diff options
author | Suchi Amalapurapu <asuchitra@google.com> | 2010-01-18 00:15:59 -0800 |
---|---|---|
committer | Suchi Amalapurapu <asuchitra@google.com> | 2010-01-19 14:04:54 -0800 |
commit | fd3530f90562bb7e66edfee39d90fc8beda82f1d (patch) | |
tree | 3829a74034270ac5434a0863e5dd115172443dfc /cmds/pm | |
parent | 97d1195832829905b07b7680b73bed8af959f430 (diff) | |
download | frameworks_base-fd3530f90562bb7e66edfee39d90fc8beda82f1d.zip frameworks_base-fd3530f90562bb7e66edfee39d90fc8beda82f1d.tar.gz frameworks_base-fd3530f90562bb7e66edfee39d90fc8beda82f1d.tar.bz2 |
Mount/Unmount secure containers
Persist flags in PackageSetting. Flags are relevant to ApplicationInfo.FLAG_SYSTEM, Application.FLAG_ON_SDCARD, ApplicationInfo.FLAG_FORWARD_LOCK.
New pm command to simulate mount/unmount in Pm. This will be removed
when MountService/vold event generation gets fixed.
Calls from MountService into PackageManager when media gets mounted/unmounted.
Scan the packages and grant permissions when the sdcard gets mounted.
This api might change again.
Diffstat (limited to 'cmds/pm')
-rw-r--r-- | cmds/pm/src/com/android/commands/pm/Pm.java | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/cmds/pm/src/com/android/commands/pm/Pm.java b/cmds/pm/src/com/android/commands/pm/Pm.java index 4953f5d..68373cb 100644 --- a/cmds/pm/src/com/android/commands/pm/Pm.java +++ b/cmds/pm/src/com/android/commands/pm/Pm.java @@ -92,6 +92,11 @@ public final class Pm { return; } + if ("mountsd".equals(op)) { + runMountSd(); + return; + } + if ("uninstall".equals(op)) { runUninstall(); return; @@ -637,6 +642,37 @@ public final class Pm { } } + private void runMountSd() { + String opt; + boolean mount = false; + while ((opt=nextOption()) != null) { + if (opt.equals("-m")) { + String mountStr = nextOptionData(); + if (mountStr == null) { + System.err.println("Error: no value specified for -m"); + showUsage(); + return; + } + if ("true".equalsIgnoreCase(mountStr)) { + mount = true; + } else if ("false".equalsIgnoreCase(mountStr)) { + mount = false; + } else { + System.err.println("Error: no value specified for -m"); + showUsage(); + return; + } + } + } + + try { + mPm.updateExternalMediaStatus(mount); + } catch (RemoteException e) { + System.err.println(e.toString()); + System.err.println(PM_NOT_RUNNING_ERR); + } + } + class PackageDeleteObserver extends IPackageDeleteObserver.Stub { boolean finished; boolean result; @@ -826,6 +862,7 @@ public final class Pm { System.err.println(" pm path PACKAGE"); System.err.println(" pm install [-l] [-r] [-t] [-i INSTALLER_PACKAGE_NAME] [-s] PATH"); System.err.println(" pm uninstall [-k] PACKAGE"); + System.err.println(" pm mountsd [-m true/false]"); System.err.println(" pm enable PACKAGE_OR_COMPONENT"); System.err.println(" pm disable PACKAGE_OR_COMPONENT"); System.err.println(""); @@ -862,6 +899,9 @@ public final class Pm { System.err.println(" -k: keep the data and cache directories around."); System.err.println("after the package removal."); System.err.println(""); + System.err.println("The mountsd command simulates mounting/unmounting sdcard.Options:"); + System.err.println(" -m: true or false."); + System.err.println(""); System.err.println("The enable and disable commands change the enabled state of"); System.err.println("a given package or component (written as \"package/class\")."); } |