45 lines
1.7 KiB
Java
45 lines
1.7 KiB
Java
package com.facebook.appevents.internal;
|
|
|
|
import android.app.Application;
|
|
import android.content.Context;
|
|
import android.os.Bundle;
|
|
import android.util.Log;
|
|
import com.facebook.FacebookSdk;
|
|
import com.facebook.appevents.AppEventsLogger;
|
|
import com.facebook.internal.FetchedAppSettings;
|
|
import com.facebook.internal.FetchedAppSettingsManager;
|
|
import com.facebook.internal.Validate;
|
|
|
|
/* loaded from: classes.dex */
|
|
public class AutomaticAnalyticsLogger {
|
|
private static final String a = "com.facebook.appevents.internal.AutomaticAnalyticsLogger";
|
|
|
|
public static void a() {
|
|
Context b = FacebookSdk.b();
|
|
String c = FacebookSdk.c();
|
|
boolean e = FacebookSdk.e();
|
|
Validate.a(b, "context");
|
|
if (e) {
|
|
if (b instanceof Application) {
|
|
AppEventsLogger.a((Application) b, c);
|
|
} else {
|
|
Log.w(a, "Automatic logging of basic events will not happen, because FacebookSdk.getApplicationContext() returns object that is not instance of android.app.Application. Make sure you call FacebookSdk.sdkInitialize() from Application class and pass application context.");
|
|
}
|
|
}
|
|
}
|
|
|
|
public static void a(String str, long j) {
|
|
Context b = FacebookSdk.b();
|
|
String c = FacebookSdk.c();
|
|
Validate.a(b, "context");
|
|
FetchedAppSettings a2 = FetchedAppSettingsManager.a(c, false);
|
|
if (a2 == null || !a2.a() || j <= 0) {
|
|
return;
|
|
}
|
|
AppEventsLogger b2 = AppEventsLogger.b(b);
|
|
Bundle bundle = new Bundle(1);
|
|
bundle.putCharSequence("fb_aa_time_spent_view_name", str);
|
|
b2.a("fb_aa_time_spent_on_view", j, bundle);
|
|
}
|
|
}
|