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;
}
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;
}
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;
}
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();
}
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();
}
Aggregations