diff options
author | wilsonshih <wilsonshih@google.com> | 2018-11-05 09:31:50 +0800 |
---|---|---|
committer | Wei Sheng Shih <wilsonshih@google.com> | 2018-11-07 02:23:53 +0000 |
commit | f51fce4dda44b99d58f2a28b7b1b1a0167f1e905 (patch) | |
tree | d439c9837bb52829df227619e8f26e5a2f1314a1 /src | |
parent | f8b66441742097599f28da7399d62e1908b1749e (diff) | |
download | android_packages_wallpapers_LivePicker-f51fce4dda44b99d58f2a28b7b1b1a0167f1e905.tar.gz android_packages_wallpapers_LivePicker-f51fce4dda44b99d58f2a28b7b1b1a0167f1e905.tar.bz2 android_packages_wallpapers_LivePicker-f51fce4dda44b99d58f2a28b7b1b1a0167f1e905.zip |
Supports wallpaper for multi display, API change.
API change on IWallpaperConnection.
Bug: 115486823
Test: manual run this app.
Test: atest ActivityManagerMultiDisplayTests
Change-Id: I13b8644a041d8ee7a5cced4c4f5d33a0f5ae68b4
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/wallpaper/livepicker/LiveWallpaperPreview.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/com/android/wallpaper/livepicker/LiveWallpaperPreview.java b/src/com/android/wallpaper/livepicker/LiveWallpaperPreview.java index 25ce3a4..b6b5316 100644 --- a/src/com/android/wallpaper/livepicker/LiveWallpaperPreview.java +++ b/src/com/android/wallpaper/livepicker/LiveWallpaperPreview.java @@ -458,16 +458,17 @@ public class LiveWallpaperPreview extends Activity { mService = null; } } - + public void onServiceConnected(ComponentName name, IBinder service) { if (mWallpaperConnection == this) { mService = IWallpaperService.Stub.asInterface(service); try { + final int displayId = getWindow().getDecorView().getDisplay().getDisplayId(); final View root = getWindow().getDecorView(); mService.attach(this, root.getWindowToken(), LayoutParams.TYPE_APPLICATION_MEDIA, true, root.getWidth(), root.getHeight(), - new Rect(0, 0, 0, 0)); + new Rect(0, 0, 0, 0), displayId); } catch (RemoteException e) { Log.w(LOG_TAG, "Failed attaching wallpaper; clearing", e); } @@ -482,7 +483,7 @@ public class LiveWallpaperPreview extends Activity { } } - public void attachEngine(IWallpaperEngine engine) { + public void attachEngine(IWallpaperEngine engine, int displayId) { synchronized (this) { if (mConnected) { mEngine = engine; |