History log of /frameworks/base/core/java/android/os/FileUtils.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
09734df8bc5a2b788c923ec1a8b78e4cb67f5e70 08-Mar-2017 Jeff Sharkey <jsharkey@android.com> Grumble, nobody likes kibibytes.

All the cool kids are using storage in increments of 1000 instead
of 1024, so find a balance somewhere between the two. We still round
to nice values like 32GB, 64GB, etc, but we represent them using
kilobytes under the hood.

Test: runtest -x frameworks/base/core/tests/coretests/src/android/os/FileUtilsTest.java
Bug: 28327846
Change-Id: I573aea43790816291e2b5c784b344b51b4444c06
/frameworks/base/core/java/android/os/FileUtils.java
373d01766f27476e81a174727dcfeee406742417 22-Feb-2017 Jeff Sharkey <jsharkey@android.com> Add queryStatsForPackage() API.

This gives developers a way to collect package-level stats, even if
it means we have to use manual calculation for sharedUserId apps.

Also round size of storage devices to nice power-of-two values so we
do a better job of matching retail packaging.

Test: builds, boots
Bug: 35294241
Change-Id: I24946c443bb9dc4b0411a8149a0656702ac1fd24
/frameworks/base/core/java/android/os/FileUtils.java
d5d5e926eb8ff2541a845d6a5657cee5e5c6e7b6 21-Feb-2017 Jeff Sharkey <jsharkey@android.com> Clear cache space when allocating bytes.

Fleshes out remainder of allocation implementation, where we offer
to clear cached data to satisfy the allocation request. To prevent
abuse, we never let apps allocate into either the minimum cache space
or low storage space.

Clean up quota APIs to require the caller to pass in the path they're
interested in, and we resolve the underlying filesystem for them.

Defines settings that can be used to tweak the minimum cache space.

Test: builds, boots
Bug: 34690590
Change-Id: I85bc07399f91ee4aa568a8a54c615646bf748ad4
/frameworks/base/core/java/android/os/FileUtils.java
032c08ad6bf21c26347b4acca4c5ca6e1557249e 20-Jan-2017 Jeff Sharkey <jsharkey@android.com> Simplify FileUtils.stringToFile().

Convert to byte[] directly instead of using heavier FileWriter.

Test: builds, boots
Bug: 34364961
Change-Id: If0c09a924cd73f2c4965ac9d206f9c060788d27c
/frameworks/base/core/java/android/os/FileUtils.java
5c50e8630164d7d9a1a097f70d2f8bcbf1bd854f 24-Nov-2016 Narayan Kamath <narayan@google.com> PackageManagerService: Implement packageParser cache in ParallelPackageParser.

We save about 2800ms of cold startup time over baseline on a marlin,
and ~1200 ms over the parallel parsing case.

warm cold
---------------
Baseline : 1700ms 4300ms
Parallel : 1400ms 2700ms
Cache : 1000ms 1600ms
Cache & parallel : 900ms 1500ms

Note that further changes will improve the speed of cache processing.

This change also includes support for :
- a flag that been flipped in code (currently set to false).
- disabling the cache via a system property.
- wiping the cache on system upgrades.
- cache versioning.

Bug: 30792387

Test: FrameworksServicesTests
Test: manual timing

Change-Id: I281710c110af5307901dd62ce93b515287c91918
/frameworks/base/core/java/android/os/FileUtils.java
6d051fc68d1b1f2c09eb2e58c26821e1e13935dc 22-Nov-2016 Narayan Kamath <narayan@google.com> PackageManager: Avoid creating encoders for appIds being written /config/sdcardfs

We know they will be ASCII, so use String.getBytes(US-ASCII) which is
much faster than creating a new ICU based CharsetEncoder for UTF-8 every time
we write one of these files (there will be a lot of them).

Test: make + manual.
Change-Id: I8eb62862ea1083e194d3f23ac68bb40aaae5efd5
/frameworks/base/core/java/android/os/FileUtils.java
aa44476f64ed5d47b21bc313d065964b065ce918 21-Sep-2016 Jeff Sharkey <jsharkey@android.com> Rename should behave like create: avoid conflict.

