@ SuppressWarnings ( { "WeakerAccess" } ) protected void initDeviceID ( ) { getDeviceCachedInfo ( ) ; // put this here to avoid running on main thread // generate a provisional while we do the rest async generateProvisionalGUID ( ) ; // grab and cache the googleAdID in any event if available // if we already have a deviceID we won't user ad id as the guid cacheGoogleAdID ( ) ; // if we already have a device ID use it and just notify // otherwise generate one, either from ad id if available or the provisional String deviceID = getDeviceID ( ) ; if ( deviceID == null || deviceID . trim ( ) . length ( ) <= 2 ) { generateDeviceID ( ) ; } }
don t run on main thread