下面列出了android.os.storage.StorageManager#UUID_PRIVATE_INTERNAL 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
@Override
public int movePackage(String packageName, VolumeInfo vol) {
try {
final String volumeUuid;
if (VolumeInfo.ID_PRIVATE_INTERNAL.equals(vol.id)) {
volumeUuid = StorageManager.UUID_PRIVATE_INTERNAL;
} else if (vol.isPrimaryPhysical()) {
volumeUuid = StorageManager.UUID_PRIMARY_PHYSICAL;
} else {
volumeUuid = Preconditions.checkNotNull(vol.fsUuid);
}
return mPM.movePackage(packageName, volumeUuid);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
@Override
public int movePrimaryStorage(VolumeInfo vol) {
try {
final String volumeUuid;
if (VolumeInfo.ID_PRIVATE_INTERNAL.equals(vol.id)) {
volumeUuid = StorageManager.UUID_PRIVATE_INTERNAL;
} else if (vol.isPrimaryPhysical()) {
volumeUuid = StorageManager.UUID_PRIMARY_PHYSICAL;
} else {
volumeUuid = Preconditions.checkNotNull(vol.fsUuid);
}
return mPM.movePrimaryStorage(volumeUuid);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
@Override
public int movePackage(String packageName, VolumeInfo vol) {
try {
final String volumeUuid;
if (VolumeInfo.ID_PRIVATE_INTERNAL.equals(vol.id)) {
volumeUuid = StorageManager.UUID_PRIVATE_INTERNAL;
} else if (vol.isPrimaryPhysical()) {
volumeUuid = StorageManager.UUID_PRIMARY_PHYSICAL;
} else {
volumeUuid = Preconditions.checkNotNull(vol.fsUuid);
}
return mPM.movePackage(packageName, volumeUuid);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
@Override
public int movePrimaryStorage(VolumeInfo vol) {
try {
final String volumeUuid;
if (VolumeInfo.ID_PRIVATE_INTERNAL.equals(vol.id)) {
volumeUuid = StorageManager.UUID_PRIVATE_INTERNAL;
} else if (vol.isPrimaryPhysical()) {
volumeUuid = StorageManager.UUID_PRIMARY_PHYSICAL;
} else {
volumeUuid = Preconditions.checkNotNull(vol.fsUuid);
}
return mPM.movePrimaryStorage(volumeUuid);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
@Override
public int movePackage(String packageName, VolumeInfo vol) {
try {
final String volumeUuid;
if (VolumeInfo.ID_PRIVATE_INTERNAL.equals(vol.id)) {
volumeUuid = StorageManager.UUID_PRIVATE_INTERNAL;
} else if (vol.isPrimaryPhysical()) {
volumeUuid = StorageManager.UUID_PRIMARY_PHYSICAL;
} else {
volumeUuid = Preconditions.checkNotNull(vol.fsUuid);
}
return mPM.movePackage(packageName, volumeUuid);
} catch (RemoteException e) {
throw e.rethrowAsRuntimeException();
}
}
@Override
public int movePrimaryStorage(VolumeInfo vol) {
try {
final String volumeUuid;
if (VolumeInfo.ID_PRIVATE_INTERNAL.equals(vol.id)) {
volumeUuid = StorageManager.UUID_PRIVATE_INTERNAL;
} else if (vol.isPrimaryPhysical()) {
volumeUuid = StorageManager.UUID_PRIMARY_PHYSICAL;
} else {
volumeUuid = Preconditions.checkNotNull(vol.fsUuid);
}
return mPM.movePrimaryStorage(volumeUuid);
} catch (RemoteException e) {
throw e.rethrowAsRuntimeException();
}
}
@Override
public int movePackage(String packageName, VolumeInfo vol) {
try {
final String volumeUuid;
if (VolumeInfo.ID_PRIVATE_INTERNAL.equals(vol.id)) {
volumeUuid = StorageManager.UUID_PRIVATE_INTERNAL;
} else if (vol.isPrimaryPhysical()) {
volumeUuid = StorageManager.UUID_PRIMARY_PHYSICAL;
} else {
volumeUuid = Preconditions.checkNotNull(vol.fsUuid);
}
return mPM.movePackage(packageName, volumeUuid);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
@Override
public int movePrimaryStorage(VolumeInfo vol) {
try {
final String volumeUuid;
if (VolumeInfo.ID_PRIVATE_INTERNAL.equals(vol.id)) {
volumeUuid = StorageManager.UUID_PRIVATE_INTERNAL;
} else if (vol.isPrimaryPhysical()) {
volumeUuid = StorageManager.UUID_PRIMARY_PHYSICAL;
} else {
volumeUuid = Preconditions.checkNotNull(vol.fsUuid);
}
return mPM.movePrimaryStorage(volumeUuid);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
@Override
public int movePackage(String packageName, VolumeInfo vol) {
try {
final String volumeUuid;
if (VolumeInfo.ID_PRIVATE_INTERNAL.equals(vol.id)) {
volumeUuid = StorageManager.UUID_PRIVATE_INTERNAL;
} else if (vol.isPrimaryPhysical()) {
volumeUuid = StorageManager.UUID_PRIMARY_PHYSICAL;
} else {
volumeUuid = Preconditions.checkNotNull(vol.fsUuid);
}
return mPM.movePackage(packageName, volumeUuid);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
@Override
public int movePrimaryStorage(VolumeInfo vol) {
try {
final String volumeUuid;
if (VolumeInfo.ID_PRIVATE_INTERNAL.equals(vol.id)) {
volumeUuid = StorageManager.UUID_PRIVATE_INTERNAL;
} else if (vol.isPrimaryPhysical()) {
volumeUuid = StorageManager.UUID_PRIMARY_PHYSICAL;
} else {
volumeUuid = Preconditions.checkNotNull(vol.fsUuid);
}
return mPM.movePrimaryStorage(volumeUuid);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
@Override
public int movePackage(String packageName, VolumeInfo vol) {
try {
final String volumeUuid;
if (VolumeInfo.ID_PRIVATE_INTERNAL.equals(vol.id)) {
volumeUuid = StorageManager.UUID_PRIVATE_INTERNAL;
} else if (vol.isPrimaryPhysical()) {
volumeUuid = StorageManager.UUID_PRIMARY_PHYSICAL;
} else {
volumeUuid = Preconditions.checkNotNull(vol.fsUuid);
}
return mPM.movePackage(packageName, volumeUuid);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
@Override
public int movePrimaryStorage(VolumeInfo vol) {
try {
final String volumeUuid;
if (VolumeInfo.ID_PRIVATE_INTERNAL.equals(vol.id)) {
volumeUuid = StorageManager.UUID_PRIVATE_INTERNAL;
} else if (vol.isPrimaryPhysical()) {
volumeUuid = StorageManager.UUID_PRIMARY_PHYSICAL;
} else {
volumeUuid = Preconditions.checkNotNull(vol.fsUuid);
}
return mPM.movePrimaryStorage(volumeUuid);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
@Override
public int movePackage(String packageName, VolumeInfo vol) {
try {
final String volumeUuid;
if (VolumeInfo.ID_PRIVATE_INTERNAL.equals(vol.id)) {
volumeUuid = StorageManager.UUID_PRIVATE_INTERNAL;
} else if (vol.isPrimaryPhysical()) {
volumeUuid = StorageManager.UUID_PRIMARY_PHYSICAL;
} else {
volumeUuid = Preconditions.checkNotNull(vol.fsUuid);
}
return mPM.movePackage(packageName, volumeUuid);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
@Override
public int movePrimaryStorage(VolumeInfo vol) {
try {
final String volumeUuid;
if (VolumeInfo.ID_PRIVATE_INTERNAL.equals(vol.id)) {
volumeUuid = StorageManager.UUID_PRIVATE_INTERNAL;
} else if (vol.isPrimaryPhysical()) {
volumeUuid = StorageManager.UUID_PRIMARY_PHYSICAL;
} else {
volumeUuid = Preconditions.checkNotNull(vol.fsUuid);
}
return mPM.movePrimaryStorage(volumeUuid);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
@Override
public int movePackage(String packageName, VolumeInfo vol) {
try {
final String volumeUuid;
if (VolumeInfo.ID_PRIVATE_INTERNAL.equals(vol.id)) {
volumeUuid = StorageManager.UUID_PRIVATE_INTERNAL;
} else if (vol.isPrimaryPhysical()) {
volumeUuid = StorageManager.UUID_PRIMARY_PHYSICAL;
} else {
volumeUuid = Preconditions.checkNotNull(vol.fsUuid);
}
return mPM.movePackage(packageName, volumeUuid);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
@Override
public int movePrimaryStorage(VolumeInfo vol) {
try {
final String volumeUuid;
if (VolumeInfo.ID_PRIVATE_INTERNAL.equals(vol.id)) {
volumeUuid = StorageManager.UUID_PRIVATE_INTERNAL;
} else if (vol.isPrimaryPhysical()) {
volumeUuid = StorageManager.UUID_PRIMARY_PHYSICAL;
} else {
volumeUuid = Preconditions.checkNotNull(vol.fsUuid);
}
return mPM.movePrimaryStorage(volumeUuid);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
@Override
public int movePackage(String packageName, VolumeInfo vol) {
try {
final String volumeUuid;
if (VolumeInfo.ID_PRIVATE_INTERNAL.equals(vol.id)) {
volumeUuid = StorageManager.UUID_PRIVATE_INTERNAL;
} else if (vol.isPrimaryPhysical()) {
volumeUuid = StorageManager.UUID_PRIMARY_PHYSICAL;
} else {
volumeUuid = Preconditions.checkNotNull(vol.fsUuid);
}
return mPM.movePackage(packageName, volumeUuid);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
@Override
public int movePrimaryStorage(VolumeInfo vol) {
try {
final String volumeUuid;
if (VolumeInfo.ID_PRIVATE_INTERNAL.equals(vol.id)) {
volumeUuid = StorageManager.UUID_PRIVATE_INTERNAL;
} else if (vol.isPrimaryPhysical()) {
volumeUuid = StorageManager.UUID_PRIMARY_PHYSICAL;
} else {
volumeUuid = Preconditions.checkNotNull(vol.fsUuid);
}
return mPM.movePrimaryStorage(volumeUuid);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
private String getDefaultPrimaryStorageUuid() {
if (SystemProperties.getBoolean(StorageManager.PROP_PRIMARY_PHYSICAL, false)) {
return StorageManager.UUID_PRIMARY_PHYSICAL;
} else {
return StorageManager.UUID_PRIVATE_INTERNAL;
}
}
private static String getVolumeUuidForPackage(PackageParser.Package pkg) {
if (pkg == null) {
return StorageManager.UUID_PRIVATE_INTERNAL;
}
if (pkg.isExternal()) {
if (TextUtils.isEmpty(pkg.volumeUuid)) {
return StorageManager.UUID_PRIMARY_PHYSICAL;
} else {
return pkg.volumeUuid;
}
} else {
return StorageManager.UUID_PRIVATE_INTERNAL;
}
}