Loading core/java/android/app/IActivityManager.aidl +0 −1 Original line number Diff line number Diff line Loading @@ -508,7 +508,6 @@ interface IActivityManager { boolean stopBinderTrackingAndDump(in ParcelFileDescriptor fd); @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553) void suppressResizeConfigChanges(boolean suppress); boolean isAppStartModeDisabled(int uid, in String packageName); @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553) boolean unlockUser(int userid, in byte[] token, in byte[] secret, in IProgressListener listener); Loading services/core/java/com/android/server/content/SyncManager.java +9 −10 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ import android.accounts.AccountManagerInternal; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.UserIdInt; import android.app.ActivityManager; import android.app.ActivityManagerInternal; import android.app.AppGlobals; import android.app.Notification; import android.app.NotificationManager; Loading Loading @@ -323,6 +323,8 @@ public class SyncManager { private final PackageManagerInternal mPackageManagerInternal; private final ActivityManagerInternal mAmi; private List<UserInfo> getAllUsers() { return mUserManager.getUsers(); } Loading Loading @@ -643,6 +645,7 @@ public class SyncManager { mAccountManager = (AccountManager) mContext.getSystemService(Context.ACCOUNT_SERVICE); mAccountManagerInternal = LocalServices.getService(AccountManagerInternal.class); mPackageManagerInternal = LocalServices.getService(PackageManagerInternal.class); mAmi = LocalServices.getService(ActivityManagerInternal.class); mAccountManagerInternal.addOnAppPermissionChangeListener((Account account, int uid) -> { // If the UID gained access to the account kick-off syncs lacking account access Loading Loading @@ -1115,16 +1118,12 @@ public class SyncManager { } final int owningUid = syncAdapterInfo.uid; final String owningPackage = syncAdapterInfo.componentName.getPackageName(); try { if (ActivityManager.getService().isAppStartModeDisabled(owningUid, owningPackage)) { if (mAmi.isAppStartModeDisabled(owningUid, owningPackage)) { Slog.w(TAG, "Not scheduling job " + syncAdapterInfo.uid + ":" + syncAdapterInfo.componentName + " -- package not allowed to start"); return AuthorityInfo.NOT_SYNCABLE; } } catch (RemoteException e) { /* ignore - local call */ } if (checkAccountAccess && !canAccessAccount(account, owningPackage, owningUid)) { Log.w(TAG, "Access to " + logSafe(account) + " denied for package " + owningPackage + " in UID " + syncAdapterInfo.uid); Loading Loading
core/java/android/app/IActivityManager.aidl +0 −1 Original line number Diff line number Diff line Loading @@ -508,7 +508,6 @@ interface IActivityManager { boolean stopBinderTrackingAndDump(in ParcelFileDescriptor fd); @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553) void suppressResizeConfigChanges(boolean suppress); boolean isAppStartModeDisabled(int uid, in String packageName); @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553) boolean unlockUser(int userid, in byte[] token, in byte[] secret, in IProgressListener listener); Loading
services/core/java/com/android/server/content/SyncManager.java +9 −10 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ import android.accounts.AccountManagerInternal; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.UserIdInt; import android.app.ActivityManager; import android.app.ActivityManagerInternal; import android.app.AppGlobals; import android.app.Notification; import android.app.NotificationManager; Loading Loading @@ -323,6 +323,8 @@ public class SyncManager { private final PackageManagerInternal mPackageManagerInternal; private final ActivityManagerInternal mAmi; private List<UserInfo> getAllUsers() { return mUserManager.getUsers(); } Loading Loading @@ -643,6 +645,7 @@ public class SyncManager { mAccountManager = (AccountManager) mContext.getSystemService(Context.ACCOUNT_SERVICE); mAccountManagerInternal = LocalServices.getService(AccountManagerInternal.class); mPackageManagerInternal = LocalServices.getService(PackageManagerInternal.class); mAmi = LocalServices.getService(ActivityManagerInternal.class); mAccountManagerInternal.addOnAppPermissionChangeListener((Account account, int uid) -> { // If the UID gained access to the account kick-off syncs lacking account access Loading Loading @@ -1115,16 +1118,12 @@ public class SyncManager { } final int owningUid = syncAdapterInfo.uid; final String owningPackage = syncAdapterInfo.componentName.getPackageName(); try { if (ActivityManager.getService().isAppStartModeDisabled(owningUid, owningPackage)) { if (mAmi.isAppStartModeDisabled(owningUid, owningPackage)) { Slog.w(TAG, "Not scheduling job " + syncAdapterInfo.uid + ":" + syncAdapterInfo.componentName + " -- package not allowed to start"); return AuthorityInfo.NOT_SYNCABLE; } } catch (RemoteException e) { /* ignore - local call */ } if (checkAccountAccess && !canAccessAccount(account, owningPackage, owningUid)) { Log.w(TAG, "Access to " + logSafe(account) + " denied for package " + owningPackage + " in UID " + syncAdapterInfo.uid); Loading