Merge "Guard mRearDisplayPendingOverrideRequest with mLock" into udc-dev

This commit is contained in:
Jiaming Liu
2023-06-28 19:57:19 +00:00
committed by Android (Google) Code Review

View File

@@ -172,6 +172,7 @@ public final class DeviceStateManagerService extends SystemService {
private DeviceState mRearDisplayState; private DeviceState mRearDisplayState;
// TODO(259328837) Generalize for all pending feature requests in the future // TODO(259328837) Generalize for all pending feature requests in the future
@GuardedBy("mLock")
@Nullable @Nullable
private OverrideRequest mRearDisplayPendingOverrideRequest; private OverrideRequest mRearDisplayPendingOverrideRequest;
@@ -779,7 +780,7 @@ public final class DeviceStateManagerService extends SystemService {
* {@link StatusBarManagerInternal} to notify SystemUI to display the educational dialog. * {@link StatusBarManagerInternal} to notify SystemUI to display the educational dialog.
*/ */
@GuardedBy("mLock") @GuardedBy("mLock")
private void showRearDisplayEducationalOverlayLocked(OverrideRequest request) { private void showRearDisplayEducationalOverlayLocked(@NonNull OverrideRequest request) {
mRearDisplayPendingOverrideRequest = request; mRearDisplayPendingOverrideRequest = request;
StatusBarManagerInternal statusBar = StatusBarManagerInternal statusBar =
@@ -844,8 +845,8 @@ public final class DeviceStateManagerService extends SystemService {
* request if it was dismissed in a way that should cancel the feature. * request if it was dismissed in a way that should cancel the feature.
*/ */
private void onStateRequestOverlayDismissedInternal(boolean shouldCancelRequest) { private void onStateRequestOverlayDismissedInternal(boolean shouldCancelRequest) {
if (mRearDisplayPendingOverrideRequest != null) {
synchronized (mLock) { synchronized (mLock) {
if (mRearDisplayPendingOverrideRequest != null) {
if (shouldCancelRequest) { if (shouldCancelRequest) {
ProcessRecord processRecord = mProcessRecords.get( ProcessRecord processRecord = mProcessRecords.get(
mRearDisplayPendingOverrideRequest.getPid()); mRearDisplayPendingOverrideRequest.getPid());