11package io .branch .referral ;
22
3- import static io .branch .referral .Defines .Jsonkey .GOOGLE_PLAY_STORE ;
4- import static io .branch .referral .Defines .Jsonkey .HUAWEI_APP_GALLERY ;
5- import static io .branch .referral .Defines .Jsonkey .SAMSUNG_GALAXY_STORE ;
6- import static io .branch .referral .Defines .Jsonkey .XIAOMI_GET_APPS ;
3+ import static io .branch .referral .Defines .Jsonkey .Google_Play_Store ;
4+ import static io .branch .referral .Defines .Jsonkey .Huawei_App_Gallery ;
5+ import static io .branch .referral .Defines .Jsonkey .Samsung_Galaxy_Store ;
6+ import static io .branch .referral .Defines .Jsonkey .Xiaomi_Get_Apps ;
77
88import android .content .Context ;
99import android .text .TextUtils ;
@@ -19,62 +19,62 @@ public class StoreReferrerUtils {
1919 */
2020 public static String getLatestValidReferrerStore (){
2121 String result = "" ;
22- Long latestTimeStamp = Long . MIN_VALUE ;
22+ Long latestTimeStamp = 0L ;
2323
2424 if (StoreReferrerGooglePlayStore .installBeginTimestamp > latestTimeStamp ){
2525 latestTimeStamp = StoreReferrerGooglePlayStore .installBeginTimestamp ;
26- result = GOOGLE_PLAY_STORE .getKey ();
26+ result = Google_Play_Store .getKey ();
2727 }
2828
2929 if (StoreReferrerHuaweiAppGallery .installBeginTimestamp > latestTimeStamp ){
3030 latestTimeStamp = StoreReferrerHuaweiAppGallery .installBeginTimestamp ;
31- result = HUAWEI_APP_GALLERY .getKey ();
31+ result = Huawei_App_Gallery .getKey ();
3232 }
3333
3434 if (StoreReferrerSamsungGalaxyStore .installBeginTimestamp > latestTimeStamp ){
3535 latestTimeStamp = StoreReferrerSamsungGalaxyStore .installBeginTimestamp ;
36- result = SAMSUNG_GALAXY_STORE .getKey ();
36+ result = Samsung_Galaxy_Store .getKey ();
3737 }
3838
3939 if (StoreReferrerXiaomiGetApps .installBeginTimestamp > latestTimeStamp ){
40- result = XIAOMI_GET_APPS .getKey ();
40+ result = Xiaomi_Get_Apps .getKey ();
4141 }
4242
4343 // iterate through non-null strings for cases like Google Play returning
4444 // "utm_source=google-play&utm_medium=organic" for organic installs
4545 if (result .isEmpty ()){
4646 if (!TextUtils .isEmpty (StoreReferrerGooglePlayStore .rawReferrer )){
47- result = GOOGLE_PLAY_STORE .getKey ();
47+ result = Google_Play_Store .getKey ();
4848 }
4949
5050 if (!TextUtils .isEmpty (StoreReferrerHuaweiAppGallery .rawReferrer )){
51- result = HUAWEI_APP_GALLERY .getKey ();
51+ result = Huawei_App_Gallery .getKey ();
5252 }
5353
5454 if (!TextUtils .isEmpty (StoreReferrerSamsungGalaxyStore .rawReferrer )){
55- result = SAMSUNG_GALAXY_STORE .getKey ();
55+ result = Samsung_Galaxy_Store .getKey ();
5656 }
5757
5858 if (!TextUtils .isEmpty (StoreReferrerXiaomiGetApps .rawReferrer )){
59- result = XIAOMI_GET_APPS .getKey ();
59+ result = Xiaomi_Get_Apps .getKey ();
6060 }
6161 }
6262
6363 return result ;
6464 }
6565
6666 public static void writeLatestInstallReferrer (Context context_ , String store ) {
67- if (store .equals (Defines .Jsonkey .GOOGLE_PLAY_STORE .getKey ())){
68- AppStoreReferrer .processReferrerInfo (context_ , StoreReferrerGooglePlayStore .rawReferrer , StoreReferrerGooglePlayStore .clickTimestamp , StoreReferrerGooglePlayStore .installBeginTimestamp );
67+ if (store .equals (Defines .Jsonkey .Google_Play_Store .getKey ())){
68+ AppStoreReferrer .processReferrerInfo (context_ , StoreReferrerGooglePlayStore .rawReferrer , StoreReferrerGooglePlayStore .clickTimestamp , StoreReferrerGooglePlayStore .installBeginTimestamp , store );
6969 }
70- if (store .equals (Defines .Jsonkey .HUAWEI_APP_GALLERY .getKey ())){
71- AppStoreReferrer .processReferrerInfo (context_ , StoreReferrerHuaweiAppGallery .rawReferrer , StoreReferrerHuaweiAppGallery .clickTimestamp , StoreReferrerHuaweiAppGallery .installBeginTimestamp );
70+ if (store .equals (Defines .Jsonkey .Huawei_App_Gallery .getKey ())){
71+ AppStoreReferrer .processReferrerInfo (context_ , StoreReferrerHuaweiAppGallery .rawReferrer , StoreReferrerHuaweiAppGallery .clickTimestamp , StoreReferrerHuaweiAppGallery .installBeginTimestamp , store );
7272 }
73- if (store .equals (Defines .Jsonkey .SAMSUNG_GALAXY_STORE .getKey ())){
74- AppStoreReferrer .processReferrerInfo (context_ , StoreReferrerSamsungGalaxyStore .rawReferrer , StoreReferrerSamsungGalaxyStore .clickTimestamp , StoreReferrerSamsungGalaxyStore .installBeginTimestamp );
73+ if (store .equals (Defines .Jsonkey .Samsung_Galaxy_Store .getKey ())){
74+ AppStoreReferrer .processReferrerInfo (context_ , StoreReferrerSamsungGalaxyStore .rawReferrer , StoreReferrerSamsungGalaxyStore .clickTimestamp , StoreReferrerSamsungGalaxyStore .installBeginTimestamp , store );
7575 }
76- if (store .equals (Defines .Jsonkey .XIAOMI_GET_APPS .getKey ())){
77- AppStoreReferrer .processReferrerInfo (context_ , StoreReferrerXiaomiGetApps .rawReferrer , StoreReferrerXiaomiGetApps .clickTimestamp , StoreReferrerXiaomiGetApps .installBeginTimestamp );
76+ if (store .equals (Defines .Jsonkey .Xiaomi_Get_Apps .getKey ())){
77+ AppStoreReferrer .processReferrerInfo (context_ , StoreReferrerXiaomiGetApps .rawReferrer , StoreReferrerXiaomiGetApps .clickTimestamp , StoreReferrerXiaomiGetApps .installBeginTimestamp , store );
7878 }
7979 }
8080}
0 commit comments