Expose the open by default settings screen to apps

With the changes for app links v2, apps need a way to link users into
the domain selection screen if the app relies on opening web links
for some functionality.

To achieve that, this exposes the existing action,
ACTION_APP_OPEN_BY_DEFAULT_SETTINGS, from android.provider.Settings
and removes the permission needed to launch the relevant Activity,
since it's no longer required.

Note that this will also require a change to remove the enforcement
from the Activity declaration, which will be a follow up.

Bug: 178648367

Test: none, unhide API

Change-Id: I73231b9b4686ee67490ffe1526542b2f59c8089b
This commit is contained in:
Winson
2021-03-24 12:15:58 -07:00
parent 5785c5c68f
commit b5ba585b39
3 changed files with 2 additions and 7 deletions

View File

@@ -34889,6 +34889,7 @@ package android.provider {
field public static final String ACTION_APPLICATION_SETTINGS = "android.settings.APPLICATION_SETTINGS";
field public static final String ACTION_APP_NOTIFICATION_BUBBLE_SETTINGS = "android.settings.APP_NOTIFICATION_BUBBLE_SETTINGS";
field public static final String ACTION_APP_NOTIFICATION_SETTINGS = "android.settings.APP_NOTIFICATION_SETTINGS";
field public static final String ACTION_APP_OPEN_BY_DEFAULT_SETTINGS = "com.android.settings.APP_OPEN_BY_DEFAULT_SETTINGS";
field public static final String ACTION_APP_SEARCH_SETTINGS = "android.settings.APP_SEARCH_SETTINGS";
field public static final String ACTION_APP_USAGE_SETTINGS = "android.settings.action.APP_USAGE_SETTINGS";
field public static final String ACTION_AUTO_ROTATE_SETTINGS = "android.settings.AUTO_ROTATE_SETTINGS";

View File

@@ -470,8 +470,8 @@ public final class Settings {
* to be shown, with the "package" scheme. That is "package:com.my.app".
* <p>
* Output: Nothing.
* @hide
*/
@SuppressLint("ActionValue")
@SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
public static final String ACTION_APP_OPEN_BY_DEFAULT_SETTINGS =
"com.android.settings.APP_OPEN_BY_DEFAULT_SETTINGS";

View File

@@ -5411,12 +5411,6 @@
<permission android:name="android.permission.WATCH_APPOPS"
android:protectionLevel="signature|privileged" />
<!-- Allows an application to directly open the "Open by default" page inside a package's
Details screen.
@hide <p>Not for use by third-party applications. -->
<permission android:name="android.permission.OPEN_APP_OPEN_BY_DEFAULT_SETTINGS"
android:protectionLevel="signature" />
<!-- Allows hidden API checks to be disabled when starting a process.
@hide <p>Not for use by third-party applications. -->
<permission android:name="android.permission.DISABLE_HIDDEN_API_CHECKS"