History log of /frameworks/base/core/java/android/os/Environment.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
74f0a3450cd598f52b2c68c43531b1a27fb4e1ce 04-Mar-2017 Calin Juravle <calin@google.com> PackageManager: Clean up code related to foreign dex use

We simplified the way we track whether or not a dex file is used by
other apps. DexManager in the framework keeps track of the data and we
no longer need file markers on disk.

Test: device boots, foreign dex markers are not created anymore

Bug: 32871170
Change-Id: I3660e2f3913a73904181449c2d910af0a0477950
/frameworks/base/core/java/android/os/Environment.java
8094e09089204b4bfbdc873d70d0c331ae8c046f 15-Feb-2017 Todd Kennedy <toddke@google.com> Revert "Revert "remove app-ephemeral""

This reverts commit c2f0d886f46ee5eb28011e1119fa9d23b073a64c.

Test: Manual
/frameworks/base/core/java/android/os/Environment.java
c2f0d886f46ee5eb28011e1119fa9d23b073a64c 15-Feb-2017 Guang Zhu <guangzhu@google.com> Revert "remove app-ephemeral"

Bug: 35390781

This reverts commit 4eb7cea562cd117e598a327ab4d93142589c1ae6.

Change-Id: I94567d333b40f99f7a2573125259f4ab575a0519
/frameworks/base/core/java/android/os/Environment.java
4eb7cea562cd117e598a327ab4d93142589c1ae6 15-Feb-2017 Todd Kennedy <toddke@google.com> remove app-ephemeral

instant apps are no longer stored in a separate folder. they
are now stored along side other full apps in the apps directory.

Bug: 25119046
Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.EphemeralTest
Change-Id: I6669be797987169a0b9cca78f80539c908812f9e
/frameworks/base/core/java/android/os/Environment.java
a28071306ec86da664603ff08e74ec7acadbd427 26-Jan-2017 Amith Yamasani <yamasani@google.com> Clear up /data/misc_ce/user folder on delete and reboot

Clean up the folder to avoid leaving residue behind when
a user is removed. This was causing issues with reusing
the userid. Also check on reboot for incomplete cleanup
and remove the folders.

Change-Id: Icd21d2669249d5f87032ef0fe95bad49537fa477
Fixes: 34736064
Test: Manual
/frameworks/base/core/java/android/os/Environment.java
6e68706f67c84a714bc9d765cf3f30d1e43ae9ce 10-Sep-2016 Fyodor Kupolov <fkupolov@google.com> Do not remove file_cache when exiting demo mode

When clearing /data/preloads directory, keep files in file_cache directory.
The content there will only be removed if systems runs low on storage.

Test: manual + RetailDemoModeServiceTest
Bug: 31008665
Change-Id: Id335d84940ee829617986f5345f169271a333de1
/frameworks/base/core/java/android/os/Environment.java
19551a8d8d2e92a5eb07bbc64df1f57a37d851f5 22-Aug-2016 Fyodor Kupolov <fkupolov@google.com> Added getDataPreloadsMediaDirectory

Bug: 31015966
Change-Id: I8b4117daae2b1f7a59d6a192b34a105f91cbac55
/frameworks/base/core/java/android/os/Environment.java
0bd776207999ccba17e5adb163710bd7b16ac907 12-Jul-2016 Calin Juravle <calin@google.com> [RFC] Special case system apps for profile optimizations

If the OTA updates a system app which was previously preopted to a non-
preopted state the app might end up being verified at runtime. That's
because by default the apps are verify-profile but for preopted apps
there's no profile.

Do a hacky check to ensure that if we have no profiles (a reasonable
indication that before the OTA the app was preopted) system apps get
compiled with a non-profile filter (by default interpret-only).

Bug: 30032273
Test: Andreas "has verified that Calin's change to A/B works as expected
and promotes things like SystemUI to speed. From my side, that's
ready to be merged"

Change-Id: I7a052a8ea76cab7f649dc993237ea05534d6c4b9
/frameworks/base/core/java/android/os/Environment.java
d281b4204a38d8cb542f2272b2d21203eafaff7b 08-Jul-2016 Andreas Gampe <agampe@google.com> Revert "Frameworks/base: Refactor UserHandle and Environment a bit"

Breaks monkey in root mode.

This reverts commit 6e16714c688ed9c52763696f5a5e7b90802a471b.

Bug: 29338430
Change-Id: I238f89dad77d7dcae6d02eccbda52eb9c6c6466c
/frameworks/base/core/java/android/os/Environment.java
6e16714c688ed9c52763696f5a5e7b90802a471b 15-Jun-2016 Andreas Gampe <agampe@google.com> Frameworks/base: Refactor UserHandle and Environment a bit

