Show private space unlocked toast when PS is unlocked from Settings

This contains the change to show private space unlocked toast message
when PS is unlocked from private space settings entry point.
Also has change in the pending intent passed to requestQuietModeEnabled
API to allow BAL of PS settings page as suggested in go/debug-bal

Recording is uploaded to the issue b/317313482

Bug: 317313482
Test: Manually verified Toast is shown on PS unlock from settings

Change-Id: I2f03b7decdad2bb9e1018012ff5986e48305a4e7
This commit is contained in:
josephpv
2024-01-11 11:56:07 +00:00
committed by Joseph Vincent
parent 87e9f512d2
commit 4d6e11ce4b
3 changed files with 24 additions and 3 deletions

View File

@@ -16,20 +16,29 @@
package com.android.settings.privatespace;
import static com.android.settings.privatespace.PrivateSpaceAuthenticationActivity.EXTRA_SHOW_PRIVATE_SPACE_UNLOCKED;
import android.app.settings.SettingsEnums;
import android.os.Bundle;
import android.util.Log;
import android.widget.Toast;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
/** Fragment representing the Private Space dashboard in Settings. */
public class PrivateSpaceDashboardFragment extends DashboardFragment {
private static final String TAG = "PrivateSpaceDashboardFragment";
private static final String TAG = "PSDashboardFragment";
@Override
public void onCreate(Bundle icicle) {
if (android.os.Flags.allowPrivateProfile()) {
super.onCreate(icicle);
if (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();
}
}
}