am 27ac243e: Merge "Print currentDestinationString() for each backup transport" into honeycomb

* commit '27ac243e2dc4688b6e761edc3ee85eb7a3bf1f21':
  Print currentDestinationString() for each backup transport
This commit is contained in:
Fabrice Di Meglio
2011-01-13 12:46:55 -08:00
committed by Android Git Automerger

View File

@@ -2768,6 +2768,15 @@ class BackupManagerService extends IBackupManager.Stub {
@Override @Override
public void dump(FileDescriptor fd, PrintWriter pw, String[] args) { public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
long identityToken = Binder.clearCallingIdentity();
try {
dumpInternal(pw);
} finally {
Binder.restoreCallingIdentity(identityToken);
}
}
private void dumpInternal(PrintWriter pw) {
synchronized (mQueueLock) { synchronized (mQueueLock) {
pw.println("Backup Manager is " + (mEnabled ? "enabled" : "disabled") pw.println("Backup Manager is " + (mEnabled ? "enabled" : "disabled")
+ " / " + (!mProvisioned ? "not " : "") + "provisioned / " + " / " + (!mProvisioned ? "not " : "") + "provisioned / "
@@ -2781,12 +2790,15 @@ class BackupManagerService extends IBackupManager.Stub {
for (String t : listAllTransports()) { for (String t : listAllTransports()) {
pw.println((t.equals(mCurrentTransport) ? " * " : " ") + t); pw.println((t.equals(mCurrentTransport) ? " * " : " ") + t);
try { try {
File dir = new File(mBaseStateDir, getTransport(t).transportDirName()); IBackupTransport transport = getTransport(t);
File dir = new File(mBaseStateDir, transport.transportDirName());
pw.println(" destination: " + transport.currentDestinationString());
pw.println(" intent: " + transport.configurationIntent());
for (File f : dir.listFiles()) { for (File f : dir.listFiles()) {
pw.println(" " + f.getName() + " - " + f.length() + " state bytes"); pw.println(" " + f.getName() + " - " + f.length() + " state bytes");
} }
} catch (RemoteException e) { } catch (Exception e) {
Slog.e(TAG, "Error in transportDirName()", e); Slog.e(TAG, "Error in transport", e);
pw.println(" Error: " + e); pw.println(" Error: " + e);
} }
} }