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

Commit c739060d authored by Yi Jiang's avatar Yi Jiang Committed by Android (Google) Code Review
Browse files

Merge "Adds debugging logs in Rotation Resolver." into sc-dev

parents c43f1a2c 337cf182
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();
                }
            }
        });