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

Commit 48a6e2f5 authored by Wenhui Yang's avatar Wenhui Yang Committed by Android (Google) Code Review
Browse files

Merge "Capture transaction traces before system reboot" into main

parents 67ea1030 eafc18ad
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -3118,6 +3118,10 @@ status_t SurfaceComposerClient::removeWindowInfosListener(
            ->removeWindowInfosListener(windowInfosListener,
            ->removeWindowInfosListener(windowInfosListener,
                                        ComposerServiceAIDL::getComposerService());
                                        ComposerServiceAIDL::getComposerService());
}
}

void SurfaceComposerClient::notifyShutdown() {
    ComposerServiceAIDL::getComposerService()->notifyShutdown();
}
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------


status_t ScreenshotClient::captureDisplay(const DisplayCaptureArgs& captureArgs,
status_t ScreenshotClient::captureDisplay(const DisplayCaptureArgs& captureArgs,
+7 −0
Original line number Original line Diff line number Diff line
@@ -573,4 +573,11 @@ interface ISurfaceComposer {
    @nullable StalledTransactionInfo getStalledTransactionInfo(int pid);
    @nullable StalledTransactionInfo getStalledTransactionInfo(int pid);


    SchedulingPolicy getSchedulingPolicy();
    SchedulingPolicy getSchedulingPolicy();

    /**
     * Notifies the SurfaceFlinger that the ShutdownThread is running. When it is called,
     * transaction traces will be captured and writted into a file.
     * This method should not block the ShutdownThread therefore it's handled asynchronously.
     */
    oneway void notifyShutdown();
}
}
+2 −0
Original line number Original line Diff line number Diff line
@@ -824,6 +824,8 @@ public:
                    nullptr);
                    nullptr);
    status_t removeWindowInfosListener(const sp<gui::WindowInfosListener>& windowInfosListener);
    status_t removeWindowInfosListener(const sp<gui::WindowInfosListener>& windowInfosListener);


    static void notifyShutdown();

protected:
protected:
    ReleaseCallbackThread mReleaseCallbackThread;
    ReleaseCallbackThread mReleaseCallbackThread;


+2 −0
Original line number Original line Diff line number Diff line
@@ -985,6 +985,8 @@ public:
        return binder::Status::ok();
        return binder::Status::ok();
    }
    }


    binder::Status notifyShutdown() override { return binder::Status::ok(); }

protected:
protected:
    IBinder* onAsBinder() override { return nullptr; }
    IBinder* onAsBinder() override { return nullptr; }


+7 −1
Original line number Original line Diff line number Diff line
@@ -1013,8 +1013,9 @@ void SurfaceFlinger::initTransactionTraceWriter() {
                        ALOGD("TransactionTraceWriter: file=%s already exists", filename.c_str());
                        ALOGD("TransactionTraceWriter: file=%s already exists", filename.c_str());
                        return;
                        return;
                    }
                    }
                    mTransactionTracing->flush();
                    ALOGD("TransactionTraceWriter: writing file=%s", filename.c_str());
                    mTransactionTracing->writeToFile(filename);
                    mTransactionTracing->writeToFile(filename);
                    mTransactionTracing->flush();
                };
                };
                if (std::this_thread::get_id() == mMainThreadId) {
                if (std::this_thread::get_id() == mMainThreadId) {
                    writeFn();
                    writeFn();
@@ -10335,6 +10336,11 @@ binder::Status SurfaceComposerAIDL::getSchedulingPolicy(gui::SchedulingPolicy* o
    return gui::getSchedulingPolicy(outPolicy);
    return gui::getSchedulingPolicy(outPolicy);
}
}


binder::Status SurfaceComposerAIDL::notifyShutdown() {
    TransactionTraceWriter::getInstance().invoke("systemShutdown_", /* overwrite= */ false);
    return ::android::binder::Status::ok();
}

status_t SurfaceComposerAIDL::checkAccessPermission(bool usePermissionCache) {
status_t SurfaceComposerAIDL::checkAccessPermission(bool usePermissionCache) {
    if (!mFlinger->callingThreadHasUnscopedSurfaceFlingerAccess(usePermissionCache)) {
    if (!mFlinger->callingThreadHasUnscopedSurfaceFlingerAccess(usePermissionCache)) {
        IPCThreadState* ipc = IPCThreadState::self();
        IPCThreadState* ipc = IPCThreadState::self();
Loading