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

Commit 24697854 authored by Aurélien Pomini's avatar Aurélien Pomini Committed by Android (Google) Code Review
Browse files

Merge "Add MainThread annotations to WallpaperService callbacks"

parents 4d4bc533 4602a88a
Loading
Loading
Loading
Loading
+15 −15
Original line number Original line Diff line number Diff line
@@ -39931,7 +39931,7 @@ package android.service.wallpaper {
  public abstract class WallpaperService extends android.app.Service {
  public abstract class WallpaperService extends android.app.Service {
    ctor public WallpaperService();
    ctor public WallpaperService();
    method public final android.os.IBinder onBind(android.content.Intent);
    method public final android.os.IBinder onBind(android.content.Intent);
    method public abstract android.service.wallpaper.WallpaperService.Engine onCreateEngine();
    method @MainThread public abstract android.service.wallpaper.WallpaperService.Engine onCreateEngine();
    field public static final String SERVICE_INTERFACE = "android.service.wallpaper.WallpaperService";
    field public static final String SERVICE_INTERFACE = "android.service.wallpaper.WallpaperService";
    field public static final String SERVICE_META_DATA = "android.service.wallpaper";
    field public static final String SERVICE_META_DATA = "android.service.wallpaper";
  }
  }
@@ -39946,20 +39946,20 @@ package android.service.wallpaper {
    method public boolean isPreview();
    method public boolean isPreview();
    method public boolean isVisible();
    method public boolean isVisible();
    method public void notifyColorsChanged();
    method public void notifyColorsChanged();
    method public void onApplyWindowInsets(android.view.WindowInsets);
    method @MainThread public void onApplyWindowInsets(android.view.WindowInsets);
    method public android.os.Bundle onCommand(String, int, int, int, android.os.Bundle, boolean);
    method @MainThread public android.os.Bundle onCommand(String, int, int, int, android.os.Bundle, boolean);
    method @Nullable public android.app.WallpaperColors onComputeColors();
    method @MainThread @Nullable public android.app.WallpaperColors onComputeColors();
    method public void onCreate(android.view.SurfaceHolder);
    method @MainThread public void onCreate(android.view.SurfaceHolder);
    method public void onDesiredSizeChanged(int, int);
    method @MainThread public void onDesiredSizeChanged(int, int);
    method public void onDestroy();
    method @MainThread public void onDestroy();
    method public void onOffsetsChanged(float, float, float, float, int, int);
    method @MainThread public void onOffsetsChanged(float, float, float, float, int, int);
    method public void onSurfaceChanged(android.view.SurfaceHolder, int, int, int);
    method @MainThread public void onSurfaceChanged(android.view.SurfaceHolder, int, int, int);
    method public void onSurfaceCreated(android.view.SurfaceHolder);
    method @MainThread public void onSurfaceCreated(android.view.SurfaceHolder);
    method public void onSurfaceDestroyed(android.view.SurfaceHolder);
    method @MainThread public void onSurfaceDestroyed(android.view.SurfaceHolder);
    method public void onSurfaceRedrawNeeded(android.view.SurfaceHolder);
    method @MainThread public void onSurfaceRedrawNeeded(android.view.SurfaceHolder);
    method public void onTouchEvent(android.view.MotionEvent);
    method @MainThread public void onTouchEvent(android.view.MotionEvent);
    method public void onVisibilityChanged(boolean);
    method @MainThread public void onVisibilityChanged(boolean);
    method public void onZoomChanged(@FloatRange(from=0.0f, to=1.0f) float);
    method @MainThread public void onZoomChanged(@FloatRange(from=0.0f, to=1.0f) float);
    method public void setOffsetNotificationsEnabled(boolean);
    method public void setOffsetNotificationsEnabled(boolean);
    method public void setTouchEventsEnabled(boolean);
    method public void setTouchEventsEnabled(boolean);
  }
  }
