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

Commit d082129e authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Switching swipe-up to overview to using test info provider" into ub-launcher3-master

parents f1d72926 d64b4f44
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -152,14 +152,6 @@
            android:writePermission="${packageName}.permission.WRITE_SETTINGS"
            android:readPermission="${packageName}.permission.READ_SETTINGS" />

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

        <!--
        The content provider for exposing various launcher grid options.
        TODO: Enable when all apps columns are correct
+4 −2
Original line number Diff line number Diff line
@@ -84,9 +84,11 @@ public class OverviewState extends LauncherState {
        super.onBackPressed(launcher);
    }


    public static float getDefaultSwipeHeight(Launcher launcher) {
        DeviceProfile dp = launcher.getDeviceProfile();
        return getDefaultSwipeHeight(launcher.getDeviceProfile());
    }

    public static float getDefaultSwipeHeight(DeviceProfile dp) {
        return dp.allAppsCellHeightPx - dp.allAppsIconTextSizePx;
    }
}
+8 −0
Original line number Diff line number Diff line
@@ -73,6 +73,14 @@
            </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" />
+5 −1
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ import android.view.View;

import com.android.launcher3.AbstractFloatingView;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.InvariantDeviceProfile;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherState;
import com.android.launcher3.R;
@@ -132,7 +133,10 @@ public class OverviewState extends LauncherState {
    }

    public static float getDefaultSwipeHeight(Launcher launcher) {
        DeviceProfile dp = launcher.getDeviceProfile();
        return getDefaultSwipeHeight(launcher.getDeviceProfile());
    }

    public static float getDefaultSwipeHeight(DeviceProfile dp) {
        return dp.allAppsCellHeightPx - dp.allAppsIconTextSizePx;
    }

+28 −4
Original line number Diff line number Diff line
@@ -14,14 +14,22 @@
 * limitations under the License.
 */

package com.android.launcher3;
package com.android.quickstep;

import android.content.ContentProvider;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;

import com.android.launcher3.DeviceProfile;
import com.android.launcher3.InvariantDeviceProfile;
import com.android.launcher3.TestProtocol;
import com.android.launcher3.Utilities;
import com.android.launcher3.uioverrides.OverviewState;
import com.android.quickstep.util.LayoutUtils;

public class TestInformationProvider extends ContentProvider {
    @Override
    public boolean onCreate() {
@@ -55,10 +63,26 @@ public class TestInformationProvider extends ContentProvider {

    @Override
    public Bundle call(String method, String arg, Bundle extras) {
        if (TestProtocol.IS_TEST_INFO_ENABLED.equals(method)) {
        if (Utilities.IS_RUNNING_IN_TEST_HARNESS) {
            final Bundle response = new Bundle();
            response.putBoolean(TestProtocol.TEST_INFO_RESPONSE_FIELD,
                    Utilities.IS_RUNNING_IN_TEST_HARNESS);
            final Context context = getContext();
            final DeviceProfile deviceProfile = InvariantDeviceProfile.INSTANCE.
                    get(context).getDeviceProfile(context);

            switch (method) {
                case TestProtocol.REQUEST_HOME_TO_OVERVIEW_SWIPE_HEIGHT: {
                    final float swipeHeight =
                            OverviewState.getDefaultSwipeHeight(deviceProfile);
                    response.putInt(TestProtocol.TEST_INFO_RESPONSE_FIELD, (int) swipeHeight);
                    break;
                }
                case TestProtocol.REQUEST_BACKGROUND_TO_OVERVIEW_SWIPE_HEIGHT: {
                    final float swipeHeight =
                            LayoutUtils.getShelfTrackingDistance(context, deviceProfile);
                    response.putInt(TestProtocol.TEST_INFO_RESPONSE_FIELD, (int) swipeHeight);
                    break;
                }
            }
            return response;
        }
        return null;
Loading