Loading core/java/android/app/WallpaperManager.java +16 −4 Original line number Diff line number Diff line Loading @@ -996,17 +996,29 @@ public class WallpaperManager { } /** * If the current wallpaper is a live wallpaper component, return the * information about that wallpaper. Otherwise, if it is a static image, * simply return null. * Returns the information about the wallpaper if the current wallpaper is * a live wallpaper component. Otherwise, if the wallpaper is a static image, * this returns null. */ public WallpaperInfo getWallpaperInfo() { return getWallpaperInfo(mContext.getUserId()); } /** * Returns the information about the wallpaper if the current wallpaper is * a live wallpaper component. Otherwise, if the wallpaper is a static image, * this returns null. * * @param userId Owner of the wallpaper. * @hide */ public WallpaperInfo getWallpaperInfo(int userId) { try { if (sGlobals.mService == null) { Log.w(TAG, "WallpaperService not running"); throw new RuntimeException(new DeadSystemException()); } else { return sGlobals.mService.getWallpaperInfo(mContext.getUserId()); return sGlobals.mService.getWallpaperInfo(userId); } } catch (RemoteException e) { throw e.rethrowFromSystemServer(); Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +5 −3 Original line number Diff line number Diff line Loading @@ -505,7 +505,7 @@ public class StatusBar extends SystemUI implements DemoMode, protected NotificationLockscreenUserManager mLockscreenUserManager; protected NotificationRemoteInputManager mRemoteInputManager; private BroadcastReceiver mWallpaperChangedReceiver = new BroadcastReceiver() { private final BroadcastReceiver mWallpaperChangedReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { WallpaperManager wallpaperManager = context.getSystemService(WallpaperManager.class); Loading @@ -513,7 +513,7 @@ public class StatusBar extends SystemUI implements DemoMode, Log.w(TAG, "WallpaperManager not available"); return; } WallpaperInfo info = wallpaperManager.getWallpaperInfo(); WallpaperInfo info = wallpaperManager.getWallpaperInfo(UserHandle.USER_CURRENT); final boolean supportsAmbientMode = info != null && info.getSupportsAmbientMode(); Loading Loading @@ -707,7 +707,8 @@ public class StatusBar extends SystemUI implements DemoMode, // Make sure we always have the most current wallpaper info. IntentFilter wallpaperChangedFilter = new IntentFilter(Intent.ACTION_WALLPAPER_CHANGED); mContext.registerReceiver(mWallpaperChangedReceiver, wallpaperChangedFilter); mContext.registerReceiverAsUser(mWallpaperChangedReceiver, UserHandle.ALL, wallpaperChangedFilter, null /* broadcastPermission */, null /* scheduler */); mWallpaperChangedReceiver.onReceive(mContext, null); mLockscreenUserManager.setUpWithPresenter(this, mEntryManager); Loading Loading @@ -3156,6 +3157,7 @@ public class StatusBar extends SystemUI implements DemoMode, updateNotificationViews(); mMediaManager.clearCurrentMediaNotification(); setLockscreenUser(newUserId); mWallpaperChangedReceiver.onReceive(mContext, null); } @Override Loading Loading
core/java/android/app/WallpaperManager.java +16 −4 Original line number Diff line number Diff line Loading @@ -996,17 +996,29 @@ public class WallpaperManager { } /** * If the current wallpaper is a live wallpaper component, return the * information about that wallpaper. Otherwise, if it is a static image, * simply return null. * Returns the information about the wallpaper if the current wallpaper is * a live wallpaper component. Otherwise, if the wallpaper is a static image, * this returns null. */ public WallpaperInfo getWallpaperInfo() { return getWallpaperInfo(mContext.getUserId()); } /** * Returns the information about the wallpaper if the current wallpaper is * a live wallpaper component. Otherwise, if the wallpaper is a static image, * this returns null. * * @param userId Owner of the wallpaper. * @hide */ public WallpaperInfo getWallpaperInfo(int userId) { try { if (sGlobals.mService == null) { Log.w(TAG, "WallpaperService not running"); throw new RuntimeException(new DeadSystemException()); } else { return sGlobals.mService.getWallpaperInfo(mContext.getUserId()); return sGlobals.mService.getWallpaperInfo(userId); } } catch (RemoteException e) { throw e.rethrowFromSystemServer(); Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +5 −3 Original line number Diff line number Diff line Loading @@ -505,7 +505,7 @@ public class StatusBar extends SystemUI implements DemoMode, protected NotificationLockscreenUserManager mLockscreenUserManager; protected NotificationRemoteInputManager mRemoteInputManager; private BroadcastReceiver mWallpaperChangedReceiver = new BroadcastReceiver() { private final BroadcastReceiver mWallpaperChangedReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { WallpaperManager wallpaperManager = context.getSystemService(WallpaperManager.class); Loading @@ -513,7 +513,7 @@ public class StatusBar extends SystemUI implements DemoMode, Log.w(TAG, "WallpaperManager not available"); return; } WallpaperInfo info = wallpaperManager.getWallpaperInfo(); WallpaperInfo info = wallpaperManager.getWallpaperInfo(UserHandle.USER_CURRENT); final boolean supportsAmbientMode = info != null && info.getSupportsAmbientMode(); Loading Loading @@ -707,7 +707,8 @@ public class StatusBar extends SystemUI implements DemoMode, // Make sure we always have the most current wallpaper info. IntentFilter wallpaperChangedFilter = new IntentFilter(Intent.ACTION_WALLPAPER_CHANGED); mContext.registerReceiver(mWallpaperChangedReceiver, wallpaperChangedFilter); mContext.registerReceiverAsUser(mWallpaperChangedReceiver, UserHandle.ALL, wallpaperChangedFilter, null /* broadcastPermission */, null /* scheduler */); mWallpaperChangedReceiver.onReceive(mContext, null); mLockscreenUserManager.setUpWithPresenter(this, mEntryManager); Loading Loading @@ -3156,6 +3157,7 @@ public class StatusBar extends SystemUI implements DemoMode, updateNotificationViews(); mMediaManager.clearCurrentMediaNotification(); setLockscreenUser(newUserId); mWallpaperChangedReceiver.onReceive(mContext, null); } @Override Loading