Loading core/java/com/android/internal/app/chooser/DisplayResolveInfo.java +7 −5 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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; Loading Loading @@ -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); Loading core/java/com/android/internal/config/sysui/SystemUiDeviceConfigFlags.java +5 −0 Original line number Diff line number Diff line Loading @@ -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() { } } core/res/res/values/config.xml +1 −1 Original line number Diff line number Diff line Loading @@ -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 --> Loading Loading
core/java/com/android/internal/app/chooser/DisplayResolveInfo.java +7 −5 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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; Loading Loading @@ -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); Loading
core/java/com/android/internal/config/sysui/SystemUiDeviceConfigFlags.java +5 −0 Original line number Diff line number Diff line Loading @@ -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() { } }
core/res/res/values/config.xml +1 −1 Original line number Diff line number Diff line Loading @@ -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 --> Loading