63 Commits

Author SHA1 Message Date
Suchi Amalapurapu
7af074a612 Forcibly unmount the sdcard after N retries.
Don't rely on the ActivityManager's reported status about killing the
storage user process since the process might have gone away in between.

Change-Id: Ia7fa43eb34553329e7ff611ab6b99375b5ae673a
2010-04-06 10:02:34 -07:00
San Mehat
a507859797 MountService: Switch all Log -> Slog
Change-Id: Id33c76497e9d963f295ef6e99d850223ca59b6cd
Signed-off-by: San Mehat <san@google.com>
2010-03-25 10:03:39 -07:00
San Mehat
2d66cef77e Asec: Add new 'StorageNotFound' response code handling for container paths
Change-Id: I45d113f77b9f0e519087356b70fc6c4b5c290935
Signed-off-by: San Mehat <san@google.com>
2010-03-23 11:14:36 -07:00
Kenny Root
f030462c83 Make trying to remount an asec container non-fatal
If an asec container is already mounted for some reason, start tracking
it in the MountService's internal state and tell the caller we had
success mounting the secure container.

Change-Id: I5bb0f84b2bafc0cd2dba248c35a8d68fd53ef1b2
2010-03-22 13:08:52 -07:00
Suchi Amalapurapu
e99bb5f10b Add new method call back in MountService.
PackageManager invokes this call back when its done handling
the media status update.
Add new uid check for updateExternalMediaStatus
Change killPids method in ActivityManager.
Remove mountsd command in Pm.java We cannot arbitrarily enable/disable
packages in PackageManager now.

Change-Id: I28dcba4afd2b4486f68abdaa1628a31b66544c91
2010-03-22 10:49:49 -07:00
San Mehat
6a25440323 MountService: Handle volumes shared on startup
Change-Id: I7c38607adee7c89f27c24285a7ace2b9c87e7f30
Signed-off-by: San Mehat <san@google.com>
2010-03-22 10:21:00 -07:00
Suchi Amalapurapu
8a9ab24a5c Do storage checks before initiating a move.
Add new remote method to check for insufficient error conditions.
Some fixes in MountService when updating media status on PackageManagerService
Fix size calculation condition in installd.

Add new error code if media is unavailable.
New tests for testing error codes.
Some additional debugging statements in MountService.

Change-Id: Ibfe90d5ed6c71d57f9c1c67806f38b5ae9ecdfbf
2010-03-16 16:36:26 -07:00
Daniel Sandler
5f27ef4968 Move MountService's Handler to a different thread.
This should help avoid blocking the system UI during storage
operations.

Change-Id: Ic53cb370baf47e8b00476706ac8df45645a2d814
2010-03-16 15:44:38 -04:00
San Mehat
2fe718a87b MountService: If USB cable is unplugged while UMS is active, clean up and remount
Change-Id: I9c20e7bfc215549cd8a6e14625e5d005bb53f8fa
Signed-off-by: San Mehat <san@google.com>
2010-03-11 12:01:49 -08:00
Suchi Amalapurapu
6ffce2e9a3 Add new shutdown observer for MountService.
Use new observer before rebooting and shutting down.
Add some unit tests for unmount and shutdown code paths
Fix registering/unregistering part in MountService
Use ShutdownThread in PowerManager.reboot()
Add reboot support to ShutdownThread.
Remove MountService code from PowerManagerService.java and Power.java.
Clean shutdown/reboot is handled exclusively by ShutdownThread now.

Change-Id: Iefb157451d3d9c426cb431707b870a873c09123d
2010-03-09 17:00:18 -05:00
Suchi Amalapurapu
9b10ef5fe8 Rework the way PackageManager binds to default container service.
Clean up stale containers when enabling/disabling packages on sdcard.
Check the path of packages which are being enabled.
Make sure gc's are done prior to destroying containers when moving applicati
as well as enabling/disabling packages for sdcard mount status changes.

Some miscellaneous issues
   Remove hack to avoid renaming containers.
   Fix test with forward locked apps
   Remove adding container id to asec list when renaming
   Some cosmetic changes to DefaultContainerService
2010-03-03 14:06:10 -08:00
Mike Lockwood
bf2dd44a6f MountService: Send ACTION_MEDIA_UNSHARED Intent a volume is no longer shared via UMS.
Change-Id: I21c887ae76eccabcc5d8449aa0a38e98758e8958
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-03-03 06:16:52 -05:00
Suchi Amalapurapu
0eec21d97d Add dialog to display storage users when enabling/disabling ums
Some error dialogs and related strings
MountService changes to follow unmount path when enabling ums.

