From b4db66635a7aae10927171fe2d8ab6ab0e41bb05 Mon Sep 17 00:00:00 2001 From: Yasin Kilicdere Date: Mon, 31 Oct 2022 14:38:02 +0000 Subject: [PATCH] Binder.restoreCallingIdentity moved from 'catch' to 'finally' block. Clearing the calling identity should be restored in the finally block. In WallpaperManagerService.WallpaperConnection.engineShown method it was restored in catch block. This CL corrects that issue. Bug: 256605760 Test: n/a Change-Id: Ibe1e252c6ef8728b0706fe1f58d1c56955ce5733 --- .../com/android/server/wallpaper/WallpaperManagerService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java b/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java index 6a3553315e5a4..7dc4f9782e705 100644 --- a/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java +++ b/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java @@ -1549,8 +1549,9 @@ public class WallpaperManagerService extends IWallpaperManager.Stub try { mReply.sendResult(null); } catch (RemoteException e) { - Binder.restoreCallingIdentity(ident); Slog.d(TAG, "failed to send callback!", e); + } finally { + Binder.restoreCallingIdentity(ident); } mReply = null; }