Showing
2 changed files
with
8 additions
and
3 deletions
... | @@ -22,6 +22,8 @@ import androidx.work.WorkManager; | ... | @@ -22,6 +22,8 @@ import androidx.work.WorkManager; |
22 | 22 | ||
23 | import com.bumptech.glide.Glide; | 23 | import com.bumptech.glide.Glide; |
24 | import com.bumptech.glide.load.engine.DiskCacheStrategy; | 24 | import com.bumptech.glide.load.engine.DiskCacheStrategy; |
25 | +import com.google.android.gms.common.ConnectionResult; | ||
26 | +import com.google.android.gms.common.GoogleApiAvailability; | ||
25 | import com.google.zxing.BarcodeFormat; | 27 | import com.google.zxing.BarcodeFormat; |
26 | import com.google.zxing.common.BitMatrix; | 28 | import com.google.zxing.common.BitMatrix; |
27 | import com.google.zxing.oned.EAN13Writer; | 29 | import com.google.zxing.oned.EAN13Writer; |
... | @@ -134,7 +136,7 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener | ... | @@ -134,7 +136,7 @@ public class CouponInfoActivity extends Activity implements View.OnClickListener |
134 | if (view.getId() == R.id.ll_shops) { | 136 | if (view.getId() == R.id.ll_shops) { |
135 | WarplyAnalyticsManager.logTrackersEvent(this, "click", "SeeShops"); | 137 | WarplyAnalyticsManager.logTrackersEvent(this, "click", "SeeShops"); |
136 | 138 | ||
137 | - if (WarplyDeviceInfoCollector.isPackageInstalled("com.android.vending", getPackageManager())) { | 139 | + if (GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(CouponInfoActivity.this) == ConnectionResult.SUCCESS) { |
138 | Intent intent = new Intent(CouponInfoActivity.this, ShopsActivity.class); | 140 | Intent intent = new Intent(CouponInfoActivity.this, ShopsActivity.class); |
139 | intent.putExtra("couponset", (Serializable) mCouponset); | 141 | intent.putExtra("couponset", (Serializable) mCouponset); |
140 | startActivity(intent); | 142 | startActivity(intent); | ... | ... |
... | @@ -14,6 +14,9 @@ import android.util.Base64; | ... | @@ -14,6 +14,9 @@ import android.util.Base64; |
14 | import android.view.Display; | 14 | import android.view.Display; |
15 | import android.view.WindowManager; | 15 | import android.view.WindowManager; |
16 | 16 | ||
17 | +import com.google.android.gms.common.ConnectionResult; | ||
18 | +import com.google.android.gms.common.GoogleApiAvailability; | ||
19 | + | ||
17 | import org.json.JSONArray; | 20 | import org.json.JSONArray; |
18 | import org.json.JSONException; | 21 | import org.json.JSONException; |
19 | import org.json.JSONObject; | 22 | import org.json.JSONObject; |
... | @@ -56,7 +59,7 @@ public class WarplyDeviceInfoCollector { | ... | @@ -56,7 +59,7 @@ public class WarplyDeviceInfoCollector { |
56 | JSONObject jObj = new JSONObject(); | 59 | JSONObject jObj = new JSONObject(); |
57 | new Thread(() -> { | 60 | new Thread(() -> { |
58 | if (!Thread.currentThread().isInterrupted()) { | 61 | if (!Thread.currentThread().isInterrupted()) { |
59 | - if (isPackageInstalled("com.android.vending", mContext.getPackageManager())) { | 62 | + if (GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(mContext) == ConnectionResult.SUCCESS) { |
60 | //Google Play Services are available | 63 | //Google Play Services are available |
61 | try { | 64 | try { |
62 | if (WarpUtils.getTrackersEnabled(mContext)) { | 65 | if (WarpUtils.getTrackersEnabled(mContext)) { |
... | @@ -106,7 +109,7 @@ public class WarplyDeviceInfoCollector { | ... | @@ -106,7 +109,7 @@ public class WarplyDeviceInfoCollector { |
106 | new Thread(() -> { | 109 | new Thread(() -> { |
107 | if (!Thread.currentThread().isInterrupted()) { | 110 | if (!Thread.currentThread().isInterrupted()) { |
108 | // For GoogleApiAvailability we need to add a meta tag in Manifest | 111 | // For GoogleApiAvailability we need to add a meta tag in Manifest |
109 | - if (isPackageInstalled("com.android.vending", mContext.getPackageManager())) { | 112 | + if (GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(mContext) == ConnectionResult.SUCCESS) { |
110 | //Google Play Services are available | 113 | //Google Play Services are available |
111 | try { | 114 | try { |
112 | if (WarpUtils.getTrackersEnabled(mContext)) { | 115 | if (WarpUtils.getTrackersEnabled(mContext)) { | ... | ... |
-
Please register or login to post a comment