Fixed context reference.
BUG: 27608886 Change-Id: I2d2e2393ce52f4461dce276231cbc90563897ffd
This commit is contained in:
@@ -85,18 +85,17 @@ public class BugreportPreference extends CustomDialogPreference {
|
|||||||
protected void onClick(DialogInterface dialog, int which) {
|
protected void onClick(DialogInterface dialog, int which) {
|
||||||
if (which == DialogInterface.BUTTON_POSITIVE) {
|
if (which == DialogInterface.BUTTON_POSITIVE) {
|
||||||
|
|
||||||
|
final Context context = getContext();
|
||||||
if (mFullTitle.isChecked()) {
|
if (mFullTitle.isChecked()) {
|
||||||
Log.v(TAG, "Taking full bugreport right away");
|
Log.v(TAG, "Taking full bugreport right away");
|
||||||
MetricsLogger.action(getDialog().getContext(),
|
MetricsLogger.action(context, MetricsEvent.ACTION_BUGREPORT_FROM_SETTINGS_FULL);
|
||||||
MetricsEvent.ACTION_BUGREPORT_FROM_SETTINGS_FULL);
|
|
||||||
takeBugreport(ActivityManager.BUGREPORT_OPTION_FULL);
|
takeBugreport(ActivityManager.BUGREPORT_OPTION_FULL);
|
||||||
} else {
|
} else {
|
||||||
Log.v(TAG, "Taking interactive bugreport in " + BUGREPORT_DELAY_SECONDS + "s");
|
Log.v(TAG, "Taking interactive bugreport in " + BUGREPORT_DELAY_SECONDS + "s");
|
||||||
MetricsLogger.action(getDialog().getContext(),
|
MetricsLogger.action(context,
|
||||||
MetricsEvent.ACTION_BUGREPORT_FROM_SETTINGS_INTERACTIVE);
|
MetricsEvent.ACTION_BUGREPORT_FROM_SETTINGS_INTERACTIVE);
|
||||||
// Add a little delay before executing, to give the user a chance to close
|
// Add a little delay before executing, to give the user a chance to close
|
||||||
// the Settings activity before it takes a screenshot.
|
// the Settings activity before it takes a screenshot.
|
||||||
final Context context = getContext();
|
|
||||||
final String msg = context.getResources()
|
final String msg = context.getResources()
|
||||||
.getQuantityString(com.android.internal.R.plurals.bugreport_countdown,
|
.getQuantityString(com.android.internal.R.plurals.bugreport_countdown,
|
||||||
BUGREPORT_DELAY_SECONDS, BUGREPORT_DELAY_SECONDS);
|
BUGREPORT_DELAY_SECONDS, BUGREPORT_DELAY_SECONDS);
|
||||||
|
Reference in New Issue
Block a user