• Home
  • History
  • Annotate
  • only in /frameworks/base/core/java/android/os/storage/
History log of /frameworks/base/core/java/android/os/storage/
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
bbb5717dee12ec37e0fcc6c186e1f80b9890e987 20-Aug-2015 Jeff Sharkey <jsharkey@google.com> am f3ad1eab: Merge "Pass underlying volume UUID to StorageVolume." into mnc-dev

* commit 'f3ad1eabc1fa5252165bfe1516690d1026507f0a':
Pass underlying volume UUID to StorageVolume.
8e2ea2a9f15217bd5e44665650251f83f3f70313 19-Aug-2015 Jeff Sharkey <jsharkey@android.com> Pass underlying volume UUID to StorageVolume.

To help MediaProvider uniquely identify storage devices, pass through
the UUID of the underlying private storage volume.

Bug: 23329611
Change-Id: I22ee7ea98fcb208d7797310acb3396a3f074f09b
olumeInfo.java
acfaa947f45ce1ea8140c2dc52d5f750dbc0a94d 29-Jul-2015 Jeff Sharkey <jsharkey@google.com> am b8040265: Merge "Give secondary users read-only physical cards." into mnc-dev

* commit 'b8040265dd0d5a2a96e0850623647dad2f528db1':
Give secondary users read-only physical cards.
4634987668eb7e1fa1434bddbde969ef43de6b40 28-Jul-2015 Jeff Sharkey <jsharkey@android.com> Give secondary users read-only physical cards.

Long ago, we mounted secondary physical cards as readable by all
users on the device, which enabled the use-case of loading media on
a card and viewing it from all users.

More recently, we started giving write access to these secondary
physical cards, but this created a one-directional channel for
communication across user boundaries; something that CDD disallows.

This change is designed to give us the best of both worlds: the
package-specific directories are writable for the user that mounted
the card, but access to those "Android" directories are blocked for
all other users. Other users remain able to read content elsewhere
on the card.

Bug: 22787184
Change-Id: Ied8c98995fec1b7b50ff7d930550feabb4398582
MountService.java
torageManager.java
olumeInfo.java
eb16e1fb2225f2cf84f5c56242a187fba59e39f8 16-Jul-2015 Svetoslav <svetoslavganov@google.com> am 08dda27b: Merge "Make sure we get valid package name or fail." into mnc-dev

* commit '08dda27be4678f2ab5bdc7e210d511ec105c158c':
Make sure we get valid package name or fail.
7395cbf07048abdad24b056f30a46f5b67920cd8 16-Jul-2015 Svetoslav <svetoslavganov@google.com> Make sure we get valid package name or fail.

bug:22492225

Change-Id: I7b7dce9a8e398c4615bcb700de80241e94c4320c
torageManager.java
c7a607496aa5ba368524dd334877a9c428ab5f78 14-Jul-2015 Jeff Sharkey <jsharkey@android.com> am d3719ab0: Merge "Better handling of storage paths." into mnc-dev

* commit 'd3719ab07a0ba66c019979ce19c45b77c4aae92e':
Better handling of storage paths.
983294596e65a0226aa69e42bda9db322727fee5 13-Jul-2015 Jeff Sharkey <jsharkey@android.com> Better handling of storage paths.

Give more details about why we failed to create storage paths, and
search for underlying volumes using canonical paths.

Bug: 22135060
Change-Id: I75d3584403ece310438b05f5b9fe72d94c9096c6
torageManager.java
c56668eb223fe45ff5c1e399d99943838320c407 14-Jul-2015 Marco Nelissen <marcone@google.com> am 3ced9617: Merge "Use original path if translated path doesn\'t exist" into mnc-dev

* commit '3ced96178b1b132705e773736cbb707a3a0cd951':
Use original path if translated path doesn't exist
aa4110366813f29f6a71dbdee090ba823feb2efe 14-Jul-2015 Marco Nelissen <marcone@google.com> Use original path if translated path doesn't exist

Bug: 22376538
Change-Id: I2f6af4fa31c097e2e2d619a068cf83721091c450
torageManager.java
d7be214ca469c593d8a59cf7404020f4ad1aaed9 14-Jul-2015 Ian Pedowitz <ijpedowitz@google.com> resolved conflicts for merge of 8cee6587 to mnc-dr-dev

Change-Id: I0b2ed52214bb097d7fd69434afd0c6c890b5afb3
6ee871e59812fea4525c50231f677c4bd10c74b8 10-Jul-2015 Svet Ganov <svetoslavganov@google.com> Teach storage appops.

For modern apps targeting M SDK and up the external storage state
is deterined by granted permissions. For apps targeting older SDK
the storage access is determined by app ops correspning to the
storage permissions as the latter are always granted.

When app ops change we do not remount as we kill the app process
in both cases enabling and disabling an app op since legacy code
is not prepared for dynamic behavior where an operation that failed
may next succeed. Hence, we remount when we start the app.

For modern apps we don't kill the app process on a permission
grant, therefore we synchronously remount the app storage.

bug:22104923

Change-Id: I601c19c764a74c2d15bea6630d0f5fdc52bf6a5a
MountService.java
ountServiceInternal.java
torageManager.java
olumeInfo.java
bac3d0936dfdb4d594873fd8690e8017e748ed96 13-Jul-2015 Paul Crowley <paulcrowley@google.com> Merge "Delete the user key when deleting a user." into mnc-dr-dev
9e0e69915a2e45dd5ba158e0436571551a672636 13-Jul-2015 Paul Crowley <paulcrowley@google.com> Merge "Use mount service to create user dirs." into mnc-dr-dev
7ec733fad39ff9e439a67c9cf51b88bc84cdfda0 19-May-2015 Paul Crowley <paulcrowley@google.com> Delete the user key when deleting a user.

Bug: 19706593

(cherry-picked from commit 85e4e818d83dbc65b1e6e3ed9d39c656188acaec)

Change-Id: Icc6d53a99558317b2ec154f931e481ad9fe64aa3
MountService.java
torageManager.java
bcf48ed2262d655ebf59153dea645ca761b73db5 22-Apr-2015 Paul Crowley <paulcrowley@google.com> Use mount service to create user dirs.

Bug: 19704432

(cherry-picked from commit 9102f5d953fbde03e12f385b2225004edc43d202)

Change-Id: I64a2c85beef115158feed3953deae32f692e750f
MountService.java
torageManager.java
a83bf1966e3e51fb052db86daf359d5b1cc110f5 08-Jul-2015 Jeff Sharkey <jsharkey@android.com> Use best volume description for MTP.

Otherwise we end up showing adopted storage devices as "Unknown."

Bug: 20275423
Change-Id: Ib42474fd5b3284b1e8eca7de8a4cfbb71a34a107
olumeInfo.java
5af1835d678031d4a6615edc96ba58c82304b31d 08-Jul-2015 Jeff Sharkey <jsharkey@android.com> Generate stable MTP storage IDs.

It ends up that MediaProvider is persisting MTP storage IDs in its
database, so we need to make sure we generate stable IDs over time,
otherwise we can end up looking into a black hole.

Bug: 22256092
Change-Id: I6a75c239aac1b71fd5f6df0df69b24971079a086
torageVolume.java
olumeInfo.java
7a788a865e72da4205b5cf4e0a6f08ccb6f4bdbd 07-Jul-2015 Jeff Sharkey <jsharkey@android.com> Fix volume naming when surfaced over MTP.

Otherwise we show everything as "Unknown."

Bug: 22256092
Change-Id: I19fe8a25aff02db8ca9aff288e6715d469f65327
olumeInfo.java
ef10ee014594d800f5f5ca31ea93f1cab2880d05 05-Jul-2015 Jeff Sharkey <jsharkey@android.com> Handle missing migration source volume.

Users can try migrating primary storage while the current location
is missing/unmounted. Fail gracefully instead of runtime restarting.