Please note that MountService api setUmsEnabled does not return
error codes for now. This is a known limitation.
2010-02-26 12:48:21 -08:00
Suchi Amalapurapu
c42e29e0a5 Add new handler mechanism in MountService to make unmount api asynchronous.
MountService updates state on PackageManager and then tries to
kill processes holding file references to media about to be unmounted by
invoking api on ACtivityManager. This is retried upto 4 times to make sure all
processes holding file references are killed before unmounting the media
at specified path.

Also changed PackageManger api to return boolean value to indicate if
MountService is likely to receive broadcasts related to apps on sd.
2010-02-24 20:30:03 -08:00
San Mehat
6a965af2d7 MountService: Send UMS_CONNECTED broadcast on boot if UMS connected.
UMS detection is now done wayyyy before the system is booted, so set a flag
to send our intent broadcast once we've booted.

Signed-off-by: San Mehat <san@google.com>
2010-02-24 18:14:18 -08:00
San Mehat
85451ee15f MountService: Fix bug which would allow apps to try to rename a container whos dst is mounted
Signed-off-by: San Mehat <san@google.com>
2010-02-24 08:54:18 -08:00
San Mehat
3d4881067a MountService: Force unmount when enabling ums
Signed-off-by: San Mehat <san@google.com>
2010-02-22 13:08:44 -08:00
San Mehat
fafb041b47 MountService: Move boot-time mount to a thread - avoids ANR at boot
Signed-off-by: San Mehat <san@google.com>
2010-02-19 06:51:58 -08:00
Marco Nelissen
c34ebce475 Make MountService work in the simulator. 2010-02-18 13:59:05 -08:00
San Mehat
d970998b0d framework: storage: Add 'force' option to unmount/destroy storage apis, and update callsites.
Also adds additional storage unit tests

Signed-off-by: San Mehat <san@google.com>
2010-02-18 11:48:48 -08:00
San Mehat
c1b4ce93be MountService: Add API call for getting a list of pids currently using the specified mountpoint
Signed-off-by: San Mehat <san@google.com>
2010-02-16 17:13:03 -08:00
San Mehat
a181b21305 MountService: Fix some mountset bugs and tighten up some return values
Signed-off-by: San Mehat <san@google.com>
2010-02-11 06:50:31 -08:00
San Mehat
6cdd9c0856 MountService: Add isSecureContainerMounted() API call
Signed-off-by: San Mehat <san@google.com>
2010-02-09 18:46:05 -08:00
San Mehat
59443a673a MountService: Check for failure to unmount when enabling UMS and fix reversed logic
Signed-off-by: San Mehat <san@google.com>
2010-02-09 13:28:45 -08:00
San Mehat
b104340496 Framework: Clean up / Refactor Mount APIs
- Move android.storage.* -> android.os.storage.* and refactor users
 - Refactor generic shares back to explicit ums enable/disable/isEnabled
 - Remove media insert/removed event callbacks (not ready for Froyo)
 - Remove 'label' from volume state change callbacks
 - Add public API functions for enabling/disabling USB mass storage (permissions enforced
   in MountSevice)
 - Remove some stray un-needed import lines
 - Move android.os.IMountService / android.os.IMountServiceListener -> android.os.storage
 - Improve code comments

Updated:
  MountService: Add dup state check and move debugging behind a conditional
  UsbStorageActivity: Fix review comments + a TODO
  StorageNotification: Add @Override tags
  StorageManager: Don't use a static Listener list
  MountService: Reduce bloat and fix == where I meant .equals()
  PackageManagerTests: Update for new API

Signed-off-by: San Mehat <san@google.com>
2010-02-09 11:03:16 -08:00
San Mehat
207e538350 MountService: Harden for pre-boot usage users
- Connection to native daemon now happens on creation instead of ON_BOOT
- Don't emit share change broadcasts before system is booted
- Protect against public API usage before we're ready

Signed-off-by: San Mehat <san@google.com>
2010-02-08 19:29:58 -08:00
San Mehat
f919cd02df MountService: Add WARN checks to ASEC calls to catch bad users
Signed-off-by: San Mehat <san@google.com>
2010-02-08 19:29:58 -08:00
Suchi Amalapurapu
b56ae20b22 Rename media resource broadcasts
Add checks for fwdlocked and updated system apps
add more tests
remove duplicate adds
2010-02-08 14:52:25 -08:00
San Mehat
4270e1ea74 MountService: Massive bloat reduction and rewrite
- Most API calls now return an int as a result code (see MountServiceResultCode.java)
- All notification code has been removed
- All settings code has been removed
- Removed UMS centric API calls in favor of more generic 'shares'
- Mount error reporting is no longer done via an event, but is done as part of the
  actual mount process
