Merge "Catch IllegalArgumentException to avoid SyncManager crash" into oc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
fbd2c21f18
@@ -172,6 +172,7 @@ public abstract class PackageManagerInternal {
|
||||
* @param packageName The package name.
|
||||
* @param userId The user for which to check.
|
||||
* @return Whether was launched.
|
||||
* @throws IllegalArgumentException if the package is not found
|
||||
*/
|
||||
public abstract boolean wasPackageEverLaunched(String packageName, int userId);
|
||||
|
||||
|
||||
@@ -907,7 +907,12 @@ public class SyncManager {
|
||||
Bundle finalExtras = new Bundle(extras);
|
||||
String packageName = syncAdapterInfo.componentName.getPackageName();
|
||||
// If the app did not run and has no account access, done
|
||||
if (!mPackageManagerInternal.wasPackageEverLaunched(packageName, userId)) {
|
||||
try {
|
||||
if (!mPackageManagerInternal.wasPackageEverLaunched(packageName, userId)) {
|
||||
continue;
|
||||
}
|
||||
} catch (IllegalArgumentException e) {
|
||||
// Package not found, race with an uninstall
|
||||
continue;
|
||||
}
|
||||
mAccountManagerInternal.requestAccountAccess(account.account,
|
||||
|
||||
Reference in New Issue
Block a user