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

Upgrade Android SDK to 34 "UpsideDownCake" #47609

Merged
merged 33 commits into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
ddfd6be
Test pointing at my fork before landing that change
gmackall Nov 2, 2023
e702da6
Update test_runner build.gradle to use minsdk 19 and compilesdk 34
gmackall Nov 2, 2023
af88787
Update build.gradle
gmackall Nov 2, 2023
a7b56ab
Update build.gradle
gmackall Nov 2, 2023
c0f4955
Update main.dart
gmackall Nov 2, 2023
5a8a8fe
Update project.xml
gmackall Nov 2, 2023
d5ea6e8
Update packages.txt
gmackall Nov 2, 2023
3df6f17
Update build.gradle
gmackall Nov 2, 2023
17da919
Update gen_javadoc.py
gmackall Nov 2, 2023
ca10998
Merge branch 'main' into upgrade_to_android14
gmackall Nov 2, 2023
2821a43
Merge branch 'main' into upgrade_to_android14
gmackall Nov 2, 2023
d6aebb6
Merge branch 'main' into upgrade_to_android14
gmackall Nov 2, 2023
f3f3eee
Merge branch 'main' into upgrade_to_android14
gmackall Nov 2, 2023
8d3a65f
Update DEPS
gmackall Nov 2, 2023
1f6123f
Update DEPS
gmackall Nov 2, 2023
6a8b646
Update DEPS
gmackall Nov 2, 2023
af3ce86
Try undoing to isolate where failure is coming from
gmackall Nov 3, 2023
4c37722
revert back
gmackall Nov 6, 2023
971a6cf
Point towards newest commit in the buildroot repo
gmackall Nov 6, 2023
9eb714e
34v2->34v3
gmackall Nov 7, 2023
231f261
stop testing jelly_bean
Nov 7, 2023
7a2dbba
Merge remote-tracking branch 'refs/remotes/origin/upgrade_to_android1…
Nov 7, 2023
0473938
undo change to cipd package creation script
Nov 7, 2023
286489c
some missed jelly_bean tests
Nov 7, 2023
7cc375b
try out java 17 on a whim
Nov 7, 2023
910eef6
do as the linter commands
Nov 8, 2023
2a87a97
yield to the bots round 2 (do as the formatter commands)
Nov 8, 2023
994cf9d
format
Nov 8, 2023
0ba27dd
catch error and initialize to null
Nov 8, 2023
38556e2
format
Nov 8, 2023
18bc650
undo change to close file descriptor and remake baseline
Nov 8, 2023
a6765b4
format
Nov 8, 2023
c0043e8
Update DEPS
gmackall Nov 8, 2023
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
6 changes: 3 additions & 3 deletions .ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ platform_properties:
# CIPD flutter/java/openjdk/$platform
dependencies: >-
[
{"dependency": "open_jdk", "version": "version:11"},
{"dependency": "open_jdk", "version": "version:17"},
{"dependency": "gradle_cache", "version": "none"}
]
device_type: none
Expand All @@ -49,7 +49,7 @@ platform_properties:
# CIPD flutter/java/openjdk/$platform
dependencies: >-
[
{"dependency": "open_jdk", "version": "version:11"}
{"dependency": "open_jdk", "version": "version:17"}
]
device_type: none
cpu: x86
Expand All @@ -76,7 +76,7 @@ platform_properties:
# CIPD flutter/java/openjdk/$platform
dependencies: >-
[
{"dependency": "open_jdk", "version": "version:11"}
{"dependency": "open_jdk", "version": "version:17"}
]
device_type: none
os: Windows-10
Expand Down
6 changes: 3 additions & 3 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ allowed_hosts = [
]

