Repo Created
This commit is contained in:
parent
eb305e2886
commit
a8c22c65db
4784 changed files with 329907 additions and 2 deletions
45
play-services-base/core/package/build.gradle
Normal file
45
play-services-base/core/package/build.gradle
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2023 microG Project Team
|
||||
* SPDX-FileCopyrightText: 2023 e Foundation
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
apply plugin: 'com.android.library'
|
||||
apply plugin: 'kotlin-android'
|
||||
|
||||
dependencies {
|
||||
implementation project(':play-services-base')
|
||||
implementation project(':play-services-base-core')
|
||||
}
|
||||
|
||||
android {
|
||||
namespace "org.microg.gms.core.pkg"
|
||||
|
||||
compileSdkVersion androidCompileSdk
|
||||
buildToolsVersion "$androidBuildVersionTools"
|
||||
|
||||
defaultConfig {
|
||||
versionName version
|
||||
minSdkVersion androidMinSdk
|
||||
targetSdkVersion androidTargetSdk
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
java.srcDirs = ['src/main/kotlin']
|
||||
}
|
||||
}
|
||||
|
||||
lintOptions {
|
||||
disable 'MissingTranslation'
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility = 1.8
|
||||
targetCompatibility = 1.8
|
||||
}
|
||||
|
||||
kotlinOptions {
|
||||
jvmTarget = 1.8
|
||||
}
|
||||
}
|
||||
23
play-services-base/core/package/src/main/AndroidManifest.xml
Normal file
23
play-services-base/core/package/src/main/AndroidManifest.xml
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
~ SPDX-FileCopyrightText: 2023 microG Project Team
|
||||
~ SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<application>
|
||||
<provider
|
||||
android:name="org.microg.gms.profile.ProfileProvider"
|
||||
android:authorities="${applicationId}.microg.profile"
|
||||
android:exported="true"
|
||||
tools:ignore="ExportedContentProvider" />
|
||||
<service
|
||||
android:name="org.microg.gms.moduleinstall.ModuleInstallService"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="com.google.android.gms.chimera.container.moduleinstall.ModuleInstallService.START" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
</application>
|
||||
</manifest>
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2023 microG Project Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.microg.gms.moduleinstall
|
||||
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import com.google.android.gms.common.Feature
|
||||
import com.google.android.gms.common.api.CommonStatusCodes
|
||||
import com.google.android.gms.common.api.Status
|
||||
import com.google.android.gms.common.api.internal.IStatusCallback
|
||||
import com.google.android.gms.common.internal.ConnectionInfo
|
||||
import com.google.android.gms.common.internal.GetServiceRequest
|
||||
import com.google.android.gms.common.internal.IGmsCallbacks
|
||||
import com.google.android.gms.common.moduleinstall.ModuleAvailabilityResponse
|
||||
import com.google.android.gms.common.moduleinstall.ModuleAvailabilityResponse.AvailabilityStatus.STATUS_ALREADY_AVAILABLE
|
||||
import com.google.android.gms.common.moduleinstall.ModuleInstallIntentResponse
|
||||
import com.google.android.gms.common.moduleinstall.ModuleInstallResponse
|
||||
import com.google.android.gms.common.moduleinstall.internal.ApiFeatureRequest
|
||||
import com.google.android.gms.common.moduleinstall.internal.IModuleInstallCallbacks
|
||||
import com.google.android.gms.common.moduleinstall.internal.IModuleInstallService
|
||||
import com.google.android.gms.common.moduleinstall.internal.IModuleInstallStatusListener
|
||||
import org.microg.gms.BaseService
|
||||
import org.microg.gms.common.GmsService
|
||||
|
||||
private const val TAG = "ModuleInstall"
|
||||
|
||||
class ModuleInstallService : BaseService(TAG, GmsService.MODULE_INSTALL) {
|
||||
override fun handleServiceRequest(callback: IGmsCallbacks, request: GetServiceRequest, service: GmsService) {
|
||||
val binder = ModuleInstallServiceImpl().asBinder()
|
||||
callback.onPostInitCompleteWithConnectionInfo(CommonStatusCodes.SUCCESS, binder, ConnectionInfo().apply {
|
||||
features = arrayOf(Feature("moduleinstall", 7))
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
class ModuleInstallServiceImpl : IModuleInstallService.Stub() {
|
||||
override fun areModulesAvailable(callbacks: IModuleInstallCallbacks?, request: ApiFeatureRequest?) {
|
||||
Log.d(TAG, "Not yet implemented: areModulesAvailable $request")
|
||||
runCatching { callbacks?.onModuleAvailabilityResponse(Status.SUCCESS, ModuleAvailabilityResponse(true, STATUS_ALREADY_AVAILABLE)) }
|
||||
}
|
||||
|
||||
override fun installModules(callbacks: IModuleInstallCallbacks?, request: ApiFeatureRequest?, listener: IModuleInstallStatusListener?) {
|
||||
Log.d(TAG, "Not yet implemented: installModules $request")
|
||||
runCatching { callbacks?.onModuleInstallResponse(Status.CANCELED, ModuleInstallResponse(0, true)) }
|
||||
}
|
||||
|
||||
override fun getInstallModulesIntent(callbacks: IModuleInstallCallbacks?, request: ApiFeatureRequest?) {
|
||||
Log.d(TAG, "Not yet implemented: getInstallModulesIntent $request")
|
||||
runCatching { callbacks?.onModuleInstallIntentResponse(Status.CANCELED, ModuleInstallIntentResponse(null)) }
|
||||
}
|
||||
|
||||
override fun releaseModules(callback: IStatusCallback?, request: ApiFeatureRequest?) {
|
||||
Log.d(TAG, "Not yet implemented: releaseModules $request")
|
||||
runCatching { callback?.onResult(Status.SUCCESS) }
|
||||
}
|
||||
|
||||
override fun unregisterListener(callback: IStatusCallback?, listener: IModuleInstallStatusListener?) {
|
||||
Log.d(TAG, "Not yet implemented: unregisterListener")
|
||||
runCatching { callback?.onResult(Status.SUCCESS) }
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2023 e Foundation
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.microg.gms.profile
|
||||
|
||||
import android.content.ContentProvider
|
||||
import android.content.ContentValues
|
||||
import android.database.Cursor
|
||||
import android.database.MatrixCursor
|
||||
import android.net.Uri
|
||||
import org.microg.gms.settings.SettingsContract
|
||||
|
||||
class ProfileProvider : ContentProvider() {
|
||||
|
||||
val COLUMN_ID = "profile_id"
|
||||
val COLUMN_VALUE = "profile_value"
|
||||
|
||||
override fun onCreate(): Boolean {
|
||||
ProfileManager.ensureInitialized(context!!)
|
||||
return true
|
||||
}
|
||||
|
||||
override fun query(
|
||||
uri: Uri,
|
||||
projection: Array<out String>?,
|
||||
selection: String?,
|
||||
selectionArgs: Array<out String>?,
|
||||
sortOrder: String?
|
||||
): Cursor =
|
||||
MatrixCursor(arrayOf(COLUMN_ID, COLUMN_VALUE)).apply {
|
||||
ProfileManager.getActiveProfileData(context!!).entries
|
||||
.forEach {
|
||||
addRow(arrayOf(it.key, it.value))
|
||||
}
|
||||
}
|
||||
|
||||
override fun getType(uri: Uri): String {
|
||||
return "vnd.android.cursor.item/vnd.${SettingsContract.getAuthority(context!!)}.${uri.path}"
|
||||
}
|
||||
|
||||
override fun insert(uri: Uri, values: ContentValues?): Nothing = throw UnsupportedOperationException()
|
||||
|
||||
override fun delete(uri: Uri, selection: String?, selectionArgs: Array<out String>?): Nothing =
|
||||
throw UnsupportedOperationException()
|
||||
|
||||
override fun update(
|
||||
uri: Uri, values: ContentValues?, selection: String?, selectionArgs: Array<out String>?
|
||||
): Nothing = throw UnsupportedOperationException()
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue