Search in sources :

Example 86 with SubSettingLauncher

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

the class ToggleFeaturePreferenceFragmentTest method setUp.

@Before
public void setUp() {
    mInstrumentation.runOnMainSync(() -> {
        MyToggleFeaturePreferenceFragment fragment = new MyToggleFeaturePreferenceFragment();
        Bundle args = new Bundle();
        args.putString(AccessibilitySettings.EXTRA_SUMMARY, SUMMARY_TEXT);
        fragment.setArguments(args);
        new SubSettingLauncher(mActivityRule.getActivity()).setDestination(MyToggleFeaturePreferenceFragment.class.getName()).setArguments(args).setSourceMetricsCategory(InstrumentedPreferenceFragment.METRICS_CATEGORY_UNKNOWN).launch();
    });
}
Also used : SubSettingLauncher(com.android.settings.core.SubSettingLauncher) Bundle(android.os.Bundle) Before(org.junit.Before)

Example 87 with SubSettingLauncher

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

the class AccountSyncPreferenceController method handlePreferenceTreeClick.

@Override
public boolean handlePreferenceTreeClick(Preference preference) {
    if (!KEY_ACCOUNT_SYNC.equals(preference.getKey())) {
        return false;
    }
    final Bundle args = new Bundle();
    args.putParcelable(AccountSyncSettings.ACCOUNT_KEY, mAccount);
    args.putParcelable(EXTRA_USER, mUserHandle);
    new SubSettingLauncher(mContext).setDestination(AccountSyncSettings.class.getName()).setArguments(args).setSourceMetricsCategory(SettingsEnums.ACCOUNT).setTitleRes(R.string.account_sync_title).launch();
    return true;
}
Also used : SubSettingLauncher(com.android.settings.core.SubSettingLauncher) Bundle(android.os.Bundle)

Example 88 with SubSettingLauncher

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

the class ProcessStatsSummary method onPreferenceClick.

@Override
public boolean onPreferenceClick(Preference preference) {
    if (preference == mAppListPreference) {
        final Bundle args = new Bundle();
        args.putBoolean(ARG_TRANSFER_STATS, true);
        args.putInt(ARG_DURATION_INDEX, mDurationIndex);
        mStatsManager.xferStats();
        new SubSettingLauncher(getContext()).setDestination(ProcessStatsUi.class.getName()).setTitleRes(R.string.memory_usage_apps).setArguments(args).setSourceMetricsCategory(getMetricsCategory()).launch();
        return true;
    }
    return false;
}
Also used : SubSettingLauncher(com.android.settings.core.SubSettingLauncher) Bundle(android.os.Bundle)

Example 89 with SubSettingLauncher

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

the class NotificationChannelSlice method getIntent.

@Override
public Intent getIntent() {
    final Bundle args = new Bundle();
    args.putString(AppInfoBase.ARG_PACKAGE_NAME, mPackageName);
    args.putInt(AppInfoBase.ARG_PACKAGE_UID, mUid);
    return new SubSettingLauncher(mContext).setDestination(AppNotificationSettings.class.getName()).setTitleRes(R.string.notifications_title).setArguments(args).setSourceMetricsCategory(SettingsEnums.SLICE).toIntent();
}
Also used : AppNotificationSettings(com.android.settings.notification.AppNotificationSettings) SubSettingLauncher(com.android.settings.core.SubSettingLauncher) Bundle(android.os.Bundle)

Example 90 with SubSettingLauncher

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

the class NotificationChannelSlice method buildRowSliceAction.

private SliceAction buildRowSliceAction(NotificationChannel channel, IconCompat icon) {
    final Bundle channelArgs = new Bundle();
    channelArgs.putInt(AppInfoBase.ARG_PACKAGE_UID, mUid);
    channelArgs.putString(AppInfoBase.ARG_PACKAGE_NAME, mPackageName);
    channelArgs.putString(Settings.EXTRA_CHANNEL_ID, channel.getId());
    final Intent channelIntent = new SubSettingLauncher(mContext).setDestination(ChannelNotificationSettings.class.getName()).setArguments(channelArgs).setTitleRes(R.string.notification_channel_title).setSourceMetricsCategory(SettingsEnums.SLICE).toIntent();
    return SliceAction.createDeeplink(PendingIntent.getActivity(mContext, channel.hashCode(), channelIntent, 0), icon, ListBuilder.ICON_IMAGE, channel.getName());
}
Also used : SubSettingLauncher(com.android.settings.core.SubSettingLauncher) Bundle(android.os.Bundle) PendingIntent(android.app.PendingIntent) Intent(android.content.Intent) ChannelNotificationSettings(com.android.settings.notification.ChannelNotificationSettings)

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