Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit f951f75

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents c0c1320 + ffb7903 commit f951f75

File tree

203 files changed

+3439
-1045
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

203 files changed

+3439
-1045
lines changed

.cirrus.yml

Lines changed: 43 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,57 @@ task:
55
cpu: 8
66
memory: 16G
77
upgrade_script:
8+
- flutter channel stable
9+
- flutter upgrade
810
- flutter channel master
911
- flutter upgrade
1012
- git fetch origin master
1113
activate_script: pub global activate flutter_plugin_tools
1214
matrix:
1315
- name: publishable
1416
script: ./script/check_publish.sh
15-
- name: test+format
17+
- name: format
1618
install_script:
1719
- wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
1820
- sudo apt-add-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-7 main"
1921
- sudo apt-get update
2022
- sudo apt-get install -y --allow-unauthenticated clang-format-7
2123
format_script: ./script/incremental_build.sh format --travis --clang-format=clang-format-7
22-
test_script: ./script/incremental_build.sh test
24+
- name: test
25+
env:
26+
matrix:
27+
CHANNEL: "master"
28+
CHANNEL: "stable"
29+
test_script:
30+
# TODO(jackson): Allow web plugins once supported on stable
31+
# https://github.com/flutter/flutter/issues/42864
32+
- if [[ "$CHANNEL" -eq "stable" ]]; then find . | grep _web$ | xargs rm -rf; fi
33+
- flutter channel $CHANNEL
34+
- ./script/incremental_build.sh test
2335
- name: analyze
2436
script: ./script/incremental_build.sh analyze
2537
- name: build_all_plugins_apk
26-
script: ./script/build_all_plugins_app.sh apk
38+
script:
39+
# TODO(jackson): Allow web plugins once supported on stable
40+
# https://github.com/flutter/flutter/issues/42864
41+
- if [[ "$CHANNEL" -eq "stable" ]]; then find . | grep _web$ | xargs rm -rf; fi
42+
- flutter channel $CHANNEL
43+
- ./script/build_all_plugins_app.sh apk
2744
- name: build-apks+java-test+firebase-test-lab
2845
env:
2946
matrix:
3047
PLUGIN_SHARDING: "--shardIndex 0 --shardCount 2"
3148
PLUGIN_SHARDING: "--shardIndex 1 --shardCount 2"
49+
matrix:
50+
CHANNEL: "master"
51+
CHANNEL: "stable"
3252
MAPS_API_KEY: ENCRYPTED[596a9f6bca436694625ac50851dc5da6b4d34cba8025f7db5bc9465142e8cd44e15f69e3507787753accebfc4910d550]
3353
GCLOUD_FIREBASE_TESTLAB_KEY: ENCRYPTED[07586610af1fdfc894e5969f70ef2458341b9b7e9c3b7c4225a663b4a48732b7208a4d91c3b7d45305a6b55fa2a37fc4]
3454
script:
55+
# TODO(jackson): Allow web plugins once supported on stable
56+
# https://github.com/flutter/flutter/issues/42864
57+
- if [[ "$CHANNEL" -eq "stable" ]]; then find . | grep _web$ | xargs rm -rf; fi
58+
- flutter channel $CHANNEL
3559
# Unsetting CIRRUS_CHANGE_MESSAGE and CIRRUS_COMMIT_MESSAGE as they
3660
# might include non-ASCII characters which makes Gradle crash.
3761
# See: https://github.com/flutter/flutter/issues/24935
@@ -60,17 +84,23 @@ task:
6084
setup_script:
6185
- pod repo update
6286
upgrade_script:
87+
- flutter channel stable
88+
- flutter upgrade
6389
- flutter channel master
6490
- flutter upgrade
6591
- git fetch origin master
66-
activate_script:
67-
- pub global activate flutter_plugin_tools
92+
activate_script: pub global activate flutter_plugin_tools
6893
create_simulator_script:
6994
- xcrun simctl list
7095
- xcrun simctl create Flutter-iPhone com.apple.CoreSimulator.SimDeviceType.iPhone-X com.apple.CoreSimulator.SimRuntime.iOS-12-2 | xargs xcrun simctl boot
7196
matrix:
7297
- name: build_all_plugins_ipa
73-
script: ./script/build_all_plugins_app.sh ios --no-codesign
98+
script:
99+
# TODO(jackson): Allow web plugins once supported on stable
100+
# https://github.com/flutter/flutter/issues/42864
101+
- if [[ "$CHANNEL" -eq "stable" ]]; then find . | grep _web$ | xargs rm -rf; fi
102+
- flutter channel $CHANNEL
103+
- ./script/build_all_plugins_app.sh ios --no-codesign
74104
- name: lint_darwin_plugins
75105
script: ./script/lint_darwin_plugins.sh
76106
- name: build-ipas+drive-examples
@@ -81,7 +111,14 @@ task:
81111
PLUGIN_SHARDING: "--shardIndex 1 --shardCount 4"
82112
PLUGIN_SHARDING: "--shardIndex 2 --shardCount 4"
83113
PLUGIN_SHARDING: "--shardIndex 3 --shardCount 4"
114+
matrix:
115+
CHANNEL: "master"
116+
CHANNEL: "stable"
84117
SIMCTL_CHILD_MAPS_API_KEY: ENCRYPTED[596a9f6bca436694625ac50851dc5da6b4d34cba8025f7db5bc9465142e8cd44e15f69e3507787753accebfc4910d550]
85118
build_script:
119+
# TODO(jackson): Allow web plugins once supported on stable
120+
# https://github.com/flutter/flutter/issues/42864
121+
- if [[ "$CHANNEL" -eq "stable" ]]; then find . | grep _web$ | xargs rm -rf; fi
122+
- flutter channel $CHANNEL
86123
- ./script/incremental_build.sh build-examples --ipa
87124
- ./script/incremental_build.sh drive-examples