Refactor slightly to forbid using myUserId in the zygote (uid == 0).
Also factor Environment to put user data (vs shared data) into its
own class, which should keep the page the shared data is on actually
shared between processes.

Bug: 29338430
Change-Id: I05d1306b57658a83299e38076171f56cb364ea80
/frameworks/base/core/java/android/os/Environment.java
c5ffdb9ee48905bacab0d5986d3eff2b399acd5e 16-Jun-2016 Amith Yamasani <yamasani@google.com> Merge \"More thorough cleansing of expired users\" into nyc-dev
am: 4f2b1b455e

Change-Id: I5714f73a9b90c0cb8fee653abf799374acfc6232
d04aaa323c3a788d26f18fc66e0a59b47e525b38 13-Jun-2016 Amith Yamasani <yamasani@google.com> More thorough cleansing of expired users

If any /data/system_[c|d]e folders were not erased
when the user was removed (maybe due to a reboot),
make sure they're cleaned up on restart as well
as when the userId is recycled later.

Mark the users' system folders with the correct
serial number for later verification.

AccountManager shouldn't be querying accounts of
partially created/destroyed users.

Change-Id: I4313756b7464f34cd5ce4fb296d61daa50b41fcb
Fixes: 29285673
/frameworks/base/core/java/android/os/Environment.java
88257587cea33b84bb682f9eb30aa954a4b6bb29 25-May-2016 Fyodor Kupolov <fkupolov@google.com> Clean up demo dir when leaving demo mode

Delete contents of demo dir when device is provisioned and demo_mode is
disabled

Bug: 28855287
Change-Id: I6e1826ec23a2ff92402fe079a9e7b565a2fe04d7
/frameworks/base/core/java/android/os/Environment.java
cf3f0a11a83e7a798e0586a78efdafc82a7f3d08 18-Mar-2016 Jeff Sharkey <jsharkey@android.com> Update direct boot related documentation.

Also hide a few APIs as requested by council. Add a method to
easily determine if a given File would already be encrypted at rest
by the OS.

Bug: 27531029
Change-Id: Icad5f1cd56411ad3ac707db85fd7449acdcc4b94
/frameworks/base/core/java/android/os/Environment.java
c50bf8e33e67c26b5dc4fd18ec665d2985fd42e7 01-Mar-2016 Felipe Leme <felipeal@google.com> Merge "Created metric events for scoped directory access API." into nyc-dev
3e166b27fcf67dedc1ca1507266484763c7e15ea 24-Feb-2016 Felipe Leme <felipeal@google.com> Created metric events for scoped directory access API.

BUG: 27334821
Change-Id: I8a1bfc328dcd26b42bb66884d14b34ad11aa232f
/frameworks/base/core/java/android/os/Environment.java
d479b52d12fc782f18df6b5ae15c19e022f0ec14 24-Feb-2016 Calin Juravle <calin@google.com> Restrict the cases when we profile guided compile an apk

Do not use profile guided compilation if the apk is loaded by another
app. The decision if an apk was used or not by another app is done
by looking into the foreign profile directory. Apks which where
loaded in others apps will have a file marker in the profile directory.
The marker is named after the canonical location of the apk file where
'/' is replaced by '@'.

Also, refactor the profile paths to the Environment.

Bug: 27334750
Bug: 26080105
Change-Id: Ic2ac5a7a231670ecb4462166c34fdd5b4c631178
/frameworks/base/core/java/android/os/Environment.java
3c3770d8fe9f64fc92de02f3e52901748e1f30de 17-Feb-2016 Felipe Leme <felipeal@google.com> Merge "Initial implementation of StorageManager.getVolumesList()." into nyc-dev
04a5d40cf35fb2c2fca2c1bfd573e5916d804ef6 09-Feb-2016 Felipe Leme <felipeal@google.com> Initial implementation of StorageManager.getVolumesList().

This change makes StorageManager.getVolumesList(),
StorageManager.getPrimaryVolume(), and StorageVolume public and adds a
buildAccessIntent() in the latter to automatically generate the
ACTION_OPEN_EXTERNAL_DIRECTORY intent, but it doesn't change the
ACTION_OPEN_EXTERNAL_DIRECTORY implementation yet (i.e., it still takes an URI with the physical path of the directory, instead of a StorageVolume and
a directorny name).

BUG: 26742218

