OSDN Git Service

Improve logging when restore fails to load Package Manager.
authorRobert Berry <robertberry@google.com>
Thu, 6 Jul 2017 12:04:47 +0000 (13:04 +0100)
committerRobert Berry <robertberry@google.com>
Wed, 12 Jul 2017 16:34:50 +0000 (16:34 +0000)
When the transport has no more packages to return, #nextRestorePackage()
returns RestoreDescription.NO_MORE_PACKAGES. Instead of logging that it had
been unable to get the package metadata, the code in BackupManagerService
was assuming that this was a valid package but one with an unexpected
package name, and hence logged a confusing error message.

Bug: 37695157
Change-Id: I75f2123d2bb062ad04003d7ef2a3a25d9661338c
Test: manual

core/java/android/app/backup/RestoreDescription.java

index 611ff07..0250326 100644 (file)
@@ -34,7 +34,7 @@ public class RestoreDescription implements Parcelable {
     private final String mPackageName;
     private final int mDataType;
 
-    private static final String NO_MORE_PACKAGES_SENTINEL = "";
+    private static final String NO_MORE_PACKAGES_SENTINEL = "NO_MORE_PACKAGES";
 
     /**
      * Return this constant RestoreDescription from BackupTransport.nextRestorePackage()