- Rework vold IPC commands to be more sane

Updated:
    MountService: Rename MountServiceObserver -> MountServiceListener
    MountService: Add support for Async callbacks

Updated:
    MountService: Add BinderDeath handling

Updated:
    MountService: Remove notifys since we dont listen anyways

Updated:
    MountService: Fix bad cast

Signed-off-by: San Mehat <san@google.com>
2010-02-02 11:17:46 -08:00
Daniel Sandler
d425a45f8d Fix build.
(Broken in change Ib94f795c.)
2010-01-29 10:09:04 -05:00
Daniel Sandler
b94f795c25 New full-screen activity for USB mass storage interaction.
Still TODO: patch into forthcoming callbacks from
MountService so the USB storage activity always shows the
correct state of the device. (Right now it only refreshes
its display onResume.)

Bug: 2299129
2010-01-28 16:18:22 -05:00
Suchi Amalapurapu
40b5110e74 Remove destroy asec command when mounting secure container 2010-01-27 23:46:13 -08:00
San Mehat
02735bc9b7 MountService: Introduce new @hide permissions to protect secure containers.
Signed-off-by: San Mehat <san@google.com>
2010-01-27 06:14:28 -08:00
San Mehat
c2a3947164 MountService: Don't update the storage status when we're unmounted
Signed-off-by: San Mehat <san@google.com>
2010-01-26 16:52:23 -08:00
San Mehat
5b77dab234 MountService: Explicitly query volume state on startup
Signed-off-by: San Mehat <san@google.com>
2010-01-26 13:28:50 -08:00
San Mehat
45f6104082 MountService: Add support for renaming secure containers
Signed-off-by: San Mehat <san@google.com>
2010-01-23 08:12:43 -08:00
San Mehat
3e3a6430ea Fix whitespace issue causing protocol syntax error
Signed-off-by: San Mehat <san@google.com>
2010-01-22 16:46:23 -08:00
San Mehat
8ab6135841 MountService: Codeshrink
Signed-off-by: San Mehat <san@google.com>
2010-01-20 18:14:09 -08:00
Suchi Amalapurapu
fd3530f905 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.
2010-01-19 14:04:54 -08:00
San Mehat
9dba709d44 MountService: Add new 'unmountSecureContainer' API call
Signed-off-by: San Mehat <san@google.com>
2010-01-18 06:49:19 -08:00
San Mehat
5fbf4094f5 MountService: Suppress media removed notification when enabling UMS
Signed-off-by: San Mehat <san@google.com>
2010-01-16 06:11:27 -08:00
San Mehat
22dd86e055 MountService: Refactor to use NativeDaemonConnector and clean-up
Signed-off-by: San Mehat <san@google.com>
2010-01-12 14:12:16 -08:00
Jean-Baptiste Queru
fa101530bc resolved conflicts for merge of d26707da to master
Change-Id: I1a379194f70c4b14191333ca2d8e6dd9d8b0f9dd
2010-01-12 11:53:42 -08:00
San Mehat
7ebf017658 framework: storage: Ensure that filesystems are unmounted before shutdown/reboot
Signed-off-by: San Mehat <san@google.com>
2010-01-12 07:57:42 -08:00
San Mehat
0f5525ad3b framework: asec: Rename 'Cache' -> 'Container'
Signed-off-by: San Mehat <san@google.com>
2010-01-11 10:15:16 -08:00
San Mehat
f96135857f MountService: Clean up some logspam
Signed-off-by: San Mehat <san@google.com>
2010-01-11 08:20:59 -08:00
San Mehat
1f6301e1ff MountService: Add new Settings for UMS prompting and notification behavior
Signed-off-by: San Mehat <san@google.com>
2010-01-08 12:56:33 -08:00
San Mehat
dde2539798 MountService: Remove ACTION_SHUTDOWN handler
Shutdown handlers run too early for unmounting, so don't handle it.
Shutdown will be called explicitly from the ShutdownThread

Signed-off-by: San Mehat <san@google.com>
2010-01-07 11:36:22 -08:00
San Mehat
91c7761139 MountService: Add an ACTION_SHUTDOWN handler and export a method for external shutdown
Signed-off-by: San Mehat <san@google.com>
2010-01-07 10:39:41 -08:00
San Mehat
3697229cc7 framework: MountService: Add initial support for Android Secure External Caches
Signed-off-by: San Mehat <san@google.com>
2010-01-06 13:54:41 -08:00