fix 1803886 android15 Translucent GLSurfaceView demo does not display properly
diff --git a/libs/surfaceflinger/SurfaceFlinger.cpp b/libs/surfaceflinger/SurfaceFlinger.cpp
index de64f55..167a59b 100644
--- a/libs/surfaceflinger/SurfaceFlinger.cpp
+++ b/libs/surfaceflinger/SurfaceFlinger.cpp
@@ -241,6 +241,9 @@
 status_t SurfaceFlinger::requestGPU(const sp<IGPUCallback>& callback,
         gpu_info_t* gpu)
 {
+    if (mGPU == 0)
+        return INVALID_OPERATION;
+
     IPCThreadState* ipc = IPCThreadState::self();
     const int pid = ipc->getCallingPid();
     status_t err = mGPU->request(pid, callback, gpu);
@@ -249,6 +252,9 @@
 
 status_t SurfaceFlinger::revokeGPU()
 {
+    if (mGPU == 0)
+        return INVALID_OPERATION;
+
     return mGPU->friendlyRevoke();
 }
 
@@ -1600,10 +1606,14 @@
             }
             return NO_ERROR;
             case 1005: // ask GPU revoke
-                mGPU->friendlyRevoke();
+                if (mGPU != 0) {
+                    mGPU->friendlyRevoke();
+                }
                 return NO_ERROR;
             case 1006: // revoke GPU
-                mGPU->unconditionalRevoke();
+                if (mGPU != 0) {
+                    mGPU->unconditionalRevoke();
+                }
                 return NO_ERROR;
             case 1007: // set mFreezeCount
                 mFreezeCount = data.readInt32();