diff options
| -rw-r--r-- | core/java/android/permission/flags.aconfig | 8 | ||||
| -rw-r--r-- | services/core/java/com/android/server/IntentResolver.java | 16 |
2 files changed, 24 insertions, 0 deletions
diff --git a/core/java/android/permission/flags.aconfig b/core/java/android/permission/flags.aconfig index 9218cb8f497d..de7008b19f54 100644 --- a/core/java/android/permission/flags.aconfig +++ b/core/java/android/permission/flags.aconfig @@ -130,3 +130,11 @@ flag { purpose: PURPOSE_BUGFIX } } + +flag { + name: "ignore_process_text" + namespace: "permissions" + description: "Ignore activities that handle PROCESS_TEXT in TextView" + bug: "325356776" +} + diff --git a/services/core/java/com/android/server/IntentResolver.java b/services/core/java/com/android/server/IntentResolver.java index 81c9ee790d72..4aa5ce19b9b0 100644 --- a/services/core/java/com/android/server/IntentResolver.java +++ b/services/core/java/com/android/server/IntentResolver.java @@ -16,6 +16,8 @@ package com.android.server; +import static android.permission.flags.Flags.ignoreProcessText; + import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.UserIdInt; @@ -353,6 +355,13 @@ public abstract class IntentResolver<F, R extends Object> { public List<R> queryIntentFromList(@NonNull Computer computer, Intent intent, String resolvedType, boolean defaultOnly, ArrayList<F[]> listCut, int userId, long customFlags) { + if (Intent.ACTION_PROCESS_TEXT.equals(intent.getAction()) && ignoreProcessText()) { + // This is for an experiment about deprecating PROCESS_TEXT + // Note: SettingsProvider isn't ready early in boot and ACTION_PROCESS_TEXT isn't + // queried during boot so we are checking the action before the flag. + return Collections.emptyList(); + } + ArrayList<R> resultList = new ArrayList<R>(); final boolean debug = localLOGV || @@ -377,6 +386,13 @@ public abstract class IntentResolver<F, R extends Object> { protected final List<R> queryIntent(@NonNull PackageDataSnapshot snapshot, Intent intent, String resolvedType, boolean defaultOnly, @UserIdInt int userId, long customFlags) { + if (Intent.ACTION_PROCESS_TEXT.equals(intent.getAction()) && ignoreProcessText()) { + // This is for an experiment about deprecating PROCESS_TEXT + // Note: SettingsProvider isn't ready early in boot and ACTION_PROCESS_TEXT isn't + // queried during boot so we are checking the action before the flag. + return Collections.emptyList(); + } + String scheme = intent.getScheme(); ArrayList<R> finalList = new ArrayList<R>(); |