When we create a file that already exists, we try attaching a suffix
like "(1)" to the filename to avoid the conflict. The newly added
rename method should do the same, since developers may not have
access to delete the conflicting file.

Test: boots, rename via UI, new unit tests
Bug: 31545404
Change-Id: Ie397eebb0fbf98cf079eee3bbbb6c6b7ca627d91
/frameworks/base/core/java/android/os/FileUtils.java
660e6def20d1b7b9b6edb8e70ec04d17b069af5b 17-May-2016 Ian Rogers <irogers@google.com> Fix bug where FileUtils.deleteOlderFiles wouldn't delete the oldest files.

Bug: 24116825
Change-Id: I1e6ec28afbb097a882a19a9b1ede4cb971cb5998
/frameworks/base/core/java/android/os/FileUtils.java
0693fd85f69db553204168eeb342e6bf0b5fe7b5 29-Apr-2016 Andreas Gampe <agampe@google.com> Frameworks/base: Use holder in FileUtils

Use a holder for an uncommon Pattern instance in FileUtils.

Allows to compile-time initialize:
* android.os.FileUtils

Bug: 28174137
Change-Id: I4a7a388795a96678b4b26e4f2c02b1117d6a67f6
/frameworks/base/core/java/android/os/FileUtils.java
fcf1e55821b694df3b8434f40aa3b6d3c3e7ea50 15-Apr-2016 Jeff Sharkey <jsharkey@android.com> Consistent creation/destruction of user data.

Preparing and destroying users currently needs to be split across
installd, system_server, and vold, since no single party has all the
required SELinux permissions.

When preparing user directories on a storage device, always enforce
the serial number and destroy data if we run into a mismatch. When
deleting a user, write the updated user list first before we start
destroying data. Also start reconciling users on internal storage
at boot, so we can recover from stale data left behind from partially
destroyed users.

Check both CE and DE user directories when reconciling user storage
on a newly mounted storage device.

Bug: 27896918
Change-Id: I4536c82b0196e2720628c4f73fccb742c233350b
/frameworks/base/core/java/android/os/FileUtils.java
fc7fb7533f46b53247d1e6e6edca6e6c9ac676fe 15-Mar-2016 Daichi Hirono <hirono@google.com> Add suffix number when copying a file.

If we have an existing file in the destination directory, which has the
same name with the source file, adding suffix number is
DocumentsProvider's responsibility.

Because MTP does not provide a way to check existance of files with
given name, the logic is implemented as try-and error strategy. The CL
lets If we MtpDocumentsProvider assume we have a file that shares the
same name with the source file if it failed to invoke
MtpDevice#sendObjectInfo. In this case MtpDocumentsProvider retry to
invoke sendObjectInfo with new name with suffix number.

BUG=26991190

Change-Id: I223ac5031f079bc91eb27709b0356f621a1ed55b
/frameworks/base/core/java/android/os/FileUtils.java
2271ba3627d18b65ed5ea63218cee7f9562acd31 02-Feb-2016 Jeff Sharkey <jsharkey@android.com> Push mapping of package name to appId to kernel.

The new sdcardfs kernel driver needs to know this mapping for
deriving UID permissions, so push the data through /config when
supported by the kernel. This also has the nice benefit of letting
us push only the deltas of what actually changes, instead of
re-parsing the entire "packages.list" file.

The mappings for newly installed apps are pushed before the app is
allowed to run, removing some latent race conditions. Also cleans
up stale mappings when packages are uninstalled, and whenever the
system server reboots.

Bug: 19160983
Change-Id: Iace92efb69616c96b34c0d9d911e4b54e5fd8a67
/frameworks/base/core/java/android/os/FileUtils.java
c4bab9843ab936f9a9f134e2088a5bd891eb55c2 01-Feb-2016 Jeff Sharkey <jsharkey@android.com> Only create custom database paths.

If the getDatabasePath() caller is using the default getDatabasesDir()
path, that method already handles possible path creation, so no
need for us to retry.