Change-Id: I36c59c42b6579e125ec7f03c3af141260875a491
/frameworks/base/core/java/android/os/Environment.java
ab3b8936dc1f4a24cffea422baf9ef51f0de05e7 16-Feb-2016 Steve McKay <smckay@google.com> Remove "HOME" directory. Use "Documents" instead.

Use "Folder" as home icon for now.

Bug:27148009
Change-Id: I9f57bba1c8e51ae7887861923f5baa8f69ec2e6e
/frameworks/base/core/java/android/os/Environment.java
8212ae0aee1700b9c287ebadf15af8dacdc8eae6 10-Feb-2016 Jeff Sharkey <jsharkey@android.com> Consistent naming for internal storage APIs.

Also completely remove a few confusingly named deprecated APIs.

Change-Id: Ia7e4ea3190a97f0a7dfa9bebf2118da0866ec38f
/frameworks/base/core/java/android/os/Environment.java
5c462a0e31dc75527d55a26f9cabf45d2ab874b3 30-Jan-2016 Steve McKay <smckay@google.com> Create "Home" dir instead of "home" to match other default dirs.

Add DIRECTORY_HOME to android.os.Environment...use that for dir name,
so we don't use a localized name when creating directory.
Mark all of the DIRECTORY_* fields final.

Bug: 26814341
Change-Id: I5a11bcb180674c619de2f5ce9ed598521e60cc25
/frameworks/base/core/java/android/os/Environment.java
b012f913cbb3e91572817914537ec16e6138a6db 23-Jan-2016 Felipe Leme <felipeal@google.com> Initial implementation of OPEN_EXTERNAL_DIRECTORY.

It opens a an alert dialog that tells user application X is requesting
access to folder Y on volume Z; if user accepts, it returns the proper
URI, otherwise it returns RESULT_CANCELED.

The requested path must satisfy the following requirements:

1.It's directory (getName()) must be one of the pre-definied folders on
Environment.
2.It's root (getParent()) must be a valid external storage root.

In order to satisfy #2, DocumentsUI calls the ExternalStorageProvider,
through a custom call() implementation.

BUG: 23011462
Change-Id: I8e491e82ae320df88f7b8923286c4c1ad050ae80
/frameworks/base/core/java/android/os/Environment.java
c7b1f89e9e86fcea8e4d334cebbf427dbd278ae1 16-Jan-2016 Felipe Leme <felipeal@google.com> Created a new API to grant scoped directory access to applications.

The Storage Access Framework currently provides an
API (OPEN_DOCUMENT_TREE) that lets the user pick a directory to be used
by the application. Although this APIs is very powerful (for example, it
allows the user to create sub-directories, delete and share files,
etc...), it's too complex for simpler use cases like a camera
application trying to have access to the standard Pictures directory.

The new API (OPEN_EXTERNAL_DIRECTORY) simplifies this scenario by
letting the application select a standard, pre-defined directory (as
defined by android.os.Environment). The user still needs to grant access
to the requested directory, but the resulting UI will be simpler and
more straightforward.

Usage example:

// ...
int requestCode = 42;
Intent intent = new Intent(Intent.ACTION_OPEN_EXTERNAL_DIRECTORY);
intent.setData(Uri.fromFile(
new File(Environment.getExternalStorageDirectory(),
Environment.DIRECTORY_PICTURES)));
startActivityForResult(intent, requestCode);
// ...

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
if (resultCode != Activity.RESULT_OK) {
return;
}
Uri uri = data.getData();
int modeFlags = data.getFlags()
& (Intent.FLAG_GRANT_READ_URI_PERMISSION
| Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
getContentResolver().takePersistableUriPermission(uri, modeFlags);
}

BUG: 23011462
Change-Id: Ie832026532f74e681ef220b761667eb66ff3c8b0
/frameworks/base/core/java/android/os/Environment.java
bdc9d58d06ce9ffd836eb299d38f1d594da36ad6 20-Nov-2015 Hung-ying Tyan <tyanh@google.com> Allow library spec and app configs to be read from odm partition

Currently only feature specs are allowed to be read from /oem/etc/permissions.
ODM may want to add their own library specs and app configs (ie, "app-link",
"system-user-whitelisted-app" and "system-user-blacklisted-app") but they can
only add them to /system/etc/permissions and thus polluted the system.img.
With the fine-grained permission flag introduced in this change, we also tighten
the permission for OEMs so they can only customize the feature specs.

