Adjusting call to AMN#requestBugReport()
Bug: 26152603 Change-Id: I5cf66889732aaca2479f09ebacb7beb36f84ea58
This commit is contained in:
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
package com.android.settings;
|
package com.android.settings;
|
||||||
|
|
||||||
|
import android.app.ActivityManager;
|
||||||
import android.app.ActivityManagerNative;
|
import android.app.ActivityManagerNative;
|
||||||
import android.app.AlertDialog.Builder;
|
import android.app.AlertDialog.Builder;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@@ -83,7 +84,7 @@ public class BugreportPreference extends CustomDialogPreference {
|
|||||||
|
|
||||||
if (mFullTitle.isChecked()) {
|
if (mFullTitle.isChecked()) {
|
||||||
Log.v(TAG, "Taking full bugreport right away");
|
Log.v(TAG, "Taking full bugreport right away");
|
||||||
takeBugreport(false);
|
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");
|
||||||
// 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
|
||||||
@@ -97,18 +98,18 @@ public class BugreportPreference extends CustomDialogPreference {
|
|||||||
new Handler().postDelayed(new Runnable() {
|
new Handler().postDelayed(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
takeBugreport(true);
|
takeBugreport(ActivityManager.BUGREPORT_OPTION_INTERACTIVE);
|
||||||
}
|
}
|
||||||
}, BUGREPORT_DELAY_SECONDS * DateUtils.SECOND_IN_MILLIS);
|
}, BUGREPORT_DELAY_SECONDS * DateUtils.SECOND_IN_MILLIS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void takeBugreport(boolean progress) {
|
private void takeBugreport(int bugreportType) {
|
||||||
try {
|
try {
|
||||||
ActivityManagerNative.getDefault().requestBugReport(progress);
|
ActivityManagerNative.getDefault().requestBugReport(bugreportType);
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
Log.e(TAG, "error taking bugreport (progress=" + progress + ")", e);
|
Log.e(TAG, "error taking bugreport (bugreportType=" + bugreportType + ")", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user