Re-add the option to migrate data back.

Currently, users can use an SD card or USB drive and adopt it as
internal storage using existing flows. They can manage this drive
perfectly fine using the old storage screen, which is still around.

One functionality that was lost was the ability to migrate data from
the adopted drive back to the private internal storage. This appeared
in a dropdown in the old storage settings.

By duplicating the code to create just that specific menu item and its
click behavior, we can restore this functionality to the new storage
view.

Change-Id: Id0e01c560e7249acccfe86c5da44466dd58fe5d4
Merged-In: I4b8c06912d2c0b2c5be5bce8b217d45accf34d4b
Fixes: 35926028
Test: Settings Robotest
This commit is contained in:
Daniel Nishi
2017-03-02 15:58:23 -08:00
parent 28e35fcf05
commit f6b12274f1
6 changed files with 234 additions and 9 deletions

View File

@@ -24,6 +24,7 @@ import android.content.pm.IPackageDeleteObserver;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.os.UserHandle;
import android.os.storage.VolumeInfo;
import java.util.List;
@@ -97,4 +98,9 @@ public class PackageManagerWrapperImpl implements PackageManagerWrapper {
int userId) {
mPm.deletePackageAsUser(packageName, observer, flags, userId);
}
@Override
public VolumeInfo getPrimaryStorageCurrentVolume() {
return mPm.getPrimaryStorageCurrentVolume();
}
}