Also fix two small bugs that would have NPE'ed when listing files in
a directory that wasn't created.

Bug: 26895777
Change-Id: Iced16b05cfe95062717da8d0414c48daefcb5648
/frameworks/base/core/java/android/os/FileUtils.java
35871f2c2bb114806b4e3f109960b7f863d7885c 30-Jan-2016 Jeff Sharkey <jsharkey@android.com> Offer to migrate databases and SharedPreferences.

Databases and SharedPreferences often involve multiple files under
the hood, so developers wanting to migrate them between different
storage contexts should ask us to make sure all relevant files are
migrated correctly.

This makes a best-effort attempt to recover from battery pulls
during migration, while still trying to alert developers to
conflicting files.

Bug: 26668510, 25860525
Change-Id: I9ffa3e8cb6191dfd4237b9466a081d6d77df3ba0
/frameworks/base/core/java/android/os/FileUtils.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/FileUtils.java
85ced632680642fce680d141ddd10299ff849233 22-Jul-2015 Jeff Sharkey <jsharkey@android.com> More info to support CTS, fix reconcile bug.

Surface more details and commands for storage volumes to support
CTS testing. Fix user reconciliation bug that skipped user setup on
empty volumes.

Bug: 22658804, 22633097
Change-Id: I4221312d1cce24d1f5a2c108095cf3cf471598ed
/frameworks/base/core/java/android/os/FileUtils.java
4f5e8b3ca489245005b76176ac6d28f5f184f3fe 12-Jun-2015 Jeff Sharkey <jsharkey@android.com> Valid filenames have length limits!

ext4 filenames are at most 255 bytes. vfat filenames are bit more
lax, but we're often saving them on ext4 through a FUSE daemon, so
limit them the same way.

Since package names are used as directory names, verify that they're
valid filenames.

Tests to verify behavior.

Bug: 18689171
Change-Id: If7df4c40d352954510b71de4ff05d78259c721ed
/frameworks/base/core/java/android/os/FileUtils.java
41be35dd011dbd7ed3a9d08e8fe3eb85ea0e5b64 13-May-2015 Jeff Sharkey <jsharkey@android.com> Rewriting should fail when any paths are null.

Bug: 21017105
Change-Id: I0c5e9c5bdf397d51e2799b06a52bc5bd0bdd09b0
/frameworks/base/core/java/android/os/FileUtils.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/FileUtils.java
62539a220c6810f66b63060326bd1668f7d6b029 23-Apr-2015 Ben Kwa <kenobi@google.com> Move extension checking code into FileUtils.

Move code for checking file extensions and MIME types from
ExternalStorageProvider into android.os.FileUtils, so it can be used by
other clients (e.g. DownloadsProvider).

BUG=20157955

Change-Id: Ib16a16af723c21fb8d2912c8917dfd68653ea6fa
/frameworks/base/core/java/android/os/FileUtils.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/FileUtils.java
0cce5355b45d835f95a8918b8b803fd977d374e4 26-Nov-2014 Jeff Sharkey <jsharkey@android.com> Sanitize display names, keep extensions intact.

When creating or renaming files on external storage, sanitize the
requested display names to be valid FAT filenames. This also fixes
a handful of directory traversal bugs.

Also relax logic around generating display names to allow any
extension which maps to the requested MIME type. Tests to verify.

Bug: 18512473, 18504132
Change-Id: I89e632019ee145f53d9d9d2050932f8939a756af
/frameworks/base/core/java/android/os/FileUtils.java
d746057f2414cba2bdc69257cc5be8cb681bb592 07-Jul-2014 Jeff Sharkey <jsharkey@android.com> Change new file installs to be cluster-based!

Now that all the other pieces are in place, we're ready to start
installing new file-based packages as a cluster (the new unified
directory-based layout). This greatly simplifies the renaming
process.

Also add helper methods to ApplicationInfo to give a much clearer
mapping between it and internal field names, since we can't change
the public API.

Add recursive restorecon().

