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

Commit ced9d6cf authored by Chris Poultney's avatar Chris Poultney
Browse files

Fix errant nullable annotation

Makes sure that IWallpaperService#attach() is never called with a null
WallpaperDescription.

Bug: 347235611
Flag: android.app.live_wallpaper_content_handling
Test: manually verified with and without flag
Change-Id: Ie55064551015d495c6f2ae9eead0329efc2c1041
parent 6779b120
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -28,6 +28,6 @@ oneway interface IWallpaperService {
    void attach(IWallpaperConnection connection,
            IBinder windowToken, int windowType, boolean isPreview,
            int reqWidth, int reqHeight, in Rect padding, int displayId, int which,
            in WallpaperInfo info, in @nullable WallpaperDescription description);
            in WallpaperInfo info, in WallpaperDescription description);
    void detach(IBinder windowToken);
}
+2 −1
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package android.service.wallpaper;

import static android.app.Flags.FLAG_LIVE_WALLPAPER_CONTENT_HANDLING;
import static android.app.Flags.liveWallpaperContentHandling;
import static android.app.WallpaperManager.COMMAND_FREEZE;
import static android.app.WallpaperManager.COMMAND_UNFREEZE;
import static android.app.WallpaperManager.SetWallpaperFlags;
@@ -2624,7 +2625,7 @@ public abstract class WallpaperService extends Service {
        private void doAttachEngine() {
            Trace.beginSection("WPMS.onCreateEngine");
            Engine engine;
            if (mDescription != null) {
            if (liveWallpaperContentHandling()) {
                engine = onCreateEngine(mDescription);
            } else {
                engine = onCreateEngine();
+4 −2
Original line number Diff line number Diff line
@@ -858,10 +858,12 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
                            wpdData.mPadding, mDisplayId, wallpaper.mWhich, connection.mInfo,
                            wallpaper.getDescription());
                } else {
                    WallpaperDescription desc = new WallpaperDescription.Builder().setComponent(
                            (connection.mInfo != null) ? connection.mInfo.getComponent()
                                    : null).build();
                    connection.mService.attach(connection, mToken, TYPE_WALLPAPER, false,
                            wpdData.mWidth, wpdData.mHeight,
                            wpdData.mPadding, mDisplayId, wallpaper.mWhich, connection.mInfo,
                            /* description= */ null);
                            wpdData.mPadding, mDisplayId, wallpaper.mWhich, connection.mInfo, desc);
                }
            } catch (RemoteException e) {
                Slog.w(TAG, "Failed attaching wallpaper on display", e);