mirror of
https://github.com/nextcloud/talk-android
synced 2025-01-31 11:32:00 +00:00
parent
bdbb3a8cd1
commit
0fcc3a7fea
@ -28,4 +28,9 @@ public class ClosedInterfaceImpl implements ClosedInterface {
|
||||
public void providerInstallerInstallIfNeededAsync() {
|
||||
// does absolutely nothing :)
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isGooglePlayServicesAvailable() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -39,9 +39,9 @@ public class ClosedInterfaceImpl implements ClosedInterface, ProviderInstallList
|
||||
|
||||
@Override
|
||||
public boolean isGooglePlayServicesAvailable() {
|
||||
GoogleApiAvailability api = GoogleApiAvailability.getInstance();
|
||||
int code = api.isGooglePlayServicesAvailable(NextcloudTalkApplication.getSharedApplication().getApplicationContext());
|
||||
return code == ConnectionResult.SUCCESS;
|
||||
GoogleApiAvailability googleApiAvailability = GoogleApiAvailability.getInstance();
|
||||
int resultCode = googleApiAvailability.isGooglePlayServicesAvailable(context);
|
||||
return resultCode == ConnectionResult.SUCCESS;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -46,10 +46,11 @@ import com.nextcloud.talk.models.json.generic.Status;
|
||||
import com.nextcloud.talk.models.json.rooms.RoomsOverall;
|
||||
import com.nextcloud.talk.models.json.userprofile.UserProfileOverall;
|
||||
import com.nextcloud.talk.utils.ApiUtils;
|
||||
import com.nextcloud.talk.utils.singletons.ApplicationWideMessageHolder;
|
||||
import com.nextcloud.talk.utils.ClosedInterfaceImpl;
|
||||
import com.nextcloud.talk.utils.bundle.BundleKeys;
|
||||
import com.nextcloud.talk.utils.database.user.UserUtils;
|
||||
import com.nextcloud.talk.utils.preferences.AppPreferences;
|
||||
import com.nextcloud.talk.utils.singletons.ApplicationWideMessageHolder;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
@ -261,7 +262,13 @@ public class AccountVerificationController extends BaseController {
|
||||
public void onNext(UserEntity userEntity) {
|
||||
internalAccountId = userEntity.getId();
|
||||
|
||||
registerForPush();
|
||||
if (new ClosedInterfaceImpl().isGooglePlayServicesAvailable()) {
|
||||
registerForPush();
|
||||
} else {
|
||||
getActivity().runOnUiThread(() -> progressText.setText(progressText.getText().toString() + "\n" +
|
||||
getResources().getString(R.string.nc_push_disabled)));
|
||||
fetchAndStoreCapabilities();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -22,4 +22,5 @@ package com.nextcloud.talk.interfaces;
|
||||
|
||||
public interface ClosedInterface {
|
||||
void providerInstallerInstallIfNeededAsync();
|
||||
boolean isGooglePlayServicesAvailable();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user