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

Commit 8e1366ce authored by Omprakash Dhyade c_odhyad@quicinc.com's avatar Omprakash Dhyade c_odhyad@quicinc.com Committed by Steve Kondik
Browse files

frameworks/base: Fix wallpaper preview surface destroy call

When we start wallpaper preview and before wallpaper preview
is shown, it gets hidden due to another app and then preview
surface gets destroyed. Renderscript is not aware of this
and it gets out-of-sync and we see egl error messages.

Change-Id: I75faff4dfbe16256ed688088cf0639ecf8cb158e
CRs-Fixed: 231711,231091,230739
parent 4e9a0ab7
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ import static android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION;
import static android.view.WindowManager.LayoutParams.TYPE_INPUT_METHOD;
import static android.view.WindowManager.LayoutParams.TYPE_INPUT_METHOD_DIALOG;
import static android.view.WindowManager.LayoutParams.TYPE_WALLPAPER;
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_MEDIA_OVERLAY;

import com.android.internal.app.IBatteryStats;
import com.android.internal.policy.PolicyManager;
@@ -2438,6 +2439,10 @@ public class WindowManagerService extends IWindowManager.Stub
                            if (mInputMethodWindow == win) {
                                mInputMethodWindow = null;
                            }

			    /* If its Wallpaper preview, do not destroy surface */
			    if (win.getAttrs().type != TYPE_APPLICATION_MEDIA_OVERLAY &&
			            win.mAttrs.windowAnimations != com.android.internal.R.style.Animation_Wallpaper)
                                win.destroySurfaceLocked();
                        }
                    }
@@ -10374,6 +10379,9 @@ public class WindowManagerService extends IWindowManager.Stub
                if (win == mWallpaperTarget) {
                    wallpaperDestroyed = true;
                }
                /* If its Wallpaper preview, do not destroy surface */
                if (win.getAttrs().type != TYPE_APPLICATION_MEDIA_OVERLAY &&
                        win.mAttrs.windowAnimations != com.android.internal.R.style.Animation_Wallpaper)
                    win.destroySurfaceLocked();
            } while (i > 0);
            mDestroySurface.clear();