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

Commit 53ce10f2 authored by Erik Wolsheimer's avatar Erik Wolsheimer
Browse files

RESTRICT AUTOMERGE Allow Wear Home app to send wallpaper commands at any time

Bug: 72527589
Exempt-From-Owner-Approval: Will not be merged to mainline
Change-Id: I6f030b6288433b9cefce0f2fb1a69de61bfa7617
(cherry picked from commit 5297b37c)
(cherry picked from commit 7edd51105dcaf3bfc730db72ee5641f8788025c3)
parent e7a65599
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -386,7 +386,14 @@ class WallpaperController {

    Bundle sendWindowWallpaperCommand(
            WindowState window, String action, int x, int y, int z, Bundle extras, boolean sync) {
        if (window == mWallpaperTarget || window == mPrevWallpaperTarget) {

        // HACK(ewol): Custom whitelist for Wear Home app, to allow it to update the wallpaper
        // regardless of what window is targeted.
        // http://b/32172459
        final boolean hackWearWhitelisted = (window != null) && (window.mAttrs != null)
                && "com.google.android.wearable.app".equals(window.mAttrs.packageName);

        if (hackWearWhitelisted || window == mWallpaperTarget || window == mPrevWallpaperTarget) {
            boolean doWait = sync;
            for (int curTokenNdx = mWallpaperTokens.size() - 1; curTokenNdx >= 0; curTokenNdx--) {
                final WallpaperWindowToken token = mWallpaperTokens.get(curTokenNdx);