Bug: 25759900
Change-Id: I44ef1380b160c2b6a53f2af6de0c5f5eae27a859
/frameworks/base/core/java/android/os/Environment.java
2699f065558ba78066887210b0c7346105959860 20-Nov-2015 Todd Kennedy <toddke@google.com> Add ephemeral installs

* Add a new --ephemeral argument to 'adb install'
* Add plumbing to internally track ephemeralness
* Create new app directory for ephemeral installs

Bug: 25119046
Change-Id: I1d379f5ccd42e9444c9051eef2d025a37bd824fe
/frameworks/base/core/java/android/os/Environment.java
15447798a38d2b5acb1998731340255f4203f294 06-Nov-2015 Jeff Sharkey <jsharkey@android.com> Initial file-based encryption public APIs.

Define two explicit directories where device-encrypted and
credential-encrypted data will be stored. Third-party apps only
need access to the device-encrypted directory, so that's the only
API exposed for now.

General cleanup in how ApplicationInfo details are derived.

Bug: 22358539
Change-Id: If0a0108721a4aa1c3052b4912e08604bbf24e1ae
/frameworks/base/core/java/android/os/Environment.java
59d28dc82000b1696ed9ef7ef2c0d7fbb2834100 14-Oct-2015 Jeff Sharkey <jsharkey@android.com> Update docs to reflect adoptable behavior.

Update storage related docs on Context to be consistent, and to call
out relevant Environment methods. Start calling it "shared" storage,
and only mention external for historical reasons. Mention that there
isn't much benefit to using emulated storage over private data
directories to help guide developers to safer locations.

Point out which paths can change over time, so developers know to
only persist relative paths.

Update Environment docs to reflect how they behave for the new
class of adopted storage devices.

Bug: 24251945
Change-Id: Ie5ab337649b4740dfd7594997bbb19c4969cfd2f
/frameworks/base/core/java/android/os/Environment.java
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
/frameworks/base/core/java/android/os/Environment.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
/frameworks/base/core/java/android/os/Environment.java
bd0e9e4958acdc6ab5f607bc252fddba877d20f9 01-May-2015 Jeff Sharkey <jsharkey@android.com> Move both app code and data together.

Refactor app movement code into the normal install flow as a new
flavor of InstallArgs. It copies both app code and data during the
copy step, and just updates paths during the rename step.

Measure free space before kicking off a move. Spawn a thread to
derive a hacky progress estimate based on free disk space counting
down.

Remove checkFreeStorage() and getLegacyNativeLibraryPath() which
nobody was calling. Fix deadlocks around package broadcasts, and fix
wrong lock ordering when loading packages.

Bug: 19993667, 20275578, 20370140
Change-Id: I7bbf14c924a724d6ebb8a41a02434750fa3302bc
/frameworks/base/core/java/android/os/Environment.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
/frameworks/base/core/java/android/os/Environment.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
/frameworks/base/core/java/android/os/Environment.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
/frameworks/base/core/java/android/os/Environment.java
d450a3a9959eaca56ee7fcb03919819c2481437b 05-Jun-2014 Robin Lee <rgl@google.com> am 7f993419: am 3c189e02: am 271251d7: Merge "Add Environment call: get config dir for some user"

* commit '7f99341950273f5284186ea2e59a22ac71241c30':
Add Environment call: get config dir for some user
6959133d84b52ad177b22efc80b10dc1ad3fb62f 28-Apr-2014 Robin Lee <rgl@google.com> Add Environment call: get config dir for some user

This returns a read-only directory accessible to any app running as the
same user, containing various configuration files written by the system.

Change-Id: I635de184fc285b8fef166b782bbc1ac79f8f0687
/frameworks/base/core/java/android/os/Environment.java
2ee3c1e189819cc6efb4d7de24f1438bdb824087 31-May-2014 Jeff Sharkey <jsharkey@android.com> Per-app media directories on external storage.

This change defines per-app directories on external storage that
will be scanned and included in MediaStore. This gives apps a way
to write content to secondary shared storage in a way that can
easily be surfaced to other apps.

Bug: 14382377
Change-Id: I4cb367c870509e76f0c2c598f01e2f699780030a
/frameworks/base/core/java/android/os/Environment.java
c84471c2e07c325e81568c4d764716f14fcb19fe 18-Apr-2014 Christopher Tate <ctate@google.com> Handle /oem and /vendor as well

Bug 13170859

(cherry-picked from commit 740888f62eae158d5775be716620f0d56d87f587)

Change-Id: I7b5e206697fcbec146cac6cd83fca5c583a8cbd7
/frameworks/base/core/java/android/os/Environment.java
740888f62eae158d5775be716620f0d56d87f587 18-Apr-2014 Christopher Tate <ctate@google.com> Handle /oem and /vendor as well

