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

Commit 6af9b92b authored by Craig Mautner's avatar Craig Mautner
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 2119ade6
Loading
Loading
Loading
Loading
+5 −6
Original line number Original line Diff line number Diff line
@@ -440,9 +440,12 @@ public class WindowAnimator {
                w.mWinAnimator.prepareSurfaceLocked(true);
                w.mWinAnimator.prepareSurfaceLocked(true);
            }
            }


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


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

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