deps = {
'src': 'https://github.com/flutter/buildroot.git' + '@' + '5ced4367fee2721f6eda34802dc28b1335637c63',
'src': 'https://github.com/flutter/buildroot.git' + '@' + '44ca359ea6fada2fa1bb007b81994fa4dc8ce2ec',

'src/flutter/third_party/rapidjson':
Var('fuchsia_git') + '/third_party/rapidjson' + '@' + 'ef3564c5c8824989393b87df25355baf35ff544b',
Expand Down Expand Up @@ -719,7 +719,7 @@ deps = {
'packages': [
{
'package': 'flutter/android/sdk/all/${{platform}}',
'version': 'version:33v6'
'version': 'version:34v3'
}
],
'condition': 'download_android_deps',
Expand Down Expand Up @@ -751,7 +751,7 @@ deps = {
'packages': [
{
'package': 'flutter/java/openjdk/${{platform}}',
'version': 'version:11'
'version': 'version:17'
}
],
'condition': 'download_android_deps',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ public FlutterView(@NonNull Context context, @NonNull RenderMode renderMode) {
renderSurface = flutterTextureView;
} else {
throw new IllegalArgumentException(
String.format("RenderMode not supported with this constructor: %s", renderMode));
"RenderMode not supported with this constructor: " + renderMode);
}

init();
Expand Down Expand Up @@ -327,7 +327,7 @@ public FlutterView(
renderSurface = flutterTextureView;
} else {
throw new IllegalArgumentException(
String.format("RenderMode not supported with this constructor: %s", renderMode));
"RenderMode not supported with this constructor: " + renderMode);
}

init();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,17 +330,17 @@ public void installDeferredComponent(int loadingUnitId, @Nullable String compone
case SplitInstallErrorCode.NETWORK_ERROR:
flutterJNI.deferredComponentInstallFailure(
loadingUnitId,
String.format(
"Install of deferred component module \"%s\" failed with a network error",
componentName),
"Install of deferred component module \""
+ componentName
+ "\" failed with a network error",
true);
break;
case SplitInstallErrorCode.MODULE_UNAVAILABLE:
flutterJNI.deferredComponentInstallFailure(
loadingUnitId,
String.format(
"Install of deferred component module \"%s\" failed as it is unavailable",
componentName),
"Install of deferred component module \""
+ componentName
+ "\" failed as it is unavailable",
false);
break;
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
* EmbeddedView
*/
@Keep
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
@TargetApi(Build.VERSION_CODES.KITKAT)
class SingleViewPresentation extends Presentation {
private static final String TAG = "PlatformViewsController";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ public void itReleaseEngineWhenOnDestroy() {
}

@Test
@Config(minSdk = Build.VERSION_CODES.JELLY_BEAN, maxSdk = Build.VERSION_CODES.P)
@Config(minSdk = Build.VERSION_CODES.KITKAT, maxSdk = Build.VERSION_CODES.P)
public void fullyDrawn_beforeAndroidQ() {
Intent intent = FlutterActivityWithReportFullyDrawn.createDefaultIntent(ctx);
ActivityController<FlutterActivityWithReportFullyDrawn> activityController =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ public void computePlatformResolvedLocale_fromAndroidN() {
// Tests the legacy pre API 24 algorithm.
@Test
@Config(
minSdk = Build.VERSION_CODES.JELLY_BEAN,
minSdk = Build.VERSION_CODES.KITKAT,
maxSdk = Build.VERSION_CODES.M,
qualifiers = "es-rMX")
public void computePlatformResolvedLocale_emptySupportedLocales_beforeAndroidN() {
Expand All @@ -252,7 +252,7 @@ public void computePlatformResolvedLocale_emptySupportedLocales_beforeAndroidN()
}

@Test
@Config(minSdk = Build.VERSION_CODES.JELLY_BEAN, maxSdk = Build.VERSION_CODES.M, qualifiers = "")
@Config(minSdk = Build.VERSION_CODES.KITKAT, maxSdk = Build.VERSION_CODES.M, qualifiers = "")
public void computePlatformResolvedLocale_selectFirstLocaleWhenNoUserSetting_beforeAndroidN() {
FlutterJNI flutterJNI = new FlutterJNI();
DartExecutor dartExecutor = mock(DartExecutor.class);
Expand All @@ -273,7 +273,7 @@ public void computePlatformResolvedLocale_selectFirstLocaleWhenNoUserSetting_bef

@Test
@Config(
minSdk = Build.VERSION_CODES.JELLY_BEAN,
minSdk = Build.VERSION_CODES.KITKAT,
maxSdk = Build.VERSION_CODES.M,
qualifiers = "fr-rCH")
public void computePlatformResolvedLocale_selectFirstLocaleWhenNoExactMatch_beforeAndroidN() {
Expand All @@ -299,7 +299,7 @@ public void computePlatformResolvedLocale_selectFirstLocaleWhenNoExactMatch_befo

@Test
@Config(
minSdk = Build.VERSION_CODES.JELLY_BEAN,
minSdk = Build.VERSION_CODES.KITKAT,
maxSdk = Build.VERSION_CODES.M,
qualifiers = "it-rIT")
public void computePlatformResolvedLocale_selectExactMatchLocale_beforeAndroidN() {
Expand All @@ -325,7 +325,7 @@ public void computePlatformResolvedLocale_selectExactMatchLocale_beforeAndroidN(

@Test
@Config(
minSdk = Build.VERSION_CODES.JELLY_BEAN,
minSdk = Build.VERSION_CODES.KITKAT,
maxSdk = Build.VERSION_CODES.M,
qualifiers = "fr-rCH")
public void computePlatformResolvedLocale_selectOnlyLanguageLocale_beforeAndroidN() {
Expand All @@ -351,35 +351,35 @@ public void computePlatformResolvedLocale_selectOnlyLanguageLocale_beforeAndroid
}

// Tests the legacy pre API 21 algorithm.
@Config(sdk = 16)
@Config(sdk = Build.VERSION_CODES.KITKAT)
@Test
public void localeFromString_languageOnly() {
Locale locale = LocalizationPlugin.localeFromString("en");
assertEquals(locale, new Locale("en"));
}

@Config(sdk = 16)
@Config(sdk = Build.VERSION_CODES.KITKAT)
@Test
public void localeFromString_languageAndCountry() {
Locale locale = LocalizationPlugin.localeFromString("en-US");
assertEquals(locale, new Locale("en", "US"));
}

@Config(sdk = 16)
@Config(sdk = Build.VERSION_CODES.KITKAT)
@Test
public void localeFromString_languageCountryAndVariant() {
Locale locale = LocalizationPlugin.localeFromString("zh-Hans-CN");
assertEquals(locale, new Locale("zh", "CN", "Hans"));
}

@Config(sdk = 16)
@Config(sdk = Build.VERSION_CODES.KITKAT)
@Test
public void localeFromString_underscore() {
Locale locale = LocalizationPlugin.localeFromString("zh_Hans_CN");
assertEquals(locale, new Locale("zh", "CN", "Hans"));
}

@Config(sdk = 16)
@Config(sdk = Build.VERSION_CODES.KITKAT)
@Test
public void localeFromString_additionalVariantsAreIgnored() {
Locale locale = LocalizationPlugin.localeFromString("de-DE-u-co-phonebk");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
public class PlatformPluginTest {
private final Context ctx = ApplicationProvider.getApplicationContext();

@Config(sdk = 16)
@Config(sdk = Build.VERSION_CODES.KITKAT)
@Test
public void itIgnoresNewHapticEventsOnOldAndroidPlatforms() {
View fakeDecorView = mock(View.class);
Expand All @@ -70,7 +70,7 @@ public void itIgnoresNewHapticEventsOnOldAndroidPlatforms() {
platformPlugin.vibrateHapticFeedback(PlatformChannel.HapticFeedbackType.SELECTION_CLICK);
}

@Config(sdk = 29)
@Config(sdk = Build.VERSION_CODES.Q)
@Test
public void platformPlugin_getClipboardData() throws IOException {
ClipboardManager clipboardManager = ctx.getSystemService(ClipboardManager.class);
Expand Down Expand Up @@ -100,7 +100,7 @@ public void platformPlugin_getClipboardData() throws IOException {

@SuppressWarnings("deprecation")
// ClipboardManager.getText
@Config(sdk = 28)
@Config(sdk = Build.VERSION_CODES.P)
@Test
public void platformPlugin_hasStrings() {
ClipboardManager clipboardManager = spy(ctx.getSystemService(ClipboardManager.class));
Expand Down Expand Up @@ -154,7 +154,7 @@ public void platformPlugin_hasStrings() {
verify(clipboardManager, never()).getText();
}

@Config(sdk = 29)
@Config(sdk = Build.VERSION_CODES.Q)
@Test
public void setNavigationBarDividerColor() {
View fakeDecorView = mock(View.class);
Expand Down Expand Up @@ -229,7 +229,7 @@ public void setNavigationBarDividerColor() {
}
}

@Config(sdk = 30)
@Config(sdk = Build.VERSION_CODES.R)
@Test
public void setNavigationBarIconBrightness() {
if (Build.VERSION.SDK_INT >= 30) {
Expand Down Expand Up @@ -276,7 +276,7 @@ public void setNavigationBarIconBrightness() {
}
}

@Config(sdk = 30)
@Config(sdk = Build.VERSION_CODES.R)
@Test
public void setStatusBarIconBrightness() {
if (Build.VERSION.SDK_INT >= 30) {
Expand Down Expand Up @@ -323,7 +323,7 @@ public void setStatusBarIconBrightness() {

@SuppressWarnings("deprecation")
// SYSTEM_UI_FLAG_*, setSystemUiVisibility
@Config(sdk = 29)
@Config(sdk = Build.VERSION_CODES.Q)
@Test
public void setSystemUiMode() {
View fakeDecorView = mock(View.class);
Expand Down Expand Up @@ -440,7 +440,7 @@ public void setSystemUiModeListener_overlaysAreVisible() {

@SuppressWarnings("deprecation")
// SYSTEM_UI_FLAG_*, setSystemUiVisibility
@Config(sdk = 28)
@Config(sdk = Build.VERSION_CODES.P)
@Test
public void doNotEnableEdgeToEdgeOnOlderSdk() {
View fakeDecorView = mock(View.class);
Expand All @@ -462,7 +462,7 @@ public void doNotEnableEdgeToEdgeOnOlderSdk() {

@SuppressWarnings("deprecation")
// FLAG_TRANSLUCENT_STATUS, FLAG_TRANSLUCENT_NAVIGATION
@Config(sdk = 29)
@Config(sdk = Build.VERSION_CODES.Q)
@Test
public void verifyWindowFlagsSetToStyleOverlays() {
View fakeDecorView = mock(View.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

package io.flutter.plugin.platform;

import static android.os.Build.VERSION_CODES.JELLY_BEAN_MR1;
import static android.os.Build.VERSION_CODES.KITKAT;
import static android.os.Build.VERSION_CODES.P;
import static android.os.Build.VERSION_CODES.R;
import static org.junit.Assert.assertEquals;
Expand All @@ -28,7 +28,7 @@
@TargetApi(P)
public class SingleViewPresentationTest {
@Test
@Config(minSdk = JELLY_BEAN_MR1, maxSdk = R)
@Config(minSdk = KITKAT, maxSdk = R)
public void returnsOuterContextInputMethodManager() {
// There's a bug in Android Q caused by the IMM being instanced per display.
// https://github.com/flutter/flutter/issues/38375. We need the context returned by
Expand Down Expand Up @@ -59,7 +59,7 @@ public void returnsOuterContextInputMethodManager() {
}

@Test
@Config(minSdk = JELLY_BEAN_MR1, maxSdk = R)
@Config(minSdk = KITKAT, maxSdk = R)
public void returnsOuterContextInputMethodManager_createDisplayContext() {
// The IMM should also persist across display contexts created from the base context.

Expand Down
4 changes: 2 additions & 2 deletions shell/platform/android/test_runner/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ println "AVAILABLE PROCESSORS: $availableProcessors"
println "=========================================="

android {
compileSdkVersion 33
compileSdkVersion 34

defaultConfig {
minSdkVersion 16
minSdkVersion 19
}

compileOptions {
Expand Down
8 changes: 4 additions & 4 deletions testing/android_background_image/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ android {
// The others are irrelevant for a test application.
disable 'UnpackedNativeCode','MissingApplicationIcon','GoogleAppIndexingApiWarning','GoogleAppIndexingWarning','GradleDependency','NewerVersionAvailable'
}
buildToolsVersion = '33.0.0'
compileSdkVersion 33
buildToolsVersion = '34.0.0'
compileSdkVersion 34
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
defaultConfig {
applicationId 'dev.flutter.android_background_image'
minSdkVersion 16
targetSdkVersion 33
minSdkVersion 19
targetSdkVersion 34
versionCode 1
versionName '1.0'
}
Expand Down
8 changes: 4 additions & 4 deletions testing/scenario_app/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ android {
// The others are irrelevant for a test application.
disable 'UnpackedNativeCode','MissingApplicationIcon','GoogleAppIndexingApiWarning','GoogleAppIndexingWarning','GradleDependency','NewerVersionAvailable','Registered'
}
buildToolsVersion = '33.0.0'
compileSdkVersion 33
buildToolsVersion = '34.0.0'
compileSdkVersion 34
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
defaultConfig {
applicationId 'dev.flutter.scenarios'
minSdkVersion 18
targetSdkVersion 33
minSdkVersion 19
targetSdkVersion 34
versionCode 1
versionName '1.0'
testInstrumentationRunner 'dev.flutter.TestRunner'
Expand Down
Loading