Search in sources :

Example 26 with SubSettingLauncher

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

the class BrandedAccountPreferenceController method displayPreference.

@Override
public void displayPreference(PreferenceScreen screen) {
    super.displayPreference(screen);
    final AccountFeatureProvider accountFeatureProvider = FeatureFactory.getFactory(mContext).getAccountFeatureProvider();
    final Preference accountPreference = screen.findPreference(getPreferenceKey());
    if (accountPreference != null && (mAccounts == null || mAccounts.length == 0)) {
        screen.removePreference(accountPreference);
        return;
    }
    accountPreference.setSummary(mAccounts[0].name);
    accountPreference.setOnPreferenceClickListener(preference -> {
        final Bundle args = new Bundle();
        args.putParcelable(AccountDetailDashboardFragment.KEY_ACCOUNT, mAccounts[0]);
        args.putParcelable(AccountDetailDashboardFragment.KEY_USER_HANDLE, android.os.Process.myUserHandle());
        args.putString(AccountDetailDashboardFragment.KEY_ACCOUNT_TYPE, accountFeatureProvider.getAccountType());
        new SubSettingLauncher(mContext).setDestination(AccountDetailDashboardFragment.class.getName()).setTitleRes(R.string.account_sync_title).setArguments(args).setSourceMetricsCategory(SettingsEnums.DEVICEINFO).launch();
        return true;
    });
}
Also used : AccountDetailDashboardFragment(com.android.settings.accounts.AccountDetailDashboardFragment) Preference(androidx.preference.Preference) SubSettingLauncher(com.android.settings.core.SubSettingLauncher) Bundle(android.os.Bundle) AccountFeatureProvider(com.android.settings.accounts.AccountFeatureProvider)

Example 27 with SubSettingLauncher

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

the class OpenNetworkSelectPagePreferenceController method handlePreferenceTreeClick.

@Override
public boolean handlePreferenceTreeClick(Preference preference) {
    if (TextUtils.equals(preference.getKey(), getPreferenceKey())) {
        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 true;
    }
    return false;
}
Also used : SubSettingLauncher(com.android.settings.core.SubSettingLauncher) Bundle(android.os.Bundle) NetworkSelectSettings(com.android.settings.network.telephony.NetworkSelectSettings)

Example 28 with SubSettingLauncher

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

the class BubbleSummaryPreferenceController method updateState.

@Override
public void updateState(Preference preference) {
    super.updateState(preference);
    if (mAppRow != null) {
        Bundle args = new Bundle();
        args.putString(AppInfoBase.ARG_PACKAGE_NAME, mAppRow.pkg);
        args.putInt(AppInfoBase.ARG_PACKAGE_UID, mAppRow.uid);
        preference.setIntent(new SubSettingLauncher(mContext).setDestination(AppBubbleNotificationSettings.class.getName()).setArguments(args).setSourceMetricsCategory(SettingsEnums.NOTIFICATION_APP_NOTIFICATION).toIntent());
    }
}
Also used : SubSettingLauncher(com.android.settings.core.SubSettingLauncher) Bundle(android.os.Bundle)

Example 29 with SubSettingLauncher

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

the class ZenModeRuleSettingsBase method onCreate.

@Override
public void onCreate(Bundle icicle) {
    mContext = getActivity();
    final Intent intent = getActivity().getIntent();
    if (DEBUG)
        Log.d(TAG, "onCreate getIntent()=" + intent);
    if (intent == null) {
        Log.w(TAG, "No intent");
        toastAndFinish();
        return;
    }
    mId = intent.getStringExtra(ConditionProviderService.EXTRA_RULE_ID);
    if (mId == null) {
        Log.w(TAG, "rule id is null");
        toastAndFinish();
        return;
    }
    if (DEBUG)
        Log.d(TAG, "mId=" + mId);
    if (refreshRuleOrFinish()) {
        return;
    }
    super.onCreate(icicle);
    mCustomBehaviorPreference = getPreferenceScreen().findPreference(CUSTOM_BEHAVIOR_KEY);
    mCustomBehaviorPreference.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {

        @Override
        public boolean onPreferenceClick(Preference preference) {
            Bundle bundle = new Bundle();
            bundle.putString(ZenCustomRuleSettings.RULE_ID, mId);
            new SubSettingLauncher(mContext).setDestination(ZenCustomRuleSettings.class.getName()).setArguments(bundle).setSourceMetricsCategory(// TODO
            0).launch();
            return true;
        }
    });
    onCreateInternal();
}
Also used : Preference(androidx.preference.Preference) SubSettingLauncher(com.android.settings.core.SubSettingLauncher) Bundle(android.os.Bundle) Intent(android.content.Intent)

Example 30 with SubSettingLauncher

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

the class BillingCyclePreference method getIntent.

@Override
public Intent getIntent() {
    final Bundle args = new Bundle();
    args.putParcelable(DataUsageList.EXTRA_NETWORK_TEMPLATE, mTemplate);
    return new SubSettingLauncher(getContext()).setDestination(BillingCycleSettings.class.getName()).setArguments(args).setTitleRes(R.string.billing_cycle).setSourceMetricsCategory(SettingsEnums.PAGE_UNKNOWN).toIntent();
}
Also used : SubSettingLauncher(com.android.settings.core.SubSettingLauncher) Bundle(android.os.Bundle)

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