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

Commit 9f3bdfe3 authored by Jeff Brown's avatar Jeff Brown
Browse files

Add method for sending wallpaper commands directly to an engine.

This enables the livewallpaper preview activity to send tap commands to the
wallpaper so that the preview is more interactive.

Also add a command for sending secondary pointer taps for multitouch
enabled wallpapers.

Change-Id: I9fa10cc47d92dfa9f1a1208aba44c66943eee3ec
parent 592f4dd8
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -36065,6 +36065,17 @@
 visibility="public"
>
</field>
<field name="COMMAND_SECONDARY_TAP"
 type="java.lang.String"
 transient="false"
 volatile="false"
 value="&quot;android.wallpaper.secondaryTap&quot;"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="COMMAND_TAP"
 type="java.lang.String"
 transient="false"
@@ -250200,7 +250211,7 @@
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="t" type="T">
<parameter name="arg0" type="T">
</parameter>
</method>
</interface>
+8 −0
Original line number Diff line number Diff line
@@ -71,6 +71,14 @@ public class WallpaperManager {
     */
    public static final String COMMAND_TAP = "android.wallpaper.tap";
    
    /**
     * Command for {@link #sendWallpaperCommand}: reported by the wallpaper
     * host when the user releases a secondary pointer on an empty area
     * (not performing an action in the host).  The x and y arguments are
     * the location of the secondary tap in screen coordinates.
     */
    public static final String COMMAND_SECONDARY_TAP = "android.wallpaper.secondaryTap";

    /**
     * Command for {@link #sendWallpaperCommand}: reported by the wallpaper
     * host when the user drops an object into an area of the host.  The x
+3 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package android.service.wallpaper;

import android.view.MotionEvent;
import android.os.Bundle;

/**
 * @hide
@@ -25,5 +26,7 @@ oneway interface IWallpaperEngine {
    void setDesiredSize(int width, int height);
    void setVisibility(boolean visible);
    void dispatchPointer(in MotionEvent event);
    void dispatchWallpaperCommand(String action, int x, int y,
            int z, in Bundle extras);
	void destroy();
}
+8 −1
Original line number Diff line number Diff line
@@ -858,6 +858,13 @@ public abstract class WallpaperService extends Service {
            }
        }

        public void dispatchWallpaperCommand(String action, int x, int y,
                int z, Bundle extras) {
            if (mEngine != null) {
                mEngine.mWindow.dispatchWallpaperCommand(action, x, y, z, extras, false);
            }
        }

        public void destroy() {
            Message msg = mCaller.obtainMessage(DO_DETACH);
            mCaller.sendMessage(msg);