packages/android_alarm_manager/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.4.4+2
2+
3+
* Remove AndroidX warning.
4+
15
## 0.4.4+1
26

37
* Update and migrate iOS example project.

packages/android_alarm_manager/android/build.gradle

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,3 @@
1-
def PLUGIN = "android_alarm_manager";
2-
def ANDROIDX_WARNING = "flutterPluginsAndroidXWarning";
3-
gradle.buildFinished { buildResult ->
4-
if (buildResult.failure && !rootProject.ext.has(ANDROIDX_WARNING)) {
5-
println ' *********************************************************'
6-
println 'WARNING: This version of ' + PLUGIN + ' will break your Android build if it or its dependencies aren\'t compatible with AndroidX.'
7-
println ' See https://goo.gl/CP92wY for more information on the problem and how to fix it.'
8-
println ' This warning prints for all Android build failures. The real root cause of the error may be unrelated.'
9-
println ' *********************************************************'
10-
rootProject.ext.set(ANDROIDX_WARNING, true);
11-
}
12-
}
13-
141
group 'io.flutter.plugins.androidalarmmanager'
152
version '1.0-SNAPSHOT'
163

packages/android_alarm_manager/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: android_alarm_manager
22
description: Flutter plugin for accessing the Android AlarmManager service, and
33
running Dart code in the background when alarms fire.
4-
version: 0.4.4+1
4+
version: 0.4.4+2
55
author: Flutter Team <flutter-dev@googlegroups.com>
66
homepage: https://github.com/flutter/plugins/tree/master/packages/android_alarm_manager
77

packages/android_intent/CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
## 0.3.4+5
2+
3+
* Remove AndroidX warning.
4+
5+
## 0.3.4+4
6+
7+
* Include lifecycle dependency as a compileOnly one on Android to resolve
8+
potential version conflicts with other transitive libraries.
9+
10+
## 0.3.4+3
11+
12+
* Android: Use android.arch.lifecycle instead of androidx.lifecycle:lifecycle in `build.gradle` to support apps that has not been migrated to AndroidX.
13+
14+
## 0.3.4+2
15+
16+
* Fix resolveActivity not respecting the provided componentName.
17+
118
## 0.3.4+1
219

320
* Fix minor lints in the Java platform code.

packages/android_intent/android/build.gradle

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,3 @@
1-
def PLUGIN = "android_intent";
2-
def ANDROIDX_WARNING = "flutterPluginsAndroidXWarning";
3-
gradle.buildFinished { buildResult ->
4-
if (buildResult.failure && !rootProject.ext.has(ANDROIDX_WARNING)) {
5-
println ' *********************************************************'
6-
println 'WARNING: This version of ' + PLUGIN + ' will break your Android build if it or its dependencies aren\'t compatible with AndroidX.'
7-
println ' See https://goo.gl/CP92wY for more information on the problem and how to fix it.'
8-
println ' This warning prints for all Android build failures. The real root cause of the error may be unrelated.'
9-
println ' *********************************************************'
10-
rootProject.ext.set(ANDROIDX_WARNING, true);
11-
}
12-
}
13-
141
group 'io.flutter.plugins.androidintent'
152
version '1.0-SNAPSHOT'
163

