Fix incorrect comparison
Bug: 10446469
Screen lock options should have been locked down when encryption is
enabled. An incorrect comparison (== instead of equals) caused it
to always bypass encryption quality check.
Change-Id: I7f3856146181a92183555f30bbc50d58bfe0c3d5
diff --git a/src/com/android/settings/ChooseLockGeneric.java b/src/com/android/settings/ChooseLockGeneric.java
index 6a34cbd..017adfa 100644
--- a/src/com/android/settings/ChooseLockGeneric.java
+++ b/src/com/android/settings/ChooseLockGeneric.java
@@ -258,7 +258,7 @@
*/
private int upgradeQualityForEncryption(int quality) {
// Don't upgrade quality for secondary users. Encryption requirements don't apply.
- if (Process.myUserHandle() != UserHandle.OWNER) return quality;
+ if (!Process.myUserHandle().equals(UserHandle.OWNER)) return quality;
int encryptionStatus = mDPM.getStorageEncryptionStatus();
boolean encrypted = (encryptionStatus == DevicePolicyManager.ENCRYPTION_STATUS_ACTIVE)
|| (encryptionStatus == DevicePolicyManager.ENCRYPTION_STATUS_ACTIVATING);