summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--services/java/com/android/server/wm/StrictModeFlash.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/services/java/com/android/server/wm/StrictModeFlash.java b/services/java/com/android/server/wm/StrictModeFlash.java
index 90bbd08..543ef7b 100644
--- a/services/java/com/android/server/wm/StrictModeFlash.java
+++ b/services/java/com/android/server/wm/StrictModeFlash.java
@@ -29,6 +29,8 @@ import android.view.SurfaceSession;
class StrictModeFlash {
private static final String TAG = "StrictModeFlash";
+ boolean mDisabled = true;
+
Surface mSurface;
int mLastDW;
int mLastDH;
@@ -36,6 +38,10 @@ class StrictModeFlash {
final int mThickness = 20;
public StrictModeFlash(Display display, SurfaceSession session) {
+ if (mDisabled) {
+ return;
+ }
+
try {
mSurface = new Surface(session, "StrictModeFlash",
1, 1, PixelFormat.TRANSLUCENT, Surface.HIDDEN);
@@ -51,7 +57,7 @@ class StrictModeFlash {
}
private void drawIfNeeded() {
- if (!mDrawNeeded) {
+ if (mDisabled || !mDrawNeeded) {
return;
}
mDrawNeeded = false;
@@ -88,7 +94,7 @@ class StrictModeFlash {
// Note: caller responsible for being inside
// Surface.openTransaction() / closeTransaction()
public void setVisibility(boolean on) {
- if (mSurface == null) {
+ if (mDisabled || mSurface == null) {
return;
}
drawIfNeeded();
@@ -100,7 +106,7 @@ class StrictModeFlash {
}
void positionSurface(int dw, int dh) {
- if (mLastDW == dw && mLastDH == dh) {
+ if (mDisabled || (mLastDW == dw && mLastDH == dh)) {
return;
}
mLastDW = dw;