Update to work with the activity manager taking over OOM settings.
The values it needs are no longer in properties. Also fix a few problems: bug with apps being left in the services list, sorting of internal storage. Change-Id: Ife9706e004931269c36a7bc37b9dbb016064c2e4
This commit is contained in:
@@ -80,6 +80,8 @@ public class ApplicationsState {
|
||||
final long id;
|
||||
String label;
|
||||
long size;
|
||||
long internalSize;
|
||||
long externalSize;
|
||||
|
||||
boolean mounted;
|
||||
|
||||
@@ -155,7 +157,8 @@ public class ApplicationsState {
|
||||
}
|
||||
};
|
||||
|
||||
public static final Comparator<AppEntry> SIZE_COMPARATOR = new Comparator<AppEntry>() {
|
||||
public static final Comparator<AppEntry> SIZE_COMPARATOR
|
||||
= new Comparator<AppEntry>() {
|
||||
private final Collator sCollator = Collator.getInstance();
|
||||
@Override
|
||||
public int compare(AppEntry object1, AppEntry object2) {
|
||||
@@ -165,6 +168,28 @@ public class ApplicationsState {
|
||||
}
|
||||
};
|
||||
|
||||
public static final Comparator<AppEntry> INTERNAL_SIZE_COMPARATOR
|
||||
= new Comparator<AppEntry>() {
|
||||
private final Collator sCollator = Collator.getInstance();
|
||||
@Override
|
||||
public int compare(AppEntry object1, AppEntry object2) {
|
||||
if (object1.internalSize < object2.internalSize) return 1;
|
||||
if (object1.internalSize > object2.internalSize) return -1;
|
||||
return sCollator.compare(object1.label, object2.label);
|
||||
}
|
||||
};
|
||||
|
||||
public static final Comparator<AppEntry> EXTERNAL_SIZE_COMPARATOR
|
||||
= new Comparator<AppEntry>() {
|
||||
private final Collator sCollator = Collator.getInstance();
|
||||
@Override
|
||||
public int compare(AppEntry object1, AppEntry object2) {
|
||||
if (object1.externalSize < object2.externalSize) return 1;
|
||||
if (object1.externalSize > object2.externalSize) return -1;
|
||||
return sCollator.compare(object1.label, object2.label);
|
||||
}
|
||||
};
|
||||
|
||||
public static final AppFilter THIRD_PARTY_FILTER = new AppFilter() {
|
||||
public void init() {
|
||||
}
|
||||
@@ -712,8 +737,10 @@ public class ApplicationsState {
|
||||
entry.externalCodeSize = externalCodeSize;
|
||||
entry.externalDataSize = externalDataSize;
|
||||
entry.sizeStr = getSizeStr(entry.size);
|
||||
entry.internalSizeStr = getSizeStr(getTotalInternalSize(stats));
|
||||
entry.externalSizeStr = getSizeStr(getTotalExternalSize(stats));
|
||||
entry.internalSize = getTotalInternalSize(stats);
|
||||
entry.internalSizeStr = getSizeStr(entry.internalSize);
|
||||
entry.externalSize = getTotalExternalSize(stats);
|
||||
entry.externalSizeStr = getSizeStr(entry.externalSize);
|
||||
if (DEBUG) Log.i(TAG, "Set size of " + entry.label + " " + entry
|
||||
+ ": " + entry.sizeStr);
|
||||
sizeChanged = true;
|
||||
|
Reference in New Issue
Block a user