Merge \"Restore \"reset ShortcutManager rate limiting\" dev option\" into nyc-mr1-dev

am: ed9aed1878

Change-Id: If095c72ed03bbae493259479c6b23a862e71db4c
This commit is contained in:
Makoto Onuki
2016-07-11 18:09:18 +00:00
committed by android-build-merger
3 changed files with 17 additions and 28 deletions

View File

@@ -2040,7 +2040,7 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
} else if (preference == mWebViewMultiprocess) {
writeWebViewMultiprocessOptions();
} else if (SHORTCUT_MANAGER_RESET_KEY.equals(preference.getKey())) {
confirmResetShortcutManagerThrottling();
resetShortcutManagerThrottling();
} else {
return super.onPreferenceTreeClick(preference);
}
@@ -2297,30 +2297,18 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
}
};
private void confirmResetShortcutManagerThrottling() {
private void resetShortcutManagerThrottling() {
final IShortcutService service = IShortcutService.Stub.asInterface(
ServiceManager.getService(Context.SHORTCUT_SERVICE));
DialogInterface.OnClickListener onClickListener = new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
if (which == DialogInterface.BUTTON_POSITIVE) {
try {
service.resetThrottling();
} catch (RemoteException e) {
}
}
if (service != null) {
try {
service.resetThrottling();
Toast.makeText(getActivity(), R.string.reset_shortcut_manager_throttling_complete,
Toast.LENGTH_SHORT).show();
} catch (RemoteException e) {
Log.e(TAG, "Failed to reset rate limiting", e);
}
};
new AlertDialog.Builder(getActivity())
.setTitle(R.string.confirm_reset_shortcut_manager_throttling_title)
.setMessage(R.string.confirm_reset_shortcut_manager_throttling_message)
.setPositiveButton(R.string.okay, onClickListener)
.setNegativeButton(android.R.string.cancel, null)
.create()
.show();
}
}
private void updateOemUnlockSettingDescription() {