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

Commit 25a39913 authored by Aurélien Pomini's avatar Aurélien Pomini
Browse files

Add trace for mirrorSurfaceControl

While this is done on a binder thread, let's add a trace in case
something goes wrong and the function times out after 5s.

Flag: EXEMPT no logical change
Bug: 428203450
Test: presubmit
Change-Id: Id57ace4237ea976d29a31737fc77c512eeea7e97
parent f16f6b24
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -2659,10 +2659,11 @@ public abstract class WallpaperService extends Service {
            if (mEngine == null || mEngine.mSurfaceControl == null) {
                return null;
            }
            Trace.beginSection("WPMS.mirrorSurfaceControl");
            try {
                CompletableFuture<SurfaceControl> futureResult = new CompletableFuture<>();
                Message msg = mCaller.obtainMessageO(MSG_MIRROR_SURFACE_CONTROL, futureResult);
                mCaller.sendMessage(msg);
            try {
                return futureResult.get(5, TimeUnit.SECONDS);
            } catch (InterruptedException | ExecutionException e) {
                Log.e(TAG, "mirrorSurfaceControl failed with an exception: ", e);
@@ -2670,6 +2671,8 @@ public abstract class WallpaperService extends Service {
            } catch (TimeoutException e) {
                Log.e(TAG, "mirrorSurfaceControl timed out", e);
                return null;
            } finally {
                Trace.endSection();
            }
        }