Bug 13170859

Change-Id: I95dec4cd68e3d64517d08b3f08eefb849ce37b86
/frameworks/base/core/java/android/os/Environment.java
1be762c1ba0f4ab57c9d2038620e03d45eeb1f0a 06-Mar-2014 Jeff Sharkey <jsharkey@android.com> Define an OEM directory, scan features and APKs.

To support OEM customizations, define a new top-level directory
that roughly mirrors the layout of the system partition. Scan this
location for (non-privileged) apps, and for additional features.

Bug: 13340779
Change-Id: Idb6d6626655061ee31ad952cab734d30ea6130b9
/frameworks/base/core/java/android/os/Environment.java
4ca728c064aeab644f6d044e0285eaa056818b8a 11-Jan-2014 Jeff Sharkey <jsharkey@android.com> Detect removable and emulated secondary storage.

Also rename existing secondary storage API to match naming
convention in rest of class.

Bug: 11536709
Change-Id: I2684c817de4982b414893d2d9927a21e3f171d53
/frameworks/base/core/java/android/os/Environment.java
a6d19995292a82e6d480779acfbd8e140bebecb9 15-Oct-2013 Jeff Sharkey <jsharkey@android.com> Relax user constraint on storage state.

Otherwise we wtf() when called various places in the system.

Bug: 11223886
Change-Id: I514d28603db02e3debd4af1cf20049af0c7399f4
/frameworks/base/core/java/android/os/Environment.java
44cbdec292c6b234d94aae59257721cf499989ba 08-Oct-2013 Jeff Sharkey <jsharkey@android.com> Add secondary external storage support.

When SECONDARY_STORAGE is defined by the hardware configuration,
include those paths in the new getExternalCacheDirs() and
getExternalFilesDirs() APIs. Give secondary volumes valid state
until vold reports back.

Bug: 10330128, 10330229
Change-Id: Ifa55bfda47fd7c750f462dd26c98792ad462ab91
/frameworks/base/core/java/android/os/Environment.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
/frameworks/base/core/java/android/os/Environment.java
3e1189b3590aefb65a2af720ae2ba959bbd4188d 13-Sep-2013 Jeff Sharkey <jsharkey@android.com> Move search to roots; Documents root; hide empty.

Documents searches now happen root-wide, instead of only under a
subdirectory. Updates abstract class and flags to match. Add flag
for a root to indicate it's empty, and hide empty roots in UI unless
creating.

Define "Documents" public directory and storage backend to contain
files.

Bug: 10712057, 10710865, 10710758
Change-Id: I8716367568969f9cb1d83927b2bf5a7013809350
/frameworks/base/core/java/android/os/Environment.java
e8222dddaf2e3da14380101e818d4254899e0c0d 05-Sep-2013 Chet Haase <chet@google.com> Change build version from KEY_LIME_PIE to KITKAT

Issue #10631619 Change build version to KitKat

Change-Id: I6ad13f6169ad74204078d36929479998b498ad8b
/frameworks/base/core/java/android/os/Environment.java
1abdb7123025e52512b2ed7a518f8c754c35f50a 12-Aug-2013 Jeff Sharkey <jsharkey@android.com> APIs for multiple external storage devices.

Provide developer APIs to discover application-specific paths on
secondary external storage devices. Covers files, cache, and OBB
directories. Apps will not have write access outside their package-
specific directories on secondary devices, so only primary storage is
exposed through Environment.

Creation of .nomedia files will be handled by FUSE daemon in future
change.

Change-Id: Ifcce6201a686d80269d7285adb597c008cf8fa7c
/frameworks/base/core/java/android/os/Environment.java
94e602d7b5f8c6fb6dbfa71d646a96aad0354640 19-Apr-2013 Jeff Sharkey <jsharkey@android.com> am 1b50e4ea: am ca2a6374: Merge "Environment should only warn when asked." into jb-mr2-dev

* commit '1b50e4ead5463f4dcc03f9c5ed64963af0d4d9eb':
Environment should only warn when asked.
48749fc78afc982ac32cf98790a85ab2b8bed515 19-Apr-2013 Jeff Sharkey <jsharkey@android.com> Environment should only warn when asked.

Instead of warning on Process.SYSTEM_UID, which is also used by the
Settings app, change to have the parent process explicitly ask for
warnings.

