Loading core/java/android/provider/Settings.java +20 −16 Original line number Diff line number Diff line Loading @@ -1417,15 +1417,17 @@ public final class Settings { } /** * An app can use this method to check if it is currently allowed to draw on top of other * apps. In order to be allowed to do so, an app must first declare the * {@link android.Manifest.permission#SYSTEM_ALERT_WINDOW} permission in its manifest. If it * is currently disallowed, it can prompt the user to grant it this capability through a * management UI by sending an Intent with action * {@link android.provider.Settings#ACTION_MANAGE_OVERLAY_PERMISSION}. * * @param context A context * @return true if the calling app can draw on top of other apps, false otherwise. * Checks if the specified context can draw on top of other apps. As of API * level 23, an app cannot draw on top of other apps unless it declares the * {@link android.Manifest.permission#SYSTEM_ALERT_WINDOW} permission in its * manifest, <em>and</em> the user specifically grants the app this * capability. To prompt the user to grant this approval, the app must send an * intent with the action * {@link android.provider.Settings#ACTION_MANAGE_OVERLAY_PERMISSION}, which * causes the system to display a permission management screen. * * @param context App context. * @return true if the specified context can draw on top of other apps, false otherwise */ public static boolean canDrawOverlays(Context context) { int uid = Binder.getCallingUid(); Loading @@ -1439,7 +1441,7 @@ public final class Settings { * {@link android.Manifest.permission#CHANGE_NETWORK_STATE} or * {@link android.Manifest.permission#WRITE_SETTINGS} permission in its manifest. If it * is currently disallowed, it can prompt the user to grant it this capability through a * management UI by sending an Intent with action * management UI by sending an intent with action * {@link android.provider.Settings#ACTION_MANAGE_WRITE_SETTINGS}. * * @param context A context Loading Loading @@ -3727,14 +3729,16 @@ public final class Settings { Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS; /** * An app can use this method to check if it is currently allowed to write or modify system * settings. In order to gain write access to the system settings, an app must declare the * {@link android.Manifest.permission#WRITE_SETTINGS} permission in its manifest. If it is * currently disallowed, it can prompt the user to grant it this capability through a * management UI by sending an Intent with action * {@link android.provider.Settings#ACTION_MANAGE_WRITE_SETTINGS}. * Checks if the specified app can modify system settings. As of API * level 23, an app cannot modify system settings unless it declares the * {@link android.Manifest.permission#WRITE_SETTINGS} * permission in its manifest, <em>and</em> the user specifically grants * the app this capability. To prompt the user to grant this approval, * the app must send an intent with the action {@link * android.provider.Settings#ACTION_MANAGE_WRITE_SETTINGS}, which causes * the system to display a permission management screen. * * @param context A context * @param context App context. * @return true if the calling app can write to system settings, false otherwise */ public static boolean canWrite(Context context) { Loading core/res/AndroidManifest.xml +23 −4 Original line number Diff line number Diff line Loading @@ -1408,11 +1408,21 @@ <!-- ================================== --> <eat-comment /> <!-- Allows an application to open windows using the type <!-- Allows an app to create windows using the type {@link android.view.WindowManager.LayoutParams#TYPE_SYSTEM_ALERT}, shown on top of all other applications. Very few applications shown on top of all other apps. Very few apps should use this permission; these windows are intended for system-level interaction with the user. --> system-level interaction with the user. <p class="note"><strong>Note:</strong> If the app targets API level 23 or higher, the app user must explicitly grant this permission to the app through a permission management screen. The app requests the user's approval by sending an intent with action {@link android.provider.Settings#ACTION_MANAGE_OVERLAY_PERMISSION}. The app can check whether it has this authorization by calling {@link android.provider.Settings#canDrawOverlays Settings.canDrawOverlays()}. <p>Protection level: signature --> <permission android:name="android.permission.SYSTEM_ALERT_WINDOW" android:label="@string/permlab_systemAlertWindow" android:description="@string/permdesc_systemAlertWindow" Loading Loading @@ -1535,6 +1545,15 @@ android:protectionLevel="signature|privileged|development" /> <!-- Allows an application to read or write the system settings. <p class="note"><strong>Note:</strong> If the app targets API level 23 or higher, the app user must explicitly grant this permission to the app through a permission management screen. The app requests the user's approval by sending an intent with action {@link android.provider.Settings#ACTION_MANAGE_WRITE_SETTINGS}. The app can check whether it has this authorization by calling {@link android.provider.Settings.System#canWrite Settings.System.canWrite()}. <p>Protection level: signature --> <permission android:name="android.permission.WRITE_SETTINGS" Loading Loading
core/java/android/provider/Settings.java +20 −16 Original line number Diff line number Diff line Loading @@ -1417,15 +1417,17 @@ public final class Settings { } /** * An app can use this method to check if it is currently allowed to draw on top of other * apps. In order to be allowed to do so, an app must first declare the * {@link android.Manifest.permission#SYSTEM_ALERT_WINDOW} permission in its manifest. If it * is currently disallowed, it can prompt the user to grant it this capability through a * management UI by sending an Intent with action * {@link android.provider.Settings#ACTION_MANAGE_OVERLAY_PERMISSION}. * * @param context A context * @return true if the calling app can draw on top of other apps, false otherwise. * Checks if the specified context can draw on top of other apps. As of API * level 23, an app cannot draw on top of other apps unless it declares the * {@link android.Manifest.permission#SYSTEM_ALERT_WINDOW} permission in its * manifest, <em>and</em> the user specifically grants the app this * capability. To prompt the user to grant this approval, the app must send an * intent with the action * {@link android.provider.Settings#ACTION_MANAGE_OVERLAY_PERMISSION}, which * causes the system to display a permission management screen. * * @param context App context. * @return true if the specified context can draw on top of other apps, false otherwise */ public static boolean canDrawOverlays(Context context) { int uid = Binder.getCallingUid(); Loading @@ -1439,7 +1441,7 @@ public final class Settings { * {@link android.Manifest.permission#CHANGE_NETWORK_STATE} or * {@link android.Manifest.permission#WRITE_SETTINGS} permission in its manifest. If it * is currently disallowed, it can prompt the user to grant it this capability through a * management UI by sending an Intent with action * management UI by sending an intent with action * {@link android.provider.Settings#ACTION_MANAGE_WRITE_SETTINGS}. * * @param context A context Loading Loading @@ -3727,14 +3729,16 @@ public final class Settings { Secure.WIFI_WATCHDOG_PING_TIMEOUT_MS; /** * An app can use this method to check if it is currently allowed to write or modify system * settings. In order to gain write access to the system settings, an app must declare the * {@link android.Manifest.permission#WRITE_SETTINGS} permission in its manifest. If it is * currently disallowed, it can prompt the user to grant it this capability through a * management UI by sending an Intent with action * {@link android.provider.Settings#ACTION_MANAGE_WRITE_SETTINGS}. * Checks if the specified app can modify system settings. As of API * level 23, an app cannot modify system settings unless it declares the * {@link android.Manifest.permission#WRITE_SETTINGS} * permission in its manifest, <em>and</em> the user specifically grants * the app this capability. To prompt the user to grant this approval, * the app must send an intent with the action {@link * android.provider.Settings#ACTION_MANAGE_WRITE_SETTINGS}, which causes * the system to display a permission management screen. * * @param context A context * @param context App context. * @return true if the calling app can write to system settings, false otherwise */ public static boolean canWrite(Context context) { Loading
core/res/AndroidManifest.xml +23 −4 Original line number Diff line number Diff line Loading @@ -1408,11 +1408,21 @@ <!-- ================================== --> <eat-comment /> <!-- Allows an application to open windows using the type <!-- Allows an app to create windows using the type {@link android.view.WindowManager.LayoutParams#TYPE_SYSTEM_ALERT}, shown on top of all other applications. Very few applications shown on top of all other apps. Very few apps should use this permission; these windows are intended for system-level interaction with the user. --> system-level interaction with the user. <p class="note"><strong>Note:</strong> If the app targets API level 23 or higher, the app user must explicitly grant this permission to the app through a permission management screen. The app requests the user's approval by sending an intent with action {@link android.provider.Settings#ACTION_MANAGE_OVERLAY_PERMISSION}. The app can check whether it has this authorization by calling {@link android.provider.Settings#canDrawOverlays Settings.canDrawOverlays()}. <p>Protection level: signature --> <permission android:name="android.permission.SYSTEM_ALERT_WINDOW" android:label="@string/permlab_systemAlertWindow" android:description="@string/permdesc_systemAlertWindow" Loading Loading @@ -1535,6 +1545,15 @@ android:protectionLevel="signature|privileged|development" /> <!-- Allows an application to read or write the system settings. <p class="note"><strong>Note:</strong> If the app targets API level 23 or higher, the app user must explicitly grant this permission to the app through a permission management screen. The app requests the user's approval by sending an intent with action {@link android.provider.Settings#ACTION_MANAGE_WRITE_SETTINGS}. The app can check whether it has this authorization by calling {@link android.provider.Settings.System#canWrite Settings.System.canWrite()}. <p>Protection level: signature --> <permission android:name="android.permission.WRITE_SETTINGS" Loading