Search in sources :

Example 1 with SubSettingLauncher

use of com.android.settings.core.SubSettingLauncher in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class SavedAccessPointsWifiSettings method showWifiPage.

public void showWifiPage(@Nullable AccessPointPreference accessPoint) {
    removeDialog(WifiSettings.WIFI_DIALOG_ID);
    if (accessPoint != null) {
        // Save the access point and edit mode
        mSelectedAccessPoint = accessPoint.getAccessPoint();
    } else {
        // No access point is selected. Clear saved state.
        mSelectedAccessPoint = null;
        mAccessPointSavedState = null;
    }
    if (mSelectedAccessPoint == null) {
        mSelectedAccessPoint = new AccessPoint(getActivity(), mAccessPointSavedState);
    }
    final Bundle savedState = new Bundle();
    mSelectedAccessPoint.saveWifiState(savedState);
    new SubSettingLauncher(getContext()).setTitleText(mSelectedAccessPoint.getTitle()).setDestination(WifiNetworkDetailsFragment.class.getName()).setArguments(savedState).setSourceMetricsCategory(getMetricsCategory()).launch();
}
Also used : SubSettingLauncher(com.android.settings.core.SubSettingLauncher) Bundle(android.os.Bundle) AccessPoint(com.android.settingslib.wifi.AccessPoint)

Example 2 with SubSettingLauncher

use of com.android.settings.core.SubSettingLauncher in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class WifiSettings method launchNetworkDetailsFragment.

private void launchNetworkDetailsFragment(ConnectedAccessPointPreference pref) {
    final AccessPoint accessPoint = pref.getAccessPoint();
    final Context context = getContext();
    final CharSequence title = FeatureFlagUtils.isEnabled(context, FeatureFlags.WIFI_DETAILS_DATAUSAGE_HEADER) ? accessPoint.getTitle() : context.getText(R.string.pref_title_network_details);
    new SubSettingLauncher(getContext()).setTitleText(title).setDestination(WifiNetworkDetailsFragment.class.getName()).setArguments(pref.getExtras()).setSourceMetricsCategory(getMetricsCategory()).launch();
}
Also used : Context(android.content.Context) SubSettingLauncher(com.android.settings.core.SubSettingLauncher) AccessPoint(com.android.settingslib.wifi.AccessPoint)

Example 3 with SubSettingLauncher

use of com.android.settings.core.SubSettingLauncher in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class AccessibilityDetailsSettingsFragment method openAccessibilitySettingsAndFinish.

@VisibleForTesting
void openAccessibilitySettingsAndFinish() {
    new SubSettingLauncher(getActivity()).setDestination(AccessibilitySettings.class.getName()).setSourceMetricsCategory(getMetricsCategory()).launch();
    finish();
}
Also used : SubSettingLauncher(com.android.settings.core.SubSettingLauncher) VisibleForTesting(com.android.internal.annotations.VisibleForTesting)

Example 4 with SubSettingLauncher

use of com.android.settings.core.SubSettingLauncher in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class AccessibilityHearingAidPreferenceController method launchBluetoothDeviceDetailSetting.

@VisibleForTesting
void launchBluetoothDeviceDetailSetting(final CachedBluetoothDevice device) {
    if (device == null) {
        return;
    }
    final Bundle args = new Bundle();
    args.putString(BluetoothDeviceDetailsFragment.KEY_DEVICE_ADDRESS, device.getDevice().getAddress());
    new SubSettingLauncher(mContext).setDestination(BluetoothDeviceDetailsFragment.class.getName()).setArguments(args).setTitleRes(R.string.device_details_title).setSourceMetricsCategory(SettingsEnums.ACCESSIBILITY).launch();
}
Also used : SubSettingLauncher(com.android.settings.core.SubSettingLauncher) Bundle(android.os.Bundle) BluetoothDeviceDetailsFragment(com.android.settings.bluetooth.BluetoothDeviceDetailsFragment) VisibleForTesting(androidx.annotation.VisibleForTesting)

Example 5 with SubSettingLauncher

use of com.android.settings.core.SubSettingLauncher in project Resurrection_packages_apps_Settings by ResurrectionRemix.

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).launch();
    return true;
}
Also used : SubSettingLauncher(com.android.settings.core.SubSettingLauncher) Bundle(android.os.Bundle) Instrumentable(com.android.settingslib.core.instrumentation.Instrumentable)

Aggregations

SubSettingLauncher (com.android.settings.core.SubSettingLauncher)65 Bundle (android.os.Bundle)57 Intent (android.content.Intent)11 VisibleForTesting (androidx.annotation.VisibleForTesting)9 Preference (androidx.preference.Preference)7 ManageApplications (com.android.settings.applications.manageapplications.ManageApplications)7 UserHandle (android.os.UserHandle)5 Context (android.content.Context)4 PendingIntent (android.app.PendingIntent)3 AccessPoint (com.android.settingslib.wifi.AccessPoint)3 PackageManager (android.content.pm.PackageManager)2 PersistableBundle (android.os.PersistableBundle)2 VolumeInfo (android.os.storage.VolumeInfo)2 VisibleForTesting (com.android.internal.annotations.VisibleForTesting)2 NetworkSelectSettings (com.android.settings.network.telephony.NetworkSelectSettings)2 ApplicationsState (com.android.settingslib.applications.ApplicationsState)2 Activity (android.app.Activity)1 NotificationChannel (android.app.NotificationChannel)1 ComponentName (android.content.ComponentName)1 UserInfo (android.content.pm.UserInfo)1