diff --git a/res/layout-land/choose_lock_pattern.xml b/res/layout-land/choose_lock_pattern.xml
index 1502301720e..9d623f6bf06 100644
--- a/res/layout-land/choose_lock_pattern.xml
+++ b/res/layout-land/choose_lock_pattern.xml
@@ -43,29 +43,35 @@
android:layout_height="0dip"
android:layout_weight="1.0">
-
-
-
-
+
+
+
+
+
+
diff --git a/res/layout/choose_lock_pattern.xml b/res/layout/choose_lock_pattern.xml
index 110b9ad1211..b4472ba65d8 100644
--- a/res/layout/choose_lock_pattern.xml
+++ b/res/layout/choose_lock_pattern.xml
@@ -56,8 +56,9 @@
@@ -70,8 +71,9 @@
diff --git a/res/values-cs/strings.xml b/res/values-cs/strings.xml
index 5aca72acd63..de79429cd40 100644
--- a/res/values-cs/strings.xml
+++ b/res/values-cs/strings.xml
@@ -417,8 +417,6 @@
"Adresa MAC sítě WiFi"
"Adresa zařízení Bluetooth"
"Nedostupný údaj"
- "Využití sítě"
- "Odesláno: %1$d packets, %2$d bytes%nPřijato: %3$d packets, %4$d bytes"
"Doba provozu"
"Doba provozu"
"Interní paměť telefonu"
diff --git a/res/values-de/strings.xml b/res/values-de/strings.xml
index 68790d5c5cc..60deacd9218 100644
--- a/res/values-de/strings.xml
+++ b/res/values-de/strings.xml
@@ -417,8 +417,6 @@
"WLAN-MAC-Adresse"
"Bluetooth-Adresse"
"Nicht verfügbar"
- "Netzwerknutzung"
- "Gesendet: \n%1$d packets, %2$d bytes%nErhalt: %3$d packets, %4$d bytes"
"Betriebszeit"
"Aktivzeit"
"Interner Telefonspeicher"
diff --git a/res/values-es/strings.xml b/res/values-es/strings.xml
index e22ee4b130f..eb4c8b100ee 100644
--- a/res/values-es/strings.xml
+++ b/res/values-es/strings.xml
@@ -416,8 +416,6 @@
"Dirección MAC de la red Wi-Fi"
"Dirección de Bluetooth"
"No disponible"
- "Uso de red"
- "Enviado: %1$d packets, %2$d bytes%nRecibido: %3$d packets, %4$d bytes"
"Tiempo de actividad"
"Tiempo de actividad"
"Almacenamiento interno del teléfono"
diff --git a/res/values-fr/strings.xml b/res/values-fr/strings.xml
index 7d8e534ebd4..3feed965998 100644
--- a/res/values-fr/strings.xml
+++ b/res/values-fr/strings.xml
@@ -416,8 +416,6 @@
"Adresse MAC Wi-Fi"
"Adresse Bluetooth"
"Non disponible"
- "Utilisation du réseau"
- "Envoyés : %1$d packets, %2$d bytes%n Reçus : %3$d packets, %4$d bytes"
"Durée d\'activité"
"Temps en activité"
"Mémoire interne du téléphone"
diff --git a/res/values-it/strings.xml b/res/values-it/strings.xml
index 24efd38c499..6e10e36d27f 100644
--- a/res/values-it/strings.xml
+++ b/res/values-it/strings.xml
@@ -416,8 +416,6 @@
"Indirizzo MAC Wi-Fi"
"Indirizzo Bluetooth"
"Non disponibile"
- "Utilizzo della rete"
- "Inviati: %1$d packets, %2$d bytes%nRicevuti: %3$d packets, %4$d bytes"
"Tempo di attività"
"Tempo di attività"
"Archiviazione interna telefono"
diff --git a/res/values-ja/strings.xml b/res/values-ja/strings.xml
index f1c2414fa03..b887234a834 100644
--- a/res/values-ja/strings.xml
+++ b/res/values-ja/strings.xml
@@ -417,8 +417,6 @@
"Wi-Fi MACアドレス"
"Bluetoothアドレス"
"不明"
- "ネットワーク使用状況"
- "送信: %1$d packets, %2$d bytes%n受信: %3$d packets, %4$d bytes"
"稼働時間"
"端末使用時間"
"端末内部メモリ"
diff --git a/res/values-ko/strings.xml b/res/values-ko/strings.xml
index 7d7590fed9f..f5d680fae4e 100644
--- a/res/values-ko/strings.xml
+++ b/res/values-ko/strings.xml
@@ -417,8 +417,6 @@
"Wi-Fi MAC 주소"
"Bluetooth 주소"
"사용할 수 없음"
- "네트워크 사용량"
- "전송: %1$d packets, %2$d bytes%n 수신:%3$d packets, %4$d bytes"
"가동 시간"
"무중단 가동 시간"
"전화기 내부 저장공간"
diff --git a/res/values-nb/strings.xml b/res/values-nb/strings.xml
index f1117586548..f9f01a613a8 100644
--- a/res/values-nb/strings.xml
+++ b/res/values-nb/strings.xml
@@ -416,8 +416,6 @@
"MAC-adresse for WLAN"
"Bluetooth-adresse"
"Ikke tilgjengelig"
- "Nettverksbruk"
- "Sendt: %1$d packets, %2$d bytes%nMottatt: %3$d packets, %4$d bytes"
"Oppetid"
"Våken tid"
"Intern lagringsplass"
diff --git a/res/values-nl/strings.xml b/res/values-nl/strings.xml
index 6f30611c731..4f1c6f9b0a5 100644
--- a/res/values-nl/strings.xml
+++ b/res/values-nl/strings.xml
@@ -417,8 +417,6 @@
"Wi-Fi MAC-adres"
"Bluetooth-adres"
"Niet beschikbaar"
- "Netwerkgebruik"
- "Verzonden: %1$d packets, %2$d bytes%nOntvangen: %3$d packets, %4$d bytes"
"Bedrijfstijd"
"Stand-bytijd"
"Intern telefoongeheugen"
diff --git a/res/values-pl/strings.xml b/res/values-pl/strings.xml
index 51ce9cb9e92..c6e7b076a7f 100644
--- a/res/values-pl/strings.xml
+++ b/res/values-pl/strings.xml
@@ -417,8 +417,6 @@
"Adres MAC karty Wi-Fi"
"Adres Bluetooth"
"Niedostępny"
- "Wykorzystanie sieci"
- "Wysłane: %1$d packets, %2$d bytes%nOdebrane: %3$d packets, %4$d bytes"
"Czas działania"
"Czas działania (włączony)"
"Pamięć wewnętrzna telefonu"
diff --git a/res/values-ru/strings.xml b/res/values-ru/strings.xml
index 0a806228a28..fa835ab277f 100644
--- a/res/values-ru/strings.xml
+++ b/res/values-ru/strings.xml
@@ -417,8 +417,6 @@
"MAC-адрес Wi-Fi"
"Адрес Bluetooth"
"Недоступно"
- "Использование сети"
- "Отправлено: %1$d packets, %2$d bytes%nПринято: %3$d packets, %4$d bytes"
"Время работы"
"Время активности"
"Хранение в памяти телефона"
diff --git a/res/values-zh-rCN/strings.xml b/res/values-zh-rCN/strings.xml
index 45148de9f53..4ad3d9e4c3f 100644
--- a/res/values-zh-rCN/strings.xml
+++ b/res/values-zh-rCN/strings.xml
@@ -417,8 +417,6 @@
"Wi-Fi MAC 地址"
"蓝牙地址"
"不可用"
- "网络使用"
- "发送:%1$d packets, %2$d bytes%n 接收:%3$d packets, %4$d bytes"
"正常使用时间"
"唤醒时间"
"手机内部存储"
diff --git a/res/values-zh-rTW/strings.xml b/res/values-zh-rTW/strings.xml
index c34d6a5a13d..a076eb83828 100644
--- a/res/values-zh-rTW/strings.xml
+++ b/res/values-zh-rTW/strings.xml
@@ -417,8 +417,6 @@
"Wi-Fi MAC 位址"
"藍牙位址"
"無法取得"
- "網路使用率"
- "已傳送:%1$d packets, %2$d bytes%n已接收:%3$d packets, %4$d bytes"
"開機時間"
"清醒時間"
"手機內部記憶體"
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 24dda75f10d..356dbef6a27 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -812,9 +812,9 @@
Animation
- Show animation when opening & closing windows
+ Show screen transition animations
- Show animation when opening & closing windows
+ Show screen transition animations
Orientation
@@ -927,10 +927,6 @@
Bluetooth address
Unavailable
-
- Network usage
-
- Sent: %1$d packets, %2$d bytes%nRcvd: %3$d packets, %4$d bytes
Up time
diff --git a/res/xml/device_info_status.xml b/res/xml/device_info_status.xml
index 95377953ed1..4934817ff60 100644
--- a/res/xml/device_info_status.xml
+++ b/res/xml/device_info_status.xml
@@ -82,11 +82,6 @@
android:title="@string/status_bt_address"
android:summary="@string/device_info_not_available"
android:persistent="false" />
-
newList = getInstalledApps(FILTER_APPS_ALL);
+ int oldCount = mAppPropCache.size();
+ boolean idxArr[] = new boolean[oldCount];
+ for ( int i = 0; i < oldCount; i++) {
+ idxArr[i] = false;
+ }
+
+ if (newList != null) {
+ for (ApplicationInfo app : newList) {
+ AppInfo aInfo = mAppPropCache.get(app.packageName);
+ if ( aInfo == null) {
+ // New package. post an ADD_PKG message
+ if(localLOGV) Log.i(TAG, "Adding pkg: "+app.packageName);
+ updatePackageList(Intent.ACTION_PACKAGE_ADDED, app.packageName);
+ } else {
+ idxArr[aInfo.index] = true;
+ }
+ }
+ Set keyList = mAppPropCache.keySet();
+ for (String key : keyList) {
+ AppInfo aInfo = mAppPropCache.get(key);
+ int idx = aInfo.index;
+ if (!idxArr[idx]) {
+ String pkg = aInfo.pkgName;
+ if(localLOGV) Log.i(TAG, "Deleting pkg: " + pkg);
+ updatePackageList(Intent.ACTION_PACKAGE_REMOVED, pkg);
+ }
+ }
+ }
+ }
// Retrieve the package list and init some structures
initAppList(mFilterApps);
mHandler.sendEmptyMessage(NEXT_LOAD_STEP);
@@ -499,12 +531,18 @@ public class ManageApplications extends ListActivity implements
// some initialization code used when kicking off the size computation
private void initAppList(int filterOption) {
+ // Initialize lists
+ List appList = getInstalledApps(filterOption);
+ initAppList(appList, filterOption);
+ }
+
+ // some initialization code used when kicking off the size computation
+ private void initAppList(List appList, int filterOption) {
setProgressBarIndeterminateVisibility(true);
mComputeIndex = 0;
mComputeSizes = false;
mLoadLabels = false;
// Initialize lists
- List appList = getInstalledApps(filterOption);
mAddRemoveMap = new TreeMap();
mAppInfoAdapter.resetAppList(filterOption, appList);
}
@@ -860,11 +898,18 @@ public class ManageApplications extends ListActivity implements
}
return mSizeComparator;
}
-
- public void updateAppsResourceInfo(Map iconMap) {
+
+ /*
+ * This method updates resource information in the package map.
+ *
+ * @param iconMap a map of package names and attributes
+ * @return A boolean value to indicate if the property map has to be
+ * refreshed completely
+ */
+ public boolean updateAppsResourceInfo(Map iconMap) {
if(iconMap == null) {
Log.w(TAG, "Null iconMap when refreshing icon in List Adapter");
- return;
+ return true;
}
boolean changed = false;
for (ApplicationInfo info : mAppLocalList) {
@@ -874,7 +919,7 @@ public class ManageApplications extends ListActivity implements
if (aInfo != null) {
aInfo.refreshIcon(pInfo);
} else {
- mAppPropMap.put(info.packageName, pInfo);
+ return false;
}
changed = true;
}
@@ -882,14 +927,56 @@ public class ManageApplications extends ListActivity implements
if(changed) {
notifyDataSetChanged();
}
+ return true;
}
+ private boolean shouldBeInList(int filterOption, ApplicationInfo info) {
+ // Match filter here
+ boolean addToCurrList = false;
+ if (filterOption == FILTER_APPS_RUNNING) {
+ List runningList = getInstalledApps(FILTER_APPS_RUNNING);
+ for (ApplicationInfo running : runningList) {
+ if (running.packageName.equalsIgnoreCase(info.packageName)) {
+ addToCurrList = true;
+ break;
+ }
+ }
+ } else if (filterOption == FILTER_APPS_THIRD_PARTY) {
+ if ((info.flags & ApplicationInfo.FLAG_SYSTEM) == 0) {
+ addToCurrList = true;
+ } else if ((info.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0) {
+ addToCurrList = true;
+ }
+ } else {
+ return true;
+ }
+ return addToCurrList;
+ }
+
+ /*
+ * Add a package to the current list.
+ * The package is only added to the displayed list
+ * based on the filter value. The package is always added to the property map.
+ * @param pkgName name of package to be added
+ * @param ps PackageStats of new package
+ */
public void addToList(String pkgName, PackageStats ps) {
if(pkgName == null) {
Log.w(TAG, "Adding null pkg to List Adapter");
return;
}
- ApplicationInfo info;
+ boolean notInList = true;
+ int newIdx = getIndex(pkgName);
+ if (newIdx != -1) {
+ notInList = false;
+ if (mAppPropMap.get(pkgName) != null) {
+ // weird. just ignore entry
+ Log.i(TAG, "Package:"+pkgName+" already added");
+ return;
+ }
+ }
+ // Get ApplicationInfo
+ ApplicationInfo info = null;
try {
info = mPm.getApplicationInfo(pkgName, 0);
} catch (NameNotFoundException e) {
@@ -901,21 +988,26 @@ public class ManageApplications extends ListActivity implements
Log.i(TAG, "Null ApplicationInfo for package:"+pkgName);
return;
}
- // Binary search returns a negative index (ie --index) of the position where
- // this might be inserted.
- int newIdx = Collections.binarySearch(mAppLocalList, info,
- getAppComparator(mSortOrder));
- if(newIdx >= 0) {
- Log.i(TAG, "Strange. Package:"+pkgName+" is not new");
- return;
- }
- // New entry
- newIdx = -newIdx-1;
- mAppLocalList.add(newIdx, info);
- mAppPropMap.put(info.packageName, new AppInfo(pkgName, newIdx,
+ // Add entry to map
+ mAppPropMap.put(pkgName, new AppInfo(pkgName, newIdx,
info.loadLabel(mPm), info.loadIcon(mPm), ps));
- adjustIndex();
- notifyDataSetChanged();
+ // Add to list
+ if (notInList && (shouldBeInList(mFilterApps, info))) {
+ // Binary search returns a negative index (ie -index) of the position where
+ // this might be inserted.
+ newIdx = Collections.binarySearch(mAppLocalList, info,
+ getAppComparator(mSortOrder));
+ if(newIdx >= 0) {
+ Log.i(TAG, "Strange. Package:"+pkgName+" is not new");
+ return;
+ }
+ // New entry
+ newIdx = -newIdx-1;
+ mAppLocalList.add(newIdx, info);
+ // Adjust index
+ adjustIndex();
+ notifyDataSetChanged();
+ }
}
public void removeFromList(List pkgNames) {
@@ -1134,7 +1226,6 @@ public class ManageApplications extends ListActivity implements
List appList = getInstalledApps(mSortOrder);
mAppInfoAdapter = new AppInfoAdapter(this, appList);
ListView lv= (ListView) findViewById(android.R.id.list);
- //lv.setAdapter(mAppInfoAdapter);
lv.setOnItemClickListener(this);
lv.setSaveEnabled(true);
lv.setItemsCanFocus(true);
diff --git a/src/com/android/settings/SecuritySettings.java b/src/com/android/settings/SecuritySettings.java
index cd26492a944..867bce3e4d6 100644
--- a/src/com/android/settings/SecuritySettings.java
+++ b/src/com/android/settings/SecuritySettings.java
@@ -45,8 +45,7 @@ public class SecuritySettings extends PreferenceActivity
private static final String KEY_LOCK_ENABLED = "lockenabled";
private static final String KEY_VISIBLE_PATTERN = "visiblepattern";
private static final String KEY_TACTILE_FEEDBACK_ENABLED = "tactilefeedback";
- private static final int CONFIRM_PATTERN_THEN_DISABLE_REQUEST_CODE = 55;
- private static final int CONFIRM_PATTERN_THEN_ENABLE_REQUEST_CODE = 56;
+ private static final int CONFIRM_PATTERN_THEN_DISABLE_AND_CLEAR_REQUEST_CODE = 55;
private LockPatternUtils mLockPatternUtils;
private CheckBoxPreference mLockEnabled;
@@ -64,7 +63,7 @@ public class SecuritySettings extends PreferenceActivity
private CheckBoxPreference mNetwork;
private CheckBoxPreference mGps;
private LocationManager mLocationManager;
-
+
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@@ -257,36 +256,26 @@ public class SecuritySettings extends PreferenceActivity
@Override
protected void onClick() {
- if (mLockPatternUtils.savedPatternExists()) {
- if (isChecked()) {
- confirmPatternThenDisable();
- } else {
- confirmPatternThenEnable();
- }
+ if (mLockPatternUtils.savedPatternExists() && isChecked()) {
+ confirmPatternThenDisableAndClear();
} else {
super.onClick();
}
}
}
- private void confirmPatternThenEnable() {
- final Intent intent = new Intent();
- intent.setClassName("com.android.settings", "com.android.settings.ConfirmLockPattern");
- startActivityForResult(intent, CONFIRM_PATTERN_THEN_ENABLE_REQUEST_CODE);
- }
-
/**
* Launch screen to confirm the existing lock pattern.
* @see #onActivityResult(int, int, android.content.Intent)
*/
- private void confirmPatternThenDisable() {
+ private void confirmPatternThenDisableAndClear() {
final Intent intent = new Intent();
intent.setClassName("com.android.settings", "com.android.settings.ConfirmLockPattern");
- startActivityForResult(intent, CONFIRM_PATTERN_THEN_DISABLE_REQUEST_CODE);
+ startActivityForResult(intent, CONFIRM_PATTERN_THEN_DISABLE_AND_CLEAR_REQUEST_CODE);
}
/**
- * @see #confirmPatternThenDisable
+ * @see #confirmPatternThenDisableAndClear
*/
@Override
protected void onActivityResult(int requestCode, int resultCode,
@@ -295,10 +284,9 @@ public class SecuritySettings extends PreferenceActivity
final boolean resultOk = resultCode == Activity.RESULT_OK;
- if ((requestCode == CONFIRM_PATTERN_THEN_DISABLE_REQUEST_CODE) && resultOk) {
+ if ((requestCode == CONFIRM_PATTERN_THEN_DISABLE_AND_CLEAR_REQUEST_CODE) && resultOk) {
mLockPatternUtils.setLockPatternEnabled(false);
- } else if ((requestCode == CONFIRM_PATTERN_THEN_ENABLE_REQUEST_CODE) && resultOk) {
- mLockPatternUtils.setLockPatternEnabled(true);
+ mLockPatternUtils.saveLockPattern(null);
}
}
}
diff --git a/src/com/android/settings/SoundAndDisplaySettings.java b/src/com/android/settings/SoundAndDisplaySettings.java
index 2a4e133da0b..8905b859fd7 100644
--- a/src/com/android/settings/SoundAndDisplaySettings.java
+++ b/src/com/android/settings/SoundAndDisplaySettings.java
@@ -168,7 +168,9 @@ public class SoundAndDisplaySettings extends PreferenceActivity implements
} catch (RemoteException e) {
}
if (mAnimationScales != null) {
- for (int i=0; i 0) {
+ // Window animations are always on.
+ mAnimationScales[0] = 1;
+ }
+ for (int i=1; i, Par
private static final String ADHOC_CAPABILITY = "[IBSS]";
/** String present in capabilities if the scan result is enterprise secured */
private static final String ENTERPRISE_CAPABILITY = "-EAP-";
-
- // Localized strings for different security types
- private static String LOCALIZED_WPA2;
- private static String LOCALIZED_WPA;
- private static String LOCALIZED_WEP;
- private static String LOCALIZED_OPEN;
- private static String LOCALIZED_UNKNOWN;
- private static String LOCALIZED_VERBOSE_WPA2;
- private static String LOCALIZED_VERBOSE_WPA;
- private static String LOCALIZED_VERBOSE_WEP;
- private static String LOCALIZED_VERBOSE_OPEN;
-
- // Localized strings for various messages
- private static String SUMMARY_NOT_IN_RANGE;
- private static String SUMMARY_REMEMBERED;
- private static String SUMMARY_CONNECTION_FAILED;
-
public static final String BSSID_ANY = "any";
public static final int NETWORK_ID_NOT_SET = -1;
/** This should be used with care! */
@@ -147,31 +130,8 @@ public final class AccessPointState implements Comparable, Par
void setContext(Context context) {
mContext = context;
- setStrings();
}
- private void setStrings() {
- final Context c = mContext;
-
- if (SUMMARY_NOT_IN_RANGE == null && c != null) {
- SUMMARY_NOT_IN_RANGE = c.getString(R.string.summary_not_in_range);
- SUMMARY_REMEMBERED = c.getString(R.string.summary_remembered);
- SUMMARY_CONNECTION_FAILED = c.getString(R.string.summary_connection_failed);
-
- LOCALIZED_OPEN = c.getString(R.string.wifi_security_open);
- LOCALIZED_WEP = c.getString(R.string.wifi_security_wep);
- LOCALIZED_WPA = c.getString(R.string.wifi_security_wpa);
- LOCALIZED_WPA2 = c.getString(R.string.wifi_security_wpa2);
-
- LOCALIZED_VERBOSE_OPEN = c.getString(R.string.wifi_security_verbose_open);
- LOCALIZED_VERBOSE_WEP = c.getString(R.string.wifi_security_verbose_wep);
- LOCALIZED_VERBOSE_WPA = c.getString(R.string.wifi_security_verbose_wpa);
- LOCALIZED_VERBOSE_WPA2 = c.getString(R.string.wifi_security_verbose_wpa2);
-
- LOCALIZED_UNKNOWN = c.getString(R.string.wifi_security_unknown);
- }
- }
-
public void setNetworkId(int networkId) {
this.networkId = networkId;
}
@@ -311,12 +271,12 @@ public final class AccessPointState implements Comparable, Par
}
public String getHumanReadableSecurity() {
- if (security.equals(OPEN)) return LOCALIZED_OPEN;
- else if (security.equals(WEP)) return LOCALIZED_WEP;
- else if (security.equals(WPA)) return LOCALIZED_WPA;
- else if (security.equals(WPA2)) return LOCALIZED_WPA2;
+ if (security.equals(OPEN)) return mContext.getString(R.string.wifi_security_open);
+ else if (security.equals(WEP)) return mContext.getString(R.string.wifi_security_wep);
+ else if (security.equals(WPA)) return mContext.getString(R.string.wifi_security_wpa);
+ else if (security.equals(WPA2)) return mContext.getString(R.string.wifi_security_wpa2);
- return LOCALIZED_UNKNOWN;
+ return mContext.getString(R.string.wifi_security_unknown);
}
public void updateFromScanResult(ScanResult scanResult) {
@@ -719,22 +679,22 @@ public final class AccessPointState implements Comparable, Par
buildSummary(sb, WifiStatus.getPrintable(mContext, status), true);
} else if (!seen) {
- buildSummary(sb, SUMMARY_NOT_IN_RANGE, true);
+ buildSummary(sb, mContext.getString(R.string.summary_not_in_range), true);
// Remembered comes second in this case
if (!primary && configured) {
- buildSummary(sb, SUMMARY_REMEMBERED, true);
+ buildSummary(sb, mContext.getString(R.string.summary_remembered), true);
}
} else {
if (configured && disabled) {
// The connection failure overrides all in this case
- return SUMMARY_CONNECTION_FAILED;
+ return mContext.getString(R.string.summary_connection_failed);
}
// Remembered comes first in this case
if (!primary && configured) {
- buildSummary(sb, SUMMARY_REMEMBERED, true);
+ buildSummary(sb, mContext.getString(R.string.summary_remembered), true);
}
// If it is seen (and not the primary), show the security type
@@ -749,13 +709,13 @@ public final class AccessPointState implements Comparable, Par
private String getVerboseSecurity() {
if (WEP.equals(security)) {
- return LOCALIZED_VERBOSE_WEP;
+ return mContext.getString(R.string.wifi_security_verbose_wep);
} else if (WPA.equals(security)) {
- return LOCALIZED_VERBOSE_WPA;
+ return mContext.getString(R.string.wifi_security_verbose_wpa);
} else if (WPA2.equals(security)) {
- return LOCALIZED_VERBOSE_WPA2;
+ return mContext.getString(R.string.wifi_security_verbose_wpa2);
} else if (OPEN.equals(security)) {
- return LOCALIZED_VERBOSE_OPEN;
+ return mContext.getString(R.string.wifi_security_verbose_open);
} else {
return null;
}
diff --git a/src/com/android/settings/wifi/WifiStatus.java b/src/com/android/settings/wifi/WifiStatus.java
index d4b6431d069..e10ab8ded94 100644
--- a/src/com/android/settings/wifi/WifiStatus.java
+++ b/src/com/android/settings/wifi/WifiStatus.java
@@ -20,51 +20,9 @@ import com.android.settings.R;
import android.content.Context;
import android.net.NetworkInfo;
-import android.net.wifi.WifiInfo;
import android.text.TextUtils;
public class WifiStatus {
-
- // e.g., "Connecting"
- public static String sScanning;
- public static String sConnecting;
- public static String sAuthenticating;
- public static String sObtainingIp;
- public static String sConnected;
- public static String sDisconnecting;
- public static String sDisconnected;
- public static String sFailed;
-
- // e.g., "Connecting to %1$s"
- public static String sScanningFragment;
- public static String sConnectingFragment;
- public static String sAuthenticatingFragment;
- public static String sObtainingIpFragment;
- public static String sConnectedFragment;
- public static String sDisconnectingFragment;
- public static String sDisconnectedFragment;
- public static String sFailedFragment;
-
- private static void fillStrings(Context context) {
- sScanning = context.getString(R.string.status_scanning);
- sConnecting = context.getString(R.string.status_connecting);
- sAuthenticating = context.getString(R.string.status_authenticating);
- sObtainingIp = context.getString(R.string.status_obtaining_ip);
- sConnected = context.getString(R.string.status_connected);
- sDisconnecting = context.getString(R.string.status_disconnecting);
- sDisconnected = context.getString(R.string.status_disconnected);
- sFailed = context.getString(R.string.status_failed);
-
- sScanningFragment = context.getString(R.string.fragment_status_scanning);
- sConnectingFragment = context.getString(R.string.fragment_status_connecting);
- sAuthenticatingFragment = context.getString(R.string.fragment_status_authenticating);
- sObtainingIpFragment = context.getString(R.string.fragment_status_obtaining_ip);
- sConnectedFragment = context.getString(R.string.fragment_status_connected);
- sDisconnectingFragment = context.getString(R.string.fragment_status_disconnecting);
- sDisconnectedFragment = context.getString(R.string.fragment_status_disconnected);
- sFailedFragment = context.getString(R.string.fragment_status_failed);
- }
-
public static String getStatus(Context context, String ssid,
NetworkInfo.DetailedState detailedState) {
@@ -85,27 +43,23 @@ public class WifiStatus {
public static String getPrintable(Context context,
NetworkInfo.DetailedState detailedState) {
- if (sScanning == null) {
- fillStrings(context);
- }
-
switch (detailedState) {
case AUTHENTICATING:
- return sAuthenticating;
+ return context.getString(R.string.status_authenticating);
case CONNECTED:
- return sConnected;
+ return context.getString(R.string.status_connected);
case CONNECTING:
- return sConnecting;
+ return context.getString(R.string.status_connecting);
case DISCONNECTED:
- return sDisconnected;
+ return context.getString(R.string.status_disconnected);
case DISCONNECTING:
- return sDisconnecting;
+ return context.getString(R.string.status_disconnecting);
case FAILED:
- return sFailed;
+ return context.getString(R.string.status_failed);
case OBTAINING_IPADDR:
- return sObtainingIp;
+ return context.getString(R.string.status_obtaining_ip);
case SCANNING:
- return sScanning;
+ return context.getString(R.string.status_scanning);
default:
return null;
}
@@ -114,35 +68,31 @@ public class WifiStatus {
public static String getPrintableFragment(Context context,
NetworkInfo.DetailedState detailedState, String apName) {
- if (sScanningFragment == null) {
- fillStrings(context);
- }
-
String fragment = null;
switch (detailedState) {
case AUTHENTICATING:
- fragment = sAuthenticatingFragment;
+ fragment = context.getString(R.string.fragment_status_authenticating);
break;
case CONNECTED:
- fragment = sConnectedFragment;
+ fragment = context.getString(R.string.fragment_status_connected);
break;
case CONNECTING:
- fragment = sConnectingFragment;
+ fragment = context.getString(R.string.fragment_status_connecting);
break;
case DISCONNECTED:
- fragment = sDisconnectedFragment;
+ fragment = context.getString(R.string.fragment_status_disconnected);
break;
case DISCONNECTING:
- fragment = sDisconnectingFragment;
+ fragment = context.getString(R.string.fragment_status_disconnecting);
break;
case FAILED:
- fragment = sFailedFragment;
+ fragment = context.getString(R.string.fragment_status_failed);
break;
case OBTAINING_IPADDR:
- fragment = sObtainingIpFragment;
+ fragment = context.getString(R.string.fragment_status_obtaining_ip);
break;
case SCANNING:
- fragment = sScanningFragment;
+ fragment = context.getString(R.string.fragment_status_scanning);
break;
}