summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authord34d <clark@cyngn.com>2016-02-01 10:06:29 -0800
committerGerrit Code Review <gerrit@cyanogenmod.org>2016-02-02 14:41:06 -0800
commit2c021b1863ce69d689a586050ac61338dc742853 (patch)
treed66afc17ad0dfb6271dd13db8516fa7ad9189769 /src/com
parent946b1e21c0fe3d83dc5fd68552a9ab5c0c3603e1 (diff)
downloadpackages_apps_Settings-2c021b1863ce69d689a586050ac61338dc742853.zip
packages_apps_Settings-2c021b1863ce69d689a586050ac61338dc742853.tar.gz
packages_apps_Settings-2c021b1863ce69d689a586050ac61338dc742853.tar.bz2
Lockscreen: Show redaction interstitial when swipe selected
If the user is switching from a secure lock screen to an insecure one and they have chosen to redact sensitive/all notififcations, show the RedactionInterstitial so the user has the option to change this setting. Change-Id: I2bcfd01fb322eb66a10a0f29feb9da696c524cdf TICKET: YAM-103
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/settings/ChooseLockGeneric.java20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/com/android/settings/ChooseLockGeneric.java b/src/com/android/settings/ChooseLockGeneric.java
index 7f5960f..502b9fd 100644
--- a/src/com/android/settings/ChooseLockGeneric.java
+++ b/src/com/android/settings/ChooseLockGeneric.java
@@ -32,6 +32,7 @@ import android.os.Process;
import android.os.UserHandle;
import android.preference.Preference;
import android.preference.PreferenceScreen;
+import android.provider.Settings;
import android.security.KeyStore;
import android.hardware.fingerprint.Fingerprint;
import android.hardware.fingerprint.FingerprintManager;
@@ -46,6 +47,7 @@ import android.widget.Toast;
import com.android.internal.logging.MetricsLogger;
import com.android.internal.widget.LockPatternUtils;
+import com.android.settings.notification.RedactionInterstitial;
public class ChooseLockGeneric extends SettingsActivity {
public static final String CONFIRM_CREDENTIALS = "confirm_credentials";
@@ -470,7 +472,6 @@ public class ChooseLockGeneric extends SettingsActivity {
if (!mPasswordConfirmed) {
throw new IllegalStateException("Tried to update password without confirming it");
}
-
quality = upgradeQuality(quality);
final Context context = getActivity();
@@ -503,6 +504,7 @@ public class ChooseLockGeneric extends SettingsActivity {
mChooseLockSettingsHelper.utils().clearLock(UserHandle.myUserId());
mChooseLockSettingsHelper.utils().setLockScreenDisabled(disabled,
UserHandle.myUserId());
+ maybeShowRedactionInterstitial();
removeAllFingerprintTemplatesAndFinish();
getActivity().setResult(Activity.RESULT_OK);
} else {
@@ -519,6 +521,22 @@ public class ChooseLockGeneric extends SettingsActivity {
}
}
+ private void maybeShowRedactionInterstitial() {
+ // do nothing if lock screen disabled
+ if (mLockPatternUtils.isLockScreenDisabled(UserHandle.myUserId())) return;
+
+ final boolean enabled = Settings.Secure.getInt(getContentResolver(),
+ Settings.Secure.LOCK_SCREEN_SHOW_NOTIFICATIONS, 0) != 0;
+ final boolean show = Settings.Secure.getInt(getContentResolver(),
+ Settings.Secure.LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS, 1) != 0;
+ if (!(enabled && show)) {
+ Intent intent = RedactionInterstitial.createStartIntent(getContext());
+ if (intent != null) {
+ startActivity(intent);
+ }
+ }
+ }
+
@Override
public void onDestroy() {
super.onDestroy();