summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--res/layout-xlarge/date_time_settings_setupwizard.xml6
-rw-r--r--res/layout-xlarge/wifi_settings_for_setup_wizard_xl.xml24
-rw-r--r--res/layout/installed_app_details.xml39
-rw-r--r--res/layout/settings_actionbar.xml64
-rw-r--r--res/layout/settings_top_level.xml67
-rw-r--r--res/values-xlarge/styles.xml9
-rw-r--r--res/values/strings.xml4
-rw-r--r--res/values/styles.xml5
-rw-r--r--src/com/android/settings/applications/ApplicationsState.java19
-rw-r--r--src/com/android/settings/applications/InstalledAppDetails.java7
-rw-r--r--src/com/android/settings/deviceinfo/MemoryMeasurement.java46
-rw-r--r--src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java14
-rw-r--r--src/com/android/settings/inputmethod/InputMethodAndSubtypeUtil.java1
13 files changed, 115 insertions, 190 deletions
diff --git a/res/layout-xlarge/date_time_settings_setupwizard.xml b/res/layout-xlarge/date_time_settings_setupwizard.xml
index 600cdbd..483b66a 100644
--- a/res/layout-xlarge/date_time_settings_setupwizard.xml
+++ b/res/layout-xlarge/date_time_settings_setupwizard.xml
@@ -158,10 +158,8 @@
<Button
android:id="@+id/next_button"
- android:layout_width="208dip"
- android:layout_height="48dip"
+ style="@style/setup_wizard_button"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
- android:text="@string/next_label"
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ android:text="@string/next_label" />
</RelativeLayout>
diff --git a/res/layout-xlarge/wifi_settings_for_setup_wizard_xl.xml b/res/layout-xlarge/wifi_settings_for_setup_wizard_xl.xml
index d3af1f8..df6cfbf 100644
--- a/res/layout-xlarge/wifi_settings_for_setup_wizard_xl.xml
+++ b/res/layout-xlarge/wifi_settings_for_setup_wizard_xl.xml
@@ -120,54 +120,42 @@
android:layout_marginBottom="16dip">
<Button android:id="@+id/wifi_setup_forget"
- android:layout_width="208dip"
- android:layout_height="48dip"
+ style="@style/setup_wizard_button"
android:layout_marginLeft="16dip"
android:text="@string/wifi_setup_forget"
- android:textAppearance="?android:attr/textAppearanceMedium"
android:visibility="gone" />
<Button android:id="@+id/wifi_setup_connect"
- android:layout_width="208dip"
- android:layout_height="48dip"
+ style="@style/setup_wizard_button"
android:layout_marginTop="96dip"
android:layout_marginLeft="16dip"
android:text="@string/wifi_setup_connect"
- android:textAppearance="?android:attr/textAppearanceMedium"
android:enabled="false"
android:visibility="gone" />
<Button android:id="@+id/wifi_setup_add_network"
- android:layout_width="208dip"
- android:layout_height="48dip"
+ style="@style/setup_wizard_button"
android:layout_marginLeft="16dip"
android:text="@string/wifi_setup_add_network"
- android:textAppearance="?android:attr/textAppearanceMedium"
android:enabled="false" />
<Button android:id="@+id/wifi_setup_refresh_list"
- android:layout_width="208dip"
- android:layout_height="48dip"
+ style="@style/setup_wizard_button"
android:layout_marginLeft="16dip"
android:text="@string/wifi_setup_refresh_list"
- android:textAppearance="?android:attr/textAppearanceMedium"
android:enabled="false" />
<Button android:id="@+id/wifi_setup_skip_or_next"
- android:layout_width="208dip"
- android:layout_height="48dip"
+ style="@style/setup_wizard_button"
android:layout_marginTop="96dip"
android:layout_marginLeft="16dip"
android:text="@string/wifi_setup_skip"
- android:textAppearance="?android:attr/textAppearanceMedium"
android:enabled="false" />
</LinearLayout>
<!-- This misleading name is for keeping consistency between non-XL layouts -->
<Button android:id="@+id/wifi_setup_cancel"
- android:layout_width="208dip"
- android:layout_height="48dip"
- android:textAppearance="?android:attr/textAppearanceMedium"
+ style="@style/setup_wizard_button"
android:layout_marginBottom="16dip"
android:layout_alignBottom="@+id/content"
android:layout_toLeftOf="@id/right_buttons"
diff --git a/res/layout/installed_app_details.xml b/res/layout/installed_app_details.xml
index fff1975..0b68d47 100644
--- a/res/layout/installed_app_details.xml
+++ b/res/layout/installed_app_details.xml
@@ -132,6 +132,7 @@
android:maxLines="1" />
</LinearLayout>
+
<LinearLayout
android:id="@+id/info_size"
android:layout_width="match_parent"
@@ -169,6 +170,44 @@
android:maxLines="1" />
</LinearLayout>
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ android:baselineAligned="true"
+ android:paddingTop="-1dip">
+ <TextView
+ android:id="@+id/external_size_prefix"
+ android:text="@string/external_size_label"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:maxLines="1"
+ android:paddingTop="6dip"
+ android:paddingLeft="6dip"/>
+ <ImageView
+ android:id="@+id/info_size_dots"
+ android:src="@drawable/dotted_line_480px"
+ android:layout_width="0dip"
+ android:layout_weight="1"
+ android:layout_height="1px"
+ android:layout_gravity="bottom"
+ android:layout_marginLeft="1dip"
+ android:layout_marginRight="1dip"
+ android:layout_marginBottom="4dip"
+ android:scaleType="center" />
+ <TextView
+ android:id="@+id/external_size_text"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:paddingTop="6dip"
+ android:paddingRight="6dip"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:maxLines="1" />
+
+ </LinearLayout>
+
<!-- Clear data and install location buttons -->
<include
layout="@layout/two_buttons_panel"
diff --git a/res/layout/settings_actionbar.xml b/res/layout/settings_actionbar.xml
deleted file mode 100644
index 711a0a1..0000000
--- a/res/layout/settings_actionbar.xml
+++ /dev/null
@@ -1,64 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2010 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<LinearLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="horizontal"
- android:padding="4dip"
- android:gravity="center_vertical"
- android:layout_width="wrap_content"
- android:layout_height="match_parent">
-
- <!-- ImageView
- android:src="@mipmap/ic_launcher_settings"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center_vertical"
- android:layout_marginLeft="4dip"
- android:layout_marginRight="4dip"
- /-->
-
- <view class="com.android.settings.Settings$BreadCrumbs"
- android:id="@+id/bread_crumbs"
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
- android:orientation="horizontal">
-
- <TextView android:id="@+id/level_up_title"
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
- android:gravity="center_vertical"
- style="?android:attr/textAppearanceMediumInverse"
- />
-
- <ImageView
- android:id="@+id/level_divider"
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
- android:layout_marginTop="4dip"
- android:layout_marginBottom="4dip"
- android:layout_marginLeft="12dip"
- android:layout_marginRight="12dip"
- android:src="@drawable/nav_divider"/>
-
- <TextView android:id="@+id/level_current_title"
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
- android:gravity="center_vertical"
- style="?android:attr/textAppearanceMediumInverse"
- />
- </view>
-</LinearLayout>
diff --git a/res/layout/settings_top_level.xml b/res/layout/settings_top_level.xml
deleted file mode 100644
index b029915..0000000
--- a/res/layout/settings_top_level.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2010 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<!-- Top-level Settings layout with fragments. -->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
- <FrameLayout android:id="@+id/prefs"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- />
-
- <!-- button_bar -->
- <RelativeLayout android:id="@+id/button_bar"
- android:layout_height="wrap_content"
- android:layout_width="match_parent"
- android:layout_weight="0"
- android:background="@android:drawable/bottom_bar"
- android:visibility="gone">
-
- <Button android:id="@+id/back_button"
- android:layout_width="150dip"
- android:layout_height="wrap_content"
- android:layout_margin="5dip"
- android:layout_alignParentLeft="true"
- android:drawablePadding="3dip"
- />
- <LinearLayout
- android:orientation="horizontal"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentRight="true">
-
- <Button android:id="@+id/skip_button"
- android:layout_width="150dip"
- android:layout_height="wrap_content"
- android:layout_margin="5dip"
- android:text="@string/skip_button_label"
- android:visibility="gone"
- />
-
- <Button android:id="@+id/next_button"
- android:layout_width="150dip"
- android:layout_height="wrap_content"
- android:layout_margin="5dip"
- android:drawableRight="@drawable/ic_btn_next"
- android:drawablePadding="3dip"
- android:text="@string/next_button_label"
- />
- </LinearLayout>
- </RelativeLayout>
-</LinearLayout>
diff --git a/res/values-xlarge/styles.xml b/res/values-xlarge/styles.xml
index 5e3fead..9b125ad 100644
--- a/res/values-xlarge/styles.xml
+++ b/res/values-xlarge/styles.xml
@@ -50,4 +50,11 @@
<item name="android:orientation">vertical</item>
</style>
-</resources> \ No newline at end of file
+ <style name="setup_wizard_button">
+ <item name="android:layout_width">wrap_content</item>
+ <item name="android:minWidth">208dip</item>
+ <item name="android:layout_height">48dip</item>
+ <item name="android:textAppearance">?android:attr/textAppearanceMedium</item>
+ </style>
+
+</resources>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 4107951..a1d58bd 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -1969,6 +1969,10 @@
<string name="application_size_label">Application</string>
<!-- Manage applications, individual application info screen, label under Storage heading. The amount of sapce taken up by the app's data (for example, downloaded emails or something like that) -->
<string name="data_size_label">Data</string>
+ <!-- Manage applications, individual application info screen, label under Storage heading. The amount of space taken up by the app's data on USB storage [CHARSIZE=40] -->
+ <string name="external_size_label" product="nosdcard">USB storage</string>
+ <!-- Manage applications, individual application info screen, label under Storage heading. The amount of space taken up by the app's data on the SD card [CHARSIZE=40] -->
+ <string name="external_size_label" product="default">SD card</string>
<!-- Manage applications, individual application info screen, button label under Storage heading. Button to remove the application from the system. -->
<string name="uninstall_text">Uninstall</string>
<!-- [CHAR LIMIT=25] Manage applications, individual application info screen, button label under Storage heading. Button to disable an existing application. -->
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 969742f..c361fa9 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -109,4 +109,9 @@
<item name="android:layout_height">wrap_content</item>
<item name="android:orientation">vertical</item>
</style>
+
+ <style name="setup_wizard_button">
+ <item name="android:layout_width">wrap_content</item>
+ <item name="android:layout_height">wrap_content</item>
+ </style>
</resources>
diff --git a/src/com/android/settings/applications/ApplicationsState.java b/src/com/android/settings/applications/ApplicationsState.java
index 6e9f2a2..6de8c7f 100644
--- a/src/com/android/settings/applications/ApplicationsState.java
+++ b/src/com/android/settings/applications/ApplicationsState.java
@@ -71,6 +71,7 @@ public class ApplicationsState {
long cacheSize;
long codeSize;
long dataSize;
+ long externalSize;
}
public static class AppEntry extends SizeInfo {
@@ -626,9 +627,16 @@ public class ApplicationsState {
// --------------------------------------------------------------
- private long getTotalSize(PackageStats ps) {
+ private long getTotalInternalSize(PackageStats ps) {
if (ps != null) {
- return ps.codeSize+ps.dataSize;
+ return ps.codeSize + ps.dataSize;
+ }
+ return SIZE_INVALID;
+ }
+
+ private long getTotalExternalSize(PackageStats ps) {
+ if (ps != null) {
+ return ps.externalDataSize + ps.externalMediaSize + ps.externalCacheSize;
}
return SIZE_INVALID;
}
@@ -660,15 +668,18 @@ public class ApplicationsState {
synchronized (entry) {
entry.sizeStale = false;
entry.sizeLoadStart = 0;
- long newSize = getTotalSize(stats);
+ long externalSize = getTotalExternalSize(stats);
+ long newSize = externalSize + getTotalInternalSize(stats);
if (entry.size != newSize ||
entry.cacheSize != stats.cacheSize ||
entry.codeSize != stats.codeSize ||
- entry.dataSize != stats.dataSize) {
+ entry.dataSize != stats.dataSize ||
+ entry.externalSize != externalSize) {
entry.size = newSize;
entry.cacheSize = stats.cacheSize;
entry.codeSize = stats.codeSize;
entry.dataSize = stats.dataSize;
+ entry.externalSize = externalSize;
entry.sizeStr = getSizeStr(entry.size);
if (DEBUG) Log.i(TAG, "Set size of " + entry.label + " " + entry
+ ": " + entry.sizeStr);
diff --git a/src/com/android/settings/applications/InstalledAppDetails.java b/src/com/android/settings/applications/InstalledAppDetails.java
index de897eb..06d97fc 100644
--- a/src/com/android/settings/applications/InstalledAppDetails.java
+++ b/src/com/android/settings/applications/InstalledAppDetails.java
@@ -93,6 +93,7 @@ public class InstalledAppDetails extends Fragment
private TextView mTotalSize;
private TextView mAppSize;
private TextView mDataSize;
+ private TextView mExternalSize;
private ClearUserDataObserver mClearDataObserver;
// Views related to cache info
private TextView mCacheSize;
@@ -107,6 +108,7 @@ public class InstalledAppDetails extends Fragment
private boolean mHaveSizes = false;
private long mLastCodeSize = -1;
private long mLastDataSize = -1;
+ private long mLastExternalSize = -1;
private long mLastCacheSize = -1;
private long mLastTotalSize = -1;
@@ -317,6 +319,7 @@ public class InstalledAppDetails extends Fragment
mTotalSize = (TextView)view.findViewById(R.id.total_size_text);
mAppSize = (TextView)view.findViewById(R.id.application_size_text);
mDataSize = (TextView)view.findViewById(R.id.data_size_text);
+ mExternalSize = (TextView)view.findViewById(R.id.external_size_text);
// Get Control button panel
View btnPanel = view.findViewById(R.id.control_buttons_panel);
@@ -504,6 +507,10 @@ public class InstalledAppDetails extends Fragment
mLastDataSize = mAppEntry.dataSize;
mDataSize.setText(getSizeStr(mAppEntry.dataSize));
}
+ if (mLastExternalSize != mAppEntry.externalSize) {
+ mLastExternalSize = mAppEntry.externalSize;
+ mExternalSize.setText(getSizeStr(mAppEntry.externalSize));
+ }
if (mLastCacheSize != mAppEntry.cacheSize) {
mLastCacheSize = mAppEntry.cacheSize;
mCacheSize.setText(getSizeStr(mAppEntry.cacheSize));
diff --git a/src/com/android/settings/deviceinfo/MemoryMeasurement.java b/src/com/android/settings/deviceinfo/MemoryMeasurement.java
index ead9dd6..19bd784 100644
--- a/src/com/android/settings/deviceinfo/MemoryMeasurement.java
+++ b/src/com/android/settings/deviceinfo/MemoryMeasurement.java
@@ -180,8 +180,6 @@ public class MemoryMeasurement {
public static final int MSG_INVALIDATE = 6;
- private List<String> mPendingApps = new ArrayList<String>();
-
private Object mLock = new Object();
private IMediaContainerService mDefaultContainer;
@@ -190,7 +188,7 @@ public class MemoryMeasurement {
private volatile boolean mMeasured = false;
- private long mAppsSize = 0;
+ private StatsObserver mStatsObserver;
private final WeakReference<Context> mContext;
@@ -287,39 +285,49 @@ public class MemoryMeasurement {
sendEmptyMessage(MSG_DISCONNECT);
}
- public void queuePackageMeasurementLocked(String packageName) {
- mPendingApps.add(packageName);
- }
-
/**
* Request measurement of each package.
*
* @param pm PackageManager instance to query
*/
public void requestQueuedMeasurementsLocked(PackageManager pm) {
- final int N = mPendingApps.size();
+ final List<String> appsList = mStatsObserver.getAppsList();
+ final int N = appsList.size();
for (int i = 0; i < N; i++) {
- pm.getPackageSizeInfo(mPendingApps.get(i), mStatsObserver);
+ pm.getPackageSizeInfo(appsList.get(i), mStatsObserver);
}
}
- final IPackageStatsObserver.Stub mStatsObserver = new IPackageStatsObserver.Stub() {
+ private class StatsObserver extends IPackageStatsObserver.Stub {
+ private long mAppsSizeForThisStatsObserver = 0;
+ private final List<String> mAppsList = new ArrayList<String>();
public void onGetStatsCompleted(PackageStats stats, boolean succeeded) {
+ if (!mStatsObserver.equals(this)) {
+ // this callback's class object is no longer in use. ignore this callback.
+ return;
+ }
if (succeeded) {
- mAppsSize += stats.codeSize + stats.dataSize;
+ mAppsSizeForThisStatsObserver += stats.codeSize + stats.dataSize;
}
- synchronized (mPendingApps) {
- mPendingApps.remove(stats.packageName);
+ synchronized (mAppsList) {
+ mAppsList.remove(stats.packageName);
- if (mPendingApps.size() == 0) {
- mInternalAppsSize = mAppsSize;
+ if (mAppsList.size() == 0) {
+ mInternalAppsSize = mAppsSizeForThisStatsObserver;
onInternalMeasurementComplete();
}
}
}
- };
+
+ public void queuePackageMeasurementLocked(String packageName) {
+ mAppsList.add(packageName);
+ }
+ public List<String> getAppsList() {
+ return mAppsList;
+ }
+ }
private void onInternalMeasurementComplete() {
sendEmptyMessage(MSG_COMPLETED);
@@ -368,10 +376,12 @@ public class MemoryMeasurement {
.getInstalledApplications(PackageManager.GET_UNINSTALLED_PACKAGES
| PackageManager.GET_DISABLED_COMPONENTS);
if (apps != null) {
- synchronized (mPendingApps) {
+ // initiate measurement of all package sizes. need new StatsObserver object.
+ mStatsObserver = new StatsObserver();
+ synchronized (mStatsObserver.mAppsList) {
for (int i = 0; i < apps.size(); i++) {
final ApplicationInfo info = apps.get(i);
- queuePackageMeasurementLocked(info.packageName);
+ mStatsObserver.queuePackageMeasurementLocked(info.packageName);
}
requestQueuedMeasurementsLocked(pm);
diff --git a/src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java b/src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java
index 117bec5..a4808b0 100644
--- a/src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java
+++ b/src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java
@@ -21,29 +21,15 @@ import com.android.settings.SettingsPreferenceFragment;
import com.android.settings.Utils;
import com.android.settings.VoiceInputOutputSettings;
-import android.app.AlertDialog;
import android.content.Context;
-import android.content.DialogInterface;
-import android.content.Intent;
-import android.content.pm.ApplicationInfo;
-import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.os.Bundle;
-import android.preference.CheckBoxPreference;
import android.preference.ListPreference;
import android.preference.Preference;
-import android.preference.PreferenceGroup;
import android.preference.PreferenceScreen;
import android.provider.Settings;
-import android.text.TextUtils;
-import android.util.Log;
-import android.view.inputmethod.InputMethodInfo;
import android.view.inputmethod.InputMethodManager;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-
public class InputMethodAndLanguageSettings extends SettingsPreferenceFragment
implements Preference.OnPreferenceChangeListener{
diff --git a/src/com/android/settings/inputmethod/InputMethodAndSubtypeUtil.java b/src/com/android/settings/inputmethod/InputMethodAndSubtypeUtil.java
index 6981927..03c5ea1 100644
--- a/src/com/android/settings/inputmethod/InputMethodAndSubtypeUtil.java
+++ b/src/com/android/settings/inputmethod/InputMethodAndSubtypeUtil.java
@@ -204,6 +204,7 @@ public class InputMethodAndSubtypeUtil {
if (DEBUG) {
Log.d(TAG, "Current IME was uninstalled or disabled.");
}
+ currentInputMethodId = null;
}
}
// If it's a disabled system ime, add it to the disabled list so that it