Merge "Banish Theme setting to developer options" into mnc-dev
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 6fd534c..d8d1736 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -1407,7 +1407,7 @@
android:theme="@style/Theme.ConfirmDeviceCredentials"/>
<activity android:name="ConfirmLockPassword"
- android:windowSoftInputMode="stateVisible|adjustResize"
+ android:windowSoftInputMode="adjustResize"
android:theme="@style/Theme.ConfirmDeviceCredentials"/>
<activity android:name=".fingerprint.FingerprintSettings" android:exported="false"/>
@@ -1424,7 +1424,7 @@
<!-- Note this must not be exported since it returns the password in the intent -->
<activity android:name="ConfirmLockPassword$InternalActivity"
android:exported="false"
- android:windowSoftInputMode="stateVisible|adjustResize"
+ android:windowSoftInputMode="adjustResize"
android:theme="@style/Theme.ConfirmDeviceCredentials"/>
<activity android:name="SetupChooseLockGeneric"
diff --git a/res/drawable/enrollment_fingerprint_isolated.xml b/res/drawable/enrollment_fingerprint_isolated.xml
index 2f1db7a..fc31ff8 100644
--- a/res/drawable/enrollment_fingerprint_isolated.xml
+++ b/res/drawable/enrollment_fingerprint_isolated.xml
@@ -30,7 +30,7 @@
<path
android:name="ridge_5_path"
android:pathData="M 24.9488677979,32.3508300781 c -1.81059265137,0.338500976562 -3.58520507812,0.447387695312 -4.62879943848,0.447387695312 c -4.12730407715,0.0 -8.05894470215,-0.96842956543 -11.5207061768,-3.45275878906 c -5.33699035645,-3.830078125 -8.56369018555,-10.0885009766 -8.56369018555,-17.1589355469"
- android:strokeColor="#10000000"
+ android:strokeColor="#19000000"
android:strokeWidth="5"
android:strokeLineCap="round"
android:trimPathEnd="0" />
@@ -40,7 +40,7 @@
<path
android:name="ridge_7_path"
android:pathData="M -9.23379516602,40.8356933594 c -3.24549865723,-3.46032714844 -5.1540222168,-5.77195739746 -7.87710571289,-10.9068603516 c -2.76379394531,-5.21166992188 -4.04838562012,-11.3482666016 -4.04838562012,-17.6915283203 c 0.0,-11.6563720703 9.44940185547,-21.1059570312 21.1058959961,-21.1059570312 c 11.6564941406,0.0 21.1058959961,9.44958496094 21.1058959961,21.1059570312"
- android:strokeColor="#10000000"
+ android:strokeColor="#19000000"
android:strokeWidth="5"
android:strokeLineCap="round"
android:trimPathEnd="0" />
@@ -50,7 +50,7 @@
<path
android:name="ridge_6_path"
android:pathData="M -28.8249053955,28.5169677734 c -2.41259765625,-6.82202148438 -2.85319519043,-12.3121337891 -2.85319519043,-16.3226318359 c 0.0,-4.64868164062 0.792999267578,-9.06323242188 2.59269714355,-13.0396728516 c 4.96929931641,-10.9801025391 16.0211029053,-18.619140625 28.857208252,-18.619140625 c 17.4846954346,0.0 31.6587982178,14.1740722656 31.6587982178,31.6588134766 c 0.0,5.82824707031 -4.72470092773,10.5529785156 -10.5529022217,10.5529785156 c -5.82820129395,0.0 -10.5529937744,-4.72473144531 -10.5529937744,-10.5529785156 c 0.0,-5.82824707031 -4.72470092773,-10.5529785156 -10.5529022217,-10.5529785156 c -5.82820129395,0.0 -10.5529022217,4.72473144531 -10.5529022217,10.5529785156 c 0.0,8.17932128906 3.10879516602,15.5925292969 8.25030517578,21.0004882812 c 3.88919067383,4.09069824219 7.77758789062,6.64123535156 14.2838897705,8.52136230469"
- android:strokeColor="#10000000"
+ android:strokeColor="#19000000"
android:strokeWidth="5"
android:strokeLineCap="round"
android:trimPathStart="1" />
@@ -60,7 +60,7 @@
<path
android:name="ridge_2_path"
android:pathData="M -34.4861907959,-11.6943359375 c 3.78790283203,-5.64636230469 8.36389160156,-9.94665527344 14.3594970703,-13.2164306641 c 5.99560546875,-3.26977539062 12.8716125488,-5.1279296875 20.1817016602,-5.1279296875 c 7.27980041504,0.0 14.129196167,1.84289550781 20.1071014404,5.08740234375 c 5.97790527344,3.24450683594 10.7957000732,7.759765625 14.5897064209,13.3666992188"
- android:strokeColor="#10000000"
+ android:strokeColor="#19000000"
android:strokeWidth="5"
android:strokeLineCap="round"
android:trimPathStart="1" />
@@ -72,7 +72,7 @@
<path
android:name="ridge_1_path"
android:pathData="M 121.472564697,107.859741211 c -7.39790344238,-4.03979492188 -15.2462921143,-6.34167480469 -24.3116912842,-6.34167480469 c -9.06539916992,0.0 -16.2951049805,2.40405273438 -23.12550354,6.34167480469"
- android:strokeColor="#10000000"
+ android:strokeColor="#19000000"
android:strokeWidth="5"
android:strokeLineCap="round"
android:trimPathEnd="0" />
diff --git a/res/layout/setup_choose_lock_pattern.xml b/res/layout/setup_choose_lock_pattern.xml
index 6ab0d47..d6bd208 100644
--- a/res/layout/setup_choose_lock_pattern.xml
+++ b/res/layout/setup_choose_lock_pattern.xml
@@ -48,6 +48,13 @@
android:minHeight="50dip"
android:textSize="18sp"/>
+ <Button android:id="@+id/retryButton"
+ style="@android:style/Widget.Material.Button.Borderless.Colored"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:text="@string/lockpattern_retry_button_text"/>
+
<com.android.internal.widget.LockPatternView android:id="@+id/lockPattern"
android:layout_width="match_parent"
android:layout_height="0dip"
@@ -56,24 +63,13 @@
</LinearLayout>
- <LinearLayout
- android:layout_width="match_parent"
+ <TextView android:id="@+id/footerText"
+ android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:gravity="center_horizontal"
- android:orientation="horizontal">
-
- <Button android:id="@+id/retryButton"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/lockpattern_retry_button_text"/>
-
- <TextView android:id="@+id/footerText"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:minHeight="50dip"
- android:textSize="14sp"/>
-
- </LinearLayout>
+ android:layout_gravity="center_horizontal"
+ android:minHeight="50dip"
+ android:textSize="14sp"
+ android:visibility="gone"/>
<!-- Buttons are hidden during setup, and use the buttons in setup navigation bar instead -->
<LinearLayout
diff --git a/res/values/strings.xml b/res/values/strings.xml
index c00d904..3a7e6ac 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -751,8 +751,8 @@
<string name="fingerprint_enable_keyguard_toggle_title">screen lock</string>
<!-- message shown for menu item that launches fingerprint settings or enrollment -->
<plurals name="security_settings_fingerprint_preference_summary">
- <item quantity="one"><xliff:g id="count">%1$d</xliff:g> fingerprint enrolled</item>
- <item quantity="other"><xliff:g id="count">%1$d</xliff:g> fingerprints enrolled</item>
+ <item quantity="one"><xliff:g id="count">%1$d</xliff:g> fingerprint set up</item>
+ <item quantity="other"><xliff:g id="count">%1$d</xliff:g> fingerprints set up</item>
</plurals>
<!-- Introduction title shown in fingerprint enrollment dialog [CHAR LIMIT=22] -->
<string name="security_settings_fingerprint_enroll_onboard_title">Fingerprint setup</string>
@@ -2926,7 +2926,7 @@
<!-- Security & location settings screen, change unlock pattern screen button, on bottom of screen. After they draw a pattern and release their finger, we display the pattern so they remember. If they are nto satisfied with this pattern, they click this button to redraw the pattern. -->
<string name="lockpattern_restart_button_text">Redraw</string>
<!-- Security & location settings screen, change unlock pattern screen button, on bottom of screen. If they are supposed to enter their current pattern before being able to draw another one, and they screw up, they hit this button to try again -->
- <string name="lockpattern_retry_button_text">Retry</string>
+ <string name="lockpattern_retry_button_text">Clear</string>
<!-- Security & location settings screen, change unlock pattern screen button, on bottom of screen. Once they draw a new pattern and confirm it by drawing it again, they press this button to exit -->
<string name="lockpattern_continue_button_text">Continue</string>
<!-- Security & location settings screen, unlock screen activity title -->
diff --git a/src/com/android/settings/ConfirmLockPassword.java b/src/com/android/settings/ConfirmLockPassword.java
index c1d8adb..8ae2824 100644
--- a/src/com/android/settings/ConfirmLockPassword.java
+++ b/src/com/android/settings/ConfirmLockPassword.java
@@ -16,7 +16,6 @@
package com.android.settings;
-import android.annotation.Nullable;
import android.os.UserHandle;
import android.text.TextUtils;
import com.android.internal.logging.MetricsLogger;
@@ -24,7 +23,9 @@
import com.android.internal.widget.LockPatternUtils;
import com.android.internal.widget.TextViewInputDisabler;
+import android.app.Fragment;
import android.app.admin.DevicePolicyManager;
+import android.content.Context;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
@@ -35,11 +36,11 @@
import android.text.InputType;
import android.view.KeyEvent;
import android.view.LayoutInflater;
-import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.view.inputmethod.EditorInfo;
+import android.view.inputmethod.InputMethodManager;
import android.widget.TextView;
import android.widget.TextView.OnEditorActionListener;
@@ -61,6 +62,15 @@
return false;
}
+ @Override
+ public void onWindowFocusChanged(boolean hasFocus) {
+ super.onWindowFocusChanged(hasFocus);
+ Fragment fragment = getFragmentManager().findFragmentById(R.id.main_content);
+ if (fragment != null && fragment instanceof ConfirmLockPasswordFragment) {
+ ((ConfirmLockPasswordFragment)fragment).onWindowFocusChanged(hasFocus);
+ }
+ }
+
public static class ConfirmLockPasswordFragment extends ConfirmDeviceCredentialBaseFragment
implements OnClickListener, OnEditorActionListener {
private static final String KEY_NUM_WRONG_CONFIRM_ATTEMPTS
@@ -77,6 +87,7 @@
private int mNumWrongConfirmAttempts;
private CountDownTimer mCountdownTimer;
private boolean mIsAlpha;
+ private InputMethodManager mImm;
// required constructor for fragments
public ConfirmLockPasswordFragment() {
@@ -111,6 +122,9 @@
|| DevicePolicyManager.PASSWORD_QUALITY_ALPHANUMERIC == storedQuality
|| DevicePolicyManager.PASSWORD_QUALITY_COMPLEX == storedQuality;
+ mImm = (InputMethodManager) getActivity().getSystemService(
+ Context.INPUT_METHOD_SERVICE);
+
Intent intent = getActivity().getIntent();
if (intent != null) {
CharSequence headerMessage = intent.getCharSequenceExtra(
@@ -172,7 +186,7 @@
if (deadline != 0) {
handleAttemptLockout(deadline);
} else {
- mPasswordEntryInputDisabler.setInputEnabled(true);
+ resetState();
}
}
@@ -189,6 +203,31 @@
getActivity().finish();
}
+ private void resetState() {
+ mPasswordEntry.setEnabled(true);
+ mPasswordEntryInputDisabler.setInputEnabled(true);
+ mImm.showSoftInput(mPasswordEntry, InputMethodManager.SHOW_IMPLICIT);
+ }
+
+ public void onWindowFocusChanged(boolean hasFocus) {
+ if (!hasFocus) {
+ return;
+ }
+ // Post to let window focus logic to finish to allow soft input show/hide properly.
+ mPasswordEntry.post(new Runnable() {
+ @Override
+ public void run() {
+ if (mPasswordEntry.isEnabled()) {
+ resetState();
+ return;
+ }
+
+ mImm.hideSoftInputFromWindow(mPasswordEntry.getWindowToken(),
+ InputMethodManager.HIDE_IMPLICIT_ONLY);
+ }
+ });
+ }
+
private void handleNext() {
mPasswordEntryInputDisabler.setInputEnabled(false);
if (mPendingLockCheck != null) {
@@ -279,7 +318,7 @@
private void handleAttemptLockout(long elapsedRealtimeDeadline) {
long elapsedRealtime = SystemClock.elapsedRealtime();
- mPasswordEntryInputDisabler.setInputEnabled(false);
+ mPasswordEntry.setEnabled(false);
mCountdownTimer = new CountDownTimer(
elapsedRealtimeDeadline - elapsedRealtime,
LockPatternUtils.FAILED_ATTEMPT_COUNTDOWN_INTERVAL_MS) {
@@ -294,7 +333,7 @@
@Override
public void onFinish() {
- mPasswordEntryInputDisabler.setInputEnabled(true);
+ resetState();
mErrorTextView.setText("");
mNumWrongConfirmAttempts = 0;
}
diff --git a/src/com/android/settings/SettingsActivity.java b/src/com/android/settings/SettingsActivity.java
index c256f5c..25adef1 100644
--- a/src/com/android/settings/SettingsActivity.java
+++ b/src/com/android/settings/SettingsActivity.java
@@ -39,10 +39,7 @@
import android.nfc.NfcAdapter;
import android.os.Bundle;
import android.os.Handler;
-import android.os.INetworkManagementService;
import android.os.Message;
-import android.os.RemoteException;
-import android.os.ServiceManager;
import android.os.UserHandle;
import android.os.UserManager;
import android.preference.Preference;
@@ -1248,14 +1245,8 @@
}
} else if (id == R.id.data_usage_settings) {
// Remove data usage when kernel module not enabled
- final INetworkManagementService netManager = INetworkManagementService.Stub
- .asInterface(ServiceManager.getService(Context.NETWORKMANAGEMENT_SERVICE));
- try {
- if (!netManager.isBandwidthControlEnabled()) {
- removeTile = true;
- }
- } catch (RemoteException e) {
- // ignored
+ if (!Utils.isBandwidthControlEnabled()) {
+ removeTile = true;
}
} else if (id == R.id.battery_settings) {
// Remove battery settings when battery is not available. (e.g. TV)
diff --git a/src/com/android/settings/Utils.java b/src/com/android/settings/Utils.java
index 4ddba80..d3d515e 100644
--- a/src/com/android/settings/Utils.java
+++ b/src/com/android/settings/Utils.java
@@ -55,7 +55,9 @@
import android.os.BatteryManager;
import android.os.Bundle;
import android.os.IBinder;
+import android.os.INetworkManagementService;
import android.os.RemoteException;
+import android.os.ServiceManager;
import android.os.UserHandle;
import android.os.UserManager;
import android.os.storage.StorageManager;
@@ -1179,4 +1181,14 @@
return null;
}
}
+
+ public static boolean isBandwidthControlEnabled() {
+ final INetworkManagementService netManager = INetworkManagementService.Stub
+ .asInterface(ServiceManager.getService(Context.NETWORKMANAGEMENT_SERVICE));
+ try {
+ return netManager.isBandwidthControlEnabled();
+ } catch (RemoteException e) {
+ return false;
+ }
+ }
}
\ No newline at end of file
diff --git a/src/com/android/settings/applications/InstalledAppDetails.java b/src/com/android/settings/applications/InstalledAppDetails.java
index 4eb86a9..e625a97 100755
--- a/src/com/android/settings/applications/InstalledAppDetails.java
+++ b/src/com/android/settings/applications/InstalledAppDetails.java
@@ -226,12 +226,16 @@
setHasOptionsMenu(true);
addPreferencesFromResource(R.xml.installed_app_details);
- INetworkStatsService statsService = INetworkStatsService.Stub.asInterface(
- ServiceManager.getService(Context.NETWORK_STATS_SERVICE));
- try {
- mStatsSession = statsService.openSession();
- } catch (RemoteException e) {
- throw new RuntimeException(e);
+ if (Utils.isBandwidthControlEnabled()) {
+ INetworkStatsService statsService = INetworkStatsService.Stub.asInterface(
+ ServiceManager.getService(Context.NETWORK_STATS_SERVICE));
+ try {
+ mStatsSession = statsService.openSession();
+ } catch (RemoteException e) {
+ throw new RuntimeException(e);
+ }
+ } else {
+ removePreference(KEY_DATA);
}
mBatteryHelper = new BatteryStatsHelper(getActivity(), true);
}
@@ -249,9 +253,11 @@
}
AppItem app = new AppItem(mAppEntry.info.uid);
app.addUid(mAppEntry.info.uid);
- getLoaderManager().restartLoader(LOADER_CHART_DATA,
- ChartDataLoader.buildArgs(getTemplate(getContext()), app),
- mDataCallbacks);
+ if (mStatsSession != null) {
+ getLoaderManager().restartLoader(LOADER_CHART_DATA,
+ ChartDataLoader.buildArgs(getTemplate(getContext()), app),
+ mDataCallbacks);
+ }
new BatteryUpdater().execute();
}
@@ -282,7 +288,9 @@
mPermissionsPreference = findPreference(KEY_PERMISSION);
mPermissionsPreference.setOnPreferenceClickListener(this);
mDataPreference = findPreference(KEY_DATA);
- mDataPreference.setOnPreferenceClickListener(this);
+ if (mDataPreference != null) {
+ mDataPreference.setOnPreferenceClickListener(this);
+ }
mBatteryPreference = findPreference(KEY_BATTERY);
mBatteryPreference.setEnabled(false);
mBatteryPreference.setOnPreferenceClickListener(this);
@@ -458,7 +466,9 @@
mPm, context));
mNotificationPreference.setSummary(getNotificationSummary(mAppEntry, context,
mBackend));
- mDataPreference.setSummary(getDataSummary());
+ if (mDataPreference != null) {
+ mDataPreference.setSummary(getDataSummary());
+ }
updateBattery();
diff --git a/src/com/android/settings/applications/ManageApplications.java b/src/com/android/settings/applications/ManageApplications.java
index 124f9da..fa95427 100644
--- a/src/com/android/settings/applications/ManageApplications.java
+++ b/src/com/android/settings/applications/ManageApplications.java
@@ -27,7 +27,6 @@
import android.os.UserHandle;
import android.os.UserManager;
import android.preference.PreferenceFrameLayout;
-import android.provider.Settings;
import android.util.ArraySet;
import android.util.Log;
import android.view.LayoutInflater;
@@ -661,6 +660,8 @@
CharSequence mCurFilterPrefix;
private PackageManager mPm;
private AppFilter mOverrideFilter;
+ private boolean mHasReceivedLoadEntries;
+ private boolean mHasReceivedBridgeCallback;
private Filter mFilter = new Filter() {
@Override
@@ -753,6 +754,11 @@
}
public void rebuild(boolean eraseold) {
+ if (!mHasReceivedLoadEntries
+ && (mExtraInfoBridge == null || mHasReceivedBridgeCallback)) {
+ // Don't rebuild the list until all the app entries are loaded.
+ return;
+ }
if (DEBUG) Log.i(TAG, "Rebuilding app list...");
ApplicationsState.AppFilter filterObj;
Comparator<AppEntry> comparatorObj;
@@ -817,17 +823,8 @@
private void updateLoading() {
Utils.handleLoadingContainer(mManageApplications.mLoadingContainer,
- mManageApplications.mListContainer, mSession.getAllApps().size() != 0, false);
- }
-
- private boolean hasDisabledApps() {
- ArrayList<AppEntry> allApps = mSession.getAllApps();
- for (int i = 0; i < allApps.size(); i++) {
- if (!allApps.get(i).info.enabled) {
- return true;
- }
- }
- return false;
+ mManageApplications.mListContainer,
+ mHasReceivedLoadEntries && mSession.getAllApps().size() != 0, false);
}
ArrayList<ApplicationsState.AppEntry> applyPrefixFilter(CharSequence prefix,
@@ -852,6 +849,7 @@
@Override
public void onExtraInfoUpdated() {
+ mHasReceivedBridgeCallback = true;
rebuild(false);
}
@@ -888,7 +886,7 @@
@Override
public void onLoadEntriesCompleted() {
- // No op.
+ mHasReceivedLoadEntries = true;
}
@Override