Loading core/api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -6703,6 +6703,7 @@ package android.app { method public boolean areNotificationsEnabled(); method public boolean areNotificationsPaused(); method public boolean canNotifyAsPackage(@NonNull String); method public boolean canSendFullScreenIntent(); method public void cancel(int); method public void cancel(@Nullable String, int); method public void cancelAll(); core/java/android/app/NotificationManager.java +27 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import android.compat.annotation.UnsupportedAppUsage; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.PermissionChecker; import android.content.pm.ParceledListSlice; import android.content.pm.ShortcutInfo; import android.graphics.drawable.Icon; Loading Loading @@ -854,6 +855,32 @@ public class NotificationManager { } } /** * Returns whether the calling app can send fullscreen intents. * <p>From Android {@link android.os.Build.VERSION_CODES#UPSIDE_DOWN_CAKE}, apps may not have * permission to use {@link android.Manifest.permission#USE_FULL_SCREEN_INTENT}. If permission * is denied, notification will show up as an expanded heads up notification on lockscreen. * <p> To request access, add the {@link android.Manifest.permission#USE_FULL_SCREEN_INTENT} * permission to your manifest, and use * {@link android.provider.Settings#ACTION_MANAGE_APP_USE_FULL_SCREEN_INTENT}. */ public boolean canSendFullScreenIntent() { final int result = PermissionChecker.checkPermissionForPreflight(mContext, android.Manifest.permission.USE_FULL_SCREEN_INTENT, mContext.getAttributionSource()); switch (result) { case PermissionChecker.PERMISSION_GRANTED: return true; case PermissionChecker.PERMISSION_SOFT_DENIED: case PermissionChecker.PERMISSION_HARD_DENIED: return false; default: if (localLOGV) Log.v(TAG, "Unknown PermissionChecker result: " + result); return false; } } /** * Creates a group container for {@link NotificationChannel} objects. * Loading Loading
core/api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -6703,6 +6703,7 @@ package android.app { method public boolean areNotificationsEnabled(); method public boolean areNotificationsPaused(); method public boolean canNotifyAsPackage(@NonNull String); method public boolean canSendFullScreenIntent(); method public void cancel(int); method public void cancel(@Nullable String, int); method public void cancelAll();
core/java/android/app/NotificationManager.java +27 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import android.compat.annotation.UnsupportedAppUsage; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.PermissionChecker; import android.content.pm.ParceledListSlice; import android.content.pm.ShortcutInfo; import android.graphics.drawable.Icon; Loading Loading @@ -854,6 +855,32 @@ public class NotificationManager { } } /** * Returns whether the calling app can send fullscreen intents. * <p>From Android {@link android.os.Build.VERSION_CODES#UPSIDE_DOWN_CAKE}, apps may not have * permission to use {@link android.Manifest.permission#USE_FULL_SCREEN_INTENT}. If permission * is denied, notification will show up as an expanded heads up notification on lockscreen. * <p> To request access, add the {@link android.Manifest.permission#USE_FULL_SCREEN_INTENT} * permission to your manifest, and use * {@link android.provider.Settings#ACTION_MANAGE_APP_USE_FULL_SCREEN_INTENT}. */ public boolean canSendFullScreenIntent() { final int result = PermissionChecker.checkPermissionForPreflight(mContext, android.Manifest.permission.USE_FULL_SCREEN_INTENT, mContext.getAttributionSource()); switch (result) { case PermissionChecker.PERMISSION_GRANTED: return true; case PermissionChecker.PERMISSION_SOFT_DENIED: case PermissionChecker.PERMISSION_HARD_DENIED: return false; default: if (localLOGV) Log.v(TAG, "Unknown PermissionChecker result: " + result); return false; } } /** * Creates a group container for {@link NotificationChannel} objects. * Loading