Skip to content

Commit 833808d

Browse files
committed
Fix transition into Recents with live wallpaper
Fixes regression introduced by: 738cfc9 (Fixing wallpaper flash when going in/out of Recents)
1 parent e9687ba commit 833808d

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

packages/SystemUI/src/com/android/systemui/recent/RecentsActivity.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,14 @@ private void updateWallpaperVisibility(boolean visible) {
113113
}
114114
}
115115

116+
public static boolean forceOpaqueBackground(Context context) {
117+
return WallpaperManager.getInstance(context).getWallpaperInfo() != null;
118+
}
119+
116120
@Override
117121
public void onStart() {
118122
// Hide wallpaper if it's not a static image
119-
if (WallpaperManager.getInstance(this).getWallpaperInfo() != null) {
123+
if (forceOpaqueBackground(this)) {
120124
updateWallpaperVisibility(false);
121125
} else {
122126
updateWallpaperVisibility(true);

packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
import android.app.ActivityOptions;
3737
import android.app.KeyguardManager;
3838
import android.app.PendingIntent;
39-
import android.app.Service;
4039
import android.app.TaskStackBuilder;
4140
import android.content.ActivityNotFoundException;
4241
import android.content.BroadcastReceiver;
@@ -81,7 +80,6 @@
8180
import android.widget.TextView;
8281

8382
import java.util.ArrayList;
84-
import java.util.List;
8583

8684
public abstract class BaseStatusBar extends SystemUI implements
8785
CommandQueue.Callbacks {
@@ -481,9 +479,18 @@ protected void toggleRecentsActivity() {
481479
| Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
482480

483481
if (firstTask == null) {
484-
// The correct window animation will be applied via the activity's style
485-
mContext.startActivityAsUser(intent, new UserHandle(
486-
UserHandle.USER_CURRENT));
482+
if (RecentsActivity.forceOpaqueBackground(mContext)) {
483+
ActivityOptions opts = ActivityOptions.makeCustomAnimation(mContext,
484+
R.anim.recents_launch_from_launcher_enter,
485+
R.anim.recents_launch_from_launcher_exit);
486+
mContext.startActivityAsUser(intent, opts.toBundle(), new UserHandle(
487+
UserHandle.USER_CURRENT));
488+
} else {
489+
// The correct window animation will be applied via the activity's style
490+
mContext.startActivityAsUser(intent, new UserHandle(
491+
UserHandle.USER_CURRENT));
492+
}
493+
487494
} else {
488495
Bitmap first = firstTask.getThumbnail();
489496
final Resources res = mContext.getResources();

0 commit comments

Comments
 (0)