Bug: 8667286
Change-Id: Ib26676694a4041ff4e6d3ffdcc14055b7eba13c7
/frameworks/base/core/java/android/os/Environment.java
e4d9a01bfc7451afff1ed399a5801c7aa2af2831 29-Mar-2013 Dan Morrill <morrildl@google.com> Phase 1 of refactoring SystemServer.

SystemServer is currently a monolithic class that brings up key system
services. This change is the first phase of refactoring it to be more
configurable. Specifically, it adds a set of on/off switches used to control
startup of individual services. Future plans include finer grained controls
and a more explicit and consistent startup sequence for these services.

Change-Id: I7299f5ce7d7b74a34eb56dffb788366fbc058532
/frameworks/base/core/java/android/os/Environment.java
63d0a067997cecf9c6e97a17852f9b657bbba48e 02-Mar-2013 Jeff Sharkey <jsharkey@android.com> Improve performance of storage measurement.

When calculating directory sizes of data living on emulated external
storage, translate the path to use the internal backing data, which
avoids going through the emulation layer. It carefully retreats to
the original path when it runs into trouble.

Testing with a hierarchy of 10 directories deep and 2 directories
and 10 files wide at each level, this change improves performance
from 5900ms before to 250ms after; over 20 times faster (!).

Bug: 8172425
Change-Id: Ia7365416f091e102bf7345a49f7d7209a22580a9
/frameworks/base/core/java/android/os/Environment.java
8b2c3a14603d163d7564e6f60286995079687690 12-Nov-2012 Jeff Sharkey <jsharkey@android.com> Useful annotations for code documentation.

Bug: 6537978
Change-Id: I806c3c09e3255f8789455f13bf37c1dde2a93f1f
/frameworks/base/core/java/android/os/Environment.java
b76a0c40d4b638064aab358a1370b47d010442d7 23-Oct-2012 Jeff Sharkey <jsharkey@android.com> Avoid mentioning hidden API in docs.

Change-Id: If83c179ec0d1b038e94a7fdca386c8ddf324e391
/frameworks/base/core/java/android/os/Environment.java
8c16579994a58c5763788b4f6be864e8a8219575 22-Oct-2012 Jeff Sharkey <jsharkey@android.com> Update docs for multi-user storage behavior.

Define external storage as being isolated for each user, with the
caveat for shared OBB files. Also mention external storage
permissions.

Bug: 7384941
Change-Id: Ib156b5874c5587749d7bc066791e9e88d931b174
/frameworks/base/core/java/android/os/Environment.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
/frameworks/base/core/java/android/os/Environment.java
7d8bcb498d4cfb90202335781df1ffa92e96c18b 24-Sep-2012 Jeff Sharkey <jsharkey@android.com> Move multi-user OBB under user-specific path.

Bug: 7212801
Change-Id: I0ab83c1d9cb21914d61a7da45a32e89956e22ec8
/frameworks/base/core/java/android/os/Environment.java
3fe5bf6d69f146077ce9b5e588be8651462b0cd2 19-Sep-2012 Jeff Sharkey <jsharkey@android.com> Make getMediaStorageDirectory() user-aware.

Bug: 7173591
Change-Id: I4513afbd8c3d6a31cd66d8a149be4071d5a4d24c
/frameworks/base/core/java/android/os/Environment.java
dfa45309e09bcdbad877e4e6a6005f348962d64d 13-Sep-2012 Jeff Sharkey <jsharkey@android.com> Give DefaultContainerService all external storage.

Now we can bind to just one instance of DCS, instead of requiring
one-per-user. This also means we can operate on otherwise-stopped
users.

Bug: 7003520
Change-Id: I4881e064ae8942907f6a02c6b868926223455cdc
/frameworks/base/core/java/android/os/Environment.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
/frameworks/base/core/java/android/os/Environment.java
61f57379ca2c5b6290c8da7548fa17128f7ab24f 31-Aug-2012 Amith Yamasani <yamasani@google.com> Centralize the creation of the user system directory

Environment.getUserSystemDirectory(int userId)

Use it all relevant places that was hardcoding it.
Also, wipe out the user's system directory when user is removed, otherwise old state
might be transferred to a new user.

Change-Id: I788ce9c4cf9624229e65efa7047bc0c019ccef0a
/frameworks/base/core/java/android/os/Environment.java
d525baa3a84928e16973fcf7f3d464adac513c1d 23-May-2012 Jeff Sharkey <jsharkey@android.com> Add media directory, hidden for now.

Bug: 6539384
Change-Id: I8f3f7b92d27f15e82a43bb2fec02f2d9ed0280e1
/frameworks/base/core/java/android/os/Environment.java
e704a15bbf0d8f2595215e13175c1f6cdcc8f5e5 18-Apr-2012 Jeff Sharkey <jsharkey@android.com> Update Environment fallback defaults.

