Loading core/java/android/content/pm/PackageManagerInternal.java +1 −0 Original line number Diff line number Diff line Loading @@ -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); Loading services/core/java/com/android/server/content/SyncManager.java +6 −1 Original line number Diff line number Diff line Loading @@ -907,9 +907,14 @@ 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 try { if (!mPackageManagerInternal.wasPackageEverLaunched(packageName, userId)) { continue; } } catch (IllegalArgumentException e) { // Package not found, race with an uninstall continue; } mAccountManagerInternal.requestAccountAccess(account.account, packageName, userId, new RemoteCallback((Bundle result) -> { Loading Loading
core/java/android/content/pm/PackageManagerInternal.java +1 −0 Original line number Diff line number Diff line Loading @@ -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); Loading
services/core/java/com/android/server/content/SyncManager.java +6 −1 Original line number Diff line number Diff line Loading @@ -907,9 +907,14 @@ 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 try { if (!mPackageManagerInternal.wasPackageEverLaunched(packageName, userId)) { continue; } } catch (IllegalArgumentException e) { // Package not found, race with an uninstall continue; } mAccountManagerInternal.requestAccountAccess(account.account, packageName, userId, new RemoteCallback((Bundle result) -> { Loading