summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Haeberling <haeberling@google.com>2015-05-29 23:57:51 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-05-29 23:57:51 +0000
commitb434a10033a8a2386693b589ecff094adfdddeb7 (patch)
tree05d79a922cc06f42da7ecd019bd0f3d807a5a859
parent42efb31207e583f1232e7a66e6bf5f6185064f27 (diff)
parent862447f384ca4e210bafff498503b94ad72c0980 (diff)
downloadandroid_packages_apps_Camera2-b434a10033a8a2386693b589ecff094adfdddeb7.tar.gz
android_packages_apps_Camera2-b434a10033a8a2386693b589ecff094adfdddeb7.tar.bz2
android_packages_apps_Camera2-b434a10033a8a2386693b589ecff094adfdddeb7.zip
am 862447f3: am 2eb8298b: Use Google Feedback CrashBuilder API to make reports easier to consume.
* commit '862447f384ca4e210bafff498503b94ad72c0980': Use Google Feedback CrashBuilder API to make reports easier to consume.
-rw-r--r--src/com/android/camera/FatalErrorHandlerImpl.java30
-rw-r--r--src/com/android/camera/util/CameraUtil.java4
-rw-r--r--src_pd/com/android/camera/util/GoogleHelpHelper.java2
3 files changed, 21 insertions, 15 deletions
diff --git a/src/com/android/camera/FatalErrorHandlerImpl.java b/src/com/android/camera/FatalErrorHandlerImpl.java
index a8bf69d62..802abc6af 100644
--- a/src/com/android/camera/FatalErrorHandlerImpl.java
+++ b/src/com/android/camera/FatalErrorHandlerImpl.java
@@ -34,8 +34,9 @@ public final class FatalErrorHandlerImpl implements FatalErrorHandler {
@Override
public void onMediaStorageFailure() {
+ Exception ex = new Exception();
// Log a stack trace to be sure we can track the source.
- Log.e(TAG, "Handling Media Storage Failure:", new Exception());
+ Log.e(TAG, "Handling Media Storage Failure:", ex);
// Log the error
UsageStatistics.instance().storageWarning(Storage.ACCESS_FAILURE);
@@ -43,13 +44,14 @@ public final class FatalErrorHandlerImpl implements FatalErrorHandler {
Reason reason = Reason.MEDIA_STORAGE_FAILURE;
boolean finishActivity = reason.doesFinishActivity();
CameraUtil.showError(mActivity, reason.getDialogMsgId(), reason.getFeedbackMsgId(),
- finishActivity);
+ finishActivity, ex);
}
@Override
public void onCameraOpenFailure() {
+ Exception ex = new Exception();
// Log a stack trace to be sure we can track the source.
- Log.e(TAG, "Handling Camera Open Failure:", new Exception());
+ Log.e(TAG, "Handling Camera Open Failure:", ex);
UsageStatistics.instance().cameraFailure(
eventprotos.CameraFailure.FailureReason.OPEN_FAILURE, null,
@@ -58,13 +60,14 @@ public final class FatalErrorHandlerImpl implements FatalErrorHandler {
Reason reason = Reason.CANNOT_CONNECT_TO_CAMERA;
boolean finishActivity = reason.doesFinishActivity();
CameraUtil.showError(mActivity, reason.getDialogMsgId(), reason.getFeedbackMsgId(),
- finishActivity);
+ finishActivity, ex);
}
@Override
public void onCameraReconnectFailure() {
+ Exception ex = new Exception();
// Log a stack trace to be sure we can track the source.
- Log.e(TAG, "Handling Camera Reconnect Failure:", new Exception());
+ Log.e(TAG, "Handling Camera Reconnect Failure:", ex);
UsageStatistics.instance().cameraFailure(
eventprotos.CameraFailure.FailureReason.RECONNECT_FAILURE, null,
@@ -73,13 +76,14 @@ public final class FatalErrorHandlerImpl implements FatalErrorHandler {
Reason reason = Reason.CANNOT_CONNECT_TO_CAMERA;
boolean finishActivity = reason.doesFinishActivity();
CameraUtil.showError(mActivity, reason.getDialogMsgId(), reason.getFeedbackMsgId(),
- finishActivity);
+ finishActivity, ex);
}
@Override
public void onGenericCameraAccessFailure() {
+ Exception ex = new Exception();
// Log a stack trace to be sure we can track the source.
- Log.e(TAG, "Handling Camera Access Failure:", new Exception());
+ Log.e(TAG, "Handling Camera Access Failure:", ex);
UsageStatistics.instance().cameraFailure(
eventprotos.CameraFailure.FailureReason.UNKNOWN_REASON, null,
@@ -88,13 +92,14 @@ public final class FatalErrorHandlerImpl implements FatalErrorHandler {
Reason reason = Reason.CANNOT_CONNECT_TO_CAMERA;
boolean finishActivity = reason.doesFinishActivity();
CameraUtil.showError(mActivity, reason.getDialogMsgId(), reason.getFeedbackMsgId(),
- finishActivity);
+ finishActivity, ex);
}
@Override
public void onCameraDisabledFailure() {
+ Exception ex = new Exception();
// Log a stack trace to be sure we can track the source.
- Log.e(TAG, "Handling Camera Disabled Failure:", new Exception());
+ Log.e(TAG, "Handling Camera Disabled Failure:", ex);
// Log the error
UsageStatistics.instance().cameraFailure(
@@ -104,16 +109,17 @@ public final class FatalErrorHandlerImpl implements FatalErrorHandler {
Reason reason = Reason.CAMERA_DISABLED_BY_SECURITY_POLICY;
boolean finishActivity = reason.doesFinishActivity();
CameraUtil.showError(mActivity, reason.getDialogMsgId(), reason.getFeedbackMsgId(),
- finishActivity);
+ finishActivity, ex);
}
@Override
public void handleFatalError(Reason reason) {
+ Exception ex = new Exception();
// Log a stack trace to be sure we can track the source.
- Log.e(TAG, "Handling Fatal Error:", new Exception());
+ Log.e(TAG, "Handling Fatal Error:", ex);
boolean finishActivity = reason.doesFinishActivity();
CameraUtil.showError(mActivity, reason.getDialogMsgId(), reason.getFeedbackMsgId(),
- finishActivity);
+ finishActivity, ex);
}
}
diff --git a/src/com/android/camera/util/CameraUtil.java b/src/com/android/camera/util/CameraUtil.java
index a2a5a7d29..639e63593 100644
--- a/src/com/android/camera/util/CameraUtil.java
+++ b/src/com/android/camera/util/CameraUtil.java
@@ -289,7 +289,7 @@ public class CameraUtil {
*/
@Deprecated
public static void showError(final Activity activity, final int dialogMsgId, final int feedbackMsgId,
- final boolean finishActivity) {
+ final boolean finishActivity, final Exception ex) {
final DialogInterface.OnClickListener buttonListener =
new DialogInterface.OnClickListener() {
@Override
@@ -304,7 +304,7 @@ public class CameraUtil {
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
- new GoogleHelpHelper(activity).sendGoogleFeedback(feedbackMsgId);
+ new GoogleHelpHelper(activity).sendGoogleFeedback(feedbackMsgId, ex);
if (finishActivity) {
activity.finish();
}
diff --git a/src_pd/com/android/camera/util/GoogleHelpHelper.java b/src_pd/com/android/camera/util/GoogleHelpHelper.java
index c59b50a02..ac876ad5f 100644
--- a/src_pd/com/android/camera/util/GoogleHelpHelper.java
+++ b/src_pd/com/android/camera/util/GoogleHelpHelper.java
@@ -32,5 +32,5 @@ public class GoogleHelpHelper {
public void launchGoogleHelp() {
}
- public void sendGoogleFeedback(int category) {}
+ public void sendGoogleFeedback(int category, Exception ex) {}
}