Merge "Adds debugging logs in Rotation Resolver." into sc-dev
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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,8 +119,10 @@ final class RotationResolverManagerPerUserService extends
|
||||
|
||||
cancellationSignalInternal.setOnCancelListener(() -> {
|
||||
synchronized (mLock) {
|
||||
Slog.i(TAG, "Trying to cancel current request.");
|
||||
mCurrentRequest.cancelInternal();
|
||||
if (mCurrentRequest != null && !mCurrentRequest.mIsFulfilled) {
|
||||
Slog.d(TAG, "Trying to cancel the remote request. Reason: Client cancelled.");
|
||||
mCurrentRequest.cancelInternal();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user