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

Commit 0b54d6d9 authored by Artem Iglikov's avatar Artem Iglikov
Browse files

Another round of code deduplication.

Moved more common classes and methods to utilities (automated).
Prepared for deduplication of restoreOneFile() method.

Bug: 37519282
Test: gts
Change-Id: Ibc3de8f7c6675f64c636aafe51a885cfbd162e3a
parent 71419a14
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -265,7 +265,8 @@ public class PerformFullTransportBackupTask extends FullBackupTask implements Ba
                if (RefactoredBackupManagerService.DEBUG) {
                    Slog.i(TAG, "full backup requested but enabled=" + backupManagerService
                            .isEnabled()
                            + " provisioned=" + backupManagerService.isProvisioned() + "; ignoring");
                            + " provisioned=" + backupManagerService.isProvisioned()
                            + "; ignoring");
                }
                int monitoringEvent;
                if (!backupManagerService.isEnabled()) {
+2 −1
Original line number Diff line number Diff line
@@ -44,7 +44,8 @@ public class PerformInitializeTask implements Runnable {
        try {
            for (String transportName : mQueue) {
                IBackupTransport transport =
                        backupManagerService.getTransportManager().getTransportBinder(transportName);
                        backupManagerService.getTransportManager().getTransportBinder(
                                transportName);
                if (transport == null) {
                    Slog.e(
                            RefactoredBackupManagerService.TAG,
+4 −2
Original line number Diff line number Diff line
@@ -50,7 +50,8 @@ public class ActiveRestoreSession extends IRestoreSession.Stub {
            String packageName, String transport) {
        this.backupManagerService = backupManagerService;
        mPackageName = packageName;
        mRestoreTransport = backupManagerService.getTransportManager().getTransportBinder(transport);
        mRestoreTransport = backupManagerService.getTransportManager().getTransportBinder(
                transport);
    }

    public void markTimedOut() {
@@ -298,7 +299,8 @@ public class ActiveRestoreSession extends IRestoreSession.Stub {

        // If the caller is not privileged and is not coming from the target
        // app's uid, throw a permission exception back to the caller.
        int perm = backupManagerService.getContext().checkPermission(android.Manifest.permission.BACKUP,
        int perm = backupManagerService.getContext().checkPermission(
                android.Manifest.permission.BACKUP,
                Binder.getCallingPid(), Binder.getCallingUid());
        if ((perm == PackageManager.PERMISSION_DENIED) &&
                (app.applicationInfo.uid != Binder.getCallingUid())) {
Loading