Merge "Update suggestion/support UI to use more negative space." into nyc-mr1-dev
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 65f72d0..1d72424 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -154,7 +154,7 @@
</intent-filter>
</activity>
- <receiver android:name="ManagedProfileSetup">
+ <receiver android:name="SettingsInitialize">
<intent-filter>
<action android:name="android.intent.action.USER_INITIALIZE"/>
<action android:name="android.intent.action.PRE_BOOT_COMPLETED"/>
diff --git a/res/layout/setup_choose_lock_pattern_common.xml b/res/layout/setup_choose_lock_pattern_common.xml
index 7e59bbf..20e46f3 100644
--- a/res/layout/setup_choose_lock_pattern_common.xml
+++ b/res/layout/setup_choose_lock_pattern_common.xml
@@ -41,17 +41,16 @@
<TextView android:id="@+id/headerText"
android:layout_width="match_parent"
- android:layout_height="0dip"
+ android:layout_height="wrap_content"
android:layout_weight="1"
+ android:minLines="2"
android:gravity="center"
- android:minHeight="50dip"
- android:textSize="18sp"/>
+ android:textSize="18sp" />
<com.android.internal.widget.LockPatternView android:id="@+id/lockPattern"
android:layout_width="match_parent"
android:layout_height="0dip"
- android:layout_weight="4"
- android:background="@color/lock_pattern_background"/>
+ android:layout_weight="4" />
<!-- Buttons are hidden during setup, and use the buttons in setup navigation bar instead -->
<LinearLayout
diff --git a/res/layout/wifi_dialog.xml b/res/layout/wifi_dialog.xml
index 44523f4..ceb7201 100644
--- a/res/layout/wifi_dialog.xml
+++ b/res/layout/wifi_dialog.xml
@@ -15,9 +15,10 @@
-->
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:fadeScrollbars="false">
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:fadeScrollbars="false"
+ android:scrollIndicators="top|bottom">
<LinearLayout
android:layout_width="match_parent"
@@ -71,7 +72,7 @@
<Spinner android:id="@+id/security"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- style="@style/wifi_item_content"
+ style="@style/wifi_item_spinner"
android:prompt="@string/wifi_security"
android:entries="@array/wifi_security" />
</LinearLayout>
@@ -103,7 +104,7 @@
<Spinner android:id="@+id/method"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- style="@style/wifi_item_content"
+ style="@style/wifi_item_spinner"
android:prompt="@string/wifi_eap_method"
android:entries="@array/wifi_eap_method" />
</LinearLayout>
@@ -122,7 +123,7 @@
<Spinner android:id="@+id/phase2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- style="@style/wifi_item_content"
+ style="@style/wifi_item_spinner"
android:prompt="@string/please_select_phase2"
android:entries="@array/wifi_phase2_entries" />
</LinearLayout>
@@ -141,7 +142,7 @@
<Spinner android:id="@+id/ca_cert"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- style="@style/wifi_item_content"
+ style="@style/wifi_item_spinner"
android:prompt="@string/wifi_eap_ca_cert" />
</LinearLayout>
@@ -201,7 +202,7 @@
<Spinner android:id="@+id/user_cert"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- style="@style/wifi_item_content"
+ style="@style/wifi_item_spinner"
android:prompt="@string/wifi_eap_user_cert" />
</LinearLayout>
@@ -285,6 +286,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/wifi_item"
+ android:paddingBottom="4dp"
android:visibility="gone">
<CheckBox android:id="@+id/wifi_advanced_togglebox"
android:layout_width="match_parent"
@@ -314,7 +316,7 @@
<Spinner android:id="@+id/proxy_settings"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- style="@style/wifi_item_content"
+ style="@style/wifi_item_spinner"
android:prompt="@string/proxy_settings_title"
android:entries="@array/wifi_proxy_settings" />
@@ -439,7 +441,7 @@
<Spinner android:id="@+id/ip_settings"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- style="@style/wifi_item_content"
+ style="@style/wifi_item_spinner"
android:prompt="@string/wifi_ip_settings"
android:entries="@array/wifi_ip_settings" />
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 4835a14..24d7905 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -228,6 +228,10 @@
<item name="android:textColor">?android:attr/textColorPrimary</item>
</style>
+ <style name="wifi_item_spinner" parent="wifi_item_content">
+ <item name="android:minHeight">48dp</item>
+ </style>
+
<style name="wifi_advanced_toggle" parent="wifi_item_content">
<item name="android:background">@null</item>
<item name="android:button">@null</item>
diff --git a/src/com/android/settings/CryptKeeper.java b/src/com/android/settings/CryptKeeper.java
index 594cd38..4214343 100644
--- a/src/com/android/settings/CryptKeeper.java
+++ b/src/com/android/settings/CryptKeeper.java
@@ -341,7 +341,6 @@
final private static int sWidgetsToDisable = StatusBarManager.DISABLE_EXPAND
| StatusBarManager.DISABLE_NOTIFICATION_ICONS
| StatusBarManager.DISABLE_NOTIFICATION_ALERTS
- | StatusBarManager.DISABLE_SYSTEM_INFO
| StatusBarManager.DISABLE_HOME
| StatusBarManager.DISABLE_SEARCH
| StatusBarManager.DISABLE_RECENT;
diff --git a/src/com/android/settings/SecuritySettings.java b/src/com/android/settings/SecuritySettings.java
index 72dacd5..d96f459 100644
--- a/src/com/android/settings/SecuritySettings.java
+++ b/src/com/android/settings/SecuritySettings.java
@@ -1213,6 +1213,7 @@
} catch (NumberFormatException e) {
Log.e("SecuritySettings", "could not persist lockAfter timeout setting", e);
}
+ setupLockAfterPreference();
updateLockAfterPreferenceSummary();
} else if (KEY_VISIBLE_PATTERN.equals(key)) {
mLockPatternUtils.setVisiblePatternEnabled((Boolean) value, MY_USER_ID);
diff --git a/src/com/android/settings/ManagedProfileSetup.java b/src/com/android/settings/SettingsInitialize.java
similarity index 78%
rename from src/com/android/settings/ManagedProfileSetup.java
rename to src/com/android/settings/SettingsInitialize.java
index ac012b0..07fec07 100644
--- a/src/com/android/settings/ManagedProfileSetup.java
+++ b/src/com/android/settings/SettingsInitialize.java
@@ -36,10 +36,11 @@
/**
* Listens to {@link Intent.ACTION_BOOT_COMPLETED} and {@link Intent.ACTION_PRE_BOOT_COMPLETED}
- * performs setup steps for a managed profile (disables the launcher icon of the Settings app and
- * adds cross-profile intent filters for the appropriate Settings activities).
+ * performs setup steps for a managed profile (disables the launcher icon of the Settings app,
+ * adds cross-profile intent filters for the appropriate Settings activities), and disables the
+ * webview setting for non-admin users.
*/
-public class ManagedProfileSetup extends BroadcastReceiver {
+public class SettingsInitialize extends BroadcastReceiver {
private static final String TAG = "Settings";
private static final String PRIMARY_PROFILE_SETTING =
"com.android.settings.PRIMARY_PROFILE_CONTROLLED";
@@ -48,12 +49,18 @@
public void onReceive(Context context, Intent broadcast) {
final UserManager um = (UserManager) context.getSystemService(Context.USER_SERVICE);
UserInfo userInfo = um.getUserInfo(UserHandle.myUserId());
+ final PackageManager pm = context.getPackageManager();
+ managedProfileSetup(context, pm, broadcast, userInfo);
+ webviewSettingSetup(context, pm, userInfo);
+ }
+
+ private void managedProfileSetup(Context context, final PackageManager pm, Intent broadcast,
+ UserInfo userInfo) {
if (userInfo == null || !userInfo.isManagedProfile()) {
return;
}
Log.i(TAG, "Received broadcast: " + broadcast.getAction()
+ ". Setting up intent forwarding for managed profile.");
- final PackageManager pm = context.getPackageManager();
// Clear any previous intent forwarding we set up
pm.clearCrossProfileIntentFilters(userInfo.id);
@@ -86,4 +93,18 @@
pm.setComponentEnabledSetting(settingsComponentName,
PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);
}
+
+ // Disable WebView Setting if the current user is not an admin
+ private void webviewSettingSetup(Context context, PackageManager pm, UserInfo userInfo) {
+ if (userInfo == null) {
+ return;
+ }
+ ComponentName settingsComponentName =
+ new ComponentName(context, WebViewImplementation.class);
+ pm.setComponentEnabledSetting(settingsComponentName,
+ userInfo.isAdmin() ?
+ PackageManager.COMPONENT_ENABLED_STATE_ENABLED :
+ PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
+ PackageManager.DONT_KILL_APP);
+ }
}
diff --git a/src/com/android/settings/applications/ProcStatsData.java b/src/com/android/settings/applications/ProcStatsData.java
index 3c81374..dd85dd2 100644
--- a/src/com/android/settings/applications/ProcStatsData.java
+++ b/src/com/android/settings/applications/ProcStatsData.java
@@ -160,7 +160,7 @@
ProcessStats.ALL_SCREEN_ADJ, mMemStates, ProcessStats.NON_CACHED_PROC_STATES);
createPkgMap(getProcs(bgTotals, runTotals), bgTotals, runTotals);
- if (totalMem.sysMemZRamWeight > 0) {
+ if (totalMem.sysMemZRamWeight > 0 && !totalMem.hasSwappedOutPss) {
distributeZRam(totalMem.sysMemZRamWeight);
}
@@ -418,8 +418,10 @@
memReader.readMemInfo();
realTotalRam = memReader.getTotalSize();
freeWeight = totalMem.sysMemFreeWeight + totalMem.sysMemCachedWeight;
- usedWeight = totalMem.sysMemKernelWeight + totalMem.sysMemNativeWeight
- + totalMem.sysMemZRamWeight;
+ usedWeight = totalMem.sysMemKernelWeight + totalMem.sysMemNativeWeight;
+ if (!totalMem.hasSwappedOutPss) {
+ usedWeight += totalMem.sysMemZRamWeight;
+ }
for (int i = 0; i < ProcessStats.STATE_COUNT; i++) {
if (i == ProcessStats.STATE_SERVICE_RESTARTING) {
// These don't really run.