Fix crash from folding/unfolding
This is fundamentally caused by the phone device profile not having task bar related attributes, which crashes in icon alignment animation. We had resolved it by skipping this animation based on isPhoneMode check. However, we passed in launcherDp instead of taskbarDp (from TaskbarActivityContext) which doesn't always have the most up to date information in race conditions (e.g. repetitively fold/unfold) Fixes: 311431054 Test: repetively fold/unfold, make sure it doesn't crash Change-Id: I65f600112da4123d337b3f59a2fe6dd13ac7af74
This commit is contained in:
@@ -492,23 +492,7 @@ public class TaskbarManager {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {@code true} if provided device profile isn't a large screen profile
|
||||
* and we are using a single window for taskbar and navbar.
|
||||
*/
|
||||
public static boolean isPhoneMode(DeviceProfile deviceProfile) {
|
||||
return ENABLE_TASKBAR_NAVBAR_UNIFICATION && deviceProfile.isPhone;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {@code true} if {@link #isPhoneMode(DeviceProfile)} is true and we're using
|
||||
* 3 button-nav
|
||||
*/
|
||||
public static boolean isPhoneButtonNavMode(TaskbarActivityContext context) {
|
||||
return isPhoneMode(context.getDeviceProfile()) && context.isThreeButtonNav();
|
||||
}
|
||||
|
||||
private boolean isTaskbarPresent(DeviceProfile deviceProfile) {
|
||||
private static boolean isTaskbarPresent(DeviceProfile deviceProfile) {
|
||||
return ENABLE_TASKBAR_NAVBAR_UNIFICATION || deviceProfile.isTaskbarPresent;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user