Skip to content

Commit 7cb693c

Browse files
GaryQianhouhuayong
authored andcommitted
Upgrade android SDK to API 32 (flutter#33524)
1 parent 9bcfdb9 commit 7cb693c

16 files changed

Lines changed: 59 additions & 186 deletions

File tree

DEPS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ allowed_hosts = [
111111
]
112112

113113
deps = {
114-
'src': 'https://github.com/flutter/buildroot.git' + '@' + 'f582982073b6f04b7a70bc284bac8fafa6c0a846',
114+
'src': 'https://github.com/flutter/buildroot.git' + '@' + '8ce3dadcb6bb3e05570e1b5748fbc2716d264bb0',
115115

116116
# Fuchsia compatibility
117117
#
@@ -571,7 +571,7 @@ deps = {
571571
'packages': [
572572
{
573573
'package': 'flutter/android/sdk/all/${{platform}}',
574-
'version': 'version:31v8'
574+
'version': 'version:32v1'
575575
}
576576
],
577577
'condition': 'download_android_deps',

shell/platform/android/io/flutter/embedding/android/FlutterView.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1028,7 +1028,7 @@ public View findViewByAccessibilityIdTraversal(int accessibilityId) {
10281028
* @param currentView The root view.
10291029
* @return A descendant of currentView or currentView itself.
10301030
*/
1031-
@SuppressLint("PrivateApi")
1031+
@SuppressLint("DiscouragedPrivateApi")
10321032
private View findViewByAccessibilityIdRootedAtCurrentView(int accessibilityId, View currentView) {
10331033
Method getAccessibilityViewIdMethod;
10341034
try {

shell/platform/android/io/flutter/embedding/engine/renderer/FlutterRenderer.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
package io.flutter.embedding.engine.renderer;
66

7-
import android.annotation.TargetApi;
87
import android.graphics.Bitmap;
98
import android.graphics.Rect;
109
import android.graphics.SurfaceTexture;
@@ -34,7 +33,6 @@
3433
* <p>{@link io.flutter.embedding.android.FlutterSurfaceView} and {@link
3534
* io.flutter.embedding.android.FlutterTextureView} are implementations of {@link RenderSurface}.
3635
*/
37-
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
3836
public class FlutterRenderer implements TextureRegistry {
3937
private static final String TAG = "FlutterRenderer";
4038

shell/platform/android/io/flutter/plugin/localization/LocalizationPlugin.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
package io.flutter.plugin.localization;
66

7+
import android.annotation.SuppressLint;
78
import android.content.Context;
89
import android.content.res.Configuration;
910
import android.content.res.Resources;
@@ -22,6 +23,7 @@ public class LocalizationPlugin {
2223
@NonNull private final LocalizationChannel localizationChannel;
2324
@NonNull private final Context context;
2425

26+
@SuppressLint("AppBundleLocaleChanges") // This is optionally turned on by apps.
2527
@VisibleForTesting
2628
final LocalizationChannel.LocalizationMessageHandler localizationMessageHandler =
2729
new LocalizationChannel.LocalizationMessageHandler() {

shell/platform/android/io/flutter/plugin/platform/PlatformPlugin.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
package io.flutter.plugin.platform;
66

7+
import android.annotation.TargetApi;
78
import android.app.Activity;
89
import android.app.ActivityManager.TaskDescription;
910
import android.content.ClipData;
@@ -243,8 +244,7 @@ public void onSystemUiVisibilityChange(int visibility) {
243244
private void setSystemChromeEnabledSystemUIMode(PlatformChannel.SystemUiMode systemUiMode) {
244245
int enabledOverlays;
245246

246-
if (systemUiMode == PlatformChannel.SystemUiMode.LEAN_BACK
247-
&& Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
247+
if (systemUiMode == PlatformChannel.SystemUiMode.LEAN_BACK) {
248248
// LEAN BACK
249249
// Available starting at SDK 16
250250
// Should not show overlays, tap to reveal overlays, needs onChange callback
@@ -364,6 +364,7 @@ private void restoreSystemChromeSystemUIOverlays() {
364364
}
365365

366366
@SuppressWarnings("deprecation")
367+
@TargetApi(21)
367368
private void setSystemChromeSystemUIOverlayStyle(
368369
PlatformChannel.SystemChromeStyle systemChromeStyle) {
369370
Window window = activity.getWindow();

shell/platform/android/io/flutter/view/AccessibilityBridge.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2758,6 +2758,8 @@ private SpannableString createSpannableString(String string, List<StringAttribut
27582758
* @param eventOrigin the view in the embedded view's hierarchy that sent the event.
27592759
* @return True if the event was sent.
27602760
*/
2761+
// AccessibilityEvent has many irrelevant cases that would be confusing to list.
2762+
@SuppressLint("SwitchIntDef")
27612763
public boolean externalViewRequestSendAccessibilityEvent(
27622764
View embeddedView, View eventOrigin, AccessibilityEvent event) {
27632765
if (!accessibilityViewEmbedder.requestSendAccessibilityEvent(

shell/platform/android/io/flutter/view/AccessibilityViewEmbedder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ private static class ReflectionAccessors {
434434
private @Nullable final Field childNodeIdsField;
435435
private @Nullable final Method longArrayGetIndex;
436436

437-
@SuppressLint("PrivateApi")
437+
@SuppressLint("DiscouragedPrivateApi,PrivateApi")
438438
private ReflectionAccessors() {
439439
Method getSourceNodeId = null;
440440
Method getParentNodeId = null;

shell/platform/android/test_runner/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ println "AVAILABLE PROCESSORS: $availableProcessors"
3333
println "=========================================="
3434

3535
android {
36-
compileSdkVersion 31
36+
compileSdkVersion 32
3737

3838
defaultConfig {
3939
minSdkVersion 16

testing/android_background_image/android/app/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@ android {
1616
// The others are irrelevant for a test application.
1717
disable 'UnpackedNativeCode','MissingApplicationIcon','GoogleAppIndexingApiWarning','GoogleAppIndexingWarning','GradleDependency','NewerVersionAvailable'
1818
}
19-
buildToolsVersion = '31.0.0'
20-
compileSdkVersion 31
19+
buildToolsVersion = '33.0.0-rc4'
20+
compileSdkVersion 32
2121
compileOptions {
2222
sourceCompatibility JavaVersion.VERSION_11
2323
targetCompatibility JavaVersion.VERSION_11
2424
}
2525
defaultConfig {
2626
applicationId 'dev.flutter.android_background_image'
2727
minSdkVersion 16
28-
targetSdkVersion 31
28+
targetSdkVersion 32
2929
versionCode 1
3030
versionName '1.0'
3131
}

testing/scenario_app/android/app/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ android {
1515
// The others are irrelevant for a test application.
1616
disable 'UnpackedNativeCode','MissingApplicationIcon','GoogleAppIndexingApiWarning','GoogleAppIndexingWarning','GradleDependency','NewerVersionAvailable','Registered'
1717
}
18-
buildToolsVersion = '31.0.0'
19-
compileSdkVersion 31
18+
buildToolsVersion = '33.0.0-rc4'
19+
compileSdkVersion 32
2020
compileOptions {
2121
sourceCompatibility JavaVersion.VERSION_11
2222
targetCompatibility JavaVersion.VERSION_11
2323
}
2424
defaultConfig {
2525
applicationId 'dev.flutter.scenarios'
2626
minSdkVersion 18
27-
targetSdkVersion 31
27+
targetSdkVersion 32
2828
versionCode 1
2929
versionName '1.0'
3030
testInstrumentationRunner 'dev.flutter.TestRunner'

0 commit comments

Comments
 (0)