Bug: 21927076
Change-Id: I40645f8ccea05154e7cbacd188f6cba5f4dbbdc4
torageManager.java
6dce4964b4d1a13d276d95730b8fb09d6a5a8d04 04-Jul-2015 Jeff Sharkey <jsharkey@android.com> Reconcile private volumes when mounted.

Many things can happen while a private volume is ejected, so we need
to reconcile newly mounted volumes against known state.

First, user IDs can be recycled, so we store the serial number in the
extended attributes of the /data/user/[id] directory inode. Since a
serial number is always unique, we can quickly determine if a user
directory "10" really belongs to the current user "10". When we
detect a mismatched serial number, we destroy all data belonging to
that user. Gracefully handles upgrade case and assumes current serial
number is valid when none is defined.

Second, we destroy apps that we find no record of, either due to
uninstallation while the volume was unmounted, or reinstallation on
another volume.

When mounting a volume, ensure that data directories exist for all
current users. Similarly, create data directories on all mounted
volumes when creating a user. When forgetting a volume, gracefully
uninstall any apps that had been installed on that volume.

Bug: 20674082, 20275572
Change-Id: I4e3448837f7c03daf00d71681ebdc96e3d8b9cc9
torageManager.java
e8a4b66960056c2dc2c8dbb5f8df00710645cc64 28-Jun-2015 Jeff Sharkey <jsharkey@android.com> Better handling of trim/benchmark results.

Request benchmarking of devices once per week during normal fstrim
maintenance window. Tunable parameter gives us the ability to change
frequency through global setting.

Track individual benchmark and trim results for each volume, and
use scrubbed volume identifier (based on adoptiong age) when logging
stats to drop box. Track last benchmark and trim time for each
volume separately.

Bug: 21831325
Change-Id: I53b3ed788f7820c2e5bceb2840339f5b4aada3f0
iskInfo.java
olumeRecord.java
9527b223a9d4a4d149bb005afc77148dbeeff785 25-Jun-2015 Jeff Sharkey <jsharkey@android.com> Let's reinvent storage, yet again!

Now that we're treating storage as a runtime permission, we need to
grant read/write access without killing the app. This is really
tricky, since we had been using GIDs for access control, and they're
set in stone once Zygote drops privileges.

The only thing left that can change dynamically is the filesystem
itself, so let's do that. This means changing the FUSE daemon to
present itself as three different views:

/mnt/runtime_default/foo - view for apps with no access
/mnt/runtime_read/foo - view for apps with read access
/mnt/runtime_write/foo - view for apps with write access

There is still a single location for all the backing files, and
filesystem permissions are derived the same way for each view, but
the file modes are masked off differently for each mountpoint.

During Zygote fork, it wires up the appropriate storage access into
an isolated mount namespace based on the current app permissions. When
the app is granted permissions dynamically at runtime, the system
asks vold to jump into the existing mount namespace and bind mount
the newly granted access model into place.

Bug: 21858077
Change-Id: I62fb25d126dd815aea699b33d580e3afb90f8fd2
MountService.java
torageManager.java
5cc0df214bbe2b169150c9060dc5288bb8aaf338 18-Jun-2015 Jeff Sharkey <jsharkey@android.com> Forget private partition keys.

When we forget a private partition, ask vold to also forget the key
for that partition GUID. This means we need to track both the
filesystem UUID and the partition GUID for a private volume.

Bug: 21782268
Change-Id: Icda1cbb65539d61dacc663428daf3d1a2e4c313e
olumeInfo.java
olumeRecord.java
80b34d7b9da0e0738a4a1db78d83cd804372594b 13-Jun-2015 Makoto Onuki <omakoto@google.com> Merge "Add StorageEventListener.onDiskDestroyed()" into mnc-dev
c7acac6798e12780194af33d5a9fdf382ab17155 13-Jun-2015 Jeff Sharkey <jsharkey@android.com> More useful extras in disk/volume broadcasts.

Change-Id: I594166cff332aaf72b2b6357ac6ed3e6e42cbc49
iskInfo.java
olumeInfo.java
9dc575d63c5f0d7511308bd2cd3d5dbd20c15e17 13-Jun-2015 Makoto Onuki <omakoto@google.com> Add StorageEventListener.onDiskDestroyed()

Bug 21336042

Change-Id: I226cf205191dd302ff8d5156f9ae0fe8fc5b2c2b
MountServiceListener.java
torageEventListener.java
torageManager.java
47b872d9c36347382dd24ad5c3f70490d8fcbb23 11-Jun-2015 Jeff Sharkey <jsharkey@android.com> Ignore some more generic USB device names.

Bug: 21376386
Change-Id: I8c1b1cf9d881ad2795e9b15740ff511260572f1b
iskInfo.java
5fc247338dfc1a817f708163201cdf395cff3303 10-Jun-2015 Jeff Sharkey <jsharkey@android.com> New strings!

Bug: 21737573, 21666225, 21756698, 21737666, 21471429
Change-Id: If1c5882d48f798d311f6d2b86277d3c13f06824e
olumeInfo.java
3452d2d0dbffc74a87751b39da9fa40d88d5c91f 26-May-2015 Paul Lawrence <paullawrence@google.com> Merge "Honor password visible setting in CryptKeeper" into mnc-dev
f5a6bd7538a6800c2a43ace5ad67d65b1f8f697a 19-May-2015 Jeff Sharkey <jsharkey@android.com> Push initial disk state, handle empty media.

Stash volume count from last scan, and use it to push initial storage
notifications state when listener is first attached.

Also omit disks with invalid size, which usually means they're an
empty slot with no media.

Bug: 20503551
Change-Id: I75097035aebaad70ba32437179a863f6a0910aa5
iskInfo.java
d8fdb338918e63bbab2e65bdb2f4d12320a1b24a 18-May-2015 Paul Lawrence <paullawrence@google.com> Honor password visible setting in CryptKeeper

Bug: 20184626

Change-Id: Ida0f34299947a5d4067406cc6e029fb841077804
torageManager.java
4c099d0c49c8366efd3c26854465b3ceef49b627 15-May-2015 Jeff Sharkey <jsharkey@android.com> Command to change force adoptable state.

Since user builds can't setprop, add an explicit "sm" verb to change
the force adoptable state.

Bug: 21191915
Change-Id: I719d9b18c1a98c97442a5ddb1cc5512e8e4d3d3f
MountService.java
torageManager.java
9756d75ec28844f5ca30fda786a117c1a0ee88da 15-May-2015 Jeff Sharkey <jsharkey@android.com> Initial pass at storage benchmarks.

Offer an interface for Settings to invoke benchmarks on various
attached volumes.

Bug: 21172095
Change-Id: I847ddc87c58285457d1324be87f70ce10507accb
MountService.java
torageManager.java
0d838a0fad500a3c446df501d8aa7656c2c3a7a2 13-May-2015 Jeff Sharkey <jsharkey@android.com> Determine if we have adoptable disks.

Bug: 19993667
Change-Id: I9b21b05736c22d34ca22f5ad6e1a6ebec440cfb6
torageManager.java
7d2af54a98358e9dea96f879ebd1ea915263522b 13-May-2015 Jeff Sharkey <jsharkey@android.com> New "sm" shell tool to call StorageManager.

Surface basic StorageManager commands through shell tool, like
simple listing of disks and volumes, and commands like mounting and
partitioning.

The output is designed to be parsed by host-side testing tools,
instead of relying on fragile dumpsys parsing.

Bug: 19993667
Change-Id: I993e92ecf57996678965945f0ae648b392a77ea2
MountService.java
c840681dbd42978745274e7c44d8c37a1f68a746 04-May-2015 Jeff Sharkey <jsharkey@android.com> Avoid NPE when fsUuid is null.

Bug: 20822962
Change-Id: I6340b70dba5a4f94a0f08ddfbda0190db97746f1
torageManager.java
50a05454795c93ac483f5cb6819e74cb17be1b5b 29-Apr-2015 Jeff Sharkey <jsharkey@android.com> Returning to wizard, split move events.