Change-Id: Ia385b03023e38c01546e57635ccf9b29d017220a
/frameworks/base/core/java/android/os/Environment.java
d4bdc7b4da5811fccae578a1f3d4b5718762d40f 26-May-2011 Mike Lockwood <lockwood@android.com> Environment: Fix default mount point for external storage

/mnt/sdcard is the real mount point. /sdcard is just a symlink.

Change-Id: If584e5cd31238d5b263de5bd72e179d53875d8c3
Signed-off-by: Mike Lockwood <lockwood@android.com>
/frameworks/base/core/java/android/os/Environment.java
8fa5b03c1ba4253003c807ad753f58af17086b4e 16-May-2011 Mike Lockwood <lockwood@android.com> resolved conflicts for merge of fc4a3d37 to master

Change-Id: I40f603ba9330c3e882f4d58398095f4094725b21
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>
/frameworks/base/core/java/android/os/Environment.java
ee1d6302912c85429aaeaa70a007248fda5c19e2 13-May-2011 Gilles Debunne <debunne@google.com> Links in Environment javadoc

Change-Id: Ib3383152ff6114fdaba5245bc8357f78bc9d5fcf
/frameworks/base/core/java/android/os/Environment.java
50c294f21b3348010c3f91c5a998d54e1e45d2e4 08-Mar-2011 Andy Stadler <stadler@google.com> Clarify rules about encryption of emulated storage.

Bug: 3351426
Change-Id: I3a8fcd369862f3eab1781699108e29fe7ab474a0
/frameworks/base/core/java/android/os/Environment.java
70ee3ca616a296650a1de7864c9f5c0f41fa8fa1 19-Jan-2011 Mike Lockwood <lockwood@android.com> Environment.isExternalStorageRemovable() is false if external storage is emulated

Change-Id: Ib1afe83e4295d8304b65e822edd0dfa1591a5be7
Signed-off-by: Mike Lockwood <lockwood@android.com>
/frameworks/base/core/java/android/os/Environment.java
b2278dc1853241b4868c89ba3dab6b86b1c7ec53 18-Jan-2011 Kenny Root <kroot@google.com> Don't cache return of getService in Environment

There is already a cache of all non-null return values for calls to
getService(), so don't bother caching it in Environment. This caused
some problems when Environment was called too early in the boot process
and getService() returned null.

Change-Id: I66739d01dab7e422f660d26b370ecce110dcc808
/frameworks/base/core/java/android/os/Environment.java
805fd7ee0e5dc2939e85c84f78d9890a51982bc0 17-Jan-2011 Dianne Hackborn <hackbod@google.com> Add API to get path to OBBs.

Also hide the bitmap thumbnail stuff, we can't support it in its
current form.

And fix some bugs with propagating paths to native code. Yikes!

Change-Id: I13ab37ddbdba5c073489cba5eab035117d3c1574
/frameworks/base/core/java/android/os/Environment.java
a3cdaa5337fa573c4c61770195d6232c2e587090 13-Jan-2011 Jason parks <jparks@google.com> Revert "Remove the APIs for the old encryption scheme."

This reverts commit 1125d780a8b61703b8eb28c5c77dac5f3f0022dd.
/frameworks/base/core/java/android/os/Environment.java
1125d780a8b61703b8eb28c5c77dac5f3f0022dd 12-Jan-2011 Jason parks <jparks@google.com> Remove the APIs for the old encryption scheme.

Change-Id: I55116a5b29b10dfd50015805ec019b485257f68b
/frameworks/base/core/java/android/os/Environment.java
3459e27e5d2f92d2d5487c189c9386c031e79fc1 11-Jan-2011 Mike Lockwood <lockwood@android.com> un@hide android.os.Environment.isExternalStorageEmulated()

Change-Id: I35e7dc59763595523cb5af569e237bcff5cf1b49
Signed-off-by: Mike Lockwood <lockwood@android.com>
/frameworks/base/core/java/android/os/Environment.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
/frameworks/base/core/java/android/os/Environment.java
407f625a9b8e356e765a5ec587c443af1f3aadb5 04-Oct-2010 Dianne Hackborn <hackbod@google.com> Add new API to find out whether external storage is removable.

This is implemented based on whether we are using the "nosdcard"
product. Needed to tweak aapt to allow use of the product attribute
with other resource definition tags besides strings.

