Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8aac3ee0 authored by Fabrice Di Meglio's avatar Fabrice Di Meglio
Browse files

Print currentDestinationString() for each backup transport

when doing a "adb shell dumpsys backup"

Change-Id: I9a7d080ad50b715f693f3e16cae3d6e5b1189d47
parent ef9932c2
Loading
Loading
Loading
Loading
+15 −3
Original line number Diff line number Diff line
@@ -2768,6 +2768,15 @@ class BackupManagerService extends IBackupManager.Stub {

    @Override
    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) {
            pw.println("Backup Manager is " + (mEnabled ? "enabled" : "disabled")
                    + " / " + (!mProvisioned ? "not " : "") + "provisioned / "
@@ -2781,12 +2790,15 @@ class BackupManagerService extends IBackupManager.Stub {
            for (String t : listAllTransports()) {
                pw.println((t.equals(mCurrentTransport) ? "  * " : "    ") + t);
                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()) {
                        pw.println("       " + f.getName() + " - " + f.length() + " state bytes");
                    }
                } catch (RemoteException e) {
                    Slog.e(TAG, "Error in transportDirName()", e);
                } catch (Exception e) {
                    Slog.e(TAG, "Error in transport", e);
                    pw.println("        Error: " + e);
                }
            }