SurfaceView: Only show background when behind ViewRoot.

The old implementation of the SurfaceView background didn't show
when the Surface was in front of the  ViewRoot surface, and the new one does.
This is causing problems with apps that float invisible SurfaceViews on top
of themselves and with apps that don't implement draw notification. Here we restore
the old behavior.

Bug: 123920952
Bug: 115969839
Test: Manual
Change-Id: I12a6f3910551ba0fa2ab71a37475a9b78cf384b6
diff --git a/core/java/android/view/SurfaceView.java b/core/java/android/view/SurfaceView.java
index ee8d663..e931448 100644
--- a/core/java/android/view/SurfaceView.java
+++ b/core/java/android/view/SurfaceView.java
@@ -491,7 +491,7 @@
         if (mBackgroundControl == null) {
             return;
         }
-        if ((mSurfaceFlags & SurfaceControl.OPAQUE) != 0) {
+        if ((mSubLayer > 0) && ((mSurfaceFlags & SurfaceControl.OPAQUE) != 0)) {
             mBackgroundControl.show();
             mBackgroundControl.setLayer(Integer.MIN_VALUE);
         } else {