diff --git a/build.gradle b/build.gradle index 8558d6c3..63d96ee5 100644 --- a/build.gradle +++ b/build.gradle @@ -35,7 +35,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:4.1.2' + classpath 'com.android.tools.build:gradle:4.1.3' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion" classpath "com.squareup.wire:wire-gradle-plugin:$wireVersion" } @@ -45,8 +45,8 @@ allprojects { apply plugin: 'idea' group = 'org.microg.gms' - version = "0.2.18.210390" - ext.appVersionCode = 210390001 + version = "0.2.18.210500" + ext.appVersionCode = 210500001 ext.isReleaseVersion = false } diff --git a/play-services-base/src/main/java/com/google/android/gms/common/GoogleApiAvailability.java b/play-services-base/src/main/java/com/google/android/gms/common/GoogleApiAvailability.java index 889cc7f6..30afec09 100644 --- a/play-services-base/src/main/java/com/google/android/gms/common/GoogleApiAvailability.java +++ b/play-services-base/src/main/java/com/google/android/gms/common/GoogleApiAvailability.java @@ -163,6 +163,19 @@ public class GoogleApiAvailability { return SUCCESS; } + /** + * Verifies that Google Play services is installed and enabled on this device, and that the version installed on + * this device is no older than the one required by this client or the version is not older than the one specified + * in minApkVersion. + * + * @return status code indicating whether there was an error. Can be one of following in + * {@link ConnectionResult}: SUCCESS, SERVICE_MISSING, SERVICE_UPDATING, + * SERVICE_VERSION_UPDATE_REQUIRED, SERVICE_DISABLED, SERVICE_INVALID + */ + public int isGooglePlayServicesAvailable(Context context, int minApkVersion) { + return isGooglePlayServicesAvailable(context); + } + /** * Determines whether an error can be resolved via user action. If true, proceed by calling * {@link #getErrorDialog(Activity, int, int)} and showing the dialog. diff --git a/play-services-basement/build.gradle b/play-services-basement/build.gradle index 4f2f05c5..bc627a1b 100644 --- a/play-services-basement/build.gradle +++ b/play-services-basement/build.gradle @@ -16,7 +16,6 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' -apply plugin: 'kotlin-android-extensions' dependencies { api "org.microg:safe-parcel:1.7.0" @@ -41,6 +40,10 @@ android { buildConfigField "int", "VERSION_CODE", "$appVersionCode" } + buildFeatures { + viewBinding = true + } + sourceSets { main.java.srcDirs += 'src/main/kotlin' } diff --git a/play-services-core/build.gradle b/play-services-core/build.gradle index 2a878698..7f3739f6 100644 --- a/play-services-core/build.gradle +++ b/play-services-core/build.gradle @@ -17,7 +17,6 @@ apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' -apply plugin: 'kotlin-android-extensions' dependencies { implementation 'com.squareup.wire:wire-runtime:3.6.1' @@ -70,6 +69,7 @@ android { buildFeatures { dataBinding = true + viewBinding = true } sourceSets { diff --git a/play-services-core/src/main/AndroidManifest.xml b/play-services-core/src/main/AndroidManifest.xml index 0f7699b3..8acb9c0d 100644 --- a/play-services-core/src/main/AndroidManifest.xml +++ b/play-services-core/src/main/AndroidManifest.xml @@ -331,12 +331,6 @@ android:resource="@string/gms_settings_summary" /> - - = 0 && !cursor.isNull(idx)) url = cursor.getString(idx); } cursor.close(); databaseHelper.close(); @@ -75,7 +75,7 @@ public class PeopleManager { } public static Bitmap getOwnerAvatarBitmap(Context context, String accountName, boolean network) { - File avaterFile = getOwnerAvaterFile(context, accountName, network); + File avaterFile = getOwnerAvatarFile(context, accountName, network); if (avaterFile == null) return null; return BitmapFactory.decodeFile(avaterFile.getPath()); } diff --git a/play-services-core/src/main/java/org/microg/gms/people/PeopleServiceImpl.java b/play-services-core/src/main/java/org/microg/gms/people/PeopleServiceImpl.java index dbccb1c8..8f0a88d3 100644 --- a/play-services-core/src/main/java/org/microg/gms/people/PeopleServiceImpl.java +++ b/play-services-core/src/main/java/org/microg/gms/people/PeopleServiceImpl.java @@ -121,7 +121,7 @@ public class PeopleServiceImpl extends IPeopleService.Stub { extras.putBoolean("rewindable", false); extras.putInt("width", 0); extras.putInt("height", 0); - File avaterFile = PeopleManager.getOwnerAvaterFile(context, account, true); + File avaterFile = PeopleManager.getOwnerAvatarFile(context, account, true); try { ParcelFileDescriptor fileDescriptor = null; if (avaterFile != null) { diff --git a/play-services-core/src/main/java/org/microg/gms/ui/AskPushPermission.java b/play-services-core/src/main/java/org/microg/gms/ui/AskPushPermission.java deleted file mode 100755 index 8fdef45f..00000000 --- a/play-services-core/src/main/java/org/microg/gms/ui/AskPushPermission.java +++ /dev/null @@ -1,64 +0,0 @@ -package org.microg.gms.ui; - -import android.app.Activity; -import android.content.Intent; -import android.content.pm.ApplicationInfo; -import android.content.pm.PackageManager; -import android.os.Bundle; -import android.os.ResultReceiver; -import android.text.Html; -import android.widget.TextView; - -import androidx.fragment.app.FragmentActivity; - -import com.mgoogle.android.gms.R; - -import org.microg.gms.gcm.GcmDatabase; -import org.microg.gms.gcm.PushRegisterService; - -import static org.microg.gms.gcm.GcmConstants.EXTRA_APP; -import static org.microg.gms.gcm.GcmConstants.EXTRA_KID; -import static org.microg.gms.gcm.GcmConstants.EXTRA_PENDING_INTENT; - -public class AskPushPermission extends FragmentActivity { - public static final String EXTRA_REQUESTED_PACKAGE = "package"; - public static final String EXTRA_RESULT_RECEIVER = "receiver"; - public static final String EXTRA_EXPLICIT = "explicit"; - - private GcmDatabase database; - - private String packageName; - private ResultReceiver resultReceiver; - private boolean answered; - - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - database = new GcmDatabase(this); - - packageName = getIntent().getStringExtra(EXTRA_REQUESTED_PACKAGE); - resultReceiver = getIntent().getParcelableExtra(EXTRA_RESULT_RECEIVER); - if (packageName == null || resultReceiver == null) { - answered = true; - finish(); - return; - } - - if (database.getApp(packageName) != null) { - resultReceiver.send(Activity.RESULT_OK, Bundle.EMPTY); - answered = true; - finish(); - return; - } - } - - @Override - protected void onDestroy() { - super.onDestroy(); - if (!answered) { - resultReceiver.send(Activity.RESULT_CANCELED, Bundle.EMPTY); - } - database.close(); - } -} diff --git a/play-services-core/src/main/kotlin/org/microg/gms/gcm/PushRegisterService.kt b/play-services-core/src/main/kotlin/org/microg/gms/gcm/PushRegisterService.kt index 1b0e0c94..00d0721e 100644 --- a/play-services-core/src/main/kotlin/org/microg/gms/gcm/PushRegisterService.kt +++ b/play-services-core/src/main/kotlin/org/microg/gms/gcm/PushRegisterService.kt @@ -24,7 +24,6 @@ import org.microg.gms.common.ForegroundServiceContext import org.microg.gms.common.PackageUtils import org.microg.gms.common.Utils import org.microg.gms.gcm.GcmConstants.* -import org.microg.gms.ui.AskPushPermission import java.util.concurrent.atomic.AtomicBoolean import kotlin.coroutines.resume import kotlin.coroutines.suspendCoroutine @@ -97,11 +96,12 @@ class PushRegisterService : LifecycleService() { } override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int { - WakefulBroadcastReceiver.completeWakefulIntent(intent) - Log.d(TAG, "onStartCommand: $intent") - lifecycleScope.launchWhenStarted { - if (intent == null) return@launchWhenStarted - handleIntent(intent) + if (intent != null) { + WakefulBroadcastReceiver.completeWakefulIntent(intent) + Log.d(TAG, "onStartCommand: $intent") + lifecycleScope.launchWhenStarted { + handleIntent(intent) + } } return super.onStartCommand(intent, flags, startId) }