Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ab3963dd authored by Sunny Goyal's avatar Sunny Goyal
Browse files

Moving TestInformationProvider to Launcher3 so that it can be used for

testing Launcher3 without quickstep

Also keeping the provider as disabled until needed

Change-Id: Ib5f459e02ae551724b390f3b74f43d601568d749
parent 571e5116
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ android_library {
        "tests/tapl/**/*.java",
        "src/com/android/launcher3/util/SecureSettingsObserver.java",
        "src/com/android/launcher3/ResourceUtils.java",
        "src/com/android/launcher3/TestProtocol.java",
        "src/com/android/launcher3/testing/TestProtocol.java",
    ],
    manifest: "tests/tapl/AndroidManifest.xml",
    platform_apis: true,
+7 −0
Original line number Diff line number Diff line
@@ -176,5 +176,12 @@
            </intent-filter>
        </activity>

        <provider
            android:name="com.android.launcher3.testing.TestInformationProvider"
            android:authorities="${packageName}.TestInfo"
            android:readPermission="android.permission.WRITE_SECURE_SETTINGS"
            android:writePermission="android.permission.WRITE_SECURE_SETTINGS"
            android:exported="true"
            android:enabled="false" />
    </application>
</manifest>
+0 −8
Original line number Diff line number Diff line
@@ -73,14 +73,6 @@
            </intent-filter>
        </provider>

        <provider
            android:name="com.android.quickstep.TestInformationProvider"
            android:authorities="${packageName}.TestInfo"
            android:readPermission="android.permission.WRITE_SECURE_SETTINGS"
            android:writePermission="android.permission.WRITE_SECURE_SETTINGS"
            android:exported="true">
        </provider>

        <service
            android:name="com.android.launcher3.uioverrides.dynamicui.WallpaperManagerCompatVL$ColorExtractionService"
            tools:node="remove" />
+2 −0
Original line number Diff line number Diff line
@@ -25,6 +25,8 @@

    <string name="stats_log_manager_class" translatable="false">com.android.quickstep.logging.StatsLogCompatManager</string>

    <string name="test_information_handler_class" translatable="false">com.android.quickstep.QuickstepTestInformationHandler</string>

    <!-- The number of thumbnails and icons to keep in the cache. The thumbnail cache size also
         determines how many thumbnails will be fetched in the background. -->
    <integer name="recentsThumbnailCacheSize">3</integer>
+36 −0
Original line number Diff line number Diff line
package com.android.quickstep;

import android.content.Context;
import android.os.Bundle;

import com.android.launcher3.testing.TestInformationHandler;
import com.android.launcher3.testing.TestProtocol;
import com.android.launcher3.uioverrides.states.OverviewState;
import com.android.quickstep.util.LayoutUtils;

public class QuickstepTestInformationHandler extends TestInformationHandler {

    public QuickstepTestInformationHandler(Context context) { }

    @Override
    public Bundle call(String method) {
        final Bundle response = new Bundle();
        switch (method) {
            case TestProtocol.REQUEST_HOME_TO_OVERVIEW_SWIPE_HEIGHT: {
                final float swipeHeight =
                        OverviewState.getDefaultSwipeHeight(mDeviceProfile);
                response.putInt(TestProtocol.TEST_INFO_RESPONSE_FIELD, (int) swipeHeight);
                return response;
            }

            case TestProtocol.REQUEST_BACKGROUND_TO_OVERVIEW_SWIPE_HEIGHT: {
                final float swipeHeight =
                        LayoutUtils.getShelfTrackingDistance(mContext, mDeviceProfile);
                response.putInt(TestProtocol.TEST_INFO_RESPONSE_FIELD, (int) swipeHeight);
                return response;
            }
        }

        return super.call(method);
    }
}
Loading