Bug: 14975160
Change-Id: I72a63c5ddbc594c2fec4a91dd59f73ef253fbfd7
/frameworks/base/core/java/android/os/FileUtils.java
73767b9d607d99b3a027619b5c6b7f1a09b7673d 05-Jul-2014 Jeff Sharkey <jsharkey@android.com> Extract native code from split APKs.

In the new split APK world, multiple APKs work together to define a
single package. This means that native code may be split among those
APKs. To handle this, extend NativeLibraryHelper to examine all
APKs in a package ordered by splitName.

A package has valid native code as long as one matching ABI is found
inside. The "best" ABI found across all APKs is picked for the
entire package. No attempt is made to ensure that every native
library defined is available for the picked ABI; that's the
responsibility of the installer.

Re-introduce PackageLite to represent a lightweight parsing of an
entire package, which may be a single monolithic APK or a cluster
of one or more APKs.

Remove native code extraction from InstallerSession, since it'll be
handled inside PMS for this release.

Bug: 14975160
Change-Id: I4f4db0f82e88a46101c7777499ebc0a11fd911f9
/frameworks/base/core/java/android/os/FileUtils.java
57dcf5b177b56195421535938544f32d8b591b42 19-Jun-2014 Jeff Sharkey <jsharkey@android.com> Slow progress towards APK clusters.

Differentiate between "split APKs" and "cluster packages". A cluster
package is a directory containing zero or more APKs (base+splits),
and a monolithic package is a single APK (base).

PackageSetting will use the directory name as its codePath, so track
the baseCodePath separately. Clarify documentation in several
places.

Require that all installers provide file:// URIs through existing
hidden APIs; PackageInstaller hasn't been able to read content://
URIs for a long time.

Bug: 14975160
Change-Id: I1c6fed1b55205c2474b09871161a98a26669d22e
/frameworks/base/core/java/android/os/FileUtils.java
3a44f3f1b446315ef894e01d2ab9b5388c2bd8c4 29-Apr-2014 Jeff Sharkey <jsharkey@android.com> Initial support for split APKs, PackageInstaller.

Defines a new PackageInstaller class that will be used for installing
and upgrading packages. An application desiring to install an
application creates a session, stages one or more package files in
that session, and then kicks off the install.

Previously, PackageManager would always make its own copy of a package
before inspecting it, to ensure the data could be trusted. This new
session concept allows the installer to write package data directly to
its final resting place on disk, reducing disk I/O and footprint
requirements. Writes are directed through an intermediate pipe
to ensure we can prevent mutations once an install has been initiated.
Also uses fallocate() internally to support optimal ext4 block
allocation using extents to reduce fragmentation.

Sessions are also the way we support installing multiple "split" APKs
in a single atomic operation. For a set of packages to form a valid
application, they must have exactly the same package name, version
code, and certificates. A session can also be used to add a small
handful of splits to an application by inheriting existing packages
when not performing a full install.

Add PackageParser support for extracting split names and certificates.

Bug: 14975160
Change-Id: I23d1bf4fbeb9f99a8c83be0c458900a0f0d1bccc
/frameworks/base/core/java/android/os/FileUtils.java
4948f0eee8789c85e793965315514975fc07403f 01-May-2014 Narayan Kamath <narayan@google.com> Fix build.

Bad automatic merge by git resulted in a dup. of a function.

Change-Id: Idb8fd8a48e1a9f6aeac98a199d6b8c661efaab16
/frameworks/base/core/java/android/os/FileUtils.java
2e2c7d2325958166eba28499f7bd740ba319f840 01-May-2014 Narayan Kamath <narayan@google.com> am 6af42aea: am 9f34234f: am b916d8ad: Merge "Implement FileUtils#contains."

* commit '6af42aea725c2afd8e5fbff9bc33ba353c05e1a9':
Implement FileUtils#contains.
d6d1dbac3f71a292e071dd3108d8333cb5dae44d 01-May-2014 Narayan Kamath <narayan@google.com> Implement FileUtils#contains.

