Search in sources :

Example 6 with MountTask

use of com.android.settings.deviceinfo.StorageSettings.MountTask in project android_packages_apps_Settings by DirtyUnicorns.

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);
}
Also used : Context(android.content.Context) Intent(android.content.Intent) MountTask(com.android.settings.deviceinfo.StorageSettings.MountTask)

Example 7 with MountTask

use of com.android.settings.deviceinfo.StorageSettings.MountTask in project platform_packages_apps_Settings by BlissRoms.

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);
}
Also used : Context(android.content.Context) Intent(android.content.Intent) MountTask(com.android.settings.deviceinfo.StorageSettings.MountTask)

Example 8 with MountTask

use of com.android.settings.deviceinfo.StorageSettings.MountTask in project Resurrection_packages_apps_Settings by ResurrectionRemix.

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);
}
Also used : Context(android.content.Context) Intent(android.content.Intent) MountTask(com.android.settings.deviceinfo.StorageSettings.MountTask)

Example 9 with MountTask

use of com.android.settings.deviceinfo.StorageSettings.MountTask in project android_packages_apps_Settings by omnirom.

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);
}
Also used : Context(android.content.Context) Intent(android.content.Intent) MountTask(com.android.settings.deviceinfo.StorageSettings.MountTask)

Example 10 with MountTask

use of com.android.settings.deviceinfo.StorageSettings.MountTask in project android_packages_apps_Settings by DirtyUnicorns.

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);
}
Also used : Context(android.content.Context) Bundle(android.os.Bundle) Intent(android.content.Intent) MountTask(com.android.settings.deviceinfo.StorageSettings.MountTask)

Aggregations

Context (android.content.Context)14 Intent (android.content.Intent)14 MountTask (com.android.settings.deviceinfo.StorageSettings.MountTask)14 Bundle (android.os.Bundle)7 SubSettingLauncher (com.android.settings.core.SubSettingLauncher)1