Merge "Fix PhysicalKeyboardFragment crash bug." into nyc-dev
diff --git a/res/drawable-nodpi/work_challenge_background.png b/res/drawable-nodpi/work_challenge_background.png
index d38668f..50f0c76 100644
--- a/res/drawable-nodpi/work_challenge_background.png
+++ b/res/drawable-nodpi/work_challenge_background.png
Binary files differ
diff --git a/res/values/ids.xml b/res/values/ids.xml
index 2fbf70b..f9334e4 100644
--- a/res/values/ids.xml
+++ b/res/values/ids.xml
@@ -18,4 +18,10 @@
-->
<resources>
<item type="id" name="preference_highlight_key" />
+
+ <item type="id" name="lock_none" />
+ <item type="id" name="lock_pin" />
+ <item type="id" name="lock_password" />
+
+ <item type="id" name="encrypt_dont_require_password" />
</resources>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 2350e55..95a7749 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -1967,10 +1967,20 @@
<string-array name="wifi_calling_mode_choices">
<item>Wi-Fi preferred</item>
<item>Cellular preferred</item>
+ <item>Wi-Fi only</item>
</string-array>
<string-array name="wifi_calling_mode_values">
<item>"2"</item>
<item>"1"</item>
+ <item>"0"</item>
+ </string-array>
+ <string-array name="wifi_calling_mode_choices_without_wifi_only">
+ <item>Wi-Fi preferred</item>
+ <item>Cellular preferred</item>
+ </string-array>
+ <string-array name="wifi_calling_mode_values_without_wifi_only">
+ <item>"2"</item>
+ <item>"1"</item>
</string-array>
<!-- Wi-Fi Calling settings. Text displayed when Wi-Fi Calling is off -->
<string name="wifi_calling_off_explanation">When Wi-Fi calling is on, your phone can route calls via Wi-Fi networks or your carrier\u2019s network, depending on your preference and which signal is stronger. Before turning on this feature, check with your carrier regarding fees and other details.</string>
@@ -3063,22 +3073,22 @@
<!-- Message to be used to explain the user that he needs to enter his pattern to continue a
particular operation. [CHAR LIMIT=70]-->
- <string name="lockpassword_confirm_your_pattern_generic">Use your device pattern to continue.</string>
+ <string name="lockpassword_confirm_your_pattern_generic">Use your device pattern to continue</string>
<!-- Message to be used to explain the user that he needs to enter his PIN to continue a
particular operation. [CHAR LIMIT=70]-->
- <string name="lockpassword_confirm_your_pin_generic">Enter your device PIN to continue.</string>
+ <string name="lockpassword_confirm_your_pin_generic">Enter your device PIN to continue</string>
<!-- Message to be used to explain the user that he needs to enter his password to continue a
particular operation. [CHAR LIMIT=70]-->
- <string name="lockpassword_confirm_your_password_generic">Enter your device password to continue.</string>
+ <string name="lockpassword_confirm_your_password_generic">Enter your device password to continue</string>
<!-- Message to be used to explain the user that he needs to enter his work pattern to continue a
particular operation. [CHAR LIMIT=70]-->
- <string name="lockpassword_confirm_your_pattern_generic_profile">Use your work pattern to continue.</string>
+ <string name="lockpassword_confirm_your_pattern_generic_profile">Use your work pattern to continue</string>
<!-- Message to be used to explain the user that he needs to enter his work PIN to continue a
particular operation. [CHAR LIMIT=70]-->
- <string name="lockpassword_confirm_your_pin_generic_profile">Enter your work PIN to continue.</string>
+ <string name="lockpassword_confirm_your_pin_generic_profile">Enter your work PIN to continue</string>
<!-- Message to be used to explain the user that he needs to enter his work password to continue a
particular operation. [CHAR LIMIT=70]-->
- <string name="lockpassword_confirm_your_password_generic_profile">Enter your work password to continue.</string>
+ <string name="lockpassword_confirm_your_password_generic_profile">Enter your work password to continue</string>
<!-- Security & location settings screen, change security method screen instruction if user
enters incorrect PIN [CHAR LIMIT=30] -->
@@ -5874,7 +5884,7 @@
<string name="zen_mode_automation_settings_title">Automatic rules</string>
<!-- Do not disturb: Title for the zen mode automation option Suggestion. [CHAR LIMIT=30] -->
- <string name="zen_mode_automation_suggestion_title">Set Do Not Disturb Schedule</string>
+ <string name="zen_mode_automation_suggestion_title">Set Do Not Disturb schedule</string>
<!-- Do not disturb: Summary for the zen mode automation option Suggestion. [CHAR LIMIT=30] -->
<string name="zen_mode_automation_suggestion_summary">Silence your device at certain times</string>
diff --git a/src/com/android/settings/ApnEditor.java b/src/com/android/settings/ApnEditor.java
index 102d6cc..3163b63 100644
--- a/src/com/android/settings/ApnEditor.java
+++ b/src/com/android/settings/ApnEditor.java
@@ -453,11 +453,7 @@
return null;
} else {
String[] values = mRes.getStringArray(R.array.mvno_type_entries);
- if (values[mvnoIndex].equals("None")) {
- mMvnoMatchData.setEnabled(false);
- } else {
- mMvnoMatchData.setEnabled(true);
- }
+ mMvnoMatchData.setEnabled(mvnoIndex != 0);
if (newValue != null && newValue.equals(oldValue) == false) {
if (values[mvnoIndex].equals("SPN")) {
mMvnoMatchData.setText(mTelephonyManager.getSimOperatorName());
diff --git a/src/com/android/settings/ChooseLockGeneric.java b/src/com/android/settings/ChooseLockGeneric.java
index bb597a6..5eb17b2 100644
--- a/src/com/android/settings/ChooseLockGeneric.java
+++ b/src/com/android/settings/ChooseLockGeneric.java
@@ -350,6 +350,11 @@
protected void addPreferences() {
addPreferencesFromResource(R.xml.security_settings_picker);
+
+ // Used for testing purposes
+ findPreference(KEY_UNLOCK_SET_NONE).setViewId(R.id.lock_none);
+ findPreference(KEY_UNLOCK_SET_PIN).setViewId(R.id.lock_pin);
+ findPreference(KEY_UNLOCK_SET_PASSWORD).setViewId(R.id.lock_password);
}
private void updatePreferenceText() {
diff --git a/src/com/android/settings/ConfirmDeviceCredentialBaseActivity.java b/src/com/android/settings/ConfirmDeviceCredentialBaseActivity.java
index e6dd5e0..c56a956 100644
--- a/src/com/android/settings/ConfirmDeviceCredentialBaseActivity.java
+++ b/src/com/android/settings/ConfirmDeviceCredentialBaseActivity.java
@@ -31,7 +31,6 @@
private boolean mDark;
private boolean mEnterAnimationPending;
private boolean mFirstTimeVisible = true;
- private final Handler mHandler = new Handler();
@Override
protected void onCreate(Bundle savedState) {
@@ -76,7 +75,6 @@
mFirstTimeVisible = false;
prepareEnterAnimation();
mEnterAnimationPending = true;
- mHandler.postDelayed(mEnterAnimationCompleteTimeoutRunnable, 1000);
}
}
@@ -92,7 +90,6 @@
public void onEnterAnimationComplete() {
super.onEnterAnimationComplete();
if (mEnterAnimationPending) {
- mHandler.removeCallbacks(mEnterAnimationCompleteTimeoutRunnable);
startEnterAnimation();
mEnterAnimationPending = false;
}
@@ -105,15 +102,4 @@
public void startEnterAnimation() {
getFragment().startEnterAnimation();
}
-
- /**
- * Workaround for a bug in window manager which results that onEnterAnimationComplete doesn't
- * get called in all cases.
- */
- private final Runnable mEnterAnimationCompleteTimeoutRunnable = new Runnable() {
- @Override
- public void run() {
- onEnterAnimationComplete();
- }
- };
}
diff --git a/src/com/android/settings/CryptKeeper.java b/src/com/android/settings/CryptKeeper.java
index 594cd38..1b37066 100644
--- a/src/com/android/settings/CryptKeeper.java
+++ b/src/com/android/settings/CryptKeeper.java
@@ -799,8 +799,6 @@
// Asynchronously throw up the IME, since there are issues with requesting it to be shown
// immediately.
if (mLockPatternView == null && !mCooldown) {
- getWindow().setSoftInputMode(
- WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
mHandler.postDelayed(new Runnable() {
@Override public void run() {
imm.showSoftInputUnchecked(0, null);
diff --git a/src/com/android/settings/EncryptionInterstitial.java b/src/com/android/settings/EncryptionInterstitial.java
index 16c5a55..89eba7c 100644
--- a/src/com/android/settings/EncryptionInterstitial.java
+++ b/src/com/android/settings/EncryptionInterstitial.java
@@ -90,6 +90,10 @@
addPreferencesFromResource(R.xml.security_settings_encryption_interstitial);
+ // Used for testing purposes
+ findPreference(KEY_ENCRYPT_DONT_REQUIRE_PASSWORD)
+ .setViewId(R.id.encrypt_dont_require_password);
+
mRequirePasswordToDecrypt = findPreference(KEY_ENCRYPT_REQUIRE_PASSWORD);
mDontRequirePasswordToDecrypt = findPreference(KEY_ENCRYPT_DONT_REQUIRE_PASSWORD);
boolean forFingerprint = getActivity().getIntent().getBooleanExtra(
diff --git a/src/com/android/settings/WifiCallingSettings.java b/src/com/android/settings/WifiCallingSettings.java
index da83cad..3602295 100644
--- a/src/com/android/settings/WifiCallingSettings.java
+++ b/src/com/android/settings/WifiCallingSettings.java
@@ -168,12 +168,20 @@
CarrierConfigManager configManager = (CarrierConfigManager)
getSystemService(Context.CARRIER_CONFIG_SERVICE);
+ boolean isWifiOnlySupported = true;
if (configManager != null) {
PersistableBundle b = configManager.getConfig();
if (b != null) {
mEditableWfcMode = b.getBoolean(CarrierConfigManager.KEY_EDITABLE_WFC_MODE_BOOL);
+ isWifiOnlySupported = b.getBoolean(
+ CarrierConfigManager.KEY_CARRIER_WFC_SUPPORTS_WIFI_ONLY_BOOL, true);
}
}
+
+ if (!isWifiOnlySupported) {
+ mButtonWfcMode.setEntries(R.array.wifi_calling_mode_choices_without_wifi_only);
+ mButtonWfcMode.setEntryValues(R.array.wifi_calling_mode_values_without_wifi_only);
+ }
}
@Override
diff --git a/src/com/android/settings/applications/AppStateNotificationBridge.java b/src/com/android/settings/applications/AppStateNotificationBridge.java
index e8db2aa..b936351 100644
--- a/src/com/android/settings/applications/AppStateNotificationBridge.java
+++ b/src/com/android/settings/applications/AppStateNotificationBridge.java
@@ -70,6 +70,9 @@
@Override
public boolean filterApp(AppEntry info) {
+ if (info == null || info.extraInfo == null) {
+ return false;
+ }
if (info.extraInfo instanceof AppRow) {
AppRow row = (AppRow) info.extraInfo;
return row.banned;
@@ -85,7 +88,7 @@
@Override
public boolean filterApp(AppEntry info) {
- if (info == null) {
+ if (info == null || info.extraInfo == null) {
return false;
}
AppRow row = (AppRow) info.extraInfo;
@@ -101,7 +104,10 @@
@Override
public boolean filterApp(AppEntry info) {
- return info.extraInfo != null && ((AppRow) info.extraInfo).appBypassDnd;
+ if (info == null || info.extraInfo == null) {
+ return false;
+ }
+ return ((AppRow) info.extraInfo).appBypassDnd;
}
};
@@ -112,7 +118,10 @@
@Override
public boolean filterApp(AppEntry info) {
- return info.extraInfo != null && ((AppRow) info.extraInfo).lockScreenSecure
+ if (info == null || info.extraInfo == null) {
+ return false;
+ }
+ return ((AppRow) info.extraInfo).lockScreenSecure
&& ((AppRow) info.extraInfo).appVisOverride == Notification.VISIBILITY_PRIVATE;
}
};
@@ -124,7 +133,10 @@
@Override
public boolean filterApp(AppEntry info) {
- return info.extraInfo != null && ((AppRow) info.extraInfo).lockScreenSecure
+ if (info == null || info.extraInfo == null) {
+ return false;
+ }
+ return ((AppRow) info.extraInfo).lockScreenSecure
&& ((AppRow) info.extraInfo).appVisOverride == Notification.VISIBILITY_SECRET;
}
};
diff --git a/src/com/android/settings/inputmethod/InputMethodAndSubtypeEnabler.java b/src/com/android/settings/inputmethod/InputMethodAndSubtypeEnabler.java
index b666318..03e97ff 100644
--- a/src/com/android/settings/inputmethod/InputMethodAndSubtypeEnabler.java
+++ b/src/com/android/settings/inputmethod/InputMethodAndSubtypeEnabler.java
@@ -121,8 +121,6 @@
@Override
public void onPause() {
super.onPause();
- // Clear all subtypes of all IMEs to make sure
- updateImplicitlyEnabledSubtypes(null /* targetImiId */, false /* check */);
InputMethodAndSubtypeUtil.saveInputMethodSubtypeList(this, getContentResolver(),
mInputMethodInfoList, mHaveHardKeyboard);
}
diff --git a/src/com/android/settings/inputmethod/InputMethodAndSubtypeUtil.java b/src/com/android/settings/inputmethod/InputMethodAndSubtypeUtil.java
index dfa1634..b79f44d 100644
--- a/src/com/android/settings/inputmethod/InputMethodAndSubtypeUtil.java
+++ b/src/com/android/settings/inputmethod/InputMethodAndSubtypeUtil.java
@@ -209,7 +209,12 @@
needsToResetSelectedSubtype = true;
subtypePrefFound = true;
}
- if (subtypePref.isChecked()) {
+ // Checking <code>subtypePref.isEnabled()</code> is insufficient to determine
+ // whether the user manually enabled this subtype or not. Implicitly-enabled
+ // subtypes are also checked just as an indicator to users. We also need to
+ // check <code>subtypePref.isEnabled()</code> so that only manually enabled
+ // subtypes can be saved here.
+ if (subtypePref.isEnabled() && subtypePref.isChecked()) {
subtypesSet.add(subtypeHashCodeStr);
if (isCurrentInputMethod) {
if (selectedInputMethodSubtype == subtype.hashCode()) {
diff --git a/src/com/android/settings/notification/ZenModePrioritySettings.java b/src/com/android/settings/notification/ZenModePrioritySettings.java
index 61bf7fc..a61be96 100644
--- a/src/com/android/settings/notification/ZenModePrioritySettings.java
+++ b/src/com/android/settings/notification/ZenModePrioritySettings.java
@@ -175,7 +175,7 @@
mEvents.setChecked(isPriorityCategoryEnabled(Policy.PRIORITY_CATEGORY_EVENTS));
mRepeatCallers.setChecked(
isPriorityCategoryEnabled(Policy.PRIORITY_CATEGORY_REPEAT_CALLERS));
- mRepeatCallers.setEnabled(!isPriorityCategoryEnabled(Policy.PRIORITY_CATEGORY_CALLS)
+ mRepeatCallers.setVisible(!isPriorityCategoryEnabled(Policy.PRIORITY_CATEGORY_CALLS)
|| mPolicy.priorityCallSenders != Policy.PRIORITY_SENDERS_ANY);
mDisableListeners = false;
}