Partial cherry-pick of changes 4ca728c0 and 21de56a9, which
can't be cherry-picked due to their large surface area.

Change-Id: Ife46e150d360cd5241dea93863141749233c1805
/frameworks/base/core/java/android/os/FileUtils.java
10596fbcce710a76ffc7e917400df13af5c2ebcb 28-Apr-2014 Elliott Hughes <enh@google.com> resolved conflicts for merge of 3ce4f3d0 to master

Change-Id: Id5c5997ad8f801b32e1dbd97413ea42e38c27210
34385d352da19805ae948215e2edbeedd16b7941 28-Apr-2014 Elliott Hughes <enh@google.com> Track libcore.os' move to android.system.

(This is partial, but should cover everything in AOSP master except
for the zygote.)

Change-Id: I1042c99245765746a744c44e714095cb2c6cb75d
/frameworks/base/core/java/android/os/FileUtils.java
21de56a94668e0fda1b8bb4ee4f99a09b40d28fd 06-Apr-2014 Jeff Sharkey <jsharkey@android.com> Add directory selection to DocumentsProvider.

Introduce new ACTION_PICK_DIRECTORY that allows users to grant access
to an entire document subtree. Instead of requiring grants for each
individual document, this leverages new prefix URI permission grants
by defining new "via"-style URIs:

content://com.example/via/12/document/24/

This references document 24 by using a prefix grant given for
document 12. Internally, we use isChildDocument() to enforce that
24 is actually a descendant (child, grandchild, etc) of 12. Since
this is an optional API, providers indicate support with
Root.FLAG_SUPPORTS_DIR_SELECTION.

Extend DocumentsUI to support picking directories. Expose
createDocument() API to work with returned directories.

Offer to canonicalize via-style URIs into direct URIs, generating
exact permission grants along the way. Override openAssetFile()
to pass through CancellationSignal. Move testing code into ApiDemos.

Bug: 10607375
Change-Id: Ifffc1cff878870f8152eb6ca0199c5d014b9cb07
/frameworks/base/core/java/android/os/FileUtils.java
ebf8ad5d91b22eb4359c75711a5b70ddcce0723d 31-Jan-2014 Jeff Sharkey <jsharkey@android.com> Update DrmOutputStream to use raw FileDescriptor.

This allows DownloadManager to use FDs, paving the way for downloading
directly to content:// Uris.

Also return flag indicating if deleteOlderFiles() actually deleted
anything. Update tests to verify.

Bug: 5287571
Change-Id: I2579e5e2113f31b2860d7b021bd61c91b6310963
/frameworks/base/core/java/android/os/FileUtils.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/FileUtils.java
6090995951c6e2e4dcf38102f01793f8a94166e1 19-Nov-2013 John Spurlock <jspurlock@google.com> Remove unused imports from frameworks/base.

Change-Id: Ia1f99bd2c1105b0b0f70aa614f1f4a67b2840906
/frameworks/base/core/java/android/os/FileUtils.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
/frameworks/base/core/java/android/os/FileUtils.java
184a0100abc431fc3d6d8dd1b20212b84958cada 11-Jul-2013 Jeff Sharkey <jsharkey@android.com> Allow packages.list access with new GID.

The FUSE daemon is using packages.list to map from package name to
appId after it drops permissions, so create a new "package_info" GID
to grant read access.

Also switches FileUtils to use Libcore.os.

Change-Id: I9451ca4e90e8a985526805c6df0888a244a1db36
/frameworks/base/core/java/android/os/FileUtils.java
053f61d6a6e23825e680dc49982e55c5b4299d61 27-Jun-2013 Dianne Hackborn <hackbod@google.com> Work on issue #9586838: Crash after waking up Hammerhead device

I made the power manager more rigid, not allowing different uids
to use the same wake lock. This never should happen. I would
guess there is somewhere that the activity manager is acquiring
the wake lock without clearing the calling identity... but it is
hard to follow all the paths this may happen in. So here we add
some checks when acquiring/releasing the wake lock to make sure
it is being done as the system uid.

Also:

