Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f90ee959 authored by Craig Mautner's avatar Craig Mautner Committed by The Android Automerger
Browse files

Fix looping to turn off dimming.

Dimming was constantly being turned off if it wasn't time to turn it
on. This caused endless reentry into the Window Manager and consumed
lots of CPU.

Fixes bug 6293953.

Change-Id: Id87e60c7c70e96e66ce0b6297442f5ac0d2ff477
parent 4f3f31bb
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -440,9 +440,12 @@ public class WindowAnimator {
                w.mWinAnimator.prepareSurfaceLocked(true);
            }

            if (mDimParams != null) {
                mDimAnimator.updateParameters(mContext.getResources(), mDimParams, mCurrentTime);
            }
            if (mDimAnimator != null && mDimAnimator.mDimShown) {
                mAnimating |= mDimAnimator.updateSurface(mService.mInnerFields.mDimming,
                            mCurrentTime, !mService.okToDisplay());
                mAnimating |= mDimAnimator.updateSurface(mDimParams != null, mCurrentTime,
                        !mService.okToDisplay());
            }

            if (mService.mBlackFrame != null) {
@@ -453,10 +456,6 @@ public class WindowAnimator {
                    mService.mBlackFrame.clearMatrix();
                }
            }

            if (mDimParams != null) {
                mDimAnimator.updateParameters(mContext.getResources(), mDimParams, mCurrentTime);
            }
        } catch (RuntimeException e) {
            Log.wtf(TAG, "Unhandled exception in Window Manager", e);
        } finally {
+1 −1
Original line number Diff line number Diff line
@@ -8419,7 +8419,7 @@ public class WindowManagerService extends IWindowManager.Stub
                    updateWallpaperVisibilityLocked();
                }
            }
            if (!mInnerFields.mDimming) {
            if (!mInnerFields.mDimming && mAnimator.mDimParams != null) {
                mAnimator.stopDimming();
            }
        } catch (RuntimeException e) {