diff options
| author | 2021-11-23 10:46:05 -0500 | |
|---|---|---|
| committer | 2021-11-23 13:34:45 -0500 | |
| commit | 0052078d76ac8491a7bde80e9997b253d3069c7c (patch) | |
| tree | 96ebd68d2749bb0a190734c8dbb92cbbb54385ca /java | |
| parent | 6538ea6be7d6406852e850bac734c508471e85b3 (diff) | |
New Chooser report AppPrediction availability
The unbundled ChooserActivity can't query the App Prediction
Service availability directly, but as of ag/16306725 the
"bundled" (system) implementation performs the query and
includes the result in the handoff to the unbundled version.
This CL overrides the query method so that the unbundled
implementation instead just reports the value of this bit.
Test: Manually confirmed service now found to be available
Change-Id: I2a5bf8e2e8c644ca82eaf7b81061ec7de2d523b6
Diffstat (limited to 'java')
| -rw-r--r-- | java/src/com/android/intentresolver/ChooserActivity.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/java/src/com/android/intentresolver/ChooserActivity.java b/java/src/com/android/intentresolver/ChooserActivity.java index 32455513..ad9fe022 100644 --- a/java/src/com/android/intentresolver/ChooserActivity.java +++ b/java/src/com/android/intentresolver/ChooserActivity.java @@ -34,10 +34,10 @@ import android.util.Log; * for notes on performing that refactoring step. */ public final class ChooserActivity extends com.android.internal.app.ChooserActivity { - private static final String TAG = "ChooserActivity"; private IBinder mPermissionToken; + private boolean mIsAppPredictionServiceAvailable; /* TODO: the first section of this file contains overrides for ChooserActivity methods that need * to be implemented differently in the delegated version. When the two classes are merged @@ -68,6 +68,11 @@ public final class ChooserActivity extends com.android.internal.app.ChooserActiv } } + @Override + public boolean isAppPredictionServiceAvailable() { + return mIsAppPredictionServiceAvailable; + } + /** * Process the intent that was used to launch the unbundled chooser, and return true if the * chooser should continue to initialize as in the full Sharesheet UI, or false if the activity @@ -76,6 +81,8 @@ public final class ChooserActivity extends com.android.internal.app.ChooserActiv private boolean processIntent() { mPermissionToken = getIntent().getExtras().getBinder( ActivityTaskManager.EXTRA_PERMISSION_TOKEN); + mIsAppPredictionServiceAvailable = getIntent().getExtras().getBoolean( + EXTRA_IS_APP_PREDICTION_SERVICE_AVAILABLE); if (mPermissionToken == null) { Log.e(TAG, "No permission token to launch activities from chooser"); |