diff options
author | Christopher Tate <ctate@google.com> | 2014-07-11 17:25:57 -0700 |
---|---|---|
committer | Christopher Tate <ctate@android.com> | 2014-07-14 22:56:04 +0000 |
commit | a7835b6b6b00923b608a6bc3194e7840f67de7a8 (patch) | |
tree | 17f914d3a2e608714d3833c90d6c0cf2db6ffc7b /test-runner | |
parent | 4ad58a4738048ade35f4bee91554dd84aeab3f88 (diff) | |
download | frameworks_base-a7835b6b6b00923b608a6bc3194e7840f67de7a8.zip frameworks_base-a7835b6b6b00923b608a6bc3194e7840f67de7a8.tar.gz frameworks_base-a7835b6b6b00923b608a6bc3194e7840f67de7a8.tar.bz2 |
Add Context.getNoBackupFilesDir()
This is an app-private filesystem space exactly like the one
reported by Context.getFilesDir(), with one exception: files
placed here are never backed up by the full-backup infrastructure.
If an app attempts to back up any of its contents via the normal
API it's immediately ignored with a logged warning.
The restriction is also enforced on the restore side, because
apps using support libraries might wind up creating full backup
archives containing no_backup subdirs on pre-L devices (via
adb backup, Helium, &c.). We check for this before passing the
restore data to the app, and drop it if we detect the situation
so that the app never sees the bits.
Bug 16240573
Change-Id: I11216a391f1d32117ec7ce15aafc9cd93d0337de
Diffstat (limited to 'test-runner')
-rw-r--r-- | test-runner/src/android/test/mock/MockContext.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test-runner/src/android/test/mock/MockContext.java b/test-runner/src/android/test/mock/MockContext.java index a54936b..2ebce9b 100644 --- a/test-runner/src/android/test/mock/MockContext.java +++ b/test-runner/src/android/test/mock/MockContext.java @@ -175,6 +175,11 @@ public class MockContext extends Context { } @Override + public File getNoBackupFilesDir() { + throw new UnsupportedOperationException(); + } + + @Override public File getExternalFilesDir(String type) { throw new UnsupportedOperationException(); } |