Loading services/core/java/com/android/server/notification/NotificationManagerService.java +11 −4 Original line number Original line Diff line number Diff line Loading @@ -12054,10 +12054,17 @@ public class NotificationManagerService extends SystemService { @Override @Override public void onServiceAdded(ManagedServiceInfo info) { public void onServiceAdded(ManagedServiceInfo info) { if (lifetimeExtensionRefactor()) { if (lifetimeExtensionRefactor()) { // We explicitly check the status bar permission for the uid in the info object. // Generally, only System or System UI should have the permissions to call // We can't use the calling uid here because it's probably always system server. // registerSystemService. // Note that this will also be true for the shell. // isCallerSystemOrPhone tells us whether the caller is System. We negate this, info.isSystemUi = getContext().checkPermission( // to eliminate cases where the service was added by the system. This leaves // services registered by system server. // To identify system UI, we explicitly check the status bar permission for the // uid in the info object. // We can't use the calling uid here because it belongs to system server. // Note that this will also return true for the shell, but we deem this // acceptable, for the purposes of testing. info.isSystemUi = !isCallerSystemOrPhone() && getContext().checkPermission( android.Manifest.permission.STATUS_BAR_SERVICE, -1, info.uid) android.Manifest.permission.STATUS_BAR_SERVICE, -1, info.uid) == PERMISSION_GRANTED; == PERMISSION_GRANTED; } } Loading
services/core/java/com/android/server/notification/NotificationManagerService.java +11 −4 Original line number Original line Diff line number Diff line Loading @@ -12054,10 +12054,17 @@ public class NotificationManagerService extends SystemService { @Override @Override public void onServiceAdded(ManagedServiceInfo info) { public void onServiceAdded(ManagedServiceInfo info) { if (lifetimeExtensionRefactor()) { if (lifetimeExtensionRefactor()) { // We explicitly check the status bar permission for the uid in the info object. // Generally, only System or System UI should have the permissions to call // We can't use the calling uid here because it's probably always system server. // registerSystemService. // Note that this will also be true for the shell. // isCallerSystemOrPhone tells us whether the caller is System. We negate this, info.isSystemUi = getContext().checkPermission( // to eliminate cases where the service was added by the system. This leaves // services registered by system server. // To identify system UI, we explicitly check the status bar permission for the // uid in the info object. // We can't use the calling uid here because it belongs to system server. // Note that this will also return true for the shell, but we deem this // acceptable, for the purposes of testing. info.isSystemUi = !isCallerSystemOrPhone() && getContext().checkPermission( android.Manifest.permission.STATUS_BAR_SERVICE, -1, info.uid) android.Manifest.permission.STATUS_BAR_SERVICE, -1, info.uid) == PERMISSION_GRANTED; == PERMISSION_GRANTED; } }