@@ -74,9 +61,10 @@ afterEvaluate {
7461
if (!containsEmbeddingDependencies) {
7562
android {
7663
dependencies {
77-
def lifecycle_version = "2.1.0"
78-
api "androidx.lifecycle:lifecycle-common-java8:$lifecycle_version"
79-
api "androidx.lifecycle:lifecycle-runtime:$lifecycle_version"
64+
def lifecycle_version = "1.1.1"
65+
compileOnly "android.arch.lifecycle:runtime:$lifecycle_version"
66+
compileOnly "android.arch.lifecycle:common:$lifecycle_version"
67+
compileOnly "android.arch.lifecycle:common-java8:$lifecycle_version"
8068
}
8169
}
8270
}
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
android.enableJetifier=true
2-
android.useAndroidX=true
31
org.gradle.jvmargs=-Xmx1536M

packages/android_intent/android/src/main/java/io/flutter/plugins/androidintent/IntentSender.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,14 @@ void send(
8080
}
8181
if (!TextUtils.isEmpty(packageName)) {
8282
intent.setPackage(packageName);
83+
if (componentName != null) {
84+
intent.setComponent(componentName);
85+
}
8386
if (intent.resolveActivity(applicationContext.getPackageManager()) == null) {
8487
Log.i(TAG, "Cannot resolve explicit intent - ignoring package");
8588
intent.setPackage(null);
8689
}
8790
}
88-
if (componentName != null) {
89-
intent.setComponent(componentName);
90-
}
9191

9292
Log.v(TAG, "Sending intent " + intent);
9393
if (activity != null) {

packages/android_intent/android/src/main/java/io/flutter/plugins/androidintent/MethodCallHandlerImpl.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,9 @@ public void onMethodCall(@NonNull MethodCall call, @NonNull Result result) {
7979
Bundle arguments = convertArguments((Map<String, ?>) call.argument("arguments"));
8080
String packageName = call.argument("package");
8181
ComponentName componentName =
82-
(!TextUtils.isEmpty(packageName) && !TextUtils.isEmpty((String) call.argument("component")))
83-
? new ComponentName(packageName, (String) call.argument("component"))
82+
(!TextUtils.isEmpty(packageName)
83+
&& !TextUtils.isEmpty((String) call.argument("componentName")))
84+
? new ComponentName(packageName, (String) call.argument("componentName"))
8485
: null;
8586

8687
sender.send(action, flags, category, data, arguments, packageName, componentName);

packages/android_intent/android/src/test/java/io/flutter/plugins/androidintent/MethodCallHandlerImplTest.java

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import static org.robolectric.Shadows.shadowOf;
1414

1515
import android.app.Application;
16+
import android.content.ComponentName;
1617
import android.content.Context;
1718
import android.content.Intent;
1819
import android.net.Uri;
@@ -27,6 +28,7 @@
2728
import org.junit.Test;
2829
import org.junit.runner.RunWith;
2930
import org.robolectric.RobolectricTestRunner;
31+
import org.robolectric.shadows.ShadowPackageManager;
3032

3133
@RunWith(RobolectricTestRunner.class)
3234
public class MethodCallHandlerImplTest {
@@ -194,4 +196,28 @@ public void onMethodCall_clearsInvalidPackageNames() {
194196
assertNotNull(intent);
195197
assertNull(intent.getPackage());
196198
}
199+
200+
@Test
201+
public void onMethodCall_setsComponentName() {
202+
sender.setApplicationContext(context);
203+
Map<String, Object> args = new HashMap<>();
204+
ComponentName expectedComponent =
205+
new ComponentName("io.flutter.plugins.androidintent", "MainActivity");
206+
args.put("action", "foo");
207+
args.put("package", expectedComponent.getPackageName());
208+
args.put("componentName", expectedComponent.getClassName());
209+
Result result = mock(Result.class);
210+
ShadowPackageManager shadowPm =
211+
shadowOf(ApplicationProvider.getApplicationContext().getPackageManager());
212+
shadowPm.addActivityIfNotPresent(expectedComponent);
213+
214+
methodCallHandler.onMethodCall(new MethodCall("launch", args), result);
215+
216+
verify(result, times(1)).success(null);
217+
Intent intent = shadowOf((Application) context).getNextStartedActivity();
218+
assertNotNull(intent);
219+
assertNotNull(intent.getComponent());
220+
assertEquals(expectedComponent.getPackageName(), intent.getPackage());
221+
assertEquals(expectedComponent.flattenToString(), intent.getComponent().flattenToString());
222+
}
197223
}

0 commit comments

Comments
 (0)