use of com.android.settings.core.SubSettingLauncher in project android_packages_apps_Settings by omnirom.
the class DataUsagePreference method getIntent.
@Override
public Intent getIntent() {
final Bundle args = new Bundle();
final SubSettingLauncher launcher;
args.putParcelable(DataUsageList.EXTRA_NETWORK_TEMPLATE, mTemplate);
args.putInt(DataUsageList.EXTRA_SUB_ID, mSubId);
args.putInt(DataUsageList.EXTRA_NETWORK_TYPE, mTemplate.isMatchRuleMobile() ? ConnectivityManager.TYPE_MOBILE : ConnectivityManager.TYPE_WIFI);
launcher = new SubSettingLauncher(getContext()).setArguments(args).setDestination(DataUsageList.class.getName()).setSourceMetricsCategory(SettingsEnums.PAGE_UNKNOWN);
if (mTemplate.isMatchRuleMobile()) {
launcher.setTitleRes(R.string.app_cellular_data_usage);
} else {
launcher.setTitleRes(mTitleRes);
}
return launcher.toIntent();
}
use of com.android.settings.core.SubSettingLauncher in project android_packages_apps_Settings by omnirom.
the class BluetoothDevicesSlice method getPairNewDeviceAction.
private SliceAction getPairNewDeviceAction() {
final Drawable drawable = mContext.getDrawable(R.drawable.ic_add_24dp);
drawable.setTint(Utils.getColorAccentDefaultColor(mContext));
final IconCompat icon = Utils.createIconWithDrawable(drawable);
final String title = mContext.getString(R.string.bluetooth_pairing_pref_title);
final Intent intent = new SubSettingLauncher(mContext).setDestination(BluetoothPairingDetail.class.getName()).setTitleRes(R.string.bluetooth_pairing_page_title).setSourceMetricsCategory(SettingsEnums.BLUETOOTH_PAIRING).toIntent();
final PendingIntent pi = PendingIntent.getActivity(mContext, intent.hashCode(), intent, PendingIntent.FLAG_IMMUTABLE);
return SliceAction.createDeeplink(pi, icon, ListBuilder.ICON_IMAGE, title);
}
use of com.android.settings.core.SubSettingLauncher in project android_packages_apps_Settings by omnirom.
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();
}
use of com.android.settings.core.SubSettingLauncher in project android_packages_apps_Settings by omnirom.
the class BatteryOptimizationPreferenceController method handlePreferenceTreeClick.
@Override
public boolean handlePreferenceTreeClick(Preference preference) {
if (!KEY_BACKGROUND_ACTIVITY.equals(preference.getKey())) {
return false;
}
final Bundle args = new Bundle();
args.putString(ManageApplications.EXTRA_CLASSNAME, Settings.HighPowerApplicationsActivity.class.getName());
new SubSettingLauncher(mSettingsActivity).setDestination(ManageApplications.class.getName()).setArguments(args).setTitleRes(R.string.high_power_apps).setSourceMetricsCategory(mFragment.getMetricsCategory()).launch();
return true;
}
use of com.android.settings.core.SubSettingLauncher in project android_packages_apps_Settings by omnirom.
the class RecentConversationsPreferenceController method getSubSettingLauncher.
SubSettingLauncher getSubSettingLauncher(ConversationChannel conversation, CharSequence title) {
Bundle channelArgs = new Bundle();
channelArgs.putInt(AppInfoBase.ARG_PACKAGE_UID, conversation.getUid());
channelArgs.putString(AppInfoBase.ARG_PACKAGE_NAME, conversation.getShortcutInfo().getPackage());
channelArgs.putString(Settings.EXTRA_CHANNEL_ID, conversation.getNotificationChannel().getId());
channelArgs.putString(Settings.EXTRA_CONVERSATION_ID, conversation.getShortcutInfo().getId());
return new SubSettingLauncher(mContext).setDestination(ChannelNotificationSettings.class.getName()).setArguments(channelArgs).setExtras(channelArgs).setUserHandle(UserHandle.getUserHandleForUid(conversation.getUid())).setTitleText(title).setSourceMetricsCategory(SettingsEnums.NOTIFICATION_CONVERSATION_LIST_SETTINGS);
}
Aggregations