Finish wiring up notifications to jump back into in-progress wizard
flow, using moveId as identifier.

Split move events back into separate creation and progress events,
and pass details as bundle to pass extra stuff like UUID. Null
package still means moving primary storage.

Add explicit "volume forgotten" event for PackageManager to clean
up internal state with.

Plumb through internal path reported by vold, and bring back FUSE
bypass rewriting optimization.

Bug: 19993667
Change-Id: I0f43edbba36c58c5cd33550022c54c4eb9f01a48
MountServiceListener.java
torageEventListener.java
torageManager.java
olumeInfo.java
b42d694691e73d094df616fe78627ada7e1239ef 29-Apr-2015 Jeff Sharkey <jsharkey@android.com> Method to wipe all adoptable disks.

Will be used by various classes doing factory reset.

Bug: 9433509
Change-Id: I0701abe00abc2fb9085ce1ffe6e28fb27c91ab51
torageManager.java
olumeRecord.java
b36586a7c9b7718f33961406537e27bbd9b16211 27-Apr-2015 Jeff Sharkey <jsharkey@android.com> Split some VolumeInfo state into VolumeRecord.

VolumeRecord is a historical record of a volume that we've seen in
the past. It's now surfaced outside the framework for SystemUI to
drive the notifications that bug users to reinsert missing private
volumes.

Show progress notifications for both storage and package movement
operations. Notify when an empty disk is inserted (no usable volumes)
which launches into the normal format flow.

Add API to forget volumes.

Bug: 20275424, 20275424
Change-Id: I75602c17fdcd4d1f1f62324e1a08c4a33093eefa
MountService.java
MountServiceListener.java
torageEventListener.java
torageManager.java
olumeInfo.java
olumeRecord.java
275e3e43f2fba72fa99001cafa2a70e5478fc545 25-Apr-2015 Jeff Sharkey <jsharkey@android.com> Migrate primary external storage.

Wire up through MountService to call down into vold. Watch for
unsolicited events that report progress, including special value "82"
that signals that copy has finished. We use this value to persist
the volumeUuid in case of unexpected reboot, since it indicates the
new volume is ready.

Wire progress updates through existing callback pipeline.

Update the volume mounting code to match against the persisted UUID
when selecting the primary external storage.

Bug: 19993667
Change-Id: Id46957610fb43517bbfbc368f29b7d430664590d
MountService.java
torageManager.java
620b32b316fd4f1bab4eef55ec8802d14a55e7dd 24-Apr-2015 Jeff Sharkey <jsharkey@android.com> Package and storage movement callbacks.

Since package and primary storage movement can take quite awhile,
we want to have SystemUI surface progress and allow the Settings
app to be torn down while the movement proceeds in the background.

Movement requests now return a unique ID that identifies an ongoing
operation, and interested parties can observe ongoing progress and
final status. Internally, progress and status are overloaded so
the values 0-100 are progress, and any values outside that range
are terminal status.

Add explicit constants for special-cased volume UUIDs, and change
the APIs to accept VolumeInfo to reduce confusion. Internally the
UUID value "null" means internal storage, and "primary_physical"
means the current primary physical volume. These values are used
for both package and primary storage movement destinations.

Persist the current primary storage location in MountService
metadata, since it can be moved over time.

Surface disk scanned events with separate volume count so we can
determine when it's partitioned successfully. Also send broadcast
to support TvSettings launching into adoption flow.

Bug: 19993667
Change-Id: Ic8a4034033c3cb3262023dba4a642efc6795af10
iskInfo.java
MountService.java
MountServiceListener.java
torageEventListener.java
torageManager.java
olumeInfo.java
74acbbb2cd367c6e78db7de5118ff9dd56da61d0 21-Apr-2015 Jeff Sharkey <jsharkey@android.com> Blend in force adoptable flag when set.

Bug: 19993667
Change-Id: Ic7f348d171a89e889281b7efb1aa0cbade048975
iskInfo.java
torageManager.java
e6c04f9417cc4bff0f5f9e72f0d6d66d2aab6e80 19-Apr-2015 Jeff Sharkey <jsharkey@android.com> Broadcast hidden volumes, notification polish.

Send limited broadcast intent when certain volume state changes
occur; the only customer for now is ExternalStorageProvider.

Change notification flow to be less bumpy. Pick USB icon based on
disk type, and avoid using "generic" disk labels.

Bug: 19993667
Change-Id: I263bc9e9aae2ae57eb4d1afe76da686aee5475fb
iskInfo.java
olumeInfo.java
27de30d31c3e79bc429cb71aed9681c55243f18d 19-Apr-2015 Jeff Sharkey <jsharkey@android.com> Wire up non-visible volumes, more states.

Adds logic to ExternalStorageProvider to scan non-visible volumes,
such as USB OTG devices. We use internal paths when surfacing these
volumes, which also optimizes around the FUSE daemon for public
devices. Also dumps internal state when requested.

VolumeInfo now directly contains DiskInfo, which means it's
snapshotted when sending events, avoiding teardown races. Switch
notifications to use this DiskInfo directly.

Finish wiring up new volume state, including helper methods to make
it readable/writable state clearer. Handle disks and volumes with
spaces in their labels.

Bug: 19993667
Change-Id: I5c75e5658a6415976811477aebafee7694bde0f4
torageManager.java
olumeInfo.java
7e92ef3a1146102806fa0543ef12e09231c55639 18-Apr-2015 Jeff Sharkey <jsharkey@android.com> Volumes know parent disks; unsupported disks.

This is cleaner and more direct than the reverse of having the disk
publish child volume membership. Rename state constants to match
public API. Add state representing bad removal. Make it clear that
volume flags are related to mounting.

Send new unsupported disk event when we finish scanning an entire
disk and have no meaningful volumes.

Splice disk labels into description when known. Only adoptable
slots are directly visible to apps.

Bug: 19993667
Change-Id: I12fda95be0d82781f70c3d85c039749052dc936b
iskInfo.java
MountServiceListener.java
torageEventListener.java
torageManager.java
olumeInfo.java
e2d45be4dae116307f8edd85eaa61134221cb8f9 16-Apr-2015 Jeff Sharkey <jsharkey@android.com> Candidate volumes for packages, fix symlink.

Add API to determine the possible candidate volumes that a package
can be moved to. For example, it currently knows that we need to
move ASEC-based apps through internal storage before migrating them
to a private volume.

Comparator for consistent VolumeInfo ordering when displayed in UI.

Fix native library symlink to be volume UUID aware.

Bug: 19993667
Change-Id: I68d5fac5f0f776ac1c7dd15e7a984bfe2704f3f7
iskInfo.java
olumeInfo.java
d95d3bfb2b28a4f21f3fdcd740160c9a61eb0363 15-Apr-2015 Jeff Sharkey <jsharkey@android.com> Persist nickname and flags for volumes.

StorageManager now offers to persist a nickname and user flags for
active volumes. This metadata is kept around and spliced into
any future VolumeInfo when the same UUID is present. Current user
flags indicate "initialized" and "snoozed" states to control how
notifications are shown.

Notify listeners when metadata changes, and kick public notification
after a volume is initialized. Make unique PendingIntents when
multiple volumes are active.

Beginnings of plumbing to ask for missing volumes.

Offer explicit accessors for VolumeInfo and DiskInfo to give better
path to documentation and deprecation.

Bug: 19993667
Change-Id: I3d8b68be83f43ba992d21d51cad5b775776d681c
iskInfo.java
MountService.java
MountServiceListener.java
torageEventListener.java
torageManager.java
olumeInfo.java
56bd3129138b525b0f2eba52bd4fa140f23e792c 14-Apr-2015 Jeff Sharkey <jsharkey@android.com> Checkpoint of storage notifications.

Rewrite of storage notifications to support multiple disks/volumes,
handling the state of each independently. Update strings to match
spec. Include actions to jump into wizard when adoptable, otherwise
browse or eject.

