Manage apps "on SD card" now shows all apps that can go on SD card.
Change-Id: Icc413891b2b884bb1af340b4c09ab3935c8e51ca
This commit is contained in:
@@ -49,6 +49,7 @@ public class ApplicationsState {
|
||||
}
|
||||
|
||||
public static interface AppFilter {
|
||||
public void init();
|
||||
public boolean filterApp(ApplicationInfo info);
|
||||
}
|
||||
|
||||
@@ -119,6 +120,9 @@ public class ApplicationsState {
|
||||
};
|
||||
|
||||
public static final AppFilter THIRD_PARTY_FILTER = new AppFilter() {
|
||||
public void init() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean filterApp(ApplicationInfo info) {
|
||||
if ((info.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0) {
|
||||
@@ -131,12 +135,16 @@ public class ApplicationsState {
|
||||
};
|
||||
|
||||
public static final AppFilter ON_SD_CARD_FILTER = new AppFilter() {
|
||||
final CanBeOnSdCardChecker mCanBeOnSdCardChecker
|
||||
= new CanBeOnSdCardChecker();
|
||||
|
||||
public void init() {
|
||||
mCanBeOnSdCardChecker.init();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean filterApp(ApplicationInfo info) {
|
||||
if ((info.flags & ApplicationInfo.FLAG_EXTERNAL_STORAGE) != 0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return mCanBeOnSdCardChecker.check(info);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -367,6 +375,10 @@ public class ApplicationsState {
|
||||
|
||||
Process.setThreadPriority(Process.THREAD_PRIORITY_FOREGROUND);
|
||||
|
||||
if (filter != null) {
|
||||
filter.init();
|
||||
}
|
||||
|
||||
List<ApplicationInfo> apps;
|
||||
synchronized (mEntriesMap) {
|
||||
apps = new ArrayList<ApplicationInfo>(mApplications);
|
||||
|
Reference in New Issue
Block a user