diff --git a/shell/platform/android/test/io/flutter/embedding/android/FlutterActivityAndFragmentDelegateTest.java b/shell/platform/android/test/io/flutter/embedding/android/FlutterActivityAndFragmentDelegateTest.java index 9ce5f8c91331f..7b37b4b54451c 100644 --- a/shell/platform/android/test/io/flutter/embedding/android/FlutterActivityAndFragmentDelegateTest.java +++ b/shell/platform/android/test/io/flutter/embedding/android/FlutterActivityAndFragmentDelegateTest.java @@ -66,6 +66,9 @@ public class FlutterActivityAndFragmentDelegateTest { private FlutterEngine mockFlutterEngine; private FlutterActivityAndFragmentDelegate.Host mockHost; + @SuppressWarnings("deprecation") + // Robolectric.setupActivity + // TODO(reidbaker): https://github.com/flutter/flutter/issues/133151 @Before public void setup() { FlutterInjector.reset(); @@ -402,6 +405,9 @@ public void itGivesHostAnOpportunityToConfigureFlutterSurfaceView() { verify(mockHost, times(1)).onFlutterSurfaceViewCreated(isNotNull()); } + @SuppressWarnings("deprecation") + // Robolectric.setupActivity + // TODO(reidbaker): https://github.com/flutter/flutter/issues/133151 @Test public void itGivesHostAnOpportunityToConfigureFlutterTextureView() { // ---- Test setup ---- diff --git a/shell/platform/android/test/io/flutter/embedding/android/FlutterAndroidComponentTest.java b/shell/platform/android/test/io/flutter/embedding/android/FlutterAndroidComponentTest.java index 64cf15d0404d2..9641739adbee8 100644 --- a/shell/platform/android/test/io/flutter/embedding/android/FlutterAndroidComponentTest.java +++ b/shell/platform/android/test/io/flutter/embedding/android/FlutterAndroidComponentTest.java @@ -265,6 +265,9 @@ public Context getContext() { return ApplicationProvider.getApplicationContext(); } + @SuppressWarnings("deprecation") + // Robolectric.setupActivity + // TODO(reidbaker): https://github.com/flutter/flutter/issues/133151 @Nullable @Override public Activity getActivity() { diff --git a/shell/platform/android/test/io/flutter/embedding/android/FlutterFragmentTest.java b/shell/platform/android/test/io/flutter/embedding/android/FlutterFragmentTest.java index 3fb89f9376e72..4b6c223530d30 100644 --- a/shell/platform/android/test/io/flutter/embedding/android/FlutterFragmentTest.java +++ b/shell/platform/android/test/io/flutter/embedding/android/FlutterFragmentTest.java @@ -283,6 +283,9 @@ public void itReturnsExclusiveAppComponent() { assertEquals(fragment.getExclusiveAppComponent(), delegate); } + @SuppressWarnings("deprecation") + // Robolectric.setupActivity + // TODO(reidbaker): https://github.com/flutter/flutter/issues/133151 @Test public void itDelegatesOnBackPressedAutomaticallyWhenEnabled() { // We need to mock FlutterJNI to avoid triggering native code. @@ -317,6 +320,9 @@ public void itDelegatesOnBackPressedAutomaticallyWhenEnabled() { verify(mockDelegate, times(1)).onBackPressed(); } + @SuppressWarnings("deprecation") + // Robolectric.setupActivity + // TODO(reidbaker): https://github.com/flutter/flutter/issues/133151 @Test public void itHandlesPopSystemNavigationAutomaticallyWhenEnabled() { // We need to mock FlutterJNI to avoid triggering native code. diff --git a/shell/platform/android/test/io/flutter/embedding/android/KeyboardManagerTest.java b/shell/platform/android/test/io/flutter/embedding/android/KeyboardManagerTest.java index 850196e6f2077..80aaf225edee5 100644 --- a/shell/platform/android/test/io/flutter/embedding/android/KeyboardManagerTest.java +++ b/shell/platform/android/test/io/flutter/embedding/android/KeyboardManagerTest.java @@ -29,7 +29,6 @@ import java.util.function.BiConsumer; import java.util.function.Consumer; import java.util.stream.Collectors; -import junit.framework.Assert; import org.json.JSONException; import org.json.JSONObject; import org.junit.Before; @@ -489,25 +488,25 @@ public void serializeAndDeserializeKeyData() { @Test public void basicCombingCharactersTest() { final KeyboardManager.CharacterCombiner combiner = new KeyboardManager.CharacterCombiner(); - Assert.assertEquals(0, (int) combiner.applyCombiningCharacterToBaseCharacter(0)); - Assert.assertEquals('A', (int) combiner.applyCombiningCharacterToBaseCharacter('A')); - Assert.assertEquals('B', (int) combiner.applyCombiningCharacterToBaseCharacter('B')); - Assert.assertEquals('B', (int) combiner.applyCombiningCharacterToBaseCharacter('B')); - Assert.assertEquals(0, (int) combiner.applyCombiningCharacterToBaseCharacter(0)); - Assert.assertEquals(0, (int) combiner.applyCombiningCharacterToBaseCharacter(0)); - - Assert.assertEquals('`', (int) combiner.applyCombiningCharacterToBaseCharacter(DEAD_KEY)); - Assert.assertEquals('`', (int) combiner.applyCombiningCharacterToBaseCharacter(DEAD_KEY)); - Assert.assertEquals('À', (int) combiner.applyCombiningCharacterToBaseCharacter('A')); - - Assert.assertEquals('`', (int) combiner.applyCombiningCharacterToBaseCharacter(DEAD_KEY)); - Assert.assertEquals(0, (int) combiner.applyCombiningCharacterToBaseCharacter(0)); + assertEquals(0, (int) combiner.applyCombiningCharacterToBaseCharacter(0)); + assertEquals('B', (int) combiner.applyCombiningCharacterToBaseCharacter('B')); + assertEquals('B', (int) combiner.applyCombiningCharacterToBaseCharacter('B')); + assertEquals('A', (int) combiner.applyCombiningCharacterToBaseCharacter('A')); + assertEquals(0, (int) combiner.applyCombiningCharacterToBaseCharacter(0)); + assertEquals(0, (int) combiner.applyCombiningCharacterToBaseCharacter(0)); + + assertEquals('`', (int) combiner.applyCombiningCharacterToBaseCharacter(DEAD_KEY)); + assertEquals('`', (int) combiner.applyCombiningCharacterToBaseCharacter(DEAD_KEY)); + assertEquals('À', (int) combiner.applyCombiningCharacterToBaseCharacter('A')); + + assertEquals('`', (int) combiner.applyCombiningCharacterToBaseCharacter(DEAD_KEY)); + assertEquals(0, (int) combiner.applyCombiningCharacterToBaseCharacter(0)); // The 0 input should remove the combining state. - Assert.assertEquals('A', (int) combiner.applyCombiningCharacterToBaseCharacter('A')); + assertEquals('A', (int) combiner.applyCombiningCharacterToBaseCharacter('A')); - Assert.assertEquals(0, (int) combiner.applyCombiningCharacterToBaseCharacter(0)); - Assert.assertEquals('`', (int) combiner.applyCombiningCharacterToBaseCharacter(DEAD_KEY)); - Assert.assertEquals('À', (int) combiner.applyCombiningCharacterToBaseCharacter('A')); + assertEquals(0, (int) combiner.applyCombiningCharacterToBaseCharacter(0)); + assertEquals('`', (int) combiner.applyCombiningCharacterToBaseCharacter(DEAD_KEY)); + assertEquals('À', (int) combiner.applyCombiningCharacterToBaseCharacter('A')); } @Test diff --git a/shell/platform/android/test/io/flutter/embedding/android/SplashShadowResources.java b/shell/platform/android/test/io/flutter/embedding/android/SplashShadowResources.java index f02646c8ed768..7c0bd96fec856 100644 --- a/shell/platform/android/test/io/flutter/embedding/android/SplashShadowResources.java +++ b/shell/platform/android/test/io/flutter/embedding/android/SplashShadowResources.java @@ -1,5 +1,7 @@ package io.flutter.embedding.android; +import static org.robolectric.util.reflector.Reflector.reflector; + import android.content.res.Resources; import android.graphics.Color; import android.graphics.drawable.ColorDrawable; @@ -8,9 +10,12 @@ import org.robolectric.annotation.Implementation; import org.robolectric.annotation.Implements; import org.robolectric.annotation.RealObject; -import org.robolectric.shadow.api.Shadow; import org.robolectric.shadows.ShadowResources; +import org.robolectric.util.reflector.Direct; +import org.robolectric.util.reflector.ForType; +@SuppressWarnings("deprecation") +// getDrawableInt @Implements(Resources.class) public class SplashShadowResources extends ShadowResources { @RealObject private Resources resources; @@ -18,12 +23,21 @@ public class SplashShadowResources extends ShadowResources { public static final int SPLASH_DRAWABLE_ID = 191919; public static final int THEMED_SPLASH_DRAWABLE_ID = 212121; + @ForType(Resources.class) + interface ResourcesReflector { + @Direct + Drawable getDrawable(int id, Resources.Theme theme); + + @Direct + Drawable getDrawable(int id); + } + @Implementation protected Drawable getDrawable(int id) { if (id == SPLASH_DRAWABLE_ID) { return new ColorDrawable(Color.BLUE); } - return Shadow.directlyOn(resources, Resources.class).getDrawable(id); + return reflector(Resources.class, resources).getDrawable(id); } @Implementation @@ -37,6 +51,6 @@ protected Drawable getDrawable(int id, @Nullable Resources.Theme theme) { } return new ColorDrawable(Color.GRAY); } - return Shadow.directlyOn(resources, Resources.class).getDrawable(id, theme); + return reflector(Resources.class, resources).getDrawable(id, theme); } } diff --git a/shell/platform/android/test/io/flutter/embedding/engine/FlutterEngineGroupCacheTest.java b/shell/platform/android/test/io/flutter/embedding/engine/FlutterEngineGroupCacheTest.java index 55802f6cecd74..efd8edc81649d 100644 --- a/shell/platform/android/test/io/flutter/embedding/engine/FlutterEngineGroupCacheTest.java +++ b/shell/platform/android/test/io/flutter/embedding/engine/FlutterEngineGroupCacheTest.java @@ -7,13 +7,13 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; +import androidx.test.core.app.ApplicationProvider; import io.flutter.FlutterInjector; import io.flutter.embedding.engine.loader.FlutterLoader; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.robolectric.RobolectricTestRunner; -import org.robolectric.RuntimeEnvironment; import org.robolectric.annotation.Config; @Config(manifest = Config.NONE) @@ -75,8 +75,10 @@ public void itRemovesFlutterEngineGroups() { @Test public void itRemovesAllFlutterEngineGroups() { // --- Test Setup --- - FlutterEngineGroup flutterEngineGroup1 = new FlutterEngineGroup(RuntimeEnvironment.application); - FlutterEngineGroup flutterEngineGroup2 = new FlutterEngineGroup(RuntimeEnvironment.application); + FlutterEngineGroup flutterEngineGroup1 = + new FlutterEngineGroup(ApplicationProvider.getApplicationContext()); + FlutterEngineGroup flutterEngineGroup2 = + new FlutterEngineGroup(ApplicationProvider.getApplicationContext()); FlutterEngineGroupCache cache = new FlutterEngineGroupCache(); // --- Execute Test --- diff --git a/shell/platform/android/test/io/flutter/embedding/engine/deferredcomponents/PlayStoreDeferredComponentManagerTest.java b/shell/platform/android/test/io/flutter/embedding/engine/deferredcomponents/PlayStoreDeferredComponentManagerTest.java index d1af9fb59fd83..e221afbe011d7 100644 --- a/shell/platform/android/test/io/flutter/embedding/engine/deferredcomponents/PlayStoreDeferredComponentManagerTest.java +++ b/shell/platform/android/test/io/flutter/embedding/engine/deferredcomponents/PlayStoreDeferredComponentManagerTest.java @@ -83,6 +83,8 @@ public void installDeferredComponent(int loadingUnitId, String componentName) { } } + @SuppressWarnings("deprecation") + // getApplicationInfo private Context createSpyContext(Bundle metadata) throws NameNotFoundException { Context spyContext = spy(ApplicationProvider.getApplicationContext()); doReturn(spyContext).when(spyContext).createPackageContext(any(), anyInt()); diff --git a/shell/platform/android/test/io/flutter/embedding/engine/loader/ApplicationInfoLoaderTest.java b/shell/platform/android/test/io/flutter/embedding/engine/loader/ApplicationInfoLoaderTest.java index e616eb627f6ac..6a9e4424f3182 100644 --- a/shell/platform/android/test/io/flutter/embedding/engine/loader/ApplicationInfoLoaderTest.java +++ b/shell/platform/android/test/io/flutter/embedding/engine/loader/ApplicationInfoLoaderTest.java @@ -48,6 +48,8 @@ public void itGeneratesCorrectApplicationInfoWithDefaultManifest() { assertNull(info.nativeLibraryDir); } + @SuppressWarnings("deprecation") + // getApplicationInfo private Context generateMockContext(Bundle metadata, String networkPolicyXml) throws Exception { Context context = mock(Context.class); PackageManager packageManager = mock(PackageManager.class); diff --git a/shell/platform/android/test/io/flutter/embedding/engine/plugins/shim/ShimPluginRegistryTest.java b/shell/platform/android/test/io/flutter/embedding/engine/plugins/shim/ShimPluginRegistryTest.java index 18c9b5ae206a7..95aad07402f12 100644 --- a/shell/platform/android/test/io/flutter/embedding/engine/plugins/shim/ShimPluginRegistryTest.java +++ b/shell/platform/android/test/io/flutter/embedding/engine/plugins/shim/ShimPluginRegistryTest.java @@ -15,7 +15,6 @@ import io.flutter.embedding.engine.plugins.PluginRegistry; import io.flutter.embedding.engine.plugins.activity.ActivityAware; import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding; -import io.flutter.plugin.common.PluginRegistry.Registrar; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -43,11 +42,15 @@ public void setup() { when(mockActivityPluginBinding.getActivity()).thenReturn(mockActivity); } + @SuppressWarnings("deprecation") + // Test is intentionally verifying deprecated behavior. @Test public void itSuppliesOldAPIsViaTheNewFlutterPluginBinding() { ShimPluginRegistry registryUnderTest = new ShimPluginRegistry(mockFlutterEngine); + // Fully qualifed name because imports can not have deprecation supression. // This is the consumption side of the old plugins. - Registrar registrarUnderTest = registryUnderTest.registrarFor("test"); + io.flutter.plugin.common.PluginRegistry.Registrar registrarUnderTest = + registryUnderTest.registrarFor("test"); ArgumentCaptor shimAggregateCaptor = ArgumentCaptor.forClass(FlutterPlugin.class); @@ -65,11 +68,16 @@ public void itSuppliesOldAPIsViaTheNewFlutterPluginBinding() { verify(mockFlutterPluginBinding).getApplicationContext(); } + @SuppressWarnings("deprecation") + // Test is intentionally verifying deprecated behavior. @Test public void itSuppliesMultipleOldPlugins() { ShimPluginRegistry registryUnderTest = new ShimPluginRegistry(mockFlutterEngine); - Registrar registrarUnderTest1 = registryUnderTest.registrarFor("test1"); - Registrar registrarUnderTest2 = registryUnderTest.registrarFor("test2"); + // Fully qualifed name because imports can not have deprecation supression. + io.flutter.plugin.common.PluginRegistry.Registrar registrarUnderTest1 = + registryUnderTest.registrarFor("test1"); + io.flutter.plugin.common.PluginRegistry.Registrar registrarUnderTest2 = + registryUnderTest.registrarFor("test2"); ArgumentCaptor shimAggregateCaptor = ArgumentCaptor.forClass(FlutterPlugin.class); @@ -86,10 +94,13 @@ public void itSuppliesMultipleOldPlugins() { verify(mockFlutterPluginBinding, times(2)).getApplicationContext(); } + @SuppressWarnings("deprecation") + // Test is intentionally verifying deprecated behavior. @Test public void itCanOnlySupplyActivityBindingWhenUpstreamActivityIsAttached() { ShimPluginRegistry registryUnderTest = new ShimPluginRegistry(mockFlutterEngine); - Registrar registrarUnderTest = registryUnderTest.registrarFor("test"); + io.flutter.plugin.common.PluginRegistry.Registrar registrarUnderTest = + registryUnderTest.registrarFor("test"); ArgumentCaptor shimAggregateCaptor = ArgumentCaptor.forClass(FlutterPlugin.class); diff --git a/shell/platform/android/test/io/flutter/embedding/engine/systemchannels/KeyboardChannelTest.java b/shell/platform/android/test/io/flutter/embedding/engine/systemchannels/KeyboardChannelTest.java index 96766a31b11c8..d0c436011e14d 100644 --- a/shell/platform/android/test/io/flutter/embedding/engine/systemchannels/KeyboardChannelTest.java +++ b/shell/platform/android/test/io/flutter/embedding/engine/systemchannels/KeyboardChannelTest.java @@ -32,6 +32,8 @@ private static BinaryMessenger.BinaryReply sendToBinaryMessageHandler( return reply; } + @SuppressWarnings("deprecation") + // setMessageHandler is deprecated. @Test public void respondsToGetKeyboardStateChannelMessage() { ArgumentCaptor binaryMessageHandlerCaptor = diff --git a/shell/platform/android/test/io/flutter/embedding/engine/systemchannels/SettingsChannelTest.java b/shell/platform/android/test/io/flutter/embedding/engine/systemchannels/SettingsChannelTest.java index a4a25ec597dfd..50c40e609ed06 100644 --- a/shell/platform/android/test/io/flutter/embedding/engine/systemchannels/SettingsChannelTest.java +++ b/shell/platform/android/test/io/flutter/embedding/engine/systemchannels/SettingsChannelTest.java @@ -23,6 +23,8 @@ public class SettingsChannelTest { @Test @TargetApi(33) @Config(sdk = 33) + @SuppressWarnings("deprecation") + // DartExecutor.send is deprecated. public void setDisplayMetricsDoesNothingOnAPILevel33() { final DartExecutor executor = mock(DartExecutor.class); executor.onAttachedToJNI(); diff --git a/shell/platform/android/test/io/flutter/plugin/editing/InputConnectionAdaptorTest.java b/shell/platform/android/test/io/flutter/plugin/editing/InputConnectionAdaptorTest.java index 93f92c182e0c2..9d93a2acd573d 100644 --- a/shell/platform/android/test/io/flutter/plugin/editing/InputConnectionAdaptorTest.java +++ b/shell/platform/android/test/io/flutter/plugin/editing/InputConnectionAdaptorTest.java @@ -135,6 +135,8 @@ public void testPerformContextMenuAction_selectAll() { assertEquals(editable.length(), Selection.getSelectionEnd(editable)); } + @SuppressWarnings("deprecation") + // ClipboardManager.hasText is deprecated. @Test public void testPerformContextMenuAction_cut() { ClipboardManager clipboardManager = ctx.getSystemService(ClipboardManager.class); @@ -152,6 +154,8 @@ public void testPerformContextMenuAction_cut() { assertFalse(editable.toString().contains(textToBeCut)); } + @SuppressWarnings("deprecation") + // ClipboardManager.hasText is deprecated. @Test public void testPerformContextMenuAction_copy() { ClipboardManager clipboardManager = ctx.getSystemService(ClipboardManager.class); @@ -171,6 +175,8 @@ public void testPerformContextMenuAction_copy() { clipboardManager.getPrimaryClip().getItemAt(0).getText()); } + @SuppressWarnings("deprecation") + // ClipboardManager.setText is deprecated. @Test public void testPerformContextMenuAction_paste() { ClipboardManager clipboardManager = ctx.getSystemService(ClipboardManager.class); @@ -185,6 +191,8 @@ public void testPerformContextMenuAction_paste() { assertTrue(editable.toString().startsWith(textToBePasted)); } + @SuppressWarnings("deprecation") + // DartExecutor.send is deprecated. @Test public void testCommitContent() throws JSONException { View testView = new View(ctx); @@ -244,6 +252,8 @@ public void testCommitContent() throws JSONException { }); } + @SuppressWarnings("deprecation") + // DartExecutor.send is deprecated. @Test public void testPerformPrivateCommand_dataIsNull() throws JSONException { View testView = new View(ctx); @@ -273,6 +283,8 @@ public void testPerformPrivateCommand_dataIsNull() throws JSONException { new String[] {"0", "{\"action\":\"actionCommand\"}"}); } + @SuppressWarnings("deprecation") + // DartExecutor.send is deprecated. @Test public void testPerformPrivateCommand_dataIsByteArray() throws JSONException { View testView = new View(ctx); @@ -308,6 +320,8 @@ public void testPerformPrivateCommand_dataIsByteArray() throws JSONException { }); } + @SuppressWarnings("deprecation") + // DartExecutor.send is deprecated. @Test public void testPerformPrivateCommand_dataIsByte() throws JSONException { View testView = new View(ctx); @@ -341,6 +355,8 @@ public void testPerformPrivateCommand_dataIsByte() throws JSONException { new String[] {"0", "{\"data\":{\"keyboard_layout\":3},\"action\":\"actionCommand\"}"}); } + @SuppressWarnings("deprecation") + // DartExecutor.send is deprecated. @Test public void testPerformPrivateCommand_dataIsCharArray() throws JSONException { View testView = new View(ctx); @@ -377,6 +393,8 @@ public void testPerformPrivateCommand_dataIsCharArray() throws JSONException { }); } + @SuppressWarnings("deprecation") + // DartExecutor.send is deprecated. @Test public void testPerformPrivateCommand_dataIsChar() throws JSONException { View testView = new View(ctx); @@ -410,6 +428,8 @@ public void testPerformPrivateCommand_dataIsChar() throws JSONException { new String[] {"0", "{\"data\":{\"keyboard_layout\":\"a\"},\"action\":\"actionCommand\"}"}); } + @SuppressWarnings("deprecation") + // DartExecutor.send is deprecated. @Test public void testPerformPrivateCommand_dataIsCharSequenceArray() throws JSONException { View testView = new View(ctx); @@ -447,6 +467,8 @@ public void testPerformPrivateCommand_dataIsCharSequenceArray() throws JSONExcep }); } + @SuppressWarnings("deprecation") + // DartExecutor.send is deprecated. @Test public void testPerformPrivateCommand_dataIsCharSequence() throws JSONException { View testView = new View(ctx); @@ -482,6 +504,8 @@ public void testPerformPrivateCommand_dataIsCharSequence() throws JSONException }); } + @SuppressWarnings("deprecation") + // DartExecutor.send is deprecated. @Test public void testPerformPrivateCommand_dataIsFloat() throws JSONException { View testView = new View(ctx); @@ -515,6 +539,8 @@ public void testPerformPrivateCommand_dataIsFloat() throws JSONException { new String[] {"0", "{\"data\":{\"keyboard_layout\":0.5},\"action\":\"actionCommand\"}"}); } + @SuppressWarnings("deprecation") + // DartExecutor.send is deprecated. @Test public void testPerformPrivateCommand_dataIsFloatArray() throws JSONException { View testView = new View(ctx); diff --git a/shell/platform/android/test/io/flutter/plugin/editing/SpellCheckPluginTest.java b/shell/platform/android/test/io/flutter/plugin/editing/SpellCheckPluginTest.java index f5c1a6fb6ee23..fd291b291ada0 100644 --- a/shell/platform/android/test/io/flutter/plugin/editing/SpellCheckPluginTest.java +++ b/shell/platform/android/test/io/flutter/plugin/editing/SpellCheckPluginTest.java @@ -44,6 +44,8 @@ private static void sendToBinaryMessageHandler( (ByteBuffer) encodedMethodCall.flip(), mock(BinaryMessenger.BinaryReply.class)); } + @SuppressWarnings("deprecation") + // setMessageHandler is deprecated. @Test public void respondsToSpellCheckChannelMessage() { ArgumentCaptor binaryMessageHandlerCaptor = diff --git a/shell/platform/android/test/io/flutter/plugin/editing/TextInputPluginTest.java b/shell/platform/android/test/io/flutter/plugin/editing/TextInputPluginTest.java index d049f171a3dfb..881dffc18882c 100644 --- a/shell/platform/android/test/io/flutter/plugin/editing/TextInputPluginTest.java +++ b/shell/platform/android/test/io/flutter/plugin/editing/TextInputPluginTest.java @@ -118,6 +118,8 @@ private static void sendToBinaryMessageHandler( (ByteBuffer) encodedMethodCall.flip(), mock(BinaryMessenger.BinaryReply.class)); } + @SuppressWarnings("deprecation") + // DartExecutor.send is deprecated. @Test public void textInputPlugin_RequestsReattachOnCreation() throws JSONException { // Initialize a general TextInputPlugin. @@ -992,6 +994,7 @@ public void setTextInputEditingState_alwaysSetEditableWhenDifferent() { // need the restart. // Update: many other keyboards need this too: // https://github.com/flutter/flutter/issues/78827 + @SuppressWarnings("deprecation") // InputMethodSubtype @Test public void setTextInputEditingState_restartsIMEOnlyWhenFrameworkChangesComposingRegion() { // Initialize a TextInputPlugin that needs to be always restarted. @@ -1136,6 +1139,8 @@ public void destroy_clearTextInputMethodHandler() { verify(textInputChannel, times(1)).setTextInputMethodHandler(isNull()); } + @SuppressWarnings("deprecation") + // DartExecutor.send is deprecated. @Test public void inputConnection_createsActionFromEnter() throws JSONException { TestImm testImm = Shadow.extract(ctx.getSystemService(Context.INPUT_METHOD_SERVICE)); @@ -1192,6 +1197,7 @@ public void inputConnection_createsActionFromEnter() throws JSONException { new String[] {"0", "TextInputAction.done"}); } + @SuppressWarnings("deprecation") // InputMethodSubtype @Test public void inputConnection_finishComposingTextUpdatesIMM() throws JSONException { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) { @@ -1441,13 +1447,14 @@ public void autofill_hintText() { verify(children[0]).setHint("placeholder"); } + @Config(minSdk = Build.VERSION_CODES.O) + @SuppressWarnings("deprecation") @Test public void autofill_onProvideVirtualViewStructure() { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) { return; } - - FlutterView testView = new FlutterView(Robolectric.setupActivity(Activity.class)); + FlutterView testView = getTestView(); TextInputChannel textInputChannel = new TextInputChannel(mock(DartExecutor.class)); TextInputPlugin textInputPlugin = new TextInputPlugin(testView, textInputChannel, mock(PlatformViewsController.class)); @@ -1531,13 +1538,15 @@ public void autofill_onProvideVirtualViewStructure() { verify(children[1], times(0)).setHint(any()); } + @SuppressWarnings("deprecation") + @Config(minSdk = Build.VERSION_CODES.O) @Test public void autofill_onProvideVirtualViewStructure_singular_textfield() { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) { return; } - - FlutterView testView = new FlutterView(Robolectric.setupActivity(Activity.class)); + // Migrate to ActivityScenario by following https://github.com/robolectric/robolectric/pull/4736 + FlutterView testView = getTestView(); TextInputChannel textInputChannel = new TextInputChannel(mock(DartExecutor.class)); TextInputPlugin textInputPlugin = new TextInputPlugin(testView, textInputChannel, mock(PlatformViewsController.class)); @@ -1582,6 +1591,7 @@ public void autofill_onProvideVirtualViewStructure_singular_textfield() { verify(children[0]).setDimens(anyInt(), anyInt(), anyInt(), anyInt(), gt(0), gt(0)); } + @Config(minSdk = Build.VERSION_CODES.O) @Test public void autofill_testLifeCycle() { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) { @@ -1589,7 +1599,7 @@ public void autofill_testLifeCycle() { } TestAfm testAfm = Shadow.extract(ctx.getSystemService(AutofillManager.class)); - FlutterView testView = new FlutterView(Robolectric.setupActivity(Activity.class)); + FlutterView testView = getTestView(); TextInputChannel textInputChannel = new TextInputChannel(mock(DartExecutor.class)); TextInputPlugin textInputPlugin = new TextInputPlugin(testView, textInputChannel, mock(PlatformViewsController.class)); @@ -1716,6 +1726,8 @@ public void autofill_testLifeCycle() { assertEquals("1".hashCode(), testAfm.exitId); } + @Config(minSdk = Build.VERSION_CODES.O) + @SuppressWarnings("deprecation") @Test public void autofill_testAutofillUpdatesTheFramework() { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) { @@ -1723,7 +1735,7 @@ public void autofill_testAutofillUpdatesTheFramework() { } TestAfm testAfm = Shadow.extract(ctx.getSystemService(AutofillManager.class)); - FlutterView testView = new FlutterView(Robolectric.setupActivity(Activity.class)); + FlutterView testView = getTestView(); TextInputChannel textInputChannel = spy(new TextInputChannel(mock(DartExecutor.class))); TextInputPlugin textInputPlugin = new TextInputPlugin(testView, textInputChannel, mock(PlatformViewsController.class)); @@ -1812,6 +1824,7 @@ public void autofill_testAutofillUpdatesTheFramework() { assertEquals(editState.text, "unfocused field"); } + @Config(minSdk = Build.VERSION_CODES.O) @Test public void autofill_doesNotCrashAfterClearClientCall() { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) { @@ -1860,6 +1873,7 @@ public void autofill_doesNotCrashAfterClearClientCall() { .updateEditingState(anyInt(), any(), anyInt(), anyInt(), anyInt(), anyInt()); } + @Config(minSdk = Build.VERSION_CODES.O) @Test public void autofill_testSetTextIpnutClientUpdatesSideFields() { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) { @@ -1867,7 +1881,7 @@ public void autofill_testSetTextIpnutClientUpdatesSideFields() { } TestAfm testAfm = Shadow.extract(ctx.getSystemService(AutofillManager.class)); - FlutterView testView = new FlutterView(Robolectric.setupActivity(Activity.class)); + FlutterView testView = getTestView(); TextInputChannel textInputChannel = new TextInputChannel(mock(DartExecutor.class)); TextInputPlugin textInputPlugin = new TextInputPlugin(testView, textInputChannel, mock(PlatformViewsController.class)); @@ -1939,6 +1953,14 @@ public void autofill_testSetTextIpnutClientUpdatesSideFields() { } // -------- End: Autofill Tests ------- + @SuppressWarnings("deprecation") + private FlutterView getTestView() { + // TODO(reidbaker): https://github.com/flutter/flutter/issues/133151 + return new FlutterView(Robolectric.setupActivity(Activity.class)); + } + + @SuppressWarnings("deprecation") + // setMessageHandler is deprecated. @Test public void respondsToInputChannelMessages() { ArgumentCaptor binaryMessageHandlerCaptor = @@ -1966,6 +1988,8 @@ public void respondsToInputChannelMessages() { verify(mockHandler, times(1)).finishAutofillContext(false); } + @SuppressWarnings("deprecation") + // setMessageHandler is deprecated. @Test public void sendAppPrivateCommand_dataIsEmpty() throws JSONException { ArgumentCaptor binaryMessageHandlerCaptor = @@ -1995,6 +2019,8 @@ public void sendAppPrivateCommand_dataIsEmpty() throws JSONException { .sendAppPrivateCommand(any(View.class), eq("actionCommand"), eq(null)); } + @SuppressWarnings("deprecation") + // setMessageHandler is deprecated. @Test public void sendAppPrivateCommand_hasData() throws JSONException { ArgumentCaptor binaryMessageHandlerCaptor = @@ -2029,8 +2055,11 @@ public void sendAppPrivateCommand_hasData() throws JSONException { @Test @TargetApi(30) @Config(sdk = 30) + @SuppressWarnings("deprecation") + // getWindowSystemUiVisibility, SYSTEM_UI_FLAG_LAYOUT_STABLE. + // flutter#133074 tracks migration work. public void ime_windowInsetsSync_notLaidOutBehindNavigation_excludesNavigationBars() { - FlutterView testView = spy(new FlutterView(Robolectric.setupActivity(Activity.class))); + FlutterView testView = spy(getTestView()); when(testView.getWindowSystemUiVisibility()).thenReturn(View.SYSTEM_UI_FLAG_LAYOUT_STABLE); TextInputChannel textInputChannel = new TextInputChannel(mock(DartExecutor.class)); @@ -2105,8 +2134,11 @@ public void ime_windowInsetsSync_notLaidOutBehindNavigation_excludesNavigationBa @Test @TargetApi(30) @Config(sdk = 30) + @SuppressWarnings("deprecation") + // getWindowSystemUiVisibility + // flutter#133074 tracks migration work. public void ime_windowInsetsSync_laidOutBehindNavigation_includesNavigationBars() { - FlutterView testView = spy(new FlutterView(Robolectric.setupActivity(Activity.class))); + FlutterView testView = spy(getTestView()); when(testView.getWindowSystemUiVisibility()) .thenReturn( View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION); @@ -2183,8 +2215,11 @@ public void ime_windowInsetsSync_laidOutBehindNavigation_includesNavigationBars( @Test @TargetApi(30) @Config(sdk = 30) + @SuppressWarnings("deprecation") + // getWindowSystemUiVisibility, SYSTEM_UI_FLAG_LAYOUT_STABLE + // flutter#133074 tracks migration work. public void lastWindowInsets_updatedOnSecondOnProgressCall() { - FlutterView testView = spy(new FlutterView(Robolectric.setupActivity(Activity.class))); + FlutterView testView = spy(getTestView()); when(testView.getWindowSystemUiVisibility()).thenReturn(View.SYSTEM_UI_FLAG_LAYOUT_STABLE); TextInputChannel textInputChannel = new TextInputChannel(mock(DartExecutor.class)); diff --git a/shell/platform/android/test/io/flutter/plugin/mouse/MouseCursorPluginTest.java b/shell/platform/android/test/io/flutter/plugin/mouse/MouseCursorPluginTest.java index 26db240c88180..5ab0f07f65d02 100644 --- a/shell/platform/android/test/io/flutter/plugin/mouse/MouseCursorPluginTest.java +++ b/shell/platform/android/test/io/flutter/plugin/mouse/MouseCursorPluginTest.java @@ -25,12 +25,18 @@ @Config( manifest = Config.NONE, + minSdk = 24, shadows = {}) @RunWith(AndroidJUnit4.class) @TargetApi(24) public class MouseCursorPluginTest { + + @SuppressWarnings("deprecation") + // Robolectric.setupActivity. + // TODO(reidbaker): https://github.com/flutter/flutter/issues/133151 @Test public void mouseCursorPlugin_SetsSystemCursorOnRequest() throws JSONException { + // Migrate to ActivityScenario by following https://github.com/robolectric/robolectric/pull/4736 // Initialize a general MouseCursorPlugin. FlutterView testView = spy(new FlutterView(Robolectric.setupActivity(Activity.class))); MouseCursorChannel mouseCursorChannel = new MouseCursorChannel(mock(DartExecutor.class)); diff --git a/shell/platform/android/test/io/flutter/plugin/platform/PlatformPluginTest.java b/shell/platform/android/test/io/flutter/plugin/platform/PlatformPluginTest.java index 8b27e80fd4264..fe8c7e46967d7 100644 --- a/shell/platform/android/test/io/flutter/plugin/platform/PlatformPluginTest.java +++ b/shell/platform/android/test/io/flutter/plugin/platform/PlatformPluginTest.java @@ -94,6 +94,8 @@ public void platformPlugin_getClipboardData() throws IOException { assertNull(platformPlugin.mPlatformMessageHandler.getClipboardData(clipboardFormat)); } + @SuppressWarnings("deprecation") + // ClipboardManager.getText @Config(sdk = 28) @Test public void platformPlugin_hasStrings() { @@ -315,6 +317,8 @@ public void setStatusBarIconBrightness() { } } + @SuppressWarnings("deprecation") + // SYSTEM_UI_FLAG_*, setSystemUiVisibility @Config(sdk = 29) @Test public void setSystemUiMode() { @@ -371,6 +375,8 @@ public void setSystemUiMode() { } } + @SuppressWarnings("deprecation") + // SYSTEM_UI_FLAG_FULLSCREEN @Test public void setSystemUiModeListener_overlaysAreHidden() { ActivityController controller = Robolectric.buildActivity(Activity.class); @@ -400,6 +406,8 @@ public void setSystemUiModeListener_overlaysAreHidden() { verify(fakePlatformChannel).systemChromeChanged(false); } + @SuppressWarnings("deprecation") + // dispatchSystemUiVisibilityChanged @Test public void setSystemUiModeListener_overlaysAreVisible() { ActivityController controller = Robolectric.buildActivity(Activity.class); @@ -426,6 +434,8 @@ public void setSystemUiModeListener_overlaysAreVisible() { verify(fakePlatformChannel).systemChromeChanged(true); } + @SuppressWarnings("deprecation") + // SYSTEM_UI_FLAG_*, setSystemUiVisibility @Config(sdk = 28) @Test public void doNotEnableEdgeToEdgeOnOlderSdk() { @@ -446,6 +456,8 @@ public void doNotEnableEdgeToEdgeOnOlderSdk() { | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN); } + @SuppressWarnings("deprecation") + // FLAG_TRANSLUCENT_STATUS, FLAG_TRANSLUCENT_NAVIGATION @Config(sdk = 29) @Test public void verifyWindowFlagsSetToStyleOverlays() { @@ -513,8 +525,12 @@ public void doesNotDoAnythingByDefaultIfPopSystemNavigatorOverridden() { verify(mockActivity, never()).finish(); } + @SuppressWarnings("deprecation") + // Robolectric.setupActivity. + // TODO(reidbaker): https://github.com/flutter/flutter/issues/133151 @Test public void popSystemNavigatorFlutterFragment() { + // Migrate to ActivityScenario by following https://github.com/robolectric/robolectric/pull/4736 FragmentActivity activity = spy(Robolectric.setupActivity(FragmentActivity.class)); final AtomicBoolean onBackPressedCalled = new AtomicBoolean(false); OnBackPressedCallback backCallback = @@ -539,6 +555,9 @@ public void handleOnBackPressed() { assertTrue(onBackPressedCalled.get()); } + @SuppressWarnings("deprecation") + // Robolectric.setupActivity. + // TODO(reidbaker): https://github.com/flutter/flutter/issues/133151 @Test public void doesNotDoAnythingByDefaultIfFragmentPopSystemNavigatorOverridden() { FragmentActivity activity = spy(Robolectric.setupActivity(FragmentActivity.class)); diff --git a/shell/platform/android/test/io/flutter/plugin/platform/PlatformViewsControllerTest.java b/shell/platform/android/test/io/flutter/plugin/platform/PlatformViewsControllerTest.java index 9dfd58ddeaa4f..13ec6823f1301 100644 --- a/shell/platform/android/test/io/flutter/plugin/platform/PlatformViewsControllerTest.java +++ b/shell/platform/android/test/io/flutter/plugin/platform/PlatformViewsControllerTest.java @@ -2,8 +2,6 @@ import static android.os.Looper.getMainLooper; import static io.flutter.embedding.engine.systemchannels.PlatformViewsChannel.PlatformViewTouch; -import static junit.framework.Assert.assertEquals; -import static junit.framework.Assert.assertTrue; import static org.junit.Assert.*; import static org.mockito.ArgumentMatchers.*; import static org.mockito.Mockito.*; @@ -27,9 +25,9 @@ import androidx.test.core.app.ApplicationProvider; import androidx.test.ext.junit.runners.AndroidJUnit4; import io.flutter.embedding.android.FlutterImageView; +import io.flutter.embedding.android.FlutterSurfaceView; import io.flutter.embedding.android.FlutterView; import io.flutter.embedding.android.MotionEventTracker; -import io.flutter.embedding.android.RenderMode; import io.flutter.embedding.engine.FlutterEngine; import io.flutter.embedding.engine.FlutterJNI; import io.flutter.embedding.engine.FlutterOverlaySurface; @@ -1523,7 +1521,7 @@ private static FlutterView attach( FlutterJNI jni, PlatformViewsController platformViewsController) { final Context context = ApplicationProvider.getApplicationContext(); final FlutterView flutterView = - new FlutterView(context, RenderMode.surface) { + new FlutterView(context, new FlutterSurfaceView(context)) { @Override public FlutterImageView createImageView() { final FlutterImageView view = mock(FlutterImageView.class); diff --git a/shell/platform/android/test/io/flutter/plugin/platform/SingleViewPresentationTest.java b/shell/platform/android/test/io/flutter/plugin/platform/SingleViewPresentationTest.java index 2cc177fd86648..20e6bb3b4731c 100644 --- a/shell/platform/android/test/io/flutter/plugin/platform/SingleViewPresentationTest.java +++ b/shell/platform/android/test/io/flutter/plugin/platform/SingleViewPresentationTest.java @@ -3,7 +3,7 @@ import static android.os.Build.VERSION_CODES.JELLY_BEAN_MR1; import static android.os.Build.VERSION_CODES.P; import static android.os.Build.VERSION_CODES.R; -import static junit.framework.Assert.assertEquals; +import static org.junit.Assert.assertEquals; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.when; @@ -13,10 +13,10 @@ import android.hardware.display.DisplayManager; import android.view.Display; import android.view.inputmethod.InputMethodManager; +import androidx.test.core.app.ApplicationProvider; import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; -import org.robolectric.RuntimeEnvironment; import org.robolectric.annotation.Config; @Config(manifest = Config.NONE) @@ -38,7 +38,7 @@ public void returnsOuterContextInputMethodManager() { // system service instead of the spy's and fails. // Create an SVP under test with a Context that returns a local IMM mock. - Context context = spy(RuntimeEnvironment.application); + Context context = spy(ApplicationProvider.getApplicationContext()); InputMethodManager expected = mock(InputMethodManager.class); when(context.getSystemService(Context.INPUT_METHOD_SERVICE)).thenReturn(expected); DisplayManager dm = (DisplayManager) context.getSystemService(Context.DISPLAY_SERVICE); @@ -60,7 +60,7 @@ public void returnsOuterContextInputMethodManager_createDisplayContext() { // The IMM should also persist across display contexts created from the base context. // Create an SVP under test with a Context that returns a local IMM mock. - Context context = spy(RuntimeEnvironment.application); + Context context = spy(ApplicationProvider.getApplicationContext()); InputMethodManager expected = mock(InputMethodManager.class); when(context.getSystemService(Context.INPUT_METHOD_SERVICE)).thenReturn(expected); Display display = diff --git a/shell/platform/android/test/io/flutter/view/AccessibilityBridgeTest.java b/shell/platform/android/test/io/flutter/view/AccessibilityBridgeTest.java index 256ba35bc702a..28077a2c6877e 100644 --- a/shell/platform/android/test/io/flutter/view/AccessibilityBridgeTest.java +++ b/shell/platform/android/test/io/flutter/view/AccessibilityBridgeTest.java @@ -81,7 +81,8 @@ public void itDescribesNonTextFieldsWithAContentDescription() { assertEquals(nodeInfo.getText(), null); } - @TargetApi(26) + @Config(sdk = 28) + @TargetApi(28) @Test public void itDescribesTextFieldsWithTextAndHint() { AccessibilityBridge accessibilityBridge = setUpBridge(); @@ -322,6 +323,7 @@ public void itSetsTraversalAfter() { verify(mockNodeInfo2, times(1)).setTraversalAfter(eq(mockRootView), eq(1)); } + @Config(sdk = 24) @TargetApi(24) @Test public void itSetsRootViewNotImportantForAccessibility() { @@ -350,6 +352,7 @@ public void itSetsRootViewNotImportantForAccessibility() { verify(mockNodeInfo, times(1)).setImportantForAccessibility(eq(false)); } + @Config(sdk = 24) @TargetApi(24) @Test public void itSetsNodeImportantForAccessibilityIfItHasContent() { @@ -380,6 +383,7 @@ public void itSetsNodeImportantForAccessibilityIfItHasContent() { verify(mockNodeInfo, times(1)).setImportantForAccessibility(eq(true)); } + @Config(sdk = 24) @TargetApi(24) @Test public void itSetsNodeImportantForAccessibilityIfItHasActions() { @@ -410,6 +414,7 @@ public void itSetsNodeImportantForAccessibilityIfItHasActions() { verify(mockNodeInfo, times(1)).setImportantForAccessibility(eq(true)); } + @Config(sdk = 24) @TargetApi(24) @Test public void itSetsNodeUnImportantForAccessibilityIfItIsEmpty() { @@ -449,6 +454,9 @@ public void itSetsNodeUnImportantForAccessibilityIfItIsEmpty() { verify(mockNodeInfo1, times(1)).setImportantForAccessibility(eq(false)); } + @SuppressWarnings("deprecation") + // getSystemWindowInset* methods deprecated. + @Config(sdk = 28) @TargetApi(28) @Test public void itSetCutoutInsetBasedonLayoutModeNever() { @@ -498,6 +506,9 @@ public void itSetCutoutInsetBasedonLayoutModeNever() { new Rect(left + expectedInsetLeft, top, right + expectedInsetLeft, bottom)); } + @SuppressWarnings("deprecation") + // getSystemWindowInset* methods deprecated. + @Config(sdk = 28) @TargetApi(28) @Test public void itSetCutoutInsetBasedonLayoutModeDefault() { @@ -547,6 +558,9 @@ public void itSetCutoutInsetBasedonLayoutModeDefault() { new Rect(left + expectedInsetLeft, top, right + expectedInsetLeft, bottom)); } + @SuppressWarnings("deprecation") + // getSystemWindowInset* methods deprecated. + @Config(sdk = 28) @TargetApi(28) @Test public void itSetCutoutInsetBasedonLayoutModeShortEdges() { @@ -595,6 +609,10 @@ public void itSetCutoutInsetBasedonLayoutModeShortEdges() { verify(mockNodeInfo, times(1)).setBoundsInScreen(new Rect(left, top, right, bottom)); } + @SuppressWarnings("deprecation") + // getSystemWindowInset* methods deprecated. + // fluter#133074 tracks post deprecation work. + @Config(sdk = 30) @TargetApi(30) @Test public void itSetCutoutInsetBasedonLayoutModeAlways() { @@ -840,6 +858,7 @@ public void itAnnouncesRouteNameWhenRemoveARoute() { verify(mockRootView, times(1)).setAccessibilityPaneTitle(eq("new_node2")); } + @Config(sdk = 21) @TargetApi(21) @Test public void itCanPerformSetText() { @@ -879,6 +898,7 @@ public void itCanPerformSetText() { .dispatchSemanticsAction(1, AccessibilityBridge.Action.SET_TEXT, expectedText); } + @Config(sdk = 21) @TargetApi(21) @Test public void itCanPredictSetText() { @@ -918,6 +938,7 @@ public void itCanPredictSetText() { assertEquals(nodeInfo.getText().toString(), expectedText); } + @Config(sdk = 21) @TargetApi(21) @Test public void itBuildsAttributedString() { @@ -984,6 +1005,7 @@ public void itBuildsAttributedString() { assertEquals(actual.getSpanEnd(spellOutSpan), 9); } + @Config(sdk = 21) @TargetApi(21) @Test public void itSetsTextCorrectly() { @@ -1043,6 +1065,7 @@ public void itSetsTextCorrectly() { assertEquals(objectSpans.length, 0); } + @Config(sdk = 28) @TargetApi(28) @Test public void itSetsTooltipCorrectly() { @@ -1080,6 +1103,7 @@ public void itSetsTooltipCorrectly() { assertEquals(actual.toString(), root.tooltip); } + @Config(sdk = 21) @TargetApi(21) @Test public void itCanCreateAccessibilityNodeInfoWithSetText() { @@ -1255,6 +1279,7 @@ public void itSetsFocusabilityBasedOnFlagsCorrectly() { assertTrue(node2Info.isFocusable()); } + @Config(sdk = 31) @TargetApi(31) @Test public void itSetsBoldTextFlagCorrectly() { diff --git a/shell/platform/android/test_runner/build.gradle b/shell/platform/android/test_runner/build.gradle index 5fd37ad3edb6f..53a537f874c15 100644 --- a/shell/platform/android/test_runner/build.gradle +++ b/shell/platform/android/test_runner/build.gradle @@ -18,11 +18,10 @@ apply plugin: "com.android.library" rootProject.buildDir = project.property("build_dir") // Shows warnings for usage of deprecated API usages. -// TODO(camsim99): Make deprecation warnings fatal and remove limit when all -// 434 (at the time of this comment) deprecations are fixed. +// TODO(reidbaker): Expand linter coverage https://github.com/flutter/flutter/issues/133154 gradle.projectsEvaluated { tasks.withType(JavaCompile) { - options.compilerArgs << "-Xlint:deprecation" << "-Xmaxwarns" << "434" + options.compilerArgs << "-Xlint:deprecation" << "-Werror" } }