Search in sources :

Example 91 with SubSettingLauncher

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);
}
Also used : SubSettingLauncher(com.android.settings.core.SubSettingLauncher) Bundle(android.os.Bundle) VisibleForTesting(com.android.internal.annotations.VisibleForTesting)

Example 92 with SubSettingLauncher

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);
    }
}
Also used : SubSettingLauncher(com.android.settings.core.SubSettingLauncher) AccessPointPreference(com.android.settingslib.wifi.AccessPointPreference) Bundle(android.os.Bundle)

Example 93 with SubSettingLauncher

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();
}
Also used : Context(android.content.Context) SubSettingLauncher(com.android.settings.core.SubSettingLauncher) Bundle(android.os.Bundle) PersistableBundle(android.os.PersistableBundle)

Example 94 with SubSettingLauncher

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();
}
Also used : SubSettingLauncher(com.android.settings.core.SubSettingLauncher) Bundle(android.os.Bundle) VisibleForTesting(androidx.annotation.VisibleForTesting)

Example 95 with SubSettingLauncher

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);
}
Also used : Context(android.content.Context) SubSettingLauncher(com.android.settings.core.SubSettingLauncher) Bundle(android.os.Bundle) Intent(android.content.Intent) MountTask(com.android.settings.deviceinfo.StorageSettings.MountTask)

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