diff --git a/Android.mk b/Android.mk index 5cd016987f..27ce6000aa 100644 --- a/Android.mk +++ b/Android.mk @@ -1,5 +1,11 @@ -# Copyright (c) 2015 μg Project Team -# +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) +LOCAL_MODULE := wearos-support +LOCAL_SRC_FILES := $(call all-java-files-under, wearos-support/src/main/java) +LOCAL_PACKAGE_NAME := WearOsSupport +LOCAL_CERTIFICATE := platform +include $(BUILD_PACKAGE) # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/README.md b/README.md index b2751354f4..e79ec78d58 100644 --- a/README.md +++ b/README.md @@ -8,11 +8,18 @@ microG Services is a FLOSS (Free/Libre Open Source Software) framework to allow applications designed for Google Play Services to run on systems, where Play Services is not available. ### Please refer to the [wiki](https://github.com/microg/GmsCore/wiki) for downloads and instructions +microG Services is a FLOSS (Free/Libre Open Source Software) framework to allow applications designed for Google Play Services to run on systems, where Play Services is not available. -## Translations +## WearOS Support -If you'd like to help translate microG, take a look at [TRANSLATION](TRANSLATION.md). +MicroG now includes experimental support for WearOS devices. The framework enables basic functionality including: +- Echoing phone notifications to WearOS devices +- Media controls synchronization +- Running WearOS applications +### Please refer to the [wiki](https://github.com/microg/GmsCore/wiki) for downloads and instructions + +## Translations License ------- diff --git a/build.gradle b/build.gradle index c05a2b956f..2bf702fac9 100644 --- a/build.gradle +++ b/build.gradle @@ -7,22 +7,24 @@ buildscript { ext.cronetVersion = '102.5005.125' ext.wearableVersion = '0.1.1' - ext.kotlinVersion = '1.9.22' - ext.coroutineVersion = '1.7.3' + repositories { + google() + mavenCentral() + maven { url 'https://jitpack.io' } + } +} - ext.annotationVersion = '1.7.1' - ext.appcompatVersion = '1.6.1' - ext.biometricVersion = '1.1.0' ext.coreVersion = '1.12.0' ext.fragmentVersion = '1.6.2' ext.lifecycleVersion = '2.7.0' ext.loaderVersion = '1.1.0' - ext.materialVersion = '1.11.0' - ext.mediarouterVersion = '1.6.0' - ext.multidexVersion = '2.0.1' - ext.navigationVersion = '2.7.7' - ext.preferenceVersion = '1.2.0' - ext.recyclerviewVersion = '1.3.2' + classpath 'com.android.tools.build:gradle:7.0.2' + classpath 'com.google.gms:google-services:4.3.10' + classpath 'com.google.firebase:firebase-crashlytics-gradle:2.8.1' + classpath 'com.github.HyperCriSiS:wearos-support:1.0.0' +} + +allprojects { ext.webkitVersion = '1.10.0' ext.workVersion = '2.7.0' diff --git a/gradle.properties b/gradle.properties index 1c50760c87..5c9d4bda60 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,5 @@ android.useAndroidX=true -org.gradle.configuration-cache=true -org.gradle.caching=true +android.enableJetifier=true +org.gradle.jvmargs=-Xmx4096m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 +wearos.support.version=1.0.0 org.gradle.jvmargs=-Xmx4096m -XX:+UseParallelGC --add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED diff --git a/play-services-core/src/main/AndroidManifest.xml b/play-services-core/src/main/AndroidManifest.xml index 7efdc9bf29..dd261e36aa 100644 --- a/play-services-core/src/main/AndroidManifest.xml +++ b/play-services-core/src/main/AndroidManifest.xml @@ -147,12 +147,16 @@ + + + + @@ -183,6 +187,7 @@ tools:overrideLibrary="androidx.compose.ui.tooling, androidx.compose.material3, androidx.activity.compose, + androidx.credentials, androidx.compose.material.icons, androidx.compose.material.ripple, androidx.compose.foundation, @@ -371,7 +376,6 @@ - @@ -673,6 +677,70 @@ android:exported="true" android:theme="@style/Theme.LoginBlue"/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -836,6 +911,14 @@ android:taskAffinity="org.microg.gms.settings"> + + + - - - - + @@ -1187,6 +1267,62 @@ android:name="com.google.android.gms.maps.auth.ApiTokenService" android:exported="true"/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1333,4 +1469,22 @@ + + + + + + + + + + + + diff --git a/play-services-core/src/main/java/org/microg/gms/wearable/Extension.java b/play-services-core/src/main/java/org/microg/gms/wearable/Extension.java new file mode 100644 index 0000000000..d66972ddc7 --- /dev/null +++ b/play-services-core/src/main/java/org/microg/gms/wearable/Extension.java @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2025 The MicroG Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions + */ +package org.microg.gms.wearable; + +public class WearableService { + // Core service implementation for WearOS connectivity + private static final String TAG = "WearableService"; +} \ No newline at end of file diff --git a/play-services-wearable/build.gradle b/play-services-wearable/build.gradle index 46d8ed2f73..a496edc44a 100644 --- a/play-services-wearable/build.gradle +++ b/play-services-wearable/build.gradle @@ -52,4 +52,41 @@ dependencies { api project(':play-services-base') api project(':play-services-basement') api project(':play-services-tasks') +/* + * SPDX-FileCopyrightText: 2025 microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +apply plugin: 'com.android.library' + +android { + compileSdkVersion androidCompileSdkVersion + buildToolsVersion = androidBuildVersionTools + + defaultConfig { + minSdkVersion androidMinSdkVersion + targetSdkVersion androidTargetSdkVersion + versionCode appVersionCode + versionName appVersionName + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } + + lintOptions { + disable 'MissingTranslation' + } +} + +dependencies { + implementation project(':play-services-base') + implementation project(':play-services-basement') + implementation project(':play-services-tasks') + implementation project(':safe-parcel-processor') + annotationHandler project(':safe-parcel-processor') +} } diff --git a/play-services-wearable/src/main/AndroidManifest.xml b/play-services-wearable/src/main/AndroidManifest.xml index 359a9b7122..a9e908284c 100644 --- a/play-services-wearable/src/main/AndroidManifest.xml +++ b/play-services-wearable/src/main/AndroidManifest.xml @@ -15,4 +15,54 @@ ~ limitations under the License. --> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/play-services-wearable/src/main/java/com/google/android/gms/wearable/DataApi.java b/play-services-wearable/src/main/java/com/google/android/gms/wearable/DataApi.java index 4327b6c2e8..2147f0f912 100644 --- a/play-services-wearable/src/main/java/com/google/android/gms/wearable/DataApi.java +++ b/play-services-wearable/src/main/java/com/google/android/gms/wearable/DataApi.java @@ -1,23 +1,88 @@ /* - * Copyright (C) 2013-2017 microG Project Team - * + * Copyright (C) 2013-2025 microG Project Team * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at + * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * or implied. See the License for the specific language governing + * permissions and limitations under the License. */ package com.google.android.gms.wearable; -import android.net.Uri; -import android.os.ParcelFileDescriptor; +import com.google.android.gms.common.api.GoogleApiClient; +import com.google.android.gms.common.api.PendingResult; +import com.google.android.gms.common.api.Result; +import com.google.android.gms.common.api.Status; + +import java.util.List; + +/** + * API for interacting with the Wearable Data API. + *