Move browse intent creation to common place on VolumeInfo. Also add
well-formed extra names. VolumeInfo now carries the parent disk ID
along with it to avoid races when unmounting.

Bug: 19993667
Change-Id: I236ddc7f8112490355f438b828bec8d40c331fdd
iskInfo.java
torageManager.java
olumeInfo.java
59d577a518333f4b4514315b6d10e8dba160abcd 12-Apr-2015 Jeff Sharkey <jsharkey@android.com> Browse mode for DocumentsUI, removed volume state.

The existing management mode is too specific, and requires that
storage backends add queryChildDocumentsForManage(), etc. Instead,
to offer more natural browsing support, add a new BROWSE_ROOT intent.

It behaves mostly like MANAGE_ROOT, except that it doesn't mutate
its Uris with setManageMode(), and it shortcuts straight to VIEW on
clicked documents.

It can be launched like this:

$ adb shell am start -a android.provider.action.BROWSE_ROOT
-d content://com.android.externalstorage.documents/root/8405-1DFB
-c android.intent.category.DEFAULT

Also rename a MetricsConstants to make it clearer, and don't
auto-mount all emulated volumes.

Fix bugs around parceling of DiskInfo/VolumeInfo. Method to resolve
the best description for a VolumeInfo, which might need to fall
back to DiskInfo.

Add back "removed" volume state so we send broadcast when a volume
is destroyed, matching the expected public API behavior.

Bug: 19993667
Change-Id: I13aff32c5e11dfc63da44aee9e93a27f4690a43f
iskInfo.java
torageManager.java
olumeInfo.java
b2b9ab8354da1485178cd8d8e9d89ac915b3f269 06-Apr-2015 Jeff Sharkey <jsharkey@android.com> Installing packages to expanded storage.

PackageManager now offers to load/unload packages when expanded
volumes are mounted/unmounted. Expanded storage volumes are still
treated as FLAG_EXTERNAL_STORAGE from a public API point-of-view,
but this change starts treating the INSTALL_EXTERNAL flag as
exclusively meaning ASEC containers.

Start tracking the UUID of the volume where a package is installed,
giving us a quick way to find relevant packages. When resolving an
install location, look across all expanded volumes and pick the one
with the largest free space. When upgrading an existing package,
continue preferring the existing volume. PackageInstaller now knows
how to stage on these volumes.

Add new movePackage() variant that accepts a target volume UUID
as destination, it will eventually move data too. Expose this
move command through "pm" command for testing.

Automount expanded volumes when they appear.

Bug: 19993667
Change-Id: I9ca2aa328b9977d34e8b3e153db4bea8b8d6f8e3
torageManager.java
olumeInfo.java
16c9c249d5f06014442aa5c78254b702f6a034c5 05-Apr-2015 Jeff Sharkey <jsharkey@android.com> Fix up ExternalStorageFormatter.

It's not going to be around for much longer, so just fix enough to
work correctly.

Also teach about new "unmountable" state from vold.

Bug: 19993667
Change-Id: Ib72c3e134092b2a895389dd5b056f4bb8043709a
olumeInfo.java
7151a9a887051542c6da9f380376f3b306184e5c 05-Apr-2015 Jeff Sharkey <jsharkey@android.com> Storage methods using IDs, update listeners.

Add StorageManager methods that work with Disk and Volume IDs instead
of paths which can change over time. For example, a freshly formatted
volume has a different UUID and mount point, even though it's the same
volume.

Update StorageEventListener to be all one-way calls to avoid blocking
while dispatching events. Add new listener method for Volume-level
state changes. The existing state method will remain focused on the
per-user state reflected by StorageVolume. Switch listeners over to
using the more robust RemoteCallbackList pattern under the hood.

Change external ASEC scanning logic in PackageManagerService to be
driven by listener events, instead of explicit MountService calls.

Bug: 19993667
Change-Id: I57c505de260ff1762a78d70d15f1892f40229210
iskInfo.java
MountService.java
MountServiceListener.java
torageEventListener.java
torageManager.java
olumeInfo.java
1b8ef7e3165ff9aa52a4905dafc8d0f83e7403f9 04-Apr-2015 Jeff Sharkey <jsharkey@android.com> Parcelable objects for Disk/Volume.

Will eventually be used by SystemUI and/or Settings.

Also fix SettingsProvider NPE.

Bug: 19993667, 19909433
Change-Id: Ie326849ac5f43ee35f728d9cc0e332b72292db70
iskInfo.aidl
iskInfo.java
MountService.java
torageManager.java
torageVolume.java
olumeInfo.aidl
olumeInfo.java
4887789e44cdb16b042a35e8ec03983213e88ac6 18-Mar-2015 Jeff Sharkey <jsharkey@android.com> Progress towards dynamic storage support.

Storage devices are no longer hard-coded, and instead bubble up from
whatever Disk and VolumeBase that vold uncovered, turning into
sibling Java objects in MountService. We now treat vold events as
the source-of-truth for state, and synchronize our state by asking
vold to "reset" whenever we reconnect.

We've now moved to a model where all storage devices are mounted in
the root mount namespace (user boundaries protected with GIDs), so
we no longer need app-to-vold path translation. This also means that
zygote only needs to bind mount the user-specific /mnt/user/n/ path
onto /storage/self/ to make legacy paths like /sdcard work. This
grealy simplifies a lot of system code.

Many parts of the platform depend on a primary storage device always
being present, so we hack together a stub StorageVolume when vold
doesn't have a volume ready yet.

StorageVolume isn't really a volume anymore; it's the user-specific
view onto a volume, so MountService now filters and builds them
based on the calling user. StorageVolume is now immutable, making
it easier to reason about.

Environment now builds all of its paths dynamically based on active
volumes. Adds utility methods to turn int types and flags into
user-readable strings for debugging purposes.

Remove UMS sharing support for now, since no current devices support
it; MTP is the recommended solution going forward because it offers
better multi-user support.

Simplify unmount logic, since vold will now gladly trigger EJECTING
broadcast and kill stubborn processes.

Bug: 19993667
Change-Id: I9842280e61974c91bae15d764e386969aedcd338
MountService.java
torageManager.java
torageVolume.java
56e629322f0739a04c8ff48915226ecf36a13b44 22-Mar-2015 Jeff Sharkey <jsharkey@android.com> Bring MountService into the SystemService world.

Change-Id: I7f7db49ff373b199f7b81f184a7c62bee682af67
MountService.java
7265abe77a76f848a316640b5da106e882bdbc8a 21-Nov-2014 Christopher Tate <ctate@google.com> Be increasingly aggressive about fstrim if it isn't being run

The current heuristics depend on devices being alive at midnight+ in
order to run periodic background fstrim operations. This unfortunately
means that people who routinely turn their devices off overnight wind
up with their devices *never* running fstrim, and this causes major
performance and disk-life problems.

We now backstop this very-friendly schedule with an increasingly
aggressive one. If the device goes a defined time without a background
fstrim, we then force the fstrim at the next reboot. Once the
device hits the midnight+ idle fstrim request time, then we already
aggressively attempt to fstrim at the first available moment
thereafter, even if it's days/weeks later without a reboot.

'Available' here means charging + device idle. If the device never
becomes idle then we can't do much without rendering an in-use device
inoperable for some number of minutes -- but we have no evidence of
devices ever failing to run fstrim due to this usage pattern.

A new Settings.Global element (type 'long', called
"fstrim_mandatory_interval") is the source of the backstop time. If
this element is zero or negative, no mandatory boot-time fstrim will
ever be performed. If the element is not supplied on a given device,
the default backstop is 3 days.

Adds a new string to display in the upgrading dialog when doing
the fstrim. Note it is too late for this to be localized, but since
this operation can take a long time it is probably better to have
it show *something* even if not localized, rather than just sit there.

Bug 18486922

