package com.facebook.internal; import android.content.Context; import com.facebook.LoggingBehavior; import java.util.HashMap; import java.util.Map; import org.json.JSONException; import org.json.JSONObject; /* loaded from: classes.dex */ public class AppEventsLoggerUtility { private static final Map a = new HashMap() { // from class: com.facebook.internal.AppEventsLoggerUtility.1 { put(GraphAPIActivityType.MOBILE_INSTALL_EVENT, "MOBILE_APP_INSTALL"); put(GraphAPIActivityType.CUSTOM_APP_EVENTS, "CUSTOM_APP_EVENTS"); } }; public enum GraphAPIActivityType { MOBILE_INSTALL_EVENT, CUSTOM_APP_EVENTS } public static JSONObject a(GraphAPIActivityType graphAPIActivityType, AttributionIdentifiers attributionIdentifiers, String str, boolean z, Context context) throws JSONException { JSONObject jSONObject = new JSONObject(); jSONObject.put("event", a.get(graphAPIActivityType)); Utility.a(jSONObject, attributionIdentifiers, str, z); try { Utility.a(jSONObject, context); } catch (Exception e) { Logger.a(LoggingBehavior.APP_EVENTS, "AppEvents", "Fetching extended device info parameters failed: '%s'", e.toString()); } jSONObject.put("application_package_name", context.getPackageName()); return jSONObject; } }