Loading core/java/android/accounts/ChooseTypeAndAccountActivity.java +1 −1 Original line number Diff line number Diff line Loading @@ -407,7 +407,7 @@ public class ChooseTypeAndAccountActivity extends Activity mExistingAccounts = AccountManager.get(this).getAccountsForPackage(mCallingPackage, mCallingUid); intent.setFlags(intent.getFlags() & ~Intent.FLAG_ACTIVITY_NEW_TASK); startActivityForResult(intent, REQUEST_ADD_ACCOUNT); startActivityForResult(new Intent(intent), REQUEST_ADD_ACCOUNT); return; } } catch (OperationCanceledException e) { Loading services/core/java/com/android/server/am/ActivityManagerService.java +18 −14 Original line number Diff line number Diff line Loading @@ -4288,20 +4288,24 @@ public class ActivityManagerService extends IActivityManager.Stub finishForceStopPackageLocked(packageName, appInfo.uid); } } if (succeeded) { final Intent intent = new Intent(Intent.ACTION_PACKAGE_DATA_CLEARED, Uri.fromParts("package", packageName, null)); Uri.fromParts("package", packageName, null /* fragment */)); intent.addFlags(Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND); intent.putExtra(Intent.EXTRA_UID, (appInfo != null) ? appInfo.uid : -1); intent.putExtra(Intent.EXTRA_UID, (appInfo != null) ? appInfo.uid : Process.INVALID_UID); intent.putExtra(Intent.EXTRA_USER_HANDLE, resolvedUserId); if (isInstantApp) { intent.putExtra(Intent.EXTRA_PACKAGE_NAME, packageName); broadcastIntentInPackage("android", null, SYSTEM_UID, uid, pid, intent, null, null, 0, null, null, permission.ACCESS_INSTANT_APPS, null, false, false, resolvedUserId, false); } else { broadcastIntentInPackage("android", null, SYSTEM_UID, uid, pid, intent, null, null, 0, null, null, null, null, false, false, resolvedUserId, false); } broadcastIntentInPackage("android", null /* featureId */, SYSTEM_UID, uid, pid, intent, null /* resolvedType */, null /* resultTo */, 0 /* resultCode */, null /* resultData */, null /* resultExtras */, isInstantApp ? permission.ACCESS_INSTANT_APPS : null, null /* bOptions */, false /* serialized */, false /* sticky */, resolvedUserId, false /* allowBackgroundActivityStarts */); } if (observer != null) { Loading services/core/java/com/android/server/notification/NotificationManagerService.java +16 −1 Original line number Diff line number Diff line Loading @@ -4523,7 +4523,16 @@ public class NotificationManagerService extends SystemService { } enforcePolicyAccess(Binder.getCallingUid(), "addAutomaticZenRule"); return mZenModeHelper.addAutomaticZenRule(pkg, automaticZenRule, // If the calling app is the system (from any user), take the package name from the // rule's owner rather than from the caller's package. String rulePkg = pkg; if (isCallingAppIdSystem()) { if (automaticZenRule.getOwner() != null) { rulePkg = automaticZenRule.getOwner().getPackageName(); } } return mZenModeHelper.addAutomaticZenRule(rulePkg, automaticZenRule, "addAutomaticZenRule"); } Loading Loading @@ -8731,6 +8740,12 @@ public class NotificationManagerService extends SystemService { return uid == Process.SYSTEM_UID; } protected boolean isCallingAppIdSystem() { final int uid = Binder.getCallingUid(); final int appid = UserHandle.getAppId(uid); return appid == Process.SYSTEM_UID; } protected boolean isUidSystemOrPhone(int uid) { final int appid = UserHandle.getAppId(uid); return (appid == Process.SYSTEM_UID || appid == Process.PHONE_UID Loading services/core/java/com/android/server/notification/ZenModeHelper.java +1 −6 Original line number Diff line number Diff line Loading @@ -305,7 +305,7 @@ public class ZenModeHelper { public String addAutomaticZenRule(String pkg, AutomaticZenRule automaticZenRule, String reason) { if (!isSystemRule(automaticZenRule)) { if (!ZenModeConfig.SYSTEM_AUTHORITY.equals(pkg)) { PackageItemInfo component = getServiceInfo(automaticZenRule.getOwner()); if (component == null) { component = getActivityInfo(automaticZenRule.getConfigurationActivity()); Loading Loading @@ -554,11 +554,6 @@ public class ZenModeHelper { } } private boolean isSystemRule(AutomaticZenRule rule) { return rule.getOwner() != null && ZenModeConfig.SYSTEM_AUTHORITY.equals(rule.getOwner().getPackageName()); } private ServiceInfo getServiceInfo(ComponentName owner) { Intent queryIntent = new Intent(); queryIntent.setComponent(owner); Loading services/core/java/com/android/server/wm/ActivityRecord.java +13 −0 Original line number Diff line number Diff line Loading @@ -673,6 +673,13 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A private AppSaturationInfo mLastAppSaturationInfo; private final ActivityRecordInputSink mActivityRecordInputSink; // Activities with this uid are allowed to not create an input sink while being in the same // task and directly above this ActivityRecord. This field is updated whenever a new activity // is launched from this ActivityRecord. Touches are always allowed within the same uid. int mAllowedTouchUid; private final ColorDisplayService.ColorTransformController mColorTransformController = (matrix, translation) -> mWmService.mH.post(() -> { synchronized (mWmService.mGlobalLock) { Loading Loading @@ -1650,6 +1657,8 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A ? (TaskDisplayArea) WindowContainer.fromBinder(daToken.asBinder()) : null; mHandoverLaunchDisplayId = options.getLaunchDisplayId(); } mActivityRecordInputSink = new ActivityRecordInputSink(this, sourceRecord); } /** Loading Loading @@ -3173,6 +3182,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A @Override void removeImmediately() { onRemovedFromDisplay(); mActivityRecordInputSink.releaseSurfaceControl(); super.removeImmediately(); } Loading Loading @@ -6048,6 +6058,9 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A } else if (!show && mLastSurfaceShowing) { getSyncTransaction().hide(mSurfaceControl); } if (show) { mActivityRecordInputSink.applyChangesToSurfaceIfChanged(getSyncTransaction()); } } if (mThumbnail != null) { mThumbnail.setShowing(getPendingTransaction(), show); Loading Loading
core/java/android/accounts/ChooseTypeAndAccountActivity.java +1 −1 Original line number Diff line number Diff line Loading @@ -407,7 +407,7 @@ public class ChooseTypeAndAccountActivity extends Activity mExistingAccounts = AccountManager.get(this).getAccountsForPackage(mCallingPackage, mCallingUid); intent.setFlags(intent.getFlags() & ~Intent.FLAG_ACTIVITY_NEW_TASK); startActivityForResult(intent, REQUEST_ADD_ACCOUNT); startActivityForResult(new Intent(intent), REQUEST_ADD_ACCOUNT); return; } } catch (OperationCanceledException e) { Loading
services/core/java/com/android/server/am/ActivityManagerService.java +18 −14 Original line number Diff line number Diff line Loading @@ -4288,20 +4288,24 @@ public class ActivityManagerService extends IActivityManager.Stub finishForceStopPackageLocked(packageName, appInfo.uid); } } if (succeeded) { final Intent intent = new Intent(Intent.ACTION_PACKAGE_DATA_CLEARED, Uri.fromParts("package", packageName, null)); Uri.fromParts("package", packageName, null /* fragment */)); intent.addFlags(Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND); intent.putExtra(Intent.EXTRA_UID, (appInfo != null) ? appInfo.uid : -1); intent.putExtra(Intent.EXTRA_UID, (appInfo != null) ? appInfo.uid : Process.INVALID_UID); intent.putExtra(Intent.EXTRA_USER_HANDLE, resolvedUserId); if (isInstantApp) { intent.putExtra(Intent.EXTRA_PACKAGE_NAME, packageName); broadcastIntentInPackage("android", null, SYSTEM_UID, uid, pid, intent, null, null, 0, null, null, permission.ACCESS_INSTANT_APPS, null, false, false, resolvedUserId, false); } else { broadcastIntentInPackage("android", null, SYSTEM_UID, uid, pid, intent, null, null, 0, null, null, null, null, false, false, resolvedUserId, false); } broadcastIntentInPackage("android", null /* featureId */, SYSTEM_UID, uid, pid, intent, null /* resolvedType */, null /* resultTo */, 0 /* resultCode */, null /* resultData */, null /* resultExtras */, isInstantApp ? permission.ACCESS_INSTANT_APPS : null, null /* bOptions */, false /* serialized */, false /* sticky */, resolvedUserId, false /* allowBackgroundActivityStarts */); } if (observer != null) { Loading
services/core/java/com/android/server/notification/NotificationManagerService.java +16 −1 Original line number Diff line number Diff line Loading @@ -4523,7 +4523,16 @@ public class NotificationManagerService extends SystemService { } enforcePolicyAccess(Binder.getCallingUid(), "addAutomaticZenRule"); return mZenModeHelper.addAutomaticZenRule(pkg, automaticZenRule, // If the calling app is the system (from any user), take the package name from the // rule's owner rather than from the caller's package. String rulePkg = pkg; if (isCallingAppIdSystem()) { if (automaticZenRule.getOwner() != null) { rulePkg = automaticZenRule.getOwner().getPackageName(); } } return mZenModeHelper.addAutomaticZenRule(rulePkg, automaticZenRule, "addAutomaticZenRule"); } Loading Loading @@ -8731,6 +8740,12 @@ public class NotificationManagerService extends SystemService { return uid == Process.SYSTEM_UID; } protected boolean isCallingAppIdSystem() { final int uid = Binder.getCallingUid(); final int appid = UserHandle.getAppId(uid); return appid == Process.SYSTEM_UID; } protected boolean isUidSystemOrPhone(int uid) { final int appid = UserHandle.getAppId(uid); return (appid == Process.SYSTEM_UID || appid == Process.PHONE_UID Loading
services/core/java/com/android/server/notification/ZenModeHelper.java +1 −6 Original line number Diff line number Diff line Loading @@ -305,7 +305,7 @@ public class ZenModeHelper { public String addAutomaticZenRule(String pkg, AutomaticZenRule automaticZenRule, String reason) { if (!isSystemRule(automaticZenRule)) { if (!ZenModeConfig.SYSTEM_AUTHORITY.equals(pkg)) { PackageItemInfo component = getServiceInfo(automaticZenRule.getOwner()); if (component == null) { component = getActivityInfo(automaticZenRule.getConfigurationActivity()); Loading Loading @@ -554,11 +554,6 @@ public class ZenModeHelper { } } private boolean isSystemRule(AutomaticZenRule rule) { return rule.getOwner() != null && ZenModeConfig.SYSTEM_AUTHORITY.equals(rule.getOwner().getPackageName()); } private ServiceInfo getServiceInfo(ComponentName owner) { Intent queryIntent = new Intent(); queryIntent.setComponent(owner); Loading
services/core/java/com/android/server/wm/ActivityRecord.java +13 −0 Original line number Diff line number Diff line Loading @@ -673,6 +673,13 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A private AppSaturationInfo mLastAppSaturationInfo; private final ActivityRecordInputSink mActivityRecordInputSink; // Activities with this uid are allowed to not create an input sink while being in the same // task and directly above this ActivityRecord. This field is updated whenever a new activity // is launched from this ActivityRecord. Touches are always allowed within the same uid. int mAllowedTouchUid; private final ColorDisplayService.ColorTransformController mColorTransformController = (matrix, translation) -> mWmService.mH.post(() -> { synchronized (mWmService.mGlobalLock) { Loading Loading @@ -1650,6 +1657,8 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A ? (TaskDisplayArea) WindowContainer.fromBinder(daToken.asBinder()) : null; mHandoverLaunchDisplayId = options.getLaunchDisplayId(); } mActivityRecordInputSink = new ActivityRecordInputSink(this, sourceRecord); } /** Loading Loading @@ -3173,6 +3182,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A @Override void removeImmediately() { onRemovedFromDisplay(); mActivityRecordInputSink.releaseSurfaceControl(); super.removeImmediately(); } Loading Loading @@ -6048,6 +6058,9 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A } else if (!show && mLastSurfaceShowing) { getSyncTransaction().hide(mSurfaceControl); } if (show) { mActivityRecordInputSink.applyChangesToSurfaceIfChanged(getSyncTransaction()); } } if (mThumbnail != null) { mThumbnail.setShowing(getPendingTransaction(), show); Loading