@@ -50,8 +50,6 @@ static const ::firebase::App* g_app = nullptr;
50
50
X (LogEvent, " logEvent" , " (Ljava/lang/String;Landroid/os/Bundle;)V" ), \
51
51
X (SetUserProperty, " setUserProperty" , \
52
52
" (Ljava/lang/String;Ljava/lang/String;)V" ), \
53
- X (SetCurrentScreen, " setCurrentScreen" , \
54
- " (Landroid/app/Activity;Ljava/lang/String;Ljava/lang/String;)V" ), \
55
53
X (SetUserId, " setUserId" , " (Ljava/lang/String;)V" ), \
56
54
X (SetSessionTimeoutDuration, " setSessionTimeoutDuration" , " (J)V" ), \
57
55
X (ResetAnalyticsData, " resetAnalyticsData" , " ()V" ), \
@@ -309,54 +307,6 @@ void SetSessionTimeoutDuration(int64_t milliseconds) {
309
307
util::CheckAndClearJniExceptions (env);
310
308
}
311
309
312
- namespace {
313
- // Data passed into SetCurrentScreen, stored here because it is needed on a
314
- // different thread.
315
- struct SetCurrentScreenData {
316
- SetCurrentScreenData () : screen_name(nullptr ), screen_class(nullptr ) {}
317
- SetCurrentScreenData (const char * screen_name_, const char * screen_class_)
318
- : screen_name(screen_name_ ? new std::string(screen_name_) : nullptr ),
319
- screen_class (screen_class_ ? new std::string(screen_class_) : nullptr) {
320
- }
321
- ~SetCurrentScreenData () {
322
- if (screen_name) delete screen_name;
323
- screen_name = nullptr ;
324
- if (screen_class) delete screen_class;
325
- screen_class = nullptr ;
326
- }
327
- // These are pointers to std::string because these can be null.
328
- std::string* screen_name;
329
- std::string* screen_class;
330
- };
331
- } // namespace
332
-
333
- static void SetCurrentScreenReal (void * raw_data) {
334
- SetCurrentScreenData* data =
335
- reinterpret_cast <SetCurrentScreenData*>(raw_data);
336
- raw_data = nullptr ;
337
- const char * screen_name =
338
- data->screen_name ? data->screen_name ->c_str () : nullptr ;
339
- const char * screen_class =
340
- data->screen_class ? data->screen_class ->c_str () : nullptr ;
341
-
342
- JNIEnv* env = g_app->GetJNIEnv ();
343
- jstring jni_screen_name =
344
- screen_name ? env->NewStringUTF (screen_name) : nullptr ;
345
- jstring jni_screen_class =
346
- screen_class ? env->NewStringUTF (screen_class) : nullptr ;
347
- env->CallVoidMethod (g_analytics_class_instance,
348
- analytics::GetMethodId (analytics::kSetCurrentScreen ),
349
- g_app->activity (), jni_screen_name, jni_screen_class);
350
- if (util::CheckAndClearJniExceptions (env)) {
351
- LogError (" Unable to set current screen name='%s', class='%s'" , screen_name,
352
- screen_class);
353
- }
354
- if (jni_screen_name) env->DeleteLocalRef (jni_screen_name);
355
- if (jni_screen_class) env->DeleteLocalRef (jni_screen_class);
356
-
357
- delete data;
358
- }
359
-
360
310
void ResetAnalyticsData () {
361
311
FIREBASE_ASSERT_RETURN_VOID (internal::IsInitialized ());
362
312
JNIEnv* env = g_app->GetJNIEnv ();
0 commit comments