Loading core/java/android/app/IWallpaperManager.aidl +0 −7 Original line number Diff line number Diff line Loading @@ -175,11 +175,4 @@ interface IWallpaperManager { * Called from SystemUI when it shows the AoD UI. */ oneway void setInAmbientMode(boolean inAmbientMode, long animationDuration); /** * Called when the wallpaper needs to zoom out. * The zoom value goes from 0 to 1 (inclusive) where 1 means fully zoomed out, * 0 means fully zoomed in */ oneway void setWallpaperZoomOut(float zoom, String callingPackage, int displayId); } core/java/android/app/WallpaperManager.java +2 −3 Original line number Diff line number Diff line Loading @@ -1858,13 +1858,12 @@ public class WallpaperManager { * * @hide */ public void setWallpaperZoomOut(float zoom) { public void setWallpaperZoomOut(IBinder windowToken, float zoom) { if (zoom < 0 || zoom > 1f) { throw new IllegalArgumentException("zoom must be between 0 and one: " + zoom); } try { sGlobals.mService.setWallpaperZoomOut(zoom, mContext.getOpPackageName(), mContext.getDisplayId()); WindowManagerGlobal.getWindowSession().setWallpaperZoomOut(windowToken, zoom); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading core/java/android/service/wallpaper/WallpaperService.java +16 −5 Original line number Diff line number Diff line Loading @@ -124,8 +124,6 @@ public abstract class WallpaperService extends Service { private static final int MSG_REQUEST_WALLPAPER_COLORS = 10050; private static final int MSG_SCALE = 10100; private static final float MAX_SCALE = 1.15f; private static final int NOTIFY_COLORS_RATE_LIMIT_MS = 1000; private final ArrayList<Engine> mActiveEngines Loading Loading @@ -351,7 +349,7 @@ public abstract class WallpaperService extends Service { @Override public void dispatchWallpaperOffsets(float x, float y, float xStep, float yStep, boolean sync) { float zoom, boolean sync) { synchronized (mLock) { if (DEBUG) Log.v(TAG, "Dispatch wallpaper offsets: " + x + ", " + y); mPendingXOffset = x; Loading @@ -366,6 +364,8 @@ public abstract class WallpaperService extends Service { Message msg = mCaller.obtainMessage(MSG_WALLPAPER_OFFSETS); mCaller.sendMessage(msg); } Message msg = mCaller.obtainMessageI(MSG_SCALE, Float.floatToIntBits(zoom)); mCaller.sendMessage(msg); } } Loading Loading @@ -461,6 +461,18 @@ public abstract class WallpaperService extends Service { return mIsInAmbientMode; } /** * This will be called when the wallpaper is first started. If true is returned, the system * will zoom in the wallpaper by default and zoom it out as the user interacts, * to create depth. Otherwise, zoom will have to be handled manually * in {@link #onZoomChanged(float)}. * * @hide */ public boolean shouldZoomOutWallpaper() { return false; } /** * Control whether this wallpaper will receive raw touch events * from the window manager as the user interacts with the window Loading Loading @@ -870,6 +882,7 @@ public abstract class WallpaperService extends Service { Log.w(TAG, "Failed to add window while updating wallpaper surface."); return; } mSession.setShouldZoomOutWallpaper(mWindow, shouldZoomOutWallpaper()); mCreated = true; mInputEventReceiver = new WallpaperInputEventReceiver( Loading Loading @@ -964,7 +977,6 @@ public abstract class WallpaperService extends Service { c.surfaceCreated(mSurfaceHolder); } } onZoomChanged(0f); } redrawNeeded |= creating || (relayoutResult Loading Loading @@ -1125,7 +1137,6 @@ public abstract class WallpaperService extends Service { mIsInAmbientMode = inAmbientMode; if (mCreated) { onAmbientModeChanged(inAmbientMode, animationDuration); setZoom(0); } } } Loading core/java/android/view/IWindow.aidl +2 −2 Original line number Diff line number Diff line Loading @@ -102,9 +102,9 @@ oneway interface IWindow { void closeSystemDialogs(String reason); /** * Called for wallpaper windows when their offsets change. * Called for wallpaper windows when their offsets or zoom level change. */ void dispatchWallpaperOffsets(float x, float y, float xStep, float yStep, boolean sync); void dispatchWallpaperOffsets(float x, float y, float xStep, float yStep, float zoom, boolean sync); void dispatchWallpaperCommand(String action, int x, int y, int z, in Bundle extras, boolean sync); Loading core/java/android/view/IWindowSession.aidl +13 −0 Original line number Diff line number Diff line Loading @@ -221,6 +221,19 @@ interface IWindowSession { */ void setWallpaperPosition(IBinder windowToken, float x, float y, float xstep, float ystep); /** * For wallpaper windows, sets the scale of the wallpaper based on * SystemUI behavior. */ void setWallpaperZoomOut(IBinder windowToken, float scale); /** * For wallpaper windows, sets whether the wallpaper should actually be * scaled when setWallpaperZoomOut is called. If set to false, the WallpaperService will * receive the zoom out value but the surface won't be scaled. */ void setShouldZoomOutWallpaper(IBinder windowToken, boolean shouldZoom); @UnsupportedAppUsage void wallpaperOffsetsComplete(IBinder window); Loading Loading
core/java/android/app/IWallpaperManager.aidl +0 −7 Original line number Diff line number Diff line Loading @@ -175,11 +175,4 @@ interface IWallpaperManager { * Called from SystemUI when it shows the AoD UI. */ oneway void setInAmbientMode(boolean inAmbientMode, long animationDuration); /** * Called when the wallpaper needs to zoom out. * The zoom value goes from 0 to 1 (inclusive) where 1 means fully zoomed out, * 0 means fully zoomed in */ oneway void setWallpaperZoomOut(float zoom, String callingPackage, int displayId); }
core/java/android/app/WallpaperManager.java +2 −3 Original line number Diff line number Diff line Loading @@ -1858,13 +1858,12 @@ public class WallpaperManager { * * @hide */ public void setWallpaperZoomOut(float zoom) { public void setWallpaperZoomOut(IBinder windowToken, float zoom) { if (zoom < 0 || zoom > 1f) { throw new IllegalArgumentException("zoom must be between 0 and one: " + zoom); } try { sGlobals.mService.setWallpaperZoomOut(zoom, mContext.getOpPackageName(), mContext.getDisplayId()); WindowManagerGlobal.getWindowSession().setWallpaperZoomOut(windowToken, zoom); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading
core/java/android/service/wallpaper/WallpaperService.java +16 −5 Original line number Diff line number Diff line Loading @@ -124,8 +124,6 @@ public abstract class WallpaperService extends Service { private static final int MSG_REQUEST_WALLPAPER_COLORS = 10050; private static final int MSG_SCALE = 10100; private static final float MAX_SCALE = 1.15f; private static final int NOTIFY_COLORS_RATE_LIMIT_MS = 1000; private final ArrayList<Engine> mActiveEngines Loading Loading @@ -351,7 +349,7 @@ public abstract class WallpaperService extends Service { @Override public void dispatchWallpaperOffsets(float x, float y, float xStep, float yStep, boolean sync) { float zoom, boolean sync) { synchronized (mLock) { if (DEBUG) Log.v(TAG, "Dispatch wallpaper offsets: " + x + ", " + y); mPendingXOffset = x; Loading @@ -366,6 +364,8 @@ public abstract class WallpaperService extends Service { Message msg = mCaller.obtainMessage(MSG_WALLPAPER_OFFSETS); mCaller.sendMessage(msg); } Message msg = mCaller.obtainMessageI(MSG_SCALE, Float.floatToIntBits(zoom)); mCaller.sendMessage(msg); } } Loading Loading @@ -461,6 +461,18 @@ public abstract class WallpaperService extends Service { return mIsInAmbientMode; } /** * This will be called when the wallpaper is first started. If true is returned, the system * will zoom in the wallpaper by default and zoom it out as the user interacts, * to create depth. Otherwise, zoom will have to be handled manually * in {@link #onZoomChanged(float)}. * * @hide */ public boolean shouldZoomOutWallpaper() { return false; } /** * Control whether this wallpaper will receive raw touch events * from the window manager as the user interacts with the window Loading Loading @@ -870,6 +882,7 @@ public abstract class WallpaperService extends Service { Log.w(TAG, "Failed to add window while updating wallpaper surface."); return; } mSession.setShouldZoomOutWallpaper(mWindow, shouldZoomOutWallpaper()); mCreated = true; mInputEventReceiver = new WallpaperInputEventReceiver( Loading Loading @@ -964,7 +977,6 @@ public abstract class WallpaperService extends Service { c.surfaceCreated(mSurfaceHolder); } } onZoomChanged(0f); } redrawNeeded |= creating || (relayoutResult Loading Loading @@ -1125,7 +1137,6 @@ public abstract class WallpaperService extends Service { mIsInAmbientMode = inAmbientMode; if (mCreated) { onAmbientModeChanged(inAmbientMode, animationDuration); setZoom(0); } } } Loading
core/java/android/view/IWindow.aidl +2 −2 Original line number Diff line number Diff line Loading @@ -102,9 +102,9 @@ oneway interface IWindow { void closeSystemDialogs(String reason); /** * Called for wallpaper windows when their offsets change. * Called for wallpaper windows when their offsets or zoom level change. */ void dispatchWallpaperOffsets(float x, float y, float xStep, float yStep, boolean sync); void dispatchWallpaperOffsets(float x, float y, float xStep, float yStep, float zoom, boolean sync); void dispatchWallpaperCommand(String action, int x, int y, int z, in Bundle extras, boolean sync); Loading
core/java/android/view/IWindowSession.aidl +13 −0 Original line number Diff line number Diff line Loading @@ -221,6 +221,19 @@ interface IWindowSession { */ void setWallpaperPosition(IBinder windowToken, float x, float y, float xstep, float ystep); /** * For wallpaper windows, sets the scale of the wallpaper based on * SystemUI behavior. */ void setWallpaperZoomOut(IBinder windowToken, float scale); /** * For wallpaper windows, sets whether the wallpaper should actually be * scaled when setWallpaperZoomOut is called. If set to false, the WallpaperService will * receive the zoom out value but the surface won't be scaled. */ void setShouldZoomOutWallpaper(IBinder windowToken, boolean shouldZoom); @UnsupportedAppUsage void wallpaperOffsetsComplete(IBinder window); Loading