summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Ben Reich <benreich@google.com> 2025-02-28 21:16:42 +1100
committer Ben Reich <benreich@google.com> 2025-02-28 21:16:42 +1100
commit009e3b3f92386e4f3a583a054683fba49355582a (patch)
tree485e1202e1b603a76cdc34128688759da020c67e
parent185a8dd97dd05df6fdcc605df7db2a69d5564c40 (diff)
Remove redirect_get_content and add read-only variant
Turns out when I added this flag initially I forgot the is_fixed_read_only property. This has inadvertently caused the AndroidManifest.xml to retain the key android:featureFlag against the TrampolineActivity. When I change it to read-only, it actually compiles the property out of the AndroidManifest and retains one or the other. Unfortunately flags which incorrectly set this property can't be updated, they have to be abandoned. So let's use redirect_get_content_ro to fix this mishap. http://ag/32017425 is rolling the existing flag back, so will submit this CL once that has landed. Bug: 377771195 Flag: com.android.documentsui.flags.redirect_get_content_ro Test: atest com.android.documentsui.picker.TrampolineActivityTest Change-Id: I4e41c0ab87ebc59272faef5351fefddbf5873654
-rw-r--r--AndroidManifest.xml10
-rw-r--r--flags.aconfig3
-rw-r--r--tests/functional/com/android/documentsui/TrampolineActivityTest.kt6
3 files changed, 10 insertions, 9 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 1fa1ac3b6..944b27471 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -63,7 +63,7 @@
android:name=".picker.TrampolineActivity"
android:exported="true"
android:theme="@android:style/Theme.NoDisplay"
- android:featureFlag="com.android.documentsui.flags.redirect_get_content"
+ android:featureFlag="com.android.documentsui.flags.redirect_get_content_ro"
android:visibleToInstantApps="true">
<intent-filter android:priority="120">
<action android:name="android.intent.action.OPEN_DOCUMENT" />
@@ -95,7 +95,7 @@
android:theme="@style/LauncherTheme"
android:visibleToInstantApps="true">
<intent-filter
- android:featureFlag="!com.android.documentsui.flags.redirect_get_content"
+ android:featureFlag="!com.android.documentsui.flags.redirect_get_content_ro"
android:priority="100">
<action android:name="android.intent.action.OPEN_DOCUMENT" />
<category android:name="android.intent.category.DEFAULT" />
@@ -103,7 +103,7 @@
<data android:mimeType="*/*" />
</intent-filter>
<intent-filter
- android:featureFlag="!com.android.documentsui.flags.redirect_get_content"
+ android:featureFlag="!com.android.documentsui.flags.redirect_get_content_ro"
android:priority="100">
<action android:name="android.intent.action.CREATE_DOCUMENT" />
<category android:name="android.intent.category.DEFAULT" />
@@ -111,7 +111,7 @@
<data android:mimeType="*/*" />
</intent-filter>
<intent-filter
- android:featureFlag="!com.android.documentsui.flags.redirect_get_content"
+ android:featureFlag="!com.android.documentsui.flags.redirect_get_content_ro"
android:priority="100">
<action android:name="android.intent.action.GET_CONTENT" />
<category android:name="android.intent.category.DEFAULT" />
@@ -119,7 +119,7 @@
<data android:mimeType="*/*" />
</intent-filter>
<intent-filter
- android:featureFlag="!com.android.documentsui.flags.redirect_get_content"
+ android:featureFlag="!com.android.documentsui.flags.redirect_get_content_ro"
android:priority="100">
<action android:name="android.intent.action.OPEN_DOCUMENT_TREE" />
<category android:name="android.intent.category.DEFAULT" />
diff --git a/flags.aconfig b/flags.aconfig
index 560d791b4..165253b1e 100644
--- a/flags.aconfig
+++ b/flags.aconfig
@@ -45,10 +45,11 @@ flag {
}
flag {
- name: "redirect_get_content"
+ name: "redirect_get_content_ro"
namespace: "documentsui"
description: "Redirects GET_CONTENT requests to Photopicker when appropriate"
bug: "377771195"
+ is_fixed_read_only: true
}
flag {
diff --git a/tests/functional/com/android/documentsui/TrampolineActivityTest.kt b/tests/functional/com/android/documentsui/TrampolineActivityTest.kt
index 76d703701..6bf0975ad 100644
--- a/tests/functional/com/android/documentsui/TrampolineActivityTest.kt
+++ b/tests/functional/com/android/documentsui/TrampolineActivityTest.kt
@@ -30,7 +30,7 @@ import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.uiautomator.By
import androidx.test.uiautomator.UiDevice
import androidx.test.uiautomator.Until
-import com.android.documentsui.flags.Flags.FLAG_REDIRECT_GET_CONTENT
+import com.android.documentsui.flags.Flags.FLAG_REDIRECT_GET_CONTENT_RO
import com.android.documentsui.picker.TrampolineActivity
import java.util.Optional
import java.util.regex.Pattern
@@ -79,7 +79,7 @@ class TrampolineActivityTest() {
}
@RunWith(Parameterized::class)
- @RequiresFlagsEnabled(FLAG_REDIRECT_GET_CONTENT)
+ @RequiresFlagsEnabled(FLAG_REDIRECT_GET_CONTENT_RO)
class ShouldLaunchCorrectPackageTest {
enum class AppType {
PHOTOPICKER,
@@ -203,7 +203,7 @@ class TrampolineActivityTest() {
}
@RunWith(AndroidJUnit4::class)
- @RequiresFlagsEnabled(FLAG_REDIRECT_GET_CONTENT)
+ @RequiresFlagsEnabled(FLAG_REDIRECT_GET_CONTENT_RO)
class RedirectTest {
@get:Rule
val checkFlagsRule: CheckFlagsRule = DeviceFlagsValueProvider.createCheckFlagsRule()