From 36a221410b615d6e4fce6f42c23d83b23db8946d Mon Sep 17 00:00:00 2001 From: sarbagyastha Date: Sat, 9 Jan 2021 10:58:09 +0545 Subject: [PATCH 1/8] added .cpid & .gclient to gitignore --- .gitignore | 3 +++ src | 1 + 2 files changed, 4 insertions(+) create mode 160000 src diff --git a/.gitignore b/.gitignore index d46d282df64d9..8d7da756f54b6 100644 --- a/.gitignore +++ b/.gitignore @@ -4,10 +4,13 @@ .*.sw? .DS_Store .ccls-cache +.cipd/ .classpath .clangd/ .cproject .dart_tool +.gclient +.gclient_entries .gdb_history .checkstyle .gdbinit diff --git a/src b/src new file mode 160000 index 0000000000000..3d37855508a4d --- /dev/null +++ b/src @@ -0,0 +1 @@ +Subproject commit 3d37855508a4de2481ad0fead8e15563f0210c2c From 5a0755183b3bca982144d21368eacbb3e39f7c3d Mon Sep 17 00:00:00 2001 From: sarbagyastha Date: Sat, 9 Jan 2021 11:29:45 +0545 Subject: [PATCH 2/8] updated tests --- .../android/FlutterActivityAndFragmentDelegate.java | 8 +++++++- .../android/FlutterActivityAndFragmentDelegateTest.java | 8 ++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/shell/platform/android/io/flutter/embedding/android/FlutterActivityAndFragmentDelegate.java b/shell/platform/android/io/flutter/embedding/android/FlutterActivityAndFragmentDelegate.java index 4d5cfcac0dbeb..492724ba5552b 100644 --- a/shell/platform/android/io/flutter/embedding/android/FlutterActivityAndFragmentDelegate.java +++ b/shell/platform/android/io/flutter/embedding/android/FlutterActivityAndFragmentDelegate.java @@ -398,8 +398,14 @@ private void doInitialFlutterViewRun() { private String maybeGetInitialRouteFromIntent(Intent intent) { if (host.shouldHandleDeeplinking()) { Uri data = intent.getData(); + String pathAndQuery; if (data != null && !data.getPath().isEmpty()) { - return data.getPath(); + pathAndQuery = data.getPath(); + if (!data.getQuery().isEmpty()) { + pathAndQuery += "?"; + pathAndQuery += data.getQuery(); + } + return pathAndQuery; } } return null; 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 e4c02d7492807..a1f4bc7d328b1 100644 --- a/shell/platform/android/test/io/flutter/embedding/android/FlutterActivityAndFragmentDelegateTest.java +++ b/shell/platform/android/test/io/flutter/embedding/android/FlutterActivityAndFragmentDelegateTest.java @@ -433,7 +433,7 @@ public void itForwardsOnRequestPermissionsResultToFlutterEngine() { public void itSendsInitialRouteFromIntentOnStartIfNoInitialRouteFromActivityAndShouldHandleDeeplinking() { Intent intent = FlutterActivity.createDefaultIntent(RuntimeEnvironment.application); - intent.setData(Uri.parse("http://myApp/custom/route")); + intent.setData(Uri.parse("http://myApp/custom/route/?query=test")); ActivityController activityController = Robolectric.buildActivity(FlutterActivity.class, intent); @@ -452,7 +452,7 @@ public void itForwardsOnRequestPermissionsResultToFlutterEngine() { delegate.onStart(); // Verify that the navigation channel was given the initial route message. - verify(mockFlutterEngine.getNavigationChannel(), times(1)).setInitialRoute("/custom/route"); + verify(mockFlutterEngine.getNavigationChannel(), times(1)).setInitialRoute("/custom/route/?query=test"); } @Test @@ -491,12 +491,12 @@ public void itSendsPushRouteMessageWhenOnNewIntent() { delegate.onAttach(RuntimeEnvironment.application); Intent mockIntent = mock(Intent.class); - when(mockIntent.getData()).thenReturn(Uri.parse("http://myApp/custom/route")); + when(mockIntent.getData()).thenReturn(Uri.parse("http://myApp/custom/route/?query=test")); // Emulate the host and call the method that we expect to be forwarded. delegate.onNewIntent(mockIntent); // Verify that the navigation channel was given the push route message. - verify(mockFlutterEngine.getNavigationChannel(), times(1)).pushRoute("/custom/route"); + verify(mockFlutterEngine.getNavigationChannel(), times(1)).pushRoute("/custom/route/?query=test"); } @Test From 54e6206e23130402c6affaa030bdc81aa3688091 Mon Sep 17 00:00:00 2001 From: sarbagyastha Date: Sat, 9 Jan 2021 13:19:02 +0545 Subject: [PATCH 3/8] minor change --- .../android/FlutterActivityAndFragmentDelegateTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 a1f4bc7d328b1..d38e6e24c610d 100644 --- a/shell/platform/android/test/io/flutter/embedding/android/FlutterActivityAndFragmentDelegateTest.java +++ b/shell/platform/android/test/io/flutter/embedding/android/FlutterActivityAndFragmentDelegateTest.java @@ -491,12 +491,12 @@ public void itSendsPushRouteMessageWhenOnNewIntent() { delegate.onAttach(RuntimeEnvironment.application); Intent mockIntent = mock(Intent.class); - when(mockIntent.getData()).thenReturn(Uri.parse("http://myApp/custom/route/?query=test")); + when(mockIntent.getData()).thenReturn(Uri.parse("http://myApp/custom/route?query=test")); // Emulate the host and call the method that we expect to be forwarded. delegate.onNewIntent(mockIntent); // Verify that the navigation channel was given the push route message. - verify(mockFlutterEngine.getNavigationChannel(), times(1)).pushRoute("/custom/route/?query=test"); + verify(mockFlutterEngine.getNavigationChannel(), times(1)).pushRoute("/custom/route?query=test"); } @Test From 83cb9d96a81e2d43a04d68296e6d4a52ffc779b3 Mon Sep 17 00:00:00 2001 From: sarbagyastha Date: Sat, 9 Jan 2021 13:47:06 +0545 Subject: [PATCH 4/8] fixed formating --- .../android/FlutterActivityAndFragmentDelegateTest.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 d38e6e24c610d..671cb2a49b208 100644 --- a/shell/platform/android/test/io/flutter/embedding/android/FlutterActivityAndFragmentDelegateTest.java +++ b/shell/platform/android/test/io/flutter/embedding/android/FlutterActivityAndFragmentDelegateTest.java @@ -452,7 +452,8 @@ public void itForwardsOnRequestPermissionsResultToFlutterEngine() { delegate.onStart(); // Verify that the navigation channel was given the initial route message. - verify(mockFlutterEngine.getNavigationChannel(), times(1)).setInitialRoute("/custom/route/?query=test"); + verify(mockFlutterEngine.getNavigationChannel(), times(1)) + .setInitialRoute("/custom/route/?query=test"); } @Test @@ -496,7 +497,8 @@ public void itSendsPushRouteMessageWhenOnNewIntent() { delegate.onNewIntent(mockIntent); // Verify that the navigation channel was given the push route message. - verify(mockFlutterEngine.getNavigationChannel(), times(1)).pushRoute("/custom/route?query=test"); + verify(mockFlutterEngine.getNavigationChannel(), times(1)) + .pushRoute("/custom/route?query=test"); } @Test From 472294721b85f9e69a9369812bafcaf769911e0e Mon Sep 17 00:00:00 2001 From: sarbagyastha Date: Sat, 9 Jan 2021 20:45:24 +0545 Subject: [PATCH 5/8] compact concatenation --- .../android/FlutterActivityAndFragmentDelegate.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/shell/platform/android/io/flutter/embedding/android/FlutterActivityAndFragmentDelegate.java b/shell/platform/android/io/flutter/embedding/android/FlutterActivityAndFragmentDelegate.java index 492724ba5552b..0990604b9ba1b 100644 --- a/shell/platform/android/io/flutter/embedding/android/FlutterActivityAndFragmentDelegate.java +++ b/shell/platform/android/io/flutter/embedding/android/FlutterActivityAndFragmentDelegate.java @@ -398,12 +398,10 @@ private void doInitialFlutterViewRun() { private String maybeGetInitialRouteFromIntent(Intent intent) { if (host.shouldHandleDeeplinking()) { Uri data = intent.getData(); - String pathAndQuery; if (data != null && !data.getPath().isEmpty()) { - pathAndQuery = data.getPath(); + String pathAndQuery = data.getPath(); if (!data.getQuery().isEmpty()) { - pathAndQuery += "?"; - pathAndQuery += data.getQuery(); + pathAndQuery += "?" + data.getQuery(); } return pathAndQuery; } From da4aba0c349951ed594b0d94b27caabfc06bb64c Mon Sep 17 00:00:00 2001 From: sarbagyastha Date: Sat, 9 Jan 2021 20:46:21 +0545 Subject: [PATCH 6/8] minor change --- .../android/FlutterActivityAndFragmentDelegateTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 671cb2a49b208..509b97791cd9c 100644 --- a/shell/platform/android/test/io/flutter/embedding/android/FlutterActivityAndFragmentDelegateTest.java +++ b/shell/platform/android/test/io/flutter/embedding/android/FlutterActivityAndFragmentDelegateTest.java @@ -433,7 +433,7 @@ public void itForwardsOnRequestPermissionsResultToFlutterEngine() { public void itSendsInitialRouteFromIntentOnStartIfNoInitialRouteFromActivityAndShouldHandleDeeplinking() { Intent intent = FlutterActivity.createDefaultIntent(RuntimeEnvironment.application); - intent.setData(Uri.parse("http://myApp/custom/route/?query=test")); + intent.setData(Uri.parse("http://myApp/custom/route?query=test")); ActivityController activityController = Robolectric.buildActivity(FlutterActivity.class, intent); @@ -453,7 +453,7 @@ public void itForwardsOnRequestPermissionsResultToFlutterEngine() { // Verify that the navigation channel was given the initial route message. verify(mockFlutterEngine.getNavigationChannel(), times(1)) - .setInitialRoute("/custom/route/?query=test"); + .setInitialRoute("/custom/route?query=test"); } @Test From 567ff36d8125855d326b66b6580267b29f15514c Mon Sep 17 00:00:00 2001 From: sarbagyastha Date: Tue, 12 Jan 2021 06:16:53 +0545 Subject: [PATCH 7/8] Revert "added .cpid & .gclient to gitignore" --- .gitignore | 3 --- 1 file changed, 3 deletions(-) diff --git a/.gitignore b/.gitignore index 8d7da756f54b6..d46d282df64d9 100644 --- a/.gitignore +++ b/.gitignore @@ -4,13 +4,10 @@ .*.sw? .DS_Store .ccls-cache -.cipd/ .classpath .clangd/ .cproject .dart_tool -.gclient -.gclient_entries .gdb_history .checkstyle .gdbinit From 44acea0403beb73e5e1711c8a5501f1213afb2ec Mon Sep 17 00:00:00 2001 From: sarbagyastha Date: Tue, 12 Jan 2021 08:37:20 +0545 Subject: [PATCH 8/8] cleanup --- src | 1 - 1 file changed, 1 deletion(-) delete mode 160000 src diff --git a/src b/src deleted file mode 160000 index 3d37855508a4d..0000000000000 --- a/src +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3d37855508a4de2481ad0fead8e15563f0210c2c