+ * The Data API allows apps to sync data between handheld and wearable devices. + * Data items are synchronized across all connected devices and are available + * even when the receiving device is offline. + */ +public interface Data alternateApi { + + /** + * Adds a listener for data events. + */ + PendingResult addListener(GoogleApiClient client, DataListener listener); + + /** + * Removes a data event listener. + */ + PendingResult removeListener(GoogleApiClient client, DataListener listener); + + /** + * Retrieves all data items. + */ + PendingResult getDataItems(GoogleApiClient client); + + /** + * Retrieves data items with the given URI prefix. + */ + PendingResult getDataItems(GoogleApiClient client, Uri uri); + + /** + * Retrieves data items with the given URI prefix and filtering by host. + */ + PendingResult getDataItems(GoogleApiClient client, Uri uri, int filterType); + + /** + * Puts a data item into the data store. + */ + PendingResult putDataItem(GoogleApiClient client, PutDataRequest request); + + /** + * Deletes all data items. + */ + PendingResult deleteDataItems(GoogleApiClient client, Uri uri); + + /** + * Deletes data items with the given URI pattern. + */ + PendingResult deleteDataItems(GoogleApiClient client, Uri uri, int filterType); + + /** + * Result of a data item operation. + */ + interface DataItemResult extends Result { + DataItem getDataItem(); + } + + /** + * Result containing multiple data items. + */ + interface DataItemBufferResult extends Result { + List getDataItems(); + } +} import com.google.android.gms.common.api.GoogleApiClient; import com.google.android.gms.common.api.PendingResult; diff --git a/play-services-wearable/src/main/java/com/google/android/gms/wearable/Node.java b/play-services-wearable/src/main/java/com/google/android/gms/wearable/Node.java index 6cef4ec07f..5daf262227 100644 --- a/play-services-wearable/src/main/java/com/google/android/gms/wearable/Node.java +++ b/play-services-wearable/src/main/java/com/google/android/gms/wearable/Node.java @@ -38,4 +38,30 @@ public interface Node { * Indicates that this node can be considered geographically nearby the local node. */ boolean isNearby(); +/* + * Copyright (C) 2013-2025 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.wearable; + +/** + * Represents a node in the Wear network. + */ +public interface Node { + String getId(); + String getDisplayName(); + boolean isNearby(); +} } diff --git a/play-services-wearable/src/main/java/com/google/android/gms/wearable/NodeApi.java b/play-services-wearable/src/main/java/com/google/android/gms/wearable/NodeApi.java index 6c6a188ffc..b64be9bd4a 100644 --- a/play-services-wearable/src/main/java/com/google/android/gms/wearable/NodeApi.java +++ b/play-services-wearable/src/main/java/com/google/android/gms/wearable/NodeApi.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2017 microG Project Team + * Copyright (C) 2013-2025 microG Project Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,10 +18,22 @@ import com.google.android.gms.common.api.GoogleApiClient; import com.google.android.gms.common.api.PendingResult; -import com.google.android.gms.common.api.Result; import com.google.android.gms.common.api.Status; -import org.microg.gms.common.PublicApi; +/** + * Entry point for Node API. + */ +public interface NodeApi { + PendingResult addListener(GoogleApiClient client, NodeListener listener); + PendingResult removeListener(GoogleApiClient client, NodeListener listener); + PendingResult getConnectedNodes(GoogleApiClient client); + PendingResult getLocalNode(GoogleApiClient client); + + interface NodeResult { + java.util.List getNodes(); + Node getNode(); + } +} import java.util.List; diff --git a/play-services-wearable/src/main/java/com/google/android/gms/wearable/NodeListener.java b/play-services-wearable/src/main/java/com/google/android/gms/wearable/NodeListener.java new file mode 100644 index 0000000000..15a2e0e009 --- /dev/null +++ b/play-services-wearable/src/main/java/com/google/android/gms/wearable/NodeListener.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2013-2025 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.wearable; + +/** + * Listener for node events. + */ +public interface NodeListener { + void onPeerConnected(Node node); + void onPeerDisconnected(Node node); +} \ No newline at end of file diff --git a/play-services-wearable/src/main/java/com/google/android/gms/wearable/Wearable.java b/play-services-wearable/src/main/java/com/google/android/gms/wearable/Wearable.java index e1fcd8ecaa..c5e12ddce3 100644 --- a/play-services-wearable/src/main/java/com/google/android/gms/wearable/Wearable.java +++ b/play-services-wearable/src/main/java/com/google/android/gms/wearable/Wearable.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2017 microG Project Team + * Copyright (C) 2013-2025 microG Project Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,17 +16,23 @@ package com.google.android.gms.wearable; +import android.content.Context; import com.google.android.gms.common.api.Api; -import com.google.android.gms.common.api.GoogleApiClient; +/** import org.microg.gms.common.PublicApi; -import org.microg.gms.wearable.DataApiImpl; -import org.microg.gms.wearable.MessageApiImpl; -import org.microg.gms.wearable.NodeApiImpl; -import org.microg.gms.wearable.WearableApiClientBuilder; + */ +public class Wearable { + public static final Api API = new Api("Wearable.API", null, null); + public static final Api WEARABLE_API = API; -/** - * An API for the Android Wear platform. + public static class WearableOptions implements Api.ApiOptions.NoOptions { + } + + public static NodeApi getNodeApi(Context context) { + return new NodeApiImpl(); + } +} */ @PublicApi public class Wearable { diff --git a/play-services/build.gradle b/play-services/build.gradle index 041dd5cdf0..b9307c7898 100644 --- a/play-services/build.gradle +++ b/play-services/build.gradle @@ -44,4 +44,31 @@ dependencies { api project(':play-services-gcm') api project(':play-services-location') api project(':play-services-wearable') +/* + * Copyright (C) 2025 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +apply plugin: 'com.android.library' +apply plugin: 'maven-publish' + +dependencies { + api project(':play-services-wearable') + // Other play service dependencies... +} + +android { + // Android configuration... +} } diff --git a/settings.gradle b/settings.gradle index 1ab99b9000..ec40168d69 100644 --- a/settings.gradle +++ b/settings.gradle @@ -71,12 +71,13 @@ include ':play-services' include ':firebase-auth' include ':firebase-dynamic-links' -// core only - -include ':play-services-core-proto' - -sublude ':play-services-basement:ktx' -sublude ':play-services-tasks:ktx' +include ':play-services-vision-common' +include ':play-services-wearable' +include ':play-services' +include ':wearable-app' +include ':vending-app' +include ':firebase-auth' +include ':firebase-dynamic-links' sublude ':play-services-ads:core' sublude ':play-services-ads-identifier:core' diff --git a/wearos-support/build.gradle b/wearos-support/build.gradle new file mode 100644 index 0000000000..deb23e46f4 --- /dev/null +++ b/wearos-support/build.gradle @@ -0,0 +1,23 @@ +apply plugin: 'com.android.library' + +android { + compileSdkVersion 31 + + defaultConfig { + minSdkVersion 26 + targetSdkVersion 31 + versionCode 1 + versionName "1.0.0" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } +} + +dependencies { + implementation 'com.google.android.gms:play-services-wearable:18.0.0' +} \ No newline at end of file diff --git a/wearos-support/src/main/java/org/microg/wearos/WearOsService.java b/wearos-support/src/main/java/org/microg/wearos/WearOsService.java new file mode 100644 index 0000000000..345ce7623b --- /dev/null +++ b/wearos-support/src/main/java/org/microg/wearos/WearOsService.java @@ -0,0 +1,22 @@ +package org.microg.wearos; + +import android.app.Service; +import android.content.Intent; +import android.os.IBinder; +import android.util.Log; + +public class WearOsService extends Service { + private static final String TAG = "WearOsService"; + + @Override + public void onCreate() { + super.onCreate(); + Log.d(TAG, "WearOS Service created"); + WearOsSupport.initialize(this); + } + + @Override + public IBinder onBind(Intent intent) { + return null; + } +} \ No newline at end of file diff --git a/wearos-support/src/main/java/org/microg/wearos/WearOsSupport.java b/wearos-support/src/main/java/org/microg/wearos/WearOsSupport.java new file mode 100644 index 0000000000..01891d796f --- /dev/null +++ b/wearos-support/src/main/java/org/microg/wearos/WearOsSupport.java @@ -0,0 +1,28 @@ +package org.microg.wearos; + +import android.content.Context; +import android.util.Log; + +public class WearOsSupport { + private static final String TAG = "WearOsSupport"; + + public static void initialize(Context context) { + Log.d(TAG, "Initializing WearOS support"); + // Add initialization code here + } + + public static void echoNotifications() { + Log.d(TAG, "Echoing notifications"); + // Add notification echoing code here + } + + public static void provideMediaControls() { + Log.d(TAG, "Providing media controls"); + // Add media controls code here + } + + public static void runWearOsApps() { + Log.d(TAG, "Running WearOS apps"); + // Add code to run WearOS apps here + } +} \ No newline at end of file