use of com.android.settings.core.SubSettingLauncher in project android_packages_apps_Settings by omnirom.
the class AccountPreferenceController method onPreferenceClick.
@Override
public boolean onPreferenceClick(Preference preference) {
final int metricsCategory = mFragment.getMetricsCategory();
// Check the preference
final int count = mProfiles.size();
for (int i = 0; i < count; i++) {
ProfileData profileData = mProfiles.valueAt(i);
if (preference == profileData.addAccountPreference) {
mMetricsFeatureProvider.logClickedPreference(preference, metricsCategory);
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) {
mMetricsFeatureProvider.logClickedPreference(preference, metricsCategory);
final int userId = profileData.userInfo.id;
RemoveUserFragment.newInstance(userId).show(mFragment.getFragmentManager(), "removeUser");
return true;
}
if (preference == profileData.managedProfilePreference) {
mMetricsFeatureProvider.logClickedPreference(preference, metricsCategory);
Bundle arguments = new Bundle();
arguments.putParcelable(Intent.EXTRA_USER, profileData.userInfo.getUserHandle());
new SubSettingLauncher(mContext).setSourceMetricsCategory(metricsCategory).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 android_packages_apps_Settings by omnirom.
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;
}
use of com.android.settings.core.SubSettingLauncher in project android_packages_apps_Settings by omnirom.
the class AppInfoDashboardFragment method startAppInfoFragment.
public static void startAppInfoFragment(Class<?> fragment, int title, Bundle args, SettingsPreferenceFragment caller, AppEntry appEntry) {
// start new fragment to display extended information
if (args == null) {
args = new Bundle();
}
args.putString(ARG_PACKAGE_NAME, appEntry.info.packageName);
args.putInt(ARG_PACKAGE_UID, appEntry.info.uid);
new SubSettingLauncher(caller.getContext()).setDestination(fragment.getName()).setArguments(args).setTitleRes(title).setResultListener(caller, SUB_INFO_FRAGMENT).setSourceMetricsCategory(caller.getMetricsCategory()).launch();
}
use of com.android.settings.core.SubSettingLauncher in project android_packages_apps_Settings by omnirom.
the class RunningProcessesView method startServiceDetailsActivity.
// utility method used to start sub activity
private void startServiceDetailsActivity(RunningState.MergedItem mi) {
if (mOwner != null && mi != null) {
// start new fragment to display extended information
Bundle args = new Bundle();
if (mi.mProcess != null) {
args.putInt(RunningServiceDetails.KEY_UID, mi.mProcess.mUid);
args.putString(RunningServiceDetails.KEY_PROCESS, mi.mProcess.mProcessName);
}
args.putInt(RunningServiceDetails.KEY_USER_ID, mi.mUserId);
args.putBoolean(RunningServiceDetails.KEY_BACKGROUND, mAdapter.mShowBackground);
new SubSettingLauncher(getContext()).setDestination(RunningServiceDetails.class.getName()).setArguments(args).setTitleRes(R.string.runningservicedetails_settings_title).setSourceMetricsCategory(mOwner.getMetricsCategory()).launch();
}
}
use of com.android.settings.core.SubSettingLauncher in project android_packages_apps_Settings by omnirom.
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();
}
Aggregations