aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2024-01-10 19:01:39 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2024-01-10 19:01:39 +0000
commit1ae064849d6f59a18cc90fc8c32c8c0bdd8e814a (patch)
treef4cf25438f6ba47f6477d504adee1f20c64baaec
parent3774fc3105e635e0745a884fc7a9a07e05c5d6d8 (diff)
parent3652dd120f3b112e190f2cd2deb0752dfefde245 (diff)
downloadIntentResolver-aml_tz5_341510010.tar.gz
Snap for 11296156 from 3652dd120f3b112e190f2cd2deb0752dfefde245 to mainline-tzdata5-releaseaml_tz5_341510070aml_tz5_341510050aml_tz5_341510010aml_tz5_341510010
Change-Id: I0d6c1147b641771091a55fcb857dbbbaa408e21d
-rw-r--r--AndroidManifest.xml33
-rw-r--r--java/src/com/android/intentresolver/ChooserActivityReEnabler.kt39
2 files changed, 16 insertions, 56 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index da781a2..17a3534 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -36,7 +36,6 @@
<uses-permission android:name="android.permission.START_ACTIVITY_AS_CALLER" />
<uses-permission android:name="android.permission.UNLIMITED_SHORTCUTS_API_CALLS" />
<uses-permission android:name="android.permission.QUERY_CLONED_APPS" />
- <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<application
android:hardwareAccelerated="true"
@@ -46,15 +45,12 @@
android:requiredForAllUsers="true"
android:supportsRtl="true">
- <activity android:name=".ChooserActivity"
- android:theme="@style/Theme.DeviceDefault.Chooser"
- android:finishOnCloseSystemDialogs="true"
- android:excludeFromRecents="true"
- android:documentLaunchMode="never"
- android:relinquishTaskIdentity="true"
- android:configChanges="screenSize|smallestScreenSize|screenLayout|keyboard|keyboardHidden"
- android:visibleToInstantApps="true"
- android:exported="true">
+ <!-- This alias needs to be maintained until there are no more devices that could be
+ upgrading from T QPR3. (b/283722356) -->
+ <activity-alias
+ android:name=".ChooserActivityLauncher"
+ android:targetActivity=".ChooserActivity"
+ android:exported="true">
<!-- This intent filter is assigned a priority greater than 100 so
that it will take precedence over the framework ChooserActivity
@@ -65,14 +61,17 @@
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.VOICE" />
</intent-filter>
- </activity>
+ </activity-alias>
- <receiver android:name=".ChooserActivityReEnabler"
- android:exported="true">
- <intent-filter>
- <action android:name="android.intent.action.BOOT_COMPLETED" />
- </intent-filter>
- </receiver>
+ <activity android:name=".ChooserActivity"
+ android:theme="@style/Theme.DeviceDefault.Chooser"
+ android:finishOnCloseSystemDialogs="true"
+ android:excludeFromRecents="true"
+ android:documentLaunchMode="never"
+ android:relinquishTaskIdentity="true"
+ android:configChanges="screenSize|smallestScreenSize|screenLayout|keyboard|keyboardHidden"
+ android:visibleToInstantApps="true"
+ android:exported="false"/>
</application>
diff --git a/java/src/com/android/intentresolver/ChooserActivityReEnabler.kt b/java/src/com/android/intentresolver/ChooserActivityReEnabler.kt
deleted file mode 100644
index 3236c1b..0000000
--- a/java/src/com/android/intentresolver/ChooserActivityReEnabler.kt
+++ /dev/null
@@ -1,39 +0,0 @@
-package com.android.intentresolver
-
-import android.content.BroadcastReceiver
-import android.content.ComponentName
-import android.content.Context
-import android.content.Intent
-import android.content.pm.PackageManager
-
-/**
- * Ensures that the unbundled version of [ChooserActivity] does not get stuck in a disabled state.
- */
-class ChooserActivityReEnabler : BroadcastReceiver() {
-
- override fun onReceive(context: Context, intent: Intent) {
- if (intent.action == Intent.ACTION_BOOT_COMPLETED) {
- context.packageManager.setComponentEnabledSetting(
- CHOOSER_COMPONENT,
- PackageManager.COMPONENT_ENABLED_STATE_DEFAULT,
- /* flags = */ 0,
- )
-
- // This only needs to be run once, so we disable ourself to avoid additional startup
- // process on future boots
- context.packageManager.setComponentEnabledSetting(
- SELF_COMPONENT,
- PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
- /* flags = */ 0,
- )
- }
- }
-
- companion object {
- private const val CHOOSER_PACKAGE = "com.android.intentresolver"
- private val CHOOSER_COMPONENT =
- ComponentName(CHOOSER_PACKAGE, "$CHOOSER_PACKAGE.ChooserActivity")
- private val SELF_COMPONENT =
- ComponentName(CHOOSER_PACKAGE, "$CHOOSER_PACKAGE.ChooserActivityReEnabler")
- }
-}