From dbc335b1c14419f7c225a56bc1b6b824c0c7abec Mon Sep 17 00:00:00 2001 From: Silin Huang Date: Fri, 14 May 2021 10:26:22 -0700 Subject: [PATCH] Intent to LockscreenSettings page on wallet overflow menu clicked. see demo: https://drive.google.com/file/d/1qO2b5hS3tE8KQt1PtJBIeEJ8r_ti8PWw/view?usp=sharing&resourcekey=0-zZhi6fNdZGnveawEh3fxRA Test: manual Bug: 186496392 Change-Id: Id68faf3e2746f66e6633d5a25e64de3f0833d3ef --- core/java/android/provider/Settings.java | 15 +++++++++++++++ .../systemui/wallet/ui/WalletActivity.java | 8 +++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index e410e50cfe397..b46962e6a266e 100644 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -889,6 +889,21 @@ public final class Settings { public static final String ACTION_LOCALE_SETTINGS = "android.settings.LOCALE_SETTINGS"; + /** + * Activity Action: Show settings to allow configuration of lockscreen. + *

+ * In some cases, a matching Activity may not exist, so ensure you + * safeguard against this. + *

+ * Input: Nothing. + *

+ * Output: Nothing. + * + * @hide + */ + @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) + public static final String ACTION_LOCKSCREEN_SETTINGS = "android.settings.LOCK_SCREEN_SETTINGS"; + /** * Activity Action: Show settings to configure input methods, in particular * allowing the user to enable input methods. diff --git a/packages/SystemUI/src/com/android/systemui/wallet/ui/WalletActivity.java b/packages/SystemUI/src/com/android/systemui/wallet/ui/WalletActivity.java index 4cba432a66bec..83aa01f8d3931 100644 --- a/packages/SystemUI/src/com/android/systemui/wallet/ui/WalletActivity.java +++ b/packages/SystemUI/src/com/android/systemui/wallet/ui/WalletActivity.java @@ -16,6 +16,9 @@ package com.android.systemui.wallet.ui; +import static android.provider.Settings.ACTION_LOCKSCREEN_SETTINGS; + +import android.content.Intent; import android.graphics.Color; import android.graphics.drawable.Drawable; import android.os.Bundle; @@ -178,7 +181,10 @@ public class WalletActivity extends LifecycleActivity { finish(); return true; } else if (itemId == R.id.wallet_lockscreen_settings) { - // TODO(b/186496392): Navigate to Lock Screen Settings page when the item is clicked. + Intent intent = + new Intent(ACTION_LOCKSCREEN_SETTINGS) + .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP); + mActivityStarter.startActivity(intent, true); return true; } return super.onOptionsItemSelected(item);