@@ -53,13 +53,13 @@ public class ActivityHandler extends HandlerThread {
5353 private static final String TIME_TRAVEL = "Time travel!" ;
5454 private static final String ADJUST_PREFIX = "adjust_" ;
5555
56- private final SessionHandler sessionHandler ;
56+ private SessionHandler sessionHandler ;
5757 private IPackageHandler packageHandler ;
5858 private OnFinishedListener onFinishedListener ;
5959 private ActivityState activityState ;
60- private final Logger logger ;
60+ private Logger logger ;
6161 private static ScheduledExecutorService timer ;
62- private final Context context ;
62+ private Context context ;
6363 private String environment ;
6464 private String defaultTracker ;
6565 private boolean eventBuffering ;
@@ -76,17 +76,8 @@ public class ActivityHandler extends HandlerThread {
7676
7777 public ActivityHandler (Activity activity ) {
7878 super (LOGTAG , MIN_PRIORITY );
79- setDaemon (true );
80- start ();
81- TIMER_INTERVAL = AdjustFactory .getTimerInterval ();
82- SESSION_INTERVAL = AdjustFactory .getSessionInterval ();
83- SUBSESSION_INTERVAL = AdjustFactory .getSubsessionInterval ();
84- sessionHandler = new SessionHandler (getLooper (), this );
85- context = activity .getApplicationContext ();
86- clientSdk = Constants .CLIENT_SDK ;
87- enabled = true ;
8879
89- logger = AdjustFactory . getLogger ( );
80+ initActivityHandler ( activity );
9081
9182 Message message = Message .obtain ();
9283 message .arg1 = SessionHandler .INIT_BUNDLE ;
@@ -96,8 +87,23 @@ public ActivityHandler(Activity activity) {
9687 public ActivityHandler (Activity activity , String appToken ,
9788 String environment , String logLevel , boolean eventBuffering ) {
9889 super (LOGTAG , MIN_PRIORITY );
90+
91+ initActivityHandler (activity );
92+
93+ this .appToken = appToken ;
94+ this .environment = environment ;
95+ this .eventBuffering = eventBuffering ;
96+ logger .setLogLevelString (logLevel );
97+
98+ Message message = Message .obtain ();
99+ message .arg1 = SessionHandler .INIT_PRESET ;
100+ sessionHandler .sendMessage (message );
101+ }
102+
103+ private void initActivityHandler (Activity activity ) {
99104 setDaemon (true );
100105 start ();
106+
101107 TIMER_INTERVAL = AdjustFactory .getTimerInterval ();
102108 SESSION_INTERVAL = AdjustFactory .getSessionInterval ();
103109 SUBSESSION_INTERVAL = AdjustFactory .getSubsessionInterval ();
@@ -108,14 +114,10 @@ public ActivityHandler(Activity activity, String appToken,
108114
109115 logger = AdjustFactory .getLogger ();
110116
111- this .appToken = appToken ;
112- this .environment = environment ;
113- this .eventBuffering = eventBuffering ;
114- logger .setLogLevelString (logLevel );
115-
116- Message message = Message .obtain ();
117- message .arg1 = SessionHandler .INIT_PRESET ;
118- sessionHandler .sendMessage (message );
117+ String gpsAdid = Util .getGpsAdid (context );
118+ if (gpsAdid == null ) {
119+ logger .info ("Unable to get Google Play Services Advertising ID at start time" );
120+ }
119121 }
120122
121123 public void setSdkPrefix (String sdkPrefx ) {
0 commit comments