Search in sources :

Example 41 with SubSettingLauncher

use of com.android.settings.core.SubSettingLauncher in project android_packages_apps_Settings by omnirom.

the class ConnectedUsbDeviceUpdater method initUsbPreference.

public void initUsbPreference(Context context) {
    mUsbPreference = new RestrictedPreference(context, null);
    mUsbPreference.setTitle(R.string.usb_pref);
    mUsbPreference.setIcon(R.drawable.ic_usb);
    mUsbPreference.setKey(PREF_KEY);
    mUsbPreference.setDisabledByAdmin(checkIfUsbDataSignalingIsDisabled(context, UserHandle.myUserId()));
    mUsbPreference.setOnPreferenceClickListener((Preference p) -> {
        mMetricsFeatureProvider.logClickedPreference(p, mFragment.getMetricsCategory());
        // New version - uses a separate screen.
        new SubSettingLauncher(mFragment.getContext()).setDestination(UsbDetailsFragment.class.getName()).setTitleRes(R.string.usb_preference).setSourceMetricsCategory(mFragment.getMetricsCategory()).launch();
        return true;
    });
    forceUpdate();
}
Also used : RestrictedPreference(com.android.settingslib.RestrictedPreference) RestrictedPreference(com.android.settingslib.RestrictedPreference) Preference(androidx.preference.Preference) SubSettingLauncher(com.android.settings.core.SubSettingLauncher)

Example 42 with SubSettingLauncher

use of com.android.settings.core.SubSettingLauncher in project android_packages_apps_Settings by omnirom.

the class StorageUtils method launchForgetMissingVolumeRecordFragment.

/**
 * Launches the fragment to forget a specified missing volume record.
 */
public static void launchForgetMissingVolumeRecordFragment(Context context, StorageEntry storageEntry) {
    if (storageEntry == null || !storageEntry.isVolumeRecordMissed()) {
        return;
    }
    final Bundle args = new Bundle();
    args.putString(VolumeRecord.EXTRA_FS_UUID, storageEntry.getFsUuid());
    new SubSettingLauncher(context).setDestination(PrivateVolumeForget.class.getCanonicalName()).setTitleRes(R.string.storage_menu_forget).setSourceMetricsCategory(SettingsEnums.SETTINGS_STORAGE_CATEGORY).setArguments(args).launch();
}
Also used : SubSettingLauncher(com.android.settings.core.SubSettingLauncher) Bundle(android.os.Bundle) PrivateVolumeForget(com.android.settings.deviceinfo.PrivateVolumeForget)

Example 43 with SubSettingLauncher

use of com.android.settings.core.SubSettingLauncher in project android_packages_apps_Settings by omnirom.

the class AccessibilitySettingsForSetupWizardActivity method tryLaunchFontSizeSettings.

@VisibleForTesting
void tryLaunchFontSizeSettings() {
    if (WizardManagerHelper.isAnySetupWizard(getIntent()) && new ComponentName(getPackageName(), CLASS_NAME_FONT_SIZE_SETTINGS_FOR_SUW).equals(getIntent().getComponent())) {
        final Bundle args = new Bundle();
        args.putInt(HelpResourceProvider.HELP_URI_RESOURCE_KEY, 0);
        args.putBoolean(SearchMenuController.NEED_SEARCH_ICON_IN_ACTION_BAR, false);
        final SubSettingLauncher subSettingLauncher = new SubSettingLauncher(this).setDestination(FontSizePreferenceFragmentForSetupWizard.class.getName()).setArguments(args).setSourceMetricsCategory(Instrumentable.METRICS_CATEGORY_UNKNOWN).setExtras(SetupWizardUtils.copyLifecycleExtra(getIntent().getExtras(), new Bundle())).setTransitionType(SettingsTransitionHelper.TransitionType.TRANSITION_FADE);
        Log.d(LOG_TAG, "Launch font size settings");
        subSettingLauncher.launch();
        finish();
    }
}
Also used : SubSettingLauncher(com.android.settings.core.SubSettingLauncher) FontSizePreferenceFragmentForSetupWizard(com.android.settings.display.FontSizePreferenceFragmentForSetupWizard) Bundle(android.os.Bundle) ComponentName(android.content.ComponentName) VisibleForTesting(androidx.annotation.VisibleForTesting)

Example 44 with SubSettingLauncher

use of com.android.settings.core.SubSettingLauncher in project android_packages_apps_Settings by omnirom.

the class AccessibilitySettingsForSetupWizardActivity method onPreferenceStartFragment.

