Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated compileSdkVersion from 31 to 33, Robolectric to 4.9 and updated AGP patch version #895

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ Rebecka Gulliksson <[email protected]>
Rahul Ravikumar <[email protected]>
Henning Nielsen Lund <[email protected]>
Øyvind Robertsen <[email protected]>
Alix Warnke <[email protected]>
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.1'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

11-

classpath 'com.android.tools.build:gradle:4.2.2'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+11 to ÷11

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good

classpath 'org.ajoberstar.grgit:grgit-gradle:4.1.1'
classpath 'org.jacoco:org.jacoco.core:0.8.7'
}
Expand Down Expand Up @@ -41,7 +41,7 @@ try {

project.ext {
minSdkVersion = 16
compileSdkVersion = 31
compileSdkVersion = 33

googleVersions = [
glide : '4.12.0',
Expand Down
2 changes: 1 addition & 1 deletion config/testdeps.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.hamcrest:hamcrest:2.2'
testImplementation 'org.mockito:mockito-core:3.10.0'
testImplementation 'org.robolectric:robolectric:4.5.1'
testImplementation 'org.robolectric:robolectric:4.9'
testImplementation 'org.assertj:assertj-core:3.19.0'
testImplementation 'androidx.test.ext:junit:1.1.3'
testImplementation 'androidx.test.ext:truth:1.3.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import androidx.annotation.VisibleForTesting;
import androidx.appcompat.app.AppCompatActivity;
Expand Down Expand Up @@ -309,10 +310,16 @@ private void extractState(Bundle state) {
return;
}

mAuthIntent = state.getParcelable(KEY_AUTH_INTENT);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
mAuthIntent = state.getParcelable(KEY_AUTH_INTENT, Intent.class);
mCompleteIntent = state.getParcelable(KEY_COMPLETE_INTENT, PendingIntent.class);
mCancelIntent = state.getParcelable(KEY_CANCEL_INTENT, PendingIntent.class);
} else {
mAuthIntent = state.getParcelable(KEY_AUTH_INTENT);
mCompleteIntent = state.getParcelable(KEY_COMPLETE_INTENT);
mCancelIntent = state.getParcelable(KEY_CANCEL_INTENT);
}
mAuthorizationStarted = state.getBoolean(KEY_AUTHORIZATION_STARTED, false);
mCompleteIntent = state.getParcelable(KEY_COMPLETE_INTENT);
mCancelIntent = state.getParcelable(KEY_CANCEL_INTENT);
try {
String authRequestJson = state.getString(KEY_AUTH_REQUEST, null);
String authRequestType = state.getString(KEY_AUTH_REQUEST_TYPE, null);
Expand Down
4 changes: 2 additions & 2 deletions library/java/net/openid/appauth/browser/BrowserSelector.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ public static List<BrowserDescriptor> getAllBrowsers(Context context) {
try {
int defaultBrowserIndex = 0;
PackageInfo packageInfo = pm.getPackageInfo(
info.activityInfo.packageName,
PackageManager.GET_SIGNATURES);
info.activityInfo.packageName, VERSION.SDK_INT >= VERSION_CODES.P
? PackageManager.GET_SIGNING_CERTIFICATES : PackageManager.GET_SIGNATURES);

if (hasWarmupService(pm, info.activityInfo.packageName)) {
BrowserDescriptor customTabBrowserDescriptor =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import android.net.Uri;
import androidx.annotation.ColorInt;
import androidx.annotation.Nullable;
import androidx.browser.customtabs.CustomTabColorSchemeParams;
import androidx.browser.customtabs.CustomTabsClient;
import androidx.browser.customtabs.CustomTabsIntent;
import androidx.browser.customtabs.CustomTabsServiceConnection;
Expand Down Expand Up @@ -208,7 +209,8 @@ public void testAuthorizationRequest_withDefaultRandomStateAndNonce() throws Exc
@Test
public void testAuthorizationRequest_customization() throws Exception {
CustomTabsIntent customTabsIntent = new CustomTabsIntent.Builder()
.setToolbarColor(Color.GREEN)
.setDefaultColorSchemeParams(new CustomTabColorSchemeParams.Builder()
.setToolbarColor(Color.GREEN).build())
.build();
mService.performAuthorizationRequest(
getTestAuthRequestBuilder().build(),
Expand Down
2 changes: 1 addition & 1 deletion library/javatests/net/openid/appauth/JsonUtilTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
public class JsonUtilTest {
private static final String TEST_KEY = "key";
private static final String TEST_STRING = "value";
private static final Long TEST_LONG = new Long(123);
private static final Long TEST_LONG = 123L;
private static final String TEST_URI_STRING = "https://openid.net/";
private static final Uri TEST_URI = Uri.parse(TEST_URI_STRING);
private static final JSONObject TEST_JSON = new JSONObject();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.pm.ResolveInfo;
import android.content.pm.Signature;
import android.os.Build;
import android.text.TextUtils;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
Expand Down Expand Up @@ -313,9 +314,10 @@ private void setBrowserList(TestBrowser... browsers) throws NameNotFoundExceptio

for (TestBrowser browser : browsers) {
when(mPackageManager.getPackageInfo(
eq(browser.mPackageInfo.packageName),
eq(PackageManager.GET_SIGNATURES)))
.thenReturn(browser.mPackageInfo);
eq(browser.mPackageInfo.packageName),
Build.VERSION.SDK_INT >= Build.VERSION_CODES.P
? eq(PackageManager.GET_SIGNING_CERTIFICATES) : eq(PackageManager.GET_SIGNATURES)
)).thenReturn(browser.mPackageInfo);
resolveInfos.add(browser.mResolveInfo);
}

Expand Down