Loading api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -150,6 +150,7 @@ package android { field public static final java.lang.String UPDATE_DEVICE_STATS = "android.permission.UPDATE_DEVICE_STATS"; field public static final java.lang.String USE_BIOMETRIC = "android.permission.USE_BIOMETRIC"; field public static final deprecated java.lang.String USE_FINGERPRINT = "android.permission.USE_FINGERPRINT"; field public static final java.lang.String USE_FULL_SCREEN_INTENT = "android.permission.USE_FULL_SCREEN_INTENT"; field public static final java.lang.String USE_SIP = "android.permission.USE_SIP"; field public static final java.lang.String VIBRATE = "android.permission.VIBRATE"; field public static final java.lang.String WAKE_LOCK = "android.permission.WAKE_LOCK"; core/java/android/app/Notification.java +3 −0 Original line number Diff line number Diff line Loading @@ -3867,6 +3867,9 @@ public class Notification implements Parcelable * The system UI may choose to display a heads-up notification, instead of * launching this intent, while the user is using the device. * </p> * <p>Apps targeting {@link Build.VERSION_CODES#Q} and above will have to request * a permission ({@link android.Manifest.permission#USE_FULL_SCREEN_INTENT}) in order to * use full screen intents.</p> * * @param intent The pending intent to launch. * @param highPriority Passing true will cause this notification to be sent Loading core/res/AndroidManifest.xml +6 −0 Original line number Diff line number Diff line Loading @@ -4247,6 +4247,12 @@ <permission android:name="android.permission.SMS_FINANCIAL_TRANSACTIONS" android:protectionLevel="signature|appop" /> <!-- Required for apps targeting {@link android.os.Build.VERSION_CODES#P} that want to use {@link android.app.Notification.Builder#setFullScreenIntent notification full screen intents}. --> <permission android:name="android.permission.USE_FULL_SCREEN_INTENT" android:protectionLevel="normal" /> <!-- @SystemApi Allows requesting the framework broadcast the {@link Intent#ACTION_DEVICE_CUSTOMIZATION_READY} intent. @hide --> Loading services/core/java/com/android/server/notification/NotificationManagerService.java +28 −12 Original line number Diff line number Diff line Loading @@ -4247,18 +4247,7 @@ public class NotificationManagerService extends SystemService { // Fix the notification as best we can. try { final ApplicationInfo ai = mPackageManagerClient.getApplicationInfoAsUser( pkg, PackageManager.MATCH_DEBUG_TRIAGED_MISSING, (userId == UserHandle.USER_ALL) ? USER_SYSTEM : userId); Notification.addFieldsFromContext(ai, notification); int canColorize = mPackageManagerClient.checkPermission( android.Manifest.permission.USE_COLORIZED_NOTIFICATIONS, pkg); if (canColorize == PERMISSION_GRANTED) { notification.flags |= Notification.FLAG_CAN_COLORIZE; } else { notification.flags &= ~Notification.FLAG_CAN_COLORIZE; } fixNotification(notification, pkg, userId); } catch (NameNotFoundException e) { Slog.e(TAG, "Cannot create a context for sending app", e); Loading Loading @@ -4359,6 +4348,33 @@ public class NotificationManagerService extends SystemService { mHandler.post(new EnqueueNotificationRunnable(userId, r)); } @VisibleForTesting protected void fixNotification(Notification notification, String pkg, int userId) throws NameNotFoundException { final ApplicationInfo ai = mPackageManagerClient.getApplicationInfoAsUser( pkg, PackageManager.MATCH_DEBUG_TRIAGED_MISSING, (userId == UserHandle.USER_ALL) ? USER_SYSTEM : userId); Notification.addFieldsFromContext(ai, notification); int canColorize = mPackageManagerClient.checkPermission( android.Manifest.permission.USE_COLORIZED_NOTIFICATIONS, pkg); if (canColorize == PERMISSION_GRANTED) { notification.flags |= Notification.FLAG_CAN_COLORIZE; } else { notification.flags &= ~Notification.FLAG_CAN_COLORIZE; } if (ai.targetSdkVersion >= Build.VERSION_CODES.Q) { int fullscreenIntentPermission = mPackageManagerClient.checkPermission( android.Manifest.permission.USE_FULL_SCREEN_INTENT, pkg); if (fullscreenIntentPermission != PERMISSION_GRANTED) { notification.fullScreenIntent = null; Log.w(TAG, "Package " + pkg + ": Use of fullScreenIntent requires the USE_FULL_SCREEN_INTENT permission"); } } } private void doChannelWarningToast(CharSequence toastText) { Binder.withCleanCallingIdentity(() -> { final int defaultWarningEnabled = Build.IS_DEBUGGABLE ? 1 : 0; Loading Loading
api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -150,6 +150,7 @@ package android { field public static final java.lang.String UPDATE_DEVICE_STATS = "android.permission.UPDATE_DEVICE_STATS"; field public static final java.lang.String USE_BIOMETRIC = "android.permission.USE_BIOMETRIC"; field public static final deprecated java.lang.String USE_FINGERPRINT = "android.permission.USE_FINGERPRINT"; field public static final java.lang.String USE_FULL_SCREEN_INTENT = "android.permission.USE_FULL_SCREEN_INTENT"; field public static final java.lang.String USE_SIP = "android.permission.USE_SIP"; field public static final java.lang.String VIBRATE = "android.permission.VIBRATE"; field public static final java.lang.String WAKE_LOCK = "android.permission.WAKE_LOCK";
core/java/android/app/Notification.java +3 −0 Original line number Diff line number Diff line Loading @@ -3867,6 +3867,9 @@ public class Notification implements Parcelable * The system UI may choose to display a heads-up notification, instead of * launching this intent, while the user is using the device. * </p> * <p>Apps targeting {@link Build.VERSION_CODES#Q} and above will have to request * a permission ({@link android.Manifest.permission#USE_FULL_SCREEN_INTENT}) in order to * use full screen intents.</p> * * @param intent The pending intent to launch. * @param highPriority Passing true will cause this notification to be sent Loading
core/res/AndroidManifest.xml +6 −0 Original line number Diff line number Diff line Loading @@ -4247,6 +4247,12 @@ <permission android:name="android.permission.SMS_FINANCIAL_TRANSACTIONS" android:protectionLevel="signature|appop" /> <!-- Required for apps targeting {@link android.os.Build.VERSION_CODES#P} that want to use {@link android.app.Notification.Builder#setFullScreenIntent notification full screen intents}. --> <permission android:name="android.permission.USE_FULL_SCREEN_INTENT" android:protectionLevel="normal" /> <!-- @SystemApi Allows requesting the framework broadcast the {@link Intent#ACTION_DEVICE_CUSTOMIZATION_READY} intent. @hide --> Loading
services/core/java/com/android/server/notification/NotificationManagerService.java +28 −12 Original line number Diff line number Diff line Loading @@ -4247,18 +4247,7 @@ public class NotificationManagerService extends SystemService { // Fix the notification as best we can. try { final ApplicationInfo ai = mPackageManagerClient.getApplicationInfoAsUser( pkg, PackageManager.MATCH_DEBUG_TRIAGED_MISSING, (userId == UserHandle.USER_ALL) ? USER_SYSTEM : userId); Notification.addFieldsFromContext(ai, notification); int canColorize = mPackageManagerClient.checkPermission( android.Manifest.permission.USE_COLORIZED_NOTIFICATIONS, pkg); if (canColorize == PERMISSION_GRANTED) { notification.flags |= Notification.FLAG_CAN_COLORIZE; } else { notification.flags &= ~Notification.FLAG_CAN_COLORIZE; } fixNotification(notification, pkg, userId); } catch (NameNotFoundException e) { Slog.e(TAG, "Cannot create a context for sending app", e); Loading Loading @@ -4359,6 +4348,33 @@ public class NotificationManagerService extends SystemService { mHandler.post(new EnqueueNotificationRunnable(userId, r)); } @VisibleForTesting protected void fixNotification(Notification notification, String pkg, int userId) throws NameNotFoundException { final ApplicationInfo ai = mPackageManagerClient.getApplicationInfoAsUser( pkg, PackageManager.MATCH_DEBUG_TRIAGED_MISSING, (userId == UserHandle.USER_ALL) ? USER_SYSTEM : userId); Notification.addFieldsFromContext(ai, notification); int canColorize = mPackageManagerClient.checkPermission( android.Manifest.permission.USE_COLORIZED_NOTIFICATIONS, pkg); if (canColorize == PERMISSION_GRANTED) { notification.flags |= Notification.FLAG_CAN_COLORIZE; } else { notification.flags &= ~Notification.FLAG_CAN_COLORIZE; } if (ai.targetSdkVersion >= Build.VERSION_CODES.Q) { int fullscreenIntentPermission = mPackageManagerClient.checkPermission( android.Manifest.permission.USE_FULL_SCREEN_INTENT, pkg); if (fullscreenIntentPermission != PERMISSION_GRANTED) { notification.fullScreenIntent = null; Log.w(TAG, "Package " + pkg + ": Use of fullScreenIntent requires the USE_FULL_SCREEN_INTENT permission"); } } } private void doChannelWarningToast(CharSequence toastText) { Binder.withCleanCallingIdentity(() -> { final int defaultWarningEnabled = Build.IS_DEBUGGABLE ? 1 : 0; Loading