Remove toast in power save mode

Redundant since animations are now shown even in battery saver.

Bug: 161458152
Fix: 161458152
Test: verified that both animations and the toast show up at head;
removed toast code; verified that animation still appears in both
regular and extreme battery saver mode.

Change-Id: I55ba9a72dfe2f3f9741aca9dd719283dce114bce
This commit is contained in:
Miranda Kephart
2020-07-16 13:56:15 -04:00
parent 81d4133de9
commit c109dd0ac7

View File

@@ -57,7 +57,6 @@ import android.net.Uri;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.os.PowerManager;
import android.os.RemoteException;
import android.provider.Settings;
import android.util.DisplayMetrics;
@@ -648,14 +647,6 @@ public class GlobalScreenshot implements ViewTreeObserver.OnComputeInternalInset
*/
private void startAnimation(final Consumer<Uri> finisher, Rect screenRect, Insets screenInsets,
boolean showFlash) {
// If power save is on, show a toast so there is some visual indication that a
// screenshot has been taken.
PowerManager powerManager = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE);
if (powerManager.isPowerSaveMode()) {
Toast.makeText(mContext, R.string.screenshot_saved_title, Toast.LENGTH_SHORT).show();
}
mScreenshotHandler.post(() -> {
if (!mScreenshotLayout.isAttachedToWindow()) {
mWindowManager.addView(mScreenshotLayout, mWindowLayoutParams);