Change-Id: I5b265ca0a65570fb8931251aa1ac37b530635a2c
MountService.java
f839b4fcb6b179529585765517895a8c90fe315b 26-Sep-2014 Elliott Hughes <enh@google.com> Set the system locale correctly even on an encrypted device.

Bug: 17659622
Change-Id: Ibbbd5b959bfab5345f20b556c4720d0910b50084
torageManager.java
e2c88d39b2c5b33d55c42230db7899202625a96a 29-Aug-2014 Paul Lawrence <paullawrence@google.com> Add constants so we can distinguish decryption failures

Bug: 17213613
Change-Id: I6bc10a1ed0855f6946ea9eb2f8d2db00c1af327c
MountService.java
941a8ba1a6043cf84a7bf622e44a0b4f7abd0178 21-Aug-2014 Jeff Sharkey <jsharkey@android.com> Installing splits into ASECs!

Sessions can now zero-copy data directly into pre-allocated ASEC
containers. Then at commit time, we compute the total size of the
final app, including any inherited APKs and unpacked libraries, and
resize the container in one step.

This supports both brand new ASEC installs and inheriting from
existing ASEC installs. To keep things simple, it currently requires
copying any inherited ASEC contents, but this could be optimized in
the future.

Expose new vold resize command, and allow read-write mounting of ASEC
containers. Move native library extraction into the installer flow,
since it needs to happen before ASEC is sealed. Move multiArch flag
into NativeLibraryHelper, instead of making everyone pass it
around. Migrate size calculation to shared location.

Separate "other" package name in public API, provide a path to a
storage device when relevant, and add more docs.

Bug: 16514385
Change-Id: I06c6ce588d312ee7e64cce02733895d640b88456
MountService.java
742e790294b3441b79f715fe447069b63c6065db 17-Aug-2014 Jeff Sharkey <jsharkey@android.com> Progress towards staging ASECs.

Move location selection logic into shared PackageHelper location,
and share it between DCS and PackageInstaller. Fix bugs related to
installed footprint calculation; always count unpacked native libs.

Have PMS do its own threshold checking, since it's fine to stat
devices. PMS only ever deleted staging ASECs, so move that logic
into installer and nuke unclaimed staging ASECs. Allocate legacy
ASEC names using PackageInstaller to make sure they don't conflict
with sessions.

Start wiring up session to allocate ASEC and pass through staged
container for installation.

Fix bug to actually delete invalid cluster-style installs.

Bug: 16514385
Change-Id: I325e0c4422fc128398c921ba45fd73ecf05fc2a9
torageManager.java
e8fdc541dc8c4388dc3c6d52aff70f290d7fb985 28-May-2014 Paul Lawrence <paullawrence@google.com> Hide crypto consts from docs

@bug 15192967

Change-Id: I134b2cb2d2841bc101e63a8a4dbd86f7b7bdca14
torageManager.java
9502f990899ef576879048ec5147d403158ad89d 10-Apr-2014 Paul Lawrence <paullawrence@google.com> Merge "Allow encryption when keyguard is set to pattern or no protection"
46791e752ca1eca35e6a882c47d7de7f4f66687c 03-Apr-2014 Paul Lawrence <paullawrence@google.com> Allow encryption when keyguard is set to pattern or no protection

Add type parameter to encryptStorage so we can set type when we encrypt

Depends on
https://googleplex-android-review.git.corp.google.com/#/c/444056/

Circular dependency on:
https://googleplex-android-review.git.corp.google.com/#/c/444201/

Bug: 13749169
Change-Id: I52034ec25de35f12f1bbfdd1b0f8584923a0be2e
MountService.java
e51dcf98a4ddb1340cffba88059ad89f0b90909a 18-Mar-2014 Paul Lawrence <paullawrence@google.com> Save OwnerInfo so CryptKeeper can display at boot time

Requires vold change from
https://googleplex-android-review.git.corp.google.com/#/c/435164/

Bug: 13526708
Change-Id: I33153df9961832f72c3b8103bd5e1d3a17e77df3
MountService.java
945490c12e32b1c13b9097c00702558260b2011f 27-Mar-2014 Paul Lawrence <paullawrence@google.com> Don't double prompt on booting encrypted device

vold will store password securely until KeyGuard requests it
and hands it on to KeyStore.

This is a revision of

https://googleplex-android-review.git.corp.google.com/#/c/418123/

which was reverted. It had two bugs in LockSettingsService.checkVoldPassword.
1) We were not checking password for null, which caused an exception
2) checkPattern/checkPassword return true if there is no saved pattern or password.
This leads to situations where we get true returned even when the password
doesn't match. Call the correct one based on what is there, not what vold
thinks ought to be there.

Bug: 12990752
Change-Id: I05315753387b1e508de5aa79b5a68ad7315791d4
MountService.java
6ee7d25010d4f23b44a151f3953225ba253de8af 26-Mar-2014 Paul Lawrence <paullawrence@google.com> Revert "Don't prompt at boot if we already did that when decrypting"

This reverts commit 493e3e7e6523fd94cc1acae3e45935a1227d58c3.

Should fixes

Bug: 13611885
Bug: 13656830
Change-Id: I117c988bb6679f44f8add4fcc18f45cb8238dfb4
MountService.java
493e3e7e6523fd94cc1acae3e45935a1227d58c3 06-Feb-2014 Paul Lawrence <paullawrence@google.com> Don't prompt at boot if we already did that when decrypting

vold will store password securely until KeyGuard requests it
and hands it on to KeyStore.

Needs matching vold changes from
https://googleplex-android-review.git.corp.google.com/#/c/432050/

Bug: 12990752
Change-Id: I930ed8180cf0b8feb1e58db043d5fb6dff1bab20
MountService.java
0a18029075fbe5e5da396c66ef26cfa7e7f1a082 13-Feb-2014 Paul Lawrence <paullawrence@google.com> Clean up a few minor issues

Make public some constants, remove unused imports.

See https://googleplex-android-review.git.corp.google.com/#/c/412885/
for when these were introduced.

Change-Id: I90d0e33a411ebdd84c36e3d9afae70d2f2847538
torageManager.java
8e39736f91a08961cf59c87075e61d9026833b50 28-Jan-2014 Paul Lawrence <paullawrence@google.com> Support default, pattern, pin and password encryption types

Java plumbing to expose methods to get/set encryption type in
IMountService, and hooking up of those methods to the Settings app
so the type is set correctly.

Needs matching vold changes from
https://googleplex-android-review.googlesource.com/#/c/412649/

Bug: 8769627
Change-Id: I70c0ed72d11f5ab6f0958a7f9c101b6822b13baa
MountService.java
torageManager.java
17d5c1b18132e82abb1b828dcc39ca17cff35dd3 06-Dec-2013 Tom Marshall <tdm.code@gmail.com> Parse UUID string with Long.parseLong

Integer.parseInt throws an NPE for values greater than 0x7fffffff.
torageVolume.java
1f706c6cd1cb841adadc2babc57a34e5728983ec 17-Oct-2013 Jeff Sharkey <jsharkey@android.com> Include external storage devices in DocumentsUI.

Include volume UUID in generated document IDs to uniquely identify
volumes over time. Show volume label to users. Watch for mount
changes to update available roots.

Bug: 11175082
Change-Id: Ia151bde768587468efde0c1d97a740b5353d1582
torageVolume.java
5aca2b8dc4f4ff2d466a64587d06666c7bbd9749 17-Oct-2013 Jeff Sharkey <jsharkey@android.com> Plumb through physical device UUID and label.

vold now parse out UUID and label for inserted physical devices,
and reports them to framework. Add these to hidden StorageVolume
class for use by DocumentsUI and MediaProvider.

Remove last JNI method in FileUtils!

Bug: 11175082
Change-Id: I1cfcd1ade61767b103f693319ea2600008ee2e3c
torageVolume.java
2d8b4e801332e02d6aad615b85cc9dd056ef805c 18-Sep-2013 Jeff Sharkey <jsharkey@android.com> Delegate mkdirs() to vold when lacking perms.

