|
@@ -20,6 +20,7 @@ import android.app.Activity;
|
20
|
20
|
import android.app.Application;
|
21
|
21
|
import android.content.Context;
|
22
|
22
|
import android.content.Intent;
|
|
23
|
+import android.net.Uri;
|
23
|
24
|
import android.os.Bundle;
|
24
|
25
|
import android.support.annotation.NonNull;
|
25
|
26
|
import android.support.annotation.Nullable;
|
|
@@ -53,9 +54,11 @@ public class JitsiMeetView extends FrameLayout {
|
53
|
54
|
|
54
|
55
|
public static JitsiMeetView findViewByExternalAPIScope(
|
55
|
56
|
String externalAPIScope) {
|
56
|
|
- for (JitsiMeetView view : views) {
|
57
|
|
- if (view.externalAPIScope.equals(externalAPIScope)) {
|
58
|
|
- return view;
|
|
57
|
+ synchronized (views) {
|
|
58
|
+ for (JitsiMeetView view : views) {
|
|
59
|
+ if (view.externalAPIScope.equals(externalAPIScope)) {
|
|
60
|
+ return view;
|
|
61
|
+ }
|
59
|
62
|
}
|
60
|
63
|
}
|
61
|
64
|
|
|
@@ -91,6 +94,30 @@ public class JitsiMeetView extends FrameLayout {
|
91
|
94
|
.build();
|
92
|
95
|
}
|
93
|
96
|
|
|
97
|
+ /**
|
|
98
|
+ * Loads a specific URL {@code String} in all existing
|
|
99
|
+ * {@code JitsiMeetView}s.
|
|
100
|
+ *
|
|
101
|
+ * @param urlString - The URL {@code String} to load in all existing
|
|
102
|
+ * {@code JitsiMeetView}s.
|
|
103
|
+ * @return If the specified {@code urlString} was submitted for loading in
|
|
104
|
+ * at least one {@code JitsiMeetView}, then {@code true}; otherwise,
|
|
105
|
+ * {@code false}.
|
|
106
|
+ */
|
|
107
|
+ private static boolean loadURLStringInViews(String urlString) {
|
|
108
|
+ synchronized (views) {
|
|
109
|
+ if (!views.isEmpty()) {
|
|
110
|
+ for (JitsiMeetView view : views) {
|
|
111
|
+ view.loadURLString(urlString);
|
|
112
|
+ }
|
|
113
|
+
|
|
114
|
+ return true;
|
|
115
|
+ }
|
|
116
|
+ }
|
|
117
|
+
|
|
118
|
+ return false;
|
|
119
|
+ }
|
|
120
|
+
|
94
|
121
|
/**
|
95
|
122
|
* Activity lifecycle method which should be called from
|
96
|
123
|
* <tt>Activity.onBackPressed</tt> so we can do the required internal
|
|
@@ -156,6 +183,19 @@ public class JitsiMeetView extends FrameLayout {
|
156
|
183
|
* @param intent - <tt>Intent</tt> instance which was received.
|
157
|
184
|
*/
|
158
|
185
|
public static void onNewIntent(Intent intent) {
|
|
186
|
+ // XXX At least twice we received bug reports about malfunctioning
|
|
187
|
+ // loadURL in the Jitsi Meet SDK while the Jitsi Meet app seemed to
|
|
188
|
+ // functioning as expected in our testing. But that was to be expected
|
|
189
|
+ // because the app does not exercise loadURL. In order to increase the
|
|
190
|
+ // test coverage of loadURL, channel deep linking through loadURL.
|
|
191
|
+ Uri uri;
|
|
192
|
+
|
|
193
|
+ if (Intent.ACTION_VIEW.equals(intent.getAction())
|
|
194
|
+ && (uri = intent.getData()) != null
|
|
195
|
+ && loadURLStringInViews(uri.toString())) {
|
|
196
|
+ return;
|
|
197
|
+ }
|
|
198
|
+
|
159
|
199
|
if (reactInstanceManager != null) {
|
160
|
200
|
reactInstanceManager.onNewIntent(intent);
|
161
|
201
|
}
|
|
@@ -196,7 +236,9 @@ public class JitsiMeetView extends FrameLayout {
|
196
|
236
|
|
197
|
237
|
// Hook this JitsiMeetView into ExternalAPI.
|
198
|
238
|
externalAPIScope = UUID.randomUUID().toString();
|
199
|
|
- views.add(this);
|
|
239
|
+ synchronized (views) {
|
|
240
|
+ views.add(this);
|
|
241
|
+ }
|
200
|
242
|
}
|
201
|
243
|
|
202
|
244
|
/**
|