Loading core/java/android/view/SurfaceControl.java +8 −0 Original line number Diff line number Diff line Loading @@ -302,6 +302,7 @@ public final class SurfaceControl implements Parcelable { long desiredPresentTimeNanos); private static native void nativeSetFrameTimeline(long transactionObj, long vsyncId); private static native void nativeNotifyShutdown(); /** * Transforms that can be applied to buffers as they are displayed to a window. Loading Loading @@ -4765,4 +4766,11 @@ public final class SurfaceControl implements Parcelable { return nativeGetStalledTransactionInfo(pid); } /** * Notify the SurfaceFlinger to capture transaction traces when shutdown. * @hide */ public static void notifyShutdown() { nativeNotifyShutdown(); } } core/jni/android_view_SurfaceControl.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -2201,6 +2201,10 @@ static jobject nativeGetStalledTransactionInfo(JNIEnv* env, jclass clazz, jint p return jStalledTransactionInfo; } static void nativeNotifyShutdown() { SurfaceComposerClient::notifyShutdown(); } // ---------------------------------------------------------------------------- SurfaceControl* android_view_SurfaceControl_getNativeSurfaceControl(JNIEnv* env, Loading Loading @@ -2476,6 +2480,8 @@ static const JNINativeMethod sSurfaceControlMethods[] = { (void*) nativeGetStalledTransactionInfo }, {"nativeSetDesiredPresentTimeNanos", "(JJ)V", (void*) nativeSetDesiredPresentTimeNanos }, {"nativeNotifyShutdown", "()V", (void*)nativeNotifyShutdown }, // clang-format on }; Loading services/core/java/com/android/server/power/ShutdownThread.java +5 −0 Original line number Diff line number Diff line Loading @@ -54,6 +54,7 @@ import android.util.ArrayMap; import android.util.Log; import android.util.Slog; import android.util.TimingsTraceLog; import android.view.SurfaceControl; import android.view.WindowManager; import com.android.internal.annotations.VisibleForTesting; Loading Loading @@ -459,6 +460,10 @@ public final class ShutdownThread extends Thread { metricShutdownStart(); metricStarted(METRIC_SYSTEM_SERVER); // Notify SurfaceFlinger that the device is shutting down. // Transaction traces should be captured at this stage. SurfaceControl.notifyShutdown(); // Start dumping check points for this shutdown in a separate thread. Thread dumpCheckPointsThread = ShutdownCheckPoints.newDumpThread( new File(CHECK_POINTS_FILE_BASENAME)); Loading Loading
core/java/android/view/SurfaceControl.java +8 −0 Original line number Diff line number Diff line Loading @@ -302,6 +302,7 @@ public final class SurfaceControl implements Parcelable { long desiredPresentTimeNanos); private static native void nativeSetFrameTimeline(long transactionObj, long vsyncId); private static native void nativeNotifyShutdown(); /** * Transforms that can be applied to buffers as they are displayed to a window. Loading Loading @@ -4765,4 +4766,11 @@ public final class SurfaceControl implements Parcelable { return nativeGetStalledTransactionInfo(pid); } /** * Notify the SurfaceFlinger to capture transaction traces when shutdown. * @hide */ public static void notifyShutdown() { nativeNotifyShutdown(); } }
core/jni/android_view_SurfaceControl.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -2201,6 +2201,10 @@ static jobject nativeGetStalledTransactionInfo(JNIEnv* env, jclass clazz, jint p return jStalledTransactionInfo; } static void nativeNotifyShutdown() { SurfaceComposerClient::notifyShutdown(); } // ---------------------------------------------------------------------------- SurfaceControl* android_view_SurfaceControl_getNativeSurfaceControl(JNIEnv* env, Loading Loading @@ -2476,6 +2480,8 @@ static const JNINativeMethod sSurfaceControlMethods[] = { (void*) nativeGetStalledTransactionInfo }, {"nativeSetDesiredPresentTimeNanos", "(JJ)V", (void*) nativeSetDesiredPresentTimeNanos }, {"nativeNotifyShutdown", "()V", (void*)nativeNotifyShutdown }, // clang-format on }; Loading
services/core/java/com/android/server/power/ShutdownThread.java +5 −0 Original line number Diff line number Diff line Loading @@ -54,6 +54,7 @@ import android.util.ArrayMap; import android.util.Log; import android.util.Slog; import android.util.TimingsTraceLog; import android.view.SurfaceControl; import android.view.WindowManager; import com.android.internal.annotations.VisibleForTesting; Loading Loading @@ -459,6 +460,10 @@ public final class ShutdownThread extends Thread { metricShutdownStart(); metricStarted(METRIC_SYSTEM_SERVER); // Notify SurfaceFlinger that the device is shutting down. // Transaction traces should be captured at this stage. SurfaceControl.notifyShutdown(); // Start dumping check points for this shutdown in a separate thread. Thread dumpCheckPointsThread = ShutdownCheckPoints.newDumpThread( new File(CHECK_POINTS_FILE_BASENAME)); Loading