Apps without sdcard_r or sdcard_rw are still able to write to
their package-specific directory, but someone needs to first make
that directory on their behalf. This change will delegate the
mkdirs() call through to vold when an app fails to create directly.

MountService validates that the path belongs to the calling user, and
that it's actually on external storage, before passing to vold.

Update Environment to make app-vs-vold paths clearer.

Bug: 10577808
Change-Id: I43b4a77fd6d2b9af2a0d899790da8d9d89386776
MountService.java
be72215c39916af9ae42332260c04b696bc73d7f 16-Feb-2013 Jeff Sharkey <jsharkey@android.com> Better API for low disk space warnings.

Provides uniform interface to ask about low disk thresholds; can
be mocked by other tests. Opens door to adjust thresholds based on
disk type.

Switch monitor service to using new API, and use filesystem paths
from Environment instead of hard-coding.

Change-Id: Ifdb536e36a453f1b67bc65849037ec3cc0232cf2
torageManager.java
4fbbda4cecb078bd3867f416b02cc75f5455284f 25-Sep-2012 Jeff Sharkey <jsharkey@android.com> Handle multi-user mountObb() requests.

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
MountService.java
torageManager.java
b049e212ab7fe8967893c202efcb30fecfdb82fb 08-Sep-2012 Jeff Sharkey <jsharkey@android.com> Include user identifier in external storage paths.

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
MountService.java
torageManager.java
torageVolume.java
9545dc020ea11649d70dcbe911a8e82a3254a4ea 07-Sep-2012 Jeff Sharkey <jsharkey@android.com> Include primary flag in StorageVolume.

Bug: 7003520
Change-Id: Iaae2ae22253820c954c51e0199c31087bc825f3f
torageVolume.java
cb80cb700d15319c20686998e822aed32a56adf5 10-Aug-2012 Jean-Baptiste Queru <jbq@google.com> am 37548994: Merge "StorageManager: fix issue that GREF has increased to 2011 in system server with intel stress test."

* commit '37548994e69292932e9e2fafb7cba6c53e3a2bcd':
StorageManager: fix issue that GREF has increased to 2011 in system server with intel stress test.
6614bb657929c70dad988fb14b4b91f3b9d4f7fc 28-May-2012 Chuanxia Dong <chuanxiao.dong@intel.com> StorageManager: fix issue that GREF has increased to 2011 in system server with intel stress test.

Issue description:
When run ICS stress test, always meet GREF issue. one of contributor is MountService$MountServiceBinderListener.
log info
19:21:11.609 222 24316 W dalvikvm: 24 of com.android.server.am.ActivityManagerService$AppDeathRecipient (24 unique instances)
19:21:11.609 222 24316 W dalvikvm: 479 of com.android.server.MountService$MountServiceBinderListener (479 unique instances)
19:21:11.619 222 24316 W dalvikvm: 7 of com.android.server.accessibility.AccessibilityManagerService$6 (7 unique instances)
Note: PID 222 is system server.

Issue alaysis:
Everyone can call getSystemService(Context.STORAGE_SERVICE) to get service.
When other service get StorageManager, StorageManager will new MountServiceBinderLister and
register a listener in MountService, which won't be unregistered. It's easy to generate a lot of
instance of unused MountService$MountServiceBinderListener in system server.

Issue fix:
So change the policy to be:
1. Doesn't new MountServiceBinderLister in construction.
2. when other service needs to register listener in StorageManager,
StorageManager will register listener with MountService.
3. When other service needs to unregister listener in StorageManager,
if there is no more other listeners in StorageManager, StorageManager
will unregister listener in MountService.

Change-Id: Iaaf889f44a1a5f62b9f65b3ab1b486c9b7dcaf7f
Author: Chuanxiao Dong <chuanxiao.dong@intel.com>
Signed-off-by: Bo Huang <bo.b.huang@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
torageManager.java
a45746efadd11bb7dfab026fb3c81a25fae74ca4 19-Jul-2012 Jeff Smith <whydoubt@yahoo.com> Fix several cases of broken droiddoc syntax
external issue 35214

patch contributed by Jeff Smith <whydoubt@yahoo.com>

Change-Id: I70dcee88a140699bf3e1ab369bed6dcd2fdd3d83
torageManager.java
13fe2a5330a5df662d7b1b136e7b08fe34c94a42 19-May-2012 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #6522190 MountService should respond to configuration changes ("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
torageVolume.java
51a573c76737733638c475f52e441c814e6645cc 17-May-2012 Kenny Root <kroot@google.com> Wait for ASECs to be scanned before proceeding

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
MountService.java
6dceb88f1c7c42c6ab43834af2c993d599895d82 12-Apr-2012 Kenny Root <kroot@google.com> Allow forward locked apps to be in ASECs

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
MountService.java
cba928cef7d614d375253246f014c4a52bb8b913 18-Aug-2011 Mike Lockwood <lockwood@android.com> SystemServer: Add support for disabling AudioService and MountService

Using the same convention in system_init.cpp, you can disable these
services by setting system properties:

system_init.startaudioservice=0
system_init.startmountservice=0

Signed-off-by: Mike Lockwood <lockwood@android.com>
torageManager.java
13235db8f780a3cb322545687041b066dd74e736 06-Dec-2011 Joe Malin <jmalin@google.com> DOC CHANGE: Add text for android.os.storage

Change-Id: Ia5785cff3860907af4c53cbe769126496ee338c3
ackage.html
b9c1acfb0b4a41ffb5a4d9c38ef298c3a1eb9599 10-Oct-2011 Christopher Tate <ctate@google.com> DO NOT MERGE - Require device encryption password for adb backup/restore

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: I278737927a4ecbb765bfb5ecfd28a4cb8dae52ef
MountService.java
13c7197da8a16f77f6398708a6314c80cb01e0d1 08-Sep-2011 Ben Komalo <benkomalo@google.com> Revert encryption mapping for device wipes.

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
MountService.java
444eca232964dbf27d0c4d01447c1493f89186e0 02-Sep-2011 Ben Komalo <benkomalo@google.com> Expose getting encryptstate through IMountService

- 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
MountService.java
4161f9b30329e558868bb2b16c3e83c0b9cd26fd 13-Jul-2011 Kenny Root <kroot@google.com> Add StorageVolume list to MountService dump

Change-Id: If2be6e420d9671032d2e7a66c71a6733e6e48ac8
torageVolume.java
7a59dd2ce33b46cbc73eef964ddb4272ea1da8d1 11-Jul-2011 Mike Lockwood <lockwood@android.com> MTP: Return error if user tries to copy a file >= 4GB to a FAT32 file system

Bug: 4561836

Change-Id: I2bffb93b032038f6c220c24c752ccd7ca66c23a0
Signed-off-by: Mike Lockwood <lockwood@android.com>
torageVolume.java
292f8bc9d1b790ab975a87a842c7fabc908b97e0 28-Jun-2011 Dianne Hackborn <hackbod@google.com> Plumb information from the framework about asec container size.

Change-Id: Ie0ec3cb6d463aefa341a8cbea80be790451ba5e3
MountService.java
8e8b280bd19fa6cb69bb19e1d90cf03a47ba2d72 07-Jun-2011 Mike Lockwood <lockwood@android.com> StorageVolume: Add allowMassStorage flag

Change-Id: I9d19e635bb06e50068d7e4e6919322bd5bb2e00f
Signed-off-by: Mike Lockwood <lockwood@android.com>
torageVolume.java
37051cdd8624c4821bb68169be427061c48ad837 26-May-2011 Gilles Debunne <debunne@google.com> ExternalStorageFormatter takes an optional StorageVolume target.

Change-Id: Ic85689659dbf49a7fcc1b7aaf25e4a94e62848b9
torageManager.java
torageVolume.java
a5250c93928e256738125b265e10c96c3575597e 23-May-2011 Mike Lockwood <lockwood@android.com> MountService: Add StorageVolume as extra in storage related broadcasts.

