summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Christopher Tate <ctate@google.com> 2014-09-03 21:33:02 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2014-09-03 21:33:03 +0000
commit835b313fa896c09d584514101f3dcce033356ba3 (patch)
tree46205a2bc395558a17eb1ac3768d11a4624f6344
parent058e1f5a38390d578700da73ca8215b5a066df57 (diff)
parent539b217b764562964c7f11b416da8391cb7cf93f (diff)
Merge "The transport system API needs to manage binder identity" into lmp-dev
-rw-r--r--services/backup/java/com/android/server/backup/BackupManagerService.java26
1 files changed, 18 insertions, 8 deletions
diff --git a/services/backup/java/com/android/server/backup/BackupManagerService.java b/services/backup/java/com/android/server/backup/BackupManagerService.java
index 3e7a7e4108a4..083aa9beb399 100644
--- a/services/backup/java/com/android/server/backup/BackupManagerService.java
+++ b/services/backup/java/com/android/server/backup/BackupManagerService.java
@@ -8395,10 +8395,15 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF
Slog.i(TAG, "Auto restore => " + doAutoRestore);
- synchronized (this) {
- Settings.Secure.putInt(mContext.getContentResolver(),
- Settings.Secure.BACKUP_AUTO_RESTORE, doAutoRestore ? 1 : 0);
- mAutoRestore = doAutoRestore;
+ final long oldId = Binder.clearCallingIdentity();
+ try {
+ synchronized (this) {
+ Settings.Secure.putInt(mContext.getContentResolver(),
+ Settings.Secure.BACKUP_AUTO_RESTORE, doAutoRestore ? 1 : 0);
+ mAutoRestore = doAutoRestore;
+ }
+ } finally {
+ Binder.restoreCallingIdentity(oldId);
}
}
@@ -8467,10 +8472,15 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF
synchronized (mTransports) {
String prevTransport = null;
if (mTransports.get(transport) != null) {
- prevTransport = mCurrentTransport;
- mCurrentTransport = transport;
- Settings.Secure.putString(mContext.getContentResolver(),
- Settings.Secure.BACKUP_TRANSPORT, transport);
+ final long oldId = Binder.clearCallingIdentity();
+ try {
+ prevTransport = mCurrentTransport;
+ mCurrentTransport = transport;
+ Settings.Secure.putString(mContext.getContentResolver(),
+ Settings.Secure.BACKUP_TRANSPORT, transport);
+ } finally {
+ Binder.restoreCallingIdentity(oldId);
+ }
Slog.v(TAG, "selectBackupTransport() set " + mCurrentTransport
+ " returning " + prevTransport);
} else {