From a97f416015d73fa2bed22bf738135b8eee204650 Mon Sep 17 00:00:00 2001 From: Julia Reynolds Date: Fri, 27 May 2022 09:06:45 -0400 Subject: [PATCH] Don't post notification with lock held Fixes: 233034364 Test: CtsDevicePolicyTestCases Change-Id: I3b7a6b0306f45eb57729bb483333dd34785acca4 --- .../server/devicepolicy/DevicePolicyManagerService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java index 8702578026082..48ad62231c11a 100644 --- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java @@ -12517,8 +12517,8 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { .setContentIntent(locationSettingsIntent) .setAutoCancel(true) .build(); - mInjector.getNotificationManager().notify(SystemMessage.NOTE_LOCATION_CHANGED, - notification); + mHandler.post(() -> mInjector.getNotificationManager().notify( + SystemMessage.NOTE_LOCATION_CHANGED, notification)); } private String getLocationChangedTitle() {