Data usage label width, locking, Wi-Fi fixes.

Avoid wrapping sweep labels when underlying string is long, and avoid
showing blank "^1" sweep labels.  Only offer "restrict data" when
mobile networks are present.  Add locking around UidDetailProvider.

Move to isNetworkSupported() for consistency.

Bug: 5492495, 5471602, 5439402, 5373465
Change-Id: I79f5938d45ffbb4c2c242106424a466042a26c1c
This commit is contained in:
Jeff Sharkey
2011-11-10 17:17:24 -08:00
parent ffc1214ccb
commit bdf98e84ab
3 changed files with 38 additions and 21 deletions

View File

@@ -39,14 +39,14 @@ public class UidDetailProvider {
mUidDetailCache = new SparseArray<UidDetail>();
}
public void clearCache() {
public synchronized void clearCache() {
mUidDetailCache.clear();
}
/**
* Resolve best descriptive label for the given UID.
*/
public UidDetail getUidDetail(int uid, boolean blocking) {
public synchronized UidDetail getUidDetail(int uid, boolean blocking) {
final UidDetail cached = mUidDetailCache.get(uid);
if (cached != null) {
return cached;