From 1e6e14c2c5325220ad1b9329a67705b192be963a Mon Sep 17 00:00:00 2001 From: josephpv Date: Thu, 8 Feb 2024 19:59:28 +0000 Subject: [PATCH] Add check to not show PS unlock message when activity is recreated The condition added with this change makes sure the toast message is shown only once and to not show duplicate toast evertime the activity is recreated on screen rotation. Recording link : b/324442522#comment2 Bug: 324442522 Test: Manual Change-Id: I4e17384c1d02deacdd911195f014b0c8f1eb8833 --- .../settings/privatespace/PrivateSpaceDashboardFragment.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/com/android/settings/privatespace/PrivateSpaceDashboardFragment.java b/src/com/android/settings/privatespace/PrivateSpaceDashboardFragment.java index e4264778dcc..726567e08de 100644 --- a/src/com/android/settings/privatespace/PrivateSpaceDashboardFragment.java +++ b/src/com/android/settings/privatespace/PrivateSpaceDashboardFragment.java @@ -34,7 +34,8 @@ public class PrivateSpaceDashboardFragment extends DashboardFragment { public void onCreate(Bundle icicle) { if (android.os.Flags.allowPrivateProfile()) { super.onCreate(icicle); - if (getIntent().getBooleanExtra(EXTRA_SHOW_PRIVATE_SPACE_UNLOCKED, false)) { + if (icicle == null + && getIntent().getBooleanExtra(EXTRA_SHOW_PRIVATE_SPACE_UNLOCKED, false)) { Log.i(TAG, "Private space unlocked showing toast"); Toast.makeText(getContext(), R.string.private_space_unlocked, Toast.LENGTH_SHORT) .show();