mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-09 13:59:48 +01:00
parent
bdbb3a8cd1
commit
0fcc3a7fea
@ -28,4 +28,9 @@ public class ClosedInterfaceImpl implements ClosedInterface {
|
|||||||
public void providerInstallerInstallIfNeededAsync() {
|
public void providerInstallerInstallIfNeededAsync() {
|
||||||
// does absolutely nothing :)
|
// does absolutely nothing :)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isGooglePlayServicesAvailable() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -39,9 +39,9 @@ public class ClosedInterfaceImpl implements ClosedInterface, ProviderInstallList
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isGooglePlayServicesAvailable() {
|
public boolean isGooglePlayServicesAvailable() {
|
||||||
GoogleApiAvailability api = GoogleApiAvailability.getInstance();
|
GoogleApiAvailability googleApiAvailability = GoogleApiAvailability.getInstance();
|
||||||
int code = api.isGooglePlayServicesAvailable(NextcloudTalkApplication.getSharedApplication().getApplicationContext());
|
int resultCode = googleApiAvailability.isGooglePlayServicesAvailable(context);
|
||||||
return code == ConnectionResult.SUCCESS;
|
return resultCode == ConnectionResult.SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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.rooms.RoomsOverall;
|
||||||
import com.nextcloud.talk.models.json.userprofile.UserProfileOverall;
|
import com.nextcloud.talk.models.json.userprofile.UserProfileOverall;
|
||||||
import com.nextcloud.talk.utils.ApiUtils;
|
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.bundle.BundleKeys;
|
||||||
import com.nextcloud.talk.utils.database.user.UserUtils;
|
import com.nextcloud.talk.utils.database.user.UserUtils;
|
||||||
import com.nextcloud.talk.utils.preferences.AppPreferences;
|
import com.nextcloud.talk.utils.preferences.AppPreferences;
|
||||||
|
import com.nextcloud.talk.utils.singletons.ApplicationWideMessageHolder;
|
||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
import org.greenrobot.eventbus.Subscribe;
|
import org.greenrobot.eventbus.Subscribe;
|
||||||
@ -261,7 +262,13 @@ public class AccountVerificationController extends BaseController {
|
|||||||
public void onNext(UserEntity userEntity) {
|
public void onNext(UserEntity userEntity) {
|
||||||
internalAccountId = userEntity.getId();
|
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
|
@Override
|
||||||
|
@ -22,4 +22,5 @@ package com.nextcloud.talk.interfaces;
|
|||||||
|
|
||||||
public interface ClosedInterface {
|
public interface ClosedInterface {
|
||||||
void providerInstallerInstallIfNeededAsync();
|
void providerInstallerInstallIfNeededAsync();
|
||||||
|
boolean isGooglePlayServicesAvailable();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user