Fix job scheduler crash due to uninstall race am: 652c5ad516 am: 1131f280ae

am: fe83435089

Change-Id: I1701b56c57ac5ac120ab15d7afd70726b783fa53
This commit is contained in:
Christopher Tate
2016-10-08 18:52:28 +00:00
committed by android-build-merger

View File

@@ -428,7 +428,18 @@ public final class JobSchedulerService extends com.android.server.SystemService
}
cancelJobsForUid(pkgUid, true);
}
} catch (RemoteException e) { /* cannot happen */ }
} catch (RemoteException|IllegalArgumentException e) {
/*
* IllegalArgumentException means that the package doesn't exist.
* This arises when PACKAGE_CHANGED broadcast delivery has lagged
* behind outright uninstall, so by the time we try to act it's gone.
* We don't need to act on this PACKAGE_CHANGED when this happens;
* we'll get a PACKAGE_REMOVED later and clean up then.
*
* RemoteException can't actually happen; the package manager is
* running in this same process.
*/
}
break;
}
}