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

Commit cb4f9b8d authored by Ming-Shin Lu's avatar Ming-Shin Lu Committed by Automerger Merge Worker
Browse files

Merge "TAPL: add setIgnoreTaskbarVisibility in LauncherInstrumentation" into...

Merge "TAPL: add setIgnoreTaskbarVisibility in LauncherInstrumentation" into tm-qpr-dev am: 8ff85dc7 am: 6013ab37

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/20064292



Change-Id: I6aaeb6efe4af83a5c8621cceb3154be4d53be58c
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents b2d7f05b 6013ab37
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -311,6 +311,28 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest {
        launchedAppState.switchToOverview();
    }

    @Test
    @ScreenRecord // b/242163205
    public void testQuickSwitchToPreviousAppForTablet() throws Exception {
        assumeTrue(mLauncher.isTablet());
        startTestActivity(2);
        startImeTestActivity();

        // Set ignoreTaskbarVisibility to true to verify the task bar visibility explicitly.
        mLauncher.setIgnoreTaskbarVisibility(true);

        // Expect task bar invisible when the launched app was the IME activity.
        LaunchedAppState launchedAppState = getAndAssertLaunchedApp();
        launchedAppState.assertTaskbarHidden();

        // Quick-switch to the test app with swiping to right.
        launchedAppState.quickSwitchToPreviousApp();

        // Expect task bar visible when the launched app was the test activity.
        launchedAppState = getAndAssertLaunchedApp();
        launchedAppState.assertTaskbarVisible();
    }

    private boolean isTestActivityRunning(int activityNumber) {
        return mDevice.wait(Until.hasObject(By.pkg(getAppPackageName())
                        .text("TestActivity" + activityNumber)),
+1 −0
Original line number Diff line number Diff line
@@ -60,6 +60,7 @@ filegroup {
      "src/com/android/launcher3/testcomponent/CustomShortcutConfigActivity.java",
      "src/com/android/launcher3/testcomponent/TestCommandReceiver.java",
      "src/com/android/launcher3/testcomponent/TestLauncherActivity.java",
      "src/com/android/launcher3/testcomponent/ImeTestActivity.java",
    ],
}

+10 −0
Original line number Diff line number Diff line
@@ -277,6 +277,16 @@
            </intent-filter>
        </activity-alias>

        <activity android:name="com.android.launcher3.testcomponent.ImeTestActivity"
            android:label="ImeTestActivity"
            android:icon="@drawable/test_theme_icon"
            android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <!-- [b/197780098] Disable eager initialization of Jetpack libraries. -->
        <provider
            android:name="androidx.startup.InitializationProvider"
+16 −0
Original line number Diff line number Diff line
@@ -24,7 +24,9 @@ import android.graphics.Color;
import android.os.Bundle;
import android.util.TypedValue;
import android.view.View;
import android.view.WindowInsets;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;

@@ -81,6 +83,20 @@ public class BaseTestingActivity extends Activity implements View.OnClickListene
        mView.addView(button, lp);
    }

    protected void addEditor(String initText, String hint, boolean requestIme) {
        EditText editText = new EditText(this);
        editText.setHint(hint);
        editText.setText(initText);

        LayoutParams lp = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
        lp.bottomMargin = mMargin;
        mView.addView(editText, lp);
        if (requestIme) {
            editText.requestFocus();
            mView.getWindowInsetsController().show(WindowInsets.Type.ime());
        }
    }

    @Override
    protected void onResume() {
        super.onResume();
+27 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2022 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.android.launcher3.testcomponent;

import android.os.Bundle;

public class ImeTestActivity extends OtherBaseTestingActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // Requests to focus an editor and show IME for test.
        addEditor("Focused editor for test", "Focused editor for test", true);
    }
}
Loading