summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSuchi Amalapurapu <asuchitra@google.com>2010-03-24 09:05:59 -0700
committerSuchi Amalapurapu <asuchitra@google.com>2010-03-24 09:08:40 -0700
commit3d503e356f2a4ca6b5baaceec9ea0f04cf038609 (patch)
treeee0adde105dcca9973229d960283bbd5028f7f2c /src
parente4a318f15ceb1f66d75fed0dde27e866f11856cb (diff)
downloadpackages_apps_Settings-3d503e356f2a4ca6b5baaceec9ea0f04cf038609.zip
packages_apps_Settings-3d503e356f2a4ca6b5baaceec9ea0f04cf038609.tar.gz
packages_apps_Settings-3d503e356f2a4ca6b5baaceec9ea0f04cf038609.tar.bz2
When unmounting the sdcard, we are currently checking for apps that
have open file references on the sdcard. We also have to check for apps on sd that are currently running. Use the new ActivityManager api to get a list of these apps before deciding to show the dialog. Change-Id: Idb00fcbd0a3f314d75ee1662cb2b10a84569527a
Diffstat (limited to 'src')
-rw-r--r--src/com/android/settings/deviceinfo/Memory.java20
1 files changed, 3 insertions, 17 deletions
diff --git a/src/com/android/settings/deviceinfo/Memory.java b/src/com/android/settings/deviceinfo/Memory.java
index 1f7f29d..b574849 100644
--- a/src/com/android/settings/deviceinfo/Memory.java
+++ b/src/com/android/settings/deviceinfo/Memory.java
@@ -231,23 +231,9 @@ public class Memory extends PreferenceActivity implements OnCancelListener {
return true;
}
ActivityManager am = (ActivityManager)getSystemService(Context.ACTIVITY_SERVICE);
- PackageManager pm = getPackageManager();
- List<ActivityManager.RunningAppProcessInfo> runningApps = am.getRunningAppProcesses();
- if (runningApps != null && runningApps.size() > 0) {
- for (ActivityManager.RunningAppProcessInfo app : runningApps) {
- if (app.pkgList == null) {
- continue;
- }
- for (String pkg : app.pkgList) {
- try {
- ApplicationInfo info = pm.getApplicationInfo(pkg, 0);
- if ((info.flags & ApplicationInfo.FLAG_EXTERNAL_STORAGE) != 0) {
- return true;
- }
- } catch (NameNotFoundException e) {
- }
- }
- }
+ List<ApplicationInfo> list = am.getRunningExternalApplications();
+ if (list != null && list.size() > 0) {
+ return true;
}
return false;
}