Commit 9d23b801 authored by Romain Hunault's avatar Romain Hunault
Browse files

Merge branch '3605-import-v0.2.21.212158' into 'master'

Update microG to v0.2.21.212158

See merge request e/apps/GmsCore!32
parents 64ef18b5 07aee04c
Pipeline #130806 failed with stages
in 3 minutes and 7 seconds
......@@ -4,7 +4,7 @@
*/
buildscript {
ext.cronetVersion = '91.0.4472.120'
ext.cronetVersion = '91.0.4472.120.1'
ext.nlpVersion = '2.0-alpha6'
ext.remoteDroidGuardVersion = '0.1.2'
ext.safeParcelVersion = '1.7.0'
......@@ -116,4 +116,3 @@ subprojects {
google()
}
}
......@@ -4,6 +4,7 @@ import android.content.ContentValues
import android.content.Context
import android.database.Cursor
import android.net.Uri
import android.os.Binder
object SettingsContract {
const val AUTHORITY = "org.microg.gms.settings"
......@@ -103,15 +104,24 @@ object SettingsContract {
const val CONTENT_TYPE = "vnd.android.cursor.item/vnd.$AUTHORITY.$id"
}
fun <T> getSettings(context: Context, uri: Uri, projection: Array<out String>?, f: (Cursor) -> T): T {
private fun <T> withoutCallingIdentity(f: () -> T): T {
val identity = Binder.clearCallingIdentity()
try {
return f.invoke()
} finally {
Binder.restoreCallingIdentity(identity)
}
}
fun <T> getSettings(context: Context, uri: Uri, projection: Array<out String>?, f: (Cursor) -> T): T = withoutCallingIdentity {
context.contentResolver.query(uri, projection, null, null, null).use { c ->
require(c != null) { "Cursor for query $uri ${projection?.toList()} was null" }
if (!c.moveToFirst()) error("Cursor for query $uri ${projection?.toList()} was empty")
return f.invoke(c)
f.invoke(c)
}
}
fun setSettings(context: Context, uri: Uri, v: ContentValues.() -> Unit) {
fun setSettings(context: Context, uri: Uri, v: ContentValues.() -> Unit) = withoutCallingIdentity {
val values = ContentValues().apply { v.invoke(this) }
val affected = context.contentResolver.update(uri, values, null, null)
require(affected == 1) { "Update for $uri with $values affected 0 rows"}
......
......@@ -37,6 +37,7 @@ public class AboutFragment extends AbstractAboutFragment {
libraries.add(new AbstractAboutFragment.Library("de.hdodenhof.circleimageview", "CircleImageView", "Apache License 2.0, Henning Dodenhof"));
libraries.add(new AbstractAboutFragment.Library("su.litvak.chromecast.api.v2", "ChromeCast Java API v2", "Apache License 2.0, Vitaly Litvak"));
libraries.add(new AbstractAboutFragment.Library("org.conscrypt", "Conscrypt", "Apache License 2.0, The Android Open Source Project"));
libraries.add(new AbstractAboutFragment.Library("org.chromium.net", "Cronet", "BSD-style License, The Chromium Authors"));
libraries.add(new AbstractAboutFragment.Library("org.microg.safeparcel", "SafeParcel", "Apache License 2.0, microG Team"));
libraries.add(new AbstractAboutFragment.Library("org.slf4j", "SLF4J", "MIT License, QOS.ch"));
libraries.add(new AbstractAboutFragment.Library("org.microg.nlp.service", "UnifiedNlp", "Apache License 2.0, microG Team"));
......
......@@ -8,7 +8,11 @@ apply plugin: 'maven-publish'
apply plugin: 'signing'
dependencies {
implementation("org.microg:cronet-api:$cronetVersion")
// TODO: Embedding the API causes random crashes as the Android AOT compiler will link the native implementation to
// out API classes even if embedded by a third-party app that comes with their own API classes.
// Need to find a better way to disable AOT for Cronet. Could be by packaging cronet as it's own apk that is
// embedded in the main APK but only loaded at runtime so that the AOT compiler has no way to become active.
// implementation("org.microg:cronet-api:$cronetVersion")
implementation("org.microg:cronet-common:$cronetVersion")
implementation("org.microg:cronet-native:$cronetVersion")
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment