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: I4b8c06912d2c0b2c5be5bce8b217d45accf34d4b
Fixes: 35926028
Test: Settings Robotest
This commit is contained in:
Daniel Nishi
2017-03-02 15:58:23 -08:00
parent 9392681afa
commit e31550d809
6 changed files with 235 additions and 9 deletions

View File

@@ -23,6 +23,7 @@ import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.os.UserHandle;
import android.os.storage.VolumeInfo;
import java.util.List;
@@ -98,4 +99,9 @@ public interface PackageManagerWrapper {
*/
void replacePreferredActivity(IntentFilter homeFilter, int matchCategoryEmpty,
ComponentName[] componentNames, ComponentName component);
/**
* Calls {@code PackageManager.getPrimaryStorageCurrentVolume}
*/
VolumeInfo getPrimaryStorageCurrentVolume();
}