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

Commit 69c0e81d authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "DeviceConfig flag to guard delegate chooser flow."

parents 8335f3f7 237b8372
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -30,9 +30,11 @@ import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.UserHandle;
import android.provider.DeviceConfig;

import com.android.internal.app.ResolverActivity;
import com.android.internal.app.ResolverListAdapter.ResolveInfoPresentationGetter;
import com.android.internal.config.sysui.SystemUiDeviceConfigFlags;

import java.util.ArrayList;
import java.util.Arrays;
@@ -43,10 +45,10 @@ import java.util.List;
 * resolve it to an activity.
 */
public class DisplayResolveInfo implements TargetInfo, Parcelable {
    // Temporary flag for new chooser delegate behavior. There are occassional token
    // permission errors from bouncing through the delegate. Watch out before reenabling:
    // b/157272342 is one example but this issue has been reported many times
    private static final boolean ENABLE_CHOOSER_DELEGATE = false;
    private final boolean mEnableChooserDelegate =
            DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_SYSTEMUI,
                    SystemUiDeviceConfigFlags.USE_DELEGATE_CHOOSER,
                    false);

    private final ResolveInfo mResolveInfo;
    private CharSequence mDisplayLabel;
@@ -178,7 +180,7 @@ public class DisplayResolveInfo implements TargetInfo, Parcelable {

    @Override
    public boolean startAsCaller(ResolverActivity activity, Bundle options, int userId) {
        if (ENABLE_CHOOSER_DELEGATE) {
        if (mEnableChooserDelegate) {
            return activity.startAsCallerImpl(mResolvedIntent, options, false, userId);
        } else {
            activity.startActivityAsCaller(mResolvedIntent, options, null, false, userId);
+5 −0
Original line number Diff line number Diff line
@@ -501,6 +501,11 @@ public final class SystemUiDeviceConfigFlags {
    public static final String IS_NEARBY_SHARE_FIRST_TARGET_IN_RANKED_APP =
            "is_nearby_share_first_target_in_ranked_app";

    /**
     * (boolean) Whether to enable the new unbundled "delegate chooser" implementation.
     */
    public static final String USE_DELEGATE_CHOOSER = "use_delegate_chooser";

    private SystemUiDeviceConfigFlags() {
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -2723,7 +2723,7 @@
    <!-- Name of the activity that will handle requests to the system to choose an activity for
         the purposes of resolving an intent. -->
    <string name="config_chooserActivity" translatable="false"
            >com.android.systemui/com.android.systemui.chooser.ChooserActivity</string>
            >com.android.intentresolver/.ChooserActivity</string>
    <!-- Component name of a custom ResolverActivity (Intent resolver) to be used instead of
         the default framework version. If left empty, then the framework version will be used.
         Example: com.google.android.myapp/.resolver.MyResolverActivity  -->