diff options
| author | Scottie Biddle <scottieb@google.com> | 2022-03-30 11:30:20 -0700 |
|---|---|---|
| committer | Scottie Biddle <scottieb@google.com> | 2022-03-30 23:28:49 +0000 |
| commit | e30d9986f184bafcab3dbcab09ef5139db438456 (patch) | |
| tree | ee691d24a77234702f5fbd05a9b939c5933cbdfc /core/java | |
| parent | 9270d9fd53e62ffd9bcc7438aa035e3897e3a576 (diff) | |
Delete attribute useTargetActivityForQuickAccess.
In practice, the value of this xml attribute is always going to a
function of whether or not getTargetActivityPendingIntent() is null--
when a QuickAccessWalletService sends us a PendingIntent, we will use
that instead of the SystemUI card switcher activity.
If the PendingIntent is null, we then fall back to our old behavior:
* If the wallet is not currently showing any cards, launch the activity
specified by getWalletIntent() (this is hardcoded in XML metadata).
* If the wallet is currently showing cards, launch the SysUI
switcher activity.
Test: atest CtsQuickAccessWalletTestCases --retry-any-failure
Test: atest QuickAccessWalletControllerTest
Fixes: 218860062
Change-Id: I62f7ca507ebce29b03d6ce76bccaa6d736720a86
Merged-In: I4cfaa5b6035499c47a0ed8b1a4a5f3e1f0f50860
Diffstat (limited to 'core/java')
4 files changed, 11 insertions, 29 deletions
diff --git a/core/java/android/service/quickaccesswallet/QuickAccessWalletClient.java b/core/java/android/service/quickaccesswallet/QuickAccessWalletClient.java index 091bf797e24b..faa5b2fe3488 100644 --- a/core/java/android/service/quickaccesswallet/QuickAccessWalletClient.java +++ b/core/java/android/service/quickaccesswallet/QuickAccessWalletClient.java @@ -240,15 +240,4 @@ public interface QuickAccessWalletClient extends Closeable { */ @Nullable CharSequence getShortcutLongLabel(); - - /** - * Return whether the system should use the component specified by the - * {@link android:targetActivity} or - * {@link QuickAccessWalletService#getTargetActivityPendingIntent()} - * as the "quick access" , invoked directly by the system. - * If false, the system will use the built-in UI instead of the component specified - * in {@link android:targetActivity} or - * {@link QuickAccessWalletService#getTargetActivityPendingIntent()}. - */ - boolean useTargetActivityForQuickAccess(); } diff --git a/core/java/android/service/quickaccesswallet/QuickAccessWalletClientImpl.java b/core/java/android/service/quickaccesswallet/QuickAccessWalletClientImpl.java index a3304a9ca386..024660bde6fe 100644 --- a/core/java/android/service/quickaccesswallet/QuickAccessWalletClientImpl.java +++ b/core/java/android/service/quickaccesswallet/QuickAccessWalletClientImpl.java @@ -350,11 +350,6 @@ public class QuickAccessWalletClientImpl implements QuickAccessWalletClient, Ser return mServiceInfo == null ? null : mServiceInfo.getShortcutLongLabel(mContext); } - @Override - public boolean useTargetActivityForQuickAccess() { - return mServiceInfo.getUseTargetActivityForQuickAccess(); - } - private void connect() { mHandler.post(this::connectInternal); } diff --git a/core/java/android/service/quickaccesswallet/QuickAccessWalletService.java b/core/java/android/service/quickaccesswallet/QuickAccessWalletService.java index 70ccd6fbd590..d004f34bc721 100644 --- a/core/java/android/service/quickaccesswallet/QuickAccessWalletService.java +++ b/core/java/android/service/quickaccesswallet/QuickAccessWalletService.java @@ -336,6 +336,14 @@ public abstract class QuickAccessWalletService extends Service { mHandler.post(() -> sendWalletServiceEventInternal(serviceEvent)); } + /** + * Specify a {@link PendingIntent} to be launched as the "Quick Access" activity. + * + * This activity will be launched directly by the system in lieu of the card switcher activity + * provided by the system. + * + * In order to use the system-provided card switcher activity, return null from this method. + */ @Nullable public PendingIntent getTargetActivityPendingIntent() { return null; diff --git a/core/java/android/service/quickaccesswallet/QuickAccessWalletServiceInfo.java b/core/java/android/service/quickaccesswallet/QuickAccessWalletServiceInfo.java index cf4be739e05a..0d290eee5777 100644 --- a/core/java/android/service/quickaccesswallet/QuickAccessWalletServiceInfo.java +++ b/core/java/android/service/quickaccesswallet/QuickAccessWalletServiceInfo.java @@ -144,23 +144,20 @@ class QuickAccessWalletServiceInfo { private final CharSequence mShortcutShortLabel; @Nullable private final CharSequence mShortcutLongLabel; - private final boolean mUseTargetActivityForQuickAccess; private static ServiceMetadata empty() { - return new ServiceMetadata(null, null, null, null, false); + return new ServiceMetadata(null, null, null, null); } private ServiceMetadata( String targetActivity, String settingsActivity, CharSequence shortcutShortLabel, - CharSequence shortcutLongLabel, - boolean useTargetActivityForQuickAccess) { + CharSequence shortcutLongLabel) { mTargetActivity = targetActivity; mSettingsActivity = settingsActivity; mShortcutShortLabel = shortcutShortLabel; mShortcutLongLabel = shortcutLongLabel; - mUseTargetActivityForQuickAccess = useTargetActivityForQuickAccess; } } @@ -194,11 +191,8 @@ class QuickAccessWalletServiceInfo { R.styleable.QuickAccessWalletService_shortcutShortLabel); CharSequence shortcutLongLabel = afsAttributes.getText( R.styleable.QuickAccessWalletService_shortcutLongLabel); - boolean useTargetActivityForQuickAccess = afsAttributes.getBoolean( - R.styleable.QuickAccessWalletService_useTargetActivityForQuickAccess, - false); return new ServiceMetadata(targetActivity, settingsActivity, shortcutShortLabel, - shortcutLongLabel, useTargetActivityForQuickAccess); + shortcutLongLabel); } finally { if (afsAttributes != null) { afsAttributes.recycle(); @@ -277,8 +271,4 @@ class QuickAccessWalletServiceInfo { CharSequence getServiceLabel(Context context) { return mServiceInfo.loadLabel(context.getPackageManager()); } - - boolean getUseTargetActivityForQuickAccess() { - return mServiceMetadata.mUseTargetActivityForQuickAccess; - } } |