Change-Id: I8e1a21ae233ba9812e58b363b59a66b260a01cbf
Signed-off-by: Mike Lockwood <lockwood@android.com>
torageVolume.java
fbfe55512596fd00c1fb51caa851e17dae60fd43 17-May-2011 Mike Lockwood <lockwood@android.com> StorageVolume: Add getStorageId() accessor

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>
torageVolume.java
2f6a3885533a52758c2cd4f81f6123a712be8ae6 10-May-2011 Mike Lockwood <lockwood@android.com> StorageManager: Clean up and generalize storage configuration resources

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>
MountService.java
torageManager.java
torageVolume.aidl
torageVolume.java
d967f4664f40f9a4c5262a44b19df9bbdf457d8a 24-Mar-2011 Mike Lockwood <lockwood@android.com> DO NOT MERGE StorageManager: Add getVolumeList() and getVolumeState() methods

Change-Id: I43d5c1730b340f1288b58012234b38f801001b71
Signed-off-by: Mike Lockwood <lockwood@android.com>
MountService.java
torageManager.java
66700397496fc6f6d26f9f0b56ead8ef610b9654 29-Jan-2011 Jean-Baptiste Queru <jbq@google.com> Merge 3100207b from gingerbread-plus-aosp

Change-Id: Ib2eaede8b9e400e1d273f981c08a6ef82f3dd588
1358b6a4fb68e81058aa938e46b125350bdf0fff 29-Jan-2011 Jean-Baptiste Queru <jbq@google.com> Tweak to make merges easier

Bug: 3364311

Change-Id: Idec05206615de524a3b61d8579d9f2b462b541cd
ObbActionListener.java
d4796c823b92866d5895acf610e5571e9b5724d9 29-Jan-2011 Jason parks <jparks@google.com> am a2e765ef: Merge "Update the encryption password when the device password is changed." into honeycomb

* commit 'a2e765ef1ad2cb907a4ae0a93bb15e4764ebb59a':
Update the encryption password when the device password is changed.
f7b3cd4efd40b7631f36ea014407a850f7dc637e 27-Jan-2011 Jason parks <jparks@google.com> Update the encryption password when the device password is changed.

* Added changeEncryptionPassword() to the MountService.
* Update LockPatternUtils to call changeEncryptionPassword()
when the password is changed.

Note we only require the new password to change the
encryption password.

Bug: 3382129
Change-Id: I26a7e919e325e75e22fa4290da0a8b1b57b55a80
MountService.java
7dbf0696ef37097f2bcec058f876f7f4ba63d357 26-Jan-2011 Kenny Root <kroot@google.com> resolved conflicts for merge of 2c1d0967 to honeycomb-plus-aosp

Change-Id: Ie9b0166b0260ee7eea7bdd275e64f2714024bf1c
2c1d0967ba23f7e806e338bc74148bed93823706 26-Jan-2011 Kenny Root <kroot@google.com> Merge "Make ObbActionListener a on-way call" into honeycomb
ff271a2288f375fc7a5854ac0d1f7c969d91996d 26-Jan-2011 Kenny Root <kroot@google.com> am 2ec4af59: am 138757db: Merge "Make OBB results a one-way call" into gingerbread

* commit '2ec4af59209ab3a7088a001bbbcb10ef0b846564':
Make OBB results a one-way call
b7db2726e91f1d9480359d0f83b9cb7769906b34 26-Jan-2011 Kenny Root <kroot@google.com> Make OBB results a one-way call

OBB result back to an application needs to be a one-way binder call.

Bug: 3353699
Change-Id: I0e625914d18a001c2fa9d764ea6463f34cf96743
ObbActionListener.java
f09d63a52c84386a7b3539eab5b43f020f194c77 17-Jan-2011 Kenny Root <kroot@google.com> Re-@hide some of the other StorageManager API

Some StorageManager API was accidentally unhidden during a bad merge.
Re-@hide the API to fix it.

Bug: 3362407
Change-Id: I5ad6925d3b6c18c33230127b1318c150d028a010
torageEventListener.java
torageResultCode.java
ec7c9ff0bb1c98cb8bec3ec7bdacbae3a434fa53 17-Jan-2011 Kenny Root <kroot@google.com> Hide USB mass storage APIs in StorageManager

They appear to have been unhidden in a bad merge from gingerbread.

Change-Id: Ice0fc865425d5d885af3c2e90a7ffeaa1d623b80
torageManager.java
373c1c975dce2e460d40a7c1cd71e35ce4b4a375 14-Jan-2011 Kenny Root <kroot@google.com> Make ObbActionListener a on-way call

Bug: 3353699
Change-Id: If1bba2e9c2ed3d807657b6b4a6b54b7805bec02b
ObbActionListener.java
56aa5321fe6f00fa3662e6f46a4b2559aa34f63e 07-Jan-2011 Jason parks <jparks@google.com> Add a method enable encryption.

This is for testing and needs to be cleaned up.

Change-Id: I29958f2a95c7773744e61bbd23a302b752614f87
MountService.java
5af0b916f850486cff4797355bf9e7dc3352fe00 29-Nov-2010 Jason parks <jparks@google.com> Add decryption support to MountService.

* Implement the decryptStorage() method on the Mount Service.
This method makes the calls into vold to decrypt the encrypted
volumes and mount them.

Change-Id: I4f6e07a111cf0b36611d590debf9f6579c5ac5f7
MountService.java
733e79c24042145d12a18cac59e8edb08965fab0 15-Oct-2010 Kenny Root <kroot@google.com> am 2f98a585: am 49ec3dff: Merge "OBB: Change documentation to reflect reality" into gingerbread

Merge commit '2f98a585cda066689b1b525322c51fcacbc3770b'

* commit '2f98a585cda066689b1b525322c51fcacbc3770b':
OBB: Change documentation to reflect reality
0a9b54e88b9cbb30748b5f0b331aec3f3ef8d639 14-Oct-2010 Kenny Root <kroot@google.com> resolved conflicts for merge of 8bb7a1df to master

Change-Id: Ieec036f494a54eab74a27b954d1423bf981dd3f9
19dcd2aeba184f81b140b4fbc692bdd80a51299e 13-Oct-2010 Kenny Root <kroot@google.com> OBB: Change documentation to reflect reality

We can't reliably detect when the key for an OBB is incorrect, so just
remove the mention in the documentation. It still returns an error, but
just not the most specific error.

Bug: 3091064
Change-Id: I70e506822f2178a0ac5e4617fe545b23ce0026f4
nObbStateChangeListener.java
e1ff214e32ed5c546a7603b07b054908c4d93312 12-Oct-2010 Kenny Root <kroot@google.com> Add API to check for emulated external storage

When the storage is emulated, we don't want to install ASEC containers
to it. This adds the API to check when the external storage is emulated
and uses it to check whether or not to install packages to the external
storage in an ASEC container.

Bug: 3024387
Change-Id: Ia0318aca9e4938a4897deaada5603a4c7c1d0f48
MountService.java
af9d667ccf3e24058214cf4cc0a8aa8bc5100e3c 08-Oct-2010 Kenny Root <kroot@google.com> OBB: rearrange to be entirely asynchronous

Rearrange structure of MountService handling of OBBs to be entirely
asynchronous so we don't rely on locking as much. We still need the
locking to support dumpsys which has been improved to output all the
data structures for OBBs.

Added more tests to cover more of the error return codes.

Oh and fix a logic inversion bug.

Change-Id: I34f541192dbbb1903b24825889b8fa8f43e6e2a9
MountService.java
ObbActionListener.java
nObbStateChangeListener.java
torageManager.java
9e95468bbb4b4cb48d817cee2960681aa876b12a 01-Oct-2010 Kenny Root <kroot@google.com> am 6ce5f60c: am 38cf8867: Remove OBBs from state list when volume unmounted

