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

Commit 337cf182 authored by Yi Jiang's avatar Yi Jiang
Browse files

Adds debugging logs in Rotation Resolver.

Test: manual.
Bug: 182004426
Change-Id: Ie567ba5d0de20d23ef70f454a33e77659dd8fc47
parent bff3cb28
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -87,6 +87,7 @@ class RemoteRotationResolverService extends ServiceConnector.Impl<IRotationResol
            synchronized (request.mLock) {
                if (!request.mIsFulfilled) {
                    request.mCallbackInternal.onFailure(ROTATION_RESULT_FAILURE_TIMED_OUT);
                    Slog.d(TAG, "Trying to cancel the remote request. Reason: Timed out.");
                    request.cancelInternal();
                }
            }
@@ -139,7 +140,6 @@ class RemoteRotationResolverService extends ServiceConnector.Impl<IRotationResol
        void cancelInternal() {
            synchronized (mLock) {
                if (mIsFulfilled) {
                    Slog.v(TAG, "Trying to cancel the request that has been already fulfilled.");
                    return;
                }
                mIsFulfilled = true;
@@ -187,6 +187,8 @@ class RemoteRotationResolverService extends ServiceConnector.Impl<IRotationResol
                            SystemClock.elapsedRealtime() - request.mRequestStartTimeMillis;
                    logRotationStats(request.mProposedRotation, request.mCurrentRotation, rotation,
                            timeToCalculate);
                    Slog.d(TAG, "onSuccess:" + rotation);
                    Slog.d(TAG, "timeToCalculate:" + timeToCalculate);
                }
            }

@@ -204,6 +206,8 @@ class RemoteRotationResolverService extends ServiceConnector.Impl<IRotationResol
                            SystemClock.elapsedRealtime() - request.mRequestStartTimeMillis;
                    logRotationStats(request.mProposedRotation, request.mCurrentRotation,
                            RESOLUTION_FAILURE, timeToCalculate);
                    Slog.d(TAG, "onFailure:" + error);
                    Slog.d(TAG, "timeToCalculate:" + timeToCalculate);
                }
            }

+5 −2
Original line number Diff line number Diff line
@@ -82,6 +82,7 @@ final class RotationResolverManagerPerUserService extends
        if (mCurrentRequest == null) {
            return;
        }
        Slog.d(TAG, "Trying to cancel the remote request. Reason: Service destroyed.");
        cancelLocked();

        if (mRemoteService != null) {
@@ -118,9 +119,11 @@ final class RotationResolverManagerPerUserService extends

        cancellationSignalInternal.setOnCancelListener(() -> {
            synchronized (mLock) {
                Slog.i(TAG, "Trying to cancel current request.");
                if (mCurrentRequest != null && !mCurrentRequest.mIsFulfilled) {
                    Slog.d(TAG, "Trying to cancel the remote request. Reason: Client cancelled.");
                    mCurrentRequest.cancelInternal();
                }
            }
        });