Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build_extensions/AndroidManifest_robolectric.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
package="androidx.test.robolectric" >

<uses-sdk
android:minSdkVersion="23"
android:minSdkVersion="24"
android:targetSdkVersion="33" />

</manifest>
2 changes: 1 addition & 1 deletion build_extensions/AndroidManifest_target_stub.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
package="${applicationId}" >

<uses-sdk
android:minSdkVersion="23"
android:minSdkVersion="24"
android:targetSdkVersion="34" />

</manifest>
2 changes: 1 addition & 1 deletion core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

**API Changes**

* Update to minSdkVersion 23 and remove all related logic for SDKs < 23
* Update to minSdkVersion 24 and remove all related logic for SDKs < 24

**Breaking API Changes**

Expand Down
2 changes: 1 addition & 1 deletion core/java/androidx/test/core/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
package="androidx.test.core" >

<uses-sdk
android:minSdkVersion="23"
android:minSdkVersion="24"
android:targetSdkVersion="28" />

<uses-permission android:name="android.permission.REORDER_TASKS" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
package="androidx.test.core.app" >

<uses-sdk
android:minSdkVersion="23"
android:minSdkVersion="24"
android:targetSdkVersion="34" />

<application >
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
package="androidx.test.core.app.test" >

<uses-sdk
android:minSdkVersion="23"
android:minSdkVersion="24"
android:targetSdkVersion="34" />

<application/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns:android="http://schemas.android.com/apk/res/android"
package="androidx.test.core.app.testing">
<uses-sdk
android:minSdkVersion="23"/>
android:minSdkVersion="24"/>
<application>
<activity
android:name=".RecreationRecordingActivity"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns:android="http://schemas.android.com/apk/res/android"
package="androidx.test.core.app.testing">
<uses-sdk
android:minSdkVersion="23"/>
android:minSdkVersion="24"/>
<application>
</application>
</manifest>
2 changes: 1 addition & 1 deletion espresso/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ The following artifacts were released:

**API Changes**

* Update to minSdkVersion 23 and remove all related logic for SDKs < 23
* Update to minSdkVersion 24 and remove all related logic for SDKs < 24

**Breaking API Changes**

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
package="androidx.test.espresso.accessibility" >

<uses-sdk
android:minSdkVersion="23"
android:minSdkVersion="24"
android:targetSdkVersion="34" />

<application />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
package="androidx.test.espresso.contrib" >

<uses-sdk
android:minSdkVersion="23"
android:minSdkVersion="24"
android:targetSdkVersion="34" />

<application />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
package="androidx.test.espresso.core" >

