summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Miranda Kephart <mkephart@google.com> 2020-10-08 15:29:02 -0400
committer Miranda Kephart <mkephart@google.com> 2020-10-09 12:40:16 -0400
commit0369a4ca5725c698d412d0ddc650b03597529699 (patch)
treeb5acf3fa94ead90472e24a9897d03bc10129d4ec
parente2b1b3b94d75eb0b8960dec4dba7f87b44af9db7 (diff)
Fix logs when screenshot fails to save
We currently incorrectly show the failed-to-capture string rather than the failed-to-save string, when a screenshot fails to save. This is confusing and makes it more difficult to track down problems. Bug: 170310033 Test: manual Change-Id: Iea30b670cf083ab2ea061ed5e4ae1ee928d06e15
-rw-r--r--packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java5
-rw-r--r--packages/SystemUI/src/com/android/systemui/screenshot/SaveImageInBackgroundTask.java2
2 files changed, 2 insertions, 5 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java b/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java
index 2b4fa2a23a07..31c23942a8b8 100644
--- a/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java
+++ b/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java
@@ -104,7 +104,6 @@ public class GlobalScreenshot implements ViewTreeObserver.OnComputeInternalInset
public Bitmap image;
public Consumer<Uri> finisher;
public GlobalScreenshot.ActionsReadyListener mActionsReadyListener;
- public int errorMsgResId;
void clearImage() {
image = null;
@@ -632,7 +631,7 @@ public class GlobalScreenshot implements ViewTreeObserver.OnComputeInternalInset
if (imageData.uri == null) {
mUiEventLogger.log(ScreenshotEvent.SCREENSHOT_NOT_SAVED);
mNotificationsController.notifyScreenshotError(
- R.string.screenshot_failed_to_capture_text);
+ R.string.screenshot_failed_to_save_text);
} else {
mUiEventLogger.log(ScreenshotEvent.SCREENSHOT_SAVED);
@@ -752,7 +751,7 @@ public class GlobalScreenshot implements ViewTreeObserver.OnComputeInternalInset
if (imageData.uri == null) {
mUiEventLogger.log(ScreenshotEvent.SCREENSHOT_NOT_SAVED);
mNotificationsController.notifyScreenshotError(
- R.string.screenshot_failed_to_capture_text);
+ R.string.screenshot_failed_to_save_text);
} else {
mUiEventLogger.log(ScreenshotEvent.SCREENSHOT_SAVED);
}
diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/SaveImageInBackgroundTask.java b/packages/SystemUI/src/com/android/systemui/screenshot/SaveImageInBackgroundTask.java
index df1d78953f46..f0ea597c458d 100644
--- a/packages/SystemUI/src/com/android/systemui/screenshot/SaveImageInBackgroundTask.java
+++ b/packages/SystemUI/src/com/android/systemui/screenshot/SaveImageInBackgroundTask.java
@@ -217,13 +217,11 @@ class SaveImageInBackgroundTask extends AsyncTask<Void, Void, Void> {
mParams.mActionsReadyListener.onActionsReady(mImageData);
mParams.finisher.accept(mImageData.uri);
mParams.image = null;
- mParams.errorMsgResId = 0;
} catch (Exception e) {
// IOException/UnsupportedOperationException may be thrown if external storage is
// not mounted
Slog.e(TAG, "unable to save screenshot", e);
mParams.clearImage();
- mParams.errorMsgResId = R.string.screenshot_failed_to_save_text;
mImageData.reset();
mParams.mActionsReadyListener.onActionsReady(mImageData);
mParams.finisher.accept(null);