@Override
public boolean onPreferenceStartFragment(PreferenceFragmentCompat caller, Preference pref) {
    Bundle args = pref.getExtras();
    if (args == null) {
        args = new Bundle();
    }
    args.putInt(HelpResourceProvider.HELP_URI_RESOURCE_KEY, 0);
    args.putBoolean(SearchMenuController.NEED_SEARCH_ICON_IN_ACTION_BAR, false);
    new SubSettingLauncher(this).setDestination(pref.getFragment()).setArguments(args).setSourceMetricsCategory(caller instanceof Instrumentable ? ((Instrumentable) caller).getMetricsCategory() : Instrumentable.METRICS_CATEGORY_UNKNOWN).setExtras(SetupWizardUtils.copyLifecycleExtra(getIntent().getExtras(), new Bundle())).setTransitionType(SettingsTransitionHelper.TransitionType.TRANSITION_FADE).launch();
    return true;
}
Also used : SubSettingLauncher(com.android.settings.core.SubSettingLauncher) Bundle(android.os.Bundle) Instrumentable(com.android.settingslib.core.instrumentation.Instrumentable)

Example 45 with SubSettingLauncher

use of com.android.settings.core.SubSettingLauncher in project android_packages_apps_Settings by omnirom.

the class AccessibilityDialogUtils method getCustomizeAccessibilityButtonLink.

private static CharSequence getCustomizeAccessibilityButtonLink(Context context) {
    final View.OnClickListener linkListener = v -> new SubSettingLauncher(context).setDestination(AccessibilityButtonFragment.class.getName()).setSourceMetricsCategory(SettingsEnums.SWITCH_SHORTCUT_DIALOG_ACCESSIBILITY_BUTTON_SETTINGS).launch();
    final AnnotationSpan.LinkInfo linkInfo = new AnnotationSpan.LinkInfo(AnnotationSpan.LinkInfo.DEFAULT_ANNOTATION, linkListener);
    return AnnotationSpan.linkify(context.getText(R.string.accessibility_shortcut_edit_dialog_summary_software_floating), linkInfo);
}
Also used : Context(android.content.Context) LinearLayout(android.widget.LinearLayout) AlertDialog(androidx.appcompat.app.AlertDialog) ImageSpan(android.text.style.ImageSpan) NonNull(androidx.annotation.NonNull) Spannable(android.text.Spannable) ImageView(android.widget.ImageView) AnnotationSpan(com.android.settings.utils.AnnotationSpan) MessageFormat(android.icu.text.MessageFormat) Dialog(android.app.Dialog) LinkMovementMethod(android.text.method.LinkMovementMethod) Drawable(android.graphics.drawable.Drawable) IntDef(androidx.annotation.IntDef) ColorInt(androidx.annotation.ColorInt) TypedArray(android.content.res.TypedArray) Retention(java.lang.annotation.Retention) ItemInfo(com.android.settings.accessibility.ItemInfoArrayAdapter.ItemInfo) SpannableStringBuilder(android.text.SpannableStringBuilder) CheckBox(android.widget.CheckBox) View(android.view.View) Button(android.widget.Button) AdapterView(android.widget.AdapterView) ContextCompat(androidx.core.content.ContextCompat) DialogInterface(android.content.DialogInterface) R(com.android.settings.R) SubSettingLauncher(com.android.settings.core.SubSettingLauncher) SpannableString(android.text.SpannableString) LayoutInflater(android.view.LayoutInflater) SettingsEnums(android.app.settings.SettingsEnums) TextUtils(android.text.TextUtils) AbsListView(android.widget.AbsListView) List(java.util.List) TextView(android.widget.TextView) Nullable(androidx.annotation.Nullable) ScrollView(android.widget.ScrollView) ListView(android.widget.ListView) RetentionPolicy(java.lang.annotation.RetentionPolicy) SubSettingLauncher(com.android.settings.core.SubSettingLauncher) ImageView(android.widget.ImageView) View(android.view.View) AdapterView(android.widget.AdapterView) AbsListView(android.widget.AbsListView) TextView(android.widget.TextView) ScrollView(android.widget.ScrollView) ListView(android.widget.ListView) AnnotationSpan(com.android.settings.utils.AnnotationSpan)

Aggregations

SubSettingLauncher (com.android.settings.core.SubSettingLauncher)135 Bundle (android.os.Bundle)116 Intent (android.content.Intent)24 VisibleForTesting (androidx.annotation.VisibleForTesting)16 Preference (androidx.preference.Preference)14 UserHandle (android.os.UserHandle)10 ManageApplications (com.android.settings.applications.manageapplications.ManageApplications)10 Context (android.content.Context)9 PendingIntent (android.app.PendingIntent)6 PackageManager (android.content.pm.PackageManager)5 ComponentName (android.content.ComponentName)4 PersistableBundle (android.os.PersistableBundle)4 ApplicationsState (com.android.settingslib.applications.ApplicationsState)4 UserManager (android.os.UserManager)3 View (android.view.View)3 NetworkSelectSettings (com.android.settings.network.telephony.NetworkSelectSettings)3 Activity (android.app.Activity)2 NotificationChannel (android.app.NotificationChannel)2 Drawable (android.graphics.drawable.Drawable)2 Uri (android.net.Uri)2