<uses-sdk
android:minSdkVersion="23"
android:minSdkVersion="24"
android:targetSdkVersion="34" />

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public static void waitForConfigurationChangesOnActivity(
Activity currentActivity, UiController uiController, Context appContext) {
// The activity's orientation can differ from application's orientation when the activity is in
// multi-window mode.
if (Build.VERSION.SDK_INT >= 24 && currentActivity.isInMultiWindowMode()) {
if (currentActivity.isInMultiWindowMode()) {
return;
}
// If the application is running activities in different processes, activities that aren't
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

/**
* An {@link EventInjectionStrategy} that uses the input manager to inject Events. This strategy
* supports API level 23 and above.
* supports API level 24 and above.
*/
final class InputManagerEventInjectionStrategy implements EventInjectionStrategy {
private static final String TAG = "EventInjectionStrategy";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import static org.hamcrest.Matchers.is;

import android.app.Activity;
import android.os.Build;
import android.os.IBinder;
import android.util.Log;
import android.view.View;
Expand Down Expand Up @@ -226,19 +225,13 @@ public IsPlatformPopup() {}

@Override
public boolean matchesSafely(Root item) {
String popupClassName = "android.widget.PopupWindow$PopupViewContainer";
if (Build.VERSION.SDK_INT >= 23) {
popupClassName = "android.widget.PopupWindow$PopupDecorView";
}
String popupClassName = "android.widget.PopupWindow$PopupDecorView";
return withDecorView(withClassName(is(popupClassName))).matches(item);
}

@Override
public void describeTo(Description description) {
String popupClassName = "PopupWindow$PopupViewContainer";
if (Build.VERSION.SDK_INT >= 23) {
popupClassName = "PopupWindow$PopupDecorView";
}
String popupClassName = "PopupWindow$PopupDecorView";
description.appendText("with decor view of type " + popupClassName);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
package="androidx.test.espresso.remote" >

<uses-sdk
android:minSdkVersion="23"
android:minSdkVersion="24"
android:targetSdkVersion="34" />

<application />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
package="androidx.test.espresso.action" >

<uses-sdk
android:minSdkVersion="23"
android:minSdkVersion="24"
android:targetSdkVersion="34" />

<application/>
Expand Down
2 changes: 1 addition & 1 deletion espresso/device/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

**API Changes**

* Update to minSdkVersion 23 and remove all related logic for SDKs < 23
* Update to minSdkVersion 24 and remove all related logic for SDKs < 24

**Breaking API Changes**

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<uses-permission android:name="android.permission.INTERNET"/>

<uses-sdk
android:minSdkVersion="23"
android:minSdkVersion="24"
android:targetSdkVersion="34" />

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@

package androidx.test.espresso.device.common

import android.os.Build
import android.os.Handler
import android.os.HandlerThread
import android.provider.Settings
import androidx.annotation.RequiresApi
import androidx.annotation.RestrictTo
import androidx.test.platform.app.InstrumentationRegistry
import java.util.concurrent.CountDownLatch
Expand All @@ -34,15 +32,14 @@ fun getAccelerometerRotationSetting(): AccelerometerRotation =
Settings.System.getInt(
InstrumentationRegistry.getInstrumentation().getTargetContext().getContentResolver(),
Settings.System.ACCELEROMETER_ROTATION,
0
0,
) == 1
) {
AccelerometerRotation.ENABLED
} else {
AccelerometerRotation.DISABLED
}

@RequiresApi(Build.VERSION_CODES.LOLLIPOP)
@RestrictTo(RestrictTo.Scope.LIBRARY)
fun setAccelerometerRotationSetting(accelerometerRotation: AccelerometerRotation) {
val context = InstrumentationRegistry.getInstrumentation().getTargetContext()
Expand All @@ -55,7 +52,7 @@ fun setAccelerometerRotationSetting(accelerometerRotation: AccelerometerRotation
runnableHandler,
context,
settingsLatch,
Settings.System.ACCELEROMETER_ROTATION
Settings.System.ACCELEROMETER_ROTATION,
)
settingsObserver.observe()
executeShellCommand("settings put system accelerometer_rotation ${accelerometerRotation.value}")
Expand All @@ -67,5 +64,5 @@ fun setAccelerometerRotationSetting(accelerometerRotation: AccelerometerRotation
@RestrictTo(RestrictTo.Scope.LIBRARY)
enum class AccelerometerRotation(val value: Int) {
DISABLED(0),
ENABLED(1)
ENABLED(1),
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
package androidx.test.espresso.device.common

import android.os.Build
import androidx.annotation.RequiresApi
import androidx.annotation.RestrictTo
import java.util.regex.Pattern

Expand Down Expand Up @@ -118,7 +117,6 @@ fun getMapOfDeviceStateNamesToIdentifiers(): MutableMap<String, String> {
*
* @hide
*/
@RequiresApi(Build.VERSION_CODES.LOLLIPOP)
@RestrictTo(RestrictTo.Scope.LIBRARY)
fun calculateCurrentDisplayWidthAndHeightPx(): Pair<Int, Int> {
// "wm size" will output a string with the format
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@

package androidx.test.espresso.device.common

import android.os.Build
import android.os.ParcelFileDescriptor.AutoCloseInputStream
import androidx.annotation.RequiresApi
import androidx.annotation.RestrictTo
import androidx.annotation.RestrictTo.Scope
import androidx.test.platform.app.InstrumentationRegistry
Expand All @@ -36,7 +34,6 @@ import java.nio.charset.Charset
* @hide
*/
@RestrictTo(Scope.LIBRARY)
@RequiresApi(Build.VERSION_CODES.LOLLIPOP)
fun executeShellCommand(command: String): String {
val parcelFileDescriptor =
InstrumentationRegistry.getInstrumentation().getUiAutomation().executeShellCommand(command)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
package="androidx.test.espresso.idling.concurrent" >

<uses-sdk
android:minSdkVersion="23"
android:minSdkVersion="24"
android:targetSdkVersion="34" />

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
package="androidx.test.espresso.idling.concurrent"
xmlns:android="http://schemas.android.com/apk/res/android">

<uses-sdk android:minSdkVersion="23" android:targetSdkVersion="30"/>
<uses-sdk android:minSdkVersion="24" android:targetSdkVersion="30"/>

<application />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
package="androidx.test.espresso.idling.resource" >

<uses-sdk
android:minSdkVersion="23"
android:minSdkVersion="24"
android:targetSdkVersion="34" />

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
package="androidx.test.espresso.idling.net" >

<uses-sdk
android:minSdkVersion="23"
android:minSdkVersion="24"
android:targetSdkVersion="34" />
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
package="androidx.test.espresso.intent" >

<uses-sdk
android:minSdkVersion="23"
android:minSdkVersion="24"
android:targetSdkVersion="34" />

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
package="androidx.test.espresso.intents">

<uses-sdk
android:minSdkVersion="23"
android:minSdkVersion="24"
android:targetSdkVersion="34"/>

<uses-permission android:name="android.permission.CALL_PHONE"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import androidx.test.espresso.intent.rule.IntentsTestRule;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.LargeTest;
Expand Down Expand Up @@ -156,12 +155,7 @@ public void recordsIntentsOnlyAfterInit() {

@Test
public void intentScheme() {
String dialerPackage = "com.android.phone";

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
// Starting with Android Lollipop the dialer package has changed.
dialerPackage = "com.android.server.telecom";
}
String dialerPackage = "com.android.server.telecom";

// Testing Scheme "tel:xxx-xxx-xxxx"
onView(withId(R.id.send_data_to_call_edit_text))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
package="androidx.test.espresso.remote" >

<uses-sdk
android:minSdkVersion="23"
android:minSdkVersion="24"
android:targetSdkVersion="34" />

<application />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
package="androidx.test.espresso.web" >

<uses-sdk
android:minSdkVersion="23"
android:minSdkVersion="24"
android:targetSdkVersion="34" />

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import static androidx.test.internal.util.Checks.checkNotNull;
import static androidx.test.internal.util.Checks.checkState;

import android.os.Build;
import android.os.Bundle;
import android.os.IBinder;
import android.os.Looper;
Expand Down Expand Up @@ -113,7 +112,7 @@ public String getDescription() {
@Override
public void perform(UiController uiController, View view) {
WebView webView = (WebView) view;
if (Build.VERSION.SDK_INT >= 23 && !webView.isHardwareAccelerated()) {
if (!webView.isHardwareAccelerated()) {
throw new PerformException.Builder()
.withViewDescription(webView.toString())
.withCause(
Expand All @@ -124,16 +123,6 @@ public void perform(UiController uiController, View view) {
String script = checkNotNull(atom.getScript());
final ListenableFuture<Evaluation> localEval =
JavascriptEvaluation.evaluate(webView, script, arguments, window);
if (null != window && Build.VERSION.SDK_INT == 19) {
Log.w(
TAG,
"WARNING: KitKat does not report when an iframe is loading new content. "
+ "If you are interacting with content within an iframe and that content is changing "
+ "(eg: you have just pressed a submit button). Espresso will not be able to block "
+ "you until the new content has loaded (which it can do on all other API levels). "
+ "You will need to have some custom polling / synchronization with the iframe in "
+ "that case.");
}

localEval.addListener(
new Runnable() {
Expand Down
Loading
Loading