Search in sources :

Example 11 with SubSettingLauncher

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

the class StorageItemPreferenceController method getGamesIntent.

private Intent getGamesIntent() {
    final Bundle args = getWorkAnnotatedBundle(1);
    args.putString(ManageApplications.EXTRA_CLASSNAME, Settings.GamesStorageActivity.class.getName());
    return new SubSettingLauncher(mContext).setDestination(ManageApplications.class.getName()).setTitleRes(R.string.game_storage_settings).setArguments(args).setSourceMetricsCategory(mMetricsFeatureProvider.getMetricsCategory(mFragment)).toIntent();
}
Also used : SubSettingLauncher(com.android.settings.core.SubSettingLauncher) Bundle(android.os.Bundle) ManageApplications(com.android.settings.applications.manageapplications.ManageApplications)

Example 12 with SubSettingLauncher

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

the class StorageItemPreferenceController method getAudioIntent.

private Intent getAudioIntent() {
    if (mVolume == null) {
        return null;
    }
    Bundle args = getWorkAnnotatedBundle(4);
    args.putString(ManageApplications.EXTRA_CLASSNAME, Settings.StorageUseActivity.class.getName());
    args.putString(ManageApplications.EXTRA_VOLUME_UUID, mVolume.getFsUuid());
    args.putString(ManageApplications.EXTRA_VOLUME_NAME, mVolume.getDescription());
    args.putInt(ManageApplications.EXTRA_STORAGE_TYPE, ManageApplications.STORAGE_TYPE_MUSIC);
    return new SubSettingLauncher(mContext).setDestination(ManageApplications.class.getName()).setTitleRes(R.string.storage_music_audio).setArguments(args).setSourceMetricsCategory(mMetricsFeatureProvider.getMetricsCategory(mFragment)).toIntent();
}
Also used : SubSettingLauncher(com.android.settings.core.SubSettingLauncher) Bundle(android.os.Bundle) ManageApplications(com.android.settings.applications.manageapplications.ManageApplications)

Example 13 with SubSettingLauncher

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

the class UserSettings method onManageUserClicked.

private void onManageUserClicked(int userId, boolean newUser) {
    mAddingUser = false;
    if (userId == UserPreference.USERID_GUEST_DEFAULTS) {
        Bundle extras = new Bundle();
        extras.putBoolean(UserDetailsSettings.EXTRA_USER_GUEST, true);
        new SubSettingLauncher(getContext()).setDestination(UserDetailsSettings.class.getName()).setArguments(extras).setTitleRes(R.string.user_guest).setSourceMetricsCategory(getMetricsCategory()).launch();
        return;
    }
    UserInfo info = mUserManager.getUserInfo(userId);
    if (info.isRestricted() && mUserCaps.mIsAdmin) {
        Bundle extras = new Bundle();
        extras.putInt(RestrictedProfileSettings.EXTRA_USER_ID, userId);
        extras.putBoolean(RestrictedProfileSettings.EXTRA_NEW_USER, newUser);
        new SubSettingLauncher(getContext()).setDestination(RestrictedProfileSettings.class.getName()).setArguments(extras).setTitleRes(R.string.user_restrictions_title).setSourceMetricsCategory(getMetricsCategory()).launch();
    } else if (info.id == UserHandle.myUserId()) {
        // Jump to owner info panel
        OwnerInfoSettings.show(this);
    } else if (mUserCaps.mIsAdmin) {
        final Bundle extras = new Bundle();
        extras.putInt(UserDetailsSettings.EXTRA_USER_ID, userId);
        new SubSettingLauncher(getContext()).setDestination(UserDetailsSettings.class.getName()).setArguments(extras).setTitleText(info.name).setSourceMetricsCategory(getMetricsCategory()).launch();
    }
}
Also used : SubSettingLauncher(com.android.settings.core.SubSettingLauncher) Bundle(android.os.Bundle) UserInfo(android.content.pm.UserInfo)

Example 14 with SubSettingLauncher

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

the class RecentAppsPreferenceController method displayPreference.

@Override
public void displayPreference(PreferenceScreen screen) {
    super.displayPreference(screen);
    mDivider = screen.findPreference(KEY_DIVIDER);
    mRecentAppsPreference = screen.findPreference(getPreferenceKey());
    final View view = mRecentAppsPreference.findViewById(R.id.app_entities_header);
    mAppEntitiesController = AppEntitiesHeaderController.newInstance(mContext, view).setHeaderTitleRes(R.string.recent_app_category_title).setHeaderDetailsClickListener((View v) -> {
        new SubSettingLauncher(mContext).setDestination(ManageApplications.class.getName()).setArguments(null).setTitleRes(R.string.application_info_label).setSourceMetricsCategory(SettingsEnums.SETTINGS_APP_NOTIF_CATEGORY).launch();
    });
}
Also used : SubSettingLauncher(com.android.settings.core.SubSettingLauncher) View(android.view.View)

Example 15 with SubSettingLauncher

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

the class AppInfoBase method startAppInfoFragment.

public static void startAppInfoFragment(Class<?> fragment, int titleRes, String pkg, int uid, Fragment source, int request, int sourceMetricsCategory) {
    final Bundle args = new Bundle();
    args.putString(AppInfoBase.ARG_PACKAGE_NAME, pkg);
    args.putInt(AppInfoBase.ARG_PACKAGE_UID, uid);
    new SubSettingLauncher(source.getContext()).setDestination(fragment.getName()).setSourceMetricsCategory(sourceMetricsCategory).setTitleRes(titleRes).setArguments(args).setUserHandle(new UserHandle(UserHandle.getUserId(uid))).setResultListener(source, request).launch();
}
Also used : SubSettingLauncher(com.android.settings.core.SubSettingLauncher) Bundle(android.os.Bundle) UserHandle(android.os.UserHandle)

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