use of com.android.settings.core.SubSettingLauncher in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class ConnectedUsbDeviceUpdater method initUsbPreference.
public void initUsbPreference(Context context) {
mUsbPreference = new Preference(context, null);
mUsbPreference.setTitle(R.string.usb_pref);
mUsbPreference.setIcon(R.drawable.ic_usb);
mUsbPreference.setOnPreferenceClickListener((Preference p) -> {
// New version - uses a separate screen.
new SubSettingLauncher(mFragment.getContext()).setDestination(UsbDetailsFragment.class.getName()).setTitleRes(R.string.device_details_title).setSourceMetricsCategory(mFragment.getMetricsCategory()).launch();
return true;
});
forceUpdate();
}
use of com.android.settings.core.SubSettingLauncher in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class AutoSelectPreferenceController method setChecked.
@Override
public boolean setChecked(boolean isChecked) {
if (isChecked) {
final long startMillis = SystemClock.elapsedRealtime();
showAutoSelectProgressBar();
mSwitchPreference.setEnabled(false);
ThreadUtils.postOnBackgroundThread(() -> {
// set network selection mode in background
mTelephonyManager.setNetworkSelectionModeAutomatic();
final int mode = mTelephonyManager.getNetworkSelectionMode();
// Update UI in UI thread
final long durationMillis = SystemClock.elapsedRealtime() - startMillis;
mUiHandler.postDelayed(() -> {
mSwitchPreference.setEnabled(true);
mSwitchPreference.setChecked(mode == TelephonyManager.NETWORK_SELECTION_MODE_AUTO);
for (OnNetworkSelectModeListener lsn : mListeners) {
lsn.onNetworkSelectModeChanged();
}
dismissProgressBar();
}, Math.max(MINIMUM_DIALOG_TIME_MILLIS - durationMillis, 0));
});
return false;
} else {
final Bundle bundle = new Bundle();
bundle.putInt(Settings.EXTRA_SUB_ID, mSubId);
new SubSettingLauncher(mContext).setDestination(NetworkSelectSettings.class.getName()).setSourceMetricsCategory(SettingsEnums.MOBILE_NETWORK_SELECT).setTitleRes(R.string.choose_network_title).setArguments(bundle).launch();
return false;
}
}
use of com.android.settings.core.SubSettingLauncher in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class RunningProcessesView method startServiceDetailsActivity.
// utility method used to start sub activity
private void startServiceDetailsActivity(RunningState.MergedItem mi) {
if (mOwner != null && mi != null) {
// start new fragment to display extended information
Bundle args = new Bundle();
if (mi.mProcess != null) {
args.putInt(RunningServiceDetails.KEY_UID, mi.mProcess.mUid);
args.putString(RunningServiceDetails.KEY_PROCESS, mi.mProcess.mProcessName);
}
args.putInt(RunningServiceDetails.KEY_USER_ID, mi.mUserId);
args.putBoolean(RunningServiceDetails.KEY_BACKGROUND, mAdapter.mShowBackground);
new SubSettingLauncher(getContext()).setDestination(RunningServiceDetails.class.getName()).setArguments(args).setTitleRes(R.string.runningservicedetails_settings_title).setSourceMetricsCategory(mOwner.getMetricsCategory()).launch();
}
}
use of com.android.settings.core.SubSettingLauncher in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class AppInfoDashboardFragment method startAppInfoFragment.
public static void startAppInfoFragment(Class<?> fragment, int title, Bundle args, SettingsPreferenceFragment caller, AppEntry appEntry) {
// start new fragment to display extended information
if (args == null) {
args = new Bundle();
}
args.putString(ARG_PACKAGE_NAME, appEntry.info.packageName);
args.putInt(ARG_PACKAGE_UID, appEntry.info.uid);
new SubSettingLauncher(caller.getContext()).setDestination(fragment.getName()).setArguments(args).setTitleRes(title).setResultListener(caller, SUB_INFO_FRAGMENT).setSourceMetricsCategory(caller.getMetricsCategory()).launch();
}
use of com.android.settings.core.SubSettingLauncher in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class RestrictedAppDetails method startRestrictedAppDetails.
public static void startRestrictedAppDetails(InstrumentedPreferenceFragment fragment, List<AppInfo> appInfos) {
final Bundle args = new Bundle();
args.putParcelableList(EXTRA_APP_INFO_LIST, appInfos);
new SubSettingLauncher(fragment.getContext()).setDestination(RestrictedAppDetails.class.getName()).setArguments(args).setTitleRes(R.string.restricted_app_title).setSourceMetricsCategory(fragment.getMetricsCategory()).launch();
}
Aggregations