Search in sources :

Example 6 with SubSettingLauncher

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

the class AccountTypePreference method onPreferenceClick.

@Override
public boolean onPreferenceClick(Preference preference) {
    if (mFragment != null) {
        UserManager userManager = (UserManager) getContext().getSystemService(Context.USER_SERVICE);
        UserHandle user = mFragmentArguments.getParcelable(EXTRA_USER);
        if (user != null && Utils.startQuietModeDialogIfNecessary(getContext(), userManager, user.getIdentifier())) {
            return true;
        } else if (user != null && Utils.unlockWorkProfileIfNecessary(getContext(), user.getIdentifier())) {
            return true;
        }
        new SubSettingLauncher(getContext()).setDestination(mFragment).setArguments(mFragmentArguments).setTitleRes(mTitleResPackageName, mTitleResId).setSourceMetricsCategory(mMetricsCategory).launch();
        return true;
    }
    return false;
}
Also used : SubSettingLauncher(com.android.settings.core.SubSettingLauncher) UserManager(android.os.UserManager) UserHandle(android.os.UserHandle)

Example 7 with SubSettingLauncher

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

the class AccountPreferenceController method onPreferenceClick.

@Override
public boolean onPreferenceClick(Preference preference) {
    // Check the preference
    final int count = mProfiles.size();
    for (int i = 0; i < count; i++) {
        ProfileData profileData = mProfiles.valueAt(i);
        if (preference == profileData.addAccountPreference) {
            Intent intent = new Intent(ACTION_ADD_ACCOUNT);
            intent.putExtra(EXTRA_USER, profileData.userInfo.getUserHandle());
            intent.putExtra(EXTRA_AUTHORITIES, mAuthorities);
            mContext.startActivity(intent);
            return true;
        }
        if (preference == profileData.removeWorkProfilePreference) {
            final int userId = profileData.userInfo.id;
            RemoveUserFragment.newInstance(userId).show(mParent.getFragmentManager(), "removeUser");
            return true;
        }
        if (preference == profileData.managedProfilePreference) {
            Bundle arguments = new Bundle();
            arguments.putParcelable(Intent.EXTRA_USER, profileData.userInfo.getUserHandle());
            new SubSettingLauncher(mContext).setSourceMetricsCategory(mParent.getMetricsCategory()).setDestination(ManagedProfileSettings.class.getName()).setTitleRes(R.string.managed_profile_settings_title).setArguments(arguments).launch();
            return true;
        }
    }
    return false;
}
Also used : SubSettingLauncher(com.android.settings.core.SubSettingLauncher) Bundle(android.os.Bundle) Intent(android.content.Intent)

Example 8 with SubSettingLauncher

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

the class ManageApplications method onOptionsItemSelected.

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    int menuId = item.getItemId();
    switch(item.getItemId()) {
        case R.id.sort_order_alpha:
        case R.id.sort_order_size:
            if (mApplications != null) {
                mApplications.rebuild(menuId);
            }
            break;
        case R.id.show_system:
        case R.id.hide_system:
            mShowSystem = !mShowSystem;
            mApplications.rebuild();
            break;
        case R.id.notification_log:
            new SubSettingLauncher(getContext()).setDestination(NotificationStation.class.getName()).setTitleRes(R.string.notification_log_title).setSourceMetricsCategory(getMetricsCategory()).setResultListener(this, NOTIFICATION_LOG).launch();
            return true;
        case R.id.reset_app_preferences:
            mResetAppsHelper.buildResetDialog();
            return true;
        case R.id.advanced:
            if (mListType == LIST_TYPE_NOTIFICATION) {
                new SubSettingLauncher(getContext()).setDestination(ConfigureNotificationSettings.class.getName()).setTitleRes(R.string.configure_notification_settings).setSourceMetricsCategory(getMetricsCategory()).setResultListener(this, ADVANCED_SETTINGS).launch();
            } else {
                Intent intent = new Intent(android.provider.Settings.ACTION_MANAGE_DEFAULT_APPS_SETTINGS);
                startActivityForResult(intent, ADVANCED_SETTINGS);
            }
            return true;
        default:
            // Handle the home button
            return false;
    }
    updateOptionsMenu();
    return true;
}
Also used : NotificationStation(com.android.settings.notification.NotificationStation) SubSettingLauncher(com.android.settings.core.SubSettingLauncher) Intent(android.content.Intent) ConfigureNotificationSettings(com.android.settings.notification.ConfigureNotificationSettings)

Example 9 with SubSettingLauncher

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

the class StorageItemPreferenceController method getPhotosIntent.

private Intent getPhotosIntent() {
    Bundle args = getWorkAnnotatedBundle(2);
    args.putString(ManageApplications.EXTRA_CLASSNAME, Settings.PhotosStorageActivity.class.getName());
    args.putInt(ManageApplications.EXTRA_STORAGE_TYPE, ManageApplications.STORAGE_TYPE_PHOTOS_VIDEOS);
    return new SubSettingLauncher(mContext).setDestination(ManageApplications.class.getName()).setTitleRes(R.string.storage_photos_videos).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 10 with SubSettingLauncher

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

the class StorageItemPreferenceController method getMoviesIntent.

private Intent getMoviesIntent() {
    final Bundle args = getWorkAnnotatedBundle(1);
    args.putString(ManageApplications.EXTRA_CLASSNAME, Settings.MoviesStorageActivity.class.getName());
    return new SubSettingLauncher(mContext).setDestination(ManageApplications.class.getName()).setTitleRes(R.string.storage_movies_tv).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)

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