use of com.android.settings.deviceinfo.StorageSettings.MountTask in project android_packages_apps_Settings by crdroidandroid.
the class PrivateVolumeSettings method onOptionsItemSelected.
@Override
public boolean onOptionsItemSelected(MenuItem item) {
final Context context = getActivity();
final Bundle args = new Bundle();
switch(item.getItemId()) {
case R.id.storage_rename:
RenameFragment.show(this, mVolume);
return true;
case R.id.storage_mount:
new MountTask(context, mVolume).execute();
return true;
case R.id.storage_unmount:
args.putString(VolumeInfo.EXTRA_VOLUME_ID, mVolume.getId());
startFragment(this, PrivateVolumeUnmount.class.getCanonicalName(), R.string.storage_menu_unmount, 0, args);
return true;
case R.id.storage_format:
args.putString(VolumeInfo.EXTRA_VOLUME_ID, mVolume.getId());
startFragment(this, PrivateVolumeFormat.class.getCanonicalName(), R.string.storage_menu_format, 0, args);
return true;
case R.id.storage_migrate:
final Intent intent = new Intent(context, StorageWizardMigrateConfirm.class);
intent.putExtra(VolumeInfo.EXTRA_VOLUME_ID, mVolume.getId());
startActivity(intent);
return true;
case R.id.storage_free:
final Intent deletion_helper_intent = new Intent(StorageManager.ACTION_MANAGE_STORAGE);
startActivity(deletion_helper_intent);
return true;
}
return super.onOptionsItemSelected(item);
}
use of com.android.settings.deviceinfo.StorageSettings.MountTask in project android_packages_apps_Settings by crdroidandroid.
the class PublicVolumeSettings method onPreferenceTreeClick.
@Override
public boolean onPreferenceTreeClick(Preference pref) {
final Context context = getActivity();
if (pref == mMount) {
new MountTask(context, mVolume).execute();
} else if (pref == mFormatPublic) {
final Intent intent = new Intent(context, StorageWizardFormatConfirm.class);
intent.putExtra(DiskInfo.EXTRA_DISK_ID, mDisk.getId());
intent.putExtra(StorageWizardFormatConfirm.EXTRA_FORMAT_PRIVATE, false);
startActivity(intent);
} else if (pref == mFormatPrivate) {
final Intent intent = new Intent(context, StorageWizardFormatConfirm.class);
intent.putExtra(DiskInfo.EXTRA_DISK_ID, mDisk.getId());
intent.putExtra(StorageWizardFormatConfirm.EXTRA_FORMAT_PRIVATE, true);
startActivity(intent);
}
return super.onPreferenceTreeClick(pref);
}
use of com.android.settings.deviceinfo.StorageSettings.MountTask in project platform_packages_apps_Settings by BlissRoms.
the class PrivateVolumeSettings method onOptionsItemSelected.
@Override
public boolean onOptionsItemSelected(MenuItem item) {
final Context context = getActivity();
final Bundle args = new Bundle();
switch(item.getItemId()) {
case R.id.storage_rename:
RenameFragment.show(this, mVolume);
return true;
case R.id.storage_mount:
new MountTask(context, mVolume).execute();
return true;
case R.id.storage_unmount:
args.putString(VolumeInfo.EXTRA_VOLUME_ID, mVolume.getId());
startFragment(this, PrivateVolumeUnmount.class.getCanonicalName(), R.string.storage_menu_unmount, 0, args);
return true;
case R.id.storage_format:
args.putString(VolumeInfo.EXTRA_VOLUME_ID, mVolume.getId());
startFragment(this, PrivateVolumeFormat.class.getCanonicalName(), R.string.storage_menu_format, 0, args);
return true;
case R.id.storage_migrate:
final Intent intent = new Intent(context, StorageWizardMigrateConfirm.class);
intent.putExtra(VolumeInfo.EXTRA_VOLUME_ID, mVolume.getId());
startActivity(intent);
return true;
case R.id.storage_free:
final Intent deletion_helper_intent = new Intent(StorageManager.ACTION_MANAGE_STORAGE);
startActivity(deletion_helper_intent);
return true;
}
return super.onOptionsItemSelected(item);
}
use of com.android.settings.deviceinfo.StorageSettings.MountTask in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class PrivateVolumeSettings method onOptionsItemSelected.
@Override
public boolean onOptionsItemSelected(MenuItem item) {
final Context context = getActivity();
final Bundle args = new Bundle();
switch(item.getItemId()) {
case R.id.storage_rename:
RenameFragment.show(this, mVolume);
return true;
case R.id.storage_mount:
new MountTask(context, mVolume).execute();
return true;
case R.id.storage_unmount:
args.putString(VolumeInfo.EXTRA_VOLUME_ID, mVolume.getId());
new SubSettingLauncher(context).setDestination(PrivateVolumeUnmount.class.getCanonicalName()).setTitleRes(R.string.storage_menu_unmount).setSourceMetricsCategory(getMetricsCategory()).setArguments(args).launch();
return true;
case R.id.storage_format:
args.putString(VolumeInfo.EXTRA_VOLUME_ID, mVolume.getId());
new SubSettingLauncher(context).setDestination(PrivateVolumeFormat.class.getCanonicalName()).setTitleRes(R.string.storage_menu_format).setSourceMetricsCategory(getMetricsCategory()).setArguments(args).launch();
return true;
case R.id.storage_migrate:
final Intent intent = new Intent(context, StorageWizardMigrateConfirm.class);
intent.putExtra(VolumeInfo.EXTRA_VOLUME_ID, mVolume.getId());
startActivity(intent);
return true;
case R.id.storage_free:
final Intent deletion_helper_intent = new Intent(StorageManager.ACTION_MANAGE_STORAGE);
startActivity(deletion_helper_intent);
return true;
}
return super.onOptionsItemSelected(item);
}
Aggregations