Explicitly check for disabled play services if needs update
Fixes #6381 // FREEBIE
This commit is contained in:
parent
5672701a60
commit
58273997b9
1 changed files with 12 additions and 0 deletions
|
@ -3,6 +3,8 @@ package org.thoughtcrime.securesms;
|
|||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
|
@ -279,6 +281,16 @@ public class RegistrationActivity extends BaseActionBarActivity {
|
|||
case ConnectionResult.SUCCESS:
|
||||
return PlayServicesStatus.SUCCESS;
|
||||
case ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED:
|
||||
try {
|
||||
ApplicationInfo applicationInfo = getPackageManager().getApplicationInfo("com.google.android.gms", 0);
|
||||
|
||||
if (applicationInfo != null && !applicationInfo.enabled) {
|
||||
return PlayServicesStatus.MISSING;
|
||||
}
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
Log.w(TAG, e);
|
||||
}
|
||||
|
||||
return PlayServicesStatus.NEEDS_UPDATE;
|
||||
case ConnectionResult.SERVICE_DISABLED:
|
||||
case ConnectionResult.SERVICE_MISSING:
|
||||
|
|
Loading…
Add table
Reference in a new issue