summaryrefslogtreecommitdiffstats
path: root/services/java/com/android/server/MountService.java
Commit message (Collapse)AuthorAgeFilesLines
* Quiet down a lot of logging.Dianne Hackborn2012-11-271-3/+3
| | | | | | | Also fix a little problem where the USER_STARTED broadcasts were not being sent as ordered broadcasts(!). Change-Id: I3aa3e0a9b3900967cdd2d115ee103371b0a50c41
* Merge "Useful annotations for code documentation." into jb-mr1.1-devJeff Sharkey2012-11-151-4/+6
|\
| * Useful annotations for code documentation.Jeff Sharkey2012-11-121-4/+6
| | | | | | | | | | Bug: 6537978 Change-Id: I806c3c09e3255f8789455f13bf37c1dde2a93f1f
* | Avoid runtime restart after vold reconnects.Jeff Sharkey2012-11-141-8/+2
|/ | | | | | | | Rely on behavior of already-released CountDownLatch instead of clearing the reference. Bug: 7290521 Change-Id: I787e673b97d18be412d5b37e279fbf1275b49151
* Handle ISE when physical volume isn't mounted.Jeff Sharkey2012-09-301-3/+10
| | | | | Bug: 7238149 Change-Id: I85081225a1a43a2c1b6f70b6275c6bbca0b3764e
* Handle multi-user mountObb() requests.Jeff Sharkey2012-09-251-101/+151
| | | | | | | | | | | | | | | | | | | | | Since emulated external storage paths differ based on execution context, carefully fix up paths for various use-cases: 1. When sending paths to DefaultContainerService, always scope OBB paths as belonging to USER_OWNER. 2. When sending paths to vold, always build emulated storage paths visible to root. 3. Always use the original untouched path when talking with apps. Mount OBB containers using shared app GID, so that an app can read the mount point across users. Handle legacy paths like "/sdcard" by resolving the canonical path before sending to MountService. Move tests to servicestests, and add tests for new path generation logic. Bug: 7212801 Change-Id: I078c52879cd08d9c8a52cc8c83ac7ced1e8035e7
* Query users excluding any being removedAmith Yamasani2012-09-201-1/+1
| | | | | | | | | | Keep track of user creation and last logged-in time. adb shell dumpsys users User switcher shouldn't show users about to be removed. No need to check for singleton for activities. Bug: 7194894 Change-Id: Ic9a59ea5bd544920479e191d1a1e8a77f8b6ddcf
* Multi-user MTP.Jeff Sharkey2012-09-181-32/+0
| | | | | | | | | | | | | | | | | | | | The current MTP kernel driver at /dev/mtp_usb is exclusive, meaning only one process can have it open. In addition, each MTP session with a desktop requires unique object IDs, which doesn't hold true across users on the device. To solve these two issues, when switching users we cycle the USB host stack to disconnect both local and remote MTP connections, giving the new user's media process a chance to claim /dev/mtp_usb, and causing the desktop to initiate a new MTP session. This change also allows BroadcastReceivers to registerReceiver() allow retrieval of a current sticky broadcast. Adds a system property to override maximum users. Removes MOUNTED broadcasts for secondary users. Allows INTERACT_ACROSS_USERS to getCurrentUser(). Bug: 6925114 Change-Id: I02b4a1b535af95fb2142655887b6d15a8068d18a
* Include user identifier in external storage paths.Jeff Sharkey2012-09-111-201/+372
| | | | | | | | | | | | | | | | | | | | | When building external storage paths, always include user in path to enable cross-user paths and aid debugging. Each Zygote process continues to only have access to the appropriate user-specific emulated storage through bind mounts. A second set of mounts continue supporting legacy /sdcard-style paths. For example, a process running as owner has these mount points: /storage/emulated_legacy /storage/emulated_legacy/Android/obb /storage/emulated/0 /storage/emulated/obb Since Environment is created before Zygote forks, we need to update its internal paths after each process launches. Bug: 7131382 Change-Id: I6f8c6971f2a8edfb415c14cb4ed05ff97e587a21
* Include primary flag in StorageVolume.Jeff Sharkey2012-09-061-3/+2
| | | | | Bug: 7003520 Change-Id: Iaae2ae22253820c954c51e0199c31087bc825f3f
* Improve multi-user broadcasts.Dianne Hackborn2012-08-301-3/+4
| | | | | | | | | | | | | | | | | | | You can now use ALL and CURRENT when sending broadcasts, to specify where the broadcast goes. Sticky broadcasts are now correctly separated per user, and registered receivers are filtered based on the requested target user. New Context APIs for more kinds of sending broadcasts as users. Updating a bunch of system code that sends broadcasts to explicitly specify which user the broadcast goes to. Made a single version of the code for interpreting the requested target user ID that all entries to activity manager (start activity, send broadcast, start service) use. Change-Id: Ie29f02dd5242ef8c8fa56c54593a315cd2574e1c
* Rename UserId to UserHandle.Dianne Hackborn2012-08-161-2/+2
| | | | | | This is the start of turning this into a formal public API. Change-Id: I5786d2c320f1de41a06ed5d0f65adb68967287a0
* am 60c77212: am 2a393a99: Merge "MountService: unlink death notification ↵Jean-Baptiste Queru2012-06-081-0/+1
|\ | | | | | | | | | | | | when unregistering listeners" * commit '60c7721210d327a464fdc95dbbe504e8eb10525c': MountService: unlink death notification when unregistering listeners
| * MountService: unlink death notification when unregistering listenersVairavan Srinivasan2012-01-241-0/+1
| | | | | | | | Change-Id: I09045cfe67f7da84bc68a50fc5440ea2c6b754e5
* | Fix bug #6522190 MountService should respond to configuration changes ↵Fabrice Di Meglio2012-05-231-4/+7
| | | | | | | | | | | | | | | | | | ("INTERNAL STORAGE" string should be translated dynamically) - use an ID instead of a String for StorageVolume description - use this ID for getting the correct localized version of the description string Change-Id: I30f3080fce2c889be38bfdf9f5121dffcf8a99e8
* | Wait for ASECs to be scanned before proceedingKenny Root2012-05-171-22/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | Move MountService up the list, then pause waiting for MountService to finish scanning ASECs before the services that require those packages to be ready. Additionally, don't automatically mark all ASEC apps as FLAG_EXTERNAL on reboot. This prevents AppWidgets and other things from being used with ASECs which are on internal storage. Bug: 6445613 Change-Id: I3e0b3e244fec966814d7a5ea93de5d337aea79bd
* | Allow forward locked apps to be in ASECsKenny Root2012-04-251-3/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We couldn't put forward-locked apps in ASEC containers before since we didn't have any permissioned filesystems. This adds the ability for forward-locked applications to be in ASEC containers. This means that forward locked applications will be able to be on the SD card now. This change also removes the old type of forward-locking that placed parts of apps in /data/app-private. Now all forward-locked applications will be in ASEC containers. Change-Id: I17ae0b0d65a4a965ef33c0ac2c47e990e55707ad
* | Package restrictions per userAmith Yamasani2012-03-221-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Packages can be enabled/disabled per user. This requires maintaining stopped/launched states and enabled / disabled components and packages per user. Refactored pm.Settings and PackageSettingsBase to keep track of states per user. Migrated the stopped-packages.xml to users/<u>/package-restrictions.xml Changed intent resolution to handle individual user restrictions. Bunch of IPackageManager calls now have a userId argument. Make AppWidgetService handle removals of packages. Added some tests for pm.Settings and PackageManager. Change-Id: Ia83b529e1df88dbcb3bd55ebfc952a6e9b20e861
* | Log netd traffic nicely.Robert Greenwalt2012-01-201-1/+5
| | | | | | | | | | | | | | | | | | Create a LocalLog class for logging within a service for dumping in dumps. Use it in the NativeDaemonConnector so we can get some insight into what is happening in these lockups. bug:5864209 Change-Id: I68ddc58847f3c8de613be9528570f8c3157d8274
* | Test the correct return code from call to cryptfs.Fredrik Roubert2011-12-201-1/+1
| | | | | | | | | | | | | | | | This was broken in commit dd519fac9b79f36a27909149a90fce4321ed1c20 (certainly by mistake), in which Integer.parseInt(tokens[1]) was errornously replaced with event.getCode(). Change-Id: Ic5af5a2ec5f321da21a4a5db25f6908462f6cae8
* | Move native vold calls to varargs.Jeff Sharkey2011-12-021-126/+75
| | | | | | | | | | | | | | | | Uses argument escaping inside NativeDaemonConnector, using varargs to separate boundaries. Bug: 5472606 Change-Id: Ie107a90df7e2b3bd3eaaf04c8367248ab40136f4
* | Move NativeDaemonConnector to varargs.Jeff Sharkey2011-11-291-1/+5
|/ | | | | | | | | Perform uniform argument escaping inside NativeDaemonConnector, using varargs to separate boundaries. Also move to parsed NativeDaemonEvent instances instead of raw Strings. Bug: 5472606 Change-Id: I1270733e2b2eeb2f6b810240df82ab24d38ebf40
* Require device encryption password to perform adb backup/restoreChristopher Tate2011-10-131-0/+47
| | | | | | | | | | | | | | This supersedes any backup-password that the user might supply. Per design, the device encryption password is also always used to encrypt the backup archive. The CL introduces two new strings, used for prompting the user for their device encryption password rather than their settings-defined "backup password" when confirming a full backup or restore operation. Bug 5382487 Change-Id: I0b03881b45437c944eaf636b6209278e1bba7a9f
* Revert encryption mapping for device wipes.Ben Komalo2011-09-091-11/+21
| | | | | | | | | | | | External storage volumes that were emulated+encrypted needed to have their encryption mapping removed so that it doesn't try to encrypt the volume after formatting them. This just wires through an argument through vold, and assumes that vold will do the right thing even if there is no encryption mapping set. Bug: 5017638 Change-Id: I858fae3d12cb415bc34637f520f71220ad9daaad
* Expose getting encryptstate through IMountServiceBen Komalo2011-09-061-5/+36
| | | | | | | | | - this really just calls cryptfs cryptocomplete - needed so that UI logic can present a factory reset option if encryption screwed up Bug: 3384231 Change-Id: I553de87f0d03a65851030c9c5266e85866d30fa6
* Default disable watchdog for vold connectionKenny Root2011-08-171-2/+7
| | | | | | | | cryptfs has long-running operations that cause the Watchdog to fire reliably when encrypting the filesystem. Disable Watchdog on MountService for this reason. Change-Id: Id03f5f60c704dcd74a8696ad9f32b5fba5381731
* Add NativeDaemonConnector users to watchdog.Jeff Sharkey2011-08-101-3/+14
| | | | | | | | | To catch instances where NativeDaemonConnector hangs while executing commands, add users to system_server watchdog. Also moved qtaguid enabler to separate thread to prevent blocking systemReady(). Bug: 5145437 Change-Id: I4c6c1dc09864a1c05f9486a31faa1b366548e911
* During encryption, don't throw exceptions for unknown vold stateKen Sumrall2011-07-151-1/+5
| | | | | | | | | | This is a temporary fix until we get something better. During the encryption process, vold does not respond to commands because it is blocked doing the encryption. Because it doesn't respond, this code times out, sets the state to null, and thows an exception. For now, just don't throw an exception if the device is encrypting. Change-Id: I7e821ec2addd60475fb10834df533beccb2650fe
* Add StorageVolume list to MountService dumpKenny Root2011-07-131-0/+13
| | | | Change-Id: If2be6e420d9671032d2e7a66c71a6733e6e48ac8
* MTP: Return error if user tries to copy a file >= 4GB to a FAT32 file systemMike Lockwood2011-07-111-2/+6
| | | | | | | Bug: 4561836 Change-Id: I2bffb93b032038f6c220c24c752ccd7ca66c23a0 Signed-off-by: Mike Lockwood <lockwood@android.com>
* Plumb information from the framework about asec container size.Dianne Hackborn2011-06-281-0/+24
| | | | Change-Id: Ie0ec3cb6d463aefa341a8cbea80be790451ba5e3
* MountService: Use UsbManager to monitor USB state for mass storageMike Lockwood2011-06-171-60/+19
| | | | | Change-Id: I50c15c1dc8a1ee4f41cac7de8df9529ff5da1053 Signed-off-by: Mike Lockwood <lockwood@android.com>
* StorageVolume: Add allowMassStorage flagMike Lockwood2011-06-071-2/+6
| | | | | Change-Id: I9d19e635bb06e50068d7e4e6919322bd5bb2e00f Signed-off-by: Mike Lockwood <lockwood@android.com>
* am 49b9449b: am d8d84708: am 988b6648: Merge "MountService: Add ↵Mike Lockwood2011-05-241-30/+36
|\ | | | | | | | | | | | | StorageVolume as extra in storage related broadcasts." into honeycomb-mr2 * commit '49b9449b6605c7b4f77f9a0635ba93f7dfa0ea47': MountService: Add StorageVolume as extra in storage related broadcasts.
| * am d8d84708: am 988b6648: Merge "MountService: Add StorageVolume as extra in ↵Mike Lockwood2011-05-231-30/+36
| |\ | | | | | | | | | | | | | | | | | | storage related broadcasts." into honeycomb-mr2 * commit 'd8d8470825a637843d45a3b436e80a3b85f1dd11': MountService: Add StorageVolume as extra in storage related broadcasts.
| | * MountService: Add StorageVolume as extra in storage related broadcasts.Mike Lockwood2011-05-231-30/+36
| | | | | | | | | | | | | | | Change-Id: I8e1a21ae233ba9812e58b363b59a66b260a01cbf Signed-off-by: Mike Lockwood <lockwood@android.com>
* | | am 53b988ba: am 5a79cfd7: am 27ac64ec: Merge "StorageVolume: Add ↵Mike Lockwood2011-05-181-0/+5
|\ \ \ | |/ / | | | | | | | | | | | | | | | getStorageId() accessor" into honeycomb-mr2 * commit '53b988ba1842f40e595bb85f2ca055c24787e6dc': StorageVolume: Add getStorageId() accessor
| * | am 5a79cfd7: am 27ac64ec: Merge "StorageVolume: Add getStorageId() accessor" ↵Mike Lockwood2011-05-171-0/+5
| |\ \ | | |/ | | | | | | | | | | | | | | | into honeycomb-mr2 * commit '5a79cfd7518defdce1911cecbc2441bb0a057e54': StorageVolume: Add getStorageId() accessor
| | * StorageVolume: Add getStorageId() accessorMike Lockwood2011-05-171-0/+5
| | | | | | | | | | | | | | | | | | | | | This ID is used for MTP as well as per volume querying in the media provider. Change-Id: Ic4fc986d972bd477730643f7e9450c390c0b3a4b Signed-off-by: Mike Lockwood <lockwood@android.com>
* | | resolved conflicts for merge of fc4a3d37 to masterMike Lockwood2011-05-161-13/+96
|\ \ \ | |/ / | | | | | | Change-Id: I40f603ba9330c3e882f4d58398095f4094725b21
| * | am b822d246: am 0a93d875: Merge "StorageManager: Clean up and generalize ↵Mike Lockwood2011-05-161-13/+96
| |\ \ | | |/ | | | | | | | | | | | | | | | storage configuration resources" into honeycomb-mr2 * commit 'b822d2464dc59056f736b0c49f0ac514c7cbb9d9': StorageManager: Clean up and generalize storage configuration resources
| | * StorageManager: Clean up and generalize storage configuration resourcesMike Lockwood2011-05-161-13/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace config_emulateExternalStorage, config_externalStorageRemovable, config_externalStoragePaths, config_externalStorageDescriptions and config_mtpReserveSpaceMegabytes resources with an XML resource file to describe the external storages that are available. Add android.os.storage.StorageVolume class StorageManager.getVolumeList() now returns an array of StorageVolume Change-Id: I06ce1451ebf08b82f0ee825d56d59ebf72eacd3d Signed-off-by: Mike Lockwood <lockwood@android.com>
| | * DO NOT MERGE MountService: Fix running media scanner at boot.Mike Lockwood2011-05-031-0/+7
| | | | | | | | | | | | | | | Change-Id: I67ff2ccde7e03143167b8c59726ffb741c96e028 Signed-off-by: Mike Lockwood <lockwood@android.com>
| | * DO NOT MERGE Fix deadlock in MountServiceMike Lockwood2011-05-031-17/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is not safe to call into vold with a lock held on mVolumeStates since we will receive events back from vold on a different thread. So in the boot completed handler we make a copy of the volume list and then call vold to mount volumes after releasing the lock Change-Id: Ic9836c2e1e8a5677d0c4e33476a72081f69823a0 Signed-off-by: Mike Lockwood <lockwood@android.com>
| | * DO NOT MERGE StorageManager: Add getVolumeList() and getVolumeState() methodsMike Lockwood2011-05-031-0/+13
| | | | | | | | | | | | | | | Change-Id: I43d5c1730b340f1288b58012234b38f801001b71 Signed-off-by: Mike Lockwood <lockwood@android.com>
| | * DO NOT MERGE MountService: Add support for multiple volumesMike Lockwood2011-05-031-108/+111
| | | | | | | | | | | | | | | Change-Id: I45ee0e5735a6d72c635f6d22320e8b13bccc3847 Signed-off-by: Mike Lockwood <lockwood@android.com>
| * | am 10fbba21: DO NOT MERGE MountService: Fix running media scanner at boot.Mike Lockwood2011-05-041-0/+7
| |\ \ | | | | | | | | | | | | | | | | * commit '10fbba21e4827a1582d97aa99e4e8d772ce04920': DO NOT MERGE MountService: Fix running media scanner at boot.
| | * | DO NOT MERGE MountService: Fix running media scanner at boot.Mike Lockwood2011-05-041-0/+7
| | | | | | | | | | | | | | | | | | | | Change-Id: Ia56573023f21fa067a14e7d3ac5a6dbd51ecc8a7 Signed-off-by: Mike Lockwood <lockwood@android.com>
| * | | am 0aa5d7b7: DO NOT MERGE Fix deadlock in MountServiceMike Lockwood2011-05-041-17/+32
| |\ \ \ | | |/ / | | | | | | | | | | | | * commit '0aa5d7b7f225236ac8461d0b6835b9c6152a2699': DO NOT MERGE Fix deadlock in MountService
| | * | DO NOT MERGE Fix deadlock in MountServiceMike Lockwood2011-05-041-17/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is not safe to call into vold with a lock held on mVolumeStates since we will receive events back from vold on a different thread. So in the boot completed handler we make a copy of the volume list and then call vold to mount volumes after releasing the lock Change-Id: Iaadfb1b8be5567c8e228a8fbc69d4d483c8dc987 Signed-off-by: Mike Lockwood <lockwood@android.com>