Commit Graph

15 Commits

Author SHA1 Message Date
John Andrew Camu
930d0e6cd7 Add Support for big screen (#4461)
* Initial Support for big screen

* Fixed regressions

* Don't recalculate when device isTablet
2024-06-22 12:58:43 +08:00
MrSluffy
cc8f9828ab Merge branch 'heads/android-14.0.0_r18' into 14-dev 2023-12-16 17:18:13 +08:00
MrSluffy
32700b0100 Merge branch 'android14-release' into 14-dev 2023-12-13 18:47:55 +08:00
MrSluffy
19bf26dd5a Merge branch 'aosp-13' into 13-wip 2023-10-21 09:52:01 +08:00
Nick Chameyev
a8037620bd Calculate StatusBar height locally in Launcher
When reading the status bar inset on devices with
multiple displays after switching the displays
the inset is not updated immediately (SystemUI
should update the height of the window first by
reacting to the display switch in it's own process).

Due to this race condition Launcher is very likely
to calculate DeviceProfile with incorrect inset
of the previous display first and update it to
the correct one only after SystemUI finished the
window update.

To avoid this adding calculation of the StatusBar
height to Launcher locally using the same utility
method that is used by SystemUI.

Bug: 264656380
Test: manual test that the statusbar height is calculated
 correctly in Launcher on a device with two displays, both on
 the inner and outer display and different rotations
Change-Id: Ia16ecadd8fcac29082d27ca693ab7740ce6161c4
2023-01-18 16:04:41 +00:00
Alex Chau
e818bcb997 Use real IDP in DeviceProfileTest
- Mock WindowManagerProxy instead of IDP in DeviceProfileTest
- Extracted NavigationMode to standalone class
- Moved parseNavigationMode to WindowManagerProxy so it can be mocked
- Moved DeviceProfileTest to internal repo

Bug: 242086027
Test: DeviceProfileTest
Change-Id: Ia5a43293b1380f04d786d2adf8503cfd10f7674a
2022-09-07 10:35:21 +01:00
vadimt
f6ef879cf4 Moving all sources that are shared between Launcher and TAPL in one directory
This will help SysUI test team (who uses TAPL) to set up Gradle build for their tests.

Bug: 202567877, 234414088
Test: presubmit
Change-Id: I3d923ea4b54d1a4c3d2b345be09692727d30433e
2022-07-27 20:18:46 +00:00
Alex Chau
661f02de18 Use normalized CachedDisplayInfo as key
- For system Launcher, migrate to use getPossibleMaximumWindowMetrics instead of getDisplays
- Removed usage of displayId
- In estimateInternalDisplayBounds, use CachedDisplayInfo directly as a key
- When cache retunrs null for the current display (e.g. the 3P launcher case), invalidate the cache and estimate again, and only add to supportedBounds if current display is not found in the new cache

Bug: 227459045
Bug: 198965093
Test: manual
Change-Id: Ibcc05ba483ed31a40d16e3cf49c3f3d43af68cf6
2022-06-09 11:36:47 +01:00
Sunny Goyal
7bf8730634 Fixing wrong window insets estimation
Launcher was estimating the landscape insets incorrectly
causing the UI to get reloaded if device is rotated. This also
caused widgets to be refetched as a result of grid size change

Bug: 218067434
Test: Verified locally that the window bounds do not change
Change-Id: Ia7228296c78ea3056f4859e43696d4bfd9522d3c
2022-05-02 13:18:45 -07:00
Sebastian Franco
00aff95ac0 Give the tests the ability to emulate other devices screens
This code contains utility clases that can change the display
of a device and make it look like another device.
The function DisplayEmulator#emulate receives a DeviceEmulationData
a certain grid to emulate and a callback, everyting that happens
inside of the callback will happen when the device is being emulated
and can be used by other tests.

Example test:
package com.android.launcher3.deviceemulator;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.MediumTest;
import com.android.launcher3.deviceemulator.models.DeviceEmulationData;
import com.android.launcher3.ui.AbstractLauncherUiTest;
import org.junit.Test;
import org.junit.runner.RunWith;
import java.util.concurrent.TimeUnit;

@MediumTest
@RunWith(AndroidJUnit4.class)
public class TestTest extends AbstractLauncherUiTest {
    @Test
    public void testEmulation() throws Exception {
        String deviceCode = "pixel6pro";
        DeviceEmulationData deviceData = DeviceEmulationData.getDevice(deviceCode);
        String grid = "normal";
        DisplayEmulator displayEmulator = new DisplayEmulator(mTargetContext);

        displayEmulator.emulate(deviceData, grid, () ->{
            TimeUnit.SECONDS.sleep(10);
            return true;
        });
    }
}

Test: You could use the test above to make your device look like a
Pixel6 pro for 10 secons.
Fix: 229028257

Change-Id: Icd79be405a2e14dda0bc5f555b0e46149e16f912
2022-04-25 11:57:58 -05:00
Alex Chau
20af9304cb Override statusBar top inset in Launcher
Fix: 227600170
Test: manual on small and large screen devices
Change-Id: I1b0dacaf555db966d1e2a837310d9cebe3e60d7a
2022-04-04 17:39:31 +01:00
Alex Chau
5f8386cf26 Merge "Using the WindowMetrics API instead of display.getRealSize" into tm-dev 2022-03-31 10:58:40 +00:00
Sunny Goyal
36c0f76e21 Using the WindowMetrics API instead of display.getRealSize
Bug: 221961069
Bug: 195408476
Bug: 198965093
Test: Verified locally and presubmit
Change-Id: I4dac9c19df4c43e6a38ba5c05f27d25f4cfcb071
2022-03-30 21:07:23 +00:00
Thales Lima
12d0eff037 Make inline qsb part of grid attrs
This should make it more configurable, and be independent of the screen size set by the user.

Fix: 223726518
Test: atest Launcher3Tests:HotseatSizeTest
Test: atest Launcher3Tests:InlineQsbTest
Change-Id: If04f3fb0f556103f60b580c757a9fc06da561516
2022-03-30 20:57:57 +01:00
Sunny Goyal
187b16cb91 Updating window manager estimation logic:
> Moving the code from ApiWrapper to Resource overlays for better maintainability
> Accounting for display cutouts in insets estimation
> Using same logic in display controller and view inset dispatching

Test: Verified on device
Bug: 221961069
Change-Id: I78466353563692ce3f7512b0146ef8b61ef14bc0
2022-03-09 11:15:58 -08:00