Use default encryption password if an accessibility service is enabled.

If accessibility is on and the user selectes a secure lock we use weaker
encryption to enable running accessibility layer at the time the user
authenticates. This change adds a warning message to the enable accessibility
service dialog if there is a secure lock and also adds a warning as a
summary for the secure lock in the lock chooser activity. Both warning
mention the weaker encryption to be used.

bug:17671790

Change-Id: Ib5cc9d3a78f751e18362bb9238fd2804c3b600f8
This commit is contained in:
Svetoslav
2014-09-29 18:15:45 -07:00
committed by Svetoslav Ganov
parent fc14e272aa
commit 5244844268
4 changed files with 51 additions and 0 deletions

View File

@@ -16,6 +16,7 @@
package com.android.settings;
import android.accessibilityservice.AccessibilityServiceInfo;
import android.app.Activity;
import android.app.PendingIntent;
import android.app.admin.DevicePolicyManager;
@@ -32,6 +33,7 @@ import android.util.MutableBoolean;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.accessibility.AccessibilityManager;
import android.widget.ListView;
import com.android.internal.widget.LockPatternUtils;
@@ -213,6 +215,7 @@ public class ChooseLockGeneric extends SettingsActivity {
}
addPreferencesFromResource(R.xml.security_settings_picker);
disableUnusablePreferences(quality, allowBiometric);
updatePreferenceSummaryIfNeeded();
} else {
updateUnlockMethodAndFinish(quality, false);
}
@@ -292,6 +295,28 @@ public class ChooseLockGeneric extends SettingsActivity {
}
}
private void updatePreferenceSummaryIfNeeded() {
if (AccessibilityManager.getInstance(getActivity()).getEnabledAccessibilityServiceList(
AccessibilityServiceInfo.FEEDBACK_ALL_MASK).isEmpty()) {
return;
}
CharSequence summary = getString(R.string.secure_lock_encryption_warning);
PreferenceScreen screen = getPreferenceScreen();
final int preferenceCount = screen.getPreferenceCount();
for (int i = 0; i < preferenceCount; i++) {
Preference preference = screen.getPreference(i);
switch (preference.getKey()) {
case KEY_UNLOCK_SET_PATTERN:
case KEY_UNLOCK_SET_PIN:
case KEY_UNLOCK_SET_PASSWORD: {
preference.setSummary(summary);
} break;
}
}
}
/**
* Check whether the key is allowed for fallback (e.g. bio sensor). Returns true if it's
* supported as a backup.