Merge commit '6ce5f60c791401ed0faf5d36baf4fc6612358676'

* commit '6ce5f60c791401ed0faf5d36baf4fc6612358676':
Remove OBBs from state list when volume unmounted
38cf8867a8d3e8d5159abd0bd0e6a3b0b8348b94 26-Sep-2010 Kenny Root <kroot@google.com> Remove OBBs from state list when volume unmounted

Don't keep tracking OBBs when the volume they're located on goes away.
Remove them from our state tracking maps and then send a notification to
any listener that is still around.

Add a dump handler to MountService so the state of the mount lists
can be inspected.

Change the API to just make a callback directly to the change listener
when mount is called when it's already mounted or unmount called when
it's already unmounted.

Change-Id: Idb4afbb943ca5ca775825f908bff334e3ce1cfcc
torageManager.java
bff405f91001237ec94ec64f86fa2370c4509559 29-Sep-2010 Kenny Root <kroot@google.com> resolved conflicts for merge of d8e8186c to master

Change-Id: Ica3f6cd958717ea7033cab8b4bf9cd3425c1e1c5
05105f7abe02b2dff91d6260b3628c8b97816bab 23-Sep-2010 Kenny Root <kroot@google.com> Update OBB API to include callbacks

Add a callback for users of the StorageManager API to be able to receive
notifications when the requested operation completes for mountObb and
unmountObb.

Add NDK API to get to ObbInfo like the Java API has.

Also update the docs for the API and remove the "STOPSHIP" comments.

Change-Id: I23a4409c7f8b74d3169614beba920b4d667990a4
nObbStateChangeListener.java
torageManager.java
53e75ea847df20b29124966a4232dc0109c37e27 24-Aug-2010 Kenny Root <kroot@google.com> resolved conflicts for merge of 485de781 to master

Change-Id: I483cb81596f09b024b1aea7fc55960183f38b24f
e49564e0f710ba4a1405cfdfde068cb776ee474e 21-Aug-2010 Kenny Root <kroot@google.com> am 821afa9a: am 54d41379: Merge "Add OBB flags to support overlays" into gingerbread

Merge commit '821afa9aec8d3a4ffd2e72ce797d8097eaf13973'

* commit '821afa9aec8d3a4ffd2e72ce797d8097eaf13973':
Add OBB flags to support overlays
be857d42849eaaa554d4772dbba7755f8a0f3547 19-Aug-2010 Kenny Root <kroot@google.com> Reorganize MountService IPC

Remove auto-generated AIDL files and replace them with manually edited
.java and .cpp/.h files so that binder calls can be made from either
Java or C++.

Update the makefiles to not attempt to generate the AIDL files and also
remove the old auto-generated .java files.

Put all the storage-related C++ things in libstorage so that we don't
pollute other libraries.

Change-Id: I82d1631295452709f12ff1270f36c3100e652806
MountService.aidl
MountService.java
MountServiceListener.aidl
MountServiceListener.java
MountShutdownObserver.aidl
MountShutdownObserver.java
ObbActionListener.aidl
ObbActionListener.java
02ca31fbae9f35dd30f79de6927fae11b549391a 12-Aug-2010 Kenny Root <kroot@google.com> Add OBB flags to support overlays

* Add flags field in OBB footer to support overlays.

* Remove unused 'crypto' and 'filesystem' fields in obbtool (could
later be supported in the "flags" field of the OBB footer).

* Add notes to document OBB classes before shipping.

Change-Id: I386b43c32c5edef55210acb5d3322639c08010ba
torageManager.java
bf0cb26a1c6305f2a7795c2498591b6189cc5b79 11-Aug-2010 Kenny Root <kroot@google.com> am f5ee5358: am ac9717ab: Merge "Move OBB file reading to DefaultContainerService" into gingerbread

Merge commit 'f5ee5358c187107b2e5a1e1fbcb5a648d793c798'

* commit 'f5ee5358c187107b2e5a1e1fbcb5a648d793c798':
Move OBB file reading to DefaultContainerService
a02b8b05dd1e8b8cf169e1f89542ef835b11fc13 06-Aug-2010 Kenny Root <kroot@google.com> Move OBB file reading to DefaultContainerService

The system_server shouldn't touch files on the SD card. This change
moves the things that touch the SD card out to the
DefaultContainerService so that it will get killed if the SD card goes
away instead of the system_server.

Change-Id: I0aefa085be4b194768527195532ee6dddc801cfc
MountService.aidl
ObbActionListener.aidl
torageManager.java
fb4e1e24a93c7e6bc0fcdb3f5cfadfbc19503cd8 16-Jul-2010 Kenny Root <kroot@google.com> resolved conflicts for merge of 181bb0ab to master

Change-Id: I2284e7c671d127da0d124fbabae8d887727fd5bf
02c8730c1bf19daf48bec8c6995df676a00a73b1 01-Jul-2010 Kenny Root <kroot@google.com> Add API to call to vold for mounting OBBs

* Unhide StorageService class; hide all the USB-related items

* Add application-visible API to StorageManager for OBB files

* Add class for parceling OBB info across binders (ObbInfo)

* Add a JNI glue class to libutils/ObbFile (ObbScanner)

* Add API to MountService to deal with calling into vold and checking
permissions

Change-Id: I33ecf9606b8ff535f3a2ada83931da6bbef41cfd
MountService.aidl
torageManager.java
6f63dd5dc8ae38f866e297883435dd1fd3a5cdfd 30-Mar-2010 San Mehat <san@google.com> framework: Hide StorageManager for froyo - do not merge

Change-Id: I9a871e49cc9e1accb28c7e4b76bb0796eaf26d7b
torageEventListener.java
torageManager.java
torageResultCode.java
e99bb5f10b90736d10cee9729b56cba156fc0921 19-Mar-2010 Suchi Amalapurapu <asuchitra@google.com> 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
MountService.aidl
2e805b19cdb309ea6eeb6d2e8b0915681f831f5a 22-Mar-2010 Brad Fitzpatrick <bradfitz@android.com> Grammar fixes.

Change-Id: I77672d2260c26aee146bb6a853137c14e3db1f28
MountService.aidl
6ffce2e9a3c57634bb73f8ff133ca680f8070d5d 08-Mar-2010 Suchi Amalapurapu <asuchitra@google.com> 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
MountService.aidl
MountShutdownObserver.aidl
0eec21d97d9dc4eb4fdbad0e4c0fc53703452d02 26-Feb-2010 Suchi Amalapurapu <asuchitra@google.com> 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.
MountService.aidl
torageManager.java
c42e29e0a58d07a95d470780216cdf1d67476bd6 23-Feb-2010 Suchi Amalapurapu <asuchitra@google.com> 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.
MountService.aidl
d970998b0d489774ad1c5b94b47d233912f00214 18-Feb-2010 San Mehat <san@google.com> 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>
MountService.aidl
torageResultCode.java
c1b4ce93be60aa09eda5653edc2f6a8ce864526d 17-Feb-2010 San Mehat <san@google.com> MountService: Add API call for getting a list of pids currently using the specified mountpoint

Signed-off-by: San Mehat <san@google.com>
MountService.aidl
a181b21305e0bcf171e2112a3ca5c08eb4fd2434 11-Feb-2010 San Mehat <san@google.com> MountService: Fix some mountset bugs and tighten up some return values

Signed-off-by: San Mehat <san@google.com>
torageResultCode.java
6cdd9c08565a6871ad72cd388adfdfca23532e5e 09-Feb-2010 San Mehat <san@google.com> MountService: Add isSecureContainerMounted() API call

Signed-off-by: San Mehat <san@google.com>
MountService.aidl
b104340496e3a531e26c8f428c808eca0e039f50 05-Feb-2010 San Mehat <san@google.com> 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>
MountService.aidl
MountServiceListener.aidl
ountServiceListener.java
torageEventListener.java
torageManager.java
torageResultCode.java