OSDN Git Service

Dogfood Crash Loop : Fixing crash loop by try and catch
authorDharmesh Mokani <mokani@google.com>
Thu, 11 Sep 2014 16:48:05 +0000 (09:48 -0700)
committerDharmesh Mokani <mokani@google.com>
Thu, 11 Sep 2014 16:49:40 +0000 (09:49 -0700)
Bug: 17467377
Change-Id: Idb2084339323b4953cbd6bbde2735f814fb75a76

src/com/android/launcher3/compat/PackageInstallerCompatVL.java

index 0a84280..9a0831f 100644 (file)
@@ -47,7 +47,12 @@ public class PackageInstallerCompatVL extends PackageInstallerCompat {
         mResumed = false;
         mBound = false;
 
-        mInstaller.registerSessionCallback(mCallback);
+        // STOPSHIP(mokani): Remove catch block once dogfood build is bigger than LRW70.
+        // This hack is just to prevent crash in older builds.
+        try {
+            mInstaller.registerSessionCallback(mCallback);
+        } catch (Throwable e) { }
+
         // On start, send updates for all active sessions
         for (SessionInfo info : mInstaller.getAllSessions()) {
             mPendingReplays.append(info.getSessionId(), info);
@@ -72,7 +77,11 @@ public class PackageInstallerCompatVL extends PackageInstallerCompat {
 
     @Override
     public void onStop() {
-        mInstaller.unregisterSessionCallback(mCallback);
+        // STOPSHIP(mokani): Remove catch block once dogfood build is bigger than LRW70.
+        // This hack is just to prevent crash in older builds.
+        try {
+            mInstaller.unregisterSessionCallback(mCallback);
+        } catch (Throwable e) { }
     }
 
     @Override