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

Commit ecd827ac authored by Christopher Tate's avatar Christopher Tate
Browse files

Fix binder identity use when clearing wallpapers

Don't restore it too soon, because the rarely-needed fallback path
will need to be executed as system, too.

Bug 17394246

Change-Id: Ic5e662d4eae331b016fc91ffd08647bd8d4d6ff3
parent ce78347c
Loading
Loading
Loading
Loading
+24 −22
Original line number Diff line number Diff line
@@ -602,6 +602,7 @@ public class WallpaperManagerService extends IWallpaperManager.Stub {
            f.delete();
        }
        final long ident = Binder.clearCallingIdentity();
        try {
            RuntimeException e = null;
            try {
                wallpaper.imageWallpaperPending = false;
@@ -613,8 +614,6 @@ public class WallpaperManagerService extends IWallpaperManager.Stub {
                }
            } catch (IllegalArgumentException e1) {
                e = e1;
        } finally {
            Binder.restoreCallingIdentity(ident);
            }

            // This can happen if the default wallpaper component doesn't
@@ -629,6 +628,9 @@ public class WallpaperManagerService extends IWallpaperManager.Stub {
                } catch (RemoteException e1) {
                }
            }
        } finally {
            Binder.restoreCallingIdentity(ident);
        }
    }

    public boolean hasNamedWallpaper(String name) {