@Override
 protected String doInBackground(Context... contexts) {
   String result = null;
   Context context = contexts[0];
   if (context != null) {
     Info adInfo = null;
     try {
       adInfo = AdvertisingIdClient.getAdvertisingIdInfo(context);
       if (adInfo != null) {
         result = adInfo.getId();
       }
     } catch (Exception e) {
       Log.e("Pubnative", "Error retrieving androidAdvertisingID: " + e.toString());
     }
   }
   return result;
 }
Esempio n. 2
0
 zza zzY() throws IOException {
   synchronized (zzam.class) {
     try {
       zza com_google_android_gms_internal_zzam_zza;
       if (!zznr.await(2, TimeUnit.SECONDS)) {
         com_google_android_gms_internal_zzam_zza = new zza(this, null, false);
         return com_google_android_gms_internal_zzam_zza;
       } else if (zznq == null) {
         com_google_android_gms_internal_zzam_zza = new zza(this, null, false);
         return com_google_android_gms_internal_zzam_zza;
       } else {
         Info info = zznq.getInfo();
         return new zza(this, zzk(info.getId()), info.isLimitAdTrackingEnabled());
       }
     } catch (InterruptedException e) {
       return new zza(this, null, false);
     }
   }
 }