+1 −1
Original line number Original line Diff line number Diff line
@@ -12226,7 +12226,7 @@ package android.service.wallpaper {
  public class WallpaperService.Engine {
  public class WallpaperService.Engine {
    method public boolean isInAmbientMode();
    method public boolean isInAmbientMode();
    method public void onAmbientModeChanged(boolean, long);
    method @MainThread public void onAmbientModeChanged(boolean, long);
  }
  }
}
}
+17 −0
Original line number Original line Diff line number Diff line
@@ -31,6 +31,7 @@ import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorListenerAdapter;
import android.animation.ValueAnimator;
import android.animation.ValueAnimator;
import android.annotation.FloatRange;
import android.annotation.FloatRange;
import android.annotation.MainThread;
import android.annotation.NonNull;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.Nullable;
import android.annotation.SdkConstant;
import android.annotation.SdkConstant;
@@ -657,6 +658,7 @@ public abstract class WallpaperService extends Service {
         * Called once to initialize the engine.  After returning, the
         * Called once to initialize the engine.  After returning, the
         * engine's surface will be created by the framework.
         * engine's surface will be created by the framework.
         */
         */
        @MainThread
        public void onCreate(SurfaceHolder surfaceHolder) {
        public void onCreate(SurfaceHolder surfaceHolder) {
        }
        }


@@ -665,6 +667,7 @@ public abstract class WallpaperService extends Service {
         * surface will be destroyed and this Engine object is no longer
         * surface will be destroyed and this Engine object is no longer
         * valid.
         * valid.
         */
         */
        @MainThread
        public void onDestroy() {
        public void onDestroy() {
        }
        }


@@ -673,6 +676,7 @@ public abstract class WallpaperService extends Service {
         * hidden.  <em>It is very important that a wallpaper only use
         * hidden.  <em>It is very important that a wallpaper only use
         * CPU while it is visible.</em>.
         * CPU while it is visible.</em>.
         */
         */
        @MainThread
        public void onVisibilityChanged(boolean visible) {
        public void onVisibilityChanged(boolean visible) {
        }
        }


@@ -683,6 +687,7 @@ public abstract class WallpaperService extends Service {
         *
         *
         * @param insets Insets to apply.
         * @param insets Insets to apply.
         */
         */
        @MainThread
        public void onApplyWindowInsets(WindowInsets insets) {
        public void onApplyWindowInsets(WindowInsets insets) {
        }
        }


@@ -693,6 +698,7 @@ public abstract class WallpaperService extends Service {
         * user is interacting with, so if it is slow you will get fewer
         * user is interacting with, so if it is slow you will get fewer
         * move events.
         * move events.
         */
         */
        @MainThread
        public void onTouchEvent(MotionEvent event) {
        public void onTouchEvent(MotionEvent event) {
        }
        }


@@ -702,6 +708,7 @@ public abstract class WallpaperService extends Service {
         * call to {@link WallpaperManager#setWallpaperOffsets(IBinder, float, float)
         * call to {@link WallpaperManager#setWallpaperOffsets(IBinder, float, float)
         * WallpaperManager.setWallpaperOffsets()}.
         * WallpaperManager.setWallpaperOffsets()}.
         */
         */
        @MainThread
        public void onOffsetsChanged(float xOffset, float yOffset,
        public void onOffsetsChanged(float xOffset, float yOffset,
                float xOffsetStep, float yOffsetStep,
                float xOffsetStep, float yOffsetStep,
                int xPixelOffset, int yPixelOffset) {
                int xPixelOffset, int yPixelOffset) {
@@ -724,6 +731,7 @@ public abstract class WallpaperService extends Service {
         * @return If returning a result, create a Bundle and place the
         * @return If returning a result, create a Bundle and place the
         * result data in to it.  Otherwise return null.
         * result data in to it.  Otherwise return null.
         */
         */
        @MainThread
        public Bundle onCommand(String action, int x, int y, int z,
        public Bundle onCommand(String action, int x, int y, int z,
                Bundle extras, boolean resultRequested) {
                Bundle extras, boolean resultRequested) {
            return null;
            return null;
@@ -742,6 +750,7 @@ public abstract class WallpaperService extends Service {
         * @hide
         * @hide
         */
         */
        @SystemApi
        @SystemApi
        @MainThread
        public void onAmbientModeChanged(boolean inAmbientMode, long animationDuration) {
        public void onAmbientModeChanged(boolean inAmbientMode, long animationDuration) {
        }
        }


@@ -749,6 +758,7 @@ public abstract class WallpaperService extends Service {
         * Called when an application has changed the desired virtual size of
         * Called when an application has changed the desired virtual size of
         * the wallpaper.
         * the wallpaper.
         */
         */
        @MainThread
        public void onDesiredSizeChanged(int desiredWidth, int desiredHeight) {
        public void onDesiredSizeChanged(int desiredWidth, int desiredHeight) {
        }
        }


@@ -756,6 +766,7 @@ public abstract class WallpaperService extends Service {
         * Convenience for {@link SurfaceHolder.Callback#surfaceChanged
         * Convenience for {@link SurfaceHolder.Callback#surfaceChanged
         * SurfaceHolder.Callback.surfaceChanged()}.
         * SurfaceHolder.Callback.surfaceChanged()}.
         */
         */
        @MainThread
        public void onSurfaceChanged(SurfaceHolder holder, int format, int width, int height) {
        public void onSurfaceChanged(SurfaceHolder holder, int format, int width, int height) {
        }
        }


@@ -763,6 +774,7 @@ public abstract class WallpaperService extends Service {
         * Convenience for {@link SurfaceHolder.Callback2#surfaceRedrawNeeded
         * Convenience for {@link SurfaceHolder.Callback2#surfaceRedrawNeeded
         * SurfaceHolder.Callback.surfaceRedrawNeeded()}.
         * SurfaceHolder.Callback.surfaceRedrawNeeded()}.
         */
         */
        @MainThread
        public void onSurfaceRedrawNeeded(SurfaceHolder holder) {
        public void onSurfaceRedrawNeeded(SurfaceHolder holder) {
        }
        }


@@ -770,6 +782,7 @@ public abstract class WallpaperService extends Service {
         * Convenience for {@link SurfaceHolder.Callback#surfaceCreated
         * Convenience for {@link SurfaceHolder.Callback#surfaceCreated
         * SurfaceHolder.Callback.surfaceCreated()}.
         * SurfaceHolder.Callback.surfaceCreated()}.
         */
         */
        @MainThread
        public void onSurfaceCreated(SurfaceHolder holder) {
        public void onSurfaceCreated(SurfaceHolder holder) {
        }
        }


@@ -777,6 +790,7 @@ public abstract class WallpaperService extends Service {
         * Convenience for {@link SurfaceHolder.Callback#surfaceDestroyed
         * Convenience for {@link SurfaceHolder.Callback#surfaceDestroyed
         * SurfaceHolder.Callback.surfaceDestroyed()}.
         * SurfaceHolder.Callback.surfaceDestroyed()}.
         */
         */
        @MainThread
        public void onSurfaceDestroyed(SurfaceHolder holder) {
        public void onSurfaceDestroyed(SurfaceHolder holder) {
        }
        }


@@ -787,6 +801,7 @@ public abstract class WallpaperService extends Service {
         * @param zoom the zoom level, between 0 indicating fully zoomed in and 1 indicating fully
         * @param zoom the zoom level, between 0 indicating fully zoomed in and 1 indicating fully
         *             zoomed out.
         *             zoomed out.
         */
         */
        @MainThread
        public void onZoomChanged(@FloatRange(from = 0f, to = 1f) float zoom) {
        public void onZoomChanged(@FloatRange(from = 0f, to = 1f) float zoom) {
        }
        }


@@ -836,6 +851,7 @@ public abstract class WallpaperService extends Service {
         *
         *
         * @return Wallpaper colors.
         * @return Wallpaper colors.
         */
         */
        @MainThread
        public @Nullable WallpaperColors onComputeColors() {
        public @Nullable WallpaperColors onComputeColors() {
            return null;
            return null;
        }
        }
@@ -2510,6 +2526,7 @@ public abstract class WallpaperService extends Service {
     * when the wallpaper is currently set as the active wallpaper and the user
     * when the wallpaper is currently set as the active wallpaper and the user
     * is in the wallpaper picker viewing a preview of it as well.
     * is in the wallpaper picker viewing a preview of it as well.
     */
     */
    @MainThread
    public abstract Engine onCreateEngine();
    public abstract Engine onCreateEngine();


    @Override
    @Override