use of com.android.settings.core.SubSettingLauncher in project android_packages_apps_Settings by omnirom.
the class VolumeOptionMenuController method onOptionsItemSelected.
@Override
public boolean onOptionsItemSelected(MenuItem menuItem) {
if (!mFragment.isAdded()) {
return false;
}
final int menuId = menuItem.getItemId();
if (menuId == R.id.storage_mount) {
if (mStorageEntry.isUnmounted()) {
new MountTask(mFragment.getActivity(), mStorageEntry.getVolumeInfo()).execute();
return true;
}
return false;
}
if (menuId == R.id.storage_unmount) {
if (mStorageEntry.isMounted()) {
if (mStorageEntry.isPublic()) {
new UnmountTask(mFragment.getActivity(), mStorageEntry.getVolumeInfo()).execute();
return true;
}
if (mStorageEntry.isPrivate() && !mStorageEntry.isDefaultInternalStorage()) {
final Bundle args = new Bundle();
args.putString(VolumeInfo.EXTRA_VOLUME_ID, mStorageEntry.getId());
new SubSettingLauncher(mContext).setDestination(PrivateVolumeUnmount.class.getCanonicalName()).setTitleRes(R.string.storage_menu_unmount).setSourceMetricsCategory(SettingsEnums.DEVICEINFO_STORAGE).setArguments(args).launch();
return true;
}
}
return false;
}
if (menuId == R.id.storage_rename) {
if ((mStorageEntry.isPrivate() && !mStorageEntry.isDefaultInternalStorage()) || mStorageEntry.isPublic()) {
StorageRenameFragment.show(mFragment, mStorageEntry.getVolumeInfo());
return true;
}
return false;
}
if (menuId == R.id.storage_format) {
if (mStorageEntry.isDiskInfoUnsupported() || mStorageEntry.isPublic()) {
StorageWizardFormatConfirm.showPublic(mFragment.getActivity(), mStorageEntry.getDiskId());
return true;
}
return false;
}
if (menuId == R.id.storage_format_as_portable) {
if (mStorageEntry.isPrivate()) {
final Bundle args = new Bundle();
args.putString(VolumeInfo.EXTRA_VOLUME_ID, mStorageEntry.getId());
new SubSettingLauncher(mContext).setDestination(PrivateVolumeFormat.class.getCanonicalName()).setTitleRes(R.string.storage_menu_format).setSourceMetricsCategory(SettingsEnums.DEVICEINFO_STORAGE).setArguments(args).launch();
return true;
}
return false;
}
if (menuId == R.id.storage_format_as_internal) {
if (mStorageEntry.isPublic()) {
StorageWizardFormatConfirm.showPrivate(mFragment.getActivity(), mStorageEntry.getDiskId());
return true;
}
return false;
}
if (menuId == R.id.storage_migrate) {
if (mStorageEntry.isPrivate()) {
final Intent intent = new Intent(mContext, StorageWizardMigrateConfirm.class);
intent.putExtra(VolumeInfo.EXTRA_VOLUME_ID, mStorageEntry.getId());
mContext.startActivity(intent);
return true;
}
return false;
}
if (menuId == R.id.storage_forget) {
if (mStorageEntry.isVolumeRecordMissed()) {
StorageUtils.launchForgetMissingVolumeRecordFragment(mContext, mStorageEntry);
return true;
}
return false;
}
return false;
}
use of com.android.settings.core.SubSettingLauncher in project android_packages_apps_Settings by omnirom.
the class NetworkProviderSettings method launchConfigNewNetworkFragment.
private void launchConfigNewNetworkFragment(WifiEntry wifiEntry) {
final Bundle bundle = new Bundle();
bundle.putString(WifiNetworkDetailsFragment.KEY_CHOSEN_WIFIENTRY_KEY, wifiEntry.getKey());
new SubSettingLauncher(getContext()).setTitleText(wifiEntry.getTitle()).setDestination(ConfigureWifiEntryFragment.class.getName()).setArguments(bundle).setSourceMetricsCategory(getMetricsCategory()).setResultListener(NetworkProviderSettings.this, CONFIG_NETWORK_REQUEST).launch();
}
use of com.android.settings.core.SubSettingLauncher in project android_packages_apps_Settings by omnirom.
the class ChangeScreenLockPreferenceController method onGearClick.
@Override
public void onGearClick(GearPreference p) {
if (TextUtils.equals(p.getKey(), getPreferenceKey())) {
mMetricsFeatureProvider.logClickedPreference(p, p.getExtras().getInt(DashboardFragment.CATEGORY));
new SubSettingLauncher(mContext).setDestination(ScreenLockSettings.class.getName()).setSourceMetricsCategory(mHost.getMetricsCategory()).launch();
}
}
use of com.android.settings.core.SubSettingLauncher in project android_packages_apps_Settings by omnirom.
the class LockUnificationPreferenceController method ununifyLocks.
private void ununifyLocks() {
final Bundle extras = new Bundle();
extras.putInt(Intent.EXTRA_USER_ID, mProfileUserId);
extras.putParcelable(ChooseLockSettingsHelper.EXTRA_KEY_PASSWORD, mCurrentDevicePassword);
new SubSettingLauncher(mContext).setDestination(ChooseLockGeneric.ChooseLockGenericFragment.class.getName()).setSourceMetricsCategory(mHost.getMetricsCategory()).setArguments(extras).setTransitionType(SettingsTransitionHelper.TransitionType.TRANSITION_SLIDE).launch();
}
use of com.android.settings.core.SubSettingLauncher in project android_packages_apps_Settings by omnirom.
the class ChangeProfileScreenLockPreferenceController method handlePreferenceTreeClick.
@Override
public boolean handlePreferenceTreeClick(Preference preference) {
if (!TextUtils.equals(preference.getKey(), getPreferenceKey())) {
return false;
}
if (Utils.startQuietModeDialogIfNecessary(mContext, mUm, mProfileChallengeUserId)) {
return false;
}
final Bundle extras = new Bundle();
extras.putInt(Intent.EXTRA_USER_ID, mProfileChallengeUserId);
new SubSettingLauncher(mContext).setDestination(ChooseLockGeneric.ChooseLockGenericFragment.class.getName()).setSourceMetricsCategory(mHost.getMetricsCategory()).setArguments(extras).setTransitionType(SettingsTransitionHelper.TransitionType.TRANSITION_SLIDE).launch();
return true;
}
Aggregations