Esempio n. 1
0
 static String reflectedGetAdvertisingId(final Object adInfo, final String defaultValue) {
   try {
     return (String) MethodBuilderFactory.create(adInfo, "getId").execute();
   } catch (Exception exception) {
     return defaultValue;
   }
 }
Esempio n. 2
0
 static boolean reflectedIsLimitAdTrackingEnabled(
     final Object adInfo, final boolean defaultValue) {
   try {
     Boolean result =
         (Boolean) MethodBuilderFactory.create(adInfo, "isLimitAdTrackingEnabled").execute();
     return (result != null) ? result : defaultValue;
   } catch (Exception exception) {
     return defaultValue;
   }
 }
Esempio n. 3
0
  static boolean isGpsAvailable(final Context context) {
    try {
      MethodBuilder methodBuilder =
          MethodBuilderFactory.create(null, "isGooglePlayServicesAvailable")
              .setStatic(Class.forName(sPlayServicesUtilClassName))
              .addParam(Context.class, context);

      Object result = methodBuilder.execute();

      return (result != null && (Integer) result == GOOGLE_PLAY_SUCCESS_CODE);
    } catch (Exception exception) {
      return false;
    }
  }