- Protect the new activity stack calls with a permission, and
make sure to clear the calling uid once past that.
- Collect uid data from process stats so we can correctly
associate CPU use with a uid even if we don't know about the
pid for some reason.
- Fix battery stats dump commands to clear calling uid before
executing so they aren't broken.

Change-Id: I0030d4f7b614e3270d794ecfc3669139a5703ce9
/frameworks/base/core/java/android/os/FileUtils.java
d9526907d1a51ef0b35bfbbeee43fa209d8b5bbf 14-Mar-2013 Jeff Sharkey <jsharkey@android.com> Move deleteOlderFiles() to framework, tests.

Supports both age and count based constraints. Added light docs and
tests to verify behavior.

Bug: 8387555
Change-Id: If4d0dac8bc54ce705c2a339bc09a60ea748728b8
/frameworks/base/core/java/android/os/FileUtils.java
90619816d99154d504a14774c6f2d5f4254ff780 13-Oct-2012 Guang Zhu <guangzhu@google.com> use BufferedInputStream in readTextFile

With FileInputStream, using assumption of bytes read (as
returned by read function) not matching buffer size as EOF is
not correct, we hit this when reading from /proc in some cases.

BufferedInputStream's behavior matches that assumption due to
its implementation.

Bug: 7342759
Change-Id: Ibb06dbe1fbe33f6f880524f7555ff5542889ea50
/frameworks/base/core/java/android/os/FileUtils.java
4c74f8c1713fa82904b10beec4da9ad8ebb97375 17-Aug-2012 Kenny Root <kroot@google.com> Use Libcore.os.umask for setting umask

Libcore.os now provides a umask method call, so just use that since it's
available.

Change-Id: I8826fa40bcab3d61a424ff98a8050d3e44f7ec34
/frameworks/base/core/java/android/os/FileUtils.java
98e15e78934a00cf46f2be55472b7fd7a39ac0de 16-Aug-2012 Kenny Root <kroot@google.com> Use Libcore's stat instead of FileUtils#getFileStatus

Remove the last user of FileUtils#getFileStatus and move it to
Libcore.os.stat instead. Then we can remove the JNI code that does the
equivalent of a stat.

Change-Id: Ieb566a2a8a17c2dd0150724b4eb3ac1cc41c823d
/frameworks/base/core/java/android/os/FileUtils.java
786cbcacd2efbd94476eb05a4d5b77211f20d434 16-Aug-2012 Kenny Root <kroot@google.com> Use Libcore.os.stat instead of FileUtils

PackageManagerService just needed to know the owner for this file, so
just use stat instead so we can remove the old JNI code.

This is the last user of FileUtils#getPermissions so just remove the
FileUtils method as well.

Change-Id: I953057cd6b9de4410f33b6f22e4bddff02fe2988
/frameworks/base/core/java/android/os/FileUtils.java
929b5899a348d2d43f67902f7a807d6660226a64 08-Mar-2012 Jeff Sharkey <jsharkey@android.com> Deprecate some FileUtils, pointing to Os instead.

Change-Id: I5d306784ea924ffd8c32c4768f975190445932a4
/frameworks/base/core/java/android/os/FileUtils.java
1b9a6a6e58fd73b5d1b6a434d17f0a69806858ec 04-Jun-2011 Wink Saville <wink@google.com> resolved conflict for merge of fc51aaec to master

Change-Id: Iee4d9ecc946dd1bbf114a70ad32db0fe47a027df
6d25a990afffd5eb385aba3043d5dfad36f1539a 04-Jun-2011 Wink Saville <wink@google.com> Add FileUtils.checksumCrc32

Change-Id: Ic6bffcb66554d7af38cea68648d9431fda8ef10d
/frameworks/base/core/java/android/os/FileUtils.java
da8bb74b9d9ffcb095815db800d0816c411f1fba 28-May-2011 Mike Lockwood <lockwood@android.com> Move stringToFile utility from ConnectivityService to FileUtils