Change-Id: I49922d23b52a34183a8e2f4d2515adaf1fc9149a
/frameworks/base/core/java/android/os/Environment.java
d49c455cc97d5fcdd8af497dc2ba85efdc719959 08-Apr-2010 Dianne Hackborn <hackbod@google.com> am 822a7e2d: am ce59fb8b: Fix issue #2578244: playing audio file downloaded by the browser...

Merge commit '822a7e2defcfbd006a7840e1da19cf0827d46736' into kraken

* commit '822a7e2defcfbd006a7840e1da19cf0827d46736':
Fix issue #2578244: playing audio file downloaded by the browser...
ce59fb8b684357f2a10ab62368beeece34bc0e5d 08-Apr-2010 Dianne Hackborn <hackbod@google.com> Fix issue #2578244: playing audio file downloaded by the browser...

...shows an image downloaded by the browser

The downloads directory needs to be non-plural for backwards compatibility.

Change-Id: Ifb6ddf8ee980a57ad113a5fc8b51f5acd8df5955
/frameworks/base/core/java/android/os/Environment.java
591ad27d748c5c605d4fd44b89b2a8ea8f0057ff 31-Mar-2010 Dianne Hackborn <hackbod@google.com> am 6d630607: am 5cdd7858: Merge "Fix issue #2553553: API REVIEW: android.context.Context" into froyo

Merge commit '6d63060768f9d73c6062a2b603d3c51c7d5f0043' into kraken

* commit '6d63060768f9d73c6062a2b603d3c51c7d5f0043':
Fix issue #2553553: API REVIEW: android.context.Context
acaf028fc9efd9754f57ed65476e79a816811b35 30-Mar-2010 Dianne Hackborn <hackbod@google.com> Fix issue #2553553: API REVIEW: android.context.Context

Change-Id: I3e3ab7a909329d498544dc9ed4d500cbcc4ed281
/frameworks/base/core/java/android/os/Environment.java
1f4df90bfab8ca42eabe95f19eadff3432eee7fd 27-Mar-2010 Oscar Montemayor <oam@google.com> DO NOT MERGE
Removing unused features from source tree.
Please refer to Bug#2502219.

Change-Id: I879c29bfd5ffe933f64bb1082aaae7c956450a5a
/frameworks/base/core/java/android/os/Environment.java
e83cefcef07f9ac025642c1ffec76b4c7ab39cf2 05-Feb-2010 Dianne Hackborn <hackbod@google.com> New external storage APIs.

This implements the spec for external storage organization, and
properly reflects how the media scanner organizes the files it finds.

Also includes package manager support for removing app private
files from external storage when the application is uninstalled.

For the new APIs and paths, the main place to look is Environment
and Context.
/frameworks/base/core/java/android/os/Environment.java
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>
/frameworks/base/core/java/android/os/Environment.java
a6a72814e0852abf0db3c58d6e62d8db59ac6033 08-Jan-2010 San Mehat <san@google.com> Environment: Catch *all* exceptions from MountService

Signed-off-by: San Mehat <san@google.com>
/frameworks/base/core/java/android/os/Environment.java
7fd0fee968f4a3e474e1ea9933fc03552fe5f50a 17-Dec-2009 San Mehat <san@google.com> services: MountService: Refactor MountService for vold2

Squash of the following:
services: MountService: Rework the way volume states are handled
MountService: Add new API for directly getting volume state via a mount point
Environment: Switch from using system property for external storage state.
MountService: Add support for UMS
MountService: Fix a few bugs
services: MountService: Add support for mount-on-insertion
services: MountService: Add some debugging around UMS
services: MountService: Fix some UMS bugs and clean-up startup mount code

Signed-off-by: San Mehat <san@google.com>
/frameworks/base/core/java/android/os/Environment.java
a8529f68671a8a118751cb6ad577f44eaf076b96 18-Nov-2009 Oscar Montemayor <oam@google.com> Encrypted File Systems Project. Installer modifications.
Started to modify isntaller for data redirection to a secure location.
/frameworks/base/core/java/android/os/Environment.java
9066cfe9886ac131c34d59ed0e2d287b0e3c0087 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/core/java/android/os/Environment.java
d83a98f4ce9cfa908f5c54bbd70f03eec07e7553 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/core/java/android/os/Environment.java
d24b8183b93e781080b2c16c487e60d51c12da31 11-Feb-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@130745
/frameworks/base/core/java/android/os/Environment.java
54b6cfa9a9e5b861a9930af873580d6dc20f773c 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution
/frameworks/base/core/java/android/os/Environment.java