summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/java/com/android/internal/app/chooser/DisplayResolveInfo.java12
-rw-r--r--core/java/com/android/internal/config/sysui/SystemUiDeviceConfigFlags.java5
-rw-r--r--core/res/res/values/config.xml2
3 files changed, 13 insertions, 6 deletions
diff --git a/core/java/com/android/internal/app/chooser/DisplayResolveInfo.java b/core/java/com/android/internal/app/chooser/DisplayResolveInfo.java
index b00148af312f..4f2e7dbebb04 100644
--- a/core/java/com/android/internal/app/chooser/DisplayResolveInfo.java
+++ b/core/java/com/android/internal/app/chooser/DisplayResolveInfo.java
@@ -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);
diff --git a/core/java/com/android/internal/config/sysui/SystemUiDeviceConfigFlags.java b/core/java/com/android/internal/config/sysui/SystemUiDeviceConfigFlags.java
index 1b3fd7bbad65..d1019c5f1613 100644
--- a/core/java/com/android/internal/config/sysui/SystemUiDeviceConfigFlags.java
+++ b/core/java/com/android/internal/config/sysui/SystemUiDeviceConfigFlags.java
@@ -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() {
}
}
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index fceb951a7923..7f68bfd622cc 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -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 -->