Skip to content

Commit 2fda6fa

Browse files
committed
Revert 'android-interop-testing: Remove usage of MultiDexApplication' and 'core: Wait for backoff timer on address update in pick_first'
1 parent 9dfa829 commit 2fda6fa

7 files changed

Lines changed: 14 additions & 11 deletions

File tree

android-interop-testing/build.gradle

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,15 @@ android {
3333

3434
defaultConfig {
3535
applicationId "io.grpc.android.integrationtest"
36-
minSdkVersion 23
36+
// Held back to 20 as Gradle fails to build at the 21 level. This is
37+
// presumably a Gradle bug that can be revisited later.
38+
// Maybe this issue: https://github.com/gradle/gradle/issues/20778
39+
minSdkVersion 20
3740
targetSdkVersion 33
3841
versionCode 1
3942
versionName "1.0"
4043
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
44+
multiDexEnabled = true
4145
}
4246
buildTypes {
4347
debug { minifyEnabled false }
@@ -58,11 +62,11 @@ android {
5862

5963
dependencies {
6064
implementation 'androidx.appcompat:appcompat:1.3.0'
65+
implementation 'androidx.multidex:multidex:2.0.0'
6166
implementation libraries.androidx.annotation
6267
implementation 'com.google.android.gms:play-services-base:18.0.1'
6368

6469
implementation project(':grpc-android'),
65-
project(':grpc-api'),
6670
project(':grpc-core'),
6771
project(':grpc-census'),
6872
project(':grpc-okhttp'),

android-interop-testing/src/androidTest/AndroidManifest.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
android:name="androidx.test.runner.AndroidJUnitRunner"
66
android:targetPackage="io.grpc.android.integrationtest" />
77

8-
<application>
8+
<application
9+
android:name="android.support.multidex.MultiDexApplication" >
910
</application>
1011

1112
</manifest>

android-interop-testing/src/main/AndroidManifest.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
android:allowBackup="true"
1515
android:icon="@mipmap/ic_launcher"
1616
android:label="@string/app_name"
17-
android:theme="@style/Base.V7.Theme.AppCompat.Light">
17+
android:theme="@style/Base.V7.Theme.AppCompat.Light"
18+
android:name="androidx.multidex.MultiDexApplication">
1819
<activity
1920
android:name=".TesterActivity"
2021
android:exported="true">

binder/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ android {
1818
versionCode 1
1919
versionName "1.0"
2020
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
21+
multiDexEnabled = true
2122
}
2223
lintOptions { abortOnError = false }
2324
publishing {

core/src/main/java/io/grpc/internal/PickFirstLeafLoadBalancer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ private void shutdownRemaining(SubchannelData activeSubchannelData) {
496496
*/
497497
@Override
498498
public void requestConnection() {
499-
if (!addressIndex.isValid() || rawConnectivityState == SHUTDOWN || reconnectTask != null) {
499+
if (!addressIndex.isValid() || rawConnectivityState == SHUTDOWN) {
500500
return;
501501
}
502502

core/src/test/java/io/grpc/internal/PickFirstLeafLoadBalancerTest.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1446,11 +1446,6 @@ public void updateAddresses_disjoint_transient_failure() {
14461446
loadBalancer.acceptResolvedAddresses(
14471447
ResolvedAddresses.newBuilder().setAddresses(newServers).setAttributes(affinity).build());
14481448

1449-
if (serializeRetries) {
1450-
inOrder.verify(mockSubchannel3, never()).start(stateListenerCaptor.capture());
1451-
forwardTimeByBackoffDelay();
1452-
}
1453-
14541449
// subchannel 3 still attempts a connection even though we stay in transient failure
14551450
assertEquals(TRANSIENT_FAILURE, loadBalancer.getConcludedConnectivityState());
14561451
inOrder.verify(mockSubchannel3).start(stateListenerCaptor.capture());

examples/android/clientcache/app/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ android {
1010

1111
defaultConfig {
1212
applicationId "io.grpc.clientcacheexample"
13-
minSdkVersion 23
13+
minSdkVersion 21
1414
targetSdkVersion 33
15+
multiDexEnabled true
1516
versionCode 1
1617
versionName "1.0"
1718
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

0 commit comments

Comments
 (0)