Pass WindowContext to DisplayInfoChangeListener

- WindowContext (or updated DisplayContext for Pre-S) contains updated Resources to be used for the listener

Fixes: 181215299
Fixes: 176656141
Test: Swap between large/small screen, large sreen UI is seen
Test: Swap between font size, launcher icon text is updated
Test: Start secondary home
Test: Repeat the above tests with Utilities.ATLEAST_S hardcoded to false
Change-Id: Ib33025ac0276c84fe2b3213e9946721e5988e3da
This commit is contained in:
Alex Chau
2021-04-22 19:10:21 +01:00
parent baf00e4e55
commit fd6d942220
6 changed files with 28 additions and 22 deletions

View File

@@ -27,12 +27,11 @@ import static com.android.systemui.shared.system.ActivityManagerWrapper.CLOSE_SY
import android.animation.AnimatorSet;
import android.animation.ValueAnimator;
import android.app.ActivityOptions;
import android.content.Context;
import android.content.Intent;
import android.content.IntentSender;
import android.os.Binder;
import android.os.Bundle;
import android.os.CancellationSignal;
import android.os.IBinder;
import android.view.View;
import androidx.annotation.Nullable;
@@ -41,7 +40,6 @@ import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.dragndrop.DragOptions;
import com.android.launcher3.model.WellbeingModel;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.model.data.WorkspaceItemInfo;
import com.android.launcher3.popup.SystemShortcut;
import com.android.launcher3.proxy.ProxyActivityStarter;
import com.android.launcher3.proxy.StartActivityParams;
@@ -73,7 +71,6 @@ import com.android.systemui.shared.system.ActivityManagerWrapper;
import com.android.systemui.shared.system.ActivityOptionsCompat;
import com.android.systemui.shared.system.RemoteAnimationTargetCompat;
import java.util.HashMap;
import java.util.List;
import java.util.stream.Stream;
@@ -240,8 +237,9 @@ public abstract class BaseQuickstepLauncher extends Launcher
}
@Override
public void onDisplayInfoChanged(DisplayController.Info info, int flags) {
super.onDisplayInfoChanged(info, flags);
public void onDisplayInfoChanged(Context context, DisplayController.Info info,
int flags) {
super.onDisplayInfoChanged(context, info, flags);
if ((flags & CHANGE_SIZE) != 0) {
addTaskbarIfNecessary();
}