use of com.android.settings.core.SubSettingLauncher in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class BluetoothDevicesSlice method getBluetoothDetailIntent.
@VisibleForTesting
PendingIntent getBluetoothDetailIntent(CachedBluetoothDevice device) {
final Bundle args = new Bundle();
args.putString(BluetoothDeviceDetailsFragment.KEY_DEVICE_ADDRESS, device.getDevice().getAddress());
final SubSettingLauncher subSettingLauncher = new SubSettingLauncher(mContext);
subSettingLauncher.setDestination(BluetoothDeviceDetailsFragment.class.getName()).setArguments(args).setTitleRes(R.string.device_details_title).setSourceMetricsCategory(SettingsEnums.BLUETOOTH_DEVICE_DETAILS);
// The requestCode should be unique, use the hashcode of device as request code.
return PendingIntent.getActivity(mContext, device.hashCode(), /* requestCode */
subSettingLauncher.toIntent(), 0);
}
use of com.android.settings.core.SubSettingLauncher in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class WifiConnectionPreferenceController method updatePreference.
private void updatePreference(AccessPoint accessPoint) {
if (mPreference != null) {
mPreferenceGroup.removePreference(mPreference);
mPreference = null;
}
if (accessPoint == null) {
return;
}
if (mPrefContext != null) {
mPreference = new AccessPointPreference(accessPoint, mPrefContext, mBadgeCache, R.drawable.ic_wifi_signal_0, false);
mPreference.setKey(KEY);
mPreference.refresh();
mPreference.setOrder(order);
mPreference.setOnPreferenceClickListener(pref -> {
Bundle args = new Bundle();
mPreference.getAccessPoint().saveWifiState(args);
new SubSettingLauncher(mPrefContext).setTitleRes(R.string.pref_title_network_details).setDestination(WifiNetworkDetailsFragment.class.getName()).setArguments(args).setSourceMetricsCategory(mMetricsCategory).launch();
return true;
});
mPreferenceGroup.addPreference(mPreference);
}
}
use of com.android.settings.core.SubSettingLauncher in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class WifiCallingSettingsForSub method onSwitchChanged.
/**
* Listens to the state change of the switch.
*/
@Override
public void onSwitchChanged(Switch switchView, boolean isChecked) {
Log.d(TAG, "onSwitchChanged(" + isChecked + ")");
if (!isChecked) {
updateWfcMode(false);
return;
}
// Launch disclaimer fragment before turning on WFC
final Context context = getActivity();
final Bundle args = new Bundle();
args.putInt(EXTRA_SUB_ID, mSubId);
new SubSettingLauncher(context).setDestination(WifiCallingDisclaimerFragment.class.getName()).setArguments(args).setTitleRes(R.string.wifi_calling_settings_title).setSourceMetricsCategory(getMetricsCategory()).setResultListener(this, REQUEST_CHECK_WFC_DISCLAIMER).launch();
}
use of com.android.settings.core.SubSettingLauncher in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class MasterClear method showFinalConfirmation.
@VisibleForTesting
void showFinalConfirmation() {
final Bundle args = new Bundle();
args.putBoolean(ERASE_EXTERNAL_EXTRA, mExternalStorage.isChecked());
args.putBoolean(ERASE_ESIMS_EXTRA, mEsimStorage.isChecked());
new SubSettingLauncher(getContext()).setDestination(MasterClearConfirm.class.getName()).setArguments(args).setTitleRes(R.string.master_clear_confirm_title).setSourceMetricsCategory(getMetricsCategory()).launch();
}
use of com.android.settings.core.SubSettingLauncher 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