Change-Id: I59a2dc649d59677f6b5e7ade252587c7c151ec06
Signed-off-by: Mike Lockwood <lockwood@android.com>
/frameworks/base/core/java/android/os/FileUtils.java
4e920f70f38d52d3a74c6a3133388a2e2cb6c175 14-Dec-2010 Brad Fitzpatrick <bradfitz@android.com> Add MODE_MULTI_PROCESS flag to Context.getSharedPreferences()

Also, changes to make this testable with CTS:

-- special PENALTY_DEATH StrictMode fast path that doesn't use
the Looper idling to "time" the violation. Only used when
death is the only violation,

-- make PENALTY_DEATH throw a RuntimeException instead of
killing its process with a signal. this means we can catch
it in CTS tests, but it's also more consistent with
PENALTY_NETWORK_DEATH in Honeycomb.

-- make FileUtils.getFileStatus() invoke StrictMode, which isn't
(yet?) aware of I/O in native code. so help it out.

CTS test for MODE_MULTI_PROCESS is in I6154edab

Change-Id: Icf93f9dfb0ece06b16781e4803dd2c17df3cf1b3
/frameworks/base/core/java/android/os/FileUtils.java
875ecaa511ce36c8044ccdf48ee2a3e69dd633fe 18-Oct-2010 Dianne Hackborn <hackbod@google.com> am 13e46665: am 736f5ec4: Merge "Work on issue #3101415: Crespo apps seem to have their UID changed over time." into gingerbread

Merge commit '13e46665ff69c1a37880762d7d611aacdf02dac7'

* commit '13e46665ff69c1a37880762d7d611aacdf02dac7':
Work on issue #3101415: Crespo apps seem to have their UID changed over time.
8bdf5935c0db4a66ab33a10b43398d2523cfa15d 15-Oct-2010 Dianne Hackborn <hackbod@google.com> Work on issue #3101415: Crespo apps seem to have their UID changed over time.

fsync!

Change-Id: Ie6c5397202579935ac69bf61d3e7b3081ecf269c
/frameworks/base/core/java/android/os/FileUtils.java
90960e87ecae696f73ae18e46c2f003fc3f592cc 06-Aug-2010 Mike Lockwood <lockwood@android.com> Set umask of system server to 0077

This matches the previous behavior of java.io.File file and directory creation.

BUG: 2898660

Change-Id: Ie8978a3fc44abfd22f8046e66742e715354220a8
Signed-off-by: Mike Lockwood <lockwood@android.com>
/frameworks/base/core/java/android/os/FileUtils.java
1afd1c90ebe789b8d3a137004127a50d2db7e3b5 19-Mar-2010 Dianne Hackborn <hackbod@google.com> Maybe fix issue #2457218: Corrupt batterystats.bin file preventing phone boot - LIBtt68127

No steps to repro, but makes the code more robust by using the standard
JournaledFile class and doing sanity checks on the input it reads.

This required moving the JournaledFile class in to the framework (and
we really should get rid of either it or AtomicFile, but they have
different recovery semantics so that is tough). Also went through and
cleaned up the file management in various places.

Change-Id: Ieb7268d8435e77dff66b6e67bb63b62e5dea572e
/frameworks/base/core/java/android/os/FileUtils.java
42471dd5552a346dd82a58a663159875ccc4fb79 08-Jan-2010 Dan Egnor <egnor@google.com> Simplify & update ANR logging; report ANR data into the dropbox.
Eliminate the per-process 200ms timeout during ANR thread-dumping.
Dump all the threads at once, then wait for the file to stabilize.
Seems to work great and is much, much, much faster.

Don't dump stack traces to traces.txt on app crashes (it isn't very
useful and mostly just clutters up the file).

Tweak the formatting of the dropbox dumpsys a bit, for readability,
and avoid running out of memory when dumping large log files.

Report build & kernel version with kernel log dropbox entries.
/frameworks/base/core/java/android/os/FileUtils.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/FileUtils.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/FileUtils.java
54b6cfa9a9e5b861a9930af873580d6dc20f773c 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution
/frameworks/base/core/java/android/os/FileUtils.java