use of com.android.settings.core.SubSettingLauncher in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class AdvancedPowerUsageDetailActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final Intent intent = getIntent();
final Uri data = intent == null ? null : intent.getData();
final String packageName = data == null ? null : data.getSchemeSpecificPart();
if (packageName != null) {
final Bundle args = new Bundle(4);
final PackageManager packageManager = getPackageManager();
args.putString(EXTRA_PACKAGE_NAME, packageName);
args.putString(EXTRA_POWER_USAGE_PERCENT, Utils.formatPercentage(0));
if (intent.getBooleanExtra("request_ignore_background_restriction", false)) {
args.putString(":settings:fragment_args_key", "background_activity");
}
try {
args.putInt(EXTRA_UID, packageManager.getPackageUid(packageName, 0));
} catch (PackageManager.NameNotFoundException e) {
Log.w(TAG, "Cannot find package: " + packageName, e);
}
new SubSettingLauncher(this).setDestination(AdvancedPowerUsageDetail.class.getName()).setTitleRes(R.string.battery_details_title).setArguments(args).setSourceMetricsCategory(SettingsEnums.APPLICATIONS_INSTALLED_APP_DETAILS).launch();
}
finish();
}
use of com.android.settings.core.SubSettingLauncher in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class AdvancedPowerUsageDetail method startBatteryDetailPage.
public static void startBatteryDetailPage(Activity caller, InstrumentedPreferenceFragment fragment, String packageName) {
final Bundle args = new Bundle(3);
final PackageManager packageManager = caller.getPackageManager();
args.putString(EXTRA_PACKAGE_NAME, packageName);
args.putString(EXTRA_POWER_USAGE_PERCENT, Utils.formatPercentage(0));
try {
args.putInt(EXTRA_UID, packageManager.getPackageUid(packageName, 0));
} catch (PackageManager.NameNotFoundException e) {
Log.w(TAG, "Cannot find package: " + packageName, e);
}
new SubSettingLauncher(caller).setDestination(AdvancedPowerUsageDetail.class.getName()).setTitleRes(R.string.battery_details_title).setArguments(args).setSourceMetricsCategory(fragment.getMetricsCategory()).launch();
}
use of com.android.settings.core.SubSettingLauncher in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class BatteryOptimizationPreferenceController method handlePreferenceTreeClick.
@Override
public boolean handlePreferenceTreeClick(Preference preference) {
if (!KEY_BACKGROUND_ACTIVITY.equals(preference.getKey())) {
return false;
}
final Bundle args = new Bundle();
args.putString(ManageApplications.EXTRA_CLASSNAME, Settings.HighPowerApplicationsActivity.class.getName());
new SubSettingLauncher(mSettingsActivity).setDestination(ManageApplications.class.getName()).setArguments(args).setTitleRes(R.string.high_power_apps).setSourceMetricsCategory(mFragment.getMetricsCategory()).launch();
return true;
}
use of com.android.settings.core.SubSettingLauncher in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class LockUnificationPreferenceController method ununifyLocks.
private void ununifyLocks() {
final Bundle extras = new Bundle();
extras.putInt(Intent.EXTRA_USER_ID, mProfileUserId);
new SubSettingLauncher(mContext).setDestination(ChooseLockGeneric.ChooseLockGenericFragment.class.getName()).setTitleRes(R.string.lock_settings_picker_title_profile).setSourceMetricsCategory(mHost.getMetricsCategory()).setArguments(extras).launch();
}
use of com.android.settings.core.SubSettingLauncher in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class UserDictionarySettings method showAddOrEditDialog.
/**
* Add or edit a word. If editingWord is null, it's an add; otherwise, it's an edit.
*
* @param editingWord the word to edit, or null if it's an add.
* @param editingShortcut the shortcut for this entry, or null if none.
*/
private void showAddOrEditDialog(final String editingWord, final String editingShortcut) {
final Bundle args = new Bundle();
args.putInt(UserDictionaryAddWordContents.EXTRA_MODE, null == editingWord ? UserDictionaryAddWordContents.MODE_INSERT : UserDictionaryAddWordContents.MODE_EDIT);
args.putString(UserDictionaryAddWordContents.EXTRA_WORD, editingWord);
args.putString(UserDictionaryAddWordContents.EXTRA_SHORTCUT, editingShortcut);
args.putString(UserDictionaryAddWordContents.EXTRA_LOCALE, mLocale);
new SubSettingLauncher(getContext()).setDestination(UserDictionaryAddWordFragment.class.getName()).setArguments(args).setTitleRes(R.string.user_dict_settings_add_dialog_title).setSourceMetricsCategory(getMetricsCategory()).launch();
}
Aggregations