Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c1c3988a authored by Evan Severson's avatar Evan Severson
Browse files

Do not resolve ACTION_PROCESS_TEXT

Test: Flip the flag and reboot and verify the menu doesn't populate for
        multiple apps.
Bug: 325356776
Change-Id: Ic562cf2d5be0091e49bf355af31b88cb85b99adc
parent c9301979
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -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"
}
+16 −0
Original line number Diff line number Diff line
@@ -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>();