From 9a178365c45036cabec200395948438b91e9398a Mon Sep 17 00:00:00 2001 From: Matt Pietal Date: Tue, 9 Jun 2020 15:00:38 -0400 Subject: [PATCH] Sharesheet - Disable delegate The original plan was to move sharesheet into systemui. The first step was to route through a delegate living in systemui, which would just launch the activity. However, the full migration has not occurred. And more notably, there are intermittent race conditions caused by token expiration. This comes from the framework activity token being removed just before the target intent is launched, due to the requirement to call finish() on resolver/chooser when complete. Fixes: 157272342 Test: atest ChooserActivityTest ResolverActivityTest Change-Id: I75ca19589ba78abc1d1a05a917457c151420c949 --- .../android/internal/app/chooser/DisplayResolveInfo.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/java/com/android/internal/app/chooser/DisplayResolveInfo.java b/core/java/com/android/internal/app/chooser/DisplayResolveInfo.java index 86a9af3db1964..fe0e7d0122626 100644 --- a/core/java/com/android/internal/app/chooser/DisplayResolveInfo.java +++ b/core/java/com/android/internal/app/chooser/DisplayResolveInfo.java @@ -40,8 +40,10 @@ import java.util.List; * resolve it to an activity. */ public class DisplayResolveInfo implements TargetInfo { - // Temporary flag for new chooser delegate behavior. - private static final boolean ENABLE_CHOOSER_DELEGATE = true; + // 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 ResolveInfo mResolveInfo; private CharSequence mDisplayLabel;