From 0e2ceee2a66c8bcb7568631a9782bbda39cd7f69 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Tue, 6 Jan 2015 04:05:25 +0100 Subject: [PATCH 001/293] Initial commit --- Android.mk | 9 + AndroidManifest.xml | 4 + build.gradle | 28 +++ .../android/auth/IAuthManagerService.aidl | 6 + .../gms/common/AbstractGmsServiceBroker.java | 170 ++++++++++++++++++ .../gms/common/internal/IGmsCallbacks.aidl | 5 + .../common/internal/IGmsServiceBroker.aidl | 30 ++++ .../android/gms/dynamic/IObjectWrapper.aidl | 8 + .../android/gms/dynamic/ObjectWrapper.java | 66 +++++++ .../google/android/gms/location/Geofence.aidl | 3 + .../google/android/gms/location/Geofence.java | 48 +++++ .../internal/IGeofencerCallbacks.aidl | 4 + .../IGoogleLocationManagerService.aidl | 8 + .../android/gms/maps/GoogleMapOptions.aidl | 3 + .../android/gms/maps/GoogleMapOptions.java | 107 +++++++++++ .../ICameraUpdateFactoryDelegate.aidl | 20 +++ .../maps/internal/ICancelableCallback.aidl | 6 + .../android/gms/maps/internal/ICreator.aidl | 17 ++ .../gms/maps/internal/IGoogleMapDelegate.aidl | 91 ++++++++++ .../gms/maps/internal/IInfoWindowAdapter.aidl | 9 + .../internal/ILocationSourceDelegate.aidl | 4 + .../maps/internal/IMapFragmentDelegate.aidl | 19 ++ .../gms/maps/internal/IMapViewDelegate.aidl | 15 ++ .../internal/IOnCameraChangeListener.aidl | 4 + .../internal/IOnInfoWindowClickListener.aidl | 7 + .../maps/internal/IOnMapClickListener.aidl | 7 + .../maps/internal/IOnMapLoadedCallback.aidl | 4 + .../internal/IOnMapLongClickListener.aidl | 7 + .../maps/internal/IOnMarkerClickListener.aidl | 7 + .../maps/internal/IOnMarkerDragListener.aidl | 4 + .../IOnMyLocationButtonClickListener.aidl | 4 + .../internal/IOnMyLocationChangeListener.aidl | 4 + .../maps/internal/IProjectionDelegate.aidl | 11 ++ .../maps/internal/ISnapshotReadyCallback.aidl | 4 + .../maps/internal/IUiSettingsDelegate.aidl | 19 ++ .../gms/maps/model/CameraPosition.aidl | 3 + .../gms/maps/model/CameraPosition.java | 91 ++++++++++ .../android/gms/maps/model/CircleOptions.aidl | 3 + .../android/gms/maps/model/CircleOptions.java | 67 +++++++ .../gms/maps/model/GroundOverlayOptions.aidl | 3 + .../gms/maps/model/GroundOverlayOptions.java | 79 ++++++++ .../google/android/gms/maps/model/LatLng.aidl | 3 + .../google/android/gms/maps/model/LatLng.java | 81 +++++++++ .../android/gms/maps/model/LatLngBounds.aidl | 3 + .../android/gms/maps/model/LatLngBounds.java | 64 +++++++ .../android/gms/maps/model/MarkerOptions.aidl | 3 + .../android/gms/maps/model/MarkerOptions.java | 134 ++++++++++++++ .../gms/maps/model/PolygonOptions.aidl | 3 + .../gms/maps/model/PolygonOptions.java | 50 ++++++ .../gms/maps/model/PolylineOptions.aidl | 3 + .../gms/maps/model/PolylineOptions.java | 66 +++++++ .../gms/maps/model/TileOverlayOptions.aidl | 3 + .../gms/maps/model/TileOverlayOptions.java | 51 ++++++ .../android/gms/maps/model/VisibleRegion.aidl | 3 + .../android/gms/maps/model/VisibleRegion.java | 76 ++++++++ .../IBitmapDescriptorFactoryDelegate.aidl | 14 ++ .../maps/model/internal/ICircleDelegate.aidl | 24 +++ .../internal/IGroundOverlayDelegate.aidl | 29 +++ .../maps/model/internal/IMarkerDelegate.aidl | 33 ++++ .../maps/model/internal/IPolygonDelegate.aidl | 27 +++ .../model/internal/IPolylineDelegate.aidl | 22 +++ .../model/internal/ITileOverlayDelegate.aidl | 4 + .../plus/internal/IPlusOneButtonCreator.aidl | 8 + 63 files changed, 1712 insertions(+) create mode 100644 Android.mk create mode 100644 AndroidManifest.xml create mode 100644 build.gradle create mode 100644 src/com/google/android/auth/IAuthManagerService.aidl create mode 100644 src/com/google/android/gms/common/AbstractGmsServiceBroker.java create mode 100644 src/com/google/android/gms/common/internal/IGmsCallbacks.aidl create mode 100644 src/com/google/android/gms/common/internal/IGmsServiceBroker.aidl create mode 100644 src/com/google/android/gms/dynamic/IObjectWrapper.aidl create mode 100644 src/com/google/android/gms/dynamic/ObjectWrapper.java create mode 100644 src/com/google/android/gms/location/Geofence.aidl create mode 100644 src/com/google/android/gms/location/Geofence.java create mode 100644 src/com/google/android/gms/location/internal/IGeofencerCallbacks.aidl create mode 100644 src/com/google/android/gms/location/internal/IGoogleLocationManagerService.aidl create mode 100644 src/com/google/android/gms/maps/GoogleMapOptions.aidl create mode 100644 src/com/google/android/gms/maps/GoogleMapOptions.java create mode 100644 src/com/google/android/gms/maps/internal/ICameraUpdateFactoryDelegate.aidl create mode 100644 src/com/google/android/gms/maps/internal/ICancelableCallback.aidl create mode 100644 src/com/google/android/gms/maps/internal/ICreator.aidl create mode 100644 src/com/google/android/gms/maps/internal/IGoogleMapDelegate.aidl create mode 100644 src/com/google/android/gms/maps/internal/IInfoWindowAdapter.aidl create mode 100644 src/com/google/android/gms/maps/internal/ILocationSourceDelegate.aidl create mode 100644 src/com/google/android/gms/maps/internal/IMapFragmentDelegate.aidl create mode 100644 src/com/google/android/gms/maps/internal/IMapViewDelegate.aidl create mode 100644 src/com/google/android/gms/maps/internal/IOnCameraChangeListener.aidl create mode 100644 src/com/google/android/gms/maps/internal/IOnInfoWindowClickListener.aidl create mode 100644 src/com/google/android/gms/maps/internal/IOnMapClickListener.aidl create mode 100644 src/com/google/android/gms/maps/internal/IOnMapLoadedCallback.aidl create mode 100644 src/com/google/android/gms/maps/internal/IOnMapLongClickListener.aidl create mode 100644 src/com/google/android/gms/maps/internal/IOnMarkerClickListener.aidl create mode 100644 src/com/google/android/gms/maps/internal/IOnMarkerDragListener.aidl create mode 100644 src/com/google/android/gms/maps/internal/IOnMyLocationButtonClickListener.aidl create mode 100644 src/com/google/android/gms/maps/internal/IOnMyLocationChangeListener.aidl create mode 100644 src/com/google/android/gms/maps/internal/IProjectionDelegate.aidl create mode 100644 src/com/google/android/gms/maps/internal/ISnapshotReadyCallback.aidl create mode 100644 src/com/google/android/gms/maps/internal/IUiSettingsDelegate.aidl create mode 100644 src/com/google/android/gms/maps/model/CameraPosition.aidl create mode 100644 src/com/google/android/gms/maps/model/CameraPosition.java create mode 100644 src/com/google/android/gms/maps/model/CircleOptions.aidl create mode 100644 src/com/google/android/gms/maps/model/CircleOptions.java create mode 100644 src/com/google/android/gms/maps/model/GroundOverlayOptions.aidl create mode 100644 src/com/google/android/gms/maps/model/GroundOverlayOptions.java create mode 100644 src/com/google/android/gms/maps/model/LatLng.aidl create mode 100644 src/com/google/android/gms/maps/model/LatLng.java create mode 100644 src/com/google/android/gms/maps/model/LatLngBounds.aidl create mode 100644 src/com/google/android/gms/maps/model/LatLngBounds.java create mode 100644 src/com/google/android/gms/maps/model/MarkerOptions.aidl create mode 100644 src/com/google/android/gms/maps/model/MarkerOptions.java create mode 100644 src/com/google/android/gms/maps/model/PolygonOptions.aidl create mode 100644 src/com/google/android/gms/maps/model/PolygonOptions.java create mode 100644 src/com/google/android/gms/maps/model/PolylineOptions.aidl create mode 100644 src/com/google/android/gms/maps/model/PolylineOptions.java create mode 100644 src/com/google/android/gms/maps/model/TileOverlayOptions.aidl create mode 100644 src/com/google/android/gms/maps/model/TileOverlayOptions.java create mode 100644 src/com/google/android/gms/maps/model/VisibleRegion.aidl create mode 100644 src/com/google/android/gms/maps/model/VisibleRegion.java create mode 100644 src/com/google/android/gms/maps/model/internal/IBitmapDescriptorFactoryDelegate.aidl create mode 100644 src/com/google/android/gms/maps/model/internal/ICircleDelegate.aidl create mode 100644 src/com/google/android/gms/maps/model/internal/IGroundOverlayDelegate.aidl create mode 100644 src/com/google/android/gms/maps/model/internal/IMarkerDelegate.aidl create mode 100644 src/com/google/android/gms/maps/model/internal/IPolygonDelegate.aidl create mode 100644 src/com/google/android/gms/maps/model/internal/IPolylineDelegate.aidl create mode 100644 src/com/google/android/gms/maps/model/internal/ITileOverlayDelegate.aidl create mode 100644 src/com/google/android/gms/plus/internal/IPlusOneButtonCreator.aidl diff --git a/Android.mk b/Android.mk new file mode 100644 index 00000000..4b9abaa0 --- /dev/null +++ b/Android.mk @@ -0,0 +1,9 @@ +# Not working yet +LOCAL_PATH := $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_MODULE := GmsApi +LOCAL_SRC_FILES := $(call all-java-files-under, src) +LOCAL_SRC_FILES := $(call all-Iaidl-files-under, src) + +include $(BUILD_STATIC_JAVA_LIBRARY) diff --git a/AndroidManifest.xml b/AndroidManifest.xml new file mode 100644 index 00000000..1b9d6274 --- /dev/null +++ b/AndroidManifest.xml @@ -0,0 +1,4 @@ + + + + diff --git a/build.gradle b/build.gradle new file mode 100644 index 00000000..f433729e --- /dev/null +++ b/build.gradle @@ -0,0 +1,28 @@ +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:1.0.0' + } +} + +apply plugin: 'com.android.library' + +dependencies { + compile project(':SafeParcel') +} + +android { + compileSdkVersion 21 + buildToolsVersion "21.0.2" + lintOptions.abortOnError false + + sourceSets { + main { + manifest.srcFile 'AndroidManifest.xml' + java.srcDirs = ['src'] + aidl.srcDirs = ['src'] + } + } +} diff --git a/src/com/google/android/auth/IAuthManagerService.aidl b/src/com/google/android/auth/IAuthManagerService.aidl new file mode 100644 index 00000000..0b84c375 --- /dev/null +++ b/src/com/google/android/auth/IAuthManagerService.aidl @@ -0,0 +1,6 @@ +package com.google.android.auth; + +interface IAuthManagerService { + Bundle getToken(String accountName, String scope, in Bundle extras); + Bundle clearToken(String token, in Bundle extras); +} diff --git a/src/com/google/android/gms/common/AbstractGmsServiceBroker.java b/src/com/google/android/gms/common/AbstractGmsServiceBroker.java new file mode 100644 index 00000000..758d6faf --- /dev/null +++ b/src/com/google/android/gms/common/AbstractGmsServiceBroker.java @@ -0,0 +1,170 @@ +/* + * Copyright (c) 2014 μg 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.common; + +import android.os.Bundle; +import android.os.IBinder; +import android.os.RemoteException; +import com.google.android.gms.common.internal.IGmsCallbacks; +import com.google.android.gms.common.internal.IGmsServiceBroker; + +public abstract class AbstractGmsServiceBroker extends IGmsServiceBroker.Stub { + @Override + public void getPlusService(IGmsCallbacks callback, int versionCode, String packageName, + String str2, String[] paramArrayOfString, String str3, Bundle params) + throws RemoteException { + throw new IllegalArgumentException("Plus service not supported"); + } + + @Override + public void getPanoramaService(IGmsCallbacks callback, int versionCode, String packageName, + Bundle params) throws RemoteException { + throw new IllegalArgumentException("Panorama service not supported"); + } + + @Override + public void getAppDataSearchService(IGmsCallbacks callback, int versionCode, String packageName) + throws RemoteException { + throw new IllegalArgumentException("App Data Search service not supported"); + } + + @Override + public void getWalletService(IGmsCallbacks callback, int versionCode) throws RemoteException { + throw new IllegalArgumentException("Wallet service not supported"); + } + + @Override + public void getPeopleService(IGmsCallbacks callback, int versionCode, String packageName, + Bundle params) throws RemoteException { + throw new IllegalArgumentException("People service not supported"); + } + + @Override + public void getReportingService(IGmsCallbacks callback, int versionCode, String packageName, + Bundle params) throws RemoteException { + throw new IllegalArgumentException("Reporting service not supported"); + } + + @Override + public void getLocationService(IGmsCallbacks callback, int versionCode, String packageName, + Bundle params) throws RemoteException { + throw new IllegalArgumentException("Location service not supported"); + } + + @Override + public void getGoogleLocationManagerService(IGmsCallbacks callback, int versionCode, + String packageName, Bundle params) throws RemoteException { + throw new IllegalArgumentException("Google Location Manager service not supported"); + } + + @Override + public void getGamesService(IGmsCallbacks callback, int versionCode, String packageName, + String str2, String[] args, String str3, IBinder binder, String str4, Bundle params) + throws RemoteException { + throw new IllegalArgumentException("Games service not supported"); + } + + @Override + public void getAppStateService(IGmsCallbacks callback, int versionCode, String packageName, + String str2, String[] args) throws RemoteException { + throw new IllegalArgumentException("App State service not supported"); + } + + @Override + public void getPlayLogService(IGmsCallbacks callback, int versionCode, String packageName, + Bundle params) throws RemoteException { + throw new IllegalArgumentException("Play Log service not supported"); + } + + @Override + public void getAdMobService(IGmsCallbacks callback, int versionCode, String packageName, + Bundle params) throws RemoteException { + throw new IllegalArgumentException("AdMob service not supported"); + } + + @Override + public void getDroidGuardService(IGmsCallbacks callback, int versionCode, String packageName, + Bundle params) throws RemoteException { + throw new IllegalArgumentException("DroidGuard service not supported"); + } + + @Override + public void getLockboxService(IGmsCallbacks callback, int versionCode, String packageName, + Bundle params) throws RemoteException { + throw new IllegalArgumentException("Lockbox service not supported"); + } + + @Override + public void getCastMirroringService(IGmsCallbacks callback, int versionCode, String packageName, + Bundle params) throws RemoteException { + throw new IllegalArgumentException("Cast Mirroring service not supported"); + } + + @Override + public void getNetworkQualityService(IGmsCallbacks callback, int versionCode, + String packageName, Bundle params) throws RemoteException { + throw new IllegalArgumentException("Network Quality service not supported"); + } + + @Override + public void getGoogleIdentityService(IGmsCallbacks callback, int versionCode, + String packageName, Bundle params) throws RemoteException { + throw new IllegalArgumentException("Google Identity service not supported"); + } + + @Override + public void getGoogleFeedbackService(IGmsCallbacks callback, int versionCode, + String packageName, Bundle params) throws RemoteException { + throw new IllegalArgumentException("Google Feedback service not supported"); + } + + @Override + public void getCastService(IGmsCallbacks callback, int versionCode, String packageName, + IBinder binder, Bundle params) throws RemoteException { + throw new IllegalArgumentException("Cast service not supported"); + } + + @Override + public void getDriveService(IGmsCallbacks callback, int versionCode, String packageName, + String[] args, String str2, Bundle params) throws RemoteException { + throw new IllegalArgumentException("Drive service not supported"); + } + + @Override + public void getLightweightAppDataSearchService(IGmsCallbacks callback, int versionCode, + String packageName) throws RemoteException { + throw new IllegalArgumentException("Lightweight App Data Search service not supported"); + } + + @Override + public void getSearchAdministrationService(IGmsCallbacks callback, int versionCode, + String packageName) throws RemoteException { + throw new IllegalArgumentException("Search Administration service not supported"); + } + + @Override + public void getAutoBackupService(IGmsCallbacks callback, int versionCode, String packageName, + Bundle params) throws RemoteException { + throw new IllegalArgumentException("Auto Backup service not supported"); + } + + @Override + public void getAddressService(IGmsCallbacks callback, int versionCode, String packageName) + throws RemoteException { + throw new IllegalArgumentException("Address service not supported"); + } +} diff --git a/src/com/google/android/gms/common/internal/IGmsCallbacks.aidl b/src/com/google/android/gms/common/internal/IGmsCallbacks.aidl new file mode 100644 index 00000000..9a36b0ed --- /dev/null +++ b/src/com/google/android/gms/common/internal/IGmsCallbacks.aidl @@ -0,0 +1,5 @@ +package com.google.android.gms.common.internal; + +interface IGmsCallbacks { + void onPostInitComplete(int statusCode, IBinder binder, in Bundle params); +} diff --git a/src/com/google/android/gms/common/internal/IGmsServiceBroker.aidl b/src/com/google/android/gms/common/internal/IGmsServiceBroker.aidl new file mode 100644 index 00000000..318c4dab --- /dev/null +++ b/src/com/google/android/gms/common/internal/IGmsServiceBroker.aidl @@ -0,0 +1,30 @@ +package com.google.android.gms.common.internal; + +import com.google.android.gms.common.internal.IGmsCallbacks; + +interface IGmsServiceBroker { + void getPlusService(IGmsCallbacks callback, int code, String str1, String str2, in String[] paramArrayOfString, String str3, in Bundle params); + void getPanoramaService(IGmsCallbacks callback, int code, String str, in Bundle params); + void getAppDataSearchService(IGmsCallbacks callback, int code, String str); + void getWalletService(IGmsCallbacks callback, int code); + void getPeopleService(IGmsCallbacks callback, int code, String str, in Bundle params); + void getReportingService(IGmsCallbacks callback, int code, String str, in Bundle params); + void getLocationService(IGmsCallbacks callback, int code, String str, in Bundle params); + void getGoogleLocationManagerService(IGmsCallbacks callback, int code, String str, in Bundle params); + void getGamesService(IGmsCallbacks callback, int code, String str1, String str2, in String[] args, String str3, IBinder binder, String str4, in Bundle params); + void getAppStateService(IGmsCallbacks callback, int code, String str1, String str2, in String[] args); + void getPlayLogService(IGmsCallbacks callback, int code, String str, in Bundle params); + void getAdMobService(IGmsCallbacks callback, int code, String str, in Bundle params); + void getDroidGuardService(IGmsCallbacks callback, int code, String str, in Bundle params); + void getLockboxService(IGmsCallbacks callback, int code, String str, in Bundle params); + void getCastMirroringService(IGmsCallbacks callback, int code, String str, in Bundle params); + void getNetworkQualityService(IGmsCallbacks callback, int code, String str, in Bundle params); + void getGoogleIdentityService(IGmsCallbacks callback, int code, String str, in Bundle params); + void getGoogleFeedbackService(IGmsCallbacks callback, int code, String str, in Bundle params); + void getCastService(IGmsCallbacks callback, int code, String str, IBinder binder, in Bundle params); + void getDriveService(IGmsCallbacks callback, int code, String str1, in String[] args, String str2, in Bundle params); + void getLightweightAppDataSearchService(IGmsCallbacks callback, int code, String str); + void getSearchAdministrationService(IGmsCallbacks callback, int code, String str); + void getAutoBackupService(IGmsCallbacks callback, int code, String str, in Bundle params); + void getAddressService(IGmsCallbacks callback, int code, String str); +} diff --git a/src/com/google/android/gms/dynamic/IObjectWrapper.aidl b/src/com/google/android/gms/dynamic/IObjectWrapper.aidl new file mode 100644 index 00000000..35e1474a --- /dev/null +++ b/src/com/google/android/gms/dynamic/IObjectWrapper.aidl @@ -0,0 +1,8 @@ +package com.google.android.gms.dynamic; + +/** + * The concrete class implementing IObjectWrapper must have exactly one declared private field + * for the wrapped object. Preferably, this is an instance of the ObjectWrapper class. + */ +interface IObjectWrapper { +} diff --git a/src/com/google/android/gms/dynamic/ObjectWrapper.java b/src/com/google/android/gms/dynamic/ObjectWrapper.java new file mode 100644 index 00000000..04a5e582 --- /dev/null +++ b/src/com/google/android/gms/dynamic/ObjectWrapper.java @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2014 μg 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.dynamic; + +import android.os.IBinder; + +import java.lang.reflect.Field; + +public class ObjectWrapper extends IObjectWrapper.Stub { + private final T t; + + public ObjectWrapper(T t) { + this.t = t; + } + + public static Object unwrap(IObjectWrapper obj) { + if (obj == null) { + return null; + } + if (obj instanceof ObjectWrapper) { + return ((ObjectWrapper) obj).t; + } + IBinder binder = obj.asBinder(); + Field[] fields = binder.getClass().getDeclaredFields(); + if (fields.length != 1) { + throw new IllegalArgumentException(); + } + Field field = fields[0]; + if (!field.isAccessible()) { + field.setAccessible(true); + try { + Object wrapped = field.get(binder); + return wrapped; + } catch (NullPointerException localNullPointerException) { + throw new IllegalArgumentException("Binder object is null.", + localNullPointerException); + } catch (IllegalArgumentException localIllegalArgumentException) { + throw new IllegalArgumentException("remoteBinder is the wrong class.", + localIllegalArgumentException); + } catch (IllegalAccessException localIllegalAccessException) { + throw new IllegalArgumentException("Could not access the field in remoteBinder.", + localIllegalAccessException); + } + } else { + throw new IllegalArgumentException(); + } + } + + public static ObjectWrapper wrap(T t) { + return new ObjectWrapper(t); + } +} diff --git a/src/com/google/android/gms/location/Geofence.aidl b/src/com/google/android/gms/location/Geofence.aidl new file mode 100644 index 00000000..4fc554eb --- /dev/null +++ b/src/com/google/android/gms/location/Geofence.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.location; + +parcelable Geofence; \ No newline at end of file diff --git a/src/com/google/android/gms/location/Geofence.java b/src/com/google/android/gms/location/Geofence.java new file mode 100644 index 00000000..0c65cfa5 --- /dev/null +++ b/src/com/google/android/gms/location/Geofence.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2014 μg 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.location; + +import android.os.Parcel; +import org.microg.safeparcel.SafeParcelUtil; +import org.microg.safeparcel.SafeParcelable; + +public class Geofence implements SafeParcelable { + + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + SafeParcelUtil.writeObject(this, dest, flags); + } + + + public static Creator CREATOR = new Creator() { + @Override + public Geofence createFromParcel(Parcel source) { + return new Geofence(); + } + + @Override + public Geofence[] newArray(int size) { + return new Geofence[size]; + } + }; +} diff --git a/src/com/google/android/gms/location/internal/IGeofencerCallbacks.aidl b/src/com/google/android/gms/location/internal/IGeofencerCallbacks.aidl new file mode 100644 index 00000000..b8e03066 --- /dev/null +++ b/src/com/google/android/gms/location/internal/IGeofencerCallbacks.aidl @@ -0,0 +1,4 @@ +package com.google.android.gms.location.internal; + +interface IGeofencerCallbacks { +} diff --git a/src/com/google/android/gms/location/internal/IGoogleLocationManagerService.aidl b/src/com/google/android/gms/location/internal/IGoogleLocationManagerService.aidl new file mode 100644 index 00000000..c461587d --- /dev/null +++ b/src/com/google/android/gms/location/internal/IGoogleLocationManagerService.aidl @@ -0,0 +1,8 @@ +package com.google.android.gms.location.internal; + +import com.google.android.gms.location.Geofence; +import com.google.android.gms.location.internal.IGeofencerCallbacks; + +interface IGoogleLocationManagerService { + void addGeofences(in List geofences, in PendingIntent pendingIntent, IGeofencerCallbacks callback, String str); +} diff --git a/src/com/google/android/gms/maps/GoogleMapOptions.aidl b/src/com/google/android/gms/maps/GoogleMapOptions.aidl new file mode 100644 index 00000000..e2cf4afd --- /dev/null +++ b/src/com/google/android/gms/maps/GoogleMapOptions.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.maps; + +parcelable GoogleMapOptions; diff --git a/src/com/google/android/gms/maps/GoogleMapOptions.java b/src/com/google/android/gms/maps/GoogleMapOptions.java new file mode 100644 index 00000000..8219b155 --- /dev/null +++ b/src/com/google/android/gms/maps/GoogleMapOptions.java @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2014 μg 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.maps; + +import android.os.Parcel; +import com.google.android.gms.maps.model.CameraPosition; +import org.microg.safeparcel.SafeParcelUtil; +import org.microg.safeparcel.SafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public final class GoogleMapOptions implements SafeParcelable { + @SafeParceled(1) + private int versionCode; + @SafeParceled(2) + private int zOrderOnTop; + @SafeParceled(3) + private boolean useViewLifecycleInFragment; + @SafeParceled(4) + private int mapType; + @SafeParceled(5) + private CameraPosition camera; + @SafeParceled(6) + private boolean zoomControlsEnabled; + @SafeParceled(7) + private boolean compassEnabled; + @SafeParceled(8) + private boolean scrollGesturesEnabled; + @SafeParceled(9) + private boolean zoomGesturesEnabled; + @SafeParceled(10) + private boolean tiltGesturesEnabled; + @SafeParceled(11) + private boolean rotateGesturesEnabled; + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + SafeParcelUtil.writeObject(this, dest, flags); + } + + public GoogleMapOptions() { + } + + private GoogleMapOptions(Parcel in) { + SafeParcelUtil.readObject(this, in); + } + + public int getMapType() { + return mapType; + } + + public CameraPosition getCamera() { + return camera; + } + + public boolean isZoomControlsEnabled() { + return zoomControlsEnabled; + } + + public boolean isCompassEnabled() { + return compassEnabled; + } + + public boolean isScrollGesturesEnabled() { + return scrollGesturesEnabled; + } + + public boolean isZoomGesturesEnabled() { + return zoomGesturesEnabled; + } + + public boolean isTiltGesturesEnabled() { + return tiltGesturesEnabled; + } + + public boolean isRotateGesturesEnabled() { + return rotateGesturesEnabled; + } + + public static Creator CREATOR = new Creator() { + public GoogleMapOptions createFromParcel(Parcel source) { + return new GoogleMapOptions(source); + } + + public GoogleMapOptions[] newArray(int size) { + return new GoogleMapOptions[size]; + } + }; +} diff --git a/src/com/google/android/gms/maps/internal/ICameraUpdateFactoryDelegate.aidl b/src/com/google/android/gms/maps/internal/ICameraUpdateFactoryDelegate.aidl new file mode 100644 index 00000000..fc1665b7 --- /dev/null +++ b/src/com/google/android/gms/maps/internal/ICameraUpdateFactoryDelegate.aidl @@ -0,0 +1,20 @@ +package com.google.android.gms.maps.internal; + +import com.google.android.gms.dynamic.IObjectWrapper; +import com.google.android.gms.maps.model.CameraPosition; +import com.google.android.gms.maps.model.LatLng; +import com.google.android.gms.maps.model.LatLngBounds; + +interface ICameraUpdateFactoryDelegate { + IObjectWrapper zoomIn(); + IObjectWrapper zoomOut(); + IObjectWrapper scrollBy(float x, float y); + IObjectWrapper zoomTo(float zoom); + IObjectWrapper zoomBy(float zoomDelta); + IObjectWrapper zoomByWithFocus(float zoomDelta, int x, int y); + IObjectWrapper newCameraPosition(in CameraPosition cameraPosition); + IObjectWrapper newLatLng(in LatLng latLng); + IObjectWrapper newLatLngZoom(in LatLng latLng, float zoom); + IObjectWrapper newLatLngBounds(in LatLngBounds bounds, int i); + IObjectWrapper newLatLngBoundsWithSize(in LatLngBounds bounds, int i1, int i2, int i3); +} diff --git a/src/com/google/android/gms/maps/internal/ICancelableCallback.aidl b/src/com/google/android/gms/maps/internal/ICancelableCallback.aidl new file mode 100644 index 00000000..0cc5938f --- /dev/null +++ b/src/com/google/android/gms/maps/internal/ICancelableCallback.aidl @@ -0,0 +1,6 @@ +package com.google.android.gms.maps.internal; + +interface ICancelableCallback { + void onFinish(); + void onCancel(); +} diff --git a/src/com/google/android/gms/maps/internal/ICreator.aidl b/src/com/google/android/gms/maps/internal/ICreator.aidl new file mode 100644 index 00000000..f10ab345 --- /dev/null +++ b/src/com/google/android/gms/maps/internal/ICreator.aidl @@ -0,0 +1,17 @@ +package com.google.android.gms.maps.internal; + +import com.google.android.gms.dynamic.IObjectWrapper; +import com.google.android.gms.maps.GoogleMapOptions; +import com.google.android.gms.maps.internal.IMapFragmentDelegate; +import com.google.android.gms.maps.internal.IMapViewDelegate; +import com.google.android.gms.maps.internal.ICameraUpdateFactoryDelegate; +import com.google.android.gms.maps.model.internal.IBitmapDescriptorFactoryDelegate; + +interface ICreator { + void init(IObjectWrapper resources); + IMapFragmentDelegate newMapFragmentDelegate(IObjectWrapper activity); + IMapViewDelegate newMapViewDelegate(IObjectWrapper context, in GoogleMapOptions options); + ICameraUpdateFactoryDelegate newCameraUpdateFactoryDelegate(); + IBitmapDescriptorFactoryDelegate newBitmapDescriptorFactoryDelegate(); + void initV2(IObjectWrapper resources, int flags); +} diff --git a/src/com/google/android/gms/maps/internal/IGoogleMapDelegate.aidl b/src/com/google/android/gms/maps/internal/IGoogleMapDelegate.aidl new file mode 100644 index 00000000..ac474c35 --- /dev/null +++ b/src/com/google/android/gms/maps/internal/IGoogleMapDelegate.aidl @@ -0,0 +1,91 @@ +package com.google.android.gms.maps.internal; + +import com.google.android.gms.dynamic.IObjectWrapper; +import com.google.android.gms.maps.model.CameraPosition; +import com.google.android.gms.maps.internal.ICancelableCallback; +import com.google.android.gms.maps.internal.ILocationSourceDelegate; +import com.google.android.gms.maps.internal.IUiSettingsDelegate; +import com.google.android.gms.maps.internal.IProjectionDelegate; +import com.google.android.gms.maps.internal.IOnCameraChangeListener; +import com.google.android.gms.maps.internal.IOnMapClickListener; +import com.google.android.gms.maps.internal.IOnMapLongClickListener; +import com.google.android.gms.maps.internal.IOnMarkerClickListener; +import com.google.android.gms.maps.internal.IOnMarkerDragListener; +import com.google.android.gms.maps.internal.IOnInfoWindowClickListener; +import com.google.android.gms.maps.internal.IInfoWindowAdapter; +import com.google.android.gms.maps.internal.IOnMapLoadedCallback; +import com.google.android.gms.maps.internal.IOnMyLocationChangeListener; +import com.google.android.gms.maps.internal.IOnMyLocationButtonClickListener; +import com.google.android.gms.maps.internal.ISnapshotReadyCallback; +import com.google.android.gms.maps.model.CircleOptions; +import com.google.android.gms.maps.model.GroundOverlayOptions; +import com.google.android.gms.maps.model.MarkerOptions; +import com.google.android.gms.maps.model.PolygonOptions; +import com.google.android.gms.maps.model.PolylineOptions; +import com.google.android.gms.maps.model.TileOverlayOptions; +import com.google.android.gms.maps.model.internal.IPolylineDelegate; +import com.google.android.gms.maps.model.internal.IPolygonDelegate; +import com.google.android.gms.maps.model.internal.IMarkerDelegate; +import com.google.android.gms.maps.model.internal.ICircleDelegate; +import com.google.android.gms.maps.model.internal.IGroundOverlayDelegate; +import com.google.android.gms.maps.model.internal.ITileOverlayDelegate; + +interface IGoogleMapDelegate { + CameraPosition getCameraPosition(); + + float getMaxZoomLevel(); + float getMinZoomLevel(); + + void moveCamera(IObjectWrapper cameraUpdate); + void animateCamera(IObjectWrapper cameraUpdate); + void animateCameraWithCallback(IObjectWrapper cameraUpdate, ICancelableCallback callback); + void animateCameraWithDurationAndCallback(IObjectWrapper cameraUpdate, int duration, ICancelableCallback callback); + void stopAnimation(); + + IPolylineDelegate addPolyline(in PolylineOptions options); + IPolygonDelegate addPolygon(in PolygonOptions options); + IMarkerDelegate addMarker(in MarkerOptions options); + IGroundOverlayDelegate addGroundOverlay(in GroundOverlayOptions options); + ITileOverlayDelegate addTileOverlay(in TileOverlayOptions options); + + void clear(); + + int getMapType(); + void setMapType(int type); + boolean isTrafficEnabled(); + void setTrafficEnabled(boolean traffic); + boolean isIndoorEnabled(); + void setIndoorEnabled(boolean indoor); + + boolean isMyLocationEnabled(); + void setMyLocationEnabled(boolean myLocation); + Location getMyLocation(); + void setLocationSource(ILocationSourceDelegate locationSource); + + IUiSettingsDelegate getUiSettings(); + IProjectionDelegate getProjection(); + + void setOnCameraChangeListener(IOnCameraChangeListener listener); + void setOnMapClickListener(IOnMapClickListener listener); + void setOnMapLongClickListener(IOnMapLongClickListener listener); + void setOnMarkerClickListener(IOnMarkerClickListener listener); + void setOnMarkerDragListener(IOnMarkerDragListener listener); + void setOnInfoWindowClickListener(IOnInfoWindowClickListener listener); + void setInfoWindowAdapter(IInfoWindowAdapter adapter); + + IObjectWrapper getTestingHelper(); + + ICircleDelegate addCircle(in CircleOptions options); + + void setOnMyLocationChangeListener(IOnMyLocationChangeListener listener); + void setOnMyLocationButtonClickListener(IOnMyLocationButtonClickListener listener); + + void snapshot(ISnapshotReadyCallback callback, IObjectWrapper bitmap); + + void setPadding(int left, int top, int right, int bottom); + + boolean isBuildingsEnabled(); + void setBuildingsEnabled(boolean buildings); + + void setOnMapLoadedCallback(IOnMapLoadedCallback callback); +} diff --git a/src/com/google/android/gms/maps/internal/IInfoWindowAdapter.aidl b/src/com/google/android/gms/maps/internal/IInfoWindowAdapter.aidl new file mode 100644 index 00000000..d11d71d4 --- /dev/null +++ b/src/com/google/android/gms/maps/internal/IInfoWindowAdapter.aidl @@ -0,0 +1,9 @@ +package com.google.android.gms.maps.internal; + +import com.google.android.gms.dynamic.IObjectWrapper; +import com.google.android.gms.maps.model.internal.IMarkerDelegate; + +interface IInfoWindowAdapter { + IObjectWrapper getInfoWindow(IMarkerDelegate marker); + IObjectWrapper getInfoContents(IMarkerDelegate marker); +} diff --git a/src/com/google/android/gms/maps/internal/ILocationSourceDelegate.aidl b/src/com/google/android/gms/maps/internal/ILocationSourceDelegate.aidl new file mode 100644 index 00000000..203ec69f --- /dev/null +++ b/src/com/google/android/gms/maps/internal/ILocationSourceDelegate.aidl @@ -0,0 +1,4 @@ +package com.google.android.gms.maps.internal; + +interface ILocationSourceDelegate { +} diff --git a/src/com/google/android/gms/maps/internal/IMapFragmentDelegate.aidl b/src/com/google/android/gms/maps/internal/IMapFragmentDelegate.aidl new file mode 100644 index 00000000..966c4e4b --- /dev/null +++ b/src/com/google/android/gms/maps/internal/IMapFragmentDelegate.aidl @@ -0,0 +1,19 @@ +package com.google.android.gms.maps.internal; + +import com.google.android.gms.maps.internal.IGoogleMapDelegate; +import com.google.android.gms.maps.GoogleMapOptions; +import com.google.android.gms.dynamic.IObjectWrapper; + +interface IMapFragmentDelegate { + IGoogleMapDelegate getMap(); + void onInflate(IObjectWrapper activity, in GoogleMapOptions options, in Bundle savedInstanceState); + void onCreate(in Bundle savedInstanceState); + IObjectWrapper onCreateView(IObjectWrapper layoutInflate, IObjectWrapper container, in Bundle savedInstanceState); + void onResume(); + void onPause(); + void onDestroyView(); + void onDestroy(); + void onLowMemory(); + void onSaveInstanceState(inout Bundle outState); + boolean isReady(); +} diff --git a/src/com/google/android/gms/maps/internal/IMapViewDelegate.aidl b/src/com/google/android/gms/maps/internal/IMapViewDelegate.aidl new file mode 100644 index 00000000..820e27b4 --- /dev/null +++ b/src/com/google/android/gms/maps/internal/IMapViewDelegate.aidl @@ -0,0 +1,15 @@ +package com.google.android.gms.maps.internal; + +import com.google.android.gms.maps.internal.IGoogleMapDelegate; +import com.google.android.gms.dynamic.IObjectWrapper; + +interface IMapViewDelegate { + IGoogleMapDelegate getMap(); + void onCreate(in Bundle savedInstanceState); + void onResume(); + void onPause(); + void onDestroy(); + void onLowMemory(); + void onSaveInstanceState(inout Bundle outState); + IObjectWrapper getView(); +} diff --git a/src/com/google/android/gms/maps/internal/IOnCameraChangeListener.aidl b/src/com/google/android/gms/maps/internal/IOnCameraChangeListener.aidl new file mode 100644 index 00000000..41010aa0 --- /dev/null +++ b/src/com/google/android/gms/maps/internal/IOnCameraChangeListener.aidl @@ -0,0 +1,4 @@ +package com.google.android.gms.maps.internal; + +interface IOnCameraChangeListener { +} diff --git a/src/com/google/android/gms/maps/internal/IOnInfoWindowClickListener.aidl b/src/com/google/android/gms/maps/internal/IOnInfoWindowClickListener.aidl new file mode 100644 index 00000000..7c396ce7 --- /dev/null +++ b/src/com/google/android/gms/maps/internal/IOnInfoWindowClickListener.aidl @@ -0,0 +1,7 @@ +package com.google.android.gms.maps.internal; + +import com.google.android.gms.maps.model.internal.IMarkerDelegate; + +interface IOnInfoWindowClickListener { + void onInfoWindowClick(IMarkerDelegate marker); +} diff --git a/src/com/google/android/gms/maps/internal/IOnMapClickListener.aidl b/src/com/google/android/gms/maps/internal/IOnMapClickListener.aidl new file mode 100644 index 00000000..6b3b2ec8 --- /dev/null +++ b/src/com/google/android/gms/maps/internal/IOnMapClickListener.aidl @@ -0,0 +1,7 @@ +package com.google.android.gms.maps.internal; + +import com.google.android.gms.maps.model.LatLng; + +interface IOnMapClickListener { + void onMapClick(in LatLng latLng); +} diff --git a/src/com/google/android/gms/maps/internal/IOnMapLoadedCallback.aidl b/src/com/google/android/gms/maps/internal/IOnMapLoadedCallback.aidl new file mode 100644 index 00000000..969d9652 --- /dev/null +++ b/src/com/google/android/gms/maps/internal/IOnMapLoadedCallback.aidl @@ -0,0 +1,4 @@ +package com.google.android.gms.maps.internal; + +interface IOnMapLoadedCallback { +} diff --git a/src/com/google/android/gms/maps/internal/IOnMapLongClickListener.aidl b/src/com/google/android/gms/maps/internal/IOnMapLongClickListener.aidl new file mode 100644 index 00000000..11201b2c --- /dev/null +++ b/src/com/google/android/gms/maps/internal/IOnMapLongClickListener.aidl @@ -0,0 +1,7 @@ +package com.google.android.gms.maps.internal; + +import com.google.android.gms.maps.model.LatLng; + +interface IOnMapLongClickListener { + void onMapLongClick(in LatLng latLng); +} diff --git a/src/com/google/android/gms/maps/internal/IOnMarkerClickListener.aidl b/src/com/google/android/gms/maps/internal/IOnMarkerClickListener.aidl new file mode 100644 index 00000000..94c4465d --- /dev/null +++ b/src/com/google/android/gms/maps/internal/IOnMarkerClickListener.aidl @@ -0,0 +1,7 @@ +package com.google.android.gms.maps.internal; + +import com.google.android.gms.maps.model.internal.IMarkerDelegate; + +interface IOnMarkerClickListener { + boolean onMarkerClick(IMarkerDelegate marker); +} diff --git a/src/com/google/android/gms/maps/internal/IOnMarkerDragListener.aidl b/src/com/google/android/gms/maps/internal/IOnMarkerDragListener.aidl new file mode 100644 index 00000000..42cec6ca --- /dev/null +++ b/src/com/google/android/gms/maps/internal/IOnMarkerDragListener.aidl @@ -0,0 +1,4 @@ +package com.google.android.gms.maps.internal; + +interface IOnMarkerDragListener { +} diff --git a/src/com/google/android/gms/maps/internal/IOnMyLocationButtonClickListener.aidl b/src/com/google/android/gms/maps/internal/IOnMyLocationButtonClickListener.aidl new file mode 100644 index 00000000..b10880dd --- /dev/null +++ b/src/com/google/android/gms/maps/internal/IOnMyLocationButtonClickListener.aidl @@ -0,0 +1,4 @@ +package com.google.android.gms.maps.internal; + +interface IOnMyLocationButtonClickListener { +} diff --git a/src/com/google/android/gms/maps/internal/IOnMyLocationChangeListener.aidl b/src/com/google/android/gms/maps/internal/IOnMyLocationChangeListener.aidl new file mode 100644 index 00000000..db71cd63 --- /dev/null +++ b/src/com/google/android/gms/maps/internal/IOnMyLocationChangeListener.aidl @@ -0,0 +1,4 @@ +package com.google.android.gms.maps.internal; + +interface IOnMyLocationChangeListener { +} diff --git a/src/com/google/android/gms/maps/internal/IProjectionDelegate.aidl b/src/com/google/android/gms/maps/internal/IProjectionDelegate.aidl new file mode 100644 index 00000000..9b2da90b --- /dev/null +++ b/src/com/google/android/gms/maps/internal/IProjectionDelegate.aidl @@ -0,0 +1,11 @@ +package com.google.android.gms.maps.internal; + +import com.google.android.gms.dynamic.IObjectWrapper; +import com.google.android.gms.maps.model.LatLng; +import com.google.android.gms.maps.model.VisibleRegion; + +interface IProjectionDelegate { + LatLng fromScreenLocation(IObjectWrapper obj); + IObjectWrapper toScreenLocation(in LatLng latLng); + VisibleRegion getVisibleRegion(); +} diff --git a/src/com/google/android/gms/maps/internal/ISnapshotReadyCallback.aidl b/src/com/google/android/gms/maps/internal/ISnapshotReadyCallback.aidl new file mode 100644 index 00000000..48a39219 --- /dev/null +++ b/src/com/google/android/gms/maps/internal/ISnapshotReadyCallback.aidl @@ -0,0 +1,4 @@ +package com.google.android.gms.maps.internal; + +interface ISnapshotReadyCallback { +} diff --git a/src/com/google/android/gms/maps/internal/IUiSettingsDelegate.aidl b/src/com/google/android/gms/maps/internal/IUiSettingsDelegate.aidl new file mode 100644 index 00000000..ca5e0d08 --- /dev/null +++ b/src/com/google/android/gms/maps/internal/IUiSettingsDelegate.aidl @@ -0,0 +1,19 @@ +package com.google.android.gms.maps.internal; + +interface IUiSettingsDelegate { + void setZoomControlsEnabled(boolean zoom); + void setCompassEnabled(boolean compass); + void setMyLocationButtonEnabled(boolean locationButton); + void setScrollGesturesEnabled(boolean scrollGestures); + void setZoomGesturesEnabled(boolean zoomGestures); + void setTiltGesturesEnabled(boolean tiltGestures); + void setRotateGesturesEnabled(boolean rotateGestures); + void setAllGesturesEnabled(boolean gestures); + boolean isZoomControlsEnabled(); + boolean isCompassEnabled(); + boolean isMyLocationButtonEnabled(); + boolean isScrollGesturesEnabled(); + boolean isZoomGesturesEnabled(); + boolean isTiltGesturesEnabled(); + boolean isRotateGesturesEnabled(); +} diff --git a/src/com/google/android/gms/maps/model/CameraPosition.aidl b/src/com/google/android/gms/maps/model/CameraPosition.aidl new file mode 100644 index 00000000..bb5ab701 --- /dev/null +++ b/src/com/google/android/gms/maps/model/CameraPosition.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.maps.model; + +parcelable CameraPosition; diff --git a/src/com/google/android/gms/maps/model/CameraPosition.java b/src/com/google/android/gms/maps/model/CameraPosition.java new file mode 100644 index 00000000..109dfddb --- /dev/null +++ b/src/com/google/android/gms/maps/model/CameraPosition.java @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2014 μg 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.maps.model; + +import android.os.Parcel; +import org.microg.safeparcel.SafeParcelUtil; +import org.microg.safeparcel.SafeParcelable; +import org.microg.safeparcel.SafeParceled; + +import java.util.Arrays; + +public class CameraPosition implements SafeParcelable { + @SafeParceled(1) + private int versionCode; + @SafeParceled(2) + public LatLng target; + @SafeParceled(3) + public float zoom; + @SafeParceled(4) + public float tilt; + @SafeParceled(5) + public float bearing; + + private CameraPosition(Parcel in) { + SafeParcelUtil.readObject(this, in); + } + + public CameraPosition(int versionCode, LatLng target, float zoom, float tilt, float bearing) { + this.versionCode = versionCode; + if (target == null) { + throw new NullPointerException("null camera target"); + } + this.target = target; + this.zoom = zoom; + if (tilt < 0 || 90 < tilt) { + throw new IllegalArgumentException("Tilt needs to be between 0 and 90 inclusive"); + } + this.tilt = tilt; + if (bearing <= 0) { + bearing += 360; + } + this.bearing = bearing % 360; + } + + public CameraPosition(LatLng target, float zoom, float tilt, float bearing) { + this(1, target, zoom, tilt, bearing); + } + + public static CameraPosition create(LatLng latLng) { + return new CameraPosition(latLng, 0, 0, 0); + } + + @Override + public int hashCode() { + return Arrays.hashCode(new Object[] { target, zoom, tilt, bearing }); + } + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + SafeParcelUtil.writeObject(this, dest, flags); + } + + public static Creator CREATOR = new Creator() { + public CameraPosition createFromParcel(Parcel source) { + return new CameraPosition(source); + } + + public CameraPosition[] newArray(int size) { + return new CameraPosition[size]; + } + }; +} diff --git a/src/com/google/android/gms/maps/model/CircleOptions.aidl b/src/com/google/android/gms/maps/model/CircleOptions.aidl new file mode 100644 index 00000000..33ae4542 --- /dev/null +++ b/src/com/google/android/gms/maps/model/CircleOptions.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.maps.model; + +parcelable CircleOptions; diff --git a/src/com/google/android/gms/maps/model/CircleOptions.java b/src/com/google/android/gms/maps/model/CircleOptions.java new file mode 100644 index 00000000..1b6d982d --- /dev/null +++ b/src/com/google/android/gms/maps/model/CircleOptions.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2014 μg 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.maps.model; + +import android.os.Parcel; +import org.microg.safeparcel.SafeParcelUtil; +import org.microg.safeparcel.SafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class CircleOptions implements SafeParcelable { + public static Creator CREATOR = new Creator() { + public CircleOptions createFromParcel(Parcel source) { + return new CircleOptions(source); + } + + public CircleOptions[] newArray(int size) { + return new CircleOptions[size]; + } + }; + @SafeParceled(1) + private int versionCode; + @SafeParceled(2) + private LatLng center; + @SafeParceled(3) + private double radius; + @SafeParceled(4) + private float strokeWidth; + @SafeParceled(5) + private int strokeColor; + @SafeParceled(6) + private int fillColor; + @SafeParceled(7) + private float zIndex; + @SafeParceled(8) + private boolean visisble; + + public CircleOptions() { + } + + private CircleOptions(Parcel in) { + SafeParcelUtil.readObject(this, in); + } + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + SafeParcelUtil.writeObject(this, dest, flags); + } +} diff --git a/src/com/google/android/gms/maps/model/GroundOverlayOptions.aidl b/src/com/google/android/gms/maps/model/GroundOverlayOptions.aidl new file mode 100644 index 00000000..5bdbefaf --- /dev/null +++ b/src/com/google/android/gms/maps/model/GroundOverlayOptions.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.maps.model; + +parcelable GroundOverlayOptions; diff --git a/src/com/google/android/gms/maps/model/GroundOverlayOptions.java b/src/com/google/android/gms/maps/model/GroundOverlayOptions.java new file mode 100644 index 00000000..dd758cfe --- /dev/null +++ b/src/com/google/android/gms/maps/model/GroundOverlayOptions.java @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2014 μg 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.maps.model; + +import android.os.IBinder; +import android.os.Parcel; +import org.microg.safeparcel.SafeParcelUtil; +import org.microg.safeparcel.SafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class GroundOverlayOptions implements SafeParcelable { + @SafeParceled(1) + private int versionCode; + @SafeParceled(2) + private IBinder wrappedImage; + @SafeParceled(3) + private LatLng location; + @SafeParceled(4) + private float width; + @SafeParceled(5) + private float height; + @SafeParceled(6) + private LatLngBounds bounds; + @SafeParceled(7) + private float bearing; + @SafeParceled(8) + private float zIndex; + @SafeParceled(9) + private boolean visible; + @SafeParceled(10) + private float transparency; + @SafeParceled(11) + private float anchorU; + @SafeParceled(12) + private float anchorV; + + public GroundOverlayOptions() { + } + + private GroundOverlayOptions(Parcel in) { + SafeParcelUtil.readObject(this, in); + // wrappedImage = new BitmapDescriptor(IObjectWrapper.Stub.asInterface(SafeReader.readBinder(in, position))); + } + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + SafeParcelUtil.writeObject(this, dest, flags); + // SafeParcelWriter.write(dest, 2, wrappedImage.getRemoteObject().asBinder(), false); + } + + public static Creator CREATOR = new Creator() { + public GroundOverlayOptions createFromParcel(Parcel source) { + return new GroundOverlayOptions(source); + } + + public GroundOverlayOptions[] newArray(int size) { + return new GroundOverlayOptions[size]; + } + }; +} diff --git a/src/com/google/android/gms/maps/model/LatLng.aidl b/src/com/google/android/gms/maps/model/LatLng.aidl new file mode 100644 index 00000000..42df9312 --- /dev/null +++ b/src/com/google/android/gms/maps/model/LatLng.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.maps.model; + +parcelable LatLng; diff --git a/src/com/google/android/gms/maps/model/LatLng.java b/src/com/google/android/gms/maps/model/LatLng.java new file mode 100644 index 00000000..1d4d1ddd --- /dev/null +++ b/src/com/google/android/gms/maps/model/LatLng.java @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2014 μg 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.maps.model; + +import android.os.Parcel; +import org.microg.safeparcel.SafeParcelUtil; +import org.microg.safeparcel.SafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class LatLng implements SafeParcelable { + public static Creator CREATOR = new Creator() { + public LatLng createFromParcel(Parcel source) { + return new LatLng(source); + } + + public LatLng[] newArray(int size) { + return new LatLng[size]; + } + }; + @SafeParceled(2) + public double latitude; + @SafeParceled(3) + public double longitude; + @SafeParceled(1) + private int versionCode; + + public LatLng(int versionCode, double latitude, double longitude) { + this.versionCode = versionCode; + this.latitude = Math.max(-90, Math.min(90, latitude)); + if ((-180 <= longitude) && (longitude < 180)) { + this.longitude = longitude; + } else { + this.longitude = ((360 + (longitude - 180) % 360) % 360 - 180); + } + } + + private LatLng(Parcel in) { + SafeParcelUtil.readObject(this, in); + } + + public LatLng(double latitude, double longitude) { + this(1, latitude, longitude); + } + + @Override + public final int hashCode() { + long lat = Double.doubleToLongBits(latitude); + int tmp = 31 + (int) (lat ^ lat >>> 32); + long lon = Double.doubleToLongBits(longitude); + return tmp * 31 + (int) (lon ^ lon >>> 32); + } + + @Override + public String toString() { + return "lat/lng: (" + latitude + "," + longitude + ")"; + } + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + SafeParcelUtil.writeObject(this, dest, flags); + } +} diff --git a/src/com/google/android/gms/maps/model/LatLngBounds.aidl b/src/com/google/android/gms/maps/model/LatLngBounds.aidl new file mode 100644 index 00000000..70538794 --- /dev/null +++ b/src/com/google/android/gms/maps/model/LatLngBounds.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.maps.model; + +parcelable LatLngBounds; \ No newline at end of file diff --git a/src/com/google/android/gms/maps/model/LatLngBounds.java b/src/com/google/android/gms/maps/model/LatLngBounds.java new file mode 100644 index 00000000..42da1d3f --- /dev/null +++ b/src/com/google/android/gms/maps/model/LatLngBounds.java @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2014 μg 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.maps.model; + +import android.os.Parcel; +import org.microg.safeparcel.SafeParcelUtil; +import org.microg.safeparcel.SafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class LatLngBounds implements SafeParcelable { + public static Creator CREATOR = new Creator() { + public LatLngBounds createFromParcel(Parcel source) { + return new LatLngBounds(source); + } + + public LatLngBounds[] newArray(int size) { + return new LatLngBounds[size]; + } + }; + @SafeParceled(1) + private int versionCode; + @SafeParceled(2) + public LatLng southWest; + @SafeParceled(3) + public LatLng northEast; + + public LatLngBounds(int versionCode, LatLng southWest, LatLng northEast) { + this.versionCode = versionCode; + this.southWest = southWest; + this.northEast = northEast; + } + + public LatLngBounds(LatLng southWest, LatLng northEast) { + this(1, southWest, northEast); + } + + private LatLngBounds(Parcel in) { + SafeParcelUtil.readObject(this, in); + } + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + SafeParcelUtil.writeObject(this, dest, flags); + } +} diff --git a/src/com/google/android/gms/maps/model/MarkerOptions.aidl b/src/com/google/android/gms/maps/model/MarkerOptions.aidl new file mode 100644 index 00000000..dc4abbcf --- /dev/null +++ b/src/com/google/android/gms/maps/model/MarkerOptions.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.maps.model; + +parcelable MarkerOptions; diff --git a/src/com/google/android/gms/maps/model/MarkerOptions.java b/src/com/google/android/gms/maps/model/MarkerOptions.java new file mode 100644 index 00000000..4162f0c0 --- /dev/null +++ b/src/com/google/android/gms/maps/model/MarkerOptions.java @@ -0,0 +1,134 @@ +/* + * Copyright (c) 2014 μg 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.maps.model; + +import android.os.IBinder; +import android.os.Parcel; +import org.microg.safeparcel.SafeParcelUtil; +import org.microg.safeparcel.SafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class MarkerOptions implements SafeParcelable { + + @SafeParceled(1) + private int versionCode = 1; + @SafeParceled(2) + private LatLng position; + @SafeParceled(3) + private String title; + @SafeParceled(4) + private String snippet; + @SafeParceled(5) + private IBinder icon; + @SafeParceled(6) + private float anchorU = 0.5F; + @SafeParceled(7) + private float anchorV = 1F; + @SafeParceled(8) + private boolean draggable; + @SafeParceled(9) + private boolean visible; + @SafeParceled(10) + private boolean flat; + @SafeParceled(11) + private float rotation = 0F; + @SafeParceled(12) + private float infoWindowAnchorU = 0F; + @SafeParceled(13) + private float infoWindowAnchorV = 1F; + @SafeParceled(14) + private float alpha = 1F; + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + } + + public MarkerOptions() { + } + + private MarkerOptions(Parcel in) { + SafeParcelUtil.readObject(this, in); + // this.icon = icon == null ? null : new BitmapDescriptor(ObjectWrapper.asInterface(icon)); + } + + public LatLng getPosition() { + return position; + } + + public String getTitle() { + return title; + } + + public String getSnippet() { + return snippet; + } + + public IBinder getIcon() { + return icon; + } + + public float getAnchorU() { + return anchorU; + } + + public float getAnchorV() { + return anchorV; + } + + public boolean isDraggable() { + return draggable; + } + + public boolean isVisible() { + return visible; + } + + public boolean isFlat() { + return flat; + } + + public float getRotation() { + return rotation; + } + + public float getInfoWindowAnchorU() { + return infoWindowAnchorU; + } + + public float getInfoWindowAnchorV() { + return infoWindowAnchorV; + } + + public float getAlpha() { + return alpha; + } + + public static Creator CREATOR = new Creator() { + public MarkerOptions createFromParcel(Parcel source) { + return new MarkerOptions(source); + } + + public MarkerOptions[] newArray(int size) { + return new MarkerOptions[size]; + } + }; +} diff --git a/src/com/google/android/gms/maps/model/PolygonOptions.aidl b/src/com/google/android/gms/maps/model/PolygonOptions.aidl new file mode 100644 index 00000000..adac82a0 --- /dev/null +++ b/src/com/google/android/gms/maps/model/PolygonOptions.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.maps.model; + +parcelable PolygonOptions; diff --git a/src/com/google/android/gms/maps/model/PolygonOptions.java b/src/com/google/android/gms/maps/model/PolygonOptions.java new file mode 100644 index 00000000..aaefc97c --- /dev/null +++ b/src/com/google/android/gms/maps/model/PolygonOptions.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2014 μg 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.maps.model; + +import android.os.Parcel; +import org.microg.safeparcel.SafeParcelUtil; +import org.microg.safeparcel.SafeParcelable; + +public class PolygonOptions implements SafeParcelable { + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + SafeParcelUtil.writeObject(this, dest, flags); + } + + public PolygonOptions() { + } + + private PolygonOptions(Parcel in) { + SafeParcelUtil.readObject(this, in); + } + + public static Creator CREATOR = new Creator() { + public PolygonOptions createFromParcel(Parcel source) { + return new PolygonOptions(source); + } + + public PolygonOptions[] newArray(int size) { + return new PolygonOptions[size]; + } + }; +} diff --git a/src/com/google/android/gms/maps/model/PolylineOptions.aidl b/src/com/google/android/gms/maps/model/PolylineOptions.aidl new file mode 100644 index 00000000..7c165891 --- /dev/null +++ b/src/com/google/android/gms/maps/model/PolylineOptions.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.maps.model; + +parcelable PolylineOptions; diff --git a/src/com/google/android/gms/maps/model/PolylineOptions.java b/src/com/google/android/gms/maps/model/PolylineOptions.java new file mode 100644 index 00000000..6cc21ac2 --- /dev/null +++ b/src/com/google/android/gms/maps/model/PolylineOptions.java @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2014 μg 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.maps.model; + +import android.os.Parcel; +import android.os.Parcelable; +import org.microg.safeparcel.SafeParcelUtil; +import org.microg.safeparcel.SafeParcelable; +import org.microg.safeparcel.SafeParceled; + +import java.util.ArrayList; +import java.util.List; + +public class PolylineOptions implements SafeParcelable { + @SafeParceled(1) + private int versionCode; + // TODO + private List points; + private float width; + private int color; + private float zIndex; + private boolean visible; + private boolean geodesic; + + + public PolylineOptions() { + } + + private PolylineOptions(Parcel in) { + SafeParcelUtil.readObject(this, in); + } + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + SafeParcelUtil.writeObject(this, dest, flags); + } + + public static Creator CREATOR = new Creator() { + public PolylineOptions createFromParcel(Parcel source) { + return new PolylineOptions(source); + } + + public PolylineOptions[] newArray(int size) { + return new PolylineOptions[size]; + } + }; +} diff --git a/src/com/google/android/gms/maps/model/TileOverlayOptions.aidl b/src/com/google/android/gms/maps/model/TileOverlayOptions.aidl new file mode 100644 index 00000000..85f5ac32 --- /dev/null +++ b/src/com/google/android/gms/maps/model/TileOverlayOptions.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.maps.model; + +parcelable TileOverlayOptions; diff --git a/src/com/google/android/gms/maps/model/TileOverlayOptions.java b/src/com/google/android/gms/maps/model/TileOverlayOptions.java new file mode 100644 index 00000000..0256adfc --- /dev/null +++ b/src/com/google/android/gms/maps/model/TileOverlayOptions.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2014 μg 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.maps.model; + +import android.os.Parcel; +import org.microg.safeparcel.SafeParcelUtil; +import org.microg.safeparcel.SafeParcelable; + +public class TileOverlayOptions implements SafeParcelable { + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + SafeParcelUtil.writeObject(this, dest, flags); + } + + public TileOverlayOptions() { + } + + private TileOverlayOptions(Parcel in) { + SafeParcelUtil.readObject(this, in); + } + + public static Creator CREATOR = new Creator() { + public TileOverlayOptions createFromParcel(Parcel source) { + return new TileOverlayOptions(source); + } + + public TileOverlayOptions[] newArray(int size) { + return new TileOverlayOptions[size]; + } + }; +} diff --git a/src/com/google/android/gms/maps/model/VisibleRegion.aidl b/src/com/google/android/gms/maps/model/VisibleRegion.aidl new file mode 100644 index 00000000..09d22101 --- /dev/null +++ b/src/com/google/android/gms/maps/model/VisibleRegion.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.maps.model; + +parcelable VisibleRegion; diff --git a/src/com/google/android/gms/maps/model/VisibleRegion.java b/src/com/google/android/gms/maps/model/VisibleRegion.java new file mode 100644 index 00000000..21f9cd13 --- /dev/null +++ b/src/com/google/android/gms/maps/model/VisibleRegion.java @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2014 μg 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.maps.model; + +import android.os.Parcel; +import org.microg.safeparcel.SafeParcelUtil; +import org.microg.safeparcel.SafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class VisibleRegion implements SafeParcelable { + @SafeParceled(1) + private int versionCode; + @SafeParceled(2) + private LatLng nearLeft; + @SafeParceled(3) + private LatLng nearRight; + @SafeParceled(4) + private LatLng farLeft; + @SafeParceled(5) + private LatLng farRight; + @SafeParceled(6) + private LatLngBounds bounds; + + public VisibleRegion(int versionCode, LatLng nearLeft, LatLng nearRight, LatLng farLeft, + LatLng farRight, LatLngBounds bounds) { + this.versionCode = versionCode; + this.nearLeft = nearLeft; + this.nearRight = nearRight; + this.farLeft = farLeft; + this.farRight = farRight; + this.bounds = bounds; + } + + public VisibleRegion(LatLng nearLeft, LatLng nearRight, LatLng farLeft, LatLng farRight, + LatLngBounds bounds) { + this(1, nearLeft, nearRight, farLeft, farRight, bounds); + } + + public VisibleRegion(Parcel in) { + SafeParcelUtil.readObject(this, in); + } + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + SafeParcelUtil.writeObject(this, dest, flags); + } + + public static Creator CREATOR = new Creator() { + public VisibleRegion createFromParcel(Parcel source) { + return new VisibleRegion(source); + } + + public VisibleRegion[] newArray(int size) { + return new VisibleRegion[size]; + } + }; +} diff --git a/src/com/google/android/gms/maps/model/internal/IBitmapDescriptorFactoryDelegate.aidl b/src/com/google/android/gms/maps/model/internal/IBitmapDescriptorFactoryDelegate.aidl new file mode 100644 index 00000000..dca49b60 --- /dev/null +++ b/src/com/google/android/gms/maps/model/internal/IBitmapDescriptorFactoryDelegate.aidl @@ -0,0 +1,14 @@ +package com.google.android.gms.maps.model.internal; + +import android.graphics.Bitmap; +import com.google.android.gms.dynamic.IObjectWrapper; + +interface IBitmapDescriptorFactoryDelegate { + IObjectWrapper fromResource(int resourceId); + IObjectWrapper fromAsset(String assetName); + IObjectWrapper fromFile(String fileName); + IObjectWrapper defaultMarker(); + IObjectWrapper defaultMarkerWithHue(float hue); + IObjectWrapper fromBitmap(in Bitmap bitmap); + IObjectWrapper fromPath(String absolutePath); +} diff --git a/src/com/google/android/gms/maps/model/internal/ICircleDelegate.aidl b/src/com/google/android/gms/maps/model/internal/ICircleDelegate.aidl new file mode 100644 index 00000000..719d8eab --- /dev/null +++ b/src/com/google/android/gms/maps/model/internal/ICircleDelegate.aidl @@ -0,0 +1,24 @@ +package com.google.android.gms.maps.model.internal; + +import com.google.android.gms.maps.model.LatLng; + +interface ICircleDelegate { + void remove(); + String getId(); + void setCenter(in LatLng center); + LatLng getCenter(); + void setRadius(double radius); + double getRadius(); + void setStrokeWidth(float width); + float getStrokeWidth(); + void setStrokeColor(int color); + int getStrokeColor(); + void setFillColor(int color); + int getFillColor(); + void setZIndex(float zIndex); + float getZIndex(); + void setVisible(boolean visible); + boolean isVisible(); + boolean equalsRemote(ICircleDelegate other); + int hashCodeRemote(); +} diff --git a/src/com/google/android/gms/maps/model/internal/IGroundOverlayDelegate.aidl b/src/com/google/android/gms/maps/model/internal/IGroundOverlayDelegate.aidl new file mode 100644 index 00000000..0a1a0632 --- /dev/null +++ b/src/com/google/android/gms/maps/model/internal/IGroundOverlayDelegate.aidl @@ -0,0 +1,29 @@ +package com.google.android.gms.maps.model.internal; + +import com.google.android.gms.dynamic.IObjectWrapper; +import com.google.android.gms.maps.model.LatLng; +import com.google.android.gms.maps.model.LatLngBounds; + +interface IGroundOverlayDelegate { + void remove(); + String getId(); + void setPosition(in LatLng pos); + LatLng getPosition(); + void setDimension(float dimension); + void setDimensions(float width, float height); + float getWidth(); + float getHeight(); + void setPositionFromBounds(in LatLngBounds bounds); + LatLngBounds getBounds(); + void setBearing(float bearing); + float getBearing(); + void setZIndex(float zIndex); + float getZIndex(); + void setVisible(boolean visible); + boolean isVisible(); + void setTransparency(float transparency); + float getTransparency(); + boolean equalsRemote(IGroundOverlayDelegate other); + int hashCodeRemote(); + void todo(IObjectWrapper obj); +} diff --git a/src/com/google/android/gms/maps/model/internal/IMarkerDelegate.aidl b/src/com/google/android/gms/maps/model/internal/IMarkerDelegate.aidl new file mode 100644 index 00000000..d4eccf6d --- /dev/null +++ b/src/com/google/android/gms/maps/model/internal/IMarkerDelegate.aidl @@ -0,0 +1,33 @@ +package com.google.android.gms.maps.model.internal; + +import com.google.android.gms.dynamic.IObjectWrapper; +import com.google.android.gms.maps.model.LatLng; + +interface IMarkerDelegate { + void remove(); + String getId(); + void setPosition(in LatLng pos); + LatLng getPosition(); + void setTitle(String title); + String getTitle(); + void setSnippet(String snippet); + String getSnippet(); + void setDraggable(boolean drag); + boolean isDraggable(); + void showInfoWindow(); + void hideInfoWindow(); + boolean isInfoWindowShown(); + void setVisible(boolean visible); + boolean isVisible(); + boolean equalsRemote(IMarkerDelegate other); + int hashCodeRemote(); + void setIcon(IObjectWrapper obj); + void setAnchor(float x, float y); + void setFlat(boolean flat); + boolean isFlat(); + void setRotation(float rotation); + float getRotation(); + void setInfoWindowAnchor(float x, float y); + void setAlpha(float alpha); + float getAlpha(); +} diff --git a/src/com/google/android/gms/maps/model/internal/IPolygonDelegate.aidl b/src/com/google/android/gms/maps/model/internal/IPolygonDelegate.aidl new file mode 100644 index 00000000..67f0517b --- /dev/null +++ b/src/com/google/android/gms/maps/model/internal/IPolygonDelegate.aidl @@ -0,0 +1,27 @@ +package com.google.android.gms.maps.model.internal; + +import com.google.android.gms.maps.model.LatLng; + +interface IPolygonDelegate { + void remove(); + String getId(); + void setPoints(in List points); + List getPoints(); + void setHoles(in List holes); + List getHoles(); + void setStrokeWidth(float width); + float getStrokeWidth(); + void setStrokeColor(int color); + int getStrokeColor(); + void setFillColor(int color); + int getFillColor(); + void setZIndex(float zIndex); + float getZIndex(); + void setVisible(boolean visible); + boolean isVisible(); + void setGeodesic(boolean geod); + boolean isGeodesic(); + boolean equalsRemote(IPolygonDelegate other); + int hashCodeRemote(); + +} diff --git a/src/com/google/android/gms/maps/model/internal/IPolylineDelegate.aidl b/src/com/google/android/gms/maps/model/internal/IPolylineDelegate.aidl new file mode 100644 index 00000000..ebbb336b --- /dev/null +++ b/src/com/google/android/gms/maps/model/internal/IPolylineDelegate.aidl @@ -0,0 +1,22 @@ +package com.google.android.gms.maps.model.internal; + +import com.google.android.gms.maps.model.LatLng; + +interface IPolylineDelegate { + void remove(); + String getId(); + void setPoints(in List points); + List getPoints(); + void setWidth(float width); + float getWidth(); + void setColor(int color); + int getColor(); + void setZIndex(float zIndex); + float getZIndex(); + void setVisible(boolean visible); + boolean isVisible(); + void setGeodesic(boolean geod); + boolean isGeodesic(); + boolean equalsRemote(IPolylineDelegate other); + int hashCodeRemote(); +} diff --git a/src/com/google/android/gms/maps/model/internal/ITileOverlayDelegate.aidl b/src/com/google/android/gms/maps/model/internal/ITileOverlayDelegate.aidl new file mode 100644 index 00000000..417cb024 --- /dev/null +++ b/src/com/google/android/gms/maps/model/internal/ITileOverlayDelegate.aidl @@ -0,0 +1,4 @@ +package com.google.android.gms.maps.model.internal; + +interface ITileOverlayDelegate { +} diff --git a/src/com/google/android/gms/plus/internal/IPlusOneButtonCreator.aidl b/src/com/google/android/gms/plus/internal/IPlusOneButtonCreator.aidl new file mode 100644 index 00000000..7e2121d2 --- /dev/null +++ b/src/com/google/android/gms/plus/internal/IPlusOneButtonCreator.aidl @@ -0,0 +1,8 @@ +package com.google.android.gms.plus.internal; + +import com.google.android.gms.dynamic.IObjectWrapper; + +interface IPlusOneButtonCreator { + IObjectWrapper create(IObjectWrapper context, int size, int annotation, String url, int activityRequestCode); + IObjectWrapper createForAccount(IObjectWrapper context, int size, int annotation, String url, String account); +} From 6649591d11d0cd0a7626887289f1b19cd10426eb Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Fri, 9 Jan 2015 19:09:23 +0100 Subject: [PATCH 002/293] Extending and start documenting API --- .../gms/maps/model/BitmapDescriptor.java | 35 +++ .../gms/maps/model/CameraPosition.java | 217 +++++++++++-- .../android/gms/maps/model/CircleOptions.java | 205 +++++++++++- .../gms/maps/model/GroundOverlayOptions.java | 291 +++++++++++++++++- .../google/android/gms/maps/model/LatLng.java | 23 +- .../android/gms/maps/model/LatLngBounds.java | 19 +- .../android/gms/maps/model/MarkerOptions.java | 288 +++++++++++++++-- .../android/gms/maps/model/VisibleRegion.java | 10 + .../android/gms/maps/model/package-info.java | 4 + src/org/microg/gms/maps/Constants.java | 28 ++ 10 files changed, 1028 insertions(+), 92 deletions(-) create mode 100644 src/com/google/android/gms/maps/model/BitmapDescriptor.java create mode 100644 src/com/google/android/gms/maps/model/package-info.java create mode 100644 src/org/microg/gms/maps/Constants.java diff --git a/src/com/google/android/gms/maps/model/BitmapDescriptor.java b/src/com/google/android/gms/maps/model/BitmapDescriptor.java new file mode 100644 index 00000000..800c1745 --- /dev/null +++ b/src/com/google/android/gms/maps/model/BitmapDescriptor.java @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2014 μg 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.maps.model; + +import com.google.android.gms.dynamic.IObjectWrapper; + +/** + * Defines an image. For a marker, it can be used to set the image of the marker icon. For a ground + * overlay, it can be used to set the image to place on the surface of the earth. + */ +public class BitmapDescriptor { + private final IObjectWrapper remoteObject; + + public BitmapDescriptor(IObjectWrapper remoteObject) { + this.remoteObject = remoteObject; + } + + public IObjectWrapper getRemoteObject() { + return remoteObject; + } +} diff --git a/src/com/google/android/gms/maps/model/CameraPosition.java b/src/com/google/android/gms/maps/model/CameraPosition.java index 109dfddb..ea00da74 100644 --- a/src/com/google/android/gms/maps/model/CameraPosition.java +++ b/src/com/google/android/gms/maps/model/CameraPosition.java @@ -16,31 +16,78 @@ package com.google.android.gms.maps.model; +import android.content.Context; import android.os.Parcel; +import android.util.AttributeSet; import org.microg.safeparcel.SafeParcelUtil; import org.microg.safeparcel.SafeParcelable; import org.microg.safeparcel.SafeParceled; import java.util.Arrays; -public class CameraPosition implements SafeParcelable { +/** + * An immutable class that aggregates all camera position parameters. + */ +public final class CameraPosition implements SafeParcelable { @SafeParceled(1) - private int versionCode; + private final int versionCode; + /** + * The location that the camera is pointing at. + */ @SafeParceled(2) - public LatLng target; + public final LatLng target; + /** + * Zoom level near the center of the screen. + * See {@link Builder#zoom(float)} for the definition of the camera's zoom level. + */ @SafeParceled(3) - public float zoom; + public final float zoom; + /** + * The angle, in degrees, of the camera angle from the nadir (directly facing the Earth). + * See {@link Builder#tilt(float)} for details of restrictions on the range of values. + */ @SafeParceled(4) - public float tilt; + public final float tilt; + /** + * Direction that the camera is pointing in, in degrees clockwise from north. + */ @SafeParceled(5) - public float bearing; + public final float bearing; - private CameraPosition(Parcel in) { - SafeParcelUtil.readObject(this, in); + /** + * This constructor is dirty setting the final fields to make the compiler happy. + * In fact, those are replaced by their real values later using SafeParcelUtil. + */ + private CameraPosition() { + target = null; + versionCode = -1; + zoom = tilt = bearing = 0; } - public CameraPosition(int versionCode, LatLng target, float zoom, float tilt, float bearing) { - this.versionCode = versionCode; + private CameraPosition(Parcel in) { + this(); + SafeParcelUtil.readObject(this, in); + if (target == null) + throw new NullPointerException("Target must not be null"); + } + + /** + * Constructs a CameraPosition. + * + * @param target The target location to align with the center of the screen. + * @param zoom Zoom level at target. See {@link #zoom} for details of restrictions. + * @param tilt The camera angle, in degrees, from the nadir (directly down). See + * {@link #tilt} for details of restrictions. + * @param bearing Direction that the camera is pointing in, in degrees clockwise from north. + * This value will be normalized to be within 0 degrees inclusive and 360 + * degrees exclusive. + * @throws NullPointerException if {@code target} is {@code null} + * @throws IllegalArgumentException if {@code tilt} is outside range of {@code 0} to {@code 90} + * degrees inclusive + */ + public CameraPosition(LatLng target, float zoom, float tilt, float bearing) + throws NullPointerException, IllegalArgumentException { + versionCode = 1; if (target == null) { throw new NullPointerException("null camera target"); } @@ -56,17 +103,27 @@ public class CameraPosition implements SafeParcelable { this.bearing = bearing % 360; } - public CameraPosition(LatLng target, float zoom, float tilt, float bearing) { - this(1, target, zoom, tilt, bearing); + /** + * Creates a builder for a camera position. + */ + public static Builder builder() { + return new Builder(); } - public static CameraPosition create(LatLng latLng) { - return new CameraPosition(latLng, 0, 0, 0); + /** + * Creates a builder for a camera position, initialized to a given position. + */ + public static Builder builder(CameraPosition camera) { + return new Builder(camera); } - @Override - public int hashCode() { - return Arrays.hashCode(new Object[] { target, zoom, tilt, bearing }); + /** + * Creates a CameraPostion from the attribute set + * + * @throws UnsupportedOperationException + */ + public static CameraPosition createFromAttributes(Context context, AttributeSet attrs) { + return null; // TODO } @Override @@ -75,8 +132,53 @@ public class CameraPosition implements SafeParcelable { } @Override - public void writeToParcel(Parcel dest, int flags) { - SafeParcelUtil.writeObject(this, dest, flags); + public boolean equals(Object o) { + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; + + CameraPosition that = (CameraPosition) o; + + if (Float.compare(that.bearing, bearing) != 0) + return false; + if (Float.compare(that.tilt, tilt) != 0) + return false; + if (Float.compare(that.zoom, zoom) != 0) + return false; + if (!target.equals(that.target)) + return false; + + return true; + } + + /** + * Constructs a CameraPosition pointed for a particular target and zoom level. The resultant + * bearing is North, and the viewing angle is perpendicular to the Earth's surface. i.e., + * directly facing the Earth's surface, with the top of the screen pointing North. + * + * @param target The target location to align with the center of the screen. + * @param zoom Zoom level at target. See {@link Builder#zoom(float)} for details on the range + * the value will be clamped to. The larger the value the more zoomed in the + * camera is. + */ + public static final CameraPosition fromLatLngZoom(LatLng target, float zoom) { + return builder().target(target).zoom(zoom).build(); + } + + @Override + public int hashCode() { + return Arrays.hashCode(new Object[] { target, zoom, tilt, bearing }); + } + + @Override + public String toString() { + return super.toString(); // TODO + } + + @Override + public void writeToParcel(Parcel out, int flags) { + SafeParcelUtil.writeObject(this, out, flags); } public static Creator CREATOR = new Creator() { @@ -88,4 +190,81 @@ public class CameraPosition implements SafeParcelable { return new CameraPosition[size]; } }; + + /** + * Builds camera position. + */ + public static final class Builder { + private LatLng target; + private float zoom; + private float tilt; + private float bearing; + + public Builder() { + } + + public Builder(CameraPosition previous) { + target = previous.target; + zoom = previous.zoom; + tilt = previous.tilt; + bearing = previous.bearing; + } + + /** + * Sets the direction that the camera is pointing in, in degrees clockwise from north. + */ + public Builder bearing(float bearing) { + this.bearing = bearing; + return this; + } + + /** + * Builds a {@link CameraPosition}. + */ + public CameraPosition build() { + return null; + } + + /** + * Sets the location that the camera is pointing at. + */ + public Builder target(LatLng target) { + this.target = target; + return this; + } + + /** + * Sets the angle, in degrees, of the camera from the nadir (directly facing the Earth). + * When changing the camera position for a map, this value is restricted depending on the + * zoom level of the camera. The restrictions are as follows: + *
    + *
  • For zoom levels less than 10 the maximum is 30.
  • + *
  • For zoom levels from 10 to 14 the maximum increases linearly from 30 to 45 (e.g. at + * zoom level 12, the maximum is 37.5).
  • + *
  • For zoom levels from 14 to 15.5 the maximum increases linearly from 45 to 67.5.
  • + *
  • For zoom levels greater than 15.5 the maximum is 67.5.
  • + *
+ * The minimum is always 0 (directly down). If you specify a value outside this range and try to move the camera to this camera position it will be clamped to these bounds. + */ + public Builder tilt(float tilt) { + this.tilt = tilt; + return this; + } + + /** + * Sets the zoom level of the camera. Zoom level is defined such that at zoom level 0, the + * whole world is approximately 256dp wide (assuming that the camera is not tilted). + * Increasing the zoom level by 1 doubles the width of the world on the screen. Hence at + * zoom level N, the width of the world is approximately 256 * 2 N dp, i.e., at zoom level + * 2, the whole world is approximately 1024dp wide. + *

+ * When changing the camera position for a map, the zoom level of the camera is restricted + * to a certain range depending on various factors including location, map type and map + * size. Note that the camera zoom need not be an integer value. + */ + public Builder zoom(float zoom) { + this.zoom = zoom; + return this; + } + } } diff --git a/src/com/google/android/gms/maps/model/CircleOptions.java b/src/com/google/android/gms/maps/model/CircleOptions.java index 1b6d982d..e0224674 100644 --- a/src/com/google/android/gms/maps/model/CircleOptions.java +++ b/src/com/google/android/gms/maps/model/CircleOptions.java @@ -16,38 +16,36 @@ package com.google.android.gms.maps.model; +import android.graphics.Color; import android.os.Parcel; import org.microg.safeparcel.SafeParcelUtil; import org.microg.safeparcel.SafeParcelable; import org.microg.safeparcel.SafeParceled; +/** + * Defines options for a Circle. + */ public class CircleOptions implements SafeParcelable { - public static Creator CREATOR = new Creator() { - public CircleOptions createFromParcel(Parcel source) { - return new CircleOptions(source); - } - - public CircleOptions[] newArray(int size) { - return new CircleOptions[size]; - } - }; @SafeParceled(1) private int versionCode; @SafeParceled(2) private LatLng center; @SafeParceled(3) - private double radius; + private double radius = 0; @SafeParceled(4) - private float strokeWidth; + private float strokeWidth = 10; @SafeParceled(5) - private int strokeColor; + private int strokeColor = Color.BLACK; @SafeParceled(6) - private int fillColor; + private int fillColor = Color.TRANSPARENT; @SafeParceled(7) - private float zIndex; + private float zIndex = 0; @SafeParceled(8) - private boolean visisble; + private boolean visible = true; + /** + * Creates circle options. + */ public CircleOptions() { } @@ -60,8 +58,185 @@ public class CircleOptions implements SafeParcelable { return 0; } + /** + * Sets the center using a {@link LatLng}. + *

+ * The center must not be {@code null}. + *

+ * This method is mandatory because there is no default center. + * + * @param center The geographic center as a {@link LatLng}. + * @return this {@link CircleOptions} object + */ + public CircleOptions center(LatLng center) { + this.center = center; + return this; + } + + /** + * Sets the fill color. + *

+ * The fill color is the color inside the circle, in the integer format specified by + * {@link Color}. If TRANSPARENT is used then no fill is drawn. + *

+ * By default the fill color is transparent ({@code 0x00000000}). + * + * @param color color in the {@link Color} format + * @return this {@link CircleOptions} object + */ + public CircleOptions fillColor(int color) { + this.fillColor = color; + return this; + } + + /** + * Returns the center as a {@link LatLng}. + * + * @return The geographic center as a {@link LatLng}. + */ + public LatLng getCenter() { + return center; + } + + /** + * Returns the fill color. + * + * @return The color in the {@link Color} format. + */ + public int getFillColor() { + return fillColor; + } + + /** + * Returns the circle's radius, in meters. + * + * @return The radius in meters. + */ + public double getRadius() { + return radius; + } + + /** + * Returns the stroke color. + * + * @return The color in the {@link Color} format. + */ + public int getStrokeColor() { + return strokeColor; + } + + /** + * Returns the stroke width. + * + * @return The width in screen pixels. + */ + public float getStrokeWidth() { + return strokeWidth; + } + + /** + * Returns the zIndex. + * + * @return The zIndex value. + */ + public float getZIndex() { + return zIndex; + } + + /** + * Checks whether the circle is visible. + * + * @return {code true} if the circle is visible; {@code false} if it is invisible. + */ + public boolean isVisible() { + return visible; + } + + /** + * Sets the radius in meters. + *

+ * The radius must be zero or greater. The default radius is zero. + * + * @param radius radius in meters + * @return this {@link CircleOptions} object + */ + public CircleOptions radius(double radius) { + this.radius = radius; + return this; + } + + /** + * Sets the stroke color. + *

+ * The stroke color is the color of this circle's outline, in the integer format specified by + * {@link Color}. If TRANSPARENT is used then no outline is drawn. + *

+ * By default the stroke color is black ({@code 0xff000000}). + * + * @param color color in the {@link Color} format + * @return this {@link CircleOptions} object + */ + public CircleOptions strokeColor(int color) { + this.strokeColor = color; + return this; + } + + /** + * Sets the stroke width. + *

+ * The stroke width is the width (in screen pixels) of the circle's outline. It must be zero or + * greater. If it is zero then no outline is drawn. + *

+ * The default width is 10 pixels. + * + * @param width width in screen pixels + * @return this {@link CircleOptions} object + */ + public CircleOptions strokeWidth(float width) { + this.strokeWidth = width; + return this; + } + + /** + * Sets the visibility. + *

+ * If this circle is not visible then it is not drawn, but all other state is preserved. + * + * @param visible {@code false} to make this circle invisible + * @return this {@link CircleOptions} object + */ + public CircleOptions visible(boolean visible) { + this.visible = visible; + return this; + } + @Override public void writeToParcel(Parcel dest, int flags) { SafeParcelUtil.writeObject(this, dest, flags); } + + /** + * Sets the zIndex. + *

+ * Overlays (such as circles) with higher zIndices are drawn above those with lower indices. + *

+ * By default the zIndex is {@code 0.0}. + * + * @param zIndex zIndex value + * @return this {@link CircleOptions} object + */ + public CircleOptions zIndex(float zIndex) { + this.zIndex = zIndex; + return this; + } + + public static Creator CREATOR = new Creator() { + public CircleOptions createFromParcel(Parcel source) { + return new CircleOptions(source); + } + + public CircleOptions[] newArray(int size) { + return new CircleOptions[size]; + } + }; } diff --git a/src/com/google/android/gms/maps/model/GroundOverlayOptions.java b/src/com/google/android/gms/maps/model/GroundOverlayOptions.java index dd758cfe..856ec8ae 100644 --- a/src/com/google/android/gms/maps/model/GroundOverlayOptions.java +++ b/src/com/google/android/gms/maps/model/GroundOverlayOptions.java @@ -18,15 +18,25 @@ package com.google.android.gms.maps.model; import android.os.IBinder; import android.os.Parcel; +import com.google.android.gms.dynamic.ObjectWrapper; import org.microg.safeparcel.SafeParcelUtil; import org.microg.safeparcel.SafeParcelable; import org.microg.safeparcel.SafeParceled; +/** + * Defines options for a ground overlay. + */ public class GroundOverlayOptions implements SafeParcelable { + /** + * Flag for when no dimension is specified for the height. + */ + public static final float NO_DIMENSION = -1; + @SafeParceled(1) private int versionCode; @SafeParceled(2) - private IBinder wrappedImage; + private IBinder image; + private BitmapDescriptor imageDescriptor; @SafeParceled(3) private LatLng location; @SafeParceled(4) @@ -42,18 +52,56 @@ public class GroundOverlayOptions implements SafeParcelable { @SafeParceled(9) private boolean visible; @SafeParceled(10) - private float transparency; + private float transparency = 0; @SafeParceled(11) private float anchorU; @SafeParceled(12) private float anchorV; + /** + * Creates a new set of ground overlay options. + */ public GroundOverlayOptions() { } private GroundOverlayOptions(Parcel in) { SafeParcelUtil.readObject(this, in); - // wrappedImage = new BitmapDescriptor(IObjectWrapper.Stub.asInterface(SafeReader.readBinder(in, position))); + } + + /** + * Specifies the anchor to be at a particular point in the image. + *

+ * The anchor specifies the point in the image that aligns with the ground overlay's location. + *

+ * The anchor point is specified in the continuous space [0.0, 1.0] x [0.0, 1.0], where (0, 0) + * is the top-left corner of the image, and (1, 1) is the bottom-right corner. + * + * @param u u-coordinate of the anchor, as a ratio of the image width (in the range [0, 1]) + * @param v v-coordinate of the anchor, as a ratio of the image height (in the range [0, 1]) + * @return this {@link GroundOverlayOptions} object with a new anchor set. + */ + public GroundOverlayOptions anchor(float u, float v) { + this.anchorU = u; + this.anchorV = v; + return this; + } + + /** + * Specifies the bearing of the ground overlay in degrees clockwise from north. The rotation is + * performed about the anchor point. If not specified, the default is 0 (i.e., up on the image + * points north). + *

+ * If a ground overlay with position set using {@link #positionFromBounds(LatLngBounds)} is + * rotated, its size will preserved and it will no longer be guaranteed to fit inside the + * bounds. + * + * @param bearing the bearing in degrees clockwise from north. Values outside the range + * [0, 360) will be normalized. + * @return this {@link GroundOverlayOptions} object with a new bearing set. + */ + public GroundOverlayOptions bearing(float bearing) { + this.bearing = bearing; + return this; } @Override @@ -61,10 +109,245 @@ public class GroundOverlayOptions implements SafeParcelable { return 0; } + /** + * Horizontal distance, normalized to [0, 1], of the anchor from the left edge. + * + * @return the u value of the anchor. + */ + public float getAnchorU() { + return anchorU; + } + + /** + * Vertical distance, normalized to [0, 1], of the anchor from the top edge. + * + * @return the v value of the anchor. + */ + public float getAnchorV() { + return anchorV; + } + + /** + * Gets the bearing set for this options object. + * + * @return the bearing of the ground overlay. + */ + public float getBearing() { + return bearing; + } + + /** + * Gets the bounds set for this options object. + * + * @return the bounds of the ground overlay. This will be {@code null} if the position was set + * using {@link #position(LatLng, float)} or {@link #position(LatLng, float, float)} + */ + public LatLngBounds getBounds() { + return bounds; + } + + /** + * Gets the height set for this options object. + * + * @return the height of the ground overlay. + */ + public float getHeight() { + return height; + } + + /** + * Gets the image set for this options object. + * + * @return the image of the ground overlay. + */ + public BitmapDescriptor getImage() { + if (imageDescriptor == null && image != null) { + imageDescriptor = new BitmapDescriptor(ObjectWrapper.asInterface(image)); + } + return imageDescriptor; + } + + /** + * Gets the location set for this options object. + * + * @return the location to place the anchor of the ground overlay. This will be {@code null} + * if the position was set using {@link #positionFromBounds(LatLngBounds)}. + */ + public LatLng getLocation() { + return location; + } + + /** + * Gets the transparency set for this options object. + * + * @return the transparency of the ground overlay. + */ + public float getTransparency() { + return transparency; + } + + /** + * Gets the width set for this options object. + * + * @return the width of the ground overlay. + */ + public float getWidth() { + return width; + } + + /** + * Gets the zIndex set for this options object. + * + * @return the zIndex of the ground overlay. + */ + public float getZIndex() { + return zIndex; + } + + /** + * Specifies the image for this ground overlay. + *

+ * To load an image as a texture (which is used to draw the image on a map), it must be + * converted into an image with sides that are powers of two. This is so that a mipmap can be + * created in order to render the texture at various zoom levels - see + * Mipmap (Wikipedia) for details. Hence, to + * conserve memory by avoiding this conversion, it is advised that the dimensions of the image + * are powers of two. + * + * @param image the {@link BitmapDescriptor} to use for this ground overlay + * @return this {@link GroundOverlayOptions} object with a new image set. + */ + public GroundOverlayOptions image(BitmapDescriptor image) { + this.imageDescriptor = image; + this.image = imageDescriptor.getRemoteObject().asBinder(); + return this; + } + + /** + * Gets the visibility setting for this options object. + * + * @return {@code true} if the ground overlay is to be visible; {@code false} if it is not. + */ + public boolean isVisible() { + return visible; + } + + /** + * Specifies the position for this ground overlay using an anchor point (a {@link LatLng}), + * width and height (both in meters). When rendered, the image will be scaled to fit the + * dimensions specified (i.e., its proportions will not necessarily be preserved). + * + * @param location the location on the map {@code LatLng} to which the anchor point in the + * given image will remain fixed. The anchor will remain fixed to the position + * on the ground when transformations are applied (e.g., setDimensions, + * setBearing, etc.). + * @param width the width of the overlay (in meters) + * @param height the height of the overlay (in meters) + * @return this {@link GroundOverlayOptions} object with a new position set. + * @throws IllegalArgumentException if anchor is null + * @throws IllegalArgumentException if width or height are negative + * @throws IllegalStateException if the position was already set using + * {@link #positionFromBounds(LatLngBounds)} + */ + public GroundOverlayOptions position(LatLng location, float width, float height) + throws IllegalArgumentException, IllegalStateException { + if (location == null) + throw new IllegalArgumentException("location must not be null"); + if (width < 0 || height < 0) + throw new IllegalArgumentException("Width and height must not be negative"); + if (bounds != null) + throw new IllegalStateException("Position already set using positionFromBounds"); + this.location = location; + this.width = width; + this.height = height; + return this; + } + + /** + * Specifies the position for this ground overlay using an anchor point (a {@link LatLng}) and + * the width (in meters). When rendered, the image will retain its proportions from the bitmap, + * i.e., the height will be calculated to preserve the original proportions of the image. + * + * @param location the location on the map {@link LatLng} to which the anchor point in the + * given image will remain fixed. The anchor will remain fixed to the position + * on the ground when transformations are applied (e.g., setDimensions, + * setBearing, etc.). + * @param width the width of the overlay (in meters). The height will be determined + * automatically based on the image proportions. + * @return this {@link GroundOverlayOptions} object with a new position set. + * @throws IllegalArgumentException if anchor is null + * @throws IllegalArgumentException if width is negative + * @throws IllegalStateException if the position was already set using + * {@link #positionFromBounds(LatLngBounds)} + */ + public GroundOverlayOptions position(LatLng location, float width) + throws IllegalArgumentException, IllegalStateException { + if (location == null) + throw new IllegalArgumentException("location must not be null"); + if (width < 0 || height < 0) + throw new IllegalArgumentException("Width must not be negative"); + if (bounds != null) + throw new IllegalStateException("Position already set using positionFromBounds"); + this.location = location; + this.width = width; + return this; + } + + /** + * Specifies the position for this ground overlay. When rendered, the image will be scaled to + * fit the bounds (i.e., its proportions will not necessarily be preserved). + * + * @param bounds a {@link LatLngBounds} in which to place the ground overlay + * @return this {@link GroundOverlayOptions} object with a new position set. + * @throws IllegalStateException if the position was already set using + * {@link #position(LatLng, float)} or + * {@link #position(LatLng, float, float)} + */ + public GroundOverlayOptions positionFromBounds(LatLngBounds bounds) + throws IllegalStateException { + this.bounds = bounds; + return this; + } + + /** + * Specifies the transparency of the ground overlay. The default transparency is {code 0} + * (opaque). + * + * @param transparency a float in the range {@code [0..1]} where {@code 0} means that the + * ground overlay is opaque and {code 1} means that the ground overlay is + * transparent + * @return this {@link GroundOverlayOptions} object with a new visibility setting. + * @throws IllegalArgumentException if the transparency is outside the range [0..1]. + */ + public GroundOverlayOptions transparency(float transparency) throws IllegalArgumentException { + this.transparency = transparency; + return this; + } + + /** + * Specifies the visibility for the ground overlay. The default visibility is {@code true}. + * + * @return this {@link GroundOverlayOptions} object with a new visibility setting. + */ + public GroundOverlayOptions visible(boolean visible) { + this.visible = visible; + return this; + } + @Override public void writeToParcel(Parcel dest, int flags) { SafeParcelUtil.writeObject(this, dest, flags); - // SafeParcelWriter.write(dest, 2, wrappedImage.getRemoteObject().asBinder(), false); + } + + /** + * Specifies the ground overlay's zIndex, i.e., the order in which it will be drawn. See the + * documentation at the top of this class for more information about zIndex. + * + * @return this {@link GroundOverlayOptions} object with a new zIndex set. + */ + public GroundOverlayOptions zIndex(float zIndex) { + this.zIndex = zIndex; + return this; } public static Creator CREATOR = new Creator() { diff --git a/src/com/google/android/gms/maps/model/LatLng.java b/src/com/google/android/gms/maps/model/LatLng.java index 1d4d1ddd..225828a6 100644 --- a/src/com/google/android/gms/maps/model/LatLng.java +++ b/src/com/google/android/gms/maps/model/LatLng.java @@ -22,21 +22,12 @@ import org.microg.safeparcel.SafeParcelable; import org.microg.safeparcel.SafeParceled; public class LatLng implements SafeParcelable { - public static Creator CREATOR = new Creator() { - public LatLng createFromParcel(Parcel source) { - return new LatLng(source); - } - - public LatLng[] newArray(int size) { - return new LatLng[size]; - } - }; + @SafeParceled(1) + private int versionCode; @SafeParceled(2) public double latitude; @SafeParceled(3) public double longitude; - @SafeParceled(1) - private int versionCode; public LatLng(int versionCode, double latitude, double longitude) { this.versionCode = versionCode; @@ -78,4 +69,14 @@ public class LatLng implements SafeParcelable { public void writeToParcel(Parcel dest, int flags) { SafeParcelUtil.writeObject(this, dest, flags); } + + public static Creator CREATOR = new Creator() { + public LatLng createFromParcel(Parcel source) { + return new LatLng(source); + } + + public LatLng[] newArray(int size) { + return new LatLng[size]; + } + }; } diff --git a/src/com/google/android/gms/maps/model/LatLngBounds.java b/src/com/google/android/gms/maps/model/LatLngBounds.java index 42da1d3f..371facb4 100644 --- a/src/com/google/android/gms/maps/model/LatLngBounds.java +++ b/src/com/google/android/gms/maps/model/LatLngBounds.java @@ -22,15 +22,6 @@ import org.microg.safeparcel.SafeParcelable; import org.microg.safeparcel.SafeParceled; public class LatLngBounds implements SafeParcelable { - public static Creator CREATOR = new Creator() { - public LatLngBounds createFromParcel(Parcel source) { - return new LatLngBounds(source); - } - - public LatLngBounds[] newArray(int size) { - return new LatLngBounds[size]; - } - }; @SafeParceled(1) private int versionCode; @SafeParceled(2) @@ -61,4 +52,14 @@ public class LatLngBounds implements SafeParcelable { public void writeToParcel(Parcel dest, int flags) { SafeParcelUtil.writeObject(this, dest, flags); } + + public static Creator CREATOR = new Creator() { + public LatLngBounds createFromParcel(Parcel source) { + return new LatLngBounds(source); + } + + public LatLngBounds[] newArray(int size) { + return new LatLngBounds[size]; + } + }; } diff --git a/src/com/google/android/gms/maps/model/MarkerOptions.java b/src/com/google/android/gms/maps/model/MarkerOptions.java index 4162f0c0..4da6246b 100644 --- a/src/com/google/android/gms/maps/model/MarkerOptions.java +++ b/src/com/google/android/gms/maps/model/MarkerOptions.java @@ -18,6 +18,7 @@ package com.google.android.gms.maps.model; import android.os.IBinder; import android.os.Parcel; +import com.google.android.gms.dynamic.ObjectWrapper; import org.microg.safeparcel.SafeParcelUtil; import org.microg.safeparcel.SafeParcelable; import org.microg.safeparcel.SafeParceled; @@ -32,8 +33,15 @@ public class MarkerOptions implements SafeParcelable { private String title; @SafeParceled(4) private String snippet; + /** + * This is a IBinder to the remote BitmapDescriptor created using BitmapDescriptorFactory + */ @SafeParceled(5) private IBinder icon; + /** + * The real BitmapDescriptor. Not transferred through Parcel. + */ + private BitmapDescriptor iconDescriptor; @SafeParceled(6) private float anchorU = 0.5F; @SafeParceled(7) @@ -53,73 +61,285 @@ public class MarkerOptions implements SafeParcelable { @SafeParceled(14) private float alpha = 1F; - @Override - public int describeContents() { - return 0; - } - - @Override - public void writeToParcel(Parcel dest, int flags) { - } - + /** + * Creates a new set of marker options. + */ public MarkerOptions() { } private MarkerOptions(Parcel in) { SafeParcelUtil.readObject(this, in); - // this.icon = icon == null ? null : new BitmapDescriptor(ObjectWrapper.asInterface(icon)); } - public LatLng getPosition() { - return position; + @Override + public int describeContents() { + return 0; } - public String getTitle() { - return title; + /** + * Sets the alpha (opacity) of the marker. This is a value from 0 to 1, where 0 means the + * marker is completely transparent and 1 means the marker is completely opaque. + * + * @return the object for which the method was called, with the new alpha set. + */ + public MarkerOptions alpha(float alpha) { + this.alpha = alpha; + return this; } - public String getSnippet() { - return snippet; + /** + * Specifies the anchor to be at a particular point in the marker image. + *

+ * The anchor specifies the point in the icon image that is anchored to the marker's position + * on the Earth's surface. + *

+ * The anchor point is specified in the continuous space [0.0, 1.0] x [0.0, 1.0], where (0, 0) + * is the top-left corner of the image, and (1, 1) is the bottom-right corner. The anchoring + * point in a W x H image is the nearest discrete grid point in a (W + 1) x (H + 1) grid, + * obtained by scaling the then rounding. For example, in a 4 x 2 image, the anchor point + * (0.7, 0.6) resolves to the grid point at (3, 1). + * + * @param u u-coordinate of the anchor, as a ratio of the image width (in the range [0, 1]) + * @param v v-coordinate of the anchor, as a ratio of the image height (in the range [0, 1]) + * @return the object for which the method was called, with the new anchor set. + */ + public MarkerOptions anchor(float u, float v) { + this.anchorU = u; + this.anchorV = v; + return this; } - public IBinder getIcon() { - return icon; + /** + * Sets the draggability for the marker. + * + * @return the object for which the method was called, with the new draggable state set. + */ + public MarkerOptions draggable(boolean draggable) { + this.draggable = draggable; + return this; } + /** + * Sets whether this marker should be flat against the map true or a billboard facing the + * camera false. If the marker is flat against the map, it will remain stuck to the map as the + * camera rotates and tilts but will still remain the same size as the camera zooms, unlike a + * GroundOverlay. If the marker is a billboard, it will always be drawn facing the camera + * and will rotate and tilt with the camera. The default value is false. + * + * @return the object for which the method was called, with the new flat state set. + */ + public MarkerOptions flat(boolean flat) { + this.flat = flat; + return this; + } + + /** + * Gets the alpha set for this MarkerOptions object. + * + * @return the alpha of the marker in the range [0, 1]. + */ + public float getAlpha() { + return alpha; + } + + /** + * Horizontal distance, normalized to [0, 1], of the anchor from the left edge. + * + * @return the u value of the anchor. + */ public float getAnchorU() { return anchorU; } + /** + * Vertical distance, normalized to [0, 1], of the anchor from the top edge. + * + * @return the v value of the anchor. + */ public float getAnchorV() { return anchorV; } - public boolean isDraggable() { - return draggable; - } - - public boolean isVisible() { - return visible; - } - - public boolean isFlat() { - return flat; - } - - public float getRotation() { - return rotation; + /** + * Gets the custom icon set for this MarkerOptions object. + * + * @return An {@link BitmapDescriptor} representing the custom icon, or {@code null} if no + * custom icon is set. + */ + public BitmapDescriptor getIcon() { + if (iconDescriptor == null && icon != null) { + iconDescriptor = new BitmapDescriptor(ObjectWrapper.asInterface(icon)); + } + return iconDescriptor; } + /** + * Horizontal distance, normalized to [0, 1], of the info window anchor from the left edge. + * + * @return the u value of the info window anchor. + */ public float getInfoWindowAnchorU() { return infoWindowAnchorU; } + /** + * Vertical distance, normalized to [0, 1], of the info window anchor from the top edge. + * + * @return the v value of the info window anchor. + */ public float getInfoWindowAnchorV() { return infoWindowAnchorV; } - public float getAlpha() { - return alpha; + /** + * Returns the position set for this MarkerOptions object. + * + * @return A {@link LatLng} object specifying the marker's current position. + */ + public LatLng getPosition() { + return position; + } + + /** + * Gets the rotation set for this MarkerOptions object. + * + * @return the rotation of the marker in degrees clockwise from the default position. + */ + public float getRotation() { + return rotation; + } + + /** + * Gets the snippet set for this MarkerOptions object. + * + * @return A string containing the marker's snippet. + */ + public String getSnippet() { + return snippet; + } + + /** + * Gets the title set for this MarkerOptions object. + * + * @return A string containing the marker's title. + */ + public String getTitle() { + return title; + } + + /** + * Sets the icon for the marker. + * + * @param icon if null, the default marker is used. + * @return the object for which the method was called, with the new icon set. + */ + public MarkerOptions icon(BitmapDescriptor icon) { + this.iconDescriptor = icon; + this.icon = icon == null ? null : icon.getRemoteObject().asBinder(); + return this; + } + + /** + * Specifies the anchor point of the info window on the marker image. This is specified in the + * same coordinate system as the anchor. See {@link MarkerOptions#anchor(float, float)} for + * more details. The default is the top middle of the image. + * + * @param u u-coordinate of the info window anchor, as a ratio of the image width (in the range [0, 1]) + * @param v v-coordinate of the info window anchor, as a ratio of the image height (in the range [0, 1]) + * @return the object for which the method was called, with the new info window anchor set. + */ + public MarkerOptions infoWindowAnchor(float u, float v) { + this.infoWindowAnchorU = u; + this.infoWindowAnchorV = v; + return this; + } + + /** + * Gets the draggability setting for this MarkerOptions object. + * + * @return {@code true} if the marker is draggable; otherwise, returns {@code false}. + */ + public boolean isDraggable() { + return draggable; + } + + /** + * Gets the flat setting for this MarkerOptions object. + * + * @return {@code true} if the marker is flat against the map; {@code false} if the marker + * should face the camera. + */ + public boolean isFlat() { + return flat; + } + + /** + * Gets the visibility setting for this MarkerOptions object. + * + * @return {@code true} if the marker is visible; otherwise, returns {@code false}. + */ + public boolean isVisible() { + return visible; + } + + /** + * Sets the location for the marker. + * + * @return the object for which the method was called, with the new position set. + */ + public MarkerOptions position(LatLng position) { + this.position = position; + return this; + } + + /** + * Sets the rotation of the marker in degrees clockwise about the marker's anchor point. The + * axis of rotation is perpendicular to the marker. A rotation of 0 corresponds to the default + * position of the marker. When the marker is flat on the map, the default position is North + * aligned and the rotation is such that the marker always remains flat on the map. When the + * marker is a billboard, the default position is pointing up and the rotation is such that + * the marker is always facing the camera. The default value is 0. + * + * @return the object for which the method was called, with the new rotation set. + */ + public MarkerOptions rotation(float rotation) { + this.rotation = rotation; + return this; + } + + /** + * Sets the snippet for the marker. + * + * @return the object for which the method was called, with the new snippet set. + */ + public MarkerOptions snippet(String snippet) { + this.snippet = snippet; + return this; + } + + /** + * Sets the title for the marker. + * + * @return the object for which the method was called, with the new title set. + */ + public MarkerOptions title(String title) { + this.title = title; + return this; + } + + /** + * Sets the visibility for the marker. + * + * @return the object for which the method was called, with the new visibility state set. + */ + public MarkerOptions visible(boolean visible) { + this.visible = visible; + return this; + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + SafeParcelUtil.writeObject(this, dest, flags); } public static Creator CREATOR = new Creator() { diff --git a/src/com/google/android/gms/maps/model/VisibleRegion.java b/src/com/google/android/gms/maps/model/VisibleRegion.java index 21f9cd13..76f2342c 100644 --- a/src/com/google/android/gms/maps/model/VisibleRegion.java +++ b/src/com/google/android/gms/maps/model/VisibleRegion.java @@ -50,6 +50,16 @@ public class VisibleRegion implements SafeParcelable { this(1, nearLeft, nearRight, farLeft, farRight, bounds); } + /** + * This is assuming that the visible region matches the bounds, which means that it's a north + * orientated top view + */ + public VisibleRegion(LatLngBounds bounds) { + this(bounds.southWest, new LatLng(bounds.southWest.latitude, bounds.northEast.longitude), + new LatLng(bounds.northEast.latitude, bounds.southWest.longitude), bounds.northEast, + bounds); + } + public VisibleRegion(Parcel in) { SafeParcelUtil.readObject(this, in); } diff --git a/src/com/google/android/gms/maps/model/package-info.java b/src/com/google/android/gms/maps/model/package-info.java new file mode 100644 index 00000000..de5998b2 --- /dev/null +++ b/src/com/google/android/gms/maps/model/package-info.java @@ -0,0 +1,4 @@ +/** + * Contains the Google Maps Android API model classes. + */ +package com.google.android.gms.maps.model; diff --git a/src/org/microg/gms/maps/Constants.java b/src/org/microg/gms/maps/Constants.java new file mode 100644 index 00000000..89745851 --- /dev/null +++ b/src/org/microg/gms/maps/Constants.java @@ -0,0 +1,28 @@ +package org.microg.gms.maps; + +public class Constants { + /** + * No base map tiles. + */ + public static final int MAP_TYPE_NONE = 0; + + /** + * Basic maps. + */ + public static final int MAP_TYPE_NORMAL = 1; + + /** + * Satellite maps with no labels. + */ + public static final int MAP_TYPE_SATELLITE = 2; + + /** + * Terrain maps. + */ + public static final int MAP_TYPE_TERRAIN = 3; + + /** + * Satellite maps with a transparent layer of major streets. + */ + public static final int MAP_TYPE_HYBRID = 4; +} From 93666176e71e304bdd856f535f97adf51ee46074 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Fri, 9 Jan 2015 19:24:02 +0100 Subject: [PATCH 003/293] Some more API --- .../android/gms/maps/model/CircleOptions.java | 4 +- .../gms/maps/model/GroundOverlayOptions.java | 4 +- .../google/android/gms/maps/model/LatLng.java | 73 +++++++++++++++---- .../android/gms/maps/model/LatLngBounds.java | 39 +++++++--- .../gms/maps/model/PolylineOptions.java | 63 ++++++++-------- .../android/gms/maps/model/VisibleRegion.java | 4 +- 6 files changed, 123 insertions(+), 64 deletions(-) diff --git a/src/com/google/android/gms/maps/model/CircleOptions.java b/src/com/google/android/gms/maps/model/CircleOptions.java index e0224674..82f2af58 100644 --- a/src/com/google/android/gms/maps/model/CircleOptions.java +++ b/src/com/google/android/gms/maps/model/CircleOptions.java @@ -211,8 +211,8 @@ public class CircleOptions implements SafeParcelable { } @Override - public void writeToParcel(Parcel dest, int flags) { - SafeParcelUtil.writeObject(this, dest, flags); + public void writeToParcel(Parcel out, int flags) { + SafeParcelUtil.writeObject(this, out, flags); } /** diff --git a/src/com/google/android/gms/maps/model/GroundOverlayOptions.java b/src/com/google/android/gms/maps/model/GroundOverlayOptions.java index 856ec8ae..0792a825 100644 --- a/src/com/google/android/gms/maps/model/GroundOverlayOptions.java +++ b/src/com/google/android/gms/maps/model/GroundOverlayOptions.java @@ -335,8 +335,8 @@ public class GroundOverlayOptions implements SafeParcelable { } @Override - public void writeToParcel(Parcel dest, int flags) { - SafeParcelUtil.writeObject(this, dest, flags); + public void writeToParcel(Parcel out, int flags) { + SafeParcelUtil.writeObject(this, out, flags); } /** diff --git a/src/com/google/android/gms/maps/model/LatLng.java b/src/com/google/android/gms/maps/model/LatLng.java index 225828a6..0844021e 100644 --- a/src/com/google/android/gms/maps/model/LatLng.java +++ b/src/com/google/android/gms/maps/model/LatLng.java @@ -21,16 +21,47 @@ import org.microg.safeparcel.SafeParcelUtil; import org.microg.safeparcel.SafeParcelable; import org.microg.safeparcel.SafeParceled; -public class LatLng implements SafeParcelable { +/** + * An immutable class representing a pair of latitude and longitude coordinates, stored as degrees. + */ +public final class LatLng implements SafeParcelable { @SafeParceled(1) - private int versionCode; + private final int versionCode; + /** + * Latitude, in degrees. This value is in the range [-90, 90]. + */ @SafeParceled(2) - public double latitude; + public final double latitude; + /** + * Longitude, in degrees. This value is in the range [-180, 180). + */ @SafeParceled(3) - public double longitude; + public final double longitude; - public LatLng(int versionCode, double latitude, double longitude) { - this.versionCode = versionCode; + /** + * This constructor is dirty setting the final fields to make the compiler happy. + * In fact, those are replaced by their real values later using SafeParcelUtil. + */ + private LatLng() { + versionCode = -1; + latitude = longitude = 0; + } + + private LatLng(Parcel in) { + this(); + SafeParcelUtil.readObject(this, in); + } + + /** + * Constructs a LatLng with the given latitude and longitude, measured in degrees. + * + * @param latitude The point's latitude. This will be clamped to between -90 degrees and + * +90 degrees inclusive. + * @param longitude The point's longitude. This will be normalized to be within -180 degrees + * inclusive and +180 degrees exclusive. + */ + public LatLng(double latitude, double longitude) { + this.versionCode = 1; this.latitude = Math.max(-90, Math.min(90, latitude)); if ((-180 <= longitude) && (longitude < 180)) { this.longitude = longitude; @@ -39,12 +70,28 @@ public class LatLng implements SafeParcelable { } } - private LatLng(Parcel in) { - SafeParcelUtil.readObject(this, in); - } + /** + * Tests if this LatLng is equal to another. + *

+ * Two points are considered equal if and only if their latitudes are bitwise equal and their + * longitudes are bitwise equal. This means that two {@link LatLng}s that are very near, in + * terms of geometric distance, might not be considered {@code .equal()}. + */ + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; - public LatLng(double latitude, double longitude) { - this(1, latitude, longitude); + LatLng latLng = (LatLng) o; + + if (Double.compare(latLng.latitude, latitude) != 0) + return false; + if (Double.compare(latLng.longitude, longitude) != 0) + return false; + + return true; } @Override @@ -66,8 +113,8 @@ public class LatLng implements SafeParcelable { } @Override - public void writeToParcel(Parcel dest, int flags) { - SafeParcelUtil.writeObject(this, dest, flags); + public void writeToParcel(Parcel out, int flags) { + SafeParcelUtil.writeObject(this, out, flags); } public static Creator CREATOR = new Creator() { diff --git a/src/com/google/android/gms/maps/model/LatLngBounds.java b/src/com/google/android/gms/maps/model/LatLngBounds.java index 371facb4..b864857e 100644 --- a/src/com/google/android/gms/maps/model/LatLngBounds.java +++ b/src/com/google/android/gms/maps/model/LatLngBounds.java @@ -21,28 +21,43 @@ import org.microg.safeparcel.SafeParcelUtil; import org.microg.safeparcel.SafeParcelable; import org.microg.safeparcel.SafeParceled; -public class LatLngBounds implements SafeParcelable { +/** + * An immutable class representing a latitude/longitude aligned rectangle. + */ +public final class LatLngBounds implements SafeParcelable { @SafeParceled(1) - private int versionCode; + private final int versionCode; + /** + * Southwest corner of the bound. + */ @SafeParceled(2) - public LatLng southWest; + public final LatLng southwest; + /** + * Northeast corner of the bound. + */ @SafeParceled(3) - public LatLng northEast; + public final LatLng northeast; - public LatLngBounds(int versionCode, LatLng southWest, LatLng northEast) { - this.versionCode = versionCode; - this.southWest = southWest; - this.northEast = northEast; - } - - public LatLngBounds(LatLng southWest, LatLng northEast) { - this(1, southWest, northEast); + /** + * This constructor is dirty setting the final fields to make the compiler happy. + * In fact, those are replaced by their real values later using SafeParcelUtil. + */ + private LatLngBounds() { + this.versionCode = -1; + southwest = northeast = null; } private LatLngBounds(Parcel in) { + this(); SafeParcelUtil.readObject(this, in); } + public LatLngBounds(LatLng southwest, LatLng northeast) throws IllegalArgumentException { + this.versionCode = 1; + this.southwest = southwest; + this.northeast = northeast; + } + @Override public int describeContents() { return 0; diff --git a/src/com/google/android/gms/maps/model/PolylineOptions.java b/src/com/google/android/gms/maps/model/PolylineOptions.java index 6cc21ac2..ee927934 100644 --- a/src/com/google/android/gms/maps/model/PolylineOptions.java +++ b/src/com/google/android/gms/maps/model/PolylineOptions.java @@ -17,50 +17,47 @@ package com.google.android.gms.maps.model; import android.os.Parcel; -import android.os.Parcelable; import org.microg.safeparcel.SafeParcelUtil; import org.microg.safeparcel.SafeParcelable; import org.microg.safeparcel.SafeParceled; -import java.util.ArrayList; import java.util.List; public class PolylineOptions implements SafeParcelable { - @SafeParceled(1) - private int versionCode; - // TODO - private List points; - private float width; - private int color; - private float zIndex; - private boolean visible; - private boolean geodesic; + @SafeParceled(1) + private int versionCode; + // TODO + private List points; + private float width; + private int color; + private float zIndex; + private boolean visible; + private boolean geodesic; + public PolylineOptions() { + } - public PolylineOptions() { - } + private PolylineOptions(Parcel in) { + SafeParcelUtil.readObject(this, in); + } - private PolylineOptions(Parcel in) { - SafeParcelUtil.readObject(this, in); - } + @Override + public int describeContents() { + return 0; + } - @Override - public int describeContents() { - return 0; - } + @Override + public void writeToParcel(Parcel dest, int flags) { + SafeParcelUtil.writeObject(this, dest, flags); + } - @Override - public void writeToParcel(Parcel dest, int flags) { - SafeParcelUtil.writeObject(this, dest, flags); - } + public static Creator CREATOR = new Creator() { + public PolylineOptions createFromParcel(Parcel source) { + return new PolylineOptions(source); + } - public static Creator CREATOR = new Creator() { - public PolylineOptions createFromParcel(Parcel source) { - return new PolylineOptions(source); - } - - public PolylineOptions[] newArray(int size) { - return new PolylineOptions[size]; - } - }; + public PolylineOptions[] newArray(int size) { + return new PolylineOptions[size]; + } + }; } diff --git a/src/com/google/android/gms/maps/model/VisibleRegion.java b/src/com/google/android/gms/maps/model/VisibleRegion.java index 76f2342c..7f96402f 100644 --- a/src/com/google/android/gms/maps/model/VisibleRegion.java +++ b/src/com/google/android/gms/maps/model/VisibleRegion.java @@ -55,8 +55,8 @@ public class VisibleRegion implements SafeParcelable { * orientated top view */ public VisibleRegion(LatLngBounds bounds) { - this(bounds.southWest, new LatLng(bounds.southWest.latitude, bounds.northEast.longitude), - new LatLng(bounds.northEast.latitude, bounds.southWest.longitude), bounds.northEast, + this(bounds.southwest, new LatLng(bounds.southwest.latitude, bounds.northeast.longitude), + new LatLng(bounds.northeast.latitude, bounds.southwest.longitude), bounds.northeast, bounds); } From c7e910af4b022877b0424011eec7336ef86c7f4e Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Fri, 9 Jan 2015 22:41:22 +0100 Subject: [PATCH 004/293] Add more API + docs (including TileProvider) --- .../gms/maps/model/CameraPosition.java | 9 +- .../gms/maps/model/GroundOverlayOptions.java | 21 +-- .../google/android/gms/maps/model/LatLng.java | 8 +- .../android/gms/maps/model/LatLngBounds.java | 176 +++++++++++++++++- .../gms/maps/model/PolygonOptions.java | 4 + .../gms/maps/model/PolylineOptions.java | 4 + .../google/android/gms/maps/model/Tile.java | 78 ++++++++ .../gms/maps/model/TileOverlayOptions.java | 100 +++++++++- .../android/gms/maps/model/TileProvider.java | 25 +++ 9 files changed, 401 insertions(+), 24 deletions(-) create mode 100644 src/com/google/android/gms/maps/model/Tile.java create mode 100644 src/com/google/android/gms/maps/model/TileProvider.java diff --git a/src/com/google/android/gms/maps/model/CameraPosition.java b/src/com/google/android/gms/maps/model/CameraPosition.java index ea00da74..f9bb0bed 100644 --- a/src/com/google/android/gms/maps/model/CameraPosition.java +++ b/src/com/google/android/gms/maps/model/CameraPosition.java @@ -173,7 +173,12 @@ public final class CameraPosition implements SafeParcelable { @Override public String toString() { - return super.toString(); // TODO + return "CameraPosition{" + + "target=" + target + + ", zoom=" + zoom + + ", tilt=" + tilt + + ", bearing=" + bearing + + '}'; } @Override @@ -222,7 +227,7 @@ public final class CameraPosition implements SafeParcelable { * Builds a {@link CameraPosition}. */ public CameraPosition build() { - return null; + return new CameraPosition(target, zoom, tilt, bearing); } /** diff --git a/src/com/google/android/gms/maps/model/GroundOverlayOptions.java b/src/com/google/android/gms/maps/model/GroundOverlayOptions.java index 0792a825..3cf9cfb4 100644 --- a/src/com/google/android/gms/maps/model/GroundOverlayOptions.java +++ b/src/com/google/android/gms/maps/model/GroundOverlayOptions.java @@ -251,14 +251,9 @@ public class GroundOverlayOptions implements SafeParcelable { */ public GroundOverlayOptions position(LatLng location, float width, float height) throws IllegalArgumentException, IllegalStateException { - if (location == null) - throw new IllegalArgumentException("location must not be null"); - if (width < 0 || height < 0) - throw new IllegalArgumentException("Width and height must not be negative"); - if (bounds != null) - throw new IllegalStateException("Position already set using positionFromBounds"); - this.location = location; - this.width = width; + position(location, width); + if (height < 0) + throw new IllegalArgumentException("height must not be negative"); this.height = height; return this; } @@ -284,10 +279,10 @@ public class GroundOverlayOptions implements SafeParcelable { throws IllegalArgumentException, IllegalStateException { if (location == null) throw new IllegalArgumentException("location must not be null"); - if (width < 0 || height < 0) - throw new IllegalArgumentException("Width must not be negative"); + if (width < 0) + throw new IllegalArgumentException("width must not be negative"); if (bounds != null) - throw new IllegalStateException("Position already set using positionFromBounds"); + throw new IllegalStateException("Position already set using positionFromBounds()"); this.location = location; this.width = width; return this; @@ -305,6 +300,8 @@ public class GroundOverlayOptions implements SafeParcelable { */ public GroundOverlayOptions positionFromBounds(LatLngBounds bounds) throws IllegalStateException { + if (location != null) + throw new IllegalStateException("Position already set using position()"); this.bounds = bounds; return this; } @@ -320,6 +317,8 @@ public class GroundOverlayOptions implements SafeParcelable { * @throws IllegalArgumentException if the transparency is outside the range [0..1]. */ public GroundOverlayOptions transparency(float transparency) throws IllegalArgumentException { + if (transparency < 0 || transparency > 1) + throw new IllegalArgumentException("transparency must be in range [0..1]"); this.transparency = transparency; return this; } diff --git a/src/com/google/android/gms/maps/model/LatLng.java b/src/com/google/android/gms/maps/model/LatLng.java index 0844021e..94a25340 100644 --- a/src/com/google/android/gms/maps/model/LatLng.java +++ b/src/com/google/android/gms/maps/model/LatLng.java @@ -96,10 +96,10 @@ public final class LatLng implements SafeParcelable { @Override public final int hashCode() { - long lat = Double.doubleToLongBits(latitude); - int tmp = 31 + (int) (lat ^ lat >>> 32); - long lon = Double.doubleToLongBits(longitude); - return tmp * 31 + (int) (lon ^ lon >>> 32); + long tmp1 = Double.doubleToLongBits(latitude); + int tmp2 = 31 + (int) (tmp1 ^ tmp1 >>> 32); + tmp1 = Double.doubleToLongBits(longitude); + return tmp2 * 31 + (int) (tmp1 ^ tmp1 >>> 32); } @Override diff --git a/src/com/google/android/gms/maps/model/LatLngBounds.java b/src/com/google/android/gms/maps/model/LatLngBounds.java index b864857e..ac849e37 100644 --- a/src/com/google/android/gms/maps/model/LatLngBounds.java +++ b/src/com/google/android/gms/maps/model/LatLngBounds.java @@ -21,6 +21,8 @@ import org.microg.safeparcel.SafeParcelUtil; import org.microg.safeparcel.SafeParcelable; import org.microg.safeparcel.SafeParceled; +import java.util.Arrays; + /** * An immutable class representing a latitude/longitude aligned rectangle. */ @@ -52,20 +54,145 @@ public final class LatLngBounds implements SafeParcelable { SafeParcelUtil.readObject(this, in); } + /** + * Creates a new bounds based on a southwest and a northeast corner. + *

+ * The bounds conceptually includes all points where: + *

    + *
  • the latitude is in the range [northeast.latitude, southwest.latitude];
  • + *
  • the longitude is in the range [southwest.longtitude, northeast.longitude] + * if southwest.longtitude ≤ northeast.longitude; and
  • + *
  • the longitude is in the range [southwest.longitude, 180) ∪ [-180, northeast.longitude] + * if southwest.longtitude > northeast.longitude.
  • + *
+ * + * @param southwest southwest corner + * @param northeast northeast corner + * @throws IllegalArgumentException if the latitude of the northeast corner is below the + * latitude of the southwest corner. + */ public LatLngBounds(LatLng southwest, LatLng northeast) throws IllegalArgumentException { + if (northeast.latitude < southwest.latitude) + throw new IllegalArgumentException("latitude of northeast corner must not be" + + " lower than latitude of southwest corner"); this.versionCode = 1; this.southwest = southwest; this.northeast = northeast; } + /** + * Creates a new builder. + */ + public Builder builder() { + return new Builder(); + } + + /** + * Returns whether this contains the given {@link LatLng}. + * + * @param point the {@link LatLng} to test + * @return {@code true} if this contains the given point; {@code false} if not. + */ + public boolean contains(LatLng point) { + return containsLatitude(point.latitude) && containsLongitude(point.longitude); + } + + private boolean containsLatitude(double latitude) { + return southwest.latitude <= latitude && latitude <= northeast.latitude; + } + + private boolean containsLongitude(double longitude) { + return southwest.longitude <= northeast.longitude ? ( + southwest.longitude <= longitude && longitude <= northeast.longitude + ) : ( + southwest.longitude >= longitude && longitude < 180 || + longitude >= -180 && longitude <= northeast.longitude + ); + } + @Override public int describeContents() { return 0; } @Override - public void writeToParcel(Parcel dest, int flags) { - SafeParcelUtil.writeObject(this, dest, flags); + public boolean equals(Object o) { + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; + + LatLngBounds that = (LatLngBounds) o; + + if (!northeast.equals(that.northeast)) + return false; + if (!southwest.equals(that.southwest)) + return false; + + return true; + } + + /** + * Returns the center of this {@link LatLngBounds}. The center is simply the average of the + * coordinates (taking into account if it crosses the antimeridian). This is approximately the + * geographical center (it would be exact if the Earth were a perfect sphere). It will not + * necessarily be the center of the rectangle as drawn on the map due to the Mercator + * projection. + * + * @return A {@link LatLng} that is the center of the {@link LatLngBounds}. + */ + public LatLng getCenter() { + double lat = (southwest.latitude + northeast.latitude) / 2.0; + double lon = (southwest.longitude + northeast.longitude) / 2.0 + + southwest.longitude <= northeast.latitude ? 0 : 180.0; + return new LatLng(lat, lon); + } + + @Override + public int hashCode() { + return Arrays.hashCode(new Object[] { southwest, northeast }); + } + + /** + * Returns a new {@link LatLngBounds} that extends this {@link LatLngBounds} to include the + * given {@link LatLng}. This will return the smallest LatLngBounds that contains both this + * and the extra point. + *

+ * In particular, it will consider extending the bounds both in the eastward and westward + * directions (one of which may cross the antimeridian) and choose the smaller of the two. In + * the case that both directions result in a LatLngBounds of the same size, this will extend + * it in the eastward direction. + * + * @param point a {@link LatLng} to be included in the new bounds + * @return A new {@link LatLngBounds} that contains this and the extra point. + */ + public LatLngBounds including(LatLng point) { + double latMin = Math.min(southwest.latitude, point.latitude); + double latMax = Math.max(northeast.latitude, point.latitude); + double lonMin = southwest.longitude; + double lonMax = northeast.longitude; + if (!containsLongitude(point.longitude)) { + if ((southwest.longitude - point.longitude + 360.0) % 360.0 < + (point.longitude - northeast.longitude + 360.0D) % 360.0D) { + lonMin = point.longitude; + } else { + lonMax = point.longitude; + } + } + return new LatLngBounds(new LatLng(latMin, lonMin), new LatLng(latMax, lonMax)); + } + + @Override + public String toString() { + return "LatLngBounds{" + + "southwest=" + southwest + + ", northeast=" + northeast + + '}'; + } + + @Override + public void writeToParcel(Parcel out, int flags) { + SafeParcelUtil.writeObject(this, out, flags); } public static Creator CREATOR = new Creator() { @@ -77,4 +204,49 @@ public final class LatLngBounds implements SafeParcelable { return new LatLngBounds[size]; } }; + + /** + * This is a builder that is able to create a minimum bound based on a set of LatLng points. + */ + public static final class Builder { + private LatLngBounds bounds; + + public Builder() { + + } + + /** + * Creates the LatLng bounds. + * + * @throws IllegalStateException if no points have been included. + */ + public LatLngBounds build() throws IllegalStateException { + if (bounds == null) + throw new IllegalStateException( + "You must not call build() before adding points to the Builder"); + return bounds; + } + + /** + * Includes this point for building of the bounds. The bounds will be extended in a + * minimum way to include this point. + *

+ * More precisely, it will consider extending the bounds both in the eastward and westward + * directions (one of which may cross the antimeridian) and choose the smaller of the two. + * In the case that both directions result in a LatLngBounds of the same size, this will + * extend it in the eastward direction. For example, adding points (0, -179) and (1, 179) + * will create a bound crossing the 180 longitude. + * + * @param point A {@link LatLng} to be included in the bounds. + * @return This builder object with a new point added. + */ + public Builder include(LatLng point) { + if (bounds == null) { + bounds = new LatLngBounds(point, point); + } else { + bounds = bounds.including(point); + } + return this; + } + } } diff --git a/src/com/google/android/gms/maps/model/PolygonOptions.java b/src/com/google/android/gms/maps/model/PolygonOptions.java index aaefc97c..8898f11e 100644 --- a/src/com/google/android/gms/maps/model/PolygonOptions.java +++ b/src/com/google/android/gms/maps/model/PolygonOptions.java @@ -20,6 +20,10 @@ import android.os.Parcel; import org.microg.safeparcel.SafeParcelUtil; import org.microg.safeparcel.SafeParcelable; +/** + * Defines options for a polygon. + * TODO + */ public class PolygonOptions implements SafeParcelable { @Override public int describeContents() { diff --git a/src/com/google/android/gms/maps/model/PolylineOptions.java b/src/com/google/android/gms/maps/model/PolylineOptions.java index ee927934..5e861b7e 100644 --- a/src/com/google/android/gms/maps/model/PolylineOptions.java +++ b/src/com/google/android/gms/maps/model/PolylineOptions.java @@ -23,6 +23,10 @@ import org.microg.safeparcel.SafeParceled; import java.util.List; +/** + * Defines options for a polyline. + * TODO + */ public class PolylineOptions implements SafeParcelable { @SafeParceled(1) private int versionCode; diff --git a/src/com/google/android/gms/maps/model/Tile.java b/src/com/google/android/gms/maps/model/Tile.java new file mode 100644 index 00000000..9ba8b612 --- /dev/null +++ b/src/com/google/android/gms/maps/model/Tile.java @@ -0,0 +1,78 @@ +package com.google.android.gms.maps.model; + +import android.os.Parcel; +import org.microg.safeparcel.SafeParcelUtil; +import org.microg.safeparcel.SafeParcelable; +import org.microg.safeparcel.SafeParceled; + +/** + * Contains information about a Tile that is returned by a {@link TileProvider}. + * TODO SafeParceled + */ +public class Tile implements SafeParcelable { + @SafeParceled(1) + private final int versionCode; + /** + * The width of the image encoded by {@link #data} in pixels. + */ + @SafeParceled(2) + public final int width; + /** + * The height of the image encoded by {@link #data} in pixels. + */ + @SafeParceled(3) + public final int height; + /** + * A byte array containing the image data. The image will be created from this data by calling + * {@link android.graphics.BitmapFactory#decodeByteArray(byte[], int, int)}. + */ + @SafeParceled(4) + public final byte[] data; + + private Tile() { + versionCode = -1; + width = height = 0; + data = null; + } + + private Tile(Parcel in) { + this(); + SafeParcelUtil.readObject(this, in); + } + + /** + * Constructs a {@link Tile}. + * + * @param width the width of the image in pixels + * @param height the height of the image in pixels + * @param data A byte array containing the image data. The image will be created from this + * data by calling + * {@link android.graphics.BitmapFactory#decodeByteArray(byte[], int, int)}. + */ + public Tile(int width, int height, byte[] data) { + this.versionCode = 1; + this.width = width; + this.height = height; + this.data = data; + } + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel out, int flags) { + SafeParcelUtil.writeObject(this, out, flags); + } + + public static Creator CREATOR = new Creator() { + public Tile createFromParcel(Parcel source) { + return new Tile(source); + } + + public Tile[] newArray(int size) { + return new Tile[size]; + } + }; +} diff --git a/src/com/google/android/gms/maps/model/TileOverlayOptions.java b/src/com/google/android/gms/maps/model/TileOverlayOptions.java index 0256adfc..6fad3fd7 100644 --- a/src/com/google/android/gms/maps/model/TileOverlayOptions.java +++ b/src/com/google/android/gms/maps/model/TileOverlayOptions.java @@ -20,23 +20,113 @@ import android.os.Parcel; import org.microg.safeparcel.SafeParcelUtil; import org.microg.safeparcel.SafeParcelable; +/** + * Defines options for a TileOverlay. + */ public class TileOverlayOptions implements SafeParcelable { + private TileProvider tileProvider; + private boolean visible = true; + private boolean fadeIn = true; + private float zIndex; + + /** + * Creates a new set of tile overlay options. + */ + public TileOverlayOptions() { + } + + private TileOverlayOptions(Parcel in) { + SafeParcelUtil.readObject(this, in); + } + @Override public int describeContents() { return 0; } + /** + * Specifies whether the tiles should fade in. The default is {@code true}. + * + * @return this {@link TileOverlayOptions} object with a new fadeIn setting. + */ + public TileOverlayOptions fadeIn(boolean fadeIn) { + this.fadeIn = fadeIn; + return this; + } + + /** + * Gets whether the tiles should fade in. + * + * @return {@code true} if the tiles are to fade in; {@code false} if it is not. + */ + public boolean getFadeIn() { + return fadeIn; + } + + /** + * Gets the tile provider set for this {@link TileOverlayOptions} object. + * + * @return the {@link TileProvider} of the tile overlay. + */ + public TileProvider getTileProvider() { + return tileProvider; + } + + /** + * Gets the zIndex set for this {@link TileOverlayOptions} object. + * + * @return the zIndex of the tile overlay. + */ + public float getZIndex() { + return zIndex; + } + + /** + * Gets the visibility setting for this {@link TileOverlayOptions} object. + * + * @return {@code true} if the tile overlay is to be visible; {@code false} if it is not. + */ + public boolean isVisible() { + return visible; + } + + /** + * Specifies the tile provider to use for this tile overlay. + * + * @param tileProvider the {@link TileProvider} to use for this tile overlay. + * @return the object for which the method was called, with the new tile provider set. + */ + public TileOverlayOptions tileProvider(TileProvider tileProvider) { + this.tileProvider = tileProvider; + return this; + } + + /** + * Specifies the visibility for the tile overlay. The default visibility is {@code true}. + * + * @return this {@link TileOverlayOptions} object with a new visibility setting. + */ + public TileOverlayOptions visible(boolean visible) { + this.visible = visible; + return this; + } + @Override public void writeToParcel(Parcel dest, int flags) { SafeParcelUtil.writeObject(this, dest, flags); } - public TileOverlayOptions() { - } - - private TileOverlayOptions(Parcel in) { - SafeParcelUtil.readObject(this, in); + /** + * Specifies the tile overlay's zIndex, i.e., the order in which it will be drawn where + * overlays with larger values are drawn above those with lower values. See the documentation + * at the top of this class for more information about zIndex. + * + * @return this {@link TileOverlayOptions} object with a new zIndex set. + */ + public TileOverlayOptions zIndex(float zIndex) { + this.zIndex = zIndex; + return this; } public static Creator CREATOR = new Creator() { diff --git a/src/com/google/android/gms/maps/model/TileProvider.java b/src/com/google/android/gms/maps/model/TileProvider.java new file mode 100644 index 00000000..21eaaadc --- /dev/null +++ b/src/com/google/android/gms/maps/model/TileProvider.java @@ -0,0 +1,25 @@ +package com.google.android.gms.maps.model; + +/** + * An interface for a class that provides the tile images for a TileOverlay. For information about + * the tile coordinate system, see TileOverlay. + *

+ * Calls to methods in this interface might be made from multiple threads so implementations of + * this interface must be threadsafe. + */ +public interface TileProvider { + public static final Tile NO_TILE = new Tile(-1, -1, null); + + /** + * Returns the tile to be used for this tile coordinate. + * + * @param x The x coordinate of the tile. This will be in the range [0, 2^(zoom - 1)] inclusive. + * @param y The y coordinate of the tile. This will be in the range [0, 2^(zoom - 1)] inclusive. + * @param zoom The zoom level of the tile. + * @return the {@link Tile} to be used for this tile coordinate. If you do not wish to provide + * a tile for this tile coordinate, return {@link #NO_TILE}. If the tile could not be found at + * this point in time, return null and further requests might be made with an exponential + * backoff. + */ + public Tile getTile(int x, int y, int zoom); +} From 8ab6a25cfd28edc18064ad62eb2bdda6b4fe9834 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Fri, 9 Jan 2015 22:57:04 +0100 Subject: [PATCH 005/293] Full Tile support in Api --- .../android/gms/maps/model/MarkerOptions.java | 17 ++++++------- .../google/android/gms/maps/model/Tile.aidl | 3 +++ .../gms/maps/model/TileOverlayOptions.java | 24 +++++++++++++++++-- .../model/internal/ITileProviderDelegate.aidl | 7 ++++++ 4 files changed, 39 insertions(+), 12 deletions(-) create mode 100644 src/com/google/android/gms/maps/model/Tile.aidl create mode 100644 src/com/google/android/gms/maps/model/internal/ITileProviderDelegate.aidl diff --git a/src/com/google/android/gms/maps/model/MarkerOptions.java b/src/com/google/android/gms/maps/model/MarkerOptions.java index 4da6246b..b2683731 100644 --- a/src/com/google/android/gms/maps/model/MarkerOptions.java +++ b/src/com/google/android/gms/maps/model/MarkerOptions.java @@ -37,11 +37,8 @@ public class MarkerOptions implements SafeParcelable { * This is a IBinder to the remote BitmapDescriptor created using BitmapDescriptorFactory */ @SafeParceled(5) - private IBinder icon; - /** - * The real BitmapDescriptor. Not transferred through Parcel. - */ - private BitmapDescriptor iconDescriptor; + private IBinder iconBinder; + private BitmapDescriptor icon; @SafeParceled(6) private float anchorU = 0.5F; @SafeParceled(7) @@ -167,10 +164,10 @@ public class MarkerOptions implements SafeParcelable { * custom icon is set. */ public BitmapDescriptor getIcon() { - if (iconDescriptor == null && icon != null) { - iconDescriptor = new BitmapDescriptor(ObjectWrapper.asInterface(icon)); + if (icon == null && iconBinder != null) { + icon = new BitmapDescriptor(ObjectWrapper.asInterface(iconBinder)); } - return iconDescriptor; + return icon; } /** @@ -234,8 +231,8 @@ public class MarkerOptions implements SafeParcelable { * @return the object for which the method was called, with the new icon set. */ public MarkerOptions icon(BitmapDescriptor icon) { - this.iconDescriptor = icon; - this.icon = icon == null ? null : icon.getRemoteObject().asBinder(); + this.icon = icon; + this.iconBinder = icon == null ? null : icon.getRemoteObject().asBinder(); return this; } diff --git a/src/com/google/android/gms/maps/model/Tile.aidl b/src/com/google/android/gms/maps/model/Tile.aidl new file mode 100644 index 00000000..54f1872f --- /dev/null +++ b/src/com/google/android/gms/maps/model/Tile.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.maps.model; + +parcelable Tile; diff --git a/src/com/google/android/gms/maps/model/TileOverlayOptions.java b/src/com/google/android/gms/maps/model/TileOverlayOptions.java index 6fad3fd7..b38a5dce 100644 --- a/src/com/google/android/gms/maps/model/TileOverlayOptions.java +++ b/src/com/google/android/gms/maps/model/TileOverlayOptions.java @@ -16,19 +16,33 @@ package com.google.android.gms.maps.model; +import android.os.IBinder; import android.os.Parcel; +import android.os.RemoteException; +import com.google.android.gms.maps.model.internal.ITileProviderDelegate; import org.microg.safeparcel.SafeParcelUtil; import org.microg.safeparcel.SafeParcelable; +import org.microg.safeparcel.SafeParceled; /** * Defines options for a TileOverlay. */ public class TileOverlayOptions implements SafeParcelable { + @SafeParceled(1) + private final int versionCode = 1; + /** + * This is a IBinder to the {@link #tileProvider}, built using {@link ITileProviderDelegate}. + */ + @SafeParceled(2) + private IBinder tileProviderBinder; private TileProvider tileProvider; + @SafeParceled(3) private boolean visible = true; - private boolean fadeIn = true; + @SafeParceled(4) private float zIndex; + @SafeParceled(5) + private boolean fadeIn = true; /** * Creates a new set of tile overlay options. @@ -97,8 +111,14 @@ public class TileOverlayOptions implements SafeParcelable { * @param tileProvider the {@link TileProvider} to use for this tile overlay. * @return the object for which the method was called, with the new tile provider set. */ - public TileOverlayOptions tileProvider(TileProvider tileProvider) { + public TileOverlayOptions tileProvider(final TileProvider tileProvider) { this.tileProvider = tileProvider; + this.tileProviderBinder = new ITileProviderDelegate.Stub() { + @Override + public Tile getTile(int x, int y, int zoom) throws RemoteException { + return tileProvider.getTile(x, y, zoom); + } + }; return this; } diff --git a/src/com/google/android/gms/maps/model/internal/ITileProviderDelegate.aidl b/src/com/google/android/gms/maps/model/internal/ITileProviderDelegate.aidl new file mode 100644 index 00000000..d6dc516b --- /dev/null +++ b/src/com/google/android/gms/maps/model/internal/ITileProviderDelegate.aidl @@ -0,0 +1,7 @@ +package com.google.android.gms.maps.model.internal; + +import com.google.android.gms.maps.model.Tile; + +interface ITileProviderDelegate { + Tile getTile(int x, int y, int zoom); +} From 012ce9bd3c170757b6382e55707c51cbdec73eff Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Sun, 11 Jan 2015 12:53:42 +0100 Subject: [PATCH 006/293] Add Location APIs + empty files --- .../android/gms/auth/AccountChangeEvent.java | 4 + .../firstparty/dataservice/TokenRequest.java | 4 + .../firstparty/dataservice/TokenResponse.java | 4 + .../firstparty/proximity/data/Permit.java | 4 + .../android/gms/common/data/DataHolder.aidl | 3 + .../android/gms/common/data/DataHolder.java | 36 ++ .../metadata/internal/MetadataBundle.java | 4 + .../android/gms/fitness/data/DataPoint.java | 4 + .../android/gms/fitness/data/Device.java | 4 + .../android/gms/fitness/data/Field.java | 4 + .../android/gms/fitness/data/Value.java | 4 + .../identity/accounts/api/AccountData.java | 4 + .../intents/model/CountrySpecification.java | 4 + .../identity/intents/model/UserAddress.java | 4 + .../gms/location/GeofencingRequest.aidl | 3 + .../gms/location/GeofencingRequest.java | 38 ++ .../android/gms/location/LocationRequest.aidl | 3 + .../android/gms/location/LocationRequest.java | 445 ++++++++++++++++++ .../android/gms/location/LocationStatus.aidl | 3 + .../android/gms/location/LocationStatus.java | 103 ++++ .../gms/location/internal/ClientIdentity.java | 4 + .../IGoogleLocationManagerService.aidl | 54 ++- .../location/internal/ILocationListener.aidl | 7 + .../internal/LocationRequestInternal.aidl | 3 + .../internal/LocationRequestInternal.java | 37 ++ .../location/places/AutocompleteFilter.aidl | 3 + .../location/places/AutocompleteFilter.java | 46 ++ .../location/places/NearbyAlertRequest.aidl | 3 + .../location/places/NearbyAlertRequest.java | 36 ++ .../gms/location/places/PlaceFilter.aidl | 3 + .../gms/location/places/PlaceFilter.java | 37 ++ .../gms/location/places/PlaceReport.aidl | 3 + .../gms/location/places/PlaceReport.java | 38 ++ .../gms/location/places/PlaceRequest.aidl | 3 + .../gms/location/places/PlaceRequest.java | 36 ++ .../gms/location/places/UserAddedPlace.aidl | 3 + .../gms/location/places/UserAddedPlace.java | 46 ++ .../gms/location/places/UserDataType.aidl | 3 + .../gms/location/places/UserDataType.java | 36 ++ .../places/internal/IPlacesCallbacks.aidl | 9 + .../places/internal/PlacesParams.aidl | 3 + .../places/internal/PlacesParams.java | 52 ++ .../gms/maps/StreetViewPanoramaOptions.java | 4 + .../android/gms/maps/internal/Point.java | 4 + .../maps/model/StreetViewPanoramaCamera.java | 4 + .../maps/model/StreetViewPanoramaLink.java | 4 + .../model/StreetViewPanoramaLocation.java | 4 + .../model/StreetViewPanoramaOrientation.java | 4 + .../gms/plus/internal/PlusCommonExtras.java | 4 + .../gms/plus/internal/PlusSession.java | 4 + .../model/smart_profile/CardsRequest.java | 4 + .../model/smart_profile/CardsResponse.java | 4 + .../PeopleForProfilesRequest.java | 4 + .../PeopleForProfilesResponse.java | 4 + .../android/gms/plus/model/posts/Comment.java | 4 + .../android/gms/plus/model/posts/Post.java | 4 + .../gms/plus/model/posts/Settings.java | 4 + .../gms/wearable/ConnectionConfiguration.java | 4 + src/org/microg/gms/maps/Constants.java | 9 + 59 files changed, 1219 insertions(+), 1 deletion(-) create mode 100644 src/com/google/android/gms/auth/AccountChangeEvent.java create mode 100644 src/com/google/android/gms/auth/firstparty/dataservice/TokenRequest.java create mode 100644 src/com/google/android/gms/auth/firstparty/dataservice/TokenResponse.java create mode 100644 src/com/google/android/gms/auth/firstparty/proximity/data/Permit.java create mode 100644 src/com/google/android/gms/common/data/DataHolder.aidl create mode 100644 src/com/google/android/gms/common/data/DataHolder.java create mode 100644 src/com/google/android/gms/drive/metadata/internal/MetadataBundle.java create mode 100644 src/com/google/android/gms/fitness/data/DataPoint.java create mode 100644 src/com/google/android/gms/fitness/data/Device.java create mode 100644 src/com/google/android/gms/fitness/data/Field.java create mode 100644 src/com/google/android/gms/fitness/data/Value.java create mode 100644 src/com/google/android/gms/identity/accounts/api/AccountData.java create mode 100644 src/com/google/android/gms/identity/intents/model/CountrySpecification.java create mode 100644 src/com/google/android/gms/identity/intents/model/UserAddress.java create mode 100644 src/com/google/android/gms/location/GeofencingRequest.aidl create mode 100644 src/com/google/android/gms/location/GeofencingRequest.java create mode 100644 src/com/google/android/gms/location/LocationRequest.aidl create mode 100644 src/com/google/android/gms/location/LocationRequest.java create mode 100644 src/com/google/android/gms/location/LocationStatus.aidl create mode 100644 src/com/google/android/gms/location/LocationStatus.java create mode 100644 src/com/google/android/gms/location/internal/ClientIdentity.java create mode 100644 src/com/google/android/gms/location/internal/ILocationListener.aidl create mode 100644 src/com/google/android/gms/location/internal/LocationRequestInternal.aidl create mode 100644 src/com/google/android/gms/location/internal/LocationRequestInternal.java create mode 100644 src/com/google/android/gms/location/places/AutocompleteFilter.aidl create mode 100644 src/com/google/android/gms/location/places/AutocompleteFilter.java create mode 100644 src/com/google/android/gms/location/places/NearbyAlertRequest.aidl create mode 100644 src/com/google/android/gms/location/places/NearbyAlertRequest.java create mode 100644 src/com/google/android/gms/location/places/PlaceFilter.aidl create mode 100644 src/com/google/android/gms/location/places/PlaceFilter.java create mode 100644 src/com/google/android/gms/location/places/PlaceReport.aidl create mode 100644 src/com/google/android/gms/location/places/PlaceReport.java create mode 100644 src/com/google/android/gms/location/places/PlaceRequest.aidl create mode 100644 src/com/google/android/gms/location/places/PlaceRequest.java create mode 100644 src/com/google/android/gms/location/places/UserAddedPlace.aidl create mode 100644 src/com/google/android/gms/location/places/UserAddedPlace.java create mode 100644 src/com/google/android/gms/location/places/UserDataType.aidl create mode 100644 src/com/google/android/gms/location/places/UserDataType.java create mode 100644 src/com/google/android/gms/location/places/internal/IPlacesCallbacks.aidl create mode 100644 src/com/google/android/gms/location/places/internal/PlacesParams.aidl create mode 100644 src/com/google/android/gms/location/places/internal/PlacesParams.java create mode 100644 src/com/google/android/gms/maps/StreetViewPanoramaOptions.java create mode 100644 src/com/google/android/gms/maps/internal/Point.java create mode 100644 src/com/google/android/gms/maps/model/StreetViewPanoramaCamera.java create mode 100644 src/com/google/android/gms/maps/model/StreetViewPanoramaLink.java create mode 100644 src/com/google/android/gms/maps/model/StreetViewPanoramaLocation.java create mode 100644 src/com/google/android/gms/maps/model/StreetViewPanoramaOrientation.java create mode 100644 src/com/google/android/gms/plus/internal/PlusCommonExtras.java create mode 100644 src/com/google/android/gms/plus/internal/PlusSession.java create mode 100644 src/com/google/android/gms/plus/internal/model/smart_profile/CardsRequest.java create mode 100644 src/com/google/android/gms/plus/internal/model/smart_profile/CardsResponse.java create mode 100644 src/com/google/android/gms/plus/internal/model/smart_profile/PeopleForProfilesRequest.java create mode 100644 src/com/google/android/gms/plus/internal/model/smart_profile/PeopleForProfilesResponse.java create mode 100644 src/com/google/android/gms/plus/model/posts/Comment.java create mode 100644 src/com/google/android/gms/plus/model/posts/Post.java create mode 100644 src/com/google/android/gms/plus/model/posts/Settings.java create mode 100644 src/com/google/android/gms/wearable/ConnectionConfiguration.java diff --git a/src/com/google/android/gms/auth/AccountChangeEvent.java b/src/com/google/android/gms/auth/AccountChangeEvent.java new file mode 100644 index 00000000..4f927ab8 --- /dev/null +++ b/src/com/google/android/gms/auth/AccountChangeEvent.java @@ -0,0 +1,4 @@ +package com.google.android.gms.auth; + +public class AccountChangeEvent { +} diff --git a/src/com/google/android/gms/auth/firstparty/dataservice/TokenRequest.java b/src/com/google/android/gms/auth/firstparty/dataservice/TokenRequest.java new file mode 100644 index 00000000..1388bbdc --- /dev/null +++ b/src/com/google/android/gms/auth/firstparty/dataservice/TokenRequest.java @@ -0,0 +1,4 @@ +package com.google.android.gms.auth.firstparty.dataservice; + +public class TokenRequest { +} diff --git a/src/com/google/android/gms/auth/firstparty/dataservice/TokenResponse.java b/src/com/google/android/gms/auth/firstparty/dataservice/TokenResponse.java new file mode 100644 index 00000000..3b1b22ac --- /dev/null +++ b/src/com/google/android/gms/auth/firstparty/dataservice/TokenResponse.java @@ -0,0 +1,4 @@ +package com.google.android.gms.auth.firstparty.dataservice; + +public class TokenResponse { +} diff --git a/src/com/google/android/gms/auth/firstparty/proximity/data/Permit.java b/src/com/google/android/gms/auth/firstparty/proximity/data/Permit.java new file mode 100644 index 00000000..fcd07ddd --- /dev/null +++ b/src/com/google/android/gms/auth/firstparty/proximity/data/Permit.java @@ -0,0 +1,4 @@ +package com.google.android.gms.auth.firstparty.proximity.data; + +public class Permit { +} diff --git a/src/com/google/android/gms/common/data/DataHolder.aidl b/src/com/google/android/gms/common/data/DataHolder.aidl new file mode 100644 index 00000000..3bbd1174 --- /dev/null +++ b/src/com/google/android/gms/common/data/DataHolder.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.common.data; + +parcelable DataHolder; diff --git a/src/com/google/android/gms/common/data/DataHolder.java b/src/com/google/android/gms/common/data/DataHolder.java new file mode 100644 index 00000000..2cb2885c --- /dev/null +++ b/src/com/google/android/gms/common/data/DataHolder.java @@ -0,0 +1,36 @@ +package com.google.android.gms.common.data; + +import android.os.Parcel; +import org.microg.safeparcel.SafeParcelUtil; +import org.microg.safeparcel.SafeParcelable; + +/** + * TODO: usage + */ +public class DataHolder implements SafeParcelable { + private DataHolder(Parcel in) { + SafeParcelUtil.readObject(this, in); + } + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel out, int flags) { + SafeParcelUtil.writeObject(this, out, flags); + } + + public static final Creator CREATOR = new Creator() { + @Override + public DataHolder createFromParcel(Parcel parcel) { + return new DataHolder(parcel); + } + + @Override + public DataHolder[] newArray(int i) { + return new DataHolder[i]; + } + }; +} diff --git a/src/com/google/android/gms/drive/metadata/internal/MetadataBundle.java b/src/com/google/android/gms/drive/metadata/internal/MetadataBundle.java new file mode 100644 index 00000000..538defa0 --- /dev/null +++ b/src/com/google/android/gms/drive/metadata/internal/MetadataBundle.java @@ -0,0 +1,4 @@ +package com.google.android.gms.drive.metadata.internal; + +public class MetadataBundle { +} diff --git a/src/com/google/android/gms/fitness/data/DataPoint.java b/src/com/google/android/gms/fitness/data/DataPoint.java new file mode 100644 index 00000000..e81a0172 --- /dev/null +++ b/src/com/google/android/gms/fitness/data/DataPoint.java @@ -0,0 +1,4 @@ +package com.google.android.gms.fitness.data; + +public class DataPoint { +} diff --git a/src/com/google/android/gms/fitness/data/Device.java b/src/com/google/android/gms/fitness/data/Device.java new file mode 100644 index 00000000..173f134f --- /dev/null +++ b/src/com/google/android/gms/fitness/data/Device.java @@ -0,0 +1,4 @@ +package com.google.android.gms.fitness.data; + +public class Device { +} diff --git a/src/com/google/android/gms/fitness/data/Field.java b/src/com/google/android/gms/fitness/data/Field.java new file mode 100644 index 00000000..ee2211d4 --- /dev/null +++ b/src/com/google/android/gms/fitness/data/Field.java @@ -0,0 +1,4 @@ +package com.google.android.gms.fitness.data; + +public class Field { +} diff --git a/src/com/google/android/gms/fitness/data/Value.java b/src/com/google/android/gms/fitness/data/Value.java new file mode 100644 index 00000000..91cd4b78 --- /dev/null +++ b/src/com/google/android/gms/fitness/data/Value.java @@ -0,0 +1,4 @@ +package com.google.android.gms.fitness.data; + +public class Value { +} diff --git a/src/com/google/android/gms/identity/accounts/api/AccountData.java b/src/com/google/android/gms/identity/accounts/api/AccountData.java new file mode 100644 index 00000000..993f6417 --- /dev/null +++ b/src/com/google/android/gms/identity/accounts/api/AccountData.java @@ -0,0 +1,4 @@ +package com.google.android.gms.identity.accounts.api; + +public class AccountData { +} diff --git a/src/com/google/android/gms/identity/intents/model/CountrySpecification.java b/src/com/google/android/gms/identity/intents/model/CountrySpecification.java new file mode 100644 index 00000000..1c9fe39b --- /dev/null +++ b/src/com/google/android/gms/identity/intents/model/CountrySpecification.java @@ -0,0 +1,4 @@ +package com.google.android.gms.identity.intents.model; + +public class CountrySpecification { +} diff --git a/src/com/google/android/gms/identity/intents/model/UserAddress.java b/src/com/google/android/gms/identity/intents/model/UserAddress.java new file mode 100644 index 00000000..3595f666 --- /dev/null +++ b/src/com/google/android/gms/identity/intents/model/UserAddress.java @@ -0,0 +1,4 @@ +package com.google.android.gms.identity.intents.model; + +public class UserAddress { +} diff --git a/src/com/google/android/gms/location/GeofencingRequest.aidl b/src/com/google/android/gms/location/GeofencingRequest.aidl new file mode 100644 index 00000000..d88a3ac8 --- /dev/null +++ b/src/com/google/android/gms/location/GeofencingRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.location; + +parcelable GeofencingRequest; diff --git a/src/com/google/android/gms/location/GeofencingRequest.java b/src/com/google/android/gms/location/GeofencingRequest.java new file mode 100644 index 00000000..f8167e78 --- /dev/null +++ b/src/com/google/android/gms/location/GeofencingRequest.java @@ -0,0 +1,38 @@ +package com.google.android.gms.location; + +import android.os.Parcel; +import android.os.Parcelable; +import org.microg.safeparcel.SafeParcelUtil; +import org.microg.safeparcel.SafeParcelable; + +/** + * TODO: usage + */ +public class GeofencingRequest implements SafeParcelable { + + private GeofencingRequest(Parcel in) { + SafeParcelUtil.readObject(this, in); + } + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel out, int flags) { + SafeParcelUtil.writeObject(this, out, flags); + } + + public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { + @Override + public GeofencingRequest createFromParcel(Parcel parcel) { + return new GeofencingRequest(parcel); + } + + @Override + public GeofencingRequest[] newArray(int i) { + return new GeofencingRequest[i]; + } + }; +} diff --git a/src/com/google/android/gms/location/LocationRequest.aidl b/src/com/google/android/gms/location/LocationRequest.aidl new file mode 100644 index 00000000..915aa2ae --- /dev/null +++ b/src/com/google/android/gms/location/LocationRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.location; + +parcelable LocationRequest; diff --git a/src/com/google/android/gms/location/LocationRequest.java b/src/com/google/android/gms/location/LocationRequest.java new file mode 100644 index 00000000..dfc46811 --- /dev/null +++ b/src/com/google/android/gms/location/LocationRequest.java @@ -0,0 +1,445 @@ +package com.google.android.gms.location; + +import android.os.Parcel; +import android.os.SystemClock; +import org.microg.safeparcel.SafeParcelUtil; +import org.microg.safeparcel.SafeParcelable; +import org.microg.safeparcel.SafeParceled; + +import java.util.Arrays; + +/** + * A data object that contains quality of service parameters for requests to the + * FusedLocationProviderApi. + *

+ * LocationRequest objects are used to request a quality of service for location updates from the + * FusedLocationProviderApi. + *

+ * For example, if your application wants high accuracy location it should create a location + * request with {@link #setPriority(int)} set to {@link #PRIORITY_HIGH_ACCURACY} and + * {@link #setInterval(long)} to 5 seconds. This would be appropriate for mapping applications that + * are showing your location in real-time. + *

+ * At the other extreme, if you want negligible power impact, but to still receive location updates + * when available, then create a location request with {@link #setPriority(int)} set to + * {@link #PRIORITY_NO_POWER}. With this request your application will not trigger (and therefore + * will not receive any power blame) any location updates, but will receive locations triggered by + * other applications. This would be appropriate for applications that have no firm requirement for + * location, but can take advantage when available. + *

+ * In between these two extremes is a very common use-case, where applications definitely want to + * receive updates at a specified interval, and can receive them faster when available, but still + * want a low power impact. These applications should consider + * {@link #PRIORITY_BALANCED_POWER_ACCURACY} combined with a faster + * {@link #setFastestInterval(long)} (such as 1 minute) and a slower {@link #setInterval(long)} + * (such as 60 minutes). They will only be assigned power blame for the interval set by + * {@link #setInterval(long)}, but can still receive locations triggered by other applications at a + * rate up to {@link #setFastestInterval(long)}. This style of request is appropriate for many + * location aware applications, including background usage. Do be careful to also throttle + * {@link #setFastestInterval(long)} if you perform heavy-weight work after receiving an update - + * such as using the network. + *

+ * Activities should strongly consider removing all location request when entering the background + * (for example at {@link android.app.Activity#onPause()}), or at least swap the request to a + * larger interval and lower quality. + *

+ * Applications cannot specify the exact location sources, such as GPS, that are used by the + * LocationClient. In fact, the system may have multiple location sources (providers) running and + * may fuse the results from several sources into a single Location object. + *

+ * Location requests from applications with + * {@link android.Manifest.permission#ACCESS_COARSE_LOCATION} and not + * {@link android.Manifest.permission#ACCESS_FINE_LOCATION} will be automatically throttled to a + * slower interval, and the location object will be obfuscated to only show a coarse level of + * accuracy. + *

+ * All location requests are considered hints, and you may receive locations that are more/less + * accurate, and faster/slower than requested. + *

+ * TODO: Works on wire, but methods not yet implemented. + */ +public class LocationRequest implements SafeParcelable { + + /** + * Used with {@link #setPriority(int)} to request "block" level accuracy. + *

+ * Block level accuracy is considered to be about 100 meter accuracy. Using a coarse accuracy + * such as this often consumes less power. + */ + public static final int PRIORITY_BALANCED_POWER_ACCURACY = 102; + /** + * Used with {@link #setPriority(int)} to request the most accurate locations available. + *

+ * This will return the finest location available. + */ + public static final int PRIORITY_HIGH_ACCURACY = 100; + /** + * Used with {@link #setPriority(int)} to request "city" level accuracy. + *

+ * City level accuracy is considered to be about 10km accuracy. Using a coarse accuracy such as + * this often consumes less power. + */ + public static final int PRIORITY_LOW_POWER = 104; + /** + * Used with {@link #setPriority(int)} to request the best accuracy possible with zero + * additional power consumption. + *

+ * No locations will be returned unless a different client has requested location updates in + * which case this request will act as a passive listener to those locations. + */ + public static final int PRIORITY_NO_POWER = 105; + + @SafeParceled(1000) + private final int versionCode; + @SafeParceled(1) + private int priority; + @SafeParceled(2) + private long interval; + @SafeParceled(3) + private long fastestInterval; + @SafeParceled(4) + private boolean explicitFastestInterval; + @SafeParceled(5) + private long expirationTime; + @SafeParceled(6) + private int numUpdates; + @SafeParceled(7) + private float smallestDesplacement; + @SafeParceled(8) + private long maxWaitTime; + + public LocationRequest() { + this.versionCode = 1; + this.priority = PRIORITY_BALANCED_POWER_ACCURACY; + this.interval = 3600000; + this.fastestInterval = 600000; + this.explicitFastestInterval = false; + this.expirationTime = Long.MAX_VALUE; + this.numUpdates = Integer.MAX_VALUE; + this.smallestDesplacement = 0; + this.maxWaitTime = 0; + } + + public LocationRequest(Parcel in) { + this(); + SafeParcelUtil.readObject(this, in); + } + + /** + * Create a location request with default parameters. + *

+ * Default parameters are for a block accuracy, slowly updated location. It can then be + * adjusted as required by the applications before passing to the FusedLocationProviderApi. + * + * @return a new location request + */ + public static LocationRequest create() { + return new LocationRequest(); + } + + @Override + public int describeContents() { + return 0; + } + + /** + * Get the request expiration time, in milliseconds since boot. + *

+ * This value can be compared to {@link SystemClock#elapsedRealtime()} to determine + * the time until expiration. + * + * @return expiration time of request, in milliseconds since boot including suspend + */ + public long getExpirationTime() { + return expirationTime; + } + + /** + * Get the fastest interval of this request, in milliseconds. + *

+ * The system will never provide location updates faster than the minimum of + * {@link #getFastestInterval()} and {@link #getInterval()}. + * + * @return fastest interval in milliseconds, exact + */ + public long getFastestInterval() { + return fastestInterval; + } + + /** + * Get the desired interval of this request, in milliseconds. + * + * @return desired interval in milliseconds, inexact + */ + public long getInterval() { + return interval; + } + + /** + * Get the number of updates requested. + *

+ * By default this is {@link java.lang.Integer#MAX_VALUE}, which indicates that locations are + * updated until the request is explicitly removed. + * + * @return number of updates + */ + public int getNumUpdates() { + return numUpdates; + } + + /** + * Get the quality of the request. + * + * @return an accuracy constant + */ + public int getPriority() { + return priority; + } + + /** + * Get the minimum displacement between location updates in meters + *

+ * By default this is 0. + * + * @return minimum displacement between location updates in meters + */ + public float getSmallestDesplacement() { + return smallestDesplacement; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; + + LocationRequest that = (LocationRequest) o; + + if (expirationTime != that.expirationTime) + return false; + if (explicitFastestInterval != that.explicitFastestInterval) + return false; + if (fastestInterval != that.fastestInterval) + return false; + if (interval != that.interval) + return false; + if (maxWaitTime != that.maxWaitTime) + return false; + if (numUpdates != that.numUpdates) + return false; + if (priority != that.priority) + return false; + if (Float.compare(that.smallestDesplacement, smallestDesplacement) != 0) + return false; + + return true; + } + + @Override + public int hashCode() { + return Arrays.hashCode( + new Object[] { priority, interval, fastestInterval, explicitFastestInterval, + explicitFastestInterval, numUpdates, smallestDesplacement, maxWaitTime + }); + } + + /** + * Set the duration of this request, in milliseconds. + *

+ * The duration begins immediately (and not when the request is passed to the location client), + * so call this method again if the request is re-used at a later time. + *

+ * The location client will automatically stop updates after the request expires. + *

+ * The duration includes suspend time. Values less than 0 are allowed, but indicate that the + * request has already expired. + * + * @param millis duration of request in milliseconds + * @return the same object, so that setters can be chained + */ + public LocationRequest setExpirationDuration(long millis) { + expirationTime = SystemClock.elapsedRealtime() + millis; + return this; + } + + /** + * Set the request expiration time, in millisecond since boot. + *

+ * This expiration time uses the same time base as {@link SystemClock#elapsedRealtime()}. + *

+ * The location client will automatically stop updates after the request expires. + *

+ * The duration includes suspend time. Values before {@link SystemClock#elapsedRealtime()} are + * allowed, but indicate that the request has already expired. + * + * @param millis expiration time of request, in milliseconds since boot including suspend + * @return the same object, so that setters can be chained + */ + public LocationRequest setExpirationTime(long millis) { + expirationTime = millis; + return this; + } + + /** + * Explicitly set the fastest interval for location updates, in milliseconds. + *

+ * This controls the fastest rate at which your application will receive location updates, + * which might be faster than {@link #setInterval(long)} in some situations (for example, if + * other applications are triggering location updates). + *

+ * This allows your application to passively acquire locations at a rate faster than it + * actively acquires locations, saving power. + *

+ * Unlike {@link #setInterval(long)}, this parameter is exact. Your application will never + * receive updates faster than this value. + *

+ * If you don't call this method, a fastest interval will be selected for you. It will be a + * value faster than your active interval ({@link #setInterval(long)}). + *

+ * An interval of 0 is allowed, but not recommended, since location updates may be extremely + * fast on future implementations. + *

+ * If {@link #setFastestInterval(long)} is set slower than {@link #setInterval(long)}, then + * your effective fastest interval is {@link #setInterval(long)}. + * + * @param millis fastest interval for updates in milliseconds, exact + * @return the same object, so that setters can be chained + * @throws IllegalArgumentException if the interval is less than zero + */ + public LocationRequest setFastestInterval(long millis) throws IllegalArgumentException { + if (millis < 0) + throw new IllegalArgumentException("interval must not be negative"); + fastestInterval = millis; + return this; + } + + /** + * Set the desired interval for active location updates, in milliseconds. + *

+ * The location client will actively try to obtain location updates for your application at + * this interval, so it has a direct influence on the amount of power used by your application. + * Choose your interval wisely. + *

+ * This interval is inexact. You may not receive updates at all (if no location sources are + * available), or you may receive them slower than requested. You may also receive them faster + * than requested (if other applications are requesting location at a faster interval). The + * fastest rate that that you will receive updates can be controlled with + * {@link #setFastestInterval(long)}. By default this fastest rate is 6x the interval frequency. + *

+ * Applications with only the coarse location permission may have their interval silently + * throttled. + *

+ * An interval of 0 is allowed, but not recommended, since location updates may be extremely + * fast on future implementations. + *

+ * {@link #setPriority(int)} and {@link #setInterval(long)} are the most important parameters + * on a location request. + * + * @param millis desired interval in millisecond, inexact + * @return the same object, so that setters can be chained + * @throws IllegalArgumentException if the interval is less than zero + */ + public LocationRequest setInterval(long millis) throws IllegalArgumentException { + if (millis < 0) + throw new IllegalArgumentException("interval must not be negative"); + interval = millis; + return this; + } + + /** + * Set the number of location updates. + *

+ * By default locations are continuously updated until the request is explicitly removed, + * however you can optionally request a set number of updates. For example, if your application + * only needs a single fresh location, then call this method with a value of 1 before passing + * the request to the location client. + *

+ * When using this option care must be taken to either explicitly remove the request when no + * longer needed or to set an expiration with ({@link #setExpirationDuration(long)} or + * {@link #setExpirationTime(long)}. Otherwise in some cases if a location can't be computed, + * this request could stay active indefinitely consuming power. + * + * @param numUpdates the number of location updates requested + * @return the same object, so that setters can be chained + * @throws IllegalArgumentException if numUpdates is 0 or less + */ + public LocationRequest setNumUpdates(int numUpdates) throws IllegalArgumentException { + if (numUpdates <= 0) + throw new IllegalArgumentException("numUpdates must not be 0 or negative"); + this.numUpdates = numUpdates; + return this; + } + + /** + * Set the priority of the request. + *

+ * Use with a priority constant such as {@link #PRIORITY_HIGH_ACCURACY}. No other values are + * accepted. + *

+ * The priority of the request is a strong hint to the LocationClient for which location + * sources to use. For example, {@link #PRIORITY_HIGH_ACCURACY} is more likely to use GPS, and + * {@link #PRIORITY_BALANCED_POWER_ACCURACY} is more likely to use WIFI & Cell tower + * positioning, but it also depends on many other factors (such as which sources are available) + * and is implementation dependent. + *

+ * {@link #setPriority(int)} and {@link #setInterval(long)} are the most important parameters + * on a location request. + * + * @param priority an accuracy or power constant + * @return the same object, so that setters can be chained + * @throws IllegalArgumentException if the quality constant is not valid + */ + public LocationRequest setPriority(int priority) { + switch (priority) { + default: + throw new IllegalArgumentException("priority is not a known constant"); + case PRIORITY_BALANCED_POWER_ACCURACY: + case PRIORITY_HIGH_ACCURACY: + case PRIORITY_LOW_POWER: + case PRIORITY_NO_POWER: + this.priority = priority; + } + return this; + } + + /** + * Set the minimum displacement between location updates in meters + *

+ * By default this is 0. + * + * @param smallestDisplacementMeters the smallest displacement in meters the user must move + * between location updates. + * @return the same object, so that setters can be chained + * @throws IllegalArgumentException if smallestDisplacementMeters is negative + */ + public LocationRequest setSmallestDesplacement(float smallestDisplacementMeters) { + if (smallestDisplacementMeters < 0) + throw new IllegalArgumentException("smallestDisplacementMeters must not be negative"); + this.smallestDesplacement = smallestDisplacementMeters; + return this; + } + + @Override + public String toString() { + // TODO + return super.toString(); + } + + @Override + public void writeToParcel(Parcel out, int flags) { + SafeParcelUtil.writeObject(this, out, flags); + } + + public static final Creator CREATOR = new Creator() { + @Override + public LocationRequest createFromParcel(Parcel parcel) { + return new LocationRequest(parcel); + } + + @Override + public LocationRequest[] newArray(int i) { + return new LocationRequest[i]; + } + }; +} diff --git a/src/com/google/android/gms/location/LocationStatus.aidl b/src/com/google/android/gms/location/LocationStatus.aidl new file mode 100644 index 00000000..398d9c18 --- /dev/null +++ b/src/com/google/android/gms/location/LocationStatus.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.location; + +parcelable LocationStatus; diff --git a/src/com/google/android/gms/location/LocationStatus.java b/src/com/google/android/gms/location/LocationStatus.java new file mode 100644 index 00000000..4009e57f --- /dev/null +++ b/src/com/google/android/gms/location/LocationStatus.java @@ -0,0 +1,103 @@ +package com.google.android.gms.location; + +import android.os.Parcel; +import org.microg.safeparcel.SafeParcelUtil; +import org.microg.safeparcel.SafeParcelable; +import org.microg.safeparcel.SafeParceled; + +import java.util.Arrays; + +public class LocationStatus implements SafeParcelable { + public static final int STATUS_SUCCESSFUL = 0; + public static final int STATUS_UNKNOWN = 1; + public static final int STATUS_TIMED_OUT_ON_SCAN = 2; + public static final int STATUS_NO_INFO_IN_DATABASE = 3; + public static final int STATUS_INVALID_SCAN = 4; + public static final int STATUS_UNABLE_TO_QUERY_DATABASE = 5; + public static final int STATUS_SCANS_DISABLED_IN_SETTINGS = 6; + public static final int STATUS_LOCATION_DISABLED_IN_SETTINGS = 7; + public static final int STATUS_IN_PROGRESS = 8; + @SafeParceled(1000) + private final int versionCode; + @SafeParceled(1) + int cellStatus; + @SafeParceled(2) + int wifiStatus; + @SafeParceled(3) + long elapsedRealtimeNanos; + + private LocationStatus(Parcel in) { + versionCode = 1; + SafeParcelUtil.readObject(this, in); + } + + @Override + public int describeContents() { + return 0; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; + + LocationStatus that = (LocationStatus) o; + + if (cellStatus != that.cellStatus) + return false; + if (elapsedRealtimeNanos != that.elapsedRealtimeNanos) + return false; + if (wifiStatus != that.wifiStatus) + return false; + + return true; + } + + @Override + public int hashCode() { + return Arrays.hashCode(new Object[] { cellStatus, wifiStatus, elapsedRealtimeNanos }); + } + + private String statusToString(int status) { + switch (status) { + case STATUS_SUCCESSFUL: + return "STATUS_SUCCESSFUL"; + case STATUS_UNKNOWN: + default: + return "STATUS_UNKNOWN"; + case STATUS_TIMED_OUT_ON_SCAN: + return "STATUS_TIMED_OUT_ON_SCAN"; + case STATUS_NO_INFO_IN_DATABASE: + return "STATUS_NO_INFO_IN_DATABASE"; + case STATUS_INVALID_SCAN: + return "STATUS_INVALID_SCAN"; + case STATUS_UNABLE_TO_QUERY_DATABASE: + return "STATUS_UNABLE_TO_QUERY_DATABASE"; + case STATUS_SCANS_DISABLED_IN_SETTINGS: + return "STATUS_SCANS_DISABLED_IN_SETTINGS"; + case STATUS_LOCATION_DISABLED_IN_SETTINGS: + return "STATUS_LOCATION_DISABLED_IN_SETTINGS"; + case STATUS_IN_PROGRESS: + return "STATUS_IN_PROGRESS"; + } + } + + @Override + public void writeToParcel(Parcel out, int flags) { + SafeParcelUtil.writeObject(this, out, flags); + } + + public static final Creator CREATOR = new Creator() { + @Override + public LocationStatus createFromParcel(Parcel parcel) { + return new LocationStatus(parcel); + } + + @Override + public LocationStatus[] newArray(int i) { + return new LocationStatus[i]; + } + }; +} diff --git a/src/com/google/android/gms/location/internal/ClientIdentity.java b/src/com/google/android/gms/location/internal/ClientIdentity.java new file mode 100644 index 00000000..afb034ba --- /dev/null +++ b/src/com/google/android/gms/location/internal/ClientIdentity.java @@ -0,0 +1,4 @@ +package com.google.android.gms.location.internal; + +public class ClientIdentity { +} diff --git a/src/com/google/android/gms/location/internal/IGoogleLocationManagerService.aidl b/src/com/google/android/gms/location/internal/IGoogleLocationManagerService.aidl index c461587d..295de798 100644 --- a/src/com/google/android/gms/location/internal/IGoogleLocationManagerService.aidl +++ b/src/com/google/android/gms/location/internal/IGoogleLocationManagerService.aidl @@ -1,8 +1,60 @@ package com.google.android.gms.location.internal; +import com.google.android.gms.location.places.AutocompleteFilter; +import com.google.android.gms.location.places.internal.IPlacesCallbacks; +import com.google.android.gms.location.internal.LocationRequestInternal; +import com.google.android.gms.location.places.NearbyAlertRequest; +import com.google.android.gms.location.places.PlaceFilter; +import com.google.android.gms.location.places.PlaceRequest; +import com.google.android.gms.location.places.PlaceReport; +import com.google.android.gms.location.places.internal.PlacesParams; +import com.google.android.gms.location.places.UserAddedPlace; +import com.google.android.gms.location.places.UserDataType; import com.google.android.gms.location.Geofence; +import com.google.android.gms.location.GeofencingRequest; +import com.google.android.gms.location.LocationRequest; +import com.google.android.gms.location.LocationStatus; import com.google.android.gms.location.internal.IGeofencerCallbacks; +import com.google.android.gms.location.internal.ILocationListener; +import com.google.android.gms.maps.model.LatLng; +import com.google.android.gms.maps.model.LatLngBounds; interface IGoogleLocationManagerService { - void addGeofences(in List geofences, in PendingIntent pendingIntent, IGeofencerCallbacks callback, String str); + void addGeofencesList(in List geofences, in PendingIntent pendingIntent, IGeofencerCallbacks callbacks, String packageName) = 0; + void removeGeofencesByIntent(in PendingIntent pendingIntent, IGeofencerCallbacks callbacks, String packageName) = 1; + void removeGeofencesById(in String[] geofenceRequestIds, IGeofencerCallbacks callbacks, String packageName) = 2; + void iglms4(IGeofencerCallbacks callbacks, String packageName) = 3; + void requestActivityUpdates(long detectionIntervalMillis, boolean alwaysTrue, in PendingIntent callbackIntent) = 4; + void removeActivityUpdates(in PendingIntent callbackIntent) = 5; + Location getLastLocation() = 6; + void requestLocationUpdatesWithListener(in LocationRequest request, ILocationListener listener) = 7; + void requestLocationUpdatesWithIntent(in LocationRequest request, in PendingIntent callbackIntent) = 8; + void removeLocationUpdatesWithListener(ILocationListener listener) = 9; // TODO + void removeLocationUpdatesWithIntent(in PendingIntent callbackIntent) = 11; + void setMockMode(boolean mockMode) = 12; + void setMockLocation(in Location mockLocation) = 13; + void iglms14(in LatLngBounds var1, int var2, in PlaceFilter var3, in PlacesParams var4, IPlacesCallbacks var5) = 14; + void iglms15(String var1, in PlacesParams var2, IPlacesCallbacks var3) = 15; + void iglms16(in LatLng var1, in PlaceFilter var2, in PlacesParams var3, IPlacesCallbacks var4) = 16; + void iglms17(in PlaceFilter var1, in PlacesParams var2, IPlacesCallbacks var3) = 17; + void iglms18(in PlaceRequest var1, in PlacesParams var2, in PendingIntent var3) = 18; + void iglms19(in PlacesParams var1, in PendingIntent var2) = 19; + void requestLocationUpdates(in LocationRequest request, ILocationListener listener, String packageName) = 20; + Location getLastLocationWithPackage(String packageName) = 21; + void iglms25(in PlaceReport var1, in PlacesParams var2) = 25; + void iglms26(in Location var1, int var2) = 26; + LocationStatus iglms34(String var1) = 34; + void iglms42(String var1, in PlacesParams var2, IPlacesCallbacks var3) = 42; + void iglms46(in UserAddedPlace var1, in PlacesParams var2, IPlacesCallbacks var3) = 46; + void iglms47(in LatLngBounds var1, int var2, String var3, in PlaceFilter var4, in PlacesParams var5, IPlacesCallbacks var6) = 47; + void iglms48(in NearbyAlertRequest var1, in PlacesParams var2, in PendingIntent var3) = 48; + void iglms49(in PlacesParams var1, in PendingIntent var2) = 49; + void iglms50(in UserDataType var1, in LatLngBounds var2, in List var3, in PlacesParams var4, IPlacesCallbacks var5) = 50; + IBinder iglms51() = 51; + void requestLocationUpdatesInternalWithListener(in LocationRequestInternal request, ILocationListener listener) = 52; + void requestLocationUpdatesInternalWithIntent(in LocationRequestInternal request, in PendingIntent callbackIntent) = 53; + IBinder iglms54() = 54; + void iglms55(String var1, in LatLngBounds var2, in AutocompleteFilter var3, in PlacesParams var4, IPlacesCallbacks var5) = 55; + void addGeofences(in GeofencingRequest geofencingRequest, in PendingIntent pendingIntent, IGeofencerCallbacks callbacks) = 57; + void iglms58(in List var1, in PlacesParams var2, IPlacesCallbacks var3) = 58; } diff --git a/src/com/google/android/gms/location/internal/ILocationListener.aidl b/src/com/google/android/gms/location/internal/ILocationListener.aidl new file mode 100644 index 00000000..055d6fdf --- /dev/null +++ b/src/com/google/android/gms/location/internal/ILocationListener.aidl @@ -0,0 +1,7 @@ +package com.google.android.gms.location.internal; + +import android.location.Location; + +interface ILocationListener { + void onLocationChanged(in Location location); +} diff --git a/src/com/google/android/gms/location/internal/LocationRequestInternal.aidl b/src/com/google/android/gms/location/internal/LocationRequestInternal.aidl new file mode 100644 index 00000000..4604714a --- /dev/null +++ b/src/com/google/android/gms/location/internal/LocationRequestInternal.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.location.internal; + +parcelable LocationRequestInternal; diff --git a/src/com/google/android/gms/location/internal/LocationRequestInternal.java b/src/com/google/android/gms/location/internal/LocationRequestInternal.java new file mode 100644 index 00000000..8ae27697 --- /dev/null +++ b/src/com/google/android/gms/location/internal/LocationRequestInternal.java @@ -0,0 +1,37 @@ +package com.google.android.gms.location.internal; + +import android.os.Parcel; +import android.os.Parcelable; +import org.microg.safeparcel.SafeParcelUtil; +import org.microg.safeparcel.SafeParcelable; + +/** + * TODO: usage + */ +public class LocationRequestInternal implements SafeParcelable { + private LocationRequestInternal(Parcel in) { + SafeParcelUtil.readObject(this, in); + } + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel out, int flags) { + SafeParcelUtil.writeObject(this, out, flags); + } + + public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { + @Override + public LocationRequestInternal createFromParcel(Parcel parcel) { + return new LocationRequestInternal(parcel); + } + + @Override + public LocationRequestInternal[] newArray(int i) { + return new LocationRequestInternal[i]; + } + }; +} diff --git a/src/com/google/android/gms/location/places/AutocompleteFilter.aidl b/src/com/google/android/gms/location/places/AutocompleteFilter.aidl new file mode 100644 index 00000000..10b7539c --- /dev/null +++ b/src/com/google/android/gms/location/places/AutocompleteFilter.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.location.places; + +parcelable AutocompleteFilter; diff --git a/src/com/google/android/gms/location/places/AutocompleteFilter.java b/src/com/google/android/gms/location/places/AutocompleteFilter.java new file mode 100644 index 00000000..86847d4e --- /dev/null +++ b/src/com/google/android/gms/location/places/AutocompleteFilter.java @@ -0,0 +1,46 @@ +package com.google.android.gms.location.places; + +import android.os.Parcel; +import org.microg.safeparcel.SafeParcelUtil; +import org.microg.safeparcel.SafeParcelable; +import org.microg.safeparcel.SafeParceled; + +/** + * TODO usage + */ +public class AutocompleteFilter implements SafeParcelable { + + @SafeParceled(1000) + private final int versionCode; + + private AutocompleteFilter() { + this.versionCode = 1; + } + + private AutocompleteFilter(Parcel in) { + this(); + SafeParcelUtil.readObject(this, in); + } + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel out, int flags) { + SafeParcelUtil.writeObject(this, out, flags); + } + + public static final Creator CREATOR = new Creator() { + @Override + public AutocompleteFilter createFromParcel(Parcel parcel) { + return new AutocompleteFilter(parcel); + } + + @Override + public AutocompleteFilter[] newArray(int i) { + return new AutocompleteFilter[i]; + } + }; +} diff --git a/src/com/google/android/gms/location/places/NearbyAlertRequest.aidl b/src/com/google/android/gms/location/places/NearbyAlertRequest.aidl new file mode 100644 index 00000000..b34605c8 --- /dev/null +++ b/src/com/google/android/gms/location/places/NearbyAlertRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.location.places; + +parcelable NearbyAlertRequest; diff --git a/src/com/google/android/gms/location/places/NearbyAlertRequest.java b/src/com/google/android/gms/location/places/NearbyAlertRequest.java new file mode 100644 index 00000000..0650e462 --- /dev/null +++ b/src/com/google/android/gms/location/places/NearbyAlertRequest.java @@ -0,0 +1,36 @@ +package com.google.android.gms.location.places; + +import android.os.Parcel; +import org.microg.safeparcel.SafeParcelUtil; +import org.microg.safeparcel.SafeParcelable; + +/** + * TODO: usage + */ +public class NearbyAlertRequest implements SafeParcelable { + private NearbyAlertRequest(Parcel in) { + SafeParcelUtil.readObject(this, in); + } + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel out, int flags) { + SafeParcelUtil.writeObject(this, out, flags); + } + + public static final Creator CREATOR = new Creator() { + @Override + public NearbyAlertRequest createFromParcel(Parcel parcel) { + return new NearbyAlertRequest(parcel); + } + + @Override + public NearbyAlertRequest[] newArray(int i) { + return new NearbyAlertRequest[i]; + } + }; +} diff --git a/src/com/google/android/gms/location/places/PlaceFilter.aidl b/src/com/google/android/gms/location/places/PlaceFilter.aidl new file mode 100644 index 00000000..07a4eec6 --- /dev/null +++ b/src/com/google/android/gms/location/places/PlaceFilter.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.location.places; + +parcelable PlaceFilter; diff --git a/src/com/google/android/gms/location/places/PlaceFilter.java b/src/com/google/android/gms/location/places/PlaceFilter.java new file mode 100644 index 00000000..d13849b8 --- /dev/null +++ b/src/com/google/android/gms/location/places/PlaceFilter.java @@ -0,0 +1,37 @@ +package com.google.android.gms.location.places; + +import android.os.Parcel; +import org.microg.safeparcel.SafeParcelUtil; +import org.microg.safeparcel.SafeParcelable; + +/** + * TODO: usage + */ +public class PlaceFilter implements SafeParcelable { + + private PlaceFilter(Parcel in) { + SafeParcelUtil.readObject(this, in); + } + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel out, int flags) { + SafeParcelUtil.writeObject(this, out, flags); + } + + public static final Creator CREATOR = new Creator() { + @Override + public PlaceFilter createFromParcel(Parcel parcel) { + return new PlaceFilter(parcel); + } + + @Override + public PlaceFilter[] newArray(int i) { + return new PlaceFilter[i]; + } + }; +} diff --git a/src/com/google/android/gms/location/places/PlaceReport.aidl b/src/com/google/android/gms/location/places/PlaceReport.aidl new file mode 100644 index 00000000..993899de --- /dev/null +++ b/src/com/google/android/gms/location/places/PlaceReport.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.location.places; + +parcelable PlaceReport; diff --git a/src/com/google/android/gms/location/places/PlaceReport.java b/src/com/google/android/gms/location/places/PlaceReport.java new file mode 100644 index 00000000..8fd57f86 --- /dev/null +++ b/src/com/google/android/gms/location/places/PlaceReport.java @@ -0,0 +1,38 @@ +package com.google.android.gms.location.places; + +import android.os.Parcel; +import android.os.Parcelable; +import org.microg.safeparcel.SafeParcelUtil; +import org.microg.safeparcel.SafeParcelable; + +/** + * TODO: usage + */ +public class PlaceReport implements SafeParcelable { + + private PlaceReport(Parcel in) { + SafeParcelUtil.readObject(this, in); + } + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel out, int flags) { + SafeParcelUtil.writeObject(this, out, flags); + } + + public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { + @Override + public PlaceReport createFromParcel(Parcel parcel) { + return new PlaceReport(parcel); + } + + @Override + public PlaceReport[] newArray(int i) { + return new PlaceReport[i]; + } + }; +} diff --git a/src/com/google/android/gms/location/places/PlaceRequest.aidl b/src/com/google/android/gms/location/places/PlaceRequest.aidl new file mode 100644 index 00000000..8de920ef --- /dev/null +++ b/src/com/google/android/gms/location/places/PlaceRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.location.places; + +parcelable PlaceRequest; diff --git a/src/com/google/android/gms/location/places/PlaceRequest.java b/src/com/google/android/gms/location/places/PlaceRequest.java new file mode 100644 index 00000000..0960bdcb --- /dev/null +++ b/src/com/google/android/gms/location/places/PlaceRequest.java @@ -0,0 +1,36 @@ +package com.google.android.gms.location.places; + +import android.os.Parcel; +import org.microg.safeparcel.SafeParcelUtil; +import org.microg.safeparcel.SafeParcelable; + +/** + * TODO: usage + */ +public class PlaceRequest implements SafeParcelable { + private PlaceRequest(Parcel in) { + SafeParcelUtil.readObject(this, in); + } + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel out, int flags) { + SafeParcelUtil.writeObject(this, out, flags); + } + + public static final Creator CREATOR = new Creator() { + @Override + public PlaceRequest createFromParcel(Parcel parcel) { + return new PlaceRequest(parcel); + } + + @Override + public PlaceRequest[] newArray(int i) { + return new PlaceRequest[i]; + } + }; +} diff --git a/src/com/google/android/gms/location/places/UserAddedPlace.aidl b/src/com/google/android/gms/location/places/UserAddedPlace.aidl new file mode 100644 index 00000000..aa543a60 --- /dev/null +++ b/src/com/google/android/gms/location/places/UserAddedPlace.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.location.places; + +parcelable UserAddedPlace; diff --git a/src/com/google/android/gms/location/places/UserAddedPlace.java b/src/com/google/android/gms/location/places/UserAddedPlace.java new file mode 100644 index 00000000..5f83f528 --- /dev/null +++ b/src/com/google/android/gms/location/places/UserAddedPlace.java @@ -0,0 +1,46 @@ +package com.google.android.gms.location.places; + +import android.os.Parcel; +import org.microg.safeparcel.SafeParcelUtil; +import org.microg.safeparcel.SafeParcelable; +import org.microg.safeparcel.SafeParceled; + +/** + * TODO: usage + */ +public class UserAddedPlace implements SafeParcelable { + + @SafeParceled(1000) + private final int versionCode; + + private UserAddedPlace() { + versionCode = -1; + } + + private UserAddedPlace(Parcel in) { + this(); + SafeParcelUtil.readObject(this, in); + } + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel out, int flags) { + SafeParcelUtil.writeObject(this, out, flags); + } + + public static final Creator CREATOR = new Creator() { + @Override + public UserAddedPlace createFromParcel(Parcel parcel) { + return new UserAddedPlace(parcel); + } + + @Override + public UserAddedPlace[] newArray(int i) { + return new UserAddedPlace[i]; + } + }; +} diff --git a/src/com/google/android/gms/location/places/UserDataType.aidl b/src/com/google/android/gms/location/places/UserDataType.aidl new file mode 100644 index 00000000..503493a3 --- /dev/null +++ b/src/com/google/android/gms/location/places/UserDataType.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.location.places; + +parcelable UserDataType; diff --git a/src/com/google/android/gms/location/places/UserDataType.java b/src/com/google/android/gms/location/places/UserDataType.java new file mode 100644 index 00000000..858d3f0c --- /dev/null +++ b/src/com/google/android/gms/location/places/UserDataType.java @@ -0,0 +1,36 @@ +package com.google.android.gms.location.places; + +import android.os.Parcel; +import org.microg.safeparcel.SafeParcelUtil; +import org.microg.safeparcel.SafeParcelable; + +/** + * TODO: usage + */ +public class UserDataType implements SafeParcelable { + private UserDataType(Parcel in) { + SafeParcelUtil.readObject(this, in); + } + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel out, int flags) { + SafeParcelUtil.writeObject(this, out, flags); + } + + public static final Creator CREATOR = new Creator() { + @Override + public UserDataType createFromParcel(Parcel parcel) { + return new UserDataType(parcel); + } + + @Override + public UserDataType[] newArray(int i) { + return new UserDataType[i]; + } + }; +} diff --git a/src/com/google/android/gms/location/places/internal/IPlacesCallbacks.aidl b/src/com/google/android/gms/location/places/internal/IPlacesCallbacks.aidl new file mode 100644 index 00000000..6e912606 --- /dev/null +++ b/src/com/google/android/gms/location/places/internal/IPlacesCallbacks.aidl @@ -0,0 +1,9 @@ +package com.google.android.gms.location.places.internal; + +import com.google.android.gms.common.data.DataHolder; + +interface IPlacesCallbacks { + void X(in DataHolder dataHolder); + void Y(in DataHolder dataHolder); + void Z(in DataHolder dataHolder); +} diff --git a/src/com/google/android/gms/location/places/internal/PlacesParams.aidl b/src/com/google/android/gms/location/places/internal/PlacesParams.aidl new file mode 100644 index 00000000..fa569540 --- /dev/null +++ b/src/com/google/android/gms/location/places/internal/PlacesParams.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.location.places.internal; + +parcelable PlacesParams; diff --git a/src/com/google/android/gms/location/places/internal/PlacesParams.java b/src/com/google/android/gms/location/places/internal/PlacesParams.java new file mode 100644 index 00000000..956c99da --- /dev/null +++ b/src/com/google/android/gms/location/places/internal/PlacesParams.java @@ -0,0 +1,52 @@ +package com.google.android.gms.location.places.internal; + +import android.os.Parcel; +import org.microg.safeparcel.SafeParcelUtil; +import org.microg.safeparcel.SafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class PlacesParams implements SafeParcelable { + + @SafeParceled(1000) + private final int versionCode; + @SafeParceled(1) + public final String clientPackageName; + @SafeParceled(2) + public final String locale; + @SafeParceled(3) + public final String accountName; + @SafeParceled(4) + public final String gCoreClientName; + + private PlacesParams() { + versionCode = -1; + clientPackageName = locale = accountName = gCoreClientName = null; + } + + private PlacesParams(Parcel in) { + this(); + SafeParcelUtil.readObject(this, in); + } + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel out, int flags) { + SafeParcelUtil.writeObject(this, out, flags); + } + + public static final Creator CREATOR = new Creator() { + @Override + public PlacesParams createFromParcel(Parcel parcel) { + return new PlacesParams(parcel); + } + + @Override + public PlacesParams[] newArray(int i) { + return new PlacesParams[i]; + } + }; +} diff --git a/src/com/google/android/gms/maps/StreetViewPanoramaOptions.java b/src/com/google/android/gms/maps/StreetViewPanoramaOptions.java new file mode 100644 index 00000000..3d1810c4 --- /dev/null +++ b/src/com/google/android/gms/maps/StreetViewPanoramaOptions.java @@ -0,0 +1,4 @@ +package com.google.android.gms.maps; + +public class StreetViewPanoramaOptions { +} diff --git a/src/com/google/android/gms/maps/internal/Point.java b/src/com/google/android/gms/maps/internal/Point.java new file mode 100644 index 00000000..43ada12e --- /dev/null +++ b/src/com/google/android/gms/maps/internal/Point.java @@ -0,0 +1,4 @@ +package com.google.android.gms.maps.internal; + +public class Point { +} diff --git a/src/com/google/android/gms/maps/model/StreetViewPanoramaCamera.java b/src/com/google/android/gms/maps/model/StreetViewPanoramaCamera.java new file mode 100644 index 00000000..534d8144 --- /dev/null +++ b/src/com/google/android/gms/maps/model/StreetViewPanoramaCamera.java @@ -0,0 +1,4 @@ +package com.google.android.gms.maps.model; + +public class StreetViewPanoramaCamera { +} diff --git a/src/com/google/android/gms/maps/model/StreetViewPanoramaLink.java b/src/com/google/android/gms/maps/model/StreetViewPanoramaLink.java new file mode 100644 index 00000000..66859e08 --- /dev/null +++ b/src/com/google/android/gms/maps/model/StreetViewPanoramaLink.java @@ -0,0 +1,4 @@ +package com.google.android.gms.maps.model; + +public class StreetViewPanoramaLink { +} diff --git a/src/com/google/android/gms/maps/model/StreetViewPanoramaLocation.java b/src/com/google/android/gms/maps/model/StreetViewPanoramaLocation.java new file mode 100644 index 00000000..8ef5fda7 --- /dev/null +++ b/src/com/google/android/gms/maps/model/StreetViewPanoramaLocation.java @@ -0,0 +1,4 @@ +package com.google.android.gms.maps.model; + +public class StreetViewPanoramaLocation { +} diff --git a/src/com/google/android/gms/maps/model/StreetViewPanoramaOrientation.java b/src/com/google/android/gms/maps/model/StreetViewPanoramaOrientation.java new file mode 100644 index 00000000..285c0617 --- /dev/null +++ b/src/com/google/android/gms/maps/model/StreetViewPanoramaOrientation.java @@ -0,0 +1,4 @@ +package com.google.android.gms.maps.model; + +public class StreetViewPanoramaOrientation { +} diff --git a/src/com/google/android/gms/plus/internal/PlusCommonExtras.java b/src/com/google/android/gms/plus/internal/PlusCommonExtras.java new file mode 100644 index 00000000..b8735781 --- /dev/null +++ b/src/com/google/android/gms/plus/internal/PlusCommonExtras.java @@ -0,0 +1,4 @@ +package com.google.android.gms.plus.internal; + +public class PlusCommonExtras { +} diff --git a/src/com/google/android/gms/plus/internal/PlusSession.java b/src/com/google/android/gms/plus/internal/PlusSession.java new file mode 100644 index 00000000..d8b6c9a1 --- /dev/null +++ b/src/com/google/android/gms/plus/internal/PlusSession.java @@ -0,0 +1,4 @@ +package com.google.android.gms.plus.internal; + +public class PlusSession { +} diff --git a/src/com/google/android/gms/plus/internal/model/smart_profile/CardsRequest.java b/src/com/google/android/gms/plus/internal/model/smart_profile/CardsRequest.java new file mode 100644 index 00000000..2237e011 --- /dev/null +++ b/src/com/google/android/gms/plus/internal/model/smart_profile/CardsRequest.java @@ -0,0 +1,4 @@ +package com.google.android.gms.plus.internal.model.smart_profile; + +public class CardsRequest { +} diff --git a/src/com/google/android/gms/plus/internal/model/smart_profile/CardsResponse.java b/src/com/google/android/gms/plus/internal/model/smart_profile/CardsResponse.java new file mode 100644 index 00000000..c6f3f23a --- /dev/null +++ b/src/com/google/android/gms/plus/internal/model/smart_profile/CardsResponse.java @@ -0,0 +1,4 @@ +package com.google.android.gms.plus.internal.model.smart_profile; + +public class CardsResponse { +} diff --git a/src/com/google/android/gms/plus/internal/model/smart_profile/PeopleForProfilesRequest.java b/src/com/google/android/gms/plus/internal/model/smart_profile/PeopleForProfilesRequest.java new file mode 100644 index 00000000..7f4374c3 --- /dev/null +++ b/src/com/google/android/gms/plus/internal/model/smart_profile/PeopleForProfilesRequest.java @@ -0,0 +1,4 @@ +package com.google.android.gms.plus.internal.model.smart_profile; + +public class PeopleForProfilesRequest { +} diff --git a/src/com/google/android/gms/plus/internal/model/smart_profile/PeopleForProfilesResponse.java b/src/com/google/android/gms/plus/internal/model/smart_profile/PeopleForProfilesResponse.java new file mode 100644 index 00000000..28bc9b79 --- /dev/null +++ b/src/com/google/android/gms/plus/internal/model/smart_profile/PeopleForProfilesResponse.java @@ -0,0 +1,4 @@ +package com.google.android.gms.plus.internal.model.smart_profile; + +public class PeopleForProfilesResponse { +} diff --git a/src/com/google/android/gms/plus/model/posts/Comment.java b/src/com/google/android/gms/plus/model/posts/Comment.java new file mode 100644 index 00000000..34b179a5 --- /dev/null +++ b/src/com/google/android/gms/plus/model/posts/Comment.java @@ -0,0 +1,4 @@ +package com.google.android.gms.plus.model.posts; + +public class Comment { +} diff --git a/src/com/google/android/gms/plus/model/posts/Post.java b/src/com/google/android/gms/plus/model/posts/Post.java new file mode 100644 index 00000000..68d73f26 --- /dev/null +++ b/src/com/google/android/gms/plus/model/posts/Post.java @@ -0,0 +1,4 @@ +package com.google.android.gms.plus.model.posts; + +public class Post { +} diff --git a/src/com/google/android/gms/plus/model/posts/Settings.java b/src/com/google/android/gms/plus/model/posts/Settings.java new file mode 100644 index 00000000..943d0ced --- /dev/null +++ b/src/com/google/android/gms/plus/model/posts/Settings.java @@ -0,0 +1,4 @@ +package com.google.android.gms.plus.model.posts; + +public class Settings { +} diff --git a/src/com/google/android/gms/wearable/ConnectionConfiguration.java b/src/com/google/android/gms/wearable/ConnectionConfiguration.java new file mode 100644 index 00000000..1539f85d --- /dev/null +++ b/src/com/google/android/gms/wearable/ConnectionConfiguration.java @@ -0,0 +1,4 @@ +package com.google.android.gms.wearable; + +public class ConnectionConfiguration { +} diff --git a/src/org/microg/gms/maps/Constants.java b/src/org/microg/gms/maps/Constants.java index 89745851..7209e500 100644 --- a/src/org/microg/gms/maps/Constants.java +++ b/src/org/microg/gms/maps/Constants.java @@ -1,6 +1,12 @@ package org.microg.gms.maps; public class Constants { + /** + * This is the highest version that was looked at during development. + * Does not necessarily mean anything. + */ + public static final int MAX_REFERENCE_VERSION = 6599436; + /** * No base map tiles. */ @@ -25,4 +31,7 @@ public class Constants { * Satellite maps with a transparent layer of major streets. */ public static final int MAP_TYPE_HYBRID = 4; + + public static final String ACTION_GMS_LOCATION_MANAGER_SERVICE_START = "com.google.android.location.internal.GoogleLocationManagerService.START"; + public static final String KEY_MOCK_LOCATION = "mockLocation"; } From d1379984a19590f736e8e4b9b4efaaa8a3bcca41 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Sun, 11 Jan 2015 17:52:29 +0100 Subject: [PATCH 007/293] Various --- .../{internal => }/ILocationListener.aidl | 2 +- .../IGoogleLocationManagerService.aidl | 58 +++++++++---------- 2 files changed, 30 insertions(+), 30 deletions(-) rename src/com/google/android/gms/location/{internal => }/ILocationListener.aidl (70%) diff --git a/src/com/google/android/gms/location/internal/ILocationListener.aidl b/src/com/google/android/gms/location/ILocationListener.aidl similarity index 70% rename from src/com/google/android/gms/location/internal/ILocationListener.aidl rename to src/com/google/android/gms/location/ILocationListener.aidl index 055d6fdf..323f9059 100644 --- a/src/com/google/android/gms/location/internal/ILocationListener.aidl +++ b/src/com/google/android/gms/location/ILocationListener.aidl @@ -1,4 +1,4 @@ -package com.google.android.gms.location.internal; +package com.google.android.gms.location; import android.location.Location; diff --git a/src/com/google/android/gms/location/internal/IGoogleLocationManagerService.aidl b/src/com/google/android/gms/location/internal/IGoogleLocationManagerService.aidl index 295de798..a60350fd 100644 --- a/src/com/google/android/gms/location/internal/IGoogleLocationManagerService.aidl +++ b/src/com/google/android/gms/location/internal/IGoogleLocationManagerService.aidl @@ -15,7 +15,7 @@ import com.google.android.gms.location.GeofencingRequest; import com.google.android.gms.location.LocationRequest; import com.google.android.gms.location.LocationStatus; import com.google.android.gms.location.internal.IGeofencerCallbacks; -import com.google.android.gms.location.internal.ILocationListener; +import com.google.android.gms.location.ILocationListener; import com.google.android.gms.maps.model.LatLng; import com.google.android.gms.maps.model.LatLngBounds; @@ -29,32 +29,32 @@ interface IGoogleLocationManagerService { Location getLastLocation() = 6; void requestLocationUpdatesWithListener(in LocationRequest request, ILocationListener listener) = 7; void requestLocationUpdatesWithIntent(in LocationRequest request, in PendingIntent callbackIntent) = 8; - void removeLocationUpdatesWithListener(ILocationListener listener) = 9; // TODO - void removeLocationUpdatesWithIntent(in PendingIntent callbackIntent) = 11; - void setMockMode(boolean mockMode) = 12; - void setMockLocation(in Location mockLocation) = 13; - void iglms14(in LatLngBounds var1, int var2, in PlaceFilter var3, in PlacesParams var4, IPlacesCallbacks var5) = 14; - void iglms15(String var1, in PlacesParams var2, IPlacesCallbacks var3) = 15; - void iglms16(in LatLng var1, in PlaceFilter var2, in PlacesParams var3, IPlacesCallbacks var4) = 16; - void iglms17(in PlaceFilter var1, in PlacesParams var2, IPlacesCallbacks var3) = 17; - void iglms18(in PlaceRequest var1, in PlacesParams var2, in PendingIntent var3) = 18; - void iglms19(in PlacesParams var1, in PendingIntent var2) = 19; - void requestLocationUpdates(in LocationRequest request, ILocationListener listener, String packageName) = 20; - Location getLastLocationWithPackage(String packageName) = 21; - void iglms25(in PlaceReport var1, in PlacesParams var2) = 25; - void iglms26(in Location var1, int var2) = 26; - LocationStatus iglms34(String var1) = 34; - void iglms42(String var1, in PlacesParams var2, IPlacesCallbacks var3) = 42; - void iglms46(in UserAddedPlace var1, in PlacesParams var2, IPlacesCallbacks var3) = 46; - void iglms47(in LatLngBounds var1, int var2, String var3, in PlaceFilter var4, in PlacesParams var5, IPlacesCallbacks var6) = 47; - void iglms48(in NearbyAlertRequest var1, in PlacesParams var2, in PendingIntent var3) = 48; - void iglms49(in PlacesParams var1, in PendingIntent var2) = 49; - void iglms50(in UserDataType var1, in LatLngBounds var2, in List var3, in PlacesParams var4, IPlacesCallbacks var5) = 50; - IBinder iglms51() = 51; - void requestLocationUpdatesInternalWithListener(in LocationRequestInternal request, ILocationListener listener) = 52; - void requestLocationUpdatesInternalWithIntent(in LocationRequestInternal request, in PendingIntent callbackIntent) = 53; - IBinder iglms54() = 54; - void iglms55(String var1, in LatLngBounds var2, in AutocompleteFilter var3, in PlacesParams var4, IPlacesCallbacks var5) = 55; - void addGeofences(in GeofencingRequest geofencingRequest, in PendingIntent pendingIntent, IGeofencerCallbacks callbacks) = 57; - void iglms58(in List var1, in PlacesParams var2, IPlacesCallbacks var3) = 58; + void removeLocationUpdatesWithListener(ILocationListener listener) = 9; + void removeLocationUpdatesWithIntent(in PendingIntent callbackIntent) = 10; + void setMockMode(boolean mockMode) = 11; + void setMockLocation(in Location mockLocation) = 12; + void iglms14(in LatLngBounds var1, int var2, in PlaceFilter var3, in PlacesParams var4, IPlacesCallbacks var5) = 13; + void iglms15(String var1, in PlacesParams var2, IPlacesCallbacks var3) = 14; + void iglms16(in LatLng var1, in PlaceFilter var2, in PlacesParams var3, IPlacesCallbacks var4) = 15; + void iglms17(in PlaceFilter var1, in PlacesParams var2, IPlacesCallbacks var3) = 16; + void iglms18(in PlaceRequest var1, in PlacesParams var2, in PendingIntent var3) = 17; + void iglms19(in PlacesParams var1, in PendingIntent var2) = 18; + void requestLocationUpdatesWithPackage(in LocationRequest request, ILocationListener listener, String packageName) = 19; + Location getLastLocationWithPackage(String packageName) = 20; + void iglms25(in PlaceReport var1, in PlacesParams var2) = 24; + void iglms26(in Location var1, int var2) = 25; + LocationStatus iglms34(String var1) = 33; + void iglms42(String var1, in PlacesParams var2, IPlacesCallbacks var3) = 41; + void iglms46(in UserAddedPlace var1, in PlacesParams var2, IPlacesCallbacks var3) = 45; + void iglms47(in LatLngBounds var1, int var2, String var3, in PlaceFilter var4, in PlacesParams var5, IPlacesCallbacks var6) = 46; + void iglms48(in NearbyAlertRequest var1, in PlacesParams var2, in PendingIntent var3) = 47; + void iglms49(in PlacesParams var1, in PendingIntent var2) = 48; + void iglms50(in UserDataType var1, in LatLngBounds var2, in List var3, in PlacesParams var4, IPlacesCallbacks var5) = 49; + IBinder iglms51() = 50; + void requestLocationUpdatesInternalWithListener(in LocationRequestInternal request, ILocationListener listener) = 51; + void requestLocationUpdatesInternalWithIntent(in LocationRequestInternal request, in PendingIntent callbackIntent) = 52; + IBinder iglms54() = 53; + void iglms55(String var1, in LatLngBounds var2, in AutocompleteFilter var3, in PlacesParams var4, IPlacesCallbacks var5) = 54; + void addGeofences(in GeofencingRequest geofencingRequest, in PendingIntent pendingIntent, IGeofencerCallbacks callbacks) = 56; + void iglms58(in List var1, in PlacesParams var2, IPlacesCallbacks var3) = 57; } From 31184fd03e862bf00dbf8e909023044bffd9dc15 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Mon, 12 Jan 2015 00:07:59 +0100 Subject: [PATCH 008/293] First snapshot --- AndroidManifest.xml | 4 + build.gradle | 29 ++ .../android/gms/common/ConnectionResult.java | 185 ++++++++ .../gms/common/GooglePlayServicesUtil.java | 81 ++++ .../google/android/gms/common/api/Api.java | 13 + .../gms/common/api/GoogleApiClient.java | 443 ++++++++++++++++++ .../android/gms/common/api/PendingResult.java | 4 + .../gms/common/api/ResultCallback.java | 4 + .../google/android/gms/common/api/Status.java | 4 + 9 files changed, 767 insertions(+) create mode 100644 AndroidManifest.xml create mode 100644 build.gradle create mode 100644 src/com/google/android/gms/common/ConnectionResult.java create mode 100644 src/com/google/android/gms/common/GooglePlayServicesUtil.java create mode 100644 src/com/google/android/gms/common/api/Api.java create mode 100644 src/com/google/android/gms/common/api/GoogleApiClient.java create mode 100644 src/com/google/android/gms/common/api/PendingResult.java create mode 100644 src/com/google/android/gms/common/api/ResultCallback.java create mode 100644 src/com/google/android/gms/common/api/Status.java diff --git a/AndroidManifest.xml b/AndroidManifest.xml new file mode 100644 index 00000000..16e3856e --- /dev/null +++ b/AndroidManifest.xml @@ -0,0 +1,4 @@ + + + + diff --git a/build.gradle b/build.gradle new file mode 100644 index 00000000..5d2d1c52 --- /dev/null +++ b/build.gradle @@ -0,0 +1,29 @@ +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:1.0.0' + } +} + +apply plugin: 'com.android.library' + +dependencies { + compile 'com.android.support:support-v4:21.0.3' + compile project(':GmsApi') +} + +android { + compileSdkVersion 21 + buildToolsVersion "21.1.2" + lintOptions.abortOnError false + + sourceSets { + main { + manifest.srcFile 'AndroidManifest.xml' + java.srcDirs = ['src'] + aidl.srcDirs = ['src'] + } + } +} diff --git a/src/com/google/android/gms/common/ConnectionResult.java b/src/com/google/android/gms/common/ConnectionResult.java new file mode 100644 index 00000000..b32466b6 --- /dev/null +++ b/src/com/google/android/gms/common/ConnectionResult.java @@ -0,0 +1,185 @@ +package com.google.android.gms.common; + +import android.app.Activity; +import android.app.PendingIntent; +import android.content.IntentSender; +import com.google.android.gms.common.api.GoogleApiClient; + +/** + * Contains all possible error codes for when a client fails to connect to Google Play services. + * These error codes are used by {@link GoogleApiClient.OnConnectionFailedListener}. + */ +public class ConnectionResult { + /** + * The connection was successful. + */ + public static final int SUCCESS = 0; + /** + * Google Play services is missing on this device. The calling activity should pass this error + * code to {@link GooglePlayServicesUtil#getErrorDialog(int, Activity, int)} to get a localized + * error dialog that will resolve the error when shown. + */ + public static final int SERVICE_MISSING = 1; + /** + * The installed version of Google Play services is out of date. The calling activity should + * pass this error code to {@link GooglePlayServicesUtil#getErrorDialog(int, Activity, int)} to + * get a localized error dialog that will resolve the error when shown. + */ + public static final int SERVICE_VERSION_UPDATE_REQUIRED = 2; + /** + * The installed version of Google Play services has been disabled on this device. The calling + * activity should pass this error code to + * {@link GooglePlayServicesUtil#getErrorDialog(int, Activity, int)} to get a localized error + * dialog that will resolve the error when shown. + */ + public static final int SERVICE_DISABLED = 3; + /** + * The client attempted to connect to the service but the user is not signed in. The client may + * choose to continue without using the API or it may call + * {@link #startResolutionForResult(Activity, int)} to prompt the user to sign in. After the + * sign in activity returns with {@link Activity#RESULT_OK} further attempts to connect should + * succeed. + */ + public static final int SIGN_IN_REQUIRED = 4; + /** + * The client attempted to connect to the service with an invalid account name specified. + */ + public static final int INVALID_ACCOUNT = 5; + /** + * Completing the connection requires some form of resolution. A resolution will be available + * to be started with {@link #startResolutionForResult(Activity, int)}. If the result returned + * is {@link Activity#RESULT_OK}, then further attempts to connect should either complete or + * continue on to the next issue that needs to be resolved. + */ + public static final int RESOLUTION_REQUIRED = 6; + /** + * A network error occurred. Retrying should resolve the problem. + */ + public static final int NETWORK_ERROR = 7; + /** + * An internal error occurred. Retrying should resolve the problem. + */ + public static final int INTERNAL_ERROR = 8; + /** + * The version of the Google Play services installed on this device is not authentic. + */ + public static final int SERVICE_INVALID = 9; + /** + * The application is misconfigured. This error is not recoverable and will be treated as + * fatal. The developer should look at the logs after this to determine more actionable + * information. + */ + public static final int DEVELOPER_ERROR = 10; + /** + * The application is not licensed to the user. This error is not recoverable and will be + * treated as fatal. + */ + public static final int LICENSE_CHECK_FAILED = 11; + /** + * The client canceled the connection by calling {@link GoogleApiClient#disconnect()}. + * Only returned by {@link GoogleApiClient#blockingConnect()}. + */ + public static final int CANCELED = 13; + /** + * The timeout was exceeded while waiting for the connection to complete. Only returned by + * {@link GoogleApiClient#blockingConnect()}. + */ + public static final int TIMEOUT = 14; + /** + * An interrupt occurred while waiting for the connection complete. Only returned by + * {@link GoogleApiClient#blockingConnect()}. + */ + public static final int INTERRUPTED = 15; + /** + * One of the API components you attempted to connect to is not available. The API will not + * work on this device, and updating Google Play services will not likely solve the problem. + * Using the API on the device should be avoided. + */ + public static final int API_UNAVAILABLE = 16; + + /** + * The Drive API requires external storage (such as an SD card), but no external storage is + * mounted. This error is recoverable if the user installs external storage (if none is + * present) and ensures that it is mounted (which may involve disabling USB storage mode, + * formatting the storage, or other initialization as required by the device). + *

+ * This error should never be returned on a device with emulated external storage. On devices + * with emulated external storage, the emulated "external storage" is always present regardless + * of whether the device also has removable storage. + */ + @Deprecated + public static final int DRIVE_EXTERNAL_STORAGE_REQUIRED = 1500; + + private final PendingIntent pendingIntent; + private final int statusCode; + + /** + * Creates a connection result. + * + * @param statusCode The status code. + * @param pendingIntent A pending intent that will resolve the issue when started, or null. + */ + public ConnectionResult(int statusCode, PendingIntent pendingIntent) { + this.statusCode = statusCode; + this.pendingIntent = pendingIntent; + } + + /** + * Indicates the type of error that interrupted connection. + * + * @return the error code, or {@link #SUCCESS} if no error occurred. + */ + public int getErrorCode() { + return this.statusCode; + } + + /** + * A pending intent to resolve the connection failure. This intent can be started with + * {@link Activity#startIntentSenderForResult(IntentSender, int, Intent, int, int, int)} to + * present UI to solve the issue. + * + * @return The pending intent to resolve the connection failure. + */ + public PendingIntent getResolution() { + return this.pendingIntent; + } + + /** + * Returns {@code true} if calling {@link #startResolutionForResult(Activity, int)} will start + * any intents requiring user interaction. + * + * @return {@code true} if there is a resolution that can be started. + */ + public boolean hasResolution() { + return statusCode != 0 && pendingIntent != null; + } + + /** + * Returns {@code true} if the connection was successful. + * + * @return {@code true} if the connection was successful, {@code false} if there was an error. + */ + public boolean isSuccess() { + return this.statusCode == 0; + } + + /** + * Resolves an error by starting any intents requiring user interaction. See + * {@link #SIGN_IN_REQUIRED}, and {@link #RESOLUTION_REQUIRED}. + * + * @param activity An Activity context to use to resolve the issue. The activity's + * {@link Activity#onActivityResult} method will be invoked after the user + * is done. If the resultCode is {@link Activity#RESULT_OK}, the application + * should try to connect again. + * @param requestCode The request code to pass to {@link Activity#onActivityResult}. + * @throws IntentSender.SendIntentException If the resolution intent has been canceled or is no + * longer able to execute the request. + */ + public void startResolutionForResult(Activity activity, int requestCode) throws + IntentSender.SendIntentException { + if (hasResolution()) { + activity.startIntentSenderForResult(pendingIntent.getIntentSender(), requestCode, null, + 0, 0, 0); + } + } +} diff --git a/src/com/google/android/gms/common/GooglePlayServicesUtil.java b/src/com/google/android/gms/common/GooglePlayServicesUtil.java new file mode 100644 index 00000000..c4d83b21 --- /dev/null +++ b/src/com/google/android/gms/common/GooglePlayServicesUtil.java @@ -0,0 +1,81 @@ +package com.google.android.gms.common; + +import android.app.Activity; +import android.app.Dialog; +import android.app.Fragment; +import android.app.PendingIntent; +import android.content.Context; +import android.content.DialogInterface; +import android.content.pm.PackageManager; +import org.microg.gms.Constants; + +/** + * Utility class for verifying that the Google Play services APK is available and up-to-date on + * this device. The same checks are performed if one uses {@link AdvertisingIdClient} or + * {@link GoogleAuthUtil} to connect to the service. + *

+ * TODO: methods :) + */ +public class GooglePlayServicesUtil { + public static final String GMS_ERROR_DIALOG = "GooglePlayServicesErrorDialog"; + public static final String GOOGLE_PLAY_SERVICES_PACKAGE = "com.google.android.gms"; + public static final int GOOGLE_PLAY_SERVICES_VERSION_CODE = Constants.MAX_REFERENCE_VERSION; + public static final String GOOGLE_PLAY_STORE_PACKAGE = "com.android.vending"; + + public static Dialog getErrorDialog(int errorCode, Activity activity, int requestCode) { + return null; // TODO + } + + public static Dialog getErrorDialog(int errorCode, Activity activity, int requestCode, + DialogInterface.OnCancelListener cancelListener) { + return null; // TODO + } + + public static PendingIntent getErrorPendingIntent(int errorCode, Activity activity, + int requestCode) { + return null; // TODO + } + + public static String getErrorString(int errorCode) { + return null; // TODO + } + + public static String getOpenSourceSoftwareLicenseInfo(Context context) { + return null; // TODO + } + + public static Context getRemoteContext(Context context) { + return null; // TODO + } + + public static int isGooglePlayServicesAvailable(Context context) { + return 0; // TODO + } + + public static boolean isGoogleSignedUid(PackageManager packageManager, int uid) { + return false; // TODO + } + + public static boolean isUserRecoverableError(int errorCode) { + return false; // TODO + } + + public static boolean showErrorDialogFragment(int errorCode, Activity activity, + int requestCode) { + return false; // TODO + } + + public static boolean showErrorDialogFragment(int errorCode, Activity activity, + Fragment fragment, int requestCode, DialogInterface.OnCancelListener cancelListener) { + return false; // TODO + } + + public static boolean showErrorDialogFragment(int errorCode, Activity activity, int requestCode, + DialogInterface.OnCancelListener cancelListener) { + return false; // TODO + } + + public static void showErrorNotification(int errorCode, Context context) { + // TODO + } +} diff --git a/src/com/google/android/gms/common/api/Api.java b/src/com/google/android/gms/common/api/Api.java new file mode 100644 index 00000000..6560e667 --- /dev/null +++ b/src/com/google/android/gms/common/api/Api.java @@ -0,0 +1,13 @@ +package com.google.android.gms.common.api; + +public class Api { + + public interface ApiOptions { + public interface HasOptions extends ApiOptions { + + } + public interface NotRequiredOptions extends ApiOptions { + + } + } +} diff --git a/src/com/google/android/gms/common/api/GoogleApiClient.java b/src/com/google/android/gms/common/api/GoogleApiClient.java new file mode 100644 index 00000000..a6029a6d --- /dev/null +++ b/src/com/google/android/gms/common/api/GoogleApiClient.java @@ -0,0 +1,443 @@ +package com.google.android.gms.common.api; + +import android.app.Activity; +import android.content.Context; +import android.os.Bundle; +import android.support.v4.app.FragmentActivity; +import android.view.View; +import com.google.android.gms.common.ConnectionResult; + +import java.util.concurrent.TimeUnit; +import java.util.logging.Handler; + +/** + * The main entry point for Google Play services integration. + *

+ * GoogleApiClient is used with a variety of static methods. Some of these methods require that + * GoogleApiClient be connected, some will queue up calls before GoogleApiClient is connected; + * check the specific API documentation to determine whether you need to be connected. + *

+ * Before any operation is executed, the GoogleApiClient must be connected using the + * {@link #connect()} method. The client is not considered connected until the + * {@link ConnectionCallbacks#onConnected(Bundle)} callback has been called. + *

+ * When your app is done using this client, call {@link #disconnect()}, even if the async result + * from {@link #connect()} has not yet been delivered. + *

+ * You should instantiate a client object in your Activity's {@link Activity#onCreate(Bundle)} + * method and then call {@link #connect()} in {@link Activity#onStart()} and {@link #disconnect()} + * in {@link Activity#onStop()}, regardless of the state. + */ +public interface GoogleApiClient { + /** + * Connects the client to Google Play services. Blocks until the connection either succeeds or + * fails. This is not allowed on the UI thread. + * + * @return the result of the connection + */ + public ConnectionResult blockingConnect(); + + /** + * Connects the client to Google Play services. Blocks until the connection is set or failed or + * has timed out. This is not allowed on the UI thread. + * + * @param timeout the maximum time to wait + * @param unit the time unit of the {@code timeout} argument + * @return the result of the connection + */ + public ConnectionResult blockingConnect(long timeout, TimeUnit unit); + + /** + * Clears the account selected by the user and reconnects the client asking the user to pick an + * account again if {@link Builder#useDefaultAccount()} was set. + * + * @return the pending result is fired once the default account has been cleared, but before + * the client is reconnected - for that {@link ConnectionCallbacks} can be used. + */ + public PendingResult clearDefaultAccountAndReconnect(); + + /** + * Connects the client to Google Play services. This method returns immediately, and connects + * to the service in the background. If the connection is successful, + * {@link ConnectionCallbacks#onConnected(Bundle)} is called and enqueued items are executed. + * On a failure, {@link OnConnectionFailedListener#onConnectionFailed(ConnectionResult)} is + * called. + */ + public void connect(); + + /** + * Closes the connection to Google Play services. No calls can be made using this client after + * calling this method. Any method calls that haven't executed yet will be canceled. That is + * {@link ResultCallback#onResult(Result)} won't be called, if connection to the service hasn't + * been established yet all calls already made will be canceled. + * + * @see #connect() + */ + public void disconnect(); + + /** + * Checks if the client is currently connected to the service, so that requests to other + * methods will succeed. Applications should guard client actions caused by the user with a + * call to this method. + * + * @return {@code true} if the client is connected to the service. + */ + public boolean isConnected(); + + /** + * Checks if the client is attempting to connect to the service. + * + * @return {@code true} if the client is attempting to connect to the service. + */ + public boolean isConnecting(); + + /** + * Returns {@code true} if the specified listener is currently registered to receive connection + * events. + * + * @param listener The listener to check for. + * @return {@code true} if the specified listener is currently registered to receive connection + * events. + * @see #registerConnectionCallbacks(ConnectionCallbacks) + * @see #unregisterConnectionCallbacks(ConnectionCallbacks) + */ + public boolean isConnectionCallbacksRegistered(ConnectionCallbacks listener); + + /** + * Returns {@code true} if the specified listener is currently registered to receive connection + * failed events. + * + * @param listener The listener to check for. + * @return {@code true} if the specified listener is currently registered to receive connection + * failed events. + * @see #registerConnectionFailedListener(OnConnectionFailedListener) + * @see #unregisterConnectionFailedListener(OnConnectionFailedListener) + */ + public boolean isConnectionFailedListenerRegistered(OnConnectionFailedListener listener); + + /** + * Closes the current connection to Google Play services and creates a new connection. + *

+ * This method closes the current connection then returns immediately and reconnects to the + * service in the background. + *

+ * After calling this method, your application will receive + * {@link ConnectionCallbacks#onConnected(Bundle)} if the connection is successful, or + * {@link OnConnectionFailedListener#onConnectionFailed(ConnectionResult)} if the connection + * failed. + * + * @see #connect() + * @see #disconnect() + */ + public void reconnect(); + + /** + * Registers a listener to receive connection events from this {@link GoogleApiClient}. If the + * service is already connected, the listener's {@link ConnectionCallbacks#onConnected(Bundle)} + * method will be called immediately. Applications should balance calls to this method with + * calls to {@link #unregisterConnectionCallbacks(ConnectionCallbacks)} to avoid leaking + * resources. + *

+ * If the specified listener is already registered to receive connection events, this method + * will not add a duplicate entry for the same listener, but will still call the listener's + * {@link ConnectionCallbacks#onConnected(Bundle)} method if currently connected. + *

+ * Note that the order of messages received here may not be stable, so clients should not rely + * on the order that multiple listeners receive events in. + * + * @param listener the listener where the results of the asynchronous {@link #connect()} call + * are delivered. + */ + public void registerConnectionCallbacks(ConnectionCallbacks listener); + + /** + * Registers a listener to receive connection failed events from this {@link GoogleApiClient}. + * Unlike {@link #registerConnectionCallbacks(ConnectionCallbacks)}, if the service is not + * already connected, the listener's + * {@link OnConnectionFailedListener#onConnectionFailed(ConnectionResult)} method will not be + * called immediately. Applications should balance calls to this method with calls to + * {@link #unregisterConnectionFailedListener(OnConnectionFailedListener)} to avoid leaking + * resources. + *

+ * If the specified listener is already registered to receive connection failed events, this + * method will not add a duplicate entry for the same listener. + *

+ * Note that the order of messages received here may not be stable, so clients should not rely + * on the order that multiple listeners receive events in. + * + * @param listener the listener where the results of the asynchronous {@link #connect()} call + * are delivered. + */ + public void registerConnectionFailedListener(OnConnectionFailedListener listener); + + /** + * Disconnects the client and stops automatic lifecycle management. Use this before creating a + * new client (which might be necessary when switching accounts, changing the set of used APIs + * etc.). + *

+ * This method must be called from the main thread. + * + * @param lifecycleActivity the activity managing the client's lifecycle. + * @throws IllegalStateException if called from outside of the main thread. + * @see Builder#enableAutoManage(FragmentActivity, int, OnConnectionFailedListener) + */ + public void stopAutoManager(FragmentActivity lifecycleActivity) throws IllegalStateException; + + /** + * Removes a connection listener from this {@link GoogleApiClient}. Note that removing a + * listener does not generate any callbacks. + *

+ * If the specified listener is not currently registered to receive connection events, this + * method will have no effect. + * + * @param listener the listener to unregister. + */ + public void unregisterConnectionCallbacks(ConnectionCallbacks listener); + + /** + * Removes a connection failed listener from the {@link GoogleApiClient}. Note that removing a + * listener does not generate any callbacks. + *

+ * If the specified listener is not currently registered to receive connection failed events, + * this method will have no effect. + * + * @param listener the listener to unregister. + */ + public void unregisterConnectionFailedListener(OnConnectionFailedListener listener); + + /** + * Builder to configure a {@link GoogleApiClient}. + */ + public class Builder { + /** + * Builder to help construct the {@link GoogleApiClient} object. + * + * @param context The context to use for the connection. + */ + public Builder(Context context) { + + } + + /** + * Builder to help construct the {@link GoogleApiClient} object. + * + * @param context The context to use for the connection. + * @param connectedListener The listener where the results of the asynchronous + * {@link #connect()} call are delivered. + * @param connectionFailedListener The listener which will be notified if the connection + * attempt fails. + */ + public Builder(Context context, ConnectionCallbacks connectedListener, + OnConnectionFailedListener connectionFailedListener) { + this(context); + addConnectionCallbacks(connectedListener); + addOnConnectionFailedListener(connectionFailedListener); + } + + /** + * Specify which Apis are requested by your app. See {@link Api} for more information. + * + * @param api The Api requested by your app. + * @param options Any additional parameters required for the specific AP + * @see Api + */ + public Builder addApi(Api api, O options) { + // TODO + return this; + } + + /** + * Specify which Apis are requested by your app. See {@link Api} for more information. + * + * @param api The Api requested by your app. + * @see Api + */ + public Builder addApi(Api api) { + // TODO + return this; + } + + /** + * Registers a listener to receive connection events from this {@link GoogleApiClient}. + * Applications should balance calls to this method with calls to + * {@link #unregisterConnectionCallbacks(ConnectionCallbacks)} to avoid + * leaking resources. + *

+ * If the specified listener is already registered to receive connection events, this + * method will not add a duplicate entry for the same listener. + *

+ * Note that the order of messages received here may not be stable, so clients should not + * rely on the order that multiple listeners receive events in. + * + * @param listener the listener where the results of the asynchronous {@link #connect()} + * call are delivered. + */ + public Builder addConnectionCallbacks(ConnectionCallbacks listener) { + // TODO + return this; + } + + /** + * Adds a listener to register to receive connection failed events from this + * {@link GoogleApiClient}. Applications should balance calls to this method with calls to + * {@link #unregisterConnectionFailedListener(OnConnectionFailedListener)} to avoid + * leaking resources. + *

+ * If the specified listener is already registered to receive connection failed events, + * this method will not add a duplicate entry for the same listener. + *

+ * Note that the order of messages received here may not be stable, so clients should not + * rely on the order that multiple listeners receive events in. + * + * @param listener the listener where the results of the asynchronous {@link #connect()} + * call are delivered. + */ + public Builder addOnConnectionFailedListener(OnConnectionFailedListener listener) { + // TODO + return this; + } + + /** + * Specify the OAuth 2.0 scopes requested by your app. See + * {@link com.google.android.gms.common.Scopes} for more information. + * + * @param scope The OAuth 2.0 scopes requested by your app. + * @see com.google.android.gms.common.Scopes + */ + public Builder addScope(Scope scope) { + // TODO + return this; + } + + /** + * Builds a new {@link GoogleApiClient} object for communicating with the Google APIs. + * + * @return The {@link GoogleApiClient} object. + */ + public GoogleApiClient build() { + return null; // TODO + } + + public Builder enableAutoManage(FragmentActivity fragmentActivity, int cliendId, + OnConnectionFailedListener unresolvedConnectionFailedListener) + throws NullPointerException, IllegalArgumentException, IllegalStateException { + // TODO + return this; + } + + /** + * Specify an account name on the device that should be used. If this is never called, the + * client will use the current default account for Google Play services for this + * application. + * + * @param accountName The account name on the device that should be used by + * {@link GoogleApiClient}. + */ + public Builder setAccountName(String accountName) { + // TODO + return this; + } + + /** + * Specifies the part of the screen at which games service popups (for example, + * "welcome back" or "achievement unlocked" popups) will be displayed using gravity. + * + * @param gravityForPopups The gravity which controls the placement of games service popups. + */ + public Builder setGravityForPopups(int gravityForPopups) { + // TODO + return this; + } + + /** + * Sets a {@link Handler} to indicate which thread to use when invoking callbacks. Will not + * be used directly to handle callbacks. If this is not called then the application's main + * thread will be used. + */ + public Builder setHandler(Handler handler) { + // TODO + return this; + } + + /** + * Sets the {@link View} to use as a content view for popups. + * + * @param viewForPopups The view to use as a content view for popups. View cannot be null. + */ + public Builder setViewForPopups(View viewForPopups) { + // TODO + return this; + } + + /** + * Specify that the default account should be used when connecting to services. + */ + public Builder useDefaultAccount() { + // TODO + return this; + } + } + + /** + * Provides callbacks that are called when the client is connected or disconnected from the + * service. Most applications implement {@link #onConnected(Bundle)} to start making requests. + */ + public interface ConnectionCallbacks { + /** + * A suspension cause informing that the service has been killed. + */ + int CAUSE_SERVICE_DISCONNECTED = 1; + /** + * A suspension cause informing you that a peer device connection was lost. + */ + int CAUSE_NETWORK_LOST = 2; + + /** + * After calling {@link #connect()}, this method will be invoked asynchronously when the + * connect request has successfully completed. After this callback, the application can + * make requests on other methods provided by the client and expect that no user + * intervention is required to call methods that use account and scopes provided to the + * client constructor. + *

+ * Note that the contents of the {@code connectionHint} Bundle are defined by the specific + * services. Please see the documentation of the specific implementation of + * {@link GoogleApiClient} you are using for more information. + * + * @param connectionHint Bundle of data provided to clients by Google Play services. May + * be null if no content is provided by the service. + */ + void onConnected(Bundle connectionHint); + + /** + * Called when the client is temporarily in a disconnected state. This can happen if there + * is a problem with the remote service (e.g. a crash or resource problem causes it to be + * killed by the system). When called, all requests have been canceled and no outstanding + * listeners will be executed. GoogleApiClient will automatically attempt to restore the + * connection. Applications should disable UI components that require the service, and wait + * for a call to {@link #onConnected(Bundle)} to re-enable them. + * + * @param cause The reason for the disconnection. Defined by constants {@code CAUSE_*}. + */ + void onConnectionSuspended(int cause); + } + + /** + * Provides callbacks for scenarios that result in a failed attempt to connect the client to + * the service. See {@link ConnectionResult} for a list of error codes and suggestions for + * resolution. + */ + public interface OnConnectionFailedListener { + /** + * Called when there was an error connecting the client to the service. + * + * @param result A {@link ConnectionResult} that can be used for resolving the error, and + * deciding what sort of error occurred. To resolve the error, the resolution + * must be started from an activity with a non-negative {@code requestCode} + * passed to {@link ConnectionResult#startResolutionForResult(Activity, int)}. + * Applications should implement {@link Activity#onActivityResult} in their + * Activity to call {@link #connect()} again if the user has resolved the + * issue (resultCode is {@link Activity#RESULT_OK}). + */ + void onConnectionFailed(ConnectionResult result); + } +} diff --git a/src/com/google/android/gms/common/api/PendingResult.java b/src/com/google/android/gms/common/api/PendingResult.java new file mode 100644 index 00000000..a1ea2473 --- /dev/null +++ b/src/com/google/android/gms/common/api/PendingResult.java @@ -0,0 +1,4 @@ +package com.google.android.gms.common.api; + +public class PendingResult { +} diff --git a/src/com/google/android/gms/common/api/ResultCallback.java b/src/com/google/android/gms/common/api/ResultCallback.java new file mode 100644 index 00000000..1d925a8d --- /dev/null +++ b/src/com/google/android/gms/common/api/ResultCallback.java @@ -0,0 +1,4 @@ +package com.google.android.gms.common.api; + +public class ResultCallback { +} diff --git a/src/com/google/android/gms/common/api/Status.java b/src/com/google/android/gms/common/api/Status.java new file mode 100644 index 00000000..fdd78880 --- /dev/null +++ b/src/com/google/android/gms/common/api/Status.java @@ -0,0 +1,4 @@ +package com.google.android.gms.common.api; + +public class Status { +} From 7c312bfe30a0b927619a8068d1cc9aecf2ab807c Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Mon, 12 Jan 2015 00:08:18 +0100 Subject: [PATCH 009/293] Add some common Api classes --- .../gms/common/AbstractGmsServiceBroker.java | 170 ------------------ src/com/google/android/gms/common/Scopes.java | 18 ++ .../google/android/gms/common/api/Scope.java | 73 ++++++++ src/org/microg/gms/{maps => }/Constants.java | 7 +- 4 files changed, 94 insertions(+), 174 deletions(-) delete mode 100644 src/com/google/android/gms/common/AbstractGmsServiceBroker.java create mode 100644 src/com/google/android/gms/common/Scopes.java create mode 100644 src/com/google/android/gms/common/api/Scope.java rename src/org/microg/gms/{maps => }/Constants.java (96%) diff --git a/src/com/google/android/gms/common/AbstractGmsServiceBroker.java b/src/com/google/android/gms/common/AbstractGmsServiceBroker.java deleted file mode 100644 index 758d6faf..00000000 --- a/src/com/google/android/gms/common/AbstractGmsServiceBroker.java +++ /dev/null @@ -1,170 +0,0 @@ -/* - * Copyright (c) 2014 μg 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.common; - -import android.os.Bundle; -import android.os.IBinder; -import android.os.RemoteException; -import com.google.android.gms.common.internal.IGmsCallbacks; -import com.google.android.gms.common.internal.IGmsServiceBroker; - -public abstract class AbstractGmsServiceBroker extends IGmsServiceBroker.Stub { - @Override - public void getPlusService(IGmsCallbacks callback, int versionCode, String packageName, - String str2, String[] paramArrayOfString, String str3, Bundle params) - throws RemoteException { - throw new IllegalArgumentException("Plus service not supported"); - } - - @Override - public void getPanoramaService(IGmsCallbacks callback, int versionCode, String packageName, - Bundle params) throws RemoteException { - throw new IllegalArgumentException("Panorama service not supported"); - } - - @Override - public void getAppDataSearchService(IGmsCallbacks callback, int versionCode, String packageName) - throws RemoteException { - throw new IllegalArgumentException("App Data Search service not supported"); - } - - @Override - public void getWalletService(IGmsCallbacks callback, int versionCode) throws RemoteException { - throw new IllegalArgumentException("Wallet service not supported"); - } - - @Override - public void getPeopleService(IGmsCallbacks callback, int versionCode, String packageName, - Bundle params) throws RemoteException { - throw new IllegalArgumentException("People service not supported"); - } - - @Override - public void getReportingService(IGmsCallbacks callback, int versionCode, String packageName, - Bundle params) throws RemoteException { - throw new IllegalArgumentException("Reporting service not supported"); - } - - @Override - public void getLocationService(IGmsCallbacks callback, int versionCode, String packageName, - Bundle params) throws RemoteException { - throw new IllegalArgumentException("Location service not supported"); - } - - @Override - public void getGoogleLocationManagerService(IGmsCallbacks callback, int versionCode, - String packageName, Bundle params) throws RemoteException { - throw new IllegalArgumentException("Google Location Manager service not supported"); - } - - @Override - public void getGamesService(IGmsCallbacks callback, int versionCode, String packageName, - String str2, String[] args, String str3, IBinder binder, String str4, Bundle params) - throws RemoteException { - throw new IllegalArgumentException("Games service not supported"); - } - - @Override - public void getAppStateService(IGmsCallbacks callback, int versionCode, String packageName, - String str2, String[] args) throws RemoteException { - throw new IllegalArgumentException("App State service not supported"); - } - - @Override - public void getPlayLogService(IGmsCallbacks callback, int versionCode, String packageName, - Bundle params) throws RemoteException { - throw new IllegalArgumentException("Play Log service not supported"); - } - - @Override - public void getAdMobService(IGmsCallbacks callback, int versionCode, String packageName, - Bundle params) throws RemoteException { - throw new IllegalArgumentException("AdMob service not supported"); - } - - @Override - public void getDroidGuardService(IGmsCallbacks callback, int versionCode, String packageName, - Bundle params) throws RemoteException { - throw new IllegalArgumentException("DroidGuard service not supported"); - } - - @Override - public void getLockboxService(IGmsCallbacks callback, int versionCode, String packageName, - Bundle params) throws RemoteException { - throw new IllegalArgumentException("Lockbox service not supported"); - } - - @Override - public void getCastMirroringService(IGmsCallbacks callback, int versionCode, String packageName, - Bundle params) throws RemoteException { - throw new IllegalArgumentException("Cast Mirroring service not supported"); - } - - @Override - public void getNetworkQualityService(IGmsCallbacks callback, int versionCode, - String packageName, Bundle params) throws RemoteException { - throw new IllegalArgumentException("Network Quality service not supported"); - } - - @Override - public void getGoogleIdentityService(IGmsCallbacks callback, int versionCode, - String packageName, Bundle params) throws RemoteException { - throw new IllegalArgumentException("Google Identity service not supported"); - } - - @Override - public void getGoogleFeedbackService(IGmsCallbacks callback, int versionCode, - String packageName, Bundle params) throws RemoteException { - throw new IllegalArgumentException("Google Feedback service not supported"); - } - - @Override - public void getCastService(IGmsCallbacks callback, int versionCode, String packageName, - IBinder binder, Bundle params) throws RemoteException { - throw new IllegalArgumentException("Cast service not supported"); - } - - @Override - public void getDriveService(IGmsCallbacks callback, int versionCode, String packageName, - String[] args, String str2, Bundle params) throws RemoteException { - throw new IllegalArgumentException("Drive service not supported"); - } - - @Override - public void getLightweightAppDataSearchService(IGmsCallbacks callback, int versionCode, - String packageName) throws RemoteException { - throw new IllegalArgumentException("Lightweight App Data Search service not supported"); - } - - @Override - public void getSearchAdministrationService(IGmsCallbacks callback, int versionCode, - String packageName) throws RemoteException { - throw new IllegalArgumentException("Search Administration service not supported"); - } - - @Override - public void getAutoBackupService(IGmsCallbacks callback, int versionCode, String packageName, - Bundle params) throws RemoteException { - throw new IllegalArgumentException("Auto Backup service not supported"); - } - - @Override - public void getAddressService(IGmsCallbacks callback, int versionCode, String packageName) - throws RemoteException { - throw new IllegalArgumentException("Address service not supported"); - } -} diff --git a/src/com/google/android/gms/common/Scopes.java b/src/com/google/android/gms/common/Scopes.java new file mode 100644 index 00000000..bbc0f55f --- /dev/null +++ b/src/com/google/android/gms/common/Scopes.java @@ -0,0 +1,18 @@ +package com.google.android.gms.common; + +public class Scopes { + public static final String PROFILE = "profile"; + public static final String PLUS_LOGIN = "https://www.googleapis.com/auth/plus.login"; + public static final String PLUS_ME = "https://www.googleapis.com/auth/plus.me"; + public static final String GAMES = "https://www.googleapis.com/auth/games"; + public static final String CLOUD_SAVE = "https://www.googleapis.com/auth/datastoremobile"; + public static final String APP_STATE = "https://www.googleapis.com/auth/appstate"; + public static final String DRIVE_FILE = "https://www.googleapis.com/auth/drive.file"; + public static final String DRIVE_APPFOLDER = "https://www.googleapis.com/auth/drive.appdata"; + public static final String FITNESS_ACTIVITY_READ = "https://www.googleapis.com/auth/fitness.activity.read"; + public static final String FITNESS_ACTIVITY_READ_WRITE = "https://www.googleapis.com/auth/fitness.activity.write"; + public static final String FITNESS_LOCATION_READ = "https://www.googleapis.com/auth/fitness.location.read"; + public static final String FITNESS_LOCATION_READ_WRITE = "https://www.googleapis.com/auth/fitness.location.write"; + public static final String FITNESS_BODY_READ = "https://www.googleapis.com/auth/fitness.body.read"; + public static final String FITNESS_BODY_READ_WRITE = "https://www.googleapis.com/auth/fitness.body.write"; +} diff --git a/src/com/google/android/gms/common/api/Scope.java b/src/com/google/android/gms/common/api/Scope.java new file mode 100644 index 00000000..21ad3321 --- /dev/null +++ b/src/com/google/android/gms/common/api/Scope.java @@ -0,0 +1,73 @@ +package com.google.android.gms.common.api; + +import android.os.Parcel; +import org.microg.safeparcel.SafeParcelUtil; +import org.microg.safeparcel.SafeParcelable; + +/** + * Describes an OAuth 2.0 scope to request. This has security implications for the user, and + * requesting additional scopes will result in authorization dialogs. + */ +public class Scope implements SafeParcelable { + private final int versionCode; + private final String scopeUri; + + private Scope() { + versionCode = -1; + scopeUri = null; + } + + private Scope(Parcel in) { + this(); + SafeParcelUtil.readObject(this, in); + } + + /** + * Creates a new scope with the given URI. + */ + public Scope(String scopeUri) { + versionCode = 1; + this.scopeUri = scopeUri; + } + + @Override + public int describeContents() { + return 0; + } + + @Override + public boolean equals(Object o) { + return this == o || o instanceof Scope && scopeUri.equals(((Scope) o).scopeUri); + } + + public String getScopeUri() { + return scopeUri; + } + + @Override + public int hashCode() { + return scopeUri.hashCode(); + } + + @Override + public String toString() { + return scopeUri; + } + + @Override + public void writeToParcel(Parcel out, int flags) { + SafeParcelUtil.writeObject(this, out, flags); + } + + public static final Creator CREATOR = new Creator() { + @Override + public Scope createFromParcel(Parcel parcel) { + return new Scope(parcel); + } + + @Override + public Scope[] newArray(int i) { + return new Scope[i]; + } + }; +} diff --git a/src/org/microg/gms/maps/Constants.java b/src/org/microg/gms/Constants.java similarity index 96% rename from src/org/microg/gms/maps/Constants.java rename to src/org/microg/gms/Constants.java index 7209e500..9ff2f907 100644 --- a/src/org/microg/gms/maps/Constants.java +++ b/src/org/microg/gms/Constants.java @@ -1,4 +1,4 @@ -package org.microg.gms.maps; +package org.microg.gms; public class Constants { /** @@ -6,6 +6,8 @@ public class Constants { * Does not necessarily mean anything. */ public static final int MAX_REFERENCE_VERSION = 6599436; + public static final String ACTION_GMS_LOCATION_MANAGER_SERVICE_START = "com.google.android.location.internal.GoogleLocationManagerService.START"; + public static final String KEY_MOCK_LOCATION = "mockLocation"; /** * No base map tiles. @@ -31,7 +33,4 @@ public class Constants { * Satellite maps with a transparent layer of major streets. */ public static final int MAP_TYPE_HYBRID = 4; - - public static final String ACTION_GMS_LOCATION_MANAGER_SERVICE_START = "com.google.android.location.internal.GoogleLocationManagerService.START"; - public static final String KEY_MOCK_LOCATION = "mockLocation"; } From 8b421638000f30c21a57997bab44f0040b66550b Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Mon, 12 Jan 2015 00:52:58 +0100 Subject: [PATCH 010/293] Start Api code --- README.md | 1 + .../android/gms/common/ConnectionResult.java | 7 ++-- .../google/android/gms/common/api/Api.java | 41 +++++++++++++++++-- .../android/gms/common/api/PendingResult.java | 38 ++++++++++++++++- .../android/gms/common/api/Releasable.java | 9 ++++ .../google/android/gms/common/api/Result.java | 8 ++++ .../gms/common/api/ResultCallback.java | 14 ++++++- .../google/android/gms/common/api/Status.java | 11 ++++- 8 files changed, 119 insertions(+), 10 deletions(-) create mode 100644 README.md create mode 100644 src/com/google/android/gms/common/api/Releasable.java create mode 100644 src/com/google/android/gms/common/api/Result.java diff --git a/README.md b/README.md new file mode 100644 index 00000000..6fb94c76 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +Do not link against this repo, as it is will be renamed later diff --git a/src/com/google/android/gms/common/ConnectionResult.java b/src/com/google/android/gms/common/ConnectionResult.java index b32466b6..ae65ae68 100644 --- a/src/com/google/android/gms/common/ConnectionResult.java +++ b/src/com/google/android/gms/common/ConnectionResult.java @@ -2,6 +2,7 @@ package com.google.android.gms.common; import android.app.Activity; import android.app.PendingIntent; +import android.content.Intent; import android.content.IntentSender; import com.google.android.gms.common.api.GoogleApiClient; @@ -130,7 +131,7 @@ public class ConnectionResult { * @return the error code, or {@link #SUCCESS} if no error occurred. */ public int getErrorCode() { - return this.statusCode; + return statusCode; } /** @@ -141,7 +142,7 @@ public class ConnectionResult { * @return The pending intent to resolve the connection failure. */ public PendingIntent getResolution() { - return this.pendingIntent; + return pendingIntent; } /** @@ -160,7 +161,7 @@ public class ConnectionResult { * @return {@code true} if the connection was successful, {@code false} if there was an error. */ public boolean isSuccess() { - return this.statusCode == 0; + return statusCode == 0; } /** diff --git a/src/com/google/android/gms/common/api/Api.java b/src/com/google/android/gms/common/api/Api.java index 6560e667..5d7e45ab 100644 --- a/src/com/google/android/gms/common/api/Api.java +++ b/src/com/google/android/gms/common/api/Api.java @@ -1,13 +1,46 @@ package com.google.android.gms.common.api; -public class Api { - +/** + * Describes a section of the Google Play Services API that should be made available. Instances of + * this should be passed into {@link GoogleApiClient.Builder#addApi(Api)} to enable the appropriate + * parts of Google Play Services. + *

+ * Google APIs are partitioned into sections which allow your application to configure only the + * services it requires. Each Google API provides an API object which can be passed to + * {@link GoogleApiClient.Builder#addApi(Api)} in order to configure and enable that functionality + * in your {@link GoogleApiClient} instance. + *

+ * See {@link GoogleApiClient.Builder} for usage examples. + */ +public final class Api { + + /** + * Base interface for API options. These are used to configure specific parameters for + * individual API surfaces. The default implementation has no parameters. + */ public interface ApiOptions { + /** + * Base interface for {@link ApiOptions} in {@link Api}s that have options. + */ public interface HasOptions extends ApiOptions { - } + + /** + * Base interface for {@link ApiOptions} that are not required, don't exist. + */ public interface NotRequiredOptions extends ApiOptions { - + } + + /** + * {@link ApiOptions} implementation for {@link Api}s that do not take any options. + */ + public class NoOptions implements NotRequiredOptions { + } + + /** + * Base interface for {@link ApiOptions} that are optional. + */ + public interface Optional extends HasOptions, NotRequiredOptions { } } } diff --git a/src/com/google/android/gms/common/api/PendingResult.java b/src/com/google/android/gms/common/api/PendingResult.java index a1ea2473..8845a8d7 100644 --- a/src/com/google/android/gms/common/api/PendingResult.java +++ b/src/com/google/android/gms/common/api/PendingResult.java @@ -1,4 +1,40 @@ package com.google.android.gms.common.api; -public class PendingResult { +import java.util.concurrent.TimeUnit; + +/** + * Represents a pending result from calling an API method in Google Play services. The final result + * object from a PendingResult is of type R, which can be retrieved in one of two ways. + *

+ *

    + *
  • via blocking calls to {@link #await()}, or {@link #await(long, TimeUnit)}, or
  • + *
  • via a callback by passing in an object implementing interface {@link ResultCallback} to + * {@link #setResultCallback(ResultCallback)}.
  • + *
+ * After the result has been retrieved using {@link #await()} or delivered to the result callback, + * it is an error to attempt to retrieve the result again. It is the responsibility of the caller + * or callback receiver to release any resources associated with the returned result. Some result + * types may implement {@link Releasable}, in which case {@link Releasable#release()} should be + * used to free the associated resources. + *

+ * TODO: Docs + */ +public interface PendingResult { + /** + * Blocks until the task is completed. This is not allowed on the UI thread. The returned result object can have an additional failure mode of INTERRUPTED. + */ + public R await(); + + /** + * Blocks until the task is completed or has timed out waiting for the result. This is not allowed on the UI thread. The returned result object can have an additional failure mode of either INTERRUPTED or TIMEOUT. + */ + public R await(long time, TimeUnit unit); + + public void cancel(); + + public boolean isCanceled(); + + public void setResultCallback(ResultCallback callback, long time, TimeUnit unit); + + public void setResultCallback(ResultCallback callback); } diff --git a/src/com/google/android/gms/common/api/Releasable.java b/src/com/google/android/gms/common/api/Releasable.java new file mode 100644 index 00000000..ed3d08c6 --- /dev/null +++ b/src/com/google/android/gms/common/api/Releasable.java @@ -0,0 +1,9 @@ +package com.google.android.gms.common.api; + +/** + * Represents a resource, or a holder of resources, which may be released once they are no longer + * needed. + */ +public interface Releasable { + public void release(); +} diff --git a/src/com/google/android/gms/common/api/Result.java b/src/com/google/android/gms/common/api/Result.java new file mode 100644 index 00000000..d8408112 --- /dev/null +++ b/src/com/google/android/gms/common/api/Result.java @@ -0,0 +1,8 @@ +package com.google.android.gms.common.api; + +/** + * Represents the final result of invoking an API method in Google Play Services. + */ +public interface Result { + public Status getStatus(); +} diff --git a/src/com/google/android/gms/common/api/ResultCallback.java b/src/com/google/android/gms/common/api/ResultCallback.java index 1d925a8d..ef8e8eb2 100644 --- a/src/com/google/android/gms/common/api/ResultCallback.java +++ b/src/com/google/android/gms/common/api/ResultCallback.java @@ -1,4 +1,16 @@ package com.google.android.gms.common.api; -public class ResultCallback { +/** + * An interface for receiving a {@link Result} from a {@link PendingResult} as an asynchronous callback. + */ +public interface ResultCallback { + /** + * Called when the {@link Result} is ready. It is the responsibility of each callback to + * release any resources associated with the result. Some result types may implement + * {@link Releasable}, in which case {@link Releasable#release()} should be used to free the + * associated resources. + * + * @param result The result from the API call. May not be null. + */ + public void onResult(R result); } diff --git a/src/com/google/android/gms/common/api/Status.java b/src/com/google/android/gms/common/api/Status.java index fdd78880..ae65e646 100644 --- a/src/com/google/android/gms/common/api/Status.java +++ b/src/com/google/android/gms/common/api/Status.java @@ -1,4 +1,13 @@ package com.google.android.gms.common.api; -public class Status { +/** + * Represents the results of work. + *

+ * TODO: content (is this IPC API?) + */ +public final class Status implements Result { + @Override + public Status getStatus() { + return this; + } } From 95fabdd877cea17a7ad25d05e875c883ede2fb99 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Mon, 12 Jan 2015 11:02:10 +0100 Subject: [PATCH 011/293] Migrate to AutoSafeParcelable --- .../android/gms/common/api/AccountInfo.java | 7 ++++ .../google/android/gms/common/api/Scope.java | 38 ++++-------------- .../android/gms/common/data/DataHolder.java | 31 ++------------- .../google/android/gms/location/Geofence.java | 30 ++------------ .../gms/location/GeofencingRequest.java | 34 ++-------------- .../android/gms/location/LocationRequest.java | 35 ++--------------- .../android/gms/location/LocationStatus.java | 31 ++------------- .../internal/LocationRequestInternal.java | 33 ++-------------- .../location/places/AutocompleteFilter.java | 36 +++-------------- .../location/places/NearbyAlertRequest.java | 32 ++------------- .../gms/location/places/PlaceFilter.java | 32 ++------------- .../gms/location/places/PlaceReport.java | 34 ++-------------- .../gms/location/places/PlaceRequest.java | 32 ++------------- .../gms/location/places/UserAddedPlace.java | 39 +++---------------- .../gms/location/places/UserDataType.java | 31 ++------------- .../places/internal/PlacesParams.java | 35 ++--------------- .../android/gms/maps/GoogleMapOptions.java | 30 ++------------ .../gms/maps/model/CameraPosition.java | 35 ++--------------- .../android/gms/maps/model/CircleOptions.java | 30 ++------------ .../gms/maps/model/GroundOverlayOptions.java | 31 ++------------- .../google/android/gms/maps/model/LatLng.java | 35 +++-------------- .../android/gms/maps/model/LatLngBounds.java | 33 ++-------------- .../android/gms/maps/model/MarkerOptions.java | 30 ++------------ .../gms/maps/model/PolygonOptions.java | 30 ++------------ .../gms/maps/model/PolylineOptions.java | 30 ++------------ .../google/android/gms/maps/model/Tile.java | 33 ++-------------- .../gms/maps/model/TileOverlayOptions.java | 30 ++------------ .../android/gms/maps/model/VisibleRegion.java | 33 +++------------- src/org/microg/gms/Constants.java | 1 + 29 files changed, 112 insertions(+), 779 deletions(-) create mode 100644 src/com/google/android/gms/common/api/AccountInfo.java diff --git a/src/com/google/android/gms/common/api/AccountInfo.java b/src/com/google/android/gms/common/api/AccountInfo.java new file mode 100644 index 00000000..e482b9fd --- /dev/null +++ b/src/com/google/android/gms/common/api/AccountInfo.java @@ -0,0 +1,7 @@ +package com.google.android.gms.common.api; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class AccountInfo extends AutoSafeParcelable { + public static final Creator CREATOR = new AutoCreator<>(AccountInfo.class); +} diff --git a/src/com/google/android/gms/common/api/Scope.java b/src/com/google/android/gms/common/api/Scope.java index 21ad3321..ab9a05a1 100644 --- a/src/com/google/android/gms/common/api/Scope.java +++ b/src/com/google/android/gms/common/api/Scope.java @@ -1,15 +1,16 @@ package com.google.android.gms.common.api; -import android.os.Parcel; -import org.microg.safeparcel.SafeParcelUtil; -import org.microg.safeparcel.SafeParcelable; +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; /** - * Describes an OAuth 2.0 scope to request. This has security implications for the user, and + * Describes an OAuth 2.0 scope to request. This has security implications for the user, and * requesting additional scopes will result in authorization dialogs. */ -public class Scope implements SafeParcelable { +public class Scope extends AutoSafeParcelable { + @SafeParceled(1) private final int versionCode; + @SafeParceled(2) private final String scopeUri; private Scope() { @@ -17,11 +18,6 @@ public class Scope implements SafeParcelable { scopeUri = null; } - private Scope(Parcel in) { - this(); - SafeParcelUtil.readObject(this, in); - } - /** * Creates a new scope with the given URI. */ @@ -30,11 +26,6 @@ public class Scope implements SafeParcelable { this.scopeUri = scopeUri; } - @Override - public int describeContents() { - return 0; - } - @Override public boolean equals(Object o) { return this == o || o instanceof Scope && scopeUri.equals(((Scope) o).scopeUri); @@ -54,20 +45,5 @@ public class Scope implements SafeParcelable { return scopeUri; } - @Override - public void writeToParcel(Parcel out, int flags) { - SafeParcelUtil.writeObject(this, out, flags); - } - - public static final Creator CREATOR = new Creator() { - @Override - public Scope createFromParcel(Parcel parcel) { - return new Scope(parcel); - } - - @Override - public Scope[] newArray(int i) { - return new Scope[i]; - } - }; + public static final Creator CREATOR = new AutoCreator<>(Scope.class); } diff --git a/src/com/google/android/gms/common/data/DataHolder.java b/src/com/google/android/gms/common/data/DataHolder.java index 2cb2885c..ef5d89ef 100644 --- a/src/com/google/android/gms/common/data/DataHolder.java +++ b/src/com/google/android/gms/common/data/DataHolder.java @@ -1,36 +1,11 @@ package com.google.android.gms.common.data; -import android.os.Parcel; -import org.microg.safeparcel.SafeParcelUtil; -import org.microg.safeparcel.SafeParcelable; +import org.microg.safeparcel.AutoSafeParcelable; /** * TODO: usage */ -public class DataHolder implements SafeParcelable { - private DataHolder(Parcel in) { - SafeParcelUtil.readObject(this, in); - } +public class DataHolder extends AutoSafeParcelable { - @Override - public int describeContents() { - return 0; - } - - @Override - public void writeToParcel(Parcel out, int flags) { - SafeParcelUtil.writeObject(this, out, flags); - } - - public static final Creator CREATOR = new Creator() { - @Override - public DataHolder createFromParcel(Parcel parcel) { - return new DataHolder(parcel); - } - - @Override - public DataHolder[] newArray(int i) { - return new DataHolder[i]; - } - }; + public static final Creator CREATOR = new AutoCreator<>(DataHolder.class); } diff --git a/src/com/google/android/gms/location/Geofence.java b/src/com/google/android/gms/location/Geofence.java index 0c65cfa5..c47a90d8 100644 --- a/src/com/google/android/gms/location/Geofence.java +++ b/src/com/google/android/gms/location/Geofence.java @@ -16,33 +16,9 @@ package com.google.android.gms.location; -import android.os.Parcel; -import org.microg.safeparcel.SafeParcelUtil; -import org.microg.safeparcel.SafeParcelable; +import org.microg.safeparcel.AutoSafeParcelable; -public class Geofence implements SafeParcelable { +public class Geofence extends AutoSafeParcelable { - - @Override - public int describeContents() { - return 0; - } - - @Override - public void writeToParcel(Parcel dest, int flags) { - SafeParcelUtil.writeObject(this, dest, flags); - } - - - public static Creator CREATOR = new Creator() { - @Override - public Geofence createFromParcel(Parcel source) { - return new Geofence(); - } - - @Override - public Geofence[] newArray(int size) { - return new Geofence[size]; - } - }; + public static Creator CREATOR = new AutoCreator<>(Geofence.class); } diff --git a/src/com/google/android/gms/location/GeofencingRequest.java b/src/com/google/android/gms/location/GeofencingRequest.java index f8167e78..a36d29e6 100644 --- a/src/com/google/android/gms/location/GeofencingRequest.java +++ b/src/com/google/android/gms/location/GeofencingRequest.java @@ -1,38 +1,12 @@ package com.google.android.gms.location; -import android.os.Parcel; -import android.os.Parcelable; -import org.microg.safeparcel.SafeParcelUtil; -import org.microg.safeparcel.SafeParcelable; +import org.microg.safeparcel.AutoSafeParcelable; /** * TODO: usage */ -public class GeofencingRequest implements SafeParcelable { +public class GeofencingRequest extends AutoSafeParcelable { - private GeofencingRequest(Parcel in) { - SafeParcelUtil.readObject(this, in); - } - - @Override - public int describeContents() { - return 0; - } - - @Override - public void writeToParcel(Parcel out, int flags) { - SafeParcelUtil.writeObject(this, out, flags); - } - - public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { - @Override - public GeofencingRequest createFromParcel(Parcel parcel) { - return new GeofencingRequest(parcel); - } - - @Override - public GeofencingRequest[] newArray(int i) { - return new GeofencingRequest[i]; - } - }; + public static final Creator CREATOR = new AutoCreator<>( + GeofencingRequest.class); } diff --git a/src/com/google/android/gms/location/LocationRequest.java b/src/com/google/android/gms/location/LocationRequest.java index dfc46811..a1105821 100644 --- a/src/com/google/android/gms/location/LocationRequest.java +++ b/src/com/google/android/gms/location/LocationRequest.java @@ -1,9 +1,7 @@ package com.google.android.gms.location; -import android.os.Parcel; import android.os.SystemClock; -import org.microg.safeparcel.SafeParcelUtil; -import org.microg.safeparcel.SafeParcelable; +import org.microg.safeparcel.AutoSafeParcelable; import org.microg.safeparcel.SafeParceled; import java.util.Arrays; @@ -55,10 +53,8 @@ import java.util.Arrays; *

* All location requests are considered hints, and you may receive locations that are more/less * accurate, and faster/slower than requested. - *

- * TODO: Works on wire, but methods not yet implemented. */ -public class LocationRequest implements SafeParcelable { +public class LocationRequest extends AutoSafeParcelable { /** * Used with {@link #setPriority(int)} to request "block" level accuracy. @@ -120,11 +116,6 @@ public class LocationRequest implements SafeParcelable { this.maxWaitTime = 0; } - public LocationRequest(Parcel in) { - this(); - SafeParcelUtil.readObject(this, in); - } - /** * Create a location request with default parameters. *

@@ -137,11 +128,6 @@ public class LocationRequest implements SafeParcelable { return new LocationRequest(); } - @Override - public int describeContents() { - return 0; - } - /** * Get the request expiration time, in milliseconds since boot. *

@@ -426,20 +412,5 @@ public class LocationRequest implements SafeParcelable { return super.toString(); } - @Override - public void writeToParcel(Parcel out, int flags) { - SafeParcelUtil.writeObject(this, out, flags); - } - - public static final Creator CREATOR = new Creator() { - @Override - public LocationRequest createFromParcel(Parcel parcel) { - return new LocationRequest(parcel); - } - - @Override - public LocationRequest[] newArray(int i) { - return new LocationRequest[i]; - } - }; + public static final Creator CREATOR = new AutoCreator<>(LocationRequest.class); } diff --git a/src/com/google/android/gms/location/LocationStatus.java b/src/com/google/android/gms/location/LocationStatus.java index 4009e57f..e60c531f 100644 --- a/src/com/google/android/gms/location/LocationStatus.java +++ b/src/com/google/android/gms/location/LocationStatus.java @@ -1,13 +1,11 @@ package com.google.android.gms.location; -import android.os.Parcel; -import org.microg.safeparcel.SafeParcelUtil; -import org.microg.safeparcel.SafeParcelable; +import org.microg.safeparcel.AutoSafeParcelable; import org.microg.safeparcel.SafeParceled; import java.util.Arrays; -public class LocationStatus implements SafeParcelable { +public class LocationStatus extends AutoSafeParcelable { public static final int STATUS_SUCCESSFUL = 0; public static final int STATUS_UNKNOWN = 1; public static final int STATUS_TIMED_OUT_ON_SCAN = 2; @@ -26,14 +24,8 @@ public class LocationStatus implements SafeParcelable { @SafeParceled(3) long elapsedRealtimeNanos; - private LocationStatus(Parcel in) { + private LocationStatus() { versionCode = 1; - SafeParcelUtil.readObject(this, in); - } - - @Override - public int describeContents() { - return 0; } @Override @@ -84,20 +76,5 @@ public class LocationStatus implements SafeParcelable { } } - @Override - public void writeToParcel(Parcel out, int flags) { - SafeParcelUtil.writeObject(this, out, flags); - } - - public static final Creator CREATOR = new Creator() { - @Override - public LocationStatus createFromParcel(Parcel parcel) { - return new LocationStatus(parcel); - } - - @Override - public LocationStatus[] newArray(int i) { - return new LocationStatus[i]; - } - }; + public static final Creator CREATOR = new AutoCreator<>(LocationStatus.class); } diff --git a/src/com/google/android/gms/location/internal/LocationRequestInternal.java b/src/com/google/android/gms/location/internal/LocationRequestInternal.java index 8ae27697..3ab5568d 100644 --- a/src/com/google/android/gms/location/internal/LocationRequestInternal.java +++ b/src/com/google/android/gms/location/internal/LocationRequestInternal.java @@ -1,37 +1,12 @@ package com.google.android.gms.location.internal; -import android.os.Parcel; -import android.os.Parcelable; -import org.microg.safeparcel.SafeParcelUtil; -import org.microg.safeparcel.SafeParcelable; +import org.microg.safeparcel.AutoSafeParcelable; /** * TODO: usage */ -public class LocationRequestInternal implements SafeParcelable { - private LocationRequestInternal(Parcel in) { - SafeParcelUtil.readObject(this, in); - } +public class LocationRequestInternal extends AutoSafeParcelable { - @Override - public int describeContents() { - return 0; - } - - @Override - public void writeToParcel(Parcel out, int flags) { - SafeParcelUtil.writeObject(this, out, flags); - } - - public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { - @Override - public LocationRequestInternal createFromParcel(Parcel parcel) { - return new LocationRequestInternal(parcel); - } - - @Override - public LocationRequestInternal[] newArray(int i) { - return new LocationRequestInternal[i]; - } - }; + public static final Creator CREATOR = new AutoCreator<>( + LocationRequestInternal.class); } diff --git a/src/com/google/android/gms/location/places/AutocompleteFilter.java b/src/com/google/android/gms/location/places/AutocompleteFilter.java index 86847d4e..23ffa4d4 100644 --- a/src/com/google/android/gms/location/places/AutocompleteFilter.java +++ b/src/com/google/android/gms/location/places/AutocompleteFilter.java @@ -1,15 +1,13 @@ package com.google.android.gms.location.places; -import android.os.Parcel; -import org.microg.safeparcel.SafeParcelUtil; -import org.microg.safeparcel.SafeParcelable; +import org.microg.safeparcel.AutoSafeParcelable; import org.microg.safeparcel.SafeParceled; /** * TODO usage */ -public class AutocompleteFilter implements SafeParcelable { - +public class AutocompleteFilter extends AutoSafeParcelable { + @SafeParceled(1000) private final int versionCode; @@ -17,30 +15,6 @@ public class AutocompleteFilter implements SafeParcelable { this.versionCode = 1; } - private AutocompleteFilter(Parcel in) { - this(); - SafeParcelUtil.readObject(this, in); - } - - @Override - public int describeContents() { - return 0; - } - - @Override - public void writeToParcel(Parcel out, int flags) { - SafeParcelUtil.writeObject(this, out, flags); - } - - public static final Creator CREATOR = new Creator() { - @Override - public AutocompleteFilter createFromParcel(Parcel parcel) { - return new AutocompleteFilter(parcel); - } - - @Override - public AutocompleteFilter[] newArray(int i) { - return new AutocompleteFilter[i]; - } - }; + public static final Creator CREATOR = new AutoCreator<>( + AutocompleteFilter.class); } diff --git a/src/com/google/android/gms/location/places/NearbyAlertRequest.java b/src/com/google/android/gms/location/places/NearbyAlertRequest.java index 0650e462..94c415a5 100644 --- a/src/com/google/android/gms/location/places/NearbyAlertRequest.java +++ b/src/com/google/android/gms/location/places/NearbyAlertRequest.java @@ -1,36 +1,12 @@ package com.google.android.gms.location.places; -import android.os.Parcel; -import org.microg.safeparcel.SafeParcelUtil; -import org.microg.safeparcel.SafeParcelable; +import org.microg.safeparcel.AutoSafeParcelable; /** * TODO: usage */ -public class NearbyAlertRequest implements SafeParcelable { - private NearbyAlertRequest(Parcel in) { - SafeParcelUtil.readObject(this, in); - } +public class NearbyAlertRequest extends AutoSafeParcelable { - @Override - public int describeContents() { - return 0; - } - - @Override - public void writeToParcel(Parcel out, int flags) { - SafeParcelUtil.writeObject(this, out, flags); - } - - public static final Creator CREATOR = new Creator() { - @Override - public NearbyAlertRequest createFromParcel(Parcel parcel) { - return new NearbyAlertRequest(parcel); - } - - @Override - public NearbyAlertRequest[] newArray(int i) { - return new NearbyAlertRequest[i]; - } - }; + public static final Creator CREATOR = new AutoCreator<>( + NearbyAlertRequest.class); } diff --git a/src/com/google/android/gms/location/places/PlaceFilter.java b/src/com/google/android/gms/location/places/PlaceFilter.java index d13849b8..2bbc41f6 100644 --- a/src/com/google/android/gms/location/places/PlaceFilter.java +++ b/src/com/google/android/gms/location/places/PlaceFilter.java @@ -1,37 +1,11 @@ package com.google.android.gms.location.places; -import android.os.Parcel; -import org.microg.safeparcel.SafeParcelUtil; -import org.microg.safeparcel.SafeParcelable; +import org.microg.safeparcel.AutoSafeParcelable; /** * TODO: usage */ -public class PlaceFilter implements SafeParcelable { +public class PlaceFilter extends AutoSafeParcelable { - private PlaceFilter(Parcel in) { - SafeParcelUtil.readObject(this, in); - } - - @Override - public int describeContents() { - return 0; - } - - @Override - public void writeToParcel(Parcel out, int flags) { - SafeParcelUtil.writeObject(this, out, flags); - } - - public static final Creator CREATOR = new Creator() { - @Override - public PlaceFilter createFromParcel(Parcel parcel) { - return new PlaceFilter(parcel); - } - - @Override - public PlaceFilter[] newArray(int i) { - return new PlaceFilter[i]; - } - }; + public static final Creator CREATOR = new AutoCreator<>(PlaceFilter.class); } diff --git a/src/com/google/android/gms/location/places/PlaceReport.java b/src/com/google/android/gms/location/places/PlaceReport.java index 8fd57f86..38d39007 100644 --- a/src/com/google/android/gms/location/places/PlaceReport.java +++ b/src/com/google/android/gms/location/places/PlaceReport.java @@ -1,38 +1,10 @@ package com.google.android.gms.location.places; -import android.os.Parcel; -import android.os.Parcelable; -import org.microg.safeparcel.SafeParcelUtil; -import org.microg.safeparcel.SafeParcelable; +import org.microg.safeparcel.AutoSafeParcelable; /** * TODO: usage */ -public class PlaceReport implements SafeParcelable { - - private PlaceReport(Parcel in) { - SafeParcelUtil.readObject(this, in); - } - - @Override - public int describeContents() { - return 0; - } - - @Override - public void writeToParcel(Parcel out, int flags) { - SafeParcelUtil.writeObject(this, out, flags); - } - - public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { - @Override - public PlaceReport createFromParcel(Parcel parcel) { - return new PlaceReport(parcel); - } - - @Override - public PlaceReport[] newArray(int i) { - return new PlaceReport[i]; - } - }; +public class PlaceReport extends AutoSafeParcelable { + public static final Creator CREATOR = new AutoCreator<>(PlaceReport.class); } diff --git a/src/com/google/android/gms/location/places/PlaceRequest.java b/src/com/google/android/gms/location/places/PlaceRequest.java index 0960bdcb..ad46244e 100644 --- a/src/com/google/android/gms/location/places/PlaceRequest.java +++ b/src/com/google/android/gms/location/places/PlaceRequest.java @@ -1,36 +1,10 @@ package com.google.android.gms.location.places; -import android.os.Parcel; -import org.microg.safeparcel.SafeParcelUtil; -import org.microg.safeparcel.SafeParcelable; +import org.microg.safeparcel.AutoSafeParcelable; /** * TODO: usage */ -public class PlaceRequest implements SafeParcelable { - private PlaceRequest(Parcel in) { - SafeParcelUtil.readObject(this, in); - } - - @Override - public int describeContents() { - return 0; - } - - @Override - public void writeToParcel(Parcel out, int flags) { - SafeParcelUtil.writeObject(this, out, flags); - } - - public static final Creator CREATOR = new Creator() { - @Override - public PlaceRequest createFromParcel(Parcel parcel) { - return new PlaceRequest(parcel); - } - - @Override - public PlaceRequest[] newArray(int i) { - return new PlaceRequest[i]; - } - }; +public class PlaceRequest extends AutoSafeParcelable { + public static final Creator CREATOR = new AutoCreator<>(PlaceRequest.class); } diff --git a/src/com/google/android/gms/location/places/UserAddedPlace.java b/src/com/google/android/gms/location/places/UserAddedPlace.java index 5f83f528..534dac3e 100644 --- a/src/com/google/android/gms/location/places/UserAddedPlace.java +++ b/src/com/google/android/gms/location/places/UserAddedPlace.java @@ -1,46 +1,19 @@ package com.google.android.gms.location.places; -import android.os.Parcel; -import org.microg.safeparcel.SafeParcelUtil; -import org.microg.safeparcel.SafeParcelable; +import org.microg.safeparcel.AutoSafeParcelable; import org.microg.safeparcel.SafeParceled; /** * TODO: usage */ -public class UserAddedPlace implements SafeParcelable { - +public class UserAddedPlace extends AutoSafeParcelable { + @SafeParceled(1000) private final int versionCode; - + private UserAddedPlace() { - versionCode = -1; + versionCode = 1; } - private UserAddedPlace(Parcel in) { - this(); - SafeParcelUtil.readObject(this, in); - } - - @Override - public int describeContents() { - return 0; - } - - @Override - public void writeToParcel(Parcel out, int flags) { - SafeParcelUtil.writeObject(this, out, flags); - } - - public static final Creator CREATOR = new Creator() { - @Override - public UserAddedPlace createFromParcel(Parcel parcel) { - return new UserAddedPlace(parcel); - } - - @Override - public UserAddedPlace[] newArray(int i) { - return new UserAddedPlace[i]; - } - }; + public static final Creator CREATOR = new AutoCreator<>(UserAddedPlace.class); } diff --git a/src/com/google/android/gms/location/places/UserDataType.java b/src/com/google/android/gms/location/places/UserDataType.java index 858d3f0c..7ac8579a 100644 --- a/src/com/google/android/gms/location/places/UserDataType.java +++ b/src/com/google/android/gms/location/places/UserDataType.java @@ -1,36 +1,11 @@ package com.google.android.gms.location.places; -import android.os.Parcel; -import org.microg.safeparcel.SafeParcelUtil; -import org.microg.safeparcel.SafeParcelable; +import org.microg.safeparcel.AutoSafeParcelable; /** * TODO: usage */ -public class UserDataType implements SafeParcelable { - private UserDataType(Parcel in) { - SafeParcelUtil.readObject(this, in); - } +public class UserDataType extends AutoSafeParcelable { - @Override - public int describeContents() { - return 0; - } - - @Override - public void writeToParcel(Parcel out, int flags) { - SafeParcelUtil.writeObject(this, out, flags); - } - - public static final Creator CREATOR = new Creator() { - @Override - public UserDataType createFromParcel(Parcel parcel) { - return new UserDataType(parcel); - } - - @Override - public UserDataType[] newArray(int i) { - return new UserDataType[i]; - } - }; + public static final Creator CREATOR = new AutoCreator<>(UserDataType.class); } diff --git a/src/com/google/android/gms/location/places/internal/PlacesParams.java b/src/com/google/android/gms/location/places/internal/PlacesParams.java index 956c99da..ad739c40 100644 --- a/src/com/google/android/gms/location/places/internal/PlacesParams.java +++ b/src/com/google/android/gms/location/places/internal/PlacesParams.java @@ -1,11 +1,9 @@ package com.google.android.gms.location.places.internal; -import android.os.Parcel; -import org.microg.safeparcel.SafeParcelUtil; -import org.microg.safeparcel.SafeParcelable; +import org.microg.safeparcel.AutoSafeParcelable; import org.microg.safeparcel.SafeParceled; -public class PlacesParams implements SafeParcelable { +public class PlacesParams extends AutoSafeParcelable { @SafeParceled(1000) private final int versionCode; @@ -19,34 +17,9 @@ public class PlacesParams implements SafeParcelable { public final String gCoreClientName; private PlacesParams() { - versionCode = -1; + versionCode = 1; clientPackageName = locale = accountName = gCoreClientName = null; } - private PlacesParams(Parcel in) { - this(); - SafeParcelUtil.readObject(this, in); - } - - @Override - public int describeContents() { - return 0; - } - - @Override - public void writeToParcel(Parcel out, int flags) { - SafeParcelUtil.writeObject(this, out, flags); - } - - public static final Creator CREATOR = new Creator() { - @Override - public PlacesParams createFromParcel(Parcel parcel) { - return new PlacesParams(parcel); - } - - @Override - public PlacesParams[] newArray(int i) { - return new PlacesParams[i]; - } - }; + public static final Creator CREATOR = new AutoCreator<>(PlacesParams.class); } diff --git a/src/com/google/android/gms/maps/GoogleMapOptions.java b/src/com/google/android/gms/maps/GoogleMapOptions.java index 8219b155..19e62bba 100644 --- a/src/com/google/android/gms/maps/GoogleMapOptions.java +++ b/src/com/google/android/gms/maps/GoogleMapOptions.java @@ -16,13 +16,11 @@ package com.google.android.gms.maps; -import android.os.Parcel; import com.google.android.gms.maps.model.CameraPosition; -import org.microg.safeparcel.SafeParcelUtil; -import org.microg.safeparcel.SafeParcelable; +import org.microg.safeparcel.AutoSafeParcelable; import org.microg.safeparcel.SafeParceled; -public final class GoogleMapOptions implements SafeParcelable { +public final class GoogleMapOptions extends AutoSafeParcelable { @SafeParceled(1) private int versionCode; @SafeParceled(2) @@ -46,23 +44,9 @@ public final class GoogleMapOptions implements SafeParcelable { @SafeParceled(11) private boolean rotateGesturesEnabled; - @Override - public int describeContents() { - return 0; - } - - @Override - public void writeToParcel(Parcel dest, int flags) { - SafeParcelUtil.writeObject(this, dest, flags); - } - public GoogleMapOptions() { } - private GoogleMapOptions(Parcel in) { - SafeParcelUtil.readObject(this, in); - } - public int getMapType() { return mapType; } @@ -95,13 +79,5 @@ public final class GoogleMapOptions implements SafeParcelable { return rotateGesturesEnabled; } - public static Creator CREATOR = new Creator() { - public GoogleMapOptions createFromParcel(Parcel source) { - return new GoogleMapOptions(source); - } - - public GoogleMapOptions[] newArray(int size) { - return new GoogleMapOptions[size]; - } - }; + public static Creator CREATOR = new AutoCreator<>(GoogleMapOptions.class); } diff --git a/src/com/google/android/gms/maps/model/CameraPosition.java b/src/com/google/android/gms/maps/model/CameraPosition.java index f9bb0bed..c989ed47 100644 --- a/src/com/google/android/gms/maps/model/CameraPosition.java +++ b/src/com/google/android/gms/maps/model/CameraPosition.java @@ -17,10 +17,8 @@ package com.google.android.gms.maps.model; import android.content.Context; -import android.os.Parcel; import android.util.AttributeSet; -import org.microg.safeparcel.SafeParcelUtil; -import org.microg.safeparcel.SafeParcelable; +import org.microg.safeparcel.AutoSafeParcelable; import org.microg.safeparcel.SafeParceled; import java.util.Arrays; @@ -28,7 +26,7 @@ import java.util.Arrays; /** * An immutable class that aggregates all camera position parameters. */ -public final class CameraPosition implements SafeParcelable { +public final class CameraPosition extends AutoSafeParcelable { @SafeParceled(1) private final int versionCode; /** @@ -60,17 +58,10 @@ public final class CameraPosition implements SafeParcelable { */ private CameraPosition() { target = null; - versionCode = -1; + versionCode = 1; zoom = tilt = bearing = 0; } - private CameraPosition(Parcel in) { - this(); - SafeParcelUtil.readObject(this, in); - if (target == null) - throw new NullPointerException("Target must not be null"); - } - /** * Constructs a CameraPosition. * @@ -126,11 +117,6 @@ public final class CameraPosition implements SafeParcelable { return null; // TODO } - @Override - public int describeContents() { - return 0; - } - @Override public boolean equals(Object o) { if (this == o) @@ -181,20 +167,7 @@ public final class CameraPosition implements SafeParcelable { '}'; } - @Override - public void writeToParcel(Parcel out, int flags) { - SafeParcelUtil.writeObject(this, out, flags); - } - - public static Creator CREATOR = new Creator() { - public CameraPosition createFromParcel(Parcel source) { - return new CameraPosition(source); - } - - public CameraPosition[] newArray(int size) { - return new CameraPosition[size]; - } - }; + public static Creator CREATOR = new AutoCreator<>(CameraPosition.class); /** * Builds camera position. diff --git a/src/com/google/android/gms/maps/model/CircleOptions.java b/src/com/google/android/gms/maps/model/CircleOptions.java index 82f2af58..4002c6b7 100644 --- a/src/com/google/android/gms/maps/model/CircleOptions.java +++ b/src/com/google/android/gms/maps/model/CircleOptions.java @@ -17,15 +17,13 @@ package com.google.android.gms.maps.model; import android.graphics.Color; -import android.os.Parcel; -import org.microg.safeparcel.SafeParcelUtil; -import org.microg.safeparcel.SafeParcelable; +import org.microg.safeparcel.AutoSafeParcelable; import org.microg.safeparcel.SafeParceled; /** * Defines options for a Circle. */ -public class CircleOptions implements SafeParcelable { +public class CircleOptions extends AutoSafeParcelable { @SafeParceled(1) private int versionCode; @SafeParceled(2) @@ -49,15 +47,6 @@ public class CircleOptions implements SafeParcelable { public CircleOptions() { } - private CircleOptions(Parcel in) { - SafeParcelUtil.readObject(this, in); - } - - @Override - public int describeContents() { - return 0; - } - /** * Sets the center using a {@link LatLng}. *

@@ -210,11 +199,6 @@ public class CircleOptions implements SafeParcelable { return this; } - @Override - public void writeToParcel(Parcel out, int flags) { - SafeParcelUtil.writeObject(this, out, flags); - } - /** * Sets the zIndex. *

@@ -230,13 +214,5 @@ public class CircleOptions implements SafeParcelable { return this; } - public static Creator CREATOR = new Creator() { - public CircleOptions createFromParcel(Parcel source) { - return new CircleOptions(source); - } - - public CircleOptions[] newArray(int size) { - return new CircleOptions[size]; - } - }; + public static Creator CREATOR = new AutoCreator<>(CircleOptions.class); } diff --git a/src/com/google/android/gms/maps/model/GroundOverlayOptions.java b/src/com/google/android/gms/maps/model/GroundOverlayOptions.java index 3cf9cfb4..12ede558 100644 --- a/src/com/google/android/gms/maps/model/GroundOverlayOptions.java +++ b/src/com/google/android/gms/maps/model/GroundOverlayOptions.java @@ -17,16 +17,14 @@ package com.google.android.gms.maps.model; import android.os.IBinder; -import android.os.Parcel; import com.google.android.gms.dynamic.ObjectWrapper; -import org.microg.safeparcel.SafeParcelUtil; -import org.microg.safeparcel.SafeParcelable; +import org.microg.safeparcel.AutoSafeParcelable; import org.microg.safeparcel.SafeParceled; /** * Defines options for a ground overlay. */ -public class GroundOverlayOptions implements SafeParcelable { +public class GroundOverlayOptions extends AutoSafeParcelable { /** * Flag for when no dimension is specified for the height. */ @@ -64,10 +62,6 @@ public class GroundOverlayOptions implements SafeParcelable { public GroundOverlayOptions() { } - private GroundOverlayOptions(Parcel in) { - SafeParcelUtil.readObject(this, in); - } - /** * Specifies the anchor to be at a particular point in the image. *

@@ -104,11 +98,6 @@ public class GroundOverlayOptions implements SafeParcelable { return this; } - @Override - public int describeContents() { - return 0; - } - /** * Horizontal distance, normalized to [0, 1], of the anchor from the left edge. * @@ -333,11 +322,6 @@ public class GroundOverlayOptions implements SafeParcelable { return this; } - @Override - public void writeToParcel(Parcel out, int flags) { - SafeParcelUtil.writeObject(this, out, flags); - } - /** * Specifies the ground overlay's zIndex, i.e., the order in which it will be drawn. See the * documentation at the top of this class for more information about zIndex. @@ -349,13 +333,6 @@ public class GroundOverlayOptions implements SafeParcelable { return this; } - public static Creator CREATOR = new Creator() { - public GroundOverlayOptions createFromParcel(Parcel source) { - return new GroundOverlayOptions(source); - } - - public GroundOverlayOptions[] newArray(int size) { - return new GroundOverlayOptions[size]; - } - }; + public static Creator CREATOR = new AutoCreator<>( + GroundOverlayOptions.class); } diff --git a/src/com/google/android/gms/maps/model/LatLng.java b/src/com/google/android/gms/maps/model/LatLng.java index 94a25340..2606b533 100644 --- a/src/com/google/android/gms/maps/model/LatLng.java +++ b/src/com/google/android/gms/maps/model/LatLng.java @@ -16,15 +16,13 @@ package com.google.android.gms.maps.model; -import android.os.Parcel; -import org.microg.safeparcel.SafeParcelUtil; -import org.microg.safeparcel.SafeParcelable; +import org.microg.safeparcel.AutoSafeParcelable; import org.microg.safeparcel.SafeParceled; /** * An immutable class representing a pair of latitude and longitude coordinates, stored as degrees. */ -public final class LatLng implements SafeParcelable { +public final class LatLng extends AutoSafeParcelable { @SafeParceled(1) private final int versionCode; /** @@ -43,15 +41,10 @@ public final class LatLng implements SafeParcelable { * In fact, those are replaced by their real values later using SafeParcelUtil. */ private LatLng() { - versionCode = -1; + versionCode = 1; latitude = longitude = 0; } - private LatLng(Parcel in) { - this(); - SafeParcelUtil.readObject(this, in); - } - /** * Constructs a LatLng with the given latitude and longitude, measured in degrees. * @@ -106,24 +99,6 @@ public final class LatLng implements SafeParcelable { public String toString() { return "lat/lng: (" + latitude + "," + longitude + ")"; } - - @Override - public int describeContents() { - return 0; - } - - @Override - public void writeToParcel(Parcel out, int flags) { - SafeParcelUtil.writeObject(this, out, flags); - } - - public static Creator CREATOR = new Creator() { - public LatLng createFromParcel(Parcel source) { - return new LatLng(source); - } - - public LatLng[] newArray(int size) { - return new LatLng[size]; - } - }; + + public static Creator CREATOR = new AutoCreator<>(LatLng.class); } diff --git a/src/com/google/android/gms/maps/model/LatLngBounds.java b/src/com/google/android/gms/maps/model/LatLngBounds.java index ac849e37..5a6653f5 100644 --- a/src/com/google/android/gms/maps/model/LatLngBounds.java +++ b/src/com/google/android/gms/maps/model/LatLngBounds.java @@ -16,9 +16,7 @@ package com.google.android.gms.maps.model; -import android.os.Parcel; -import org.microg.safeparcel.SafeParcelUtil; -import org.microg.safeparcel.SafeParcelable; +import org.microg.safeparcel.AutoSafeParcelable; import org.microg.safeparcel.SafeParceled; import java.util.Arrays; @@ -26,7 +24,7 @@ import java.util.Arrays; /** * An immutable class representing a latitude/longitude aligned rectangle. */ -public final class LatLngBounds implements SafeParcelable { +public final class LatLngBounds extends AutoSafeParcelable { @SafeParceled(1) private final int versionCode; /** @@ -45,15 +43,10 @@ public final class LatLngBounds implements SafeParcelable { * In fact, those are replaced by their real values later using SafeParcelUtil. */ private LatLngBounds() { - this.versionCode = -1; + this.versionCode = 1; southwest = northeast = null; } - private LatLngBounds(Parcel in) { - this(); - SafeParcelUtil.readObject(this, in); - } - /** * Creates a new bounds based on a southwest and a northeast corner. *

@@ -110,11 +103,6 @@ public final class LatLngBounds implements SafeParcelable { ); } - @Override - public int describeContents() { - return 0; - } - @Override public boolean equals(Object o) { if (this == o) @@ -190,20 +178,7 @@ public final class LatLngBounds implements SafeParcelable { '}'; } - @Override - public void writeToParcel(Parcel out, int flags) { - SafeParcelUtil.writeObject(this, out, flags); - } - - public static Creator CREATOR = new Creator() { - public LatLngBounds createFromParcel(Parcel source) { - return new LatLngBounds(source); - } - - public LatLngBounds[] newArray(int size) { - return new LatLngBounds[size]; - } - }; + public static Creator CREATOR = new AutoCreator<>(LatLngBounds.class); /** * This is a builder that is able to create a minimum bound based on a set of LatLng points. diff --git a/src/com/google/android/gms/maps/model/MarkerOptions.java b/src/com/google/android/gms/maps/model/MarkerOptions.java index b2683731..4a076ac0 100644 --- a/src/com/google/android/gms/maps/model/MarkerOptions.java +++ b/src/com/google/android/gms/maps/model/MarkerOptions.java @@ -17,13 +17,11 @@ package com.google.android.gms.maps.model; import android.os.IBinder; -import android.os.Parcel; import com.google.android.gms.dynamic.ObjectWrapper; -import org.microg.safeparcel.SafeParcelUtil; -import org.microg.safeparcel.SafeParcelable; +import org.microg.safeparcel.AutoSafeParcelable; import org.microg.safeparcel.SafeParceled; -public class MarkerOptions implements SafeParcelable { +public class MarkerOptions extends AutoSafeParcelable { @SafeParceled(1) private int versionCode = 1; @@ -64,15 +62,6 @@ public class MarkerOptions implements SafeParcelable { public MarkerOptions() { } - private MarkerOptions(Parcel in) { - SafeParcelUtil.readObject(this, in); - } - - @Override - public int describeContents() { - return 0; - } - /** * Sets the alpha (opacity) of the marker. This is a value from 0 to 1, where 0 means the * marker is completely transparent and 1 means the marker is completely opaque. @@ -334,18 +323,5 @@ public class MarkerOptions implements SafeParcelable { return this; } - @Override - public void writeToParcel(Parcel dest, int flags) { - SafeParcelUtil.writeObject(this, dest, flags); - } - - public static Creator CREATOR = new Creator() { - public MarkerOptions createFromParcel(Parcel source) { - return new MarkerOptions(source); - } - - public MarkerOptions[] newArray(int size) { - return new MarkerOptions[size]; - } - }; + public static Creator CREATOR = new AutoCreator<>(MarkerOptions.class); } diff --git a/src/com/google/android/gms/maps/model/PolygonOptions.java b/src/com/google/android/gms/maps/model/PolygonOptions.java index 8898f11e..b74d2ea0 100644 --- a/src/com/google/android/gms/maps/model/PolygonOptions.java +++ b/src/com/google/android/gms/maps/model/PolygonOptions.java @@ -16,39 +16,15 @@ package com.google.android.gms.maps.model; -import android.os.Parcel; -import org.microg.safeparcel.SafeParcelUtil; -import org.microg.safeparcel.SafeParcelable; +import org.microg.safeparcel.AutoSafeParcelable; /** * Defines options for a polygon. * TODO */ -public class PolygonOptions implements SafeParcelable { - @Override - public int describeContents() { - return 0; - } - - @Override - public void writeToParcel(Parcel dest, int flags) { - SafeParcelUtil.writeObject(this, dest, flags); - } - +public class PolygonOptions extends AutoSafeParcelable { public PolygonOptions() { } - private PolygonOptions(Parcel in) { - SafeParcelUtil.readObject(this, in); - } - - public static Creator CREATOR = new Creator() { - public PolygonOptions createFromParcel(Parcel source) { - return new PolygonOptions(source); - } - - public PolygonOptions[] newArray(int size) { - return new PolygonOptions[size]; - } - }; + public static Creator CREATOR = new AutoCreator<>(PolygonOptions.class); } diff --git a/src/com/google/android/gms/maps/model/PolylineOptions.java b/src/com/google/android/gms/maps/model/PolylineOptions.java index 5e861b7e..2a06e96a 100644 --- a/src/com/google/android/gms/maps/model/PolylineOptions.java +++ b/src/com/google/android/gms/maps/model/PolylineOptions.java @@ -16,9 +16,7 @@ package com.google.android.gms.maps.model; -import android.os.Parcel; -import org.microg.safeparcel.SafeParcelUtil; -import org.microg.safeparcel.SafeParcelable; +import org.microg.safeparcel.AutoSafeParcelable; import org.microg.safeparcel.SafeParceled; import java.util.List; @@ -27,7 +25,7 @@ import java.util.List; * Defines options for a polyline. * TODO */ -public class PolylineOptions implements SafeParcelable { +public class PolylineOptions extends AutoSafeParcelable { @SafeParceled(1) private int versionCode; // TODO @@ -41,27 +39,5 @@ public class PolylineOptions implements SafeParcelable { public PolylineOptions() { } - private PolylineOptions(Parcel in) { - SafeParcelUtil.readObject(this, in); - } - - @Override - public int describeContents() { - return 0; - } - - @Override - public void writeToParcel(Parcel dest, int flags) { - SafeParcelUtil.writeObject(this, dest, flags); - } - - public static Creator CREATOR = new Creator() { - public PolylineOptions createFromParcel(Parcel source) { - return new PolylineOptions(source); - } - - public PolylineOptions[] newArray(int size) { - return new PolylineOptions[size]; - } - }; + public static Creator CREATOR = new AutoCreator<>(PolylineOptions.class); } diff --git a/src/com/google/android/gms/maps/model/Tile.java b/src/com/google/android/gms/maps/model/Tile.java index 9ba8b612..a3062e5f 100644 --- a/src/com/google/android/gms/maps/model/Tile.java +++ b/src/com/google/android/gms/maps/model/Tile.java @@ -1,15 +1,13 @@ package com.google.android.gms.maps.model; -import android.os.Parcel; -import org.microg.safeparcel.SafeParcelUtil; -import org.microg.safeparcel.SafeParcelable; +import org.microg.safeparcel.AutoSafeParcelable; import org.microg.safeparcel.SafeParceled; /** * Contains information about a Tile that is returned by a {@link TileProvider}. * TODO SafeParceled */ -public class Tile implements SafeParcelable { +public class Tile extends AutoSafeParcelable { @SafeParceled(1) private final int versionCode; /** @@ -30,16 +28,11 @@ public class Tile implements SafeParcelable { public final byte[] data; private Tile() { - versionCode = -1; + versionCode = 1; width = height = 0; data = null; } - private Tile(Parcel in) { - this(); - SafeParcelUtil.readObject(this, in); - } - /** * Constructs a {@link Tile}. * @@ -56,23 +49,5 @@ public class Tile implements SafeParcelable { this.data = data; } - @Override - public int describeContents() { - return 0; - } - - @Override - public void writeToParcel(Parcel out, int flags) { - SafeParcelUtil.writeObject(this, out, flags); - } - - public static Creator CREATOR = new Creator() { - public Tile createFromParcel(Parcel source) { - return new Tile(source); - } - - public Tile[] newArray(int size) { - return new Tile[size]; - } - }; + public static Creator CREATOR = new AutoCreator<>(Tile.class); } diff --git a/src/com/google/android/gms/maps/model/TileOverlayOptions.java b/src/com/google/android/gms/maps/model/TileOverlayOptions.java index b38a5dce..15523837 100644 --- a/src/com/google/android/gms/maps/model/TileOverlayOptions.java +++ b/src/com/google/android/gms/maps/model/TileOverlayOptions.java @@ -17,17 +17,15 @@ package com.google.android.gms.maps.model; import android.os.IBinder; -import android.os.Parcel; import android.os.RemoteException; import com.google.android.gms.maps.model.internal.ITileProviderDelegate; -import org.microg.safeparcel.SafeParcelUtil; -import org.microg.safeparcel.SafeParcelable; +import org.microg.safeparcel.AutoSafeParcelable; import org.microg.safeparcel.SafeParceled; /** * Defines options for a TileOverlay. */ -public class TileOverlayOptions implements SafeParcelable { +public class TileOverlayOptions extends AutoSafeParcelable { @SafeParceled(1) private final int versionCode = 1; @@ -50,15 +48,6 @@ public class TileOverlayOptions implements SafeParcelable { public TileOverlayOptions() { } - private TileOverlayOptions(Parcel in) { - SafeParcelUtil.readObject(this, in); - } - - @Override - public int describeContents() { - return 0; - } - /** * Specifies whether the tiles should fade in. The default is {@code true}. * @@ -132,11 +121,6 @@ public class TileOverlayOptions implements SafeParcelable { return this; } - @Override - public void writeToParcel(Parcel dest, int flags) { - SafeParcelUtil.writeObject(this, dest, flags); - } - /** * Specifies the tile overlay's zIndex, i.e., the order in which it will be drawn where * overlays with larger values are drawn above those with lower values. See the documentation @@ -149,13 +133,5 @@ public class TileOverlayOptions implements SafeParcelable { return this; } - public static Creator CREATOR = new Creator() { - public TileOverlayOptions createFromParcel(Parcel source) { - return new TileOverlayOptions(source); - } - - public TileOverlayOptions[] newArray(int size) { - return new TileOverlayOptions[size]; - } - }; + public static Creator CREATOR = new AutoCreator<>(TileOverlayOptions.class); } diff --git a/src/com/google/android/gms/maps/model/VisibleRegion.java b/src/com/google/android/gms/maps/model/VisibleRegion.java index 7f96402f..43f161db 100644 --- a/src/com/google/android/gms/maps/model/VisibleRegion.java +++ b/src/com/google/android/gms/maps/model/VisibleRegion.java @@ -16,12 +16,10 @@ package com.google.android.gms.maps.model; -import android.os.Parcel; -import org.microg.safeparcel.SafeParcelUtil; -import org.microg.safeparcel.SafeParcelable; +import org.microg.safeparcel.AutoSafeParcelable; import org.microg.safeparcel.SafeParceled; -public class VisibleRegion implements SafeParcelable { +public class VisibleRegion extends AutoSafeParcelable { @SafeParceled(1) private int versionCode; @SafeParceled(2) @@ -35,6 +33,9 @@ public class VisibleRegion implements SafeParcelable { @SafeParceled(6) private LatLngBounds bounds; + private VisibleRegion() { + } + public VisibleRegion(int versionCode, LatLng nearLeft, LatLng nearRight, LatLng farLeft, LatLng farRight, LatLngBounds bounds) { this.versionCode = versionCode; @@ -60,27 +61,5 @@ public class VisibleRegion implements SafeParcelable { bounds); } - public VisibleRegion(Parcel in) { - SafeParcelUtil.readObject(this, in); - } - - @Override - public int describeContents() { - return 0; - } - - @Override - public void writeToParcel(Parcel dest, int flags) { - SafeParcelUtil.writeObject(this, dest, flags); - } - - public static Creator CREATOR = new Creator() { - public VisibleRegion createFromParcel(Parcel source) { - return new VisibleRegion(source); - } - - public VisibleRegion[] newArray(int size) { - return new VisibleRegion[size]; - } - }; + public static Creator CREATOR = new AutoCreator<>(VisibleRegion.class); } diff --git a/src/org/microg/gms/Constants.java b/src/org/microg/gms/Constants.java index 9ff2f907..a855bbc5 100644 --- a/src/org/microg/gms/Constants.java +++ b/src/org/microg/gms/Constants.java @@ -8,6 +8,7 @@ public class Constants { public static final int MAX_REFERENCE_VERSION = 6599436; public static final String ACTION_GMS_LOCATION_MANAGER_SERVICE_START = "com.google.android.location.internal.GoogleLocationManagerService.START"; public static final String KEY_MOCK_LOCATION = "mockLocation"; + public static final String DEFAULT_ACCOUNT = "<>"; /** * No base map tiles. From d2fb7d569ba160ea251b9b8edc931561c6984f2f Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Thu, 15 Jan 2015 20:11:31 +0100 Subject: [PATCH 012/293] WIP: Location API --- AndroidManifest.xml | 6 +- .../gms/common/GooglePlayServicesClient.java | 40 +++++ .../gms/common/GooglePlayServicesUtil.java | 3 +- .../google/android/gms/common/api/Api.java | 27 ++- .../gms/common/api/GoogleApiClient.java | 58 +++++-- .../google/android/gms/common/api/Result.java | 8 - .../google/android/gms/common/api/Status.java | 13 -- .../location/FusedLocationProviderApi.java | 33 ++++ .../android/gms/location/GeofencingApi.java | 4 + .../android/gms/location/LocationClient.java | 78 +++++++++ .../gms/location/LocationListener.java | 4 + .../gms/location/LocationServices.java | 28 ++++ .../common/ForwardConnectionCallbacks.java | 35 ++++ .../ForwardConnectionFailedListener.java | 31 ++++ src/org/microg/gms/common/GmsClient.java | 105 ++++++++++++ .../gms/common/MultiConnectionKeeper.java | 136 +++++++++++++++ .../gms/common/api/AbstractPendingResult.java | 95 +++++++++++ .../gms/common/api/CallbackHandler.java | 42 +++++ .../gms/common/api/GoogleApiClientImpl.java | 155 ++++++++++++++++++ .../FusedLocationProviderApiImpl.java | 72 ++++++++ .../gms/location/GeofencingApiImpl.java | 6 + .../location/GoogleLocationManagerClient.java | 35 ++++ .../gms/location/LocationClientImpl.java | 61 +++++++ 23 files changed, 1035 insertions(+), 40 deletions(-) create mode 100644 src/com/google/android/gms/common/GooglePlayServicesClient.java delete mode 100644 src/com/google/android/gms/common/api/Result.java delete mode 100644 src/com/google/android/gms/common/api/Status.java create mode 100644 src/com/google/android/gms/location/FusedLocationProviderApi.java create mode 100644 src/com/google/android/gms/location/GeofencingApi.java create mode 100644 src/com/google/android/gms/location/LocationClient.java create mode 100644 src/com/google/android/gms/location/LocationListener.java create mode 100644 src/com/google/android/gms/location/LocationServices.java create mode 100644 src/org/microg/gms/common/ForwardConnectionCallbacks.java create mode 100644 src/org/microg/gms/common/ForwardConnectionFailedListener.java create mode 100644 src/org/microg/gms/common/GmsClient.java create mode 100644 src/org/microg/gms/common/MultiConnectionKeeper.java create mode 100644 src/org/microg/gms/common/api/AbstractPendingResult.java create mode 100644 src/org/microg/gms/common/api/CallbackHandler.java create mode 100644 src/org/microg/gms/common/api/GoogleApiClientImpl.java create mode 100644 src/org/microg/gms/location/FusedLocationProviderApiImpl.java create mode 100644 src/org/microg/gms/location/GeofencingApiImpl.java create mode 100644 src/org/microg/gms/location/GoogleLocationManagerClient.java create mode 100644 src/org/microg/gms/location/LocationClientImpl.java diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 16e3856e..7c0e18bf 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -1,4 +1,6 @@ - - + + + diff --git a/src/com/google/android/gms/common/GooglePlayServicesClient.java b/src/com/google/android/gms/common/GooglePlayServicesClient.java new file mode 100644 index 00000000..9796592f --- /dev/null +++ b/src/com/google/android/gms/common/GooglePlayServicesClient.java @@ -0,0 +1,40 @@ +package com.google.android.gms.common; + +import android.os.Bundle; + +@Deprecated +public interface GooglePlayServicesClient { + void connect(); + + void disconnect(); + + boolean isConnected(); + + boolean isConnecting(); + + void registerConnectionCallbacks(ConnectionCallbacks listener); + + boolean isConnectionCallbacksRegistered(ConnectionCallbacks listener); + + void unregisterConnectionCallbacks(ConnectionCallbacks listener); + + void registerConnectionFailedListener(OnConnectionFailedListener listener); + + boolean isConnectionFailedListenerRegistered(OnConnectionFailedListener listener); + + void unregisterConnectionFailedListener(OnConnectionFailedListener listener); + + @Deprecated + public interface OnConnectionFailedListener { + + void onConnectionFailed(ConnectionResult result); + } + + @Deprecated + public interface ConnectionCallbacks { + + void onConnected(Bundle connectionHint); + + void onDisconnected(); + } +} diff --git a/src/com/google/android/gms/common/GooglePlayServicesUtil.java b/src/com/google/android/gms/common/GooglePlayServicesUtil.java index c4d83b21..a32adf04 100644 --- a/src/com/google/android/gms/common/GooglePlayServicesUtil.java +++ b/src/com/google/android/gms/common/GooglePlayServicesUtil.java @@ -49,7 +49,8 @@ public class GooglePlayServicesUtil { } public static int isGooglePlayServicesAvailable(Context context) { - return 0; // TODO + // As we can't know right now if the later desired feature is available, we just pretend it to be. + return ConnectionResult.SUCCESS; } public static boolean isGoogleSignedUid(PackageManager packageManager, int uid) { diff --git a/src/com/google/android/gms/common/api/Api.java b/src/com/google/android/gms/common/api/Api.java index 5d7e45ab..d094fdd0 100644 --- a/src/com/google/android/gms/common/api/Api.java +++ b/src/com/google/android/gms/common/api/Api.java @@ -1,5 +1,8 @@ package com.google.android.gms.common.api; +import android.content.Context; +import android.os.Looper; + /** * Describes a section of the Google Play Services API that should be made available. Instances of * this should be passed into {@link GoogleApiClient.Builder#addApi(Api)} to enable the appropriate @@ -13,6 +16,16 @@ package com.google.android.gms.common.api; * See {@link GoogleApiClient.Builder} for usage examples. */ public final class Api { + + private final Builder builder; + + public Api(Builder builder) { + this.builder = builder; + } + + public Builder getBuilder() { + return builder; + } /** * Base interface for API options. These are used to configure specific parameters for @@ -34,7 +47,7 @@ public final class Api { /** * {@link ApiOptions} implementation for {@link Api}s that do not take any options. */ - public class NoOptions implements NotRequiredOptions { + public final class NoOptions implements NotRequiredOptions { } /** @@ -43,4 +56,16 @@ public final class Api { public interface Optional extends HasOptions, NotRequiredOptions { } } + + public interface Connection { + public void connect(); + public void disconnect(); + public boolean isConnected(); + } + + public interface Builder { + Connection build(Context context, Looper looper, O options, AccountInfo accountInfo, + GoogleApiClient.ConnectionCallbacks callbacks, + GoogleApiClient.OnConnectionFailedListener connectionFailedListener); + } } diff --git a/src/com/google/android/gms/common/api/GoogleApiClient.java b/src/com/google/android/gms/common/api/GoogleApiClient.java index a6029a6d..3f024457 100644 --- a/src/com/google/android/gms/common/api/GoogleApiClient.java +++ b/src/com/google/android/gms/common/api/GoogleApiClient.java @@ -3,12 +3,19 @@ package com.google.android.gms.common.api; import android.app.Activity; import android.content.Context; import android.os.Bundle; +import android.os.Handler; +import android.os.Looper; import android.support.v4.app.FragmentActivity; import android.view.View; import com.google.android.gms.common.ConnectionResult; +import org.microg.gms.Constants; +import org.microg.gms.common.api.GoogleApiClientImpl; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; import java.util.concurrent.TimeUnit; -import java.util.logging.Handler; /** * The main entry point for Google Play services integration. @@ -209,13 +216,27 @@ public interface GoogleApiClient { * Builder to configure a {@link GoogleApiClient}. */ public class Builder { + private final Context context; + private final Map apis = new HashMap<>(); + private final Set connectionCallbacks = new HashSet<>(); + private final Set connectionFailedListeners = new HashSet<>(); + private final Set scopes = new HashSet<>(); + private String accountName; + private int clientId = -1; + private FragmentActivity fragmentActivity; + private Looper looper; + private int gravityForPopups; + private OnConnectionFailedListener unresolvedConnectionFailedListener; + private View viewForPopups; + /** * Builder to help construct the {@link GoogleApiClient} object. * * @param context The context to use for the connection. */ public Builder(Context context) { - + this.context = context; + this.looper = context.getMainLooper(); } /** @@ -242,7 +263,7 @@ public interface GoogleApiClient { * @see Api */ public Builder addApi(Api api, O options) { - // TODO + apis.put(api, options); return this; } @@ -253,7 +274,7 @@ public interface GoogleApiClient { * @see Api */ public Builder addApi(Api api) { - // TODO + apis.put(api, null); return this; } @@ -273,7 +294,7 @@ public interface GoogleApiClient { * call are delivered. */ public Builder addConnectionCallbacks(ConnectionCallbacks listener) { - // TODO + connectionCallbacks.add(listener); return this; } @@ -293,7 +314,7 @@ public interface GoogleApiClient { * call are delivered. */ public Builder addOnConnectionFailedListener(OnConnectionFailedListener listener) { - // TODO + connectionFailedListeners.add(listener); return this; } @@ -305,7 +326,7 @@ public interface GoogleApiClient { * @see com.google.android.gms.common.Scopes */ public Builder addScope(Scope scope) { - // TODO + scopes.add(scope.getScopeUri()); return this; } @@ -315,13 +336,20 @@ public interface GoogleApiClient { * @return The {@link GoogleApiClient} object. */ public GoogleApiClient build() { - return null; // TODO + return new GoogleApiClientImpl(context, looper, getAccountInfo(), apis, + connectionCallbacks, connectionFailedListeners, clientId); + } + + private AccountInfo getAccountInfo() { + return null; } public Builder enableAutoManage(FragmentActivity fragmentActivity, int cliendId, OnConnectionFailedListener unresolvedConnectionFailedListener) throws NullPointerException, IllegalArgumentException, IllegalStateException { - // TODO + this.fragmentActivity = fragmentActivity; + this.clientId = cliendId; + this.unresolvedConnectionFailedListener = unresolvedConnectionFailedListener; return this; } @@ -334,7 +362,7 @@ public interface GoogleApiClient { * {@link GoogleApiClient}. */ public Builder setAccountName(String accountName) { - // TODO + this.accountName = accountName; return this; } @@ -345,7 +373,7 @@ public interface GoogleApiClient { * @param gravityForPopups The gravity which controls the placement of games service popups. */ public Builder setGravityForPopups(int gravityForPopups) { - // TODO + this.gravityForPopups = gravityForPopups; return this; } @@ -355,7 +383,7 @@ public interface GoogleApiClient { * thread will be used. */ public Builder setHandler(Handler handler) { - // TODO + this.looper = handler.getLooper(); return this; } @@ -365,7 +393,7 @@ public interface GoogleApiClient { * @param viewForPopups The view to use as a content view for popups. View cannot be null. */ public Builder setViewForPopups(View viewForPopups) { - // TODO + this.viewForPopups = viewForPopups; return this; } @@ -373,13 +401,13 @@ public interface GoogleApiClient { * Specify that the default account should be used when connecting to services. */ public Builder useDefaultAccount() { - // TODO + this.accountName = Constants.DEFAULT_ACCOUNT; return this; } } /** - * Provides callbacks that are called when the client is connected or disconnected from the + * Provides callbacks that are called when the client is connected or disconnected from the * service. Most applications implement {@link #onConnected(Bundle)} to start making requests. */ public interface ConnectionCallbacks { diff --git a/src/com/google/android/gms/common/api/Result.java b/src/com/google/android/gms/common/api/Result.java deleted file mode 100644 index d8408112..00000000 --- a/src/com/google/android/gms/common/api/Result.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.google.android.gms.common.api; - -/** - * Represents the final result of invoking an API method in Google Play Services. - */ -public interface Result { - public Status getStatus(); -} diff --git a/src/com/google/android/gms/common/api/Status.java b/src/com/google/android/gms/common/api/Status.java deleted file mode 100644 index ae65e646..00000000 --- a/src/com/google/android/gms/common/api/Status.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.google.android.gms.common.api; - -/** - * Represents the results of work. - *

- * TODO: content (is this IPC API?) - */ -public final class Status implements Result { - @Override - public Status getStatus() { - return this; - } -} diff --git a/src/com/google/android/gms/location/FusedLocationProviderApi.java b/src/com/google/android/gms/location/FusedLocationProviderApi.java new file mode 100644 index 00000000..5d5ba084 --- /dev/null +++ b/src/com/google/android/gms/location/FusedLocationProviderApi.java @@ -0,0 +1,33 @@ +package com.google.android.gms.location; + +import android.app.PendingIntent; +import android.location.Location; +import android.os.Looper; +import com.google.android.gms.common.api.GoogleApiClient; +import com.google.android.gms.common.api.PendingResult; +import org.microg.gms.Constants; + +public interface FusedLocationProviderApi { + String KEY_LOCATION_CHANGED = "com.google.android.location.LOCATION"; + String KEY_MOCK_LOCATION = Constants.KEY_MOCK_LOCATION; + + public Location getLastLocation(GoogleApiClient client); + + public PendingResult requestLocationUpdates(GoogleApiClient client, LocationRequest request, + LocationListener listener); + + public PendingResult requestLocationUpdates(GoogleApiClient client, LocationRequest request, + LocationListener listener, Looper looper); + + public PendingResult requestLocationUpdates(GoogleApiClient client, LocationRequest request, + PendingIntent callbackIntent); + + public PendingResult removeLocationUpdates(GoogleApiClient client, LocationListener listener); + + public PendingResult removeLocationUpdates(GoogleApiClient client, + PendingIntent callbackIntent); + + public PendingResult setMockMode(GoogleApiClient client, boolean isMockMode); + + public PendingResult setMockLocation(GoogleApiClient client, Location mockLocation); +} diff --git a/src/com/google/android/gms/location/GeofencingApi.java b/src/com/google/android/gms/location/GeofencingApi.java new file mode 100644 index 00000000..fe2f8762 --- /dev/null +++ b/src/com/google/android/gms/location/GeofencingApi.java @@ -0,0 +1,4 @@ +package com.google.android.gms.location; + +public interface GeofencingApi { +} diff --git a/src/com/google/android/gms/location/LocationClient.java b/src/com/google/android/gms/location/LocationClient.java new file mode 100644 index 00000000..b3072880 --- /dev/null +++ b/src/com/google/android/gms/location/LocationClient.java @@ -0,0 +1,78 @@ +package com.google.android.gms.location; + +import android.content.Context; +import com.google.android.gms.common.GooglePlayServicesClient; +import com.google.android.gms.common.api.GoogleApiClient; +import org.microg.gms.common.ForwardConnectionCallbacks; +import org.microg.gms.common.ForwardConnectionFailedListener; + +@Deprecated +public class LocationClient implements GooglePlayServicesClient { + private GoogleApiClient googleApiClient; + + public LocationClient(Context context, ConnectionCallbacks callbacks) { + googleApiClient = new GoogleApiClient.Builder(context) + .addApi(LocationServices.API) + .addConnectionCallbacks(new ForwardConnectionCallbacks(callbacks)) + .build(); + } + + @Override + public void connect() { + googleApiClient.connect(); + } + + @Override + public void disconnect() { + googleApiClient.disconnect(); + } + + @Override + public boolean isConnected() { + return googleApiClient.isConnected(); + } + + @Override + public boolean isConnecting() { + return googleApiClient.isConnecting(); + } + + @Override + public void registerConnectionCallbacks(final ConnectionCallbacks listener) { + googleApiClient.registerConnectionCallbacks(new ForwardConnectionCallbacks(listener)); + } + + @Override + public boolean isConnectionCallbacksRegistered(ConnectionCallbacks listener) { + return googleApiClient + .isConnectionCallbacksRegistered(new ForwardConnectionCallbacks(listener)); + } + + @Override + public void unregisterConnectionCallbacks( + ConnectionCallbacks listener) { + googleApiClient.unregisterConnectionCallbacks(new ForwardConnectionCallbacks(listener)); + } + + @Override + public void registerConnectionFailedListener( + OnConnectionFailedListener listener) { + googleApiClient.registerConnectionFailedListener( + new ForwardConnectionFailedListener(listener)); + } + + @Override + public boolean isConnectionFailedListenerRegistered( + OnConnectionFailedListener listener) { + return googleApiClient.isConnectionFailedListenerRegistered( + new ForwardConnectionFailedListener(listener)); + } + + @Override + public void unregisterConnectionFailedListener( + OnConnectionFailedListener listener) { + googleApiClient.unregisterConnectionFailedListener( + new ForwardConnectionFailedListener(listener)); + } + +} diff --git a/src/com/google/android/gms/location/LocationListener.java b/src/com/google/android/gms/location/LocationListener.java new file mode 100644 index 00000000..63603d67 --- /dev/null +++ b/src/com/google/android/gms/location/LocationListener.java @@ -0,0 +1,4 @@ +package com.google.android.gms.location; + +public interface LocationListener { +} diff --git a/src/com/google/android/gms/location/LocationServices.java b/src/com/google/android/gms/location/LocationServices.java new file mode 100644 index 00000000..ced08aa6 --- /dev/null +++ b/src/com/google/android/gms/location/LocationServices.java @@ -0,0 +1,28 @@ +package com.google.android.gms.location; + +import android.content.Context; +import android.os.Looper; +import com.google.android.gms.common.api.AccountInfo; +import com.google.android.gms.common.api.Api; +import com.google.android.gms.common.api.GoogleApiClient; +import org.microg.gms.location.FusedLocationProviderApiImpl; +import org.microg.gms.location.GeofencingApiImpl; +import org.microg.gms.location.LocationClientImpl; + +/** + * The main entry point for location services integration. + */ +public class LocationServices { + public static final Api API = new Api<>( + new Api.Builder() { + @Override + public Api.Connection build(Context context, Looper looper, + Api.ApiOptions.NoOptions options, + AccountInfo accountInfo, GoogleApiClient.ConnectionCallbacks callbacks, + GoogleApiClient.OnConnectionFailedListener connectionFailedListener) { + return new LocationClientImpl(context); + } + }); + public static final FusedLocationProviderApi FusedLocationApi = new FusedLocationProviderApiImpl(); + public static final GeofencingApi GeofencingApi = new GeofencingApiImpl(); +} diff --git a/src/org/microg/gms/common/ForwardConnectionCallbacks.java b/src/org/microg/gms/common/ForwardConnectionCallbacks.java new file mode 100644 index 00000000..026b9340 --- /dev/null +++ b/src/org/microg/gms/common/ForwardConnectionCallbacks.java @@ -0,0 +1,35 @@ +package org.microg.gms.common; + +import android.os.Bundle; +import com.google.android.gms.common.GooglePlayServicesClient; +import com.google.android.gms.common.api.GoogleApiClient; +import com.google.android.gms.location.LocationClient; + +public final class ForwardConnectionCallbacks implements GoogleApiClient.ConnectionCallbacks { + private final GooglePlayServicesClient.ConnectionCallbacks callbacks; + + public ForwardConnectionCallbacks(GooglePlayServicesClient.ConnectionCallbacks callbacks) { + this.callbacks = callbacks; + } + + @Override + public boolean equals(Object o) { + return o instanceof ForwardConnectionCallbacks && + callbacks.equals(((ForwardConnectionCallbacks) o).callbacks); + } + + @Override + public int hashCode() { + return callbacks.hashCode(); + } + + @Override + public void onConnected(Bundle connectionHint) { + callbacks.onConnected(connectionHint); + } + + @Override + public void onConnectionSuspended(int cause) { + callbacks.onDisconnected(); + } +} diff --git a/src/org/microg/gms/common/ForwardConnectionFailedListener.java b/src/org/microg/gms/common/ForwardConnectionFailedListener.java new file mode 100644 index 00000000..273383f9 --- /dev/null +++ b/src/org/microg/gms/common/ForwardConnectionFailedListener.java @@ -0,0 +1,31 @@ +package org.microg.gms.common; + +import com.google.android.gms.common.ConnectionResult; +import com.google.android.gms.common.GooglePlayServicesClient; +import com.google.android.gms.common.api.GoogleApiClient; + +public final class ForwardConnectionFailedListener + implements GoogleApiClient.OnConnectionFailedListener { + private final GooglePlayServicesClient.OnConnectionFailedListener listener; + + public ForwardConnectionFailedListener( + GooglePlayServicesClient.OnConnectionFailedListener listener) { + this.listener = listener; + } + + @Override + public boolean equals(Object o) { + return o instanceof ForwardConnectionFailedListener && + listener.equals(((ForwardConnectionFailedListener) o).listener); + } + + @Override + public int hashCode() { + return listener.hashCode(); + } + + @Override + public void onConnectionFailed(ConnectionResult result) { + listener.onConnectionFailed(result); + } +} diff --git a/src/org/microg/gms/common/GmsClient.java b/src/org/microg/gms/common/GmsClient.java new file mode 100644 index 00000000..046c2e36 --- /dev/null +++ b/src/org/microg/gms/common/GmsClient.java @@ -0,0 +1,105 @@ +package org.microg.gms.common; + +import android.content.ComponentName; +import android.content.Context; +import android.content.ServiceConnection; +import android.os.Bundle; +import android.os.IBinder; +import android.os.IInterface; +import android.os.RemoteException; +import com.google.android.gms.common.ConnectionResult; +import com.google.android.gms.common.GooglePlayServicesUtil; +import com.google.android.gms.common.api.Api; +import com.google.android.gms.common.internal.IGmsCallbacks; +import com.google.android.gms.common.internal.IGmsServiceBroker; + +public abstract class GmsClient implements Api.Connection { + private static final String TAG = "GmsClient"; + + private final Context context; + private ConnectionState state = ConnectionState.CONNECTED; + private ServiceConnection serviceConnection; + private I serviceInterface; + + public GmsClient(Context context) { + this.context = context; + } + + protected abstract String getActionString(); + + protected abstract void onConnectedToBroker(IGmsServiceBroker broker, GmsCallbacks callbacks) + throws RemoteException; + + protected abstract I interfaceFromBinder(IBinder binder); + + @Override + public void connect() { + state = ConnectionState.CONNECTING; + if (GooglePlayServicesUtil.isGooglePlayServicesAvailable(context) != + ConnectionResult.SUCCESS) { + state = ConnectionState.NOT_CONNECTED; + } else { + if (serviceConnection != null) { + MultiConnectionKeeper.getInstance(context) + .unbind(getActionString(), serviceConnection); + } + serviceConnection = new GmsServiceConnection(); + MultiConnectionKeeper.getInstance(context).bind(getActionString(), + serviceConnection); + } + } + + @Override + public void disconnect() { + serviceInterface = null; + if (serviceConnection != null) { + MultiConnectionKeeper.getInstance(context).unbind(getActionString(), serviceConnection); + serviceConnection = null; + } + state = ConnectionState.NOT_CONNECTED; + } + + @Override + public boolean isConnected() { + return state == ConnectionState.CONNECTED; + } + + public Context getContext() { + return context; + } + + public I getServiceInterface() { + return serviceInterface; + } + + private enum ConnectionState { + NOT_CONNECTED, CONNECTING, CONNECTED, ERROR + } + + private class GmsServiceConnection implements ServiceConnection { + + @Override + public void onServiceConnected(ComponentName componentName, IBinder iBinder) { + try { + onConnectedToBroker(IGmsServiceBroker.Stub.asInterface(iBinder), new GmsCallbacks()); + } catch (RemoteException e) { + disconnect(); + } + } + + @Override + public void onServiceDisconnected(ComponentName componentName) { + state = ConnectionState.ERROR; + } + } + + public class GmsCallbacks extends IGmsCallbacks.Stub { + + @Override + public void onPostInitComplete(int statusCode, IBinder binder, Bundle params) + throws RemoteException { + serviceInterface = interfaceFromBinder(binder); + } + } + +} diff --git a/src/org/microg/gms/common/MultiConnectionKeeper.java b/src/org/microg/gms/common/MultiConnectionKeeper.java new file mode 100644 index 00000000..459b9ccd --- /dev/null +++ b/src/org/microg/gms/common/MultiConnectionKeeper.java @@ -0,0 +1,136 @@ +package org.microg.gms.common; + +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.content.ServiceConnection; +import android.os.IBinder; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +import static org.microg.gms.Constants.GMS_PACKAGE_NAME; + +public class MultiConnectionKeeper { + private static MultiConnectionKeeper INSTANCE; + + private final Context context; + private final Map connections = new HashMap<>(); + + public MultiConnectionKeeper(Context context) { + this.context = context; + } + + public static MultiConnectionKeeper getInstance(Context context) { + if (INSTANCE == null) + INSTANCE = new MultiConnectionKeeper(context); + return INSTANCE; + } + + public boolean bind(String action, ServiceConnection connection) { + Connection con = connections.get(action); + if (con != null) { + if (!con.forwardsConnection(connection)) { + con.addConnectionForward(connection); + if (!con.isBound()) + con.bind(); + } + } else { + con = new Connection(action); + con.addConnectionForward(connection); + con.bind(); + connections.put(action, con); + } + return con.isBound(); + } + + public void unbind(String action, ServiceConnection connection) { + Connection con = connections.get(action); + if (con != null) { + con.removeConnectionForward(connection); + if (!con.hasForwards() && con.isBound()) { + con.unbind(); + } + } + } + + public class Connection { + private final String actionString; + private final Set connectionForwards = new HashSet<>(); + private boolean bound = false; + private boolean connected = false; + private IBinder binder; + private ComponentName component; + private ServiceConnection serviceConnection = new ServiceConnection() { + @Override + public void onServiceConnected(ComponentName componentName, IBinder iBinder) { + binder = iBinder; + component = componentName; + for (ServiceConnection connection : connectionForwards) { + connection.onServiceConnected(componentName, iBinder); + } + connected = true; + } + + @Override + public void onServiceDisconnected(ComponentName componentName) { + binder = null; + component = componentName; + for (ServiceConnection connection : connectionForwards) { + connection.onServiceDisconnected(componentName); + } + connected = false; + } + }; + + public Connection(String actionString) { + this.actionString = actionString; + } + + public void bind() { + Intent intent = new Intent(actionString).setPackage(GMS_PACKAGE_NAME); + bound = context.bindService(intent, serviceConnection, + Context.BIND_ADJUST_WITH_ACTIVITY & Context.BIND_AUTO_CREATE); + if (!bound) { + context.unbindService(serviceConnection); + } + } + + public boolean isBound() { + return bound; + } + + public IBinder getBinder() { + return binder; + } + + public void unbind() { + context.unbindService(serviceConnection); + bound = false; + } + + public void addConnectionForward(ServiceConnection connection) { + connectionForwards.add(connection); + if (connected) { + connection.onServiceConnected(component, binder); + } + } + + public void removeConnectionForward(ServiceConnection connection) { + connectionForwards.remove(connection); + if (connected) { + connection.onServiceDisconnected(component); + } + } + + public boolean forwardsConnection(ServiceConnection connection) { + return connectionForwards.contains(connection); + } + + public boolean hasForwards() { + return !connectionForwards.isEmpty(); + } + } +} diff --git a/src/org/microg/gms/common/api/AbstractPendingResult.java b/src/org/microg/gms/common/api/AbstractPendingResult.java new file mode 100644 index 00000000..dfb00a86 --- /dev/null +++ b/src/org/microg/gms/common/api/AbstractPendingResult.java @@ -0,0 +1,95 @@ +package org.microg.gms.common.api; + +import android.os.Looper; +import com.google.android.gms.common.api.PendingResult; +import com.google.android.gms.common.api.Result; +import com.google.android.gms.common.api.ResultCallback; + +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; + +public class AbstractPendingResult implements PendingResult { + private final Object lock = new Object(); + private final CountDownLatch countDownLatch = new CountDownLatch(1); + private final CallbackHandler handler; + private boolean canceled; + private R result; + private ResultCallback resultCallback; + + public AbstractPendingResult(Looper looper) { + handler = new CallbackHandler(looper); + } + + private R getResult() { + synchronized (lock) { + return result; + } + } + + @Override + public R await() { + try { + countDownLatch.await(); + } catch (InterruptedException ignored) { + } + return getResult(); + } + + @Override + public R await(long time, TimeUnit unit) { + try { + countDownLatch.await(time, unit); + } catch (InterruptedException ignored) { + } + return getResult(); + } + + @Override + public void cancel() { + // TODO + } + + @Override + public boolean isCanceled() { + synchronized (lock) { + return canceled; + } + } + + public boolean isReady() { + return this.countDownLatch.getCount() == 0L; + } + + @Override + public void setResultCallback(ResultCallback callback, long time, TimeUnit unit) { + synchronized (lock) { + if (!isCanceled()) { + if (isReady()) { + handler.sendResultCallback(callback, getResult()); + } else { + handler.sendTimeoutResultCallback(this, unit.toMillis(time)); + } + } + } + } + + @Override + public void setResultCallback(ResultCallback callback) { + synchronized (lock) { + if (!isCanceled()) { + if (isReady()) { + handler.sendResultCallback(callback, getResult()); + } else { + resultCallback = callback; + } + } + } + } + + private void deliverResult(R result) { + this.result = result; + countDownLatch.countDown(); + + } + +} diff --git a/src/org/microg/gms/common/api/CallbackHandler.java b/src/org/microg/gms/common/api/CallbackHandler.java new file mode 100644 index 00000000..9d573abc --- /dev/null +++ b/src/org/microg/gms/common/api/CallbackHandler.java @@ -0,0 +1,42 @@ +package org.microg.gms.common.api; + +import android.os.Handler; +import android.os.Looper; +import android.os.Message; +import com.google.android.gms.common.api.Result; +import com.google.android.gms.common.api.ResultCallback; + +class CallbackHandler extends Handler { + public static final int CALLBACK_ON_COMPLETE = 1; + public static final int CALLBACK_ON_TIMEOUT = 2; + + public CallbackHandler(Looper looper) { + super(looper); + } + + @Override + public void handleMessage(Message msg) { + switch (msg.what) { + case CALLBACK_ON_COMPLETE: + OnCompleteObject o = (OnCompleteObject) msg.obj; + o.callback.onResult(o.result); + break; + case CALLBACK_ON_TIMEOUT: + // TODO + break; + } + } + + public void sendResultCallback(ResultCallback callback, R result) { + + } + + public void sendTimeoutResultCallback(AbstractPendingResult pendingResult, long millis) { + + } + + public static class OnCompleteObject { + public ResultCallback callback; + public R result; + } +} diff --git a/src/org/microg/gms/common/api/GoogleApiClientImpl.java b/src/org/microg/gms/common/api/GoogleApiClientImpl.java new file mode 100644 index 00000000..f77b5243 --- /dev/null +++ b/src/org/microg/gms/common/api/GoogleApiClientImpl.java @@ -0,0 +1,155 @@ +package org.microg.gms.common.api; + +import android.content.Context; +import android.os.Bundle; +import android.os.Looper; +import android.support.v4.app.FragmentActivity; +import com.google.android.gms.common.ConnectionResult; +import com.google.android.gms.common.api.*; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.TimeUnit; + +public class GoogleApiClientImpl implements GoogleApiClient { + private final Context context; + private final Looper looper; + private final AccountInfo accountInfo; + private final Map apis = new HashMap<>(); + private final Map apiConnections = new HashMap<>(); + private final Set connectionCallbacks = new HashSet<>(); + private final Set connectionFailedListeners = new HashSet<>(); + private final ConnectionCallbacks baseConnectionCallbacks = new ConnectionCallbacks() { + @Override + public void onConnected(Bundle connectionHint) { + for (ConnectionCallbacks callback : connectionCallbacks) { + callback.onConnected(connectionHint); + } + } + + @Override + public void onConnectionSuspended(int cause) { + for (ConnectionCallbacks callback : connectionCallbacks) { + callback.onConnectionSuspended(cause); + } + } + }; + private final OnConnectionFailedListener baseConnectionFailedListener = new OnConnectionFailedListener() { + @Override + public void onConnectionFailed(ConnectionResult result) { + for (OnConnectionFailedListener listener : connectionFailedListeners) { + listener.onConnectionFailed(result); + } + } + }; + private final int clientId; + + public GoogleApiClientImpl(Context context, Looper looper, AccountInfo accountInfo, + Map apis, + Set connectionCallbacks, + Set connectionFailedListeners, int clientId) { + this.context = context; + this.looper = looper; + this.accountInfo = accountInfo; + this.apis.putAll(apis); + this.connectionCallbacks.addAll(connectionCallbacks); + this.connectionFailedListeners.addAll(connectionFailedListeners); + this.clientId = clientId; + + for (Api api : apis.keySet()) { + apiConnections.put(api, api.getBuilder().build(context, looper, + apis.get(api), accountInfo, baseConnectionCallbacks, + baseConnectionFailedListener)); + } + } + + public Api.Connection getApiConnection(Api api) { + return apiConnections.get(api); + } + + @Override + public ConnectionResult blockingConnect() { + return null; + } + + @Override + public ConnectionResult blockingConnect(long timeout, TimeUnit unit) { + return null; + } + + @Override + public PendingResult clearDefaultAccountAndReconnect() { + return null; + } + + @Override + public void connect() { + for (Api.Connection connection : apiConnections.values()) { + connection.connect(); + } + } + + @Override + public void disconnect() { + for (Api.Connection connection : apiConnections.values()) { + connection.disconnect(); + } + } + + @Override + public boolean isConnected() { + for (Api.Connection connection : apiConnections.values()) { + if (!connection.isConnected()) return false; + } + return true; + } + + @Override + public boolean isConnecting() { + return false; // TODO + } + + @Override + public boolean isConnectionCallbacksRegistered(ConnectionCallbacks listener) { + return connectionCallbacks.contains(listener); + } + + @Override + public boolean isConnectionFailedListenerRegistered( + OnConnectionFailedListener listener) { + return connectionFailedListeners.contains(listener); + } + + @Override + public void reconnect() { + disconnect(); + connect(); + } + + @Override + public void registerConnectionCallbacks(ConnectionCallbacks listener) { + connectionCallbacks.add(listener); + } + + @Override + public void registerConnectionFailedListener(OnConnectionFailedListener listener) { + connectionFailedListeners.add(listener); + } + + @Override + public void stopAutoManager(FragmentActivity lifecycleActivity) throws IllegalStateException { + + } + + @Override + public void unregisterConnectionCallbacks(ConnectionCallbacks listener) { + connectionCallbacks.remove(listener); + } + + @Override + public void unregisterConnectionFailedListener(OnConnectionFailedListener listener) { + connectionFailedListeners.remove(listener); + } +} diff --git a/src/org/microg/gms/location/FusedLocationProviderApiImpl.java b/src/org/microg/gms/location/FusedLocationProviderApiImpl.java new file mode 100644 index 00000000..eb4c516f --- /dev/null +++ b/src/org/microg/gms/location/FusedLocationProviderApiImpl.java @@ -0,0 +1,72 @@ +package org.microg.gms.location; + +import android.app.PendingIntent; +import android.location.Location; +import android.os.Looper; +import android.os.RemoteException; +import android.util.Log; +import com.google.android.gms.common.api.GoogleApiClient; +import com.google.android.gms.common.api.PendingResult; +import com.google.android.gms.location.FusedLocationProviderApi; +import com.google.android.gms.location.LocationListener; +import com.google.android.gms.location.LocationRequest; + +public class FusedLocationProviderApiImpl implements FusedLocationProviderApi { + private static final String TAG = "GmsFusedApiImpl"; + + @Override + public Location getLastLocation(GoogleApiClient client) { + try { + return LocationClientImpl.get(client).getLastLocation(); + } catch (RemoteException e) { + Log.w(TAG, e); + return null; + } + } + + @Override + public PendingResult requestLocationUpdates(GoogleApiClient client, LocationRequest request, + LocationListener listener) { + //LocationClientImpl.get(client).requestLocationUpdates(request, listener); + return null; + } + + @Override + public PendingResult requestLocationUpdates(GoogleApiClient client, LocationRequest request, + LocationListener listener, Looper looper) { + //LocationClientImpl.get(client).requestLocationUpdates(request, listener, looper); + return null; + } + + @Override + public PendingResult requestLocationUpdates(GoogleApiClient client, LocationRequest request, + PendingIntent callbackIntent) { + //LocationClientImpl.get(client).requestLocationUpdates(request, callbackIntent); + return null; + } + + @Override + public PendingResult removeLocationUpdates(GoogleApiClient client, LocationListener listener) { + //LocationClientImpl.get(client).removeLocationUpdates(listener); + return null; + } + + @Override + public PendingResult removeLocationUpdates(GoogleApiClient client, + PendingIntent callbackIntent) { + //LocationClientImpl.get(client).removeLocationUpdates(callbackIntent); + return null; + } + + @Override + public PendingResult setMockMode(GoogleApiClient client, boolean isMockMode) { + //LocationClientImpl.get(client).setMockMode(isMockMode); + return null; + } + + @Override + public PendingResult setMockLocation(GoogleApiClient client, Location mockLocation) { + //LocationClientImpl.get(client).setMockLocation(mockLocation); + return null; + } +} diff --git a/src/org/microg/gms/location/GeofencingApiImpl.java b/src/org/microg/gms/location/GeofencingApiImpl.java new file mode 100644 index 00000000..27cef98c --- /dev/null +++ b/src/org/microg/gms/location/GeofencingApiImpl.java @@ -0,0 +1,6 @@ +package org.microg.gms.location; + +import com.google.android.gms.location.GeofencingApi; + +public class GeofencingApiImpl implements GeofencingApi { +} diff --git a/src/org/microg/gms/location/GoogleLocationManagerClient.java b/src/org/microg/gms/location/GoogleLocationManagerClient.java new file mode 100644 index 00000000..a60a665b --- /dev/null +++ b/src/org/microg/gms/location/GoogleLocationManagerClient.java @@ -0,0 +1,35 @@ +package org.microg.gms.location; + +import android.content.Context; +import android.os.Bundle; +import android.os.IBinder; +import android.os.RemoteException; +import com.google.android.gms.common.internal.IGmsServiceBroker; +import com.google.android.gms.location.internal.IGoogleLocationManagerService; +import org.microg.gms.Constants; +import org.microg.gms.common.GmsClient; + +public class GoogleLocationManagerClient extends GmsClient { + public GoogleLocationManagerClient(Context context) { + super(context); + } + + @Override + protected String getActionString() { + return Constants.ACTION_GMS_LOCATION_MANAGER_SERVICE_START; + } + + @Override + protected IGoogleLocationManagerService interfaceFromBinder(IBinder binder) { + return IGoogleLocationManagerService.Stub.asInterface(binder); + } + + @Override + protected void onConnectedToBroker(IGmsServiceBroker broker, GmsCallbacks callbacks) + throws RemoteException { + Bundle bundle = new Bundle(); + bundle.putString("client_name", "locationServices"); + broker.getGoogleLocationManagerService(callbacks, Constants.MAX_REFERENCE_VERSION, + getContext().getPackageName(), bundle); + } +} diff --git a/src/org/microg/gms/location/LocationClientImpl.java b/src/org/microg/gms/location/LocationClientImpl.java new file mode 100644 index 00000000..e523c14c --- /dev/null +++ b/src/org/microg/gms/location/LocationClientImpl.java @@ -0,0 +1,61 @@ +package org.microg.gms.location; + +import android.app.PendingIntent; +import android.content.Context; +import android.location.Location; +import android.os.Looper; +import android.os.RemoteException; +import com.google.android.gms.common.api.GoogleApiClient; +import com.google.android.gms.location.LocationListener; +import com.google.android.gms.location.LocationRequest; +import com.google.android.gms.location.LocationServices; +import org.microg.gms.common.api.GoogleApiClientImpl; + +public class LocationClientImpl extends GoogleLocationManagerClient { + public LocationClientImpl(Context context) { + super(context); + } + + public static LocationClientImpl get(GoogleApiClient apiClient) { + if (apiClient instanceof GoogleApiClientImpl) { + return (LocationClientImpl) ((GoogleApiClientImpl) apiClient) + .getApiConnection(LocationServices.API); + } + return null; + } + + public Location getLastLocation() throws RemoteException { + return getServiceInterface().getLastLocation(); + } + + public void requestLocationUpdates(LocationRequest request, LocationListener listener) + throws RemoteException { + + } + + public void requestLocationUpdates(LocationRequest request, PendingIntent pendingIntent) + throws RemoteException { + + } + + public void requestLocationUpdates(LocationRequest request, LocationListener listener, + Looper looper) throws RemoteException { + + } + + public void removeLocationUpdates(LocationListener listener) throws RemoteException { + + } + + public void removeLocationUpdates(PendingIntent pendingIntent) throws RemoteException { + + } + + public void setMockMode(boolean isMockMode) throws RemoteException { + + } + + public void setMockLocation(Location mockLocation) throws RemoteException { + + } +} From c1f66a6b3b462c53f0d67345cc9ca2c7c6bdab74 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Thu, 15 Jan 2015 20:16:15 +0100 Subject: [PATCH 013/293] Add api stuff --- build.gradle | 2 +- .../google/android/gms/common/api/Result.java | 8 ++ .../google/android/gms/common/api/Status.java | 79 +++++++++++++++++++ src/org/microg/gms/Constants.java | 1 + 4 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 src/com/google/android/gms/common/api/Result.java create mode 100644 src/com/google/android/gms/common/api/Status.java diff --git a/build.gradle b/build.gradle index f433729e..dd90597a 100644 --- a/build.gradle +++ b/build.gradle @@ -15,7 +15,7 @@ dependencies { android { compileSdkVersion 21 - buildToolsVersion "21.0.2" + buildToolsVersion "21.1.2" lintOptions.abortOnError false sourceSets { diff --git a/src/com/google/android/gms/common/api/Result.java b/src/com/google/android/gms/common/api/Result.java new file mode 100644 index 00000000..d8408112 --- /dev/null +++ b/src/com/google/android/gms/common/api/Result.java @@ -0,0 +1,8 @@ +package com.google.android.gms.common.api; + +/** + * Represents the final result of invoking an API method in Google Play Services. + */ +public interface Result { + public Status getStatus(); +} diff --git a/src/com/google/android/gms/common/api/Status.java b/src/com/google/android/gms/common/api/Status.java new file mode 100644 index 00000000..1431f98c --- /dev/null +++ b/src/com/google/android/gms/common/api/Status.java @@ -0,0 +1,79 @@ +package com.google.android.gms.common.api; + +import android.app.PendingIntent; +import org.microg.safeparcel.AutoSafeParcelable; + +/** + * Represents the results of work. + *

+ * TODO: Docs + */ +public final class Status extends AutoSafeParcelable implements Result { + private static final int STATUS_CODE_INTERRUPTED = 14; + private static final int STATUS_CODE_CANCELED = 16; + + public static final Status INTERRUPTED = new Status(STATUS_CODE_INTERRUPTED); + public static final Status CANCELED = new Status(STATUS_CODE_CANCELED); + + private final int versionCode; + private final int statusCode; + private final String statusMessage; + private final PendingIntent resolution; + + private Status() { + versionCode = 1; + statusCode = 0; + statusMessage = null; + resolution = null; + } + + public Status(int statusCode) { + this(statusCode, null); + } + + public Status(int statusCode, String statusMessage) { + this(statusCode, statusMessage, null); + } + + public Status(int statusCode, String statusMessage, PendingIntent resolution) { + this.versionCode = 1; + this.statusCode = statusCode; + this.statusMessage = statusMessage; + this.resolution = resolution; + } + + public PendingIntent getResolution() { + return resolution; + } + + public int getStatusCode() { + return statusCode; + } + + public String getStatusMessage() { + return statusMessage; + } + + public boolean hasResolution() { + return resolution != null; + } + + public boolean isCanceled() { + return statusCode == STATUS_CODE_CANCELED; + } + + public boolean isInterrupted() { + return statusCode == STATUS_CODE_INTERRUPTED; + } + + public boolean isSuccess() { + return statusCode <= 0; + } + + @Override + public Status getStatus() { + return this; + } + + public static final Creator CREATOR = new AutoCreator<>(Status.class); +} diff --git a/src/org/microg/gms/Constants.java b/src/org/microg/gms/Constants.java index a855bbc5..8e6c6844 100644 --- a/src/org/microg/gms/Constants.java +++ b/src/org/microg/gms/Constants.java @@ -9,6 +9,7 @@ public class Constants { public static final String ACTION_GMS_LOCATION_MANAGER_SERVICE_START = "com.google.android.location.internal.GoogleLocationManagerService.START"; public static final String KEY_MOCK_LOCATION = "mockLocation"; public static final String DEFAULT_ACCOUNT = "<>"; + public static final String GMS_PACKAGE_NAME = "com.google.android.gms"; /** * No base map tiles. From 6af3c0b70018610b057463c341f6bc2125ffe2f6 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Sun, 18 Jan 2015 23:57:09 +0100 Subject: [PATCH 014/293] Some work... --- .../google/android/gms/common/api/Api.java | 20 +---- .../gms/location/LocationServices.java | 7 +- src/org/microg/gms/common/GmsClient.java | 4 +- src/org/microg/gms/common/GmsConnector.java | 79 +++++++++++++++++++ .../gms/common/api/AbstractPendingResult.java | 7 +- src/org/microg/gms/common/api/ApiBuilder.java | 32 ++++++++ .../microg/gms/common/api/ApiConnection.java | 23 ++++++ .../gms/common/api/CallbackHandler.java | 10 ++- .../gms/common/api/GoogleApiClientImpl.java | 18 +++-- .../FusedLocationProviderApiImpl.java | 3 + 10 files changed, 173 insertions(+), 30 deletions(-) create mode 100644 src/org/microg/gms/common/GmsConnector.java create mode 100644 src/org/microg/gms/common/api/ApiBuilder.java create mode 100644 src/org/microg/gms/common/api/ApiConnection.java diff --git a/src/com/google/android/gms/common/api/Api.java b/src/com/google/android/gms/common/api/Api.java index d094fdd0..5a8d3cfc 100644 --- a/src/com/google/android/gms/common/api/Api.java +++ b/src/com/google/android/gms/common/api/Api.java @@ -1,7 +1,6 @@ package com.google.android.gms.common.api; -import android.content.Context; -import android.os.Looper; +import org.microg.gms.common.api.ApiBuilder; /** * Describes a section of the Google Play Services API that should be made available. Instances of @@ -17,13 +16,13 @@ import android.os.Looper; */ public final class Api { - private final Builder builder; + private final ApiBuilder builder; - public Api(Builder builder) { + public Api(ApiBuilder builder) { this.builder = builder; } - public Builder getBuilder() { + public ApiBuilder getBuilder() { return builder; } @@ -57,15 +56,4 @@ public final class Api { } } - public interface Connection { - public void connect(); - public void disconnect(); - public boolean isConnected(); - } - - public interface Builder { - Connection build(Context context, Looper looper, O options, AccountInfo accountInfo, - GoogleApiClient.ConnectionCallbacks callbacks, - GoogleApiClient.OnConnectionFailedListener connectionFailedListener); - } } diff --git a/src/com/google/android/gms/location/LocationServices.java b/src/com/google/android/gms/location/LocationServices.java index ced08aa6..db3f9b5b 100644 --- a/src/com/google/android/gms/location/LocationServices.java +++ b/src/com/google/android/gms/location/LocationServices.java @@ -4,6 +4,9 @@ import android.content.Context; import android.os.Looper; import com.google.android.gms.common.api.AccountInfo; import com.google.android.gms.common.api.Api; +import org.microg.gms.common.api.ApiConnection; + +import org.microg.gms.common.api.ApiBuilder; import com.google.android.gms.common.api.GoogleApiClient; import org.microg.gms.location.FusedLocationProviderApiImpl; import org.microg.gms.location.GeofencingApiImpl; @@ -14,9 +17,9 @@ import org.microg.gms.location.LocationClientImpl; */ public class LocationServices { public static final Api API = new Api<>( - new Api.Builder() { + new ApiBuilder() { @Override - public Api.Connection build(Context context, Looper looper, + public ApiConnection build(Context context, Looper looper, Api.ApiOptions.NoOptions options, AccountInfo accountInfo, GoogleApiClient.ConnectionCallbacks callbacks, GoogleApiClient.OnConnectionFailedListener connectionFailedListener) { diff --git a/src/org/microg/gms/common/GmsClient.java b/src/org/microg/gms/common/GmsClient.java index 046c2e36..14e00cd8 100644 --- a/src/org/microg/gms/common/GmsClient.java +++ b/src/org/microg/gms/common/GmsClient.java @@ -9,11 +9,11 @@ import android.os.IInterface; import android.os.RemoteException; import com.google.android.gms.common.ConnectionResult; import com.google.android.gms.common.GooglePlayServicesUtil; -import com.google.android.gms.common.api.Api; +import org.microg.gms.common.api.ApiConnection; import com.google.android.gms.common.internal.IGmsCallbacks; import com.google.android.gms.common.internal.IGmsServiceBroker; -public abstract class GmsClient implements Api.Connection { +public abstract class GmsClient implements ApiConnection { private static final String TAG = "GmsClient"; private final Context context; diff --git a/src/org/microg/gms/common/GmsConnector.java b/src/org/microg/gms/common/GmsConnector.java new file mode 100644 index 00000000..af3c8699 --- /dev/null +++ b/src/org/microg/gms/common/GmsConnector.java @@ -0,0 +1,79 @@ +/* + * Copyright 2014-2015 µg 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 org.microg.gms.common; + +import android.os.Looper; +import android.os.Message; +import android.os.RemoteException; + +import com.google.android.gms.common.api.Api; + +import org.microg.gms.common.api.AbstractPendingResult; +import org.microg.gms.common.api.ApiConnection; + +import com.google.android.gms.common.api.GoogleApiClient; +import com.google.android.gms.common.api.Result; + +import org.microg.gms.common.api.GoogleApiClientImpl; + +public class GmsConnector { + public static + AbstractPendingResult connect(GoogleApiClient apiClient, Api api, Callback callback) { + Looper looper = ((GoogleApiClientImpl) apiClient).getLooper(); + final AbstractPendingResult result = new AbstractPendingResult<>(looper); + Message msg = new Message(); + msg.obj = new ConnectRequest((GoogleApiClientImpl) apiClient, api, result, callback); + new Handler(looper).sendMessage(msg); + return result; + } + + public static interface Callback { + public R onClientAvailable(C client) throws RemoteException; + } + + private static class Handler extends android.os.Handler { + private Handler(Looper looper) { + super(looper); + } + + @Override + public void handleMessage(Message msg) { + ConnectRequest request = (ConnectRequest) msg.obj; + ApiConnection apiConnection = request.apiClient.getApiConnection(request.api); + apiConnection.connect(); + try { + request.result.setResult(request.callback.onClientAvailable((C) apiConnection)); + } catch (RemoteException ignored) { + + } + } + } + + private static class ConnectRequest { + GoogleApiClientImpl apiClient; + Api api; + AbstractPendingResult result; + Callback callback; + + private ConnectRequest(GoogleApiClientImpl apiClient, Api api, AbstractPendingResult result, Callback callback) { + this.apiClient = apiClient; + this.api = api; + this.result = result; + this.callback = callback; + } + } +} diff --git a/src/org/microg/gms/common/api/AbstractPendingResult.java b/src/org/microg/gms/common/api/AbstractPendingResult.java index dfb00a86..2b34ae43 100644 --- a/src/org/microg/gms/common/api/AbstractPendingResult.java +++ b/src/org/microg/gms/common/api/AbstractPendingResult.java @@ -11,13 +11,13 @@ import java.util.concurrent.TimeUnit; public class AbstractPendingResult implements PendingResult { private final Object lock = new Object(); private final CountDownLatch countDownLatch = new CountDownLatch(1); - private final CallbackHandler handler; + private final CallbackHandler handler; private boolean canceled; private R result; private ResultCallback resultCallback; public AbstractPendingResult(Looper looper) { - handler = new CallbackHandler(looper); + handler = new CallbackHandler(looper); } private R getResult() { @@ -92,4 +92,7 @@ public class AbstractPendingResult implements PendingResult } + public void setResult(R result) { + this.result = result; + } } diff --git a/src/org/microg/gms/common/api/ApiBuilder.java b/src/org/microg/gms/common/api/ApiBuilder.java new file mode 100644 index 00000000..14aba7d0 --- /dev/null +++ b/src/org/microg/gms/common/api/ApiBuilder.java @@ -0,0 +1,32 @@ +/* + * Copyright 2014-2015 µg 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 org.microg.gms.common.api; + +import android.content.Context; +import android.os.Looper; + +import com.google.android.gms.common.api.AccountInfo; +import com.google.android.gms.common.api.Api; +import com.google.android.gms.common.api.GoogleApiClient; + +import org.microg.gms.common.api.ApiConnection; + +public interface ApiBuilder { + ApiConnection build(Context context, Looper looper, O options, AccountInfo accountInfo, + GoogleApiClient.ConnectionCallbacks callbacks, + GoogleApiClient.OnConnectionFailedListener connectionFailedListener); +} diff --git a/src/org/microg/gms/common/api/ApiConnection.java b/src/org/microg/gms/common/api/ApiConnection.java new file mode 100644 index 00000000..8f21c1bf --- /dev/null +++ b/src/org/microg/gms/common/api/ApiConnection.java @@ -0,0 +1,23 @@ +/* + * Copyright 2014-2015 µg 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 org.microg.gms.common.api; + +public interface ApiConnection { + public void connect(); + public void disconnect(); + public boolean isConnected(); +} diff --git a/src/org/microg/gms/common/api/CallbackHandler.java b/src/org/microg/gms/common/api/CallbackHandler.java index 9d573abc..b2250f9e 100644 --- a/src/org/microg/gms/common/api/CallbackHandler.java +++ b/src/org/microg/gms/common/api/CallbackHandler.java @@ -28,7 +28,10 @@ class CallbackHandler extends Handler { } public void sendResultCallback(ResultCallback callback, R result) { - + Message message = new Message(); + message.what = CALLBACK_ON_COMPLETE; + message.obj = new OnCompleteObject(callback, result); + sendMessage(message); } public void sendTimeoutResultCallback(AbstractPendingResult pendingResult, long millis) { @@ -38,5 +41,10 @@ class CallbackHandler extends Handler { public static class OnCompleteObject { public ResultCallback callback; public R result; + + public OnCompleteObject(ResultCallback callback, R result) { + this.callback = callback; + this.result = result; + } } } diff --git a/src/org/microg/gms/common/api/GoogleApiClientImpl.java b/src/org/microg/gms/common/api/GoogleApiClientImpl.java index f77b5243..8a96332c 100644 --- a/src/org/microg/gms/common/api/GoogleApiClientImpl.java +++ b/src/org/microg/gms/common/api/GoogleApiClientImpl.java @@ -18,9 +18,10 @@ public class GoogleApiClientImpl implements GoogleApiClient { private final Looper looper; private final AccountInfo accountInfo; private final Map apis = new HashMap<>(); - private final Map apiConnections = new HashMap<>(); + private final Map apiConnections = new HashMap<>(); private final Set connectionCallbacks = new HashSet<>(); private final Set connectionFailedListeners = new HashSet<>(); + private final int clientId; private final ConnectionCallbacks baseConnectionCallbacks = new ConnectionCallbacks() { @Override public void onConnected(Bundle connectionHint) { @@ -44,7 +45,6 @@ public class GoogleApiClientImpl implements GoogleApiClient { } } }; - private final int clientId; public GoogleApiClientImpl(Context context, Looper looper, AccountInfo accountInfo, Map apis, @@ -64,8 +64,12 @@ public class GoogleApiClientImpl implements GoogleApiClient { baseConnectionFailedListener)); } } - - public Api.Connection getApiConnection(Api api) { + + public Looper getLooper() { + return looper; + } + + public ApiConnection getApiConnection(Api api) { return apiConnections.get(api); } @@ -86,21 +90,21 @@ public class GoogleApiClientImpl implements GoogleApiClient { @Override public void connect() { - for (Api.Connection connection : apiConnections.values()) { + for (ApiConnection connection : apiConnections.values()) { connection.connect(); } } @Override public void disconnect() { - for (Api.Connection connection : apiConnections.values()) { + for (ApiConnection connection : apiConnections.values()) { connection.disconnect(); } } @Override public boolean isConnected() { - for (Api.Connection connection : apiConnections.values()) { + for (ApiConnection connection : apiConnections.values()) { if (!connection.isConnected()) return false; } return true; diff --git a/src/org/microg/gms/location/FusedLocationProviderApiImpl.java b/src/org/microg/gms/location/FusedLocationProviderApiImpl.java index eb4c516f..169b9788 100644 --- a/src/org/microg/gms/location/FusedLocationProviderApiImpl.java +++ b/src/org/microg/gms/location/FusedLocationProviderApiImpl.java @@ -11,6 +11,8 @@ import com.google.android.gms.location.FusedLocationProviderApi; import com.google.android.gms.location.LocationListener; import com.google.android.gms.location.LocationRequest; +import org.microg.gms.common.GmsConnector; + public class FusedLocationProviderApiImpl implements FusedLocationProviderApi { private static final String TAG = "GmsFusedApiImpl"; @@ -27,6 +29,7 @@ public class FusedLocationProviderApiImpl implements FusedLocationProviderApi { @Override public PendingResult requestLocationUpdates(GoogleApiClient client, LocationRequest request, LocationListener listener) { + //LocationClientImpl.get(client).requestLocationUpdates(request, listener); return null; } From 3ec1456a3e9ed5238b4a0360b23f646f1cb93645 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Mon, 19 Jan 2015 01:45:41 +0100 Subject: [PATCH 015/293] Small fixes --- src/com/google/android/gms/common/api/Status.java | 1 + src/com/google/android/gms/location/LocationRequest.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/com/google/android/gms/common/api/Status.java b/src/com/google/android/gms/common/api/Status.java index 1431f98c..903563ad 100644 --- a/src/com/google/android/gms/common/api/Status.java +++ b/src/com/google/android/gms/common/api/Status.java @@ -14,6 +14,7 @@ public final class Status extends AutoSafeParcelable implements Result { public static final Status INTERRUPTED = new Status(STATUS_CODE_INTERRUPTED); public static final Status CANCELED = new Status(STATUS_CODE_CANCELED); + public static final Status SUCCESS = new Status(0); private final int versionCode; private final int statusCode; diff --git a/src/com/google/android/gms/location/LocationRequest.java b/src/com/google/android/gms/location/LocationRequest.java index a1105821..a5369fd0 100644 --- a/src/com/google/android/gms/location/LocationRequest.java +++ b/src/com/google/android/gms/location/LocationRequest.java @@ -399,7 +399,7 @@ public class LocationRequest extends AutoSafeParcelable { * @return the same object, so that setters can be chained * @throws IllegalArgumentException if smallestDisplacementMeters is negative */ - public LocationRequest setSmallestDesplacement(float smallestDisplacementMeters) { + public LocationRequest setSmallestDisplacement(float smallestDisplacementMeters) { if (smallestDisplacementMeters < 0) throw new IllegalArgumentException("smallestDisplacementMeters must not be negative"); this.smallestDesplacement = smallestDisplacementMeters; From a5be10d11b6b7077ea16a4bd87d4ea422913f326 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Mon, 19 Jan 2015 01:46:08 +0100 Subject: [PATCH 016/293] Location API mainly done --- .../location/FusedLocationProviderApi.java | 4 +- .../android/gms/location/LocationClient.java | 83 ++++++------- .../gms/location/LocationListener.java | 14 +++ src/main/res/values/version.xml | 20 ++++ src/org/microg/gms/common/GmsConnector.java | 42 +++---- .../api/AbstractPlayServicesClient.java | 90 ++++++++++++++ .../FusedLocationProviderApiImpl.java | 112 +++++++++++++----- .../gms/location/LocationClientImpl.java | 35 ++++-- 8 files changed, 288 insertions(+), 112 deletions(-) create mode 100644 src/main/res/values/version.xml create mode 100644 src/org/microg/gms/common/api/AbstractPlayServicesClient.java diff --git a/src/com/google/android/gms/location/FusedLocationProviderApi.java b/src/com/google/android/gms/location/FusedLocationProviderApi.java index 5d5ba084..c736e6ce 100644 --- a/src/com/google/android/gms/location/FusedLocationProviderApi.java +++ b/src/com/google/android/gms/location/FusedLocationProviderApi.java @@ -8,8 +8,8 @@ import com.google.android.gms.common.api.PendingResult; import org.microg.gms.Constants; public interface FusedLocationProviderApi { - String KEY_LOCATION_CHANGED = "com.google.android.location.LOCATION"; - String KEY_MOCK_LOCATION = Constants.KEY_MOCK_LOCATION; + public static final String KEY_LOCATION_CHANGED = "com.google.android.location.LOCATION"; + public static final String KEY_MOCK_LOCATION = Constants.KEY_MOCK_LOCATION; public Location getLastLocation(GoogleApiClient client); diff --git a/src/com/google/android/gms/location/LocationClient.java b/src/com/google/android/gms/location/LocationClient.java index b3072880..a8b79b0b 100644 --- a/src/com/google/android/gms/location/LocationClient.java +++ b/src/com/google/android/gms/location/LocationClient.java @@ -1,78 +1,63 @@ package com.google.android.gms.location; +import android.app.PendingIntent; import android.content.Context; +import android.location.Location; +import android.os.Looper; +import android.os.RemoteException; + import com.google.android.gms.common.GooglePlayServicesClient; import com.google.android.gms.common.api.GoogleApiClient; +import com.google.android.gms.common.api.PendingResult; + import org.microg.gms.common.ForwardConnectionCallbacks; import org.microg.gms.common.ForwardConnectionFailedListener; +import org.microg.gms.common.api.AbstractPlayServicesClient; +import org.microg.gms.common.api.GoogleApiClientImpl; +import org.microg.gms.location.LocationClientImpl; @Deprecated -public class LocationClient implements GooglePlayServicesClient { - private GoogleApiClient googleApiClient; - - public LocationClient(Context context, ConnectionCallbacks callbacks) { - googleApiClient = new GoogleApiClient.Builder(context) +public class LocationClient extends AbstractPlayServicesClient { + public static final String KEY_LOCATION_CHANGED = "com.google.android.location.LOCATION"; + + public LocationClient(Context context, ConnectionCallbacks callbacks, + OnConnectionFailedListener connectionFailedListener) { + super(new GoogleApiClient.Builder(context) .addApi(LocationServices.API) .addConnectionCallbacks(new ForwardConnectionCallbacks(callbacks)) - .build(); + .addOnConnectionFailedListener(new ForwardConnectionFailedListener(connectionFailedListener)) + .build()); } - @Override - public void connect() { - googleApiClient.connect(); + public Location getLastLocation() { + return LocationServices.FusedLocationApi.getLastLocation(googleApiClient); } - @Override - public void disconnect() { - googleApiClient.disconnect(); + public PendingResult requestLocationUpdates(LocationRequest request, LocationListener listener) { + return LocationServices.FusedLocationApi.requestLocationUpdates(googleApiClient, request, listener); } - @Override - public boolean isConnected() { - return googleApiClient.isConnected(); + public PendingResult requestLocationUpdates(LocationRequest request, LocationListener listener, Looper looper) { + return LocationServices.FusedLocationApi.requestLocationUpdates(googleApiClient, request, listener, looper); } - @Override - public boolean isConnecting() { - return googleApiClient.isConnecting(); + public PendingResult requestLocationUpdates(LocationRequest request, PendingIntent callbackIntent) { + return LocationServices.FusedLocationApi.requestLocationUpdates(googleApiClient, request, callbackIntent); } - @Override - public void registerConnectionCallbacks(final ConnectionCallbacks listener) { - googleApiClient.registerConnectionCallbacks(new ForwardConnectionCallbacks(listener)); + public PendingResult removeLocationUpdates(LocationListener listener) { + return LocationServices.FusedLocationApi.removeLocationUpdates(googleApiClient, listener); } - @Override - public boolean isConnectionCallbacksRegistered(ConnectionCallbacks listener) { - return googleApiClient - .isConnectionCallbacksRegistered(new ForwardConnectionCallbacks(listener)); + public PendingResult removeLocationUpdates(PendingIntent callbackIntent) { + return LocationServices.FusedLocationApi.removeLocationUpdates(googleApiClient, callbackIntent); } - @Override - public void unregisterConnectionCallbacks( - ConnectionCallbacks listener) { - googleApiClient.unregisterConnectionCallbacks(new ForwardConnectionCallbacks(listener)); + public PendingResult setMockMode(boolean isMockMode) { + return LocationServices.FusedLocationApi.setMockMode(googleApiClient, isMockMode); } - @Override - public void registerConnectionFailedListener( - OnConnectionFailedListener listener) { - googleApiClient.registerConnectionFailedListener( - new ForwardConnectionFailedListener(listener)); + public PendingResult setMockLocation(Location mockLocation) { + return LocationServices.FusedLocationApi.setMockLocation(googleApiClient, mockLocation); } - - @Override - public boolean isConnectionFailedListenerRegistered( - OnConnectionFailedListener listener) { - return googleApiClient.isConnectionFailedListenerRegistered( - new ForwardConnectionFailedListener(listener)); - } - - @Override - public void unregisterConnectionFailedListener( - OnConnectionFailedListener listener) { - googleApiClient.unregisterConnectionFailedListener( - new ForwardConnectionFailedListener(listener)); - } - } diff --git a/src/com/google/android/gms/location/LocationListener.java b/src/com/google/android/gms/location/LocationListener.java index 63603d67..86fedc42 100644 --- a/src/com/google/android/gms/location/LocationListener.java +++ b/src/com/google/android/gms/location/LocationListener.java @@ -1,4 +1,18 @@ package com.google.android.gms.location; +import android.location.Location; + +/** + * Used for receiving notifications from the {@link FusedLocationProviderApi} when the location has + * changed. The methods are called if the LocationListener has been registered with the location + * client. + */ public interface LocationListener { + + /** + * Called when the location has changed. + * + * @param location The updated location. + */ + public void onLocationChanged(Location location); } diff --git a/src/main/res/values/version.xml b/src/main/res/values/version.xml new file mode 100644 index 00000000..096db2c0 --- /dev/null +++ b/src/main/res/values/version.xml @@ -0,0 +1,20 @@ + + + + + 6599436 + diff --git a/src/org/microg/gms/common/GmsConnector.java b/src/org/microg/gms/common/GmsConnector.java index af3c8699..c222aad2 100644 --- a/src/org/microg/gms/common/GmsConnector.java +++ b/src/org/microg/gms/common/GmsConnector.java @@ -30,14 +30,24 @@ import com.google.android.gms.common.api.Result; import org.microg.gms.common.api.GoogleApiClientImpl; -public class GmsConnector { - public static - AbstractPendingResult connect(GoogleApiClient apiClient, Api api, Callback callback) { +public class GmsConnector { + private final GoogleApiClientImpl apiClient; + private final Api api; + private final Callback callback; + + public GmsConnector(GoogleApiClient apiClient, Api api, Callback callback) { + this.apiClient = (GoogleApiClientImpl) apiClient; + this.api = api; + this.callback = callback; + } + + + public AbstractPendingResult connect() { Looper looper = ((GoogleApiClientImpl) apiClient).getLooper(); final AbstractPendingResult result = new AbstractPendingResult<>(looper); Message msg = new Message(); - msg.obj = new ConnectRequest((GoogleApiClientImpl) apiClient, api, result, callback); - new Handler(looper).sendMessage(msg); + msg.obj = result; + new Handler(looper).sendMessage(msg); return result; } @@ -45,35 +55,21 @@ public class GmsConnector { public R onClientAvailable(C client) throws RemoteException; } - private static class Handler extends android.os.Handler { + private class Handler extends android.os.Handler { private Handler(Looper looper) { super(looper); } @Override public void handleMessage(Message msg) { - ConnectRequest request = (ConnectRequest) msg.obj; - ApiConnection apiConnection = request.apiClient.getApiConnection(request.api); + AbstractPendingResult result = (AbstractPendingResult) msg.obj; + ApiConnection apiConnection = apiClient.getApiConnection(api); apiConnection.connect(); try { - request.result.setResult(request.callback.onClientAvailable((C) apiConnection)); + result.setResult(callback.onClientAvailable((C) apiConnection)); } catch (RemoteException ignored) { } } } - - private static class ConnectRequest { - GoogleApiClientImpl apiClient; - Api api; - AbstractPendingResult result; - Callback callback; - - private ConnectRequest(GoogleApiClientImpl apiClient, Api api, AbstractPendingResult result, Callback callback) { - this.apiClient = apiClient; - this.api = api; - this.result = result; - this.callback = callback; - } - } } diff --git a/src/org/microg/gms/common/api/AbstractPlayServicesClient.java b/src/org/microg/gms/common/api/AbstractPlayServicesClient.java new file mode 100644 index 00000000..6ff1be44 --- /dev/null +++ b/src/org/microg/gms/common/api/AbstractPlayServicesClient.java @@ -0,0 +1,90 @@ +/* + * Copyright 2014-2015 µg 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 org.microg.gms.common.api; + +import com.google.android.gms.common.GooglePlayServicesClient; +import com.google.android.gms.common.api.GoogleApiClient; + +import org.microg.gms.common.ForwardConnectionCallbacks; +import org.microg.gms.common.ForwardConnectionFailedListener; + +public class AbstractPlayServicesClient implements GooglePlayServicesClient { + + protected final GoogleApiClient googleApiClient; + + public AbstractPlayServicesClient(GoogleApiClient googleApiClient) { + this.googleApiClient = googleApiClient; + } + + @Override + public void connect() { + googleApiClient.connect(); + } + + @Override + public void disconnect() { + googleApiClient.disconnect(); + } + + @Override + public boolean isConnected() { + return googleApiClient.isConnected(); + } + + @Override + public boolean isConnecting() { + return googleApiClient.isConnecting(); + } + + @Override + public void registerConnectionCallbacks(final ConnectionCallbacks listener) { + googleApiClient.registerConnectionCallbacks(new ForwardConnectionCallbacks(listener)); + } + + @Override + public boolean isConnectionCallbacksRegistered(ConnectionCallbacks listener) { + return googleApiClient + .isConnectionCallbacksRegistered(new ForwardConnectionCallbacks(listener)); + } + + @Override + public void unregisterConnectionCallbacks( + ConnectionCallbacks listener) { + googleApiClient.unregisterConnectionCallbacks(new ForwardConnectionCallbacks(listener)); + } + + @Override + public void registerConnectionFailedListener( + OnConnectionFailedListener listener) { + googleApiClient.registerConnectionFailedListener( + new ForwardConnectionFailedListener(listener)); + } + + @Override + public boolean isConnectionFailedListenerRegistered( + OnConnectionFailedListener listener) { + return googleApiClient.isConnectionFailedListenerRegistered( + new ForwardConnectionFailedListener(listener)); + } + + @Override + public void unregisterConnectionFailedListener( + OnConnectionFailedListener listener) { + googleApiClient.unregisterConnectionFailedListener( + new ForwardConnectionFailedListener(listener)); + } +} diff --git a/src/org/microg/gms/location/FusedLocationProviderApiImpl.java b/src/org/microg/gms/location/FusedLocationProviderApiImpl.java index 169b9788..c3f5f36f 100644 --- a/src/org/microg/gms/location/FusedLocationProviderApiImpl.java +++ b/src/org/microg/gms/location/FusedLocationProviderApiImpl.java @@ -5,17 +5,22 @@ import android.location.Location; import android.os.Looper; import android.os.RemoteException; import android.util.Log; + 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 com.google.android.gms.location.FusedLocationProviderApi; import com.google.android.gms.location.LocationListener; import com.google.android.gms.location.LocationRequest; +import com.google.android.gms.location.LocationServices; import org.microg.gms.common.GmsConnector; +import org.microg.gms.common.api.ApiConnection; public class FusedLocationProviderApiImpl implements FusedLocationProviderApi { private static final String TAG = "GmsFusedApiImpl"; - + @Override public Location getLastLocation(GoogleApiClient client) { try { @@ -27,49 +32,98 @@ public class FusedLocationProviderApiImpl implements FusedLocationProviderApi { } @Override - public PendingResult requestLocationUpdates(GoogleApiClient client, LocationRequest request, - LocationListener listener) { - - //LocationClientImpl.get(client).requestLocationUpdates(request, listener); - return null; + public PendingResult requestLocationUpdates(GoogleApiClient client, + final LocationRequest request, + final LocationListener listener) { + return callVoid(client, new Runnable() { + @Override + public void run(LocationClientImpl client) throws RemoteException { + client.requestLocationUpdates(request, listener); + } + }); } @Override - public PendingResult requestLocationUpdates(GoogleApiClient client, LocationRequest request, - LocationListener listener, Looper looper) { - //LocationClientImpl.get(client).requestLocationUpdates(request, listener, looper); - return null; + public PendingResult requestLocationUpdates(GoogleApiClient client, + final LocationRequest request, + final LocationListener listener, + final Looper looper) { + return callVoid(client, new Runnable() { + @Override + public void run(LocationClientImpl client) throws RemoteException { + client.requestLocationUpdates(request, listener, looper); + } + }); } @Override - public PendingResult requestLocationUpdates(GoogleApiClient client, LocationRequest request, - PendingIntent callbackIntent) { - //LocationClientImpl.get(client).requestLocationUpdates(request, callbackIntent); - return null; - } - - @Override - public PendingResult removeLocationUpdates(GoogleApiClient client, LocationListener listener) { - //LocationClientImpl.get(client).removeLocationUpdates(listener); - return null; + public PendingResult requestLocationUpdates(GoogleApiClient client, + final LocationRequest request, + final PendingIntent callbackIntent) { + return callVoid(client, new Runnable() { + @Override + public void run(LocationClientImpl client) throws RemoteException { + client.requestLocationUpdates(request, callbackIntent); + } + }); } @Override public PendingResult removeLocationUpdates(GoogleApiClient client, - PendingIntent callbackIntent) { - //LocationClientImpl.get(client).removeLocationUpdates(callbackIntent); - return null; + final LocationListener listener) { + return callVoid(client, new Runnable() { + @Override + public void run(LocationClientImpl client) throws RemoteException { + client.removeLocationUpdates(listener); + } + }); } @Override - public PendingResult setMockMode(GoogleApiClient client, boolean isMockMode) { - //LocationClientImpl.get(client).setMockMode(isMockMode); - return null; + public PendingResult removeLocationUpdates(GoogleApiClient client, + final PendingIntent callbackIntent) { + return callVoid(client, new Runnable() { + @Override + public void run(LocationClientImpl client) throws RemoteException { + client.removeLocationUpdates(callbackIntent); + } + }); } @Override - public PendingResult setMockLocation(GoogleApiClient client, Location mockLocation) { - //LocationClientImpl.get(client).setMockLocation(mockLocation); - return null; + public PendingResult setMockMode(GoogleApiClient client, final boolean isMockMode) { + return callVoid(client, new Runnable() { + @Override + public void run(LocationClientImpl client) throws RemoteException { + client.setMockMode(isMockMode); + } + }); } + + @Override + public PendingResult setMockLocation(GoogleApiClient client, final Location mockLocation) { + return callVoid(client, new Runnable() { + @Override + public void run(LocationClientImpl client) throws RemoteException { + client.setMockLocation(mockLocation); + } + }); + } + + private PendingResult callVoid(GoogleApiClient client, final Runnable runnable) { + return new GmsConnector<>(client, LocationServices.API, + new GmsConnector.Callback() { + @Override + public Result onClientAvailable(LocationClientImpl client) throws + RemoteException { + runnable.run(client); + return Status.SUCCESS; + } + }).connect(); + } + + private interface Runnable { + public void run(LocationClientImpl client) throws RemoteException; + } + } diff --git a/src/org/microg/gms/location/LocationClientImpl.java b/src/org/microg/gms/location/LocationClientImpl.java index e523c14c..1bb56a9a 100644 --- a/src/org/microg/gms/location/LocationClientImpl.java +++ b/src/org/microg/gms/location/LocationClientImpl.java @@ -5,12 +5,18 @@ import android.content.Context; import android.location.Location; import android.os.Looper; import android.os.RemoteException; + import com.google.android.gms.common.api.GoogleApiClient; +import com.google.android.gms.location.ILocationListener; import com.google.android.gms.location.LocationListener; import com.google.android.gms.location.LocationRequest; import com.google.android.gms.location.LocationServices; + import org.microg.gms.common.api.GoogleApiClientImpl; +import java.util.HashMap; +import java.util.Map; + public class LocationClientImpl extends GoogleLocationManagerClient { public LocationClientImpl(Context context) { super(context); @@ -24,38 +30,49 @@ public class LocationClientImpl extends GoogleLocationManagerClient { return null; } + private Map listenerMap = new HashMap<>(); + public Location getLastLocation() throws RemoteException { return getServiceInterface().getLastLocation(); } - public void requestLocationUpdates(LocationRequest request, LocationListener listener) + public void requestLocationUpdates(LocationRequest request, final LocationListener listener) throws RemoteException { - + ILocationListener iLocationListener = new ILocationListener.Stub() { + @Override + public void onLocationChanged(Location location) throws RemoteException { + listener.onLocationChanged(location); + } + }; + listenerMap.put(listener, iLocationListener); + getServiceInterface().requestLocationUpdatesWithPackage(request, + iLocationListener, getContext().getPackageName()); } public void requestLocationUpdates(LocationRequest request, PendingIntent pendingIntent) throws RemoteException { - + getServiceInterface().requestLocationUpdatesWithIntent(request, pendingIntent); } public void requestLocationUpdates(LocationRequest request, LocationListener listener, - Looper looper) throws RemoteException { - + Looper looper) throws RemoteException { + requestLocationUpdates(request, listener); // TODO } public void removeLocationUpdates(LocationListener listener) throws RemoteException { - + getServiceInterface().removeLocationUpdatesWithListener(listenerMap.get(listener)); + listenerMap.remove(listener); } public void removeLocationUpdates(PendingIntent pendingIntent) throws RemoteException { - + getServiceInterface().removeLocationUpdatesWithIntent(pendingIntent); } public void setMockMode(boolean isMockMode) throws RemoteException { - + getServiceInterface().setMockMode(isMockMode); } public void setMockLocation(Location mockLocation) throws RemoteException { - + getServiceInterface().setMockLocation(mockLocation); } } From 745a1d0fef02b2508da0b27fcd4ad205a46446e7 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Wed, 21 Jan 2015 23:45:21 +0100 Subject: [PATCH 017/293] README --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6fb94c76..f3f240f3 100644 --- a/README.md +++ b/README.md @@ -1 +1,5 @@ -Do not link against this repo, as it is will be renamed later +GmsLib +====== +This library is a compatibility implementation of the often used play-services library. + +It will try to use the Play Services when installed on the target device. If this is not possible, a basic fallback implementation might be used. From 863c9693ac86b9c203bfb9f6116f1528dd984aed Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Thu, 22 Jan 2015 03:07:09 +0100 Subject: [PATCH 018/293] Basic Location API working. Tested using deprecated LocationClient calls in DashClock --- .../android/gms/common/ConnectionResult.java | 1 + .../gms/common/GooglePlayServicesUtil.java | 18 +++++++---- .../google/android/gms/common/api/Api.java | 4 +-- .../gms/common/api/GoogleApiClient.java | 2 ++ .../android/gms/common/api/PendingResult.java | 7 +++-- .../gms/common/api/ResultCallback.java | 3 +- .../location/FusedLocationProviderApi.java | 2 ++ .../android/gms/location/LocationClient.java | 30 +++++++++++-------- .../gms/location/LocationServices.java | 10 ++++--- .../common/ForwardConnectionCallbacks.java | 2 +- src/org/microg/gms/common/GmsClient.java | 20 ++++++++++--- src/org/microg/gms/common/GmsConnector.java | 8 ++--- .../gms/common/MultiConnectionKeeper.java | 12 ++++++-- .../gms/common/api/AbstractPendingResult.java | 5 ++-- src/org/microg/gms/common/api/ApiBuilder.java | 6 ++-- .../microg/gms/common/api/ApiConnection.java | 2 ++ .../gms/common/api/GoogleApiClientImpl.java | 23 ++++++++++++++ .../FusedLocationProviderApiImpl.java | 16 ++++------ .../location/GoogleLocationManagerClient.java | 8 +++-- .../gms/location/LocationClientImpl.java | 11 +++++-- 20 files changed, 128 insertions(+), 62 deletions(-) diff --git a/src/com/google/android/gms/common/ConnectionResult.java b/src/com/google/android/gms/common/ConnectionResult.java index ae65ae68..155f0508 100644 --- a/src/com/google/android/gms/common/ConnectionResult.java +++ b/src/com/google/android/gms/common/ConnectionResult.java @@ -4,6 +4,7 @@ import android.app.Activity; import android.app.PendingIntent; import android.content.Intent; import android.content.IntentSender; + import com.google.android.gms.common.api.GoogleApiClient; /** diff --git a/src/com/google/android/gms/common/GooglePlayServicesUtil.java b/src/com/google/android/gms/common/GooglePlayServicesUtil.java index a32adf04..40cc045f 100644 --- a/src/com/google/android/gms/common/GooglePlayServicesUtil.java +++ b/src/com/google/android/gms/common/GooglePlayServicesUtil.java @@ -7,6 +7,8 @@ import android.app.PendingIntent; import android.content.Context; import android.content.DialogInterface; import android.content.pm.PackageManager; +import android.util.Log; + import org.microg.gms.Constants; /** @@ -17,6 +19,8 @@ import org.microg.gms.Constants; * TODO: methods :) */ public class GooglePlayServicesUtil { + private static final String TAG = "GooglePlayServicesUtil"; + public static final String GMS_ERROR_DIALOG = "GooglePlayServicesErrorDialog"; public static final String GOOGLE_PLAY_SERVICES_PACKAGE = "com.google.android.gms"; public static final int GOOGLE_PLAY_SERVICES_VERSION_CODE = Constants.MAX_REFERENCE_VERSION; @@ -27,12 +31,12 @@ public class GooglePlayServicesUtil { } public static Dialog getErrorDialog(int errorCode, Activity activity, int requestCode, - DialogInterface.OnCancelListener cancelListener) { + DialogInterface.OnCancelListener cancelListener) { return null; // TODO } public static PendingIntent getErrorPendingIntent(int errorCode, Activity activity, - int requestCode) { + int requestCode) { return null; // TODO } @@ -49,7 +53,8 @@ public class GooglePlayServicesUtil { } public static int isGooglePlayServicesAvailable(Context context) { - // As we can't know right now if the later desired feature is available, we just pretend it to be. + Log.d(TAG, "As we can't know right now if the later desired feature is available, " + + "we just pretend it to be."); return ConnectionResult.SUCCESS; } @@ -62,17 +67,18 @@ public class GooglePlayServicesUtil { } public static boolean showErrorDialogFragment(int errorCode, Activity activity, - int requestCode) { + int requestCode) { return false; // TODO } public static boolean showErrorDialogFragment(int errorCode, Activity activity, - Fragment fragment, int requestCode, DialogInterface.OnCancelListener cancelListener) { + Fragment fragment, int requestCode, + DialogInterface.OnCancelListener cancelListener) { return false; // TODO } public static boolean showErrorDialogFragment(int errorCode, Activity activity, int requestCode, - DialogInterface.OnCancelListener cancelListener) { + DialogInterface.OnCancelListener cancelListener) { return false; // TODO } diff --git a/src/com/google/android/gms/common/api/Api.java b/src/com/google/android/gms/common/api/Api.java index 5a8d3cfc..ffbeeddc 100644 --- a/src/com/google/android/gms/common/api/Api.java +++ b/src/com/google/android/gms/common/api/Api.java @@ -15,9 +15,9 @@ import org.microg.gms.common.api.ApiBuilder; * See {@link GoogleApiClient.Builder} for usage examples. */ public final class Api { - + private final ApiBuilder builder; - + public Api(ApiBuilder builder) { this.builder = builder; } diff --git a/src/com/google/android/gms/common/api/GoogleApiClient.java b/src/com/google/android/gms/common/api/GoogleApiClient.java index 3f024457..92a2ee64 100644 --- a/src/com/google/android/gms/common/api/GoogleApiClient.java +++ b/src/com/google/android/gms/common/api/GoogleApiClient.java @@ -7,7 +7,9 @@ import android.os.Handler; import android.os.Looper; import android.support.v4.app.FragmentActivity; import android.view.View; + import com.google.android.gms.common.ConnectionResult; + import org.microg.gms.Constants; import org.microg.gms.common.api.GoogleApiClientImpl; diff --git a/src/com/google/android/gms/common/api/PendingResult.java b/src/com/google/android/gms/common/api/PendingResult.java index 8845a8d7..575fc791 100644 --- a/src/com/google/android/gms/common/api/PendingResult.java +++ b/src/com/google/android/gms/common/api/PendingResult.java @@ -21,12 +21,15 @@ import java.util.concurrent.TimeUnit; */ public interface PendingResult { /** - * Blocks until the task is completed. This is not allowed on the UI thread. The returned result object can have an additional failure mode of INTERRUPTED. + * Blocks until the task is completed. This is not allowed on the UI thread. The returned + * result object can have an additional failure mode of INTERRUPTED. */ public R await(); /** - * Blocks until the task is completed or has timed out waiting for the result. This is not allowed on the UI thread. The returned result object can have an additional failure mode of either INTERRUPTED or TIMEOUT. + * Blocks until the task is completed or has timed out waiting for the result. This is not + * allowed on the UI thread. The returned result object can have an additional failure mode + * of either INTERRUPTED or TIMEOUT. */ public R await(long time, TimeUnit unit); diff --git a/src/com/google/android/gms/common/api/ResultCallback.java b/src/com/google/android/gms/common/api/ResultCallback.java index ef8e8eb2..08335d5b 100644 --- a/src/com/google/android/gms/common/api/ResultCallback.java +++ b/src/com/google/android/gms/common/api/ResultCallback.java @@ -1,7 +1,8 @@ package com.google.android.gms.common.api; /** - * An interface for receiving a {@link Result} from a {@link PendingResult} as an asynchronous callback. + * An interface for receiving a {@link Result} from a {@link PendingResult} as an asynchronous + * callback. */ public interface ResultCallback { /** diff --git a/src/com/google/android/gms/location/FusedLocationProviderApi.java b/src/com/google/android/gms/location/FusedLocationProviderApi.java index c736e6ce..46a91060 100644 --- a/src/com/google/android/gms/location/FusedLocationProviderApi.java +++ b/src/com/google/android/gms/location/FusedLocationProviderApi.java @@ -3,8 +3,10 @@ package com.google.android.gms.location; import android.app.PendingIntent; import android.location.Location; import android.os.Looper; + import com.google.android.gms.common.api.GoogleApiClient; import com.google.android.gms.common.api.PendingResult; + import org.microg.gms.Constants; public interface FusedLocationProviderApi { diff --git a/src/com/google/android/gms/location/LocationClient.java b/src/com/google/android/gms/location/LocationClient.java index a8b79b0b..130c9ed9 100644 --- a/src/com/google/android/gms/location/LocationClient.java +++ b/src/com/google/android/gms/location/LocationClient.java @@ -4,28 +4,25 @@ import android.app.PendingIntent; import android.content.Context; import android.location.Location; import android.os.Looper; -import android.os.RemoteException; -import com.google.android.gms.common.GooglePlayServicesClient; import com.google.android.gms.common.api.GoogleApiClient; import com.google.android.gms.common.api.PendingResult; import org.microg.gms.common.ForwardConnectionCallbacks; import org.microg.gms.common.ForwardConnectionFailedListener; import org.microg.gms.common.api.AbstractPlayServicesClient; -import org.microg.gms.common.api.GoogleApiClientImpl; -import org.microg.gms.location.LocationClientImpl; @Deprecated public class LocationClient extends AbstractPlayServicesClient { public static final String KEY_LOCATION_CHANGED = "com.google.android.location.LOCATION"; public LocationClient(Context context, ConnectionCallbacks callbacks, - OnConnectionFailedListener connectionFailedListener) { + OnConnectionFailedListener connectionFailedListener) { super(new GoogleApiClient.Builder(context) .addApi(LocationServices.API) .addConnectionCallbacks(new ForwardConnectionCallbacks(callbacks)) - .addOnConnectionFailedListener(new ForwardConnectionFailedListener(connectionFailedListener)) + .addOnConnectionFailedListener(new ForwardConnectionFailedListener + (connectionFailedListener)) .build()); } @@ -33,16 +30,22 @@ public class LocationClient extends AbstractPlayServicesClient { return LocationServices.FusedLocationApi.getLastLocation(googleApiClient); } - public PendingResult requestLocationUpdates(LocationRequest request, LocationListener listener) { - return LocationServices.FusedLocationApi.requestLocationUpdates(googleApiClient, request, listener); + public PendingResult requestLocationUpdates(LocationRequest request, + LocationListener listener) { + return LocationServices.FusedLocationApi.requestLocationUpdates(googleApiClient, request, + listener); } - public PendingResult requestLocationUpdates(LocationRequest request, LocationListener listener, Looper looper) { - return LocationServices.FusedLocationApi.requestLocationUpdates(googleApiClient, request, listener, looper); + public PendingResult requestLocationUpdates(LocationRequest request, + LocationListener listener, Looper looper) { + return LocationServices.FusedLocationApi.requestLocationUpdates(googleApiClient, request, + listener, looper); } - public PendingResult requestLocationUpdates(LocationRequest request, PendingIntent callbackIntent) { - return LocationServices.FusedLocationApi.requestLocationUpdates(googleApiClient, request, callbackIntent); + public PendingResult requestLocationUpdates(LocationRequest request, + PendingIntent callbackIntent) { + return LocationServices.FusedLocationApi.requestLocationUpdates(googleApiClient, request, + callbackIntent); } public PendingResult removeLocationUpdates(LocationListener listener) { @@ -50,7 +53,8 @@ public class LocationClient extends AbstractPlayServicesClient { } public PendingResult removeLocationUpdates(PendingIntent callbackIntent) { - return LocationServices.FusedLocationApi.removeLocationUpdates(googleApiClient, callbackIntent); + return LocationServices.FusedLocationApi.removeLocationUpdates(googleApiClient, + callbackIntent); } public PendingResult setMockMode(boolean isMockMode) { diff --git a/src/com/google/android/gms/location/LocationServices.java b/src/com/google/android/gms/location/LocationServices.java index db3f9b5b..c0949f43 100644 --- a/src/com/google/android/gms/location/LocationServices.java +++ b/src/com/google/android/gms/location/LocationServices.java @@ -2,12 +2,13 @@ package com.google.android.gms.location; import android.content.Context; import android.os.Looper; + import com.google.android.gms.common.api.AccountInfo; import com.google.android.gms.common.api.Api; -import org.microg.gms.common.api.ApiConnection; +import com.google.android.gms.common.api.GoogleApiClient; import org.microg.gms.common.api.ApiBuilder; -import com.google.android.gms.common.api.GoogleApiClient; +import org.microg.gms.common.api.ApiConnection; import org.microg.gms.location.FusedLocationProviderApiImpl; import org.microg.gms.location.GeofencingApiImpl; import org.microg.gms.location.LocationClientImpl; @@ -23,9 +24,10 @@ public class LocationServices { Api.ApiOptions.NoOptions options, AccountInfo accountInfo, GoogleApiClient.ConnectionCallbacks callbacks, GoogleApiClient.OnConnectionFailedListener connectionFailedListener) { - return new LocationClientImpl(context); + return new LocationClientImpl(context, callbacks, connectionFailedListener); } }); - public static final FusedLocationProviderApi FusedLocationApi = new FusedLocationProviderApiImpl(); + public static final FusedLocationProviderApi FusedLocationApi = new + FusedLocationProviderApiImpl(); public static final GeofencingApi GeofencingApi = new GeofencingApiImpl(); } diff --git a/src/org/microg/gms/common/ForwardConnectionCallbacks.java b/src/org/microg/gms/common/ForwardConnectionCallbacks.java index 026b9340..de4d9203 100644 --- a/src/org/microg/gms/common/ForwardConnectionCallbacks.java +++ b/src/org/microg/gms/common/ForwardConnectionCallbacks.java @@ -1,9 +1,9 @@ package org.microg.gms.common; import android.os.Bundle; + import com.google.android.gms.common.GooglePlayServicesClient; import com.google.android.gms.common.api.GoogleApiClient; -import com.google.android.gms.location.LocationClient; public final class ForwardConnectionCallbacks implements GoogleApiClient.ConnectionCallbacks { private final GooglePlayServicesClient.ConnectionCallbacks callbacks; diff --git a/src/org/microg/gms/common/GmsClient.java b/src/org/microg/gms/common/GmsClient.java index 14e00cd8..e990ab27 100644 --- a/src/org/microg/gms/common/GmsClient.java +++ b/src/org/microg/gms/common/GmsClient.java @@ -7,22 +7,31 @@ import android.os.Bundle; import android.os.IBinder; import android.os.IInterface; import android.os.RemoteException; +import android.util.Log; + import com.google.android.gms.common.ConnectionResult; import com.google.android.gms.common.GooglePlayServicesUtil; -import org.microg.gms.common.api.ApiConnection; +import com.google.android.gms.common.api.GoogleApiClient; import com.google.android.gms.common.internal.IGmsCallbacks; import com.google.android.gms.common.internal.IGmsServiceBroker; +import org.microg.gms.common.api.ApiConnection; + public abstract class GmsClient implements ApiConnection { private static final String TAG = "GmsClient"; private final Context context; + private final GoogleApiClient.ConnectionCallbacks callbacks; + private final GoogleApiClient.OnConnectionFailedListener connectionFailedListener; private ConnectionState state = ConnectionState.CONNECTED; private ServiceConnection serviceConnection; private I serviceInterface; - public GmsClient(Context context) { + public GmsClient(Context context, GoogleApiClient.ConnectionCallbacks callbacks, + GoogleApiClient.OnConnectionFailedListener connectionFailedListener) { this.context = context; + this.callbacks = callbacks; + this.connectionFailedListener = connectionFailedListener; } protected abstract String getActionString(); @@ -67,7 +76,7 @@ public abstract class GmsClient implements ApiConnection { public Context getContext() { return context; } - + public I getServiceInterface() { return serviceInterface; } @@ -81,7 +90,9 @@ public abstract class GmsClient implements ApiConnection { @Override public void onServiceConnected(ComponentName componentName, IBinder iBinder) { try { - onConnectedToBroker(IGmsServiceBroker.Stub.asInterface(iBinder), new GmsCallbacks()); + Log.d(TAG, "Connecting to broker for " + componentName); + onConnectedToBroker(IGmsServiceBroker.Stub.asInterface(iBinder), + new GmsCallbacks()); } catch (RemoteException e) { disconnect(); } @@ -99,6 +110,7 @@ public abstract class GmsClient implements ApiConnection { public void onPostInitComplete(int statusCode, IBinder binder, Bundle params) throws RemoteException { serviceInterface = interfaceFromBinder(binder); + callbacks.onConnected(params); } } diff --git a/src/org/microg/gms/common/GmsConnector.java b/src/org/microg/gms/common/GmsConnector.java index c222aad2..3510c956 100644 --- a/src/org/microg/gms/common/GmsConnector.java +++ b/src/org/microg/gms/common/GmsConnector.java @@ -21,13 +21,11 @@ import android.os.Message; import android.os.RemoteException; import com.google.android.gms.common.api.Api; - -import org.microg.gms.common.api.AbstractPendingResult; -import org.microg.gms.common.api.ApiConnection; - import com.google.android.gms.common.api.GoogleApiClient; import com.google.android.gms.common.api.Result; +import org.microg.gms.common.api.AbstractPendingResult; +import org.microg.gms.common.api.ApiConnection; import org.microg.gms.common.api.GoogleApiClientImpl; public class GmsConnector { @@ -43,7 +41,7 @@ public class GmsConnector connect() { - Looper looper = ((GoogleApiClientImpl) apiClient).getLooper(); + Looper looper = apiClient.getLooper(); final AbstractPendingResult result = new AbstractPendingResult<>(looper); Message msg = new Message(); msg.obj = result; diff --git a/src/org/microg/gms/common/MultiConnectionKeeper.java b/src/org/microg/gms/common/MultiConnectionKeeper.java index 459b9ccd..e7414f71 100644 --- a/src/org/microg/gms/common/MultiConnectionKeeper.java +++ b/src/org/microg/gms/common/MultiConnectionKeeper.java @@ -5,6 +5,7 @@ import android.content.Context; import android.content.Intent; import android.content.ServiceConnection; import android.os.IBinder; +import android.util.Log; import java.util.HashMap; import java.util.HashSet; @@ -14,6 +15,8 @@ import java.util.Set; import static org.microg.gms.Constants.GMS_PACKAGE_NAME; public class MultiConnectionKeeper { + private static final String TAG = "GmsMultiConnectionKeeper"; + private static MultiConnectionKeeper INSTANCE; private final Context context; @@ -45,7 +48,7 @@ public class MultiConnectionKeeper { } return con.isBound(); } - + public void unbind(String action, ServiceConnection connection) { Connection con = connections.get(action); if (con != null) { @@ -68,6 +71,7 @@ public class MultiConnectionKeeper { public void onServiceConnected(ComponentName componentName, IBinder iBinder) { binder = iBinder; component = componentName; + Log.d(TAG, "bound to " + actionString); for (ServiceConnection connection : connectionForwards) { connection.onServiceConnected(componentName, iBinder); } @@ -92,7 +96,8 @@ public class MultiConnectionKeeper { public void bind() { Intent intent = new Intent(actionString).setPackage(GMS_PACKAGE_NAME); bound = context.bindService(intent, serviceConnection, - Context.BIND_ADJUST_WITH_ACTIVITY & Context.BIND_AUTO_CREATE); + Context.BIND_ADJUST_WITH_ACTIVITY | Context.BIND_AUTO_CREATE); + Log.d(TAG, "binding to " + actionString + ": " + bound); if (!bound) { context.unbindService(serviceConnection); } @@ -108,6 +113,7 @@ public class MultiConnectionKeeper { public void unbind() { context.unbindService(serviceConnection); + Log.d(TAG, "unbinding from " + actionString); bound = false; } @@ -128,7 +134,7 @@ public class MultiConnectionKeeper { public boolean forwardsConnection(ServiceConnection connection) { return connectionForwards.contains(connection); } - + public boolean hasForwards() { return !connectionForwards.isEmpty(); } diff --git a/src/org/microg/gms/common/api/AbstractPendingResult.java b/src/org/microg/gms/common/api/AbstractPendingResult.java index 2b34ae43..e52fb847 100644 --- a/src/org/microg/gms/common/api/AbstractPendingResult.java +++ b/src/org/microg/gms/common/api/AbstractPendingResult.java @@ -1,6 +1,7 @@ package org.microg.gms.common.api; import android.os.Looper; + import com.google.android.gms.common.api.PendingResult; import com.google.android.gms.common.api.Result; import com.google.android.gms.common.api.ResultCallback; @@ -85,11 +86,11 @@ public class AbstractPendingResult implements PendingResult } } } - + private void deliverResult(R result) { this.result = result; countDownLatch.countDown(); - + } public void setResult(R result) { diff --git a/src/org/microg/gms/common/api/ApiBuilder.java b/src/org/microg/gms/common/api/ApiBuilder.java index 14aba7d0..4ffffebe 100644 --- a/src/org/microg/gms/common/api/ApiBuilder.java +++ b/src/org/microg/gms/common/api/ApiBuilder.java @@ -23,10 +23,8 @@ import com.google.android.gms.common.api.AccountInfo; import com.google.android.gms.common.api.Api; import com.google.android.gms.common.api.GoogleApiClient; -import org.microg.gms.common.api.ApiConnection; - public interface ApiBuilder { ApiConnection build(Context context, Looper looper, O options, AccountInfo accountInfo, - GoogleApiClient.ConnectionCallbacks callbacks, - GoogleApiClient.OnConnectionFailedListener connectionFailedListener); + GoogleApiClient.ConnectionCallbacks callbacks, + GoogleApiClient.OnConnectionFailedListener connectionFailedListener); } diff --git a/src/org/microg/gms/common/api/ApiConnection.java b/src/org/microg/gms/common/api/ApiConnection.java index 8f21c1bf..24a80b4a 100644 --- a/src/org/microg/gms/common/api/ApiConnection.java +++ b/src/org/microg/gms/common/api/ApiConnection.java @@ -18,6 +18,8 @@ package org.microg.gms.common.api; public interface ApiConnection { public void connect(); + public void disconnect(); + public boolean isConnected(); } diff --git a/src/org/microg/gms/common/api/GoogleApiClientImpl.java b/src/org/microg/gms/common/api/GoogleApiClientImpl.java index 8a96332c..ed67ad31 100644 --- a/src/org/microg/gms/common/api/GoogleApiClientImpl.java +++ b/src/org/microg/gms/common/api/GoogleApiClientImpl.java @@ -2,7 +2,9 @@ package org.microg.gms.common.api; import android.content.Context; import android.os.Bundle; +import android.os.Handler; import android.os.Looper; +import android.os.Message; import android.support.v4.app.FragmentActivity; import com.google.android.gms.common.ConnectionResult; import com.google.android.gms.common.api.*; @@ -19,6 +21,7 @@ public class GoogleApiClientImpl implements GoogleApiClient { private final AccountInfo accountInfo; private final Map apis = new HashMap<>(); private final Map apiConnections = new HashMap<>(); + private final Handler handler; private final Set connectionCallbacks = new HashSet<>(); private final Set connectionFailedListeners = new HashSet<>(); private final int clientId; @@ -52,6 +55,7 @@ public class GoogleApiClientImpl implements GoogleApiClient { Set connectionFailedListeners, int clientId) { this.context = context; this.looper = looper; + this.handler = new Handler(looper); this.accountInfo = accountInfo; this.apis.putAll(apis); this.connectionCallbacks.addAll(connectionCallbacks); @@ -156,4 +160,23 @@ public class GoogleApiClientImpl implements GoogleApiClient { public void unregisterConnectionFailedListener(OnConnectionFailedListener listener) { connectionFailedListeners.remove(listener); } + + private class Handler extends android.os.Handler { + private Handler(Looper looper) { + super(looper); + } + + @Override + public void handleMessage(Message msg) { + if (msg.what == 0 && msg.obj instanceof Runnable) { + ((Runnable) msg.obj).run(); + } else { + super.handleMessage(msg); + } + } + + public void sendRunnable(Runnable runnable) { + sendMessage(obtainMessage(1, runnable)); + } + } } diff --git a/src/org/microg/gms/location/FusedLocationProviderApiImpl.java b/src/org/microg/gms/location/FusedLocationProviderApiImpl.java index c3f5f36f..708f4263 100644 --- a/src/org/microg/gms/location/FusedLocationProviderApiImpl.java +++ b/src/org/microg/gms/location/FusedLocationProviderApiImpl.java @@ -16,7 +16,6 @@ import com.google.android.gms.location.LocationRequest; import com.google.android.gms.location.LocationServices; import org.microg.gms.common.GmsConnector; -import org.microg.gms.common.api.ApiConnection; public class FusedLocationProviderApiImpl implements FusedLocationProviderApi { private static final String TAG = "GmsFusedApiImpl"; @@ -33,8 +32,7 @@ public class FusedLocationProviderApiImpl implements FusedLocationProviderApi { @Override public PendingResult requestLocationUpdates(GoogleApiClient client, - final LocationRequest request, - final LocationListener listener) { + final LocationRequest request, final LocationListener listener) { return callVoid(client, new Runnable() { @Override public void run(LocationClientImpl client) throws RemoteException { @@ -45,9 +43,8 @@ public class FusedLocationProviderApiImpl implements FusedLocationProviderApi { @Override public PendingResult requestLocationUpdates(GoogleApiClient client, - final LocationRequest request, - final LocationListener listener, - final Looper looper) { + final LocationRequest request, final LocationListener listener, + final Looper looper) { return callVoid(client, new Runnable() { @Override public void run(LocationClientImpl client) throws RemoteException { @@ -58,8 +55,7 @@ public class FusedLocationProviderApiImpl implements FusedLocationProviderApi { @Override public PendingResult requestLocationUpdates(GoogleApiClient client, - final LocationRequest request, - final PendingIntent callbackIntent) { + final LocationRequest request, final PendingIntent callbackIntent) { return callVoid(client, new Runnable() { @Override public void run(LocationClientImpl client) throws RemoteException { @@ -70,7 +66,7 @@ public class FusedLocationProviderApiImpl implements FusedLocationProviderApi { @Override public PendingResult removeLocationUpdates(GoogleApiClient client, - final LocationListener listener) { + final LocationListener listener) { return callVoid(client, new Runnable() { @Override public void run(LocationClientImpl client) throws RemoteException { @@ -81,7 +77,7 @@ public class FusedLocationProviderApiImpl implements FusedLocationProviderApi { @Override public PendingResult removeLocationUpdates(GoogleApiClient client, - final PendingIntent callbackIntent) { + final PendingIntent callbackIntent) { return callVoid(client, new Runnable() { @Override public void run(LocationClientImpl client) throws RemoteException { diff --git a/src/org/microg/gms/location/GoogleLocationManagerClient.java b/src/org/microg/gms/location/GoogleLocationManagerClient.java index a60a665b..93f7fba1 100644 --- a/src/org/microg/gms/location/GoogleLocationManagerClient.java +++ b/src/org/microg/gms/location/GoogleLocationManagerClient.java @@ -4,14 +4,18 @@ import android.content.Context; import android.os.Bundle; import android.os.IBinder; import android.os.RemoteException; + +import com.google.android.gms.common.api.GoogleApiClient; import com.google.android.gms.common.internal.IGmsServiceBroker; import com.google.android.gms.location.internal.IGoogleLocationManagerService; + import org.microg.gms.Constants; import org.microg.gms.common.GmsClient; public class GoogleLocationManagerClient extends GmsClient { - public GoogleLocationManagerClient(Context context) { - super(context); + public GoogleLocationManagerClient(Context context, GoogleApiClient.ConnectionCallbacks + callbacks, GoogleApiClient.OnConnectionFailedListener connectionFailedListener) { + super(context, callbacks, connectionFailedListener); } @Override diff --git a/src/org/microg/gms/location/LocationClientImpl.java b/src/org/microg/gms/location/LocationClientImpl.java index 1bb56a9a..07aac0f3 100644 --- a/src/org/microg/gms/location/LocationClientImpl.java +++ b/src/org/microg/gms/location/LocationClientImpl.java @@ -5,6 +5,7 @@ import android.content.Context; import android.location.Location; import android.os.Looper; import android.os.RemoteException; +import android.util.Log; import com.google.android.gms.common.api.GoogleApiClient; import com.google.android.gms.location.ILocationListener; @@ -18,8 +19,12 @@ import java.util.HashMap; import java.util.Map; public class LocationClientImpl extends GoogleLocationManagerClient { - public LocationClientImpl(Context context) { - super(context); + private static final String TAG = "GmsLocationClientImpl"; + + public LocationClientImpl(Context context, GoogleApiClient.ConnectionCallbacks callbacks, + GoogleApiClient.OnConnectionFailedListener connectionFailedListener) { + super(context, callbacks, connectionFailedListener); + Log.d(TAG, ""); } public static LocationClientImpl get(GoogleApiClient apiClient) { @@ -55,7 +60,7 @@ public class LocationClientImpl extends GoogleLocationManagerClient { } public void requestLocationUpdates(LocationRequest request, LocationListener listener, - Looper looper) throws RemoteException { + Looper looper) throws RemoteException { requestLocationUpdates(request, listener); // TODO } From a2b51811289c9c224f8ea5a555a06f1a1cebe5a2 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Sat, 24 Jan 2015 19:06:41 +0100 Subject: [PATCH 019/293] Add more debug logging, fix some bugs --- .../gms/common/GooglePlayServicesUtil.java | 13 ++++--- src/org/microg/gms/common/GmsClient.java | 28 ++++++++++++--- src/org/microg/gms/common/GmsConnector.java | 9 +++-- .../gms/common/MultiConnectionKeeper.java | 14 +++++--- .../gms/common/api/AbstractPendingResult.java | 10 ++---- .../microg/gms/common/api/ApiConnection.java | 2 ++ .../gms/common/api/GoogleApiClientImpl.java | 35 +++++++++++++++---- ...andler.java => ResultCallbackHandler.java} | 12 ++++--- .../FusedLocationProviderApiImpl.java | 1 + .../location/GoogleLocationManagerClient.java | 2 +- .../gms/location/LocationClientImpl.java | 1 + 11 files changed, 90 insertions(+), 37 deletions(-) rename src/org/microg/gms/common/api/{CallbackHandler.java => ResultCallbackHandler.java} (82%) diff --git a/src/com/google/android/gms/common/GooglePlayServicesUtil.java b/src/com/google/android/gms/common/GooglePlayServicesUtil.java index 40cc045f..f1dc70c6 100644 --- a/src/com/google/android/gms/common/GooglePlayServicesUtil.java +++ b/src/com/google/android/gms/common/GooglePlayServicesUtil.java @@ -22,7 +22,7 @@ public class GooglePlayServicesUtil { private static final String TAG = "GooglePlayServicesUtil"; public static final String GMS_ERROR_DIALOG = "GooglePlayServicesErrorDialog"; - public static final String GOOGLE_PLAY_SERVICES_PACKAGE = "com.google.android.gms"; + public static final String GOOGLE_PLAY_SERVICES_PACKAGE = Constants.GMS_PACKAGE_NAME; public static final int GOOGLE_PLAY_SERVICES_VERSION_CODE = Constants.MAX_REFERENCE_VERSION; public static final String GOOGLE_PLAY_STORE_PACKAGE = "com.android.vending"; @@ -31,12 +31,12 @@ public class GooglePlayServicesUtil { } public static Dialog getErrorDialog(int errorCode, Activity activity, int requestCode, - DialogInterface.OnCancelListener cancelListener) { + DialogInterface.OnCancelListener cancelListener) { return null; // TODO } public static PendingIntent getErrorPendingIntent(int errorCode, Activity activity, - int requestCode) { + int requestCode) { return null; // TODO } @@ -67,18 +67,17 @@ public class GooglePlayServicesUtil { } public static boolean showErrorDialogFragment(int errorCode, Activity activity, - int requestCode) { + int requestCode) { return false; // TODO } public static boolean showErrorDialogFragment(int errorCode, Activity activity, - Fragment fragment, int requestCode, - DialogInterface.OnCancelListener cancelListener) { + Fragment fragment, int requestCode, DialogInterface.OnCancelListener cancelListener) { return false; // TODO } public static boolean showErrorDialogFragment(int errorCode, Activity activity, int requestCode, - DialogInterface.OnCancelListener cancelListener) { + DialogInterface.OnCancelListener cancelListener) { return false; // TODO } diff --git a/src/org/microg/gms/common/GmsClient.java b/src/org/microg/gms/common/GmsClient.java index e990ab27..c9b726f7 100644 --- a/src/org/microg/gms/common/GmsClient.java +++ b/src/org/microg/gms/common/GmsClient.java @@ -23,7 +23,7 @@ public abstract class GmsClient implements ApiConnection { private final Context context; private final GoogleApiClient.ConnectionCallbacks callbacks; private final GoogleApiClient.OnConnectionFailedListener connectionFailedListener; - private ConnectionState state = ConnectionState.CONNECTED; + private ConnectionState state = ConnectionState.NOT_CONNECTED; private ServiceConnection serviceConnection; private I serviceInterface; @@ -43,6 +43,8 @@ public abstract class GmsClient implements ApiConnection { @Override public void connect() { + Log.d(TAG, "connect()"); + if (state == ConnectionState.CONNECTED || state == ConnectionState.CONNECTING) return; state = ConnectionState.CONNECTING; if (GooglePlayServicesUtil.isGooglePlayServicesAvailable(context) != ConnectionResult.SUCCESS) { @@ -60,6 +62,12 @@ public abstract class GmsClient implements ApiConnection { @Override public void disconnect() { + Log.d(TAG, "disconnect()"); + if (state == ConnectionState.DISCONNECTING) return; + if (state == ConnectionState.CONNECTING) { + state = ConnectionState.DISCONNECTING; + return; + } serviceInterface = null; if (serviceConnection != null) { MultiConnectionKeeper.getInstance(context).unbind(getActionString(), serviceConnection); @@ -73,6 +81,11 @@ public abstract class GmsClient implements ApiConnection { return state == ConnectionState.CONNECTED; } + @Override + public boolean isConnecting() { + return state == ConnectionState.CONNECTING; + } + public Context getContext() { return context; } @@ -82,7 +95,7 @@ public abstract class GmsClient implements ApiConnection { } private enum ConnectionState { - NOT_CONNECTED, CONNECTING, CONNECTED, ERROR + NOT_CONNECTED, CONNECTING, CONNECTED, DISCONNECTING, ERROR } private class GmsServiceConnection implements ServiceConnection { @@ -90,7 +103,7 @@ public abstract class GmsClient implements ApiConnection { @Override public void onServiceConnected(ComponentName componentName, IBinder iBinder) { try { - Log.d(TAG, "Connecting to broker for " + componentName); + Log.d(TAG, "ServiceConnection : onServiceConnected(" + componentName + ")"); onConnectedToBroker(IGmsServiceBroker.Stub.asInterface(iBinder), new GmsCallbacks()); } catch (RemoteException e) { @@ -100,7 +113,7 @@ public abstract class GmsClient implements ApiConnection { @Override public void onServiceDisconnected(ComponentName componentName) { - state = ConnectionState.ERROR; + state = ConnectionState.NOT_CONNECTED; } } @@ -109,7 +122,14 @@ public abstract class GmsClient implements ApiConnection { @Override public void onPostInitComplete(int statusCode, IBinder binder, Bundle params) throws RemoteException { + if (state == ConnectionState.DISCONNECTING) { + state = ConnectionState.CONNECTED; + disconnect(); + return; + } + state = ConnectionState.CONNECTED; serviceInterface = interfaceFromBinder(binder); + Log.d(TAG, "GmsCallbacks : onPostInitComplete(" + serviceInterface + ")"); callbacks.onConnected(params); } } diff --git a/src/org/microg/gms/common/GmsConnector.java b/src/org/microg/gms/common/GmsConnector.java index 3510c956..fbd4e01b 100644 --- a/src/org/microg/gms/common/GmsConnector.java +++ b/src/org/microg/gms/common/GmsConnector.java @@ -19,6 +19,7 @@ package org.microg.gms.common; import android.os.Looper; import android.os.Message; import android.os.RemoteException; +import android.util.Log; import com.google.android.gms.common.api.Api; import com.google.android.gms.common.api.GoogleApiClient; @@ -29,6 +30,8 @@ import org.microg.gms.common.api.ApiConnection; import org.microg.gms.common.api.GoogleApiClientImpl; public class GmsConnector { + private static final String TAG = "GmsConnector"; + private final GoogleApiClientImpl apiClient; private final Api api; private final Callback callback; @@ -41,6 +44,7 @@ public class GmsConnector connect() { + Log.d(TAG, "connect()"); Looper looper = apiClient.getLooper(); final AbstractPendingResult result = new AbstractPendingResult<>(looper); Message msg = new Message(); @@ -60,11 +64,10 @@ public class GmsConnector result = (AbstractPendingResult) msg.obj; - ApiConnection apiConnection = apiClient.getApiConnection(api); - apiConnection.connect(); try { - result.setResult(callback.onClientAvailable((C) apiConnection)); + result.deliverResult(callback.onClientAvailable((C) apiClient.getApiConnection(api))); } catch (RemoteException ignored) { } diff --git a/src/org/microg/gms/common/MultiConnectionKeeper.java b/src/org/microg/gms/common/MultiConnectionKeeper.java index e7414f71..2d4fe832 100644 --- a/src/org/microg/gms/common/MultiConnectionKeeper.java +++ b/src/org/microg/gms/common/MultiConnectionKeeper.java @@ -26,13 +26,14 @@ public class MultiConnectionKeeper { this.context = context; } - public static MultiConnectionKeeper getInstance(Context context) { + public synchronized static MultiConnectionKeeper getInstance(Context context) { if (INSTANCE == null) INSTANCE = new MultiConnectionKeeper(context); return INSTANCE; } public boolean bind(String action, ServiceConnection connection) { + Log.d(TAG, "bind(" + action + ", " + connection + ")"); Connection con = connections.get(action); if (con != null) { if (!con.forwardsConnection(connection)) { @@ -50,11 +51,13 @@ public class MultiConnectionKeeper { } public void unbind(String action, ServiceConnection connection) { + Log.d(TAG, "unbind(" + action + ", " + connection + ")"); Connection con = connections.get(action); if (con != null) { con.removeConnectionForward(connection); if (!con.hasForwards() && con.isBound()) { con.unbind(); + connections.remove(action); } } } @@ -69,9 +72,10 @@ public class MultiConnectionKeeper { private ServiceConnection serviceConnection = new ServiceConnection() { @Override public void onServiceConnected(ComponentName componentName, IBinder iBinder) { + Log.d(TAG, "Connection(" + actionString + ") : ServiceConnection : " + + "onServiceConnected("+componentName+")"); binder = iBinder; component = componentName; - Log.d(TAG, "bound to " + actionString); for (ServiceConnection connection : connectionForwards) { connection.onServiceConnected(componentName, iBinder); } @@ -80,6 +84,8 @@ public class MultiConnectionKeeper { @Override public void onServiceDisconnected(ComponentName componentName) { + Log.d(TAG, "Connection(" + actionString + ") : ServiceConnection : " + + "onServiceDisconnected("+componentName+")"); binder = null; component = componentName; for (ServiceConnection connection : connectionForwards) { @@ -94,10 +100,10 @@ public class MultiConnectionKeeper { } public void bind() { + Log.d(TAG, "Connection(" + actionString + ") : bind()"); Intent intent = new Intent(actionString).setPackage(GMS_PACKAGE_NAME); bound = context.bindService(intent, serviceConnection, Context.BIND_ADJUST_WITH_ACTIVITY | Context.BIND_AUTO_CREATE); - Log.d(TAG, "binding to " + actionString + ": " + bound); if (!bound) { context.unbindService(serviceConnection); } @@ -112,8 +118,8 @@ public class MultiConnectionKeeper { } public void unbind() { + Log.d(TAG, "Connection(" + actionString + ") : unbind()"); context.unbindService(serviceConnection); - Log.d(TAG, "unbinding from " + actionString); bound = false; } diff --git a/src/org/microg/gms/common/api/AbstractPendingResult.java b/src/org/microg/gms/common/api/AbstractPendingResult.java index e52fb847..7e42142c 100644 --- a/src/org/microg/gms/common/api/AbstractPendingResult.java +++ b/src/org/microg/gms/common/api/AbstractPendingResult.java @@ -12,13 +12,13 @@ import java.util.concurrent.TimeUnit; public class AbstractPendingResult implements PendingResult { private final Object lock = new Object(); private final CountDownLatch countDownLatch = new CountDownLatch(1); - private final CallbackHandler handler; + private final ResultCallbackHandler handler; private boolean canceled; private R result; private ResultCallback resultCallback; public AbstractPendingResult(Looper looper) { - handler = new CallbackHandler(looper); + handler = new ResultCallbackHandler(looper); } private R getResult() { @@ -87,13 +87,9 @@ public class AbstractPendingResult implements PendingResult } } - private void deliverResult(R result) { + public void deliverResult(R result) { this.result = result; countDownLatch.countDown(); } - - public void setResult(R result) { - this.result = result; - } } diff --git a/src/org/microg/gms/common/api/ApiConnection.java b/src/org/microg/gms/common/api/ApiConnection.java index 24a80b4a..d5697e4a 100644 --- a/src/org/microg/gms/common/api/ApiConnection.java +++ b/src/org/microg/gms/common/api/ApiConnection.java @@ -22,4 +22,6 @@ public interface ApiConnection { public void disconnect(); public boolean isConnected(); + + boolean isConnecting(); } diff --git a/src/org/microg/gms/common/api/GoogleApiClientImpl.java b/src/org/microg/gms/common/api/GoogleApiClientImpl.java index ed67ad31..1884b2f1 100644 --- a/src/org/microg/gms/common/api/GoogleApiClientImpl.java +++ b/src/org/microg/gms/common/api/GoogleApiClientImpl.java @@ -2,12 +2,17 @@ package org.microg.gms.common.api; import android.content.Context; import android.os.Bundle; -import android.os.Handler; import android.os.Looper; import android.os.Message; import android.support.v4.app.FragmentActivity; +import android.util.Log; + import com.google.android.gms.common.ConnectionResult; -import com.google.android.gms.common.api.*; +import com.google.android.gms.common.api.AccountInfo; +import com.google.android.gms.common.api.Api; +import com.google.android.gms.common.api.GoogleApiClient; +import com.google.android.gms.common.api.PendingResult; +import com.google.android.gms.common.api.Status; import java.util.HashMap; import java.util.HashSet; @@ -16,6 +21,8 @@ import java.util.Set; import java.util.concurrent.TimeUnit; public class GoogleApiClientImpl implements GoogleApiClient { + private static final String TAG = "GmsApiClientImpl"; + private final Context context; private final Looper looper; private final AccountInfo accountInfo; @@ -28,6 +35,7 @@ public class GoogleApiClientImpl implements GoogleApiClient { private final ConnectionCallbacks baseConnectionCallbacks = new ConnectionCallbacks() { @Override public void onConnected(Bundle connectionHint) { + Log.d(TAG, "ConnectionCallbacks : onConnected()"); for (ConnectionCallbacks callback : connectionCallbacks) { callback.onConnected(connectionHint); } @@ -35,14 +43,17 @@ public class GoogleApiClientImpl implements GoogleApiClient { @Override public void onConnectionSuspended(int cause) { + Log.d(TAG, "ConnectionCallbacks : onConnectionSuspended()"); for (ConnectionCallbacks callback : connectionCallbacks) { callback.onConnectionSuspended(cause); } } }; - private final OnConnectionFailedListener baseConnectionFailedListener = new OnConnectionFailedListener() { + private final OnConnectionFailedListener baseConnectionFailedListener = new + OnConnectionFailedListener() { @Override public void onConnectionFailed(ConnectionResult result) { + Log.d(TAG, "OnConnectionFailedListener : onConnectionFailed()"); for (OnConnectionFailedListener listener : connectionFailedListeners) { listener.onConnectionFailed(result); } @@ -61,7 +72,7 @@ public class GoogleApiClientImpl implements GoogleApiClient { this.connectionCallbacks.addAll(connectionCallbacks); this.connectionFailedListeners.addAll(connectionFailedListeners); this.clientId = clientId; - + for (Api api : apis.keySet()) { apiConnections.put(api, api.getBuilder().build(context, looper, apis.get(api), accountInfo, baseConnectionCallbacks, @@ -94,15 +105,21 @@ public class GoogleApiClientImpl implements GoogleApiClient { @Override public void connect() { + Log.d(TAG, "connect()"); for (ApiConnection connection : apiConnections.values()) { - connection.connect(); + if (!connection.isConnected()) { + connection.connect(); + } } } @Override public void disconnect() { + Log.d(TAG, "disconnect()"); for (ApiConnection connection : apiConnections.values()) { - connection.disconnect(); + if (connection.isConnected()) { + connection.disconnect(); + } } } @@ -116,7 +133,10 @@ public class GoogleApiClientImpl implements GoogleApiClient { @Override public boolean isConnecting() { - return false; // TODO + for (ApiConnection connection : apiConnections.values()) { + if (connection.isConnecting()) return true; + } + return false; } @Override @@ -132,6 +152,7 @@ public class GoogleApiClientImpl implements GoogleApiClient { @Override public void reconnect() { + Log.d(TAG, "reconnect()"); disconnect(); connect(); } diff --git a/src/org/microg/gms/common/api/CallbackHandler.java b/src/org/microg/gms/common/api/ResultCallbackHandler.java similarity index 82% rename from src/org/microg/gms/common/api/CallbackHandler.java rename to src/org/microg/gms/common/api/ResultCallbackHandler.java index b2250f9e..0d5dbe98 100644 --- a/src/org/microg/gms/common/api/CallbackHandler.java +++ b/src/org/microg/gms/common/api/ResultCallbackHandler.java @@ -3,14 +3,17 @@ package org.microg.gms.common.api; import android.os.Handler; import android.os.Looper; import android.os.Message; +import android.util.Log; + import com.google.android.gms.common.api.Result; import com.google.android.gms.common.api.ResultCallback; -class CallbackHandler extends Handler { +class ResultCallbackHandler extends Handler { + private static final String TAG = "GmsResultCallbackHandler"; public static final int CALLBACK_ON_COMPLETE = 1; public static final int CALLBACK_ON_TIMEOUT = 2; - - public CallbackHandler(Looper looper) { + + public ResultCallbackHandler(Looper looper) { super(looper); } @@ -19,6 +22,7 @@ class CallbackHandler extends Handler { switch (msg.what) { case CALLBACK_ON_COMPLETE: OnCompleteObject o = (OnCompleteObject) msg.obj; + Log.d(TAG, "handleMessage() : onResult(" + o.result + ")"); o.callback.onResult(o.result); break; case CALLBACK_ON_TIMEOUT: @@ -35,7 +39,7 @@ class CallbackHandler extends Handler { } public void sendTimeoutResultCallback(AbstractPendingResult pendingResult, long millis) { - + } public static class OnCompleteObject { diff --git a/src/org/microg/gms/location/FusedLocationProviderApiImpl.java b/src/org/microg/gms/location/FusedLocationProviderApiImpl.java index 708f4263..ee2bcd25 100644 --- a/src/org/microg/gms/location/FusedLocationProviderApiImpl.java +++ b/src/org/microg/gms/location/FusedLocationProviderApiImpl.java @@ -23,6 +23,7 @@ public class FusedLocationProviderApiImpl implements FusedLocationProviderApi { @Override public Location getLastLocation(GoogleApiClient client) { try { + Log.d(TAG, "getLastLocation(" + client + ")"); return LocationClientImpl.get(client).getLastLocation(); } catch (RemoteException e) { Log.w(TAG, e); diff --git a/src/org/microg/gms/location/GoogleLocationManagerClient.java b/src/org/microg/gms/location/GoogleLocationManagerClient.java index 93f7fba1..63ed578b 100644 --- a/src/org/microg/gms/location/GoogleLocationManagerClient.java +++ b/src/org/microg/gms/location/GoogleLocationManagerClient.java @@ -12,7 +12,7 @@ import com.google.android.gms.location.internal.IGoogleLocationManagerService; import org.microg.gms.Constants; import org.microg.gms.common.GmsClient; -public class GoogleLocationManagerClient extends GmsClient { +public abstract class GoogleLocationManagerClient extends GmsClient { public GoogleLocationManagerClient(Context context, GoogleApiClient.ConnectionCallbacks callbacks, GoogleApiClient.OnConnectionFailedListener connectionFailedListener) { super(context, callbacks, connectionFailedListener); diff --git a/src/org/microg/gms/location/LocationClientImpl.java b/src/org/microg/gms/location/LocationClientImpl.java index 07aac0f3..4ce3a12a 100644 --- a/src/org/microg/gms/location/LocationClientImpl.java +++ b/src/org/microg/gms/location/LocationClientImpl.java @@ -38,6 +38,7 @@ public class LocationClientImpl extends GoogleLocationManagerClient { private Map listenerMap = new HashMap<>(); public Location getLastLocation() throws RemoteException { + Log.d(TAG, "getLastLocation()"); return getServiceInterface().getLastLocation(); } From 50c81f4a2486d8ae720f94e6e1530f7ef64bbac8 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Sat, 24 Jan 2015 21:57:42 +0100 Subject: [PATCH 020/293] Add fallback to native location provider --- AndroidManifest.xml | 5 +- src/org/microg/gms/common/GmsClient.java | 42 ++-- .../gms/location/LocationClientImpl.java | 77 +++++-- .../location/NativeLocationClientImpl.java | 208 ++++++++++++++++++ 4 files changed, 296 insertions(+), 36 deletions(-) create mode 100644 src/org/microg/gms/location/NativeLocationClientImpl.java diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 7c0e18bf..b0fcdc8e 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -2,5 +2,8 @@ - + + + + diff --git a/src/org/microg/gms/common/GmsClient.java b/src/org/microg/gms/common/GmsClient.java index c9b726f7..e8cd12ae 100644 --- a/src/org/microg/gms/common/GmsClient.java +++ b/src/org/microg/gms/common/GmsClient.java @@ -10,7 +10,6 @@ import android.os.RemoteException; import android.util.Log; import com.google.android.gms.common.ConnectionResult; -import com.google.android.gms.common.GooglePlayServicesUtil; import com.google.android.gms.common.api.GoogleApiClient; import com.google.android.gms.common.internal.IGmsCallbacks; import com.google.android.gms.common.internal.IGmsServiceBroker; @@ -21,9 +20,9 @@ public abstract class GmsClient implements ApiConnection { private static final String TAG = "GmsClient"; private final Context context; - private final GoogleApiClient.ConnectionCallbacks callbacks; - private final GoogleApiClient.OnConnectionFailedListener connectionFailedListener; - private ConnectionState state = ConnectionState.NOT_CONNECTED; + protected final GoogleApiClient.ConnectionCallbacks callbacks; + protected final GoogleApiClient.OnConnectionFailedListener connectionFailedListener; + protected ConnectionState state = ConnectionState.NOT_CONNECTED; private ServiceConnection serviceConnection; private I serviceInterface; @@ -46,18 +45,21 @@ public abstract class GmsClient implements ApiConnection { Log.d(TAG, "connect()"); if (state == ConnectionState.CONNECTED || state == ConnectionState.CONNECTING) return; state = ConnectionState.CONNECTING; - if (GooglePlayServicesUtil.isGooglePlayServicesAvailable(context) != - ConnectionResult.SUCCESS) { - state = ConnectionState.NOT_CONNECTED; - } else { - if (serviceConnection != null) { - MultiConnectionKeeper.getInstance(context) - .unbind(getActionString(), serviceConnection); - } - serviceConnection = new GmsServiceConnection(); - MultiConnectionKeeper.getInstance(context).bind(getActionString(), - serviceConnection); + if (serviceConnection != null) { + MultiConnectionKeeper.getInstance(context) + .unbind(getActionString(), serviceConnection); } + serviceConnection = new GmsServiceConnection(); + if (!MultiConnectionKeeper.getInstance(context).bind(getActionString(), + serviceConnection)) { + state = ConnectionState.ERROR; + handleConnectionFailed(); + } + } + + public void handleConnectionFailed() { + connectionFailedListener.onConnectionFailed(new ConnectionResult(ConnectionResult + .API_UNAVAILABLE, null)); } @Override @@ -78,7 +80,7 @@ public abstract class GmsClient implements ApiConnection { @Override public boolean isConnected() { - return state == ConnectionState.CONNECTED; + return state == ConnectionState.CONNECTED || state == ConnectionState.PSEUDO_CONNECTED; } @Override @@ -86,6 +88,10 @@ public abstract class GmsClient implements ApiConnection { return state == ConnectionState.CONNECTING; } + public boolean hasError() { + return state == ConnectionState.ERROR; + } + public Context getContext() { return context; } @@ -94,8 +100,8 @@ public abstract class GmsClient implements ApiConnection { return serviceInterface; } - private enum ConnectionState { - NOT_CONNECTED, CONNECTING, CONNECTED, DISCONNECTING, ERROR + protected enum ConnectionState { + NOT_CONNECTED, CONNECTING, CONNECTED, DISCONNECTING, ERROR, PSEUDO_CONNECTED } private class GmsServiceConnection implements ServiceConnection { diff --git a/src/org/microg/gms/location/LocationClientImpl.java b/src/org/microg/gms/location/LocationClientImpl.java index 4ce3a12a..57c9c60b 100644 --- a/src/org/microg/gms/location/LocationClientImpl.java +++ b/src/org/microg/gms/location/LocationClientImpl.java @@ -3,6 +3,7 @@ package org.microg.gms.location; import android.app.PendingIntent; import android.content.Context; import android.location.Location; +import android.os.Bundle; import android.os.Looper; import android.os.RemoteException; import android.util.Log; @@ -20,6 +21,9 @@ import java.util.Map; public class LocationClientImpl extends GoogleLocationManagerClient { private static final String TAG = "GmsLocationClientImpl"; + private NativeLocationClientImpl nativeLocation = null; + private Map listenerMap = new HashMap<>(); + public LocationClientImpl(Context context, GoogleApiClient.ConnectionCallbacks callbacks, GoogleApiClient.OnConnectionFailedListener connectionFailedListener) { @@ -35,50 +39,89 @@ public class LocationClientImpl extends GoogleLocationManagerClient { return null; } - private Map listenerMap = new HashMap<>(); - public Location getLastLocation() throws RemoteException { Log.d(TAG, "getLastLocation()"); - return getServiceInterface().getLastLocation(); + if (nativeLocation != null) { + return nativeLocation.getLastLocation(); + } else { + return getServiceInterface().getLastLocation(); + } } public void requestLocationUpdates(LocationRequest request, final LocationListener listener) throws RemoteException { - ILocationListener iLocationListener = new ILocationListener.Stub() { - @Override - public void onLocationChanged(Location location) throws RemoteException { - listener.onLocationChanged(location); + if (nativeLocation != null) { + nativeLocation.requestLocationUpdates(request, listener); + } else { + if (!listenerMap.containsKey(listener)) { + listenerMap.put(listener, new ILocationListener.Stub() { + @Override + public void onLocationChanged(Location location) throws RemoteException { + listener.onLocationChanged(location); + } + }); } - }; - listenerMap.put(listener, iLocationListener); - getServiceInterface().requestLocationUpdatesWithPackage(request, - iLocationListener, getContext().getPackageName()); + getServiceInterface().requestLocationUpdatesWithPackage(request, + listenerMap.get(listener), getContext().getPackageName()); + } } public void requestLocationUpdates(LocationRequest request, PendingIntent pendingIntent) throws RemoteException { - getServiceInterface().requestLocationUpdatesWithIntent(request, pendingIntent); + if (nativeLocation != null) { + nativeLocation.requestLocationUpdates(request, pendingIntent); + } else { + getServiceInterface().requestLocationUpdatesWithIntent(request, pendingIntent); + } } public void requestLocationUpdates(LocationRequest request, LocationListener listener, Looper looper) throws RemoteException { + if (nativeLocation != null) { + nativeLocation.requestLocationUpdates(request, listener, looper); + } requestLocationUpdates(request, listener); // TODO } public void removeLocationUpdates(LocationListener listener) throws RemoteException { - getServiceInterface().removeLocationUpdatesWithListener(listenerMap.get(listener)); - listenerMap.remove(listener); + if (nativeLocation != null) { + nativeLocation.removeLocationUpdates(listener); + } else { + getServiceInterface().removeLocationUpdatesWithListener(listenerMap.get(listener)); + } } public void removeLocationUpdates(PendingIntent pendingIntent) throws RemoteException { - getServiceInterface().removeLocationUpdatesWithIntent(pendingIntent); + if (nativeLocation != null) { + nativeLocation.removeLocationUpdates(pendingIntent); + } else { + getServiceInterface().removeLocationUpdatesWithIntent(pendingIntent); + } } public void setMockMode(boolean isMockMode) throws RemoteException { - getServiceInterface().setMockMode(isMockMode); + if (nativeLocation != null) { + nativeLocation.setMockMode(isMockMode); + } else { + getServiceInterface().setMockMode(isMockMode); + } } public void setMockLocation(Location mockLocation) throws RemoteException { - getServiceInterface().setMockLocation(mockLocation); + if (nativeLocation != null) { + nativeLocation.setMockLocation(mockLocation); + } else { + getServiceInterface().setMockLocation(mockLocation); + } + } + + @Override + public void handleConnectionFailed() { + // DO NOT call super here, because fails are not really problems :) + nativeLocation = new NativeLocationClientImpl(this); + state = ConnectionState.PSEUDO_CONNECTED; + Bundle bundle = new Bundle(); + bundle.putBoolean("fallback_to_native_active", true); + callbacks.onConnected(bundle); } } diff --git a/src/org/microg/gms/location/NativeLocationClientImpl.java b/src/org/microg/gms/location/NativeLocationClientImpl.java new file mode 100644 index 00000000..1937c6c1 --- /dev/null +++ b/src/org/microg/gms/location/NativeLocationClientImpl.java @@ -0,0 +1,208 @@ +/* + * Copyright 2014-2015 µg 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 org.microg.gms.location; + +import android.app.PendingIntent; +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; +import android.location.Criteria; +import android.location.Location; +import android.location.LocationManager; +import android.os.Bundle; +import android.os.Looper; +import android.util.Log; + +import com.google.android.gms.location.LocationListener; +import com.google.android.gms.location.LocationRequest; + +import java.util.HashMap; +import java.util.Map; + +public class NativeLocationClientImpl { + private final static String TAG = "GmsToNativeLocationClient"; + private final static Criteria DEFAULT_CRITERIA = new Criteria(); + private final static Map pendingCount = new HashMap<>(); + private final static Map nativePendingMap = new HashMap<>(); + private static final String EXTRA_PENDING_INTENT = "pending_intent"; + + private final Context context; + private final LocationManager locationManager; + private final Map nativeListenerMap = new HashMap<>(); + + public NativeLocationClientImpl(LocationClientImpl client) { + context = client.getContext(); + locationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE); + } + + private static Criteria makeNativeCriteria(LocationRequest request) { + Criteria criteria = new Criteria(); + switch (request.getPriority()) { + case LocationRequest.PRIORITY_HIGH_ACCURACY: + criteria.setAccuracy(Criteria.ACCURACY_FINE); + criteria.setPowerRequirement(Criteria.POWER_HIGH); + break; + case LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY: + default: + criteria.setAccuracy(Criteria.ACCURACY_COARSE); + criteria.setPowerRequirement(Criteria.POWER_MEDIUM); + break; + case LocationRequest.PRIORITY_NO_POWER: + case LocationRequest.PRIORITY_LOW_POWER: + criteria.setAccuracy(Criteria.ACCURACY_COARSE); + criteria.setPowerRequirement(Criteria.POWER_LOW); + } + return criteria; + } + + public Location getLastLocation() { + Log.d(TAG,"getLastLocation()"); + return locationManager.getLastKnownLocation( + locationManager.getBestProvider(DEFAULT_CRITERIA, true)); + } + + public void requestLocationUpdates(LocationRequest request, LocationListener listener) { + requestLocationUpdates(request, listener, Looper.getMainLooper()); + } + + public void requestLocationUpdates(LocationRequest request, PendingIntent pendingIntent) { + Log.d(TAG,"requestLocationUpdates()"); + Intent i = new Intent(context, NativePendingIntentForwarder.class); + Bundle bundle = new Bundle(); + bundle.putParcelable(EXTRA_PENDING_INTENT, pendingIntent); + i.putExtras(bundle); + pendingCount.put(pendingIntent, request.getNumUpdates()); + nativePendingMap.put(pendingIntent, PendingIntent.getActivity(context, 0, i, 0)); + locationManager.requestLocationUpdates(request.getInterval(), + request.getSmallestDesplacement(), makeNativeCriteria(request), + nativePendingMap.get(pendingIntent)); + } + + public void requestLocationUpdates(LocationRequest request, LocationListener listener, Looper + looper) { + Log.d(TAG,"requestLocationUpdates()"); + if (nativeListenerMap.containsKey(listener)) { + removeLocationUpdates(listener); + } + nativeListenerMap.put(listener, new NativeListener(listener, request.getNumUpdates())); + locationManager.requestLocationUpdates(request.getInterval(), + request.getSmallestDesplacement(), makeNativeCriteria(request), + nativeListenerMap.get(listener), looper); + } + + public void removeLocationUpdates(LocationListener listener) { + Log.d(TAG,"removeLocationUpdates()"); + locationManager.removeUpdates(nativeListenerMap.get(listener)); + nativeListenerMap.remove(listener); + } + + public void removeLocationUpdates(PendingIntent pendingIntent) { + Log.d(TAG,"removeLocationUpdates()"); + locationManager.removeUpdates(nativePendingMap.get(pendingIntent)); + nativePendingMap.remove(pendingIntent); + pendingCount.remove(pendingIntent); + } + + public void setMockMode(boolean isMockMode) { + Log.d(TAG,"setMockMode()"); + // not yet supported + } + + public void setMockLocation(Location mockLocation) { + Log.d(TAG,"setMockLocation()"); + // not yet supported + } + + public static class NativePendingIntentForwarder extends BroadcastReceiver { + + @Override + public void onReceive(Context context, Intent intent) { + if (intent.hasExtra(LocationManager.KEY_LOCATION_CHANGED)) { + PendingIntent pendingIntent = intent.getExtras().getParcelable + (EXTRA_PENDING_INTENT); + try { + pendingIntent.send(context, 0, intent); + pendingCount.put(pendingIntent, pendingCount.get(pendingIntent) - 1); + if (pendingCount.get(pendingIntent) == 0) { + ((LocationManager) context.getSystemService(Context.LOCATION_SERVICE)) + .removeUpdates(nativePendingMap.get(pendingIntent)); + nativePendingMap.remove(pendingIntent); + pendingCount.remove(pendingIntent); + } + } catch (PendingIntent.CanceledException e) { + ((LocationManager) context.getSystemService(Context.LOCATION_SERVICE)) + .removeUpdates(nativePendingMap.get(pendingIntent)); + nativePendingMap.remove(pendingIntent); + pendingCount.remove(pendingIntent); + } + } + } + } + + public class NativeListener implements android.location.LocationListener { + + private final LocationListener listener; + private int count; + + private NativeListener(LocationListener listener, int count) { + this.listener = listener; + this.count = count; + } + + @Override + public void onLocationChanged(Location location) { + listener.onLocationChanged(location); + count--; + if (count == 0) { + locationManager.removeUpdates(this); + nativeListenerMap.remove(listener); + } + } + + @Override + public void onStatusChanged(String provider, int status, Bundle extras) { + + } + + @Override + public void onProviderEnabled(String provider) { + + } + + @Override + public void onProviderDisabled(String provider) { + + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + NativeListener that = (NativeListener) o; + + if (!listener.equals(that.listener)) return false; + + return true; + } + + @Override + public int hashCode() { + return listener.hashCode(); + } + } +} From e7a815f6554e38451ab027bbba796b10710c70d8 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Sat, 24 Jan 2015 22:20:41 +0100 Subject: [PATCH 021/293] Add submodule --- .gitignore | 6 ++++++ .gitmodules | 3 +++ SafeParcel | 1 + 3 files changed, 10 insertions(+) create mode 100644 .gitignore create mode 100644 .gitmodules create mode 160000 SafeParcel diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..2653ad41 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +out/ +build/ +*.iml +local.properties +gradle/ +gradlew diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..20fd0301 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "SafeParcel"] + path = SafeParcel + url = https://github.com/microg/android_external_SafeParcel.git diff --git a/SafeParcel b/SafeParcel new file mode 160000 index 00000000..330b6bd4 --- /dev/null +++ b/SafeParcel @@ -0,0 +1 @@ +Subproject commit 330b6bd4f38297473c661e7f7727579cc1659181 From 426b7b07db28b65ba9c4ae937ad757ac83539736 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Sun, 25 Jan 2015 01:09:54 +0100 Subject: [PATCH 022/293] Add settings.gradle --- .gitignore | 1 + settings.gradle | 1 + 2 files changed, 2 insertions(+) create mode 100644 settings.gradle diff --git a/.gitignore b/.gitignore index 2653ad41..bf3b44e9 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ build/ local.properties gradle/ gradlew +.gradle/ diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 00000000..0151283d --- /dev/null +++ b/settings.gradle @@ -0,0 +1 @@ +include ':SafeParcel' From b82cd0aeccc00fcbbfe4778b29c7a07f2b4c2c48 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Sun, 25 Jan 2015 01:14:08 +0100 Subject: [PATCH 023/293] Update SafeParcel --- SafeParcel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SafeParcel b/SafeParcel index 330b6bd4..3efecf38 160000 --- a/SafeParcel +++ b/SafeParcel @@ -1 +1 @@ -Subproject commit 330b6bd4f38297473c661e7f7727579cc1659181 +Subproject commit 3efecf38ca8b1f89cd8f0c40eea4b497f1563d90 From 7e2f3b8f7b598ee243486e03f0637b8334be216f Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Sun, 25 Jan 2015 01:19:43 +0100 Subject: [PATCH 024/293] Fix gradle --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index dd90597a..ea4fbdb4 100644 --- a/build.gradle +++ b/build.gradle @@ -10,7 +10,7 @@ buildscript { apply plugin: 'com.android.library' dependencies { - compile project(':SafeParcel') + compile project('SafeParcel') } android { From fd9bd3950c40151020a13a33067f1a0ace9462e9 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Sun, 25 Jan 2015 01:22:44 +0100 Subject: [PATCH 025/293] Explain + usage --- .gitignore | 7 +++++++ .gitmodules | 3 +++ GmsApi | 1 + README.md | 20 ++++++++++++++++++++ settings.gradle | 1 + 5 files changed, 32 insertions(+) create mode 100644 .gitignore create mode 100644 .gitmodules create mode 160000 GmsApi create mode 100644 settings.gradle diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..5a0e68a2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +out/ +build/ +*.iml +local.properties +.gradle/ +gradle/ +gradlew diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..4503545a --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "GmsApi"] + path = GmsApi + url = https://github.com/microg/android_external_GmsApi.git diff --git a/GmsApi b/GmsApi new file mode 160000 index 00000000..7e2f3b8f --- /dev/null +++ b/GmsApi @@ -0,0 +1 @@ +Subproject commit 7e2f3b8f7b598ee243486e03f0637b8334be216f diff --git a/README.md b/README.md index f3f240f3..d03a1ce4 100644 --- a/README.md +++ b/README.md @@ -3,3 +3,23 @@ GmsLib This library is a compatibility implementation of the often used play-services library. It will try to use the Play Services when installed on the target device. If this is not possible, a basic fallback implementation might be used. + +WIP +--- +This is still work in progress, and most applications will not build. +However feel free to try it out and create issues for missing method calls (please include an application to test it). + +Example: DashClock +------------------ +[DashClock](https://code.google.com/p/dashclock/) is an open source clock widget with enhanced features. +However it uses play services as location backend and thus requires proprietary libraries to compile it. + +However, it is possible to build DashClock using GmsLib, supporting all it's location features, with or without play services installed. +To do this, download and build GmsLib plus its submodules and copy the three resulting .aar files (SafeParcel.aar, GmsApi.aar, GmsLib.aar) to `$DASHCLOCK_DIR/local_aars/`. +Then replace `compile 'com.google.android.gms:play-services:4.0.30'` in `$DASHCLOCK_SRC/main/build.gradle` with + + compile(name:'GmsLib', ext:'aar') + compile(name:'GmsApi', ext:'aar') + compile(name:'SafeParcel', ext:'aar') + +and build as usual. diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 00000000..dbfd9faf --- /dev/null +++ b/settings.gradle @@ -0,0 +1 @@ +include ':GmsApi', ':GmsApi:SafeParcel' From c4db81d1fcf5c301f34e12d5675b9b50c507bd42 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Sun, 25 Jan 2015 01:27:21 +0100 Subject: [PATCH 026/293] Revert "Fix gradle" This reverts commit 7e2f3b8f7b598ee243486e03f0637b8334be216f. --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index ea4fbdb4..dd90597a 100644 --- a/build.gradle +++ b/build.gradle @@ -10,7 +10,7 @@ buildscript { apply plugin: 'com.android.library' dependencies { - compile project('SafeParcel') + compile project(':SafeParcel') } android { From e9dfb23e604fe19aea2eb0e0ab2b8f4bb34dcf72 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Sun, 25 Jan 2015 01:29:43 +0100 Subject: [PATCH 027/293] Subsubmodules are messy with git, just don't use them --- .gitmodules | 3 +++ GmsApi | 2 +- SafeParcel | 1 + settings.gradle | 2 +- 4 files changed, 6 insertions(+), 2 deletions(-) create mode 160000 SafeParcel diff --git a/.gitmodules b/.gitmodules index 4503545a..2be15080 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "GmsApi"] path = GmsApi url = https://github.com/microg/android_external_GmsApi.git +[submodule "SafeParcel"] + path = SafeParcel + url = https://github.com/microg/android_external_SafeParcel.git diff --git a/GmsApi b/GmsApi index 7e2f3b8f..c4db81d1 160000 --- a/GmsApi +++ b/GmsApi @@ -1 +1 @@ -Subproject commit 7e2f3b8f7b598ee243486e03f0637b8334be216f +Subproject commit c4db81d1fcf5c301f34e12d5675b9b50c507bd42 diff --git a/SafeParcel b/SafeParcel new file mode 160000 index 00000000..3efecf38 --- /dev/null +++ b/SafeParcel @@ -0,0 +1 @@ +Subproject commit 3efecf38ca8b1f89cd8f0c40eea4b497f1563d90 diff --git a/settings.gradle b/settings.gradle index dbfd9faf..87e5535f 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1 @@ -include ':GmsApi', ':GmsApi:SafeParcel' +include ':GmsApi', ':SafeParcel' From 55a608cc8d07936750f41ba40ab574d6a91b433a Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Sun, 25 Jan 2015 01:55:26 +0100 Subject: [PATCH 028/293] Fix res path --- build.gradle | 1 + {src/main/res => res}/values/version.xml | 0 2 files changed, 1 insertion(+) rename {src/main/res => res}/values/version.xml (100%) diff --git a/build.gradle b/build.gradle index 5d2d1c52..b581ecdf 100644 --- a/build.gradle +++ b/build.gradle @@ -24,6 +24,7 @@ android { manifest.srcFile 'AndroidManifest.xml' java.srcDirs = ['src'] aidl.srcDirs = ['src'] + res.srcDirs = ['res'] } } } diff --git a/src/main/res/values/version.xml b/res/values/version.xml similarity index 100% rename from src/main/res/values/version.xml rename to res/values/version.xml From af8bc78effb0e7d3c98981a6d663f7d1c4abe7d3 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Sun, 25 Jan 2015 02:11:52 +0100 Subject: [PATCH 029/293] Add copyright notice --- .../gms/common/ForwardConnectionCallbacks.java | 16 ++++++++++++++++ .../common/ForwardConnectionFailedListener.java | 16 ++++++++++++++++ src/org/microg/gms/common/GmsClient.java | 16 ++++++++++++++++ src/org/microg/gms/common/GmsConnector.java | 3 ++- .../microg/gms/common/MultiConnectionKeeper.java | 16 ++++++++++++++++ .../gms/common/api/AbstractPendingResult.java | 16 ++++++++++++++++ .../gms/common/api/GoogleApiClientImpl.java | 16 ++++++++++++++++ .../gms/common/api/ResultCallbackHandler.java | 16 ++++++++++++++++ .../location/FusedLocationProviderApiImpl.java | 16 ++++++++++++++++ .../microg/gms/location/GeofencingApiImpl.java | 16 ++++++++++++++++ .../location/GoogleLocationManagerClient.java | 16 ++++++++++++++++ .../microg/gms/location/LocationClientImpl.java | 16 ++++++++++++++++ 12 files changed, 178 insertions(+), 1 deletion(-) diff --git a/src/org/microg/gms/common/ForwardConnectionCallbacks.java b/src/org/microg/gms/common/ForwardConnectionCallbacks.java index de4d9203..e38972ff 100644 --- a/src/org/microg/gms/common/ForwardConnectionCallbacks.java +++ b/src/org/microg/gms/common/ForwardConnectionCallbacks.java @@ -1,3 +1,19 @@ +/* + * Copyright 2014-2015 µg 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 org.microg.gms.common; import android.os.Bundle; diff --git a/src/org/microg/gms/common/ForwardConnectionFailedListener.java b/src/org/microg/gms/common/ForwardConnectionFailedListener.java index 273383f9..823a1991 100644 --- a/src/org/microg/gms/common/ForwardConnectionFailedListener.java +++ b/src/org/microg/gms/common/ForwardConnectionFailedListener.java @@ -1,3 +1,19 @@ +/* + * Copyright 2014-2015 µg 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 org.microg.gms.common; import com.google.android.gms.common.ConnectionResult; diff --git a/src/org/microg/gms/common/GmsClient.java b/src/org/microg/gms/common/GmsClient.java index e8cd12ae..800b8df8 100644 --- a/src/org/microg/gms/common/GmsClient.java +++ b/src/org/microg/gms/common/GmsClient.java @@ -1,3 +1,19 @@ +/* + * Copyright 2014-2015 µg 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 org.microg.gms.common; import android.content.ComponentName; diff --git a/src/org/microg/gms/common/GmsConnector.java b/src/org/microg/gms/common/GmsConnector.java index fbd4e01b..cd23afc7 100644 --- a/src/org/microg/gms/common/GmsConnector.java +++ b/src/org/microg/gms/common/GmsConnector.java @@ -67,7 +67,8 @@ public class GmsConnector result = (AbstractPendingResult) msg.obj; try { - result.deliverResult(callback.onClientAvailable((C) apiClient.getApiConnection(api))); + result.deliverResult(callback.onClientAvailable((C) apiClient.getApiConnection + (api))); } catch (RemoteException ignored) { } diff --git a/src/org/microg/gms/common/MultiConnectionKeeper.java b/src/org/microg/gms/common/MultiConnectionKeeper.java index 2d4fe832..bb454e55 100644 --- a/src/org/microg/gms/common/MultiConnectionKeeper.java +++ b/src/org/microg/gms/common/MultiConnectionKeeper.java @@ -1,3 +1,19 @@ +/* + * Copyright 2014-2015 µg 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 org.microg.gms.common; import android.content.ComponentName; diff --git a/src/org/microg/gms/common/api/AbstractPendingResult.java b/src/org/microg/gms/common/api/AbstractPendingResult.java index 7e42142c..7986adff 100644 --- a/src/org/microg/gms/common/api/AbstractPendingResult.java +++ b/src/org/microg/gms/common/api/AbstractPendingResult.java @@ -1,3 +1,19 @@ +/* + * Copyright 2014-2015 µg 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 org.microg.gms.common.api; import android.os.Looper; diff --git a/src/org/microg/gms/common/api/GoogleApiClientImpl.java b/src/org/microg/gms/common/api/GoogleApiClientImpl.java index 1884b2f1..ff2fa9ce 100644 --- a/src/org/microg/gms/common/api/GoogleApiClientImpl.java +++ b/src/org/microg/gms/common/api/GoogleApiClientImpl.java @@ -1,3 +1,19 @@ +/* + * Copyright 2014-2015 µg 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 org.microg.gms.common.api; import android.content.Context; diff --git a/src/org/microg/gms/common/api/ResultCallbackHandler.java b/src/org/microg/gms/common/api/ResultCallbackHandler.java index 0d5dbe98..0c03a57b 100644 --- a/src/org/microg/gms/common/api/ResultCallbackHandler.java +++ b/src/org/microg/gms/common/api/ResultCallbackHandler.java @@ -1,3 +1,19 @@ +/* + * Copyright 2014-2015 µg 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 org.microg.gms.common.api; import android.os.Handler; diff --git a/src/org/microg/gms/location/FusedLocationProviderApiImpl.java b/src/org/microg/gms/location/FusedLocationProviderApiImpl.java index ee2bcd25..be46f446 100644 --- a/src/org/microg/gms/location/FusedLocationProviderApiImpl.java +++ b/src/org/microg/gms/location/FusedLocationProviderApiImpl.java @@ -1,3 +1,19 @@ +/* + * Copyright 2014-2015 µg 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 org.microg.gms.location; import android.app.PendingIntent; diff --git a/src/org/microg/gms/location/GeofencingApiImpl.java b/src/org/microg/gms/location/GeofencingApiImpl.java index 27cef98c..81fcfdc7 100644 --- a/src/org/microg/gms/location/GeofencingApiImpl.java +++ b/src/org/microg/gms/location/GeofencingApiImpl.java @@ -1,3 +1,19 @@ +/* + * Copyright 2014-2015 µg 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 org.microg.gms.location; import com.google.android.gms.location.GeofencingApi; diff --git a/src/org/microg/gms/location/GoogleLocationManagerClient.java b/src/org/microg/gms/location/GoogleLocationManagerClient.java index 63ed578b..cbc24b21 100644 --- a/src/org/microg/gms/location/GoogleLocationManagerClient.java +++ b/src/org/microg/gms/location/GoogleLocationManagerClient.java @@ -1,3 +1,19 @@ +/* + * Copyright 2014-2015 µg 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 org.microg.gms.location; import android.content.Context; diff --git a/src/org/microg/gms/location/LocationClientImpl.java b/src/org/microg/gms/location/LocationClientImpl.java index 57c9c60b..a79e0c62 100644 --- a/src/org/microg/gms/location/LocationClientImpl.java +++ b/src/org/microg/gms/location/LocationClientImpl.java @@ -1,3 +1,19 @@ +/* + * Copyright 2014-2015 µg 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 org.microg.gms.location; import android.app.PendingIntent; From 2f2745d6e9b3d745b69b4892bf41a37a523e0b92 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Sun, 25 Jan 2015 02:14:45 +0100 Subject: [PATCH 030/293] Fix KEY_LOCATION_CHANGED --- .../gms/location/NativeLocationClientImpl.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/org/microg/gms/location/NativeLocationClientImpl.java b/src/org/microg/gms/location/NativeLocationClientImpl.java index 1937c6c1..5129c19f 100644 --- a/src/org/microg/gms/location/NativeLocationClientImpl.java +++ b/src/org/microg/gms/location/NativeLocationClientImpl.java @@ -27,6 +27,7 @@ import android.os.Bundle; import android.os.Looper; import android.util.Log; +import com.google.android.gms.location.FusedLocationProviderApi; import com.google.android.gms.location.LocationListener; import com.google.android.gms.location.LocationRequest; @@ -70,7 +71,7 @@ public class NativeLocationClientImpl { } public Location getLastLocation() { - Log.d(TAG,"getLastLocation()"); + Log.d(TAG, "getLastLocation()"); return locationManager.getLastKnownLocation( locationManager.getBestProvider(DEFAULT_CRITERIA, true)); } @@ -80,7 +81,7 @@ public class NativeLocationClientImpl { } public void requestLocationUpdates(LocationRequest request, PendingIntent pendingIntent) { - Log.d(TAG,"requestLocationUpdates()"); + Log.d(TAG, "requestLocationUpdates()"); Intent i = new Intent(context, NativePendingIntentForwarder.class); Bundle bundle = new Bundle(); bundle.putParcelable(EXTRA_PENDING_INTENT, pendingIntent); @@ -94,7 +95,7 @@ public class NativeLocationClientImpl { public void requestLocationUpdates(LocationRequest request, LocationListener listener, Looper looper) { - Log.d(TAG,"requestLocationUpdates()"); + Log.d(TAG, "requestLocationUpdates()"); if (nativeListenerMap.containsKey(listener)) { removeLocationUpdates(listener); } @@ -105,25 +106,25 @@ public class NativeLocationClientImpl { } public void removeLocationUpdates(LocationListener listener) { - Log.d(TAG,"removeLocationUpdates()"); + Log.d(TAG, "removeLocationUpdates()"); locationManager.removeUpdates(nativeListenerMap.get(listener)); nativeListenerMap.remove(listener); } public void removeLocationUpdates(PendingIntent pendingIntent) { - Log.d(TAG,"removeLocationUpdates()"); + Log.d(TAG, "removeLocationUpdates()"); locationManager.removeUpdates(nativePendingMap.get(pendingIntent)); nativePendingMap.remove(pendingIntent); pendingCount.remove(pendingIntent); } public void setMockMode(boolean isMockMode) { - Log.d(TAG,"setMockMode()"); + Log.d(TAG, "setMockMode()"); // not yet supported } public void setMockLocation(Location mockLocation) { - Log.d(TAG,"setMockLocation()"); + Log.d(TAG, "setMockLocation()"); // not yet supported } @@ -135,6 +136,8 @@ public class NativeLocationClientImpl { PendingIntent pendingIntent = intent.getExtras().getParcelable (EXTRA_PENDING_INTENT); try { + intent.putExtra(FusedLocationProviderApi.KEY_LOCATION_CHANGED, + intent.getParcelableExtra(LocationManager.KEY_LOCATION_CHANGED)); pendingIntent.send(context, 0, intent); pendingCount.put(pendingIntent, pendingCount.get(pendingIntent) - 1); if (pendingCount.get(pendingIntent) == 0) { From ae39009ccd9db363888c292814ce91a12451c16f Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Sun, 25 Jan 2015 17:59:09 +0100 Subject: [PATCH 031/293] Add some Wearable classes, mark public apis --- .../gms/common/api/CommonStatusCodes.java | 40 ++++++++++ .../google/android/gms/common/api/Result.java | 3 + .../google/android/gms/common/api/Scope.java | 2 + .../google/android/gms/common/api/Status.java | 3 + .../gms/maps/model/BitmapDescriptor.java | 3 + .../gms/maps/model/CameraPosition.java | 3 + .../android/gms/maps/model/CircleOptions.java | 3 + .../gms/maps/model/GroundOverlayOptions.java | 3 + .../google/android/gms/maps/model/LatLng.java | 2 + .../android/gms/maps/model/LatLngBounds.java | 2 + .../android/gms/maps/model/MarkerOptions.java | 3 + .../gms/maps/model/PolygonOptions.java | 2 + .../gms/maps/model/PolylineOptions.java | 2 + .../maps/model/StreetViewPanoramaCamera.java | 3 + .../maps/model/StreetViewPanoramaLink.java | 3 + .../model/StreetViewPanoramaLocation.java | 3 + .../model/StreetViewPanoramaOrientation.java | 3 + .../google/android/gms/maps/model/Tile.java | 2 + .../gms/maps/model/TileOverlayOptions.java | 3 + .../android/gms/maps/model/VisibleRegion.java | 2 + src/com/google/android/gms/wearable/Node.java | 36 +++++++++ .../gms/wearable/WearableStatusCodes.java | 53 +++++++++++++ .../gms/wearable/internal/NodeParcelable.java | 79 +++++++++++++++++++ src/org/microg/gms/PublicApi.java | 23 ++++++ 24 files changed, 281 insertions(+) create mode 100644 src/com/google/android/gms/common/api/CommonStatusCodes.java create mode 100644 src/com/google/android/gms/wearable/Node.java create mode 100644 src/com/google/android/gms/wearable/WearableStatusCodes.java create mode 100644 src/com/google/android/gms/wearable/internal/NodeParcelable.java create mode 100644 src/org/microg/gms/PublicApi.java diff --git a/src/com/google/android/gms/common/api/CommonStatusCodes.java b/src/com/google/android/gms/common/api/CommonStatusCodes.java new file mode 100644 index 00000000..c0c1beb8 --- /dev/null +++ b/src/com/google/android/gms/common/api/CommonStatusCodes.java @@ -0,0 +1,40 @@ +/* + * Copyright 2014-2015 µg 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.common.api; + +import org.microg.gms.PublicApi; + +@PublicApi +public class CommonStatusCodes { + public static final int SUCCESS_CACHE = -1; + public static final int SUCCESS = 0; + public static final int SERVICE_MISSING = 1; + public static final int SERVICE_VERSION_UPDATE_REQUIRED = 2; + public static final int SERVICE_DISABLED = 3; + public static final int SIGN_IN_REQUIRED = 4; + public static final int INVALID_ACCOUNT = 5; + public static final int RESOLUTION_REQUIRED = 6; + public static final int NETWORK_ERROR = 7; + public static final int INTERNAL_ERROR = 8; + public static final int SERVICE_INVALID = 9; + public static final int DEVELOPER_ERROR = 10; + public static final int LICENSE_CHECK_FAILED = 11; + public static final int ERROR = 13; + public static final int INTERRUPTED = 14; + public static final int TIMEOUT = 15; + public static final int CANCELED = 16; +} diff --git a/src/com/google/android/gms/common/api/Result.java b/src/com/google/android/gms/common/api/Result.java index d8408112..e1bf524c 100644 --- a/src/com/google/android/gms/common/api/Result.java +++ b/src/com/google/android/gms/common/api/Result.java @@ -1,8 +1,11 @@ package com.google.android.gms.common.api; +import org.microg.gms.PublicApi; + /** * Represents the final result of invoking an API method in Google Play Services. */ +@PublicApi public interface Result { public Status getStatus(); } diff --git a/src/com/google/android/gms/common/api/Scope.java b/src/com/google/android/gms/common/api/Scope.java index ab9a05a1..f1ed8f9d 100644 --- a/src/com/google/android/gms/common/api/Scope.java +++ b/src/com/google/android/gms/common/api/Scope.java @@ -1,5 +1,6 @@ package com.google.android.gms.common.api; +import org.microg.gms.PublicApi; import org.microg.safeparcel.AutoSafeParcelable; import org.microg.safeparcel.SafeParceled; @@ -7,6 +8,7 @@ import org.microg.safeparcel.SafeParceled; * Describes an OAuth 2.0 scope to request. This has security implications for the user, and * requesting additional scopes will result in authorization dialogs. */ +@PublicApi public class Scope extends AutoSafeParcelable { @SafeParceled(1) private final int versionCode; diff --git a/src/com/google/android/gms/common/api/Status.java b/src/com/google/android/gms/common/api/Status.java index 903563ad..eadbefbb 100644 --- a/src/com/google/android/gms/common/api/Status.java +++ b/src/com/google/android/gms/common/api/Status.java @@ -1,6 +1,8 @@ package com.google.android.gms.common.api; import android.app.PendingIntent; + +import org.microg.gms.PublicApi; import org.microg.safeparcel.AutoSafeParcelable; /** @@ -8,6 +10,7 @@ import org.microg.safeparcel.AutoSafeParcelable; *

* TODO: Docs */ +@PublicApi public final class Status extends AutoSafeParcelable implements Result { private static final int STATUS_CODE_INTERRUPTED = 14; private static final int STATUS_CODE_CANCELED = 16; diff --git a/src/com/google/android/gms/maps/model/BitmapDescriptor.java b/src/com/google/android/gms/maps/model/BitmapDescriptor.java index 800c1745..5a8b3088 100644 --- a/src/com/google/android/gms/maps/model/BitmapDescriptor.java +++ b/src/com/google/android/gms/maps/model/BitmapDescriptor.java @@ -18,10 +18,13 @@ package com.google.android.gms.maps.model; import com.google.android.gms.dynamic.IObjectWrapper; +import org.microg.gms.PublicApi; + /** * Defines an image. For a marker, it can be used to set the image of the marker icon. For a ground * overlay, it can be used to set the image to place on the surface of the earth. */ +@PublicApi public class BitmapDescriptor { private final IObjectWrapper remoteObject; diff --git a/src/com/google/android/gms/maps/model/CameraPosition.java b/src/com/google/android/gms/maps/model/CameraPosition.java index c989ed47..cff10680 100644 --- a/src/com/google/android/gms/maps/model/CameraPosition.java +++ b/src/com/google/android/gms/maps/model/CameraPosition.java @@ -18,6 +18,8 @@ package com.google.android.gms.maps.model; import android.content.Context; import android.util.AttributeSet; + +import org.microg.gms.PublicApi; import org.microg.safeparcel.AutoSafeParcelable; import org.microg.safeparcel.SafeParceled; @@ -26,6 +28,7 @@ import java.util.Arrays; /** * An immutable class that aggregates all camera position parameters. */ +@PublicApi public final class CameraPosition extends AutoSafeParcelable { @SafeParceled(1) private final int versionCode; diff --git a/src/com/google/android/gms/maps/model/CircleOptions.java b/src/com/google/android/gms/maps/model/CircleOptions.java index 4002c6b7..eb3e2561 100644 --- a/src/com/google/android/gms/maps/model/CircleOptions.java +++ b/src/com/google/android/gms/maps/model/CircleOptions.java @@ -17,12 +17,15 @@ package com.google.android.gms.maps.model; import android.graphics.Color; + +import org.microg.gms.PublicApi; import org.microg.safeparcel.AutoSafeParcelable; import org.microg.safeparcel.SafeParceled; /** * Defines options for a Circle. */ +@PublicApi public class CircleOptions extends AutoSafeParcelable { @SafeParceled(1) private int versionCode; diff --git a/src/com/google/android/gms/maps/model/GroundOverlayOptions.java b/src/com/google/android/gms/maps/model/GroundOverlayOptions.java index 12ede558..25c024d4 100644 --- a/src/com/google/android/gms/maps/model/GroundOverlayOptions.java +++ b/src/com/google/android/gms/maps/model/GroundOverlayOptions.java @@ -18,12 +18,15 @@ package com.google.android.gms.maps.model; import android.os.IBinder; import com.google.android.gms.dynamic.ObjectWrapper; + +import org.microg.gms.PublicApi; import org.microg.safeparcel.AutoSafeParcelable; import org.microg.safeparcel.SafeParceled; /** * Defines options for a ground overlay. */ +@PublicApi public class GroundOverlayOptions extends AutoSafeParcelable { /** * Flag for when no dimension is specified for the height. diff --git a/src/com/google/android/gms/maps/model/LatLng.java b/src/com/google/android/gms/maps/model/LatLng.java index 2606b533..f1eb4b12 100644 --- a/src/com/google/android/gms/maps/model/LatLng.java +++ b/src/com/google/android/gms/maps/model/LatLng.java @@ -16,12 +16,14 @@ package com.google.android.gms.maps.model; +import org.microg.gms.PublicApi; import org.microg.safeparcel.AutoSafeParcelable; import org.microg.safeparcel.SafeParceled; /** * An immutable class representing a pair of latitude and longitude coordinates, stored as degrees. */ +@PublicApi public final class LatLng extends AutoSafeParcelable { @SafeParceled(1) private final int versionCode; diff --git a/src/com/google/android/gms/maps/model/LatLngBounds.java b/src/com/google/android/gms/maps/model/LatLngBounds.java index 5a6653f5..1ef2c39c 100644 --- a/src/com/google/android/gms/maps/model/LatLngBounds.java +++ b/src/com/google/android/gms/maps/model/LatLngBounds.java @@ -16,6 +16,7 @@ package com.google.android.gms.maps.model; +import org.microg.gms.PublicApi; import org.microg.safeparcel.AutoSafeParcelable; import org.microg.safeparcel.SafeParceled; @@ -24,6 +25,7 @@ import java.util.Arrays; /** * An immutable class representing a latitude/longitude aligned rectangle. */ +@PublicApi public final class LatLngBounds extends AutoSafeParcelable { @SafeParceled(1) private final int versionCode; diff --git a/src/com/google/android/gms/maps/model/MarkerOptions.java b/src/com/google/android/gms/maps/model/MarkerOptions.java index 4a076ac0..34ddaaf5 100644 --- a/src/com/google/android/gms/maps/model/MarkerOptions.java +++ b/src/com/google/android/gms/maps/model/MarkerOptions.java @@ -18,9 +18,12 @@ package com.google.android.gms.maps.model; import android.os.IBinder; import com.google.android.gms.dynamic.ObjectWrapper; + +import org.microg.gms.PublicApi; import org.microg.safeparcel.AutoSafeParcelable; import org.microg.safeparcel.SafeParceled; +@PublicApi public class MarkerOptions extends AutoSafeParcelable { @SafeParceled(1) diff --git a/src/com/google/android/gms/maps/model/PolygonOptions.java b/src/com/google/android/gms/maps/model/PolygonOptions.java index b74d2ea0..162ae2fa 100644 --- a/src/com/google/android/gms/maps/model/PolygonOptions.java +++ b/src/com/google/android/gms/maps/model/PolygonOptions.java @@ -16,12 +16,14 @@ package com.google.android.gms.maps.model; +import org.microg.gms.PublicApi; import org.microg.safeparcel.AutoSafeParcelable; /** * Defines options for a polygon. * TODO */ +@PublicApi public class PolygonOptions extends AutoSafeParcelable { public PolygonOptions() { } diff --git a/src/com/google/android/gms/maps/model/PolylineOptions.java b/src/com/google/android/gms/maps/model/PolylineOptions.java index 2a06e96a..6a0b809e 100644 --- a/src/com/google/android/gms/maps/model/PolylineOptions.java +++ b/src/com/google/android/gms/maps/model/PolylineOptions.java @@ -16,6 +16,7 @@ package com.google.android.gms.maps.model; +import org.microg.gms.PublicApi; import org.microg.safeparcel.AutoSafeParcelable; import org.microg.safeparcel.SafeParceled; @@ -25,6 +26,7 @@ import java.util.List; * Defines options for a polyline. * TODO */ +@PublicApi public class PolylineOptions extends AutoSafeParcelable { @SafeParceled(1) private int versionCode; diff --git a/src/com/google/android/gms/maps/model/StreetViewPanoramaCamera.java b/src/com/google/android/gms/maps/model/StreetViewPanoramaCamera.java index 534d8144..1281fcbc 100644 --- a/src/com/google/android/gms/maps/model/StreetViewPanoramaCamera.java +++ b/src/com/google/android/gms/maps/model/StreetViewPanoramaCamera.java @@ -1,4 +1,7 @@ package com.google.android.gms.maps.model; +import org.microg.gms.PublicApi; + +@PublicApi public class StreetViewPanoramaCamera { } diff --git a/src/com/google/android/gms/maps/model/StreetViewPanoramaLink.java b/src/com/google/android/gms/maps/model/StreetViewPanoramaLink.java index 66859e08..0b85a6e6 100644 --- a/src/com/google/android/gms/maps/model/StreetViewPanoramaLink.java +++ b/src/com/google/android/gms/maps/model/StreetViewPanoramaLink.java @@ -1,4 +1,7 @@ package com.google.android.gms.maps.model; +import org.microg.gms.PublicApi; + +@PublicApi public class StreetViewPanoramaLink { } diff --git a/src/com/google/android/gms/maps/model/StreetViewPanoramaLocation.java b/src/com/google/android/gms/maps/model/StreetViewPanoramaLocation.java index 8ef5fda7..cfd3a29d 100644 --- a/src/com/google/android/gms/maps/model/StreetViewPanoramaLocation.java +++ b/src/com/google/android/gms/maps/model/StreetViewPanoramaLocation.java @@ -1,4 +1,7 @@ package com.google.android.gms.maps.model; +import org.microg.gms.PublicApi; + +@PublicApi public class StreetViewPanoramaLocation { } diff --git a/src/com/google/android/gms/maps/model/StreetViewPanoramaOrientation.java b/src/com/google/android/gms/maps/model/StreetViewPanoramaOrientation.java index 285c0617..32eec064 100644 --- a/src/com/google/android/gms/maps/model/StreetViewPanoramaOrientation.java +++ b/src/com/google/android/gms/maps/model/StreetViewPanoramaOrientation.java @@ -1,4 +1,7 @@ package com.google.android.gms.maps.model; +import org.microg.gms.PublicApi; + +@PublicApi public class StreetViewPanoramaOrientation { } diff --git a/src/com/google/android/gms/maps/model/Tile.java b/src/com/google/android/gms/maps/model/Tile.java index a3062e5f..3e5031c5 100644 --- a/src/com/google/android/gms/maps/model/Tile.java +++ b/src/com/google/android/gms/maps/model/Tile.java @@ -1,5 +1,6 @@ package com.google.android.gms.maps.model; +import org.microg.gms.PublicApi; import org.microg.safeparcel.AutoSafeParcelable; import org.microg.safeparcel.SafeParceled; @@ -7,6 +8,7 @@ import org.microg.safeparcel.SafeParceled; * Contains information about a Tile that is returned by a {@link TileProvider}. * TODO SafeParceled */ +@PublicApi public class Tile extends AutoSafeParcelable { @SafeParceled(1) private final int versionCode; diff --git a/src/com/google/android/gms/maps/model/TileOverlayOptions.java b/src/com/google/android/gms/maps/model/TileOverlayOptions.java index 15523837..55825613 100644 --- a/src/com/google/android/gms/maps/model/TileOverlayOptions.java +++ b/src/com/google/android/gms/maps/model/TileOverlayOptions.java @@ -19,12 +19,15 @@ package com.google.android.gms.maps.model; import android.os.IBinder; import android.os.RemoteException; import com.google.android.gms.maps.model.internal.ITileProviderDelegate; + +import org.microg.gms.PublicApi; import org.microg.safeparcel.AutoSafeParcelable; import org.microg.safeparcel.SafeParceled; /** * Defines options for a TileOverlay. */ +@PublicApi public class TileOverlayOptions extends AutoSafeParcelable { @SafeParceled(1) diff --git a/src/com/google/android/gms/maps/model/VisibleRegion.java b/src/com/google/android/gms/maps/model/VisibleRegion.java index 43f161db..601f1509 100644 --- a/src/com/google/android/gms/maps/model/VisibleRegion.java +++ b/src/com/google/android/gms/maps/model/VisibleRegion.java @@ -16,9 +16,11 @@ package com.google.android.gms.maps.model; +import org.microg.gms.PublicApi; import org.microg.safeparcel.AutoSafeParcelable; import org.microg.safeparcel.SafeParceled; +@PublicApi public class VisibleRegion extends AutoSafeParcelable { @SafeParceled(1) private int versionCode; diff --git a/src/com/google/android/gms/wearable/Node.java b/src/com/google/android/gms/wearable/Node.java new file mode 100644 index 00000000..9c7d5796 --- /dev/null +++ b/src/com/google/android/gms/wearable/Node.java @@ -0,0 +1,36 @@ +/* + * Copyright 2014-2015 µg 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; + +import org.microg.gms.PublicApi; + +/** + * Information about a particular node in the Android Wear network. + */ +@PublicApi +public interface Node { + /** + * Returns a human readable description of the node. Sometimes generated from the Bluetooth + * device name + */ + public abstract String getDisplayName(); + + /** + * Returns an opaque string that represents a node in the Android Wear network. + */ + public abstract String getId(); +} diff --git a/src/com/google/android/gms/wearable/WearableStatusCodes.java b/src/com/google/android/gms/wearable/WearableStatusCodes.java new file mode 100644 index 00000000..46e4dbdd --- /dev/null +++ b/src/com/google/android/gms/wearable/WearableStatusCodes.java @@ -0,0 +1,53 @@ +/* + * Copyright 2014-2015 µg 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; + +import com.google.android.gms.common.api.CommonStatusCodes; + +import org.microg.gms.PublicApi; + +/** + * Error codes for wearable API failures. These values may be returned by APIs to indicate the + * success or failure of a request. + */ +@PublicApi +public class WearableStatusCodes extends CommonStatusCodes { + /** + * Indicates that the targeted node is not accessible in the wearable network. + */ + public static final int TARGET_NODE_NOT_CONNECTED = 4000; + /** + * Indicates that the specified listener is already registered. + */ + public static final int DUPLICATE_LISTENER = 4001; + /** + * Indicates that the specified listener is not recognized. + */ + public static final int UNKNOWN_LISTENER = 4002; + /** + * Indicates that the data item was too large to set. + */ + public static final int DATA_ITEM_TOO_LARGE = 4003; + /** + * Indicates that the targeted node is not a valid node in the wearable network. + */ + public static final int INVALID_TARGET_NODE = 4004; + /** + * Indicates that the requested asset is unavailable. + */ + public static final int ASSET_UNAVAILABLE = 4005; +} diff --git a/src/com/google/android/gms/wearable/internal/NodeParcelable.java b/src/com/google/android/gms/wearable/internal/NodeParcelable.java new file mode 100644 index 00000000..9c96a109 --- /dev/null +++ b/src/com/google/android/gms/wearable/internal/NodeParcelable.java @@ -0,0 +1,79 @@ +/* + * Copyright 2014-2015 µg 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.internal; + +import com.google.android.gms.wearable.Node; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +/** + * Parcelable implementation of the {@link com.google.android.gms.wearable.Node} interface. + */ +public class NodeParcelable extends AutoSafeParcelable implements Node { + @SafeParceled(1) + private final int versionCode; + @SafeParceled(2) + private final String id; + @SafeParceled(3) + private final String displayName; + + private NodeParcelable() { + versionCode = 1; + id = displayName = null; + } + + public NodeParcelable(String id, String displayName) { + versionCode = 1; + this.id = id; + this.displayName = displayName; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + NodeParcelable that = (NodeParcelable) o; + + if (!id.equals(that.id)) return false; + if (!displayName.equals(that.displayName)) return false; + + return true; + } + + @Override + public String getDisplayName() { + return displayName; + } + + @Override + public String getId() { + return id; + } + + @Override + public int hashCode() { + int result = 37 * 17 + id.hashCode(); + return 37 * result + displayName.hashCode(); + } + + @Override + public String toString() { + return "NodeParcelable{" + id + "," + displayName + "}"; + } +} diff --git a/src/org/microg/gms/PublicApi.java b/src/org/microg/gms/PublicApi.java new file mode 100644 index 00000000..00092bac --- /dev/null +++ b/src/org/microg/gms/PublicApi.java @@ -0,0 +1,23 @@ +/* + * Copyright 2014-2015 µg 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 org.microg.gms; + +public @interface PublicApi { + String since() default "-1"; + + String until() default "-1"; +} From 61d5ccde6ccad258245d06167317dc5c8f145c07 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Sun, 25 Jan 2015 18:03:54 +0100 Subject: [PATCH 032/293] Further describe the public api interface --- src/org/microg/gms/PublicApi.java | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/org/microg/gms/PublicApi.java b/src/org/microg/gms/PublicApi.java index 00092bac..1766f220 100644 --- a/src/org/microg/gms/PublicApi.java +++ b/src/org/microg/gms/PublicApi.java @@ -16,8 +16,24 @@ package org.microg.gms; +/** + * An class, method or field is named public, if it can be used with the original play services + * client library. + */ public @interface PublicApi { - String since() default "-1"; + /** + * @return the first version that contains the given class, method or field + */ + String since() default "0"; - String until() default "-1"; + /** + * @return the last version that contains the given class, method or field + */ + String until() default "latest"; + + /** + * @return used on a method or field to exclude it from the public api if the corresponding + * class was marked as public api + */ + boolean exclude() default false; } From 3c19d84eaa9842a2526166a38ad445125dbd2300 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Mon, 26 Jan 2015 00:42:56 +0100 Subject: [PATCH 033/293] Fix NodeParcelable, meta-annotate @PublicApi --- .../android/gms/wearable/internal/NodeParcelable.java | 2 ++ src/org/microg/gms/PublicApi.java | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/src/com/google/android/gms/wearable/internal/NodeParcelable.java b/src/com/google/android/gms/wearable/internal/NodeParcelable.java index 9c96a109..d673c1bb 100644 --- a/src/com/google/android/gms/wearable/internal/NodeParcelable.java +++ b/src/com/google/android/gms/wearable/internal/NodeParcelable.java @@ -76,4 +76,6 @@ public class NodeParcelable extends AutoSafeParcelable implements Node { public String toString() { return "NodeParcelable{" + id + "," + displayName + "}"; } + + public static final Creator CREATOR = new AutoCreator<>(NodeParcelable.class); } diff --git a/src/org/microg/gms/PublicApi.java b/src/org/microg/gms/PublicApi.java index 1766f220..488f6c3a 100644 --- a/src/org/microg/gms/PublicApi.java +++ b/src/org/microg/gms/PublicApi.java @@ -16,10 +16,17 @@ package org.microg.gms; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + /** * An class, method or field is named public, if it can be used with the original play services * client library. */ +@Retention(RetentionPolicy.SOURCE) +@Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD, ElementType.CONSTRUCTOR}) public @interface PublicApi { /** * @return the first version that contains the given class, method or field From ad1d47e1cf3f45752b5ae3bf7691bfa187d4ab8d Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Mon, 26 Jan 2015 00:43:41 +0100 Subject: [PATCH 034/293] Start adding support for wearable API --- GmsApi | 2 +- .../gms/common/GooglePlayServicesUtil.java | 2 + .../google/android/gms/common/api/Api.java | 9 ++++ .../gms/common/api/GoogleApiClient.java | 5 ++ .../android/gms/location/LocationClient.java | 4 ++ .../gms/location/LocationServices.java | 21 ++------- .../google/android/gms/wearable/DataApi.java | 20 ++++++++ .../android/gms/wearable/MessageApi.java | 20 ++++++++ .../google/android/gms/wearable/NodeApi.java | 20 ++++++++ .../google/android/gms/wearable/Wearable.java | 47 +++++++++++++++++++ .../location/LocationServicesApiBuilder.java | 37 +++++++++++++++ src/org/microg/gms/wearable/DataApiImpl.java | 22 +++++++++ .../microg/gms/wearable/MessageApiImpl.java | 22 +++++++++ src/org/microg/gms/wearable/NodeApiImpl.java | 22 +++++++++ .../gms/wearable/WearableApiBuilder.java | 40 ++++++++++++++++ 15 files changed, 274 insertions(+), 19 deletions(-) create mode 100644 src/com/google/android/gms/wearable/DataApi.java create mode 100644 src/com/google/android/gms/wearable/MessageApi.java create mode 100644 src/com/google/android/gms/wearable/NodeApi.java create mode 100644 src/com/google/android/gms/wearable/Wearable.java create mode 100644 src/org/microg/gms/location/LocationServicesApiBuilder.java create mode 100644 src/org/microg/gms/wearable/DataApiImpl.java create mode 100644 src/org/microg/gms/wearable/MessageApiImpl.java create mode 100644 src/org/microg/gms/wearable/NodeApiImpl.java create mode 100644 src/org/microg/gms/wearable/WearableApiBuilder.java diff --git a/GmsApi b/GmsApi index c4db81d1..3c19d84e 160000 --- a/GmsApi +++ b/GmsApi @@ -1 +1 @@ -Subproject commit c4db81d1fcf5c301f34e12d5675b9b50c507bd42 +Subproject commit 3c19d84eaa9842a2526166a38ad445125dbd2300 diff --git a/src/com/google/android/gms/common/GooglePlayServicesUtil.java b/src/com/google/android/gms/common/GooglePlayServicesUtil.java index f1dc70c6..6da29c4f 100644 --- a/src/com/google/android/gms/common/GooglePlayServicesUtil.java +++ b/src/com/google/android/gms/common/GooglePlayServicesUtil.java @@ -10,6 +10,7 @@ import android.content.pm.PackageManager; import android.util.Log; import org.microg.gms.Constants; +import org.microg.gms.PublicApi; /** * Utility class for verifying that the Google Play services APK is available and up-to-date on @@ -19,6 +20,7 @@ import org.microg.gms.Constants; * TODO: methods :) */ public class GooglePlayServicesUtil { + @PublicApi(exclude = true) private static final String TAG = "GooglePlayServicesUtil"; public static final String GMS_ERROR_DIALOG = "GooglePlayServicesErrorDialog"; diff --git a/src/com/google/android/gms/common/api/Api.java b/src/com/google/android/gms/common/api/Api.java index ffbeeddc..3e5482a9 100644 --- a/src/com/google/android/gms/common/api/Api.java +++ b/src/com/google/android/gms/common/api/Api.java @@ -1,5 +1,6 @@ package com.google.android.gms.common.api; +import org.microg.gms.PublicApi; import org.microg.gms.common.api.ApiBuilder; /** @@ -14,14 +15,17 @@ import org.microg.gms.common.api.ApiBuilder; *

* See {@link GoogleApiClient.Builder} for usage examples. */ +@PublicApi public final class Api { private final ApiBuilder builder; + @PublicApi(exclude = true) public Api(ApiBuilder builder) { this.builder = builder; } + @PublicApi(exclude = true) public ApiBuilder getBuilder() { return builder; } @@ -30,28 +34,33 @@ public final class Api { * Base interface for API options. These are used to configure specific parameters for * individual API surfaces. The default implementation has no parameters. */ + @PublicApi public interface ApiOptions { /** * Base interface for {@link ApiOptions} in {@link Api}s that have options. */ + @PublicApi public interface HasOptions extends ApiOptions { } /** * Base interface for {@link ApiOptions} that are not required, don't exist. */ + @PublicApi public interface NotRequiredOptions extends ApiOptions { } /** * {@link ApiOptions} implementation for {@link Api}s that do not take any options. */ + @PublicApi public final class NoOptions implements NotRequiredOptions { } /** * Base interface for {@link ApiOptions} that are optional. */ + @PublicApi public interface Optional extends HasOptions, NotRequiredOptions { } } diff --git a/src/com/google/android/gms/common/api/GoogleApiClient.java b/src/com/google/android/gms/common/api/GoogleApiClient.java index 92a2ee64..672a1a7e 100644 --- a/src/com/google/android/gms/common/api/GoogleApiClient.java +++ b/src/com/google/android/gms/common/api/GoogleApiClient.java @@ -11,6 +11,7 @@ import android.view.View; import com.google.android.gms.common.ConnectionResult; import org.microg.gms.Constants; +import org.microg.gms.PublicApi; import org.microg.gms.common.api.GoogleApiClientImpl; import java.util.HashMap; @@ -37,6 +38,7 @@ import java.util.concurrent.TimeUnit; * method and then call {@link #connect()} in {@link Activity#onStart()} and {@link #disconnect()} * in {@link Activity#onStop()}, regardless of the state. */ +@PublicApi public interface GoogleApiClient { /** * Connects the client to Google Play services. Blocks until the connection either succeeds or @@ -217,6 +219,7 @@ public interface GoogleApiClient { /** * Builder to configure a {@link GoogleApiClient}. */ + @PublicApi public class Builder { private final Context context; private final Map apis = new HashMap<>(); @@ -412,6 +415,7 @@ public interface GoogleApiClient { * Provides callbacks that are called when the client is connected or disconnected from the * service. Most applications implement {@link #onConnected(Bundle)} to start making requests. */ + @PublicApi public interface ConnectionCallbacks { /** * A suspension cause informing that the service has been killed. @@ -456,6 +460,7 @@ public interface GoogleApiClient { * the service. See {@link ConnectionResult} for a list of error codes and suggestions for * resolution. */ + @PublicApi public interface OnConnectionFailedListener { /** * Called when there was an error connecting the client to the service. diff --git a/src/com/google/android/gms/location/LocationClient.java b/src/com/google/android/gms/location/LocationClient.java index 130c9ed9..06b766d1 100644 --- a/src/com/google/android/gms/location/LocationClient.java +++ b/src/com/google/android/gms/location/LocationClient.java @@ -12,6 +12,10 @@ import org.microg.gms.common.ForwardConnectionCallbacks; import org.microg.gms.common.ForwardConnectionFailedListener; import org.microg.gms.common.api.AbstractPlayServicesClient; +/** + * This class is deprecated as of play services 6.5, do not use it in production systems, + * it's just a forwarder for the {@link FusedLocationProviderApi}. + */ @Deprecated public class LocationClient extends AbstractPlayServicesClient { public static final String KEY_LOCATION_CHANGED = "com.google.android.location.LOCATION"; diff --git a/src/com/google/android/gms/location/LocationServices.java b/src/com/google/android/gms/location/LocationServices.java index c0949f43..5dddd2b4 100644 --- a/src/com/google/android/gms/location/LocationServices.java +++ b/src/com/google/android/gms/location/LocationServices.java @@ -1,32 +1,17 @@ package com.google.android.gms.location; -import android.content.Context; -import android.os.Looper; - -import com.google.android.gms.common.api.AccountInfo; import com.google.android.gms.common.api.Api; -import com.google.android.gms.common.api.GoogleApiClient; -import org.microg.gms.common.api.ApiBuilder; -import org.microg.gms.common.api.ApiConnection; import org.microg.gms.location.FusedLocationProviderApiImpl; import org.microg.gms.location.GeofencingApiImpl; -import org.microg.gms.location.LocationClientImpl; +import org.microg.gms.location.LocationServicesApiBuilder; /** * The main entry point for location services integration. */ public class LocationServices { - public static final Api API = new Api<>( - new ApiBuilder() { - @Override - public ApiConnection build(Context context, Looper looper, - Api.ApiOptions.NoOptions options, - AccountInfo accountInfo, GoogleApiClient.ConnectionCallbacks callbacks, - GoogleApiClient.OnConnectionFailedListener connectionFailedListener) { - return new LocationClientImpl(context, callbacks, connectionFailedListener); - } - }); + public static final Api API = new Api<>(new + LocationServicesApiBuilder()); public static final FusedLocationProviderApi FusedLocationApi = new FusedLocationProviderApiImpl(); public static final GeofencingApi GeofencingApi = new GeofencingApiImpl(); diff --git a/src/com/google/android/gms/wearable/DataApi.java b/src/com/google/android/gms/wearable/DataApi.java new file mode 100644 index 00000000..c26bdf22 --- /dev/null +++ b/src/com/google/android/gms/wearable/DataApi.java @@ -0,0 +1,20 @@ +/* + * Copyright 2014-2015 µg 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; + +public interface DataApi { +} diff --git a/src/com/google/android/gms/wearable/MessageApi.java b/src/com/google/android/gms/wearable/MessageApi.java new file mode 100644 index 00000000..730ebe4a --- /dev/null +++ b/src/com/google/android/gms/wearable/MessageApi.java @@ -0,0 +1,20 @@ +/* + * Copyright 2014-2015 µg 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; + +public interface MessageApi { +} diff --git a/src/com/google/android/gms/wearable/NodeApi.java b/src/com/google/android/gms/wearable/NodeApi.java new file mode 100644 index 00000000..4aa57284 --- /dev/null +++ b/src/com/google/android/gms/wearable/NodeApi.java @@ -0,0 +1,20 @@ +/* + * Copyright 2014-2015 µg 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; + +public interface NodeApi { +} diff --git a/src/com/google/android/gms/wearable/Wearable.java b/src/com/google/android/gms/wearable/Wearable.java new file mode 100644 index 00000000..72003234 --- /dev/null +++ b/src/com/google/android/gms/wearable/Wearable.java @@ -0,0 +1,47 @@ +/* + * Copyright 2014-2015 µg 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; + +import com.google.android.gms.common.api.Api; +import com.google.android.gms.common.api.GoogleApiClient; + +import org.microg.gms.wearable.DataApiImpl; +import org.microg.gms.wearable.MessageApiImpl; +import org.microg.gms.wearable.NodeApiImpl; +import org.microg.gms.wearable.WearableApiBuilder; + +/** + * An API for the Android Wear platform. + */ +public class Wearable { + /** + * Token to pass to {@link GoogleApiClient.Builder#addApi(Api)} to enable the Wearable features. + */ + public static final Api API = new Api<>(new WearableApiBuilder()); + + public static final DataApi DataApi = new DataApiImpl(); + public static final MessageApi MessageApi = new MessageApiImpl(); + public static final NodeApi NodeApi = new NodeApiImpl(); + + public static class WearableOptions implements Api.ApiOptions.Optional { + public static class Builder { + public WearableOptions build() { + return new WearableOptions(); + } + } + } +} diff --git a/src/org/microg/gms/location/LocationServicesApiBuilder.java b/src/org/microg/gms/location/LocationServicesApiBuilder.java new file mode 100644 index 00000000..6876e630 --- /dev/null +++ b/src/org/microg/gms/location/LocationServicesApiBuilder.java @@ -0,0 +1,37 @@ +/* + * Copyright 2014-2015 µg 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 org.microg.gms.location; + +import android.content.Context; +import android.os.Looper; + +import com.google.android.gms.common.api.AccountInfo; +import com.google.android.gms.common.api.Api; +import com.google.android.gms.common.api.GoogleApiClient; + +import org.microg.gms.common.api.ApiBuilder; +import org.microg.gms.common.api.ApiConnection; + +public class LocationServicesApiBuilder implements ApiBuilder { + @Override + public ApiConnection build(Context context, Looper looper, + Api.ApiOptions.NoOptions options, + AccountInfo accountInfo, GoogleApiClient.ConnectionCallbacks callbacks, + GoogleApiClient.OnConnectionFailedListener connectionFailedListener) { + return new LocationClientImpl(context, callbacks, connectionFailedListener); + } +} diff --git a/src/org/microg/gms/wearable/DataApiImpl.java b/src/org/microg/gms/wearable/DataApiImpl.java new file mode 100644 index 00000000..5d8f07ec --- /dev/null +++ b/src/org/microg/gms/wearable/DataApiImpl.java @@ -0,0 +1,22 @@ +/* + * Copyright 2014-2015 µg 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 org.microg.gms.wearable; + +import com.google.android.gms.wearable.DataApi; + +public class DataApiImpl implements DataApi { +} diff --git a/src/org/microg/gms/wearable/MessageApiImpl.java b/src/org/microg/gms/wearable/MessageApiImpl.java new file mode 100644 index 00000000..6f055d5e --- /dev/null +++ b/src/org/microg/gms/wearable/MessageApiImpl.java @@ -0,0 +1,22 @@ +/* + * Copyright 2014-2015 µg 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 org.microg.gms.wearable; + +import com.google.android.gms.wearable.MessageApi; + +public class MessageApiImpl implements MessageApi { +} diff --git a/src/org/microg/gms/wearable/NodeApiImpl.java b/src/org/microg/gms/wearable/NodeApiImpl.java new file mode 100644 index 00000000..bf8bf5ed --- /dev/null +++ b/src/org/microg/gms/wearable/NodeApiImpl.java @@ -0,0 +1,22 @@ +/* + * Copyright 2014-2015 µg 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 org.microg.gms.wearable; + +import com.google.android.gms.wearable.NodeApi; + +public class NodeApiImpl implements NodeApi { +} diff --git a/src/org/microg/gms/wearable/WearableApiBuilder.java b/src/org/microg/gms/wearable/WearableApiBuilder.java new file mode 100644 index 00000000..c19f5da4 --- /dev/null +++ b/src/org/microg/gms/wearable/WearableApiBuilder.java @@ -0,0 +1,40 @@ +/* + * Copyright 2014-2015 µg 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 org.microg.gms.wearable; + +import android.content.Context; +import android.os.Looper; +import android.util.Log; + +import com.google.android.gms.common.api.AccountInfo; +import com.google.android.gms.common.api.GoogleApiClient; +import com.google.android.gms.wearable.Wearable; + +import org.microg.gms.common.api.ApiBuilder; +import org.microg.gms.common.api.ApiConnection; + +public class WearableApiBuilder implements ApiBuilder { + private static final String TAG = "GmsWearableApi"; + + @Override + public ApiConnection build(Context context, Looper looper, Wearable.WearableOptions options, + AccountInfo accountInfo, GoogleApiClient.ConnectionCallbacks callbacks, + GoogleApiClient.OnConnectionFailedListener connectionFailedListener) { + Log.d(TAG, "Wearables not supported"); + return null; + } +} From 5d2364f3dcc66bdd1ae19c91d76d77d2a4a785b6 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Mon, 2 Feb 2015 00:02:32 +0100 Subject: [PATCH 035/293] Update --- AndroidManifest.xml | 6 ++++-- .../google/android/gms/common/api/CommonStatusCodes.java | 2 +- src/com/google/android/gms/common/api/Result.java | 2 +- src/com/google/android/gms/common/api/Scope.java | 2 +- src/com/google/android/gms/common/api/Status.java | 2 +- src/com/google/android/gms/maps/model/BitmapDescriptor.java | 2 +- src/com/google/android/gms/maps/model/CameraPosition.java | 2 +- src/com/google/android/gms/maps/model/CircleOptions.java | 2 +- .../google/android/gms/maps/model/GroundOverlayOptions.java | 2 +- src/com/google/android/gms/maps/model/LatLng.java | 2 +- src/com/google/android/gms/maps/model/LatLngBounds.java | 2 +- src/com/google/android/gms/maps/model/MarkerOptions.java | 2 +- src/com/google/android/gms/maps/model/PolygonOptions.java | 2 +- src/com/google/android/gms/maps/model/PolylineOptions.java | 2 +- .../android/gms/maps/model/StreetViewPanoramaCamera.java | 2 +- .../android/gms/maps/model/StreetViewPanoramaLink.java | 2 +- .../android/gms/maps/model/StreetViewPanoramaLocation.java | 2 +- .../gms/maps/model/StreetViewPanoramaOrientation.java | 2 +- src/com/google/android/gms/maps/model/Tile.java | 2 +- .../google/android/gms/maps/model/TileOverlayOptions.java | 2 +- src/com/google/android/gms/maps/model/VisibleRegion.java | 2 +- src/com/google/android/gms/wearable/Node.java | 2 +- .../google/android/gms/wearable/WearableStatusCodes.java | 2 +- src/org/microg/gms/{ => common}/Constants.java | 2 +- src/org/microg/gms/{ => common}/PublicApi.java | 2 +- 25 files changed, 28 insertions(+), 26 deletions(-) rename src/org/microg/gms/{ => common}/Constants.java (97%) rename src/org/microg/gms/{ => common}/PublicApi.java (97%) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 1b9d6274..39f687cb 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -1,4 +1,6 @@ - - + + + diff --git a/src/com/google/android/gms/common/api/CommonStatusCodes.java b/src/com/google/android/gms/common/api/CommonStatusCodes.java index c0c1beb8..402d501e 100644 --- a/src/com/google/android/gms/common/api/CommonStatusCodes.java +++ b/src/com/google/android/gms/common/api/CommonStatusCodes.java @@ -16,7 +16,7 @@ package com.google.android.gms.common.api; -import org.microg.gms.PublicApi; +import org.microg.gms.common.PublicApi; @PublicApi public class CommonStatusCodes { diff --git a/src/com/google/android/gms/common/api/Result.java b/src/com/google/android/gms/common/api/Result.java index e1bf524c..394234d0 100644 --- a/src/com/google/android/gms/common/api/Result.java +++ b/src/com/google/android/gms/common/api/Result.java @@ -1,6 +1,6 @@ package com.google.android.gms.common.api; -import org.microg.gms.PublicApi; +import org.microg.gms.common.PublicApi; /** * Represents the final result of invoking an API method in Google Play Services. diff --git a/src/com/google/android/gms/common/api/Scope.java b/src/com/google/android/gms/common/api/Scope.java index f1ed8f9d..47c05291 100644 --- a/src/com/google/android/gms/common/api/Scope.java +++ b/src/com/google/android/gms/common/api/Scope.java @@ -1,6 +1,6 @@ package com.google.android.gms.common.api; -import org.microg.gms.PublicApi; +import org.microg.gms.common.PublicApi; import org.microg.safeparcel.AutoSafeParcelable; import org.microg.safeparcel.SafeParceled; diff --git a/src/com/google/android/gms/common/api/Status.java b/src/com/google/android/gms/common/api/Status.java index eadbefbb..52e2cf7f 100644 --- a/src/com/google/android/gms/common/api/Status.java +++ b/src/com/google/android/gms/common/api/Status.java @@ -2,7 +2,7 @@ package com.google.android.gms.common.api; import android.app.PendingIntent; -import org.microg.gms.PublicApi; +import org.microg.gms.common.PublicApi; import org.microg.safeparcel.AutoSafeParcelable; /** diff --git a/src/com/google/android/gms/maps/model/BitmapDescriptor.java b/src/com/google/android/gms/maps/model/BitmapDescriptor.java index 5a8b3088..9b45597b 100644 --- a/src/com/google/android/gms/maps/model/BitmapDescriptor.java +++ b/src/com/google/android/gms/maps/model/BitmapDescriptor.java @@ -18,7 +18,7 @@ package com.google.android.gms.maps.model; import com.google.android.gms.dynamic.IObjectWrapper; -import org.microg.gms.PublicApi; +import org.microg.gms.common.PublicApi; /** * Defines an image. For a marker, it can be used to set the image of the marker icon. For a ground diff --git a/src/com/google/android/gms/maps/model/CameraPosition.java b/src/com/google/android/gms/maps/model/CameraPosition.java index cff10680..86c2b255 100644 --- a/src/com/google/android/gms/maps/model/CameraPosition.java +++ b/src/com/google/android/gms/maps/model/CameraPosition.java @@ -19,7 +19,7 @@ package com.google.android.gms.maps.model; import android.content.Context; import android.util.AttributeSet; -import org.microg.gms.PublicApi; +import org.microg.gms.common.PublicApi; import org.microg.safeparcel.AutoSafeParcelable; import org.microg.safeparcel.SafeParceled; diff --git a/src/com/google/android/gms/maps/model/CircleOptions.java b/src/com/google/android/gms/maps/model/CircleOptions.java index eb3e2561..0629d6fa 100644 --- a/src/com/google/android/gms/maps/model/CircleOptions.java +++ b/src/com/google/android/gms/maps/model/CircleOptions.java @@ -18,7 +18,7 @@ package com.google.android.gms.maps.model; import android.graphics.Color; -import org.microg.gms.PublicApi; +import org.microg.gms.common.PublicApi; import org.microg.safeparcel.AutoSafeParcelable; import org.microg.safeparcel.SafeParceled; diff --git a/src/com/google/android/gms/maps/model/GroundOverlayOptions.java b/src/com/google/android/gms/maps/model/GroundOverlayOptions.java index 25c024d4..191afda1 100644 --- a/src/com/google/android/gms/maps/model/GroundOverlayOptions.java +++ b/src/com/google/android/gms/maps/model/GroundOverlayOptions.java @@ -19,7 +19,7 @@ package com.google.android.gms.maps.model; import android.os.IBinder; import com.google.android.gms.dynamic.ObjectWrapper; -import org.microg.gms.PublicApi; +import org.microg.gms.common.PublicApi; import org.microg.safeparcel.AutoSafeParcelable; import org.microg.safeparcel.SafeParceled; diff --git a/src/com/google/android/gms/maps/model/LatLng.java b/src/com/google/android/gms/maps/model/LatLng.java index f1eb4b12..356e04d6 100644 --- a/src/com/google/android/gms/maps/model/LatLng.java +++ b/src/com/google/android/gms/maps/model/LatLng.java @@ -16,7 +16,7 @@ package com.google.android.gms.maps.model; -import org.microg.gms.PublicApi; +import org.microg.gms.common.PublicApi; import org.microg.safeparcel.AutoSafeParcelable; import org.microg.safeparcel.SafeParceled; diff --git a/src/com/google/android/gms/maps/model/LatLngBounds.java b/src/com/google/android/gms/maps/model/LatLngBounds.java index 1ef2c39c..eae9cb2d 100644 --- a/src/com/google/android/gms/maps/model/LatLngBounds.java +++ b/src/com/google/android/gms/maps/model/LatLngBounds.java @@ -16,7 +16,7 @@ package com.google.android.gms.maps.model; -import org.microg.gms.PublicApi; +import org.microg.gms.common.PublicApi; import org.microg.safeparcel.AutoSafeParcelable; import org.microg.safeparcel.SafeParceled; diff --git a/src/com/google/android/gms/maps/model/MarkerOptions.java b/src/com/google/android/gms/maps/model/MarkerOptions.java index 34ddaaf5..bb289362 100644 --- a/src/com/google/android/gms/maps/model/MarkerOptions.java +++ b/src/com/google/android/gms/maps/model/MarkerOptions.java @@ -19,7 +19,7 @@ package com.google.android.gms.maps.model; import android.os.IBinder; import com.google.android.gms.dynamic.ObjectWrapper; -import org.microg.gms.PublicApi; +import org.microg.gms.common.PublicApi; import org.microg.safeparcel.AutoSafeParcelable; import org.microg.safeparcel.SafeParceled; diff --git a/src/com/google/android/gms/maps/model/PolygonOptions.java b/src/com/google/android/gms/maps/model/PolygonOptions.java index 162ae2fa..0b5aaa59 100644 --- a/src/com/google/android/gms/maps/model/PolygonOptions.java +++ b/src/com/google/android/gms/maps/model/PolygonOptions.java @@ -16,7 +16,7 @@ package com.google.android.gms.maps.model; -import org.microg.gms.PublicApi; +import org.microg.gms.common.PublicApi; import org.microg.safeparcel.AutoSafeParcelable; /** diff --git a/src/com/google/android/gms/maps/model/PolylineOptions.java b/src/com/google/android/gms/maps/model/PolylineOptions.java index 6a0b809e..ce34b343 100644 --- a/src/com/google/android/gms/maps/model/PolylineOptions.java +++ b/src/com/google/android/gms/maps/model/PolylineOptions.java @@ -16,7 +16,7 @@ package com.google.android.gms.maps.model; -import org.microg.gms.PublicApi; +import org.microg.gms.common.PublicApi; import org.microg.safeparcel.AutoSafeParcelable; import org.microg.safeparcel.SafeParceled; diff --git a/src/com/google/android/gms/maps/model/StreetViewPanoramaCamera.java b/src/com/google/android/gms/maps/model/StreetViewPanoramaCamera.java index 1281fcbc..585fc072 100644 --- a/src/com/google/android/gms/maps/model/StreetViewPanoramaCamera.java +++ b/src/com/google/android/gms/maps/model/StreetViewPanoramaCamera.java @@ -1,6 +1,6 @@ package com.google.android.gms.maps.model; -import org.microg.gms.PublicApi; +import org.microg.gms.common.PublicApi; @PublicApi public class StreetViewPanoramaCamera { diff --git a/src/com/google/android/gms/maps/model/StreetViewPanoramaLink.java b/src/com/google/android/gms/maps/model/StreetViewPanoramaLink.java index 0b85a6e6..88cf0542 100644 --- a/src/com/google/android/gms/maps/model/StreetViewPanoramaLink.java +++ b/src/com/google/android/gms/maps/model/StreetViewPanoramaLink.java @@ -1,6 +1,6 @@ package com.google.android.gms.maps.model; -import org.microg.gms.PublicApi; +import org.microg.gms.common.PublicApi; @PublicApi public class StreetViewPanoramaLink { diff --git a/src/com/google/android/gms/maps/model/StreetViewPanoramaLocation.java b/src/com/google/android/gms/maps/model/StreetViewPanoramaLocation.java index cfd3a29d..75422e12 100644 --- a/src/com/google/android/gms/maps/model/StreetViewPanoramaLocation.java +++ b/src/com/google/android/gms/maps/model/StreetViewPanoramaLocation.java @@ -1,6 +1,6 @@ package com.google.android.gms.maps.model; -import org.microg.gms.PublicApi; +import org.microg.gms.common.PublicApi; @PublicApi public class StreetViewPanoramaLocation { diff --git a/src/com/google/android/gms/maps/model/StreetViewPanoramaOrientation.java b/src/com/google/android/gms/maps/model/StreetViewPanoramaOrientation.java index 32eec064..9b77f9b4 100644 --- a/src/com/google/android/gms/maps/model/StreetViewPanoramaOrientation.java +++ b/src/com/google/android/gms/maps/model/StreetViewPanoramaOrientation.java @@ -1,6 +1,6 @@ package com.google.android.gms.maps.model; -import org.microg.gms.PublicApi; +import org.microg.gms.common.PublicApi; @PublicApi public class StreetViewPanoramaOrientation { diff --git a/src/com/google/android/gms/maps/model/Tile.java b/src/com/google/android/gms/maps/model/Tile.java index 3e5031c5..cf6f437a 100644 --- a/src/com/google/android/gms/maps/model/Tile.java +++ b/src/com/google/android/gms/maps/model/Tile.java @@ -1,6 +1,6 @@ package com.google.android.gms.maps.model; -import org.microg.gms.PublicApi; +import org.microg.gms.common.PublicApi; import org.microg.safeparcel.AutoSafeParcelable; import org.microg.safeparcel.SafeParceled; diff --git a/src/com/google/android/gms/maps/model/TileOverlayOptions.java b/src/com/google/android/gms/maps/model/TileOverlayOptions.java index 55825613..85ab38f0 100644 --- a/src/com/google/android/gms/maps/model/TileOverlayOptions.java +++ b/src/com/google/android/gms/maps/model/TileOverlayOptions.java @@ -20,7 +20,7 @@ import android.os.IBinder; import android.os.RemoteException; import com.google.android.gms.maps.model.internal.ITileProviderDelegate; -import org.microg.gms.PublicApi; +import org.microg.gms.common.PublicApi; import org.microg.safeparcel.AutoSafeParcelable; import org.microg.safeparcel.SafeParceled; diff --git a/src/com/google/android/gms/maps/model/VisibleRegion.java b/src/com/google/android/gms/maps/model/VisibleRegion.java index 601f1509..ab0e20b7 100644 --- a/src/com/google/android/gms/maps/model/VisibleRegion.java +++ b/src/com/google/android/gms/maps/model/VisibleRegion.java @@ -16,7 +16,7 @@ package com.google.android.gms.maps.model; -import org.microg.gms.PublicApi; +import org.microg.gms.common.PublicApi; import org.microg.safeparcel.AutoSafeParcelable; import org.microg.safeparcel.SafeParceled; diff --git a/src/com/google/android/gms/wearable/Node.java b/src/com/google/android/gms/wearable/Node.java index 9c7d5796..f308c611 100644 --- a/src/com/google/android/gms/wearable/Node.java +++ b/src/com/google/android/gms/wearable/Node.java @@ -16,7 +16,7 @@ package com.google.android.gms.wearable; -import org.microg.gms.PublicApi; +import org.microg.gms.common.PublicApi; /** * Information about a particular node in the Android Wear network. diff --git a/src/com/google/android/gms/wearable/WearableStatusCodes.java b/src/com/google/android/gms/wearable/WearableStatusCodes.java index 46e4dbdd..13cc75d2 100644 --- a/src/com/google/android/gms/wearable/WearableStatusCodes.java +++ b/src/com/google/android/gms/wearable/WearableStatusCodes.java @@ -18,7 +18,7 @@ package com.google.android.gms.wearable; import com.google.android.gms.common.api.CommonStatusCodes; -import org.microg.gms.PublicApi; +import org.microg.gms.common.PublicApi; /** * Error codes for wearable API failures. These values may be returned by APIs to indicate the diff --git a/src/org/microg/gms/Constants.java b/src/org/microg/gms/common/Constants.java similarity index 97% rename from src/org/microg/gms/Constants.java rename to src/org/microg/gms/common/Constants.java index 8e6c6844..1197f46a 100644 --- a/src/org/microg/gms/Constants.java +++ b/src/org/microg/gms/common/Constants.java @@ -1,4 +1,4 @@ -package org.microg.gms; +package org.microg.gms.common; public class Constants { /** diff --git a/src/org/microg/gms/PublicApi.java b/src/org/microg/gms/common/PublicApi.java similarity index 97% rename from src/org/microg/gms/PublicApi.java rename to src/org/microg/gms/common/PublicApi.java index 488f6c3a..45afeb22 100644 --- a/src/org/microg/gms/PublicApi.java +++ b/src/org/microg/gms/common/PublicApi.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.microg.gms; +package org.microg.gms.common; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; From f70578f78b3667d57d6168f4c0b1ebea29e84ad6 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Mon, 2 Feb 2015 00:03:48 +0100 Subject: [PATCH 036/293] Fix async issues --- GmsApi | 2 +- .../android/gms/common/GooglePlayServicesUtil.java | 4 ++-- src/com/google/android/gms/common/api/Api.java | 2 +- .../android/gms/common/api/GoogleApiClient.java | 4 ++-- .../gms/location/FusedLocationProviderApi.java | 2 +- .../microg/gms/common/MultiConnectionKeeper.java | 13 +++++++++---- .../gms/location/GoogleLocationManagerClient.java | 2 +- 7 files changed, 17 insertions(+), 12 deletions(-) diff --git a/GmsApi b/GmsApi index 3c19d84e..5d2364f3 160000 --- a/GmsApi +++ b/GmsApi @@ -1 +1 @@ -Subproject commit 3c19d84eaa9842a2526166a38ad445125dbd2300 +Subproject commit 5d2364f3dcc66bdd1ae19c91d76d77d2a4a785b6 diff --git a/src/com/google/android/gms/common/GooglePlayServicesUtil.java b/src/com/google/android/gms/common/GooglePlayServicesUtil.java index 6da29c4f..01499aec 100644 --- a/src/com/google/android/gms/common/GooglePlayServicesUtil.java +++ b/src/com/google/android/gms/common/GooglePlayServicesUtil.java @@ -9,8 +9,8 @@ import android.content.DialogInterface; import android.content.pm.PackageManager; import android.util.Log; -import org.microg.gms.Constants; -import org.microg.gms.PublicApi; +import org.microg.gms.common.Constants; +import org.microg.gms.common.PublicApi; /** * Utility class for verifying that the Google Play services APK is available and up-to-date on diff --git a/src/com/google/android/gms/common/api/Api.java b/src/com/google/android/gms/common/api/Api.java index 3e5482a9..60ab9a36 100644 --- a/src/com/google/android/gms/common/api/Api.java +++ b/src/com/google/android/gms/common/api/Api.java @@ -1,6 +1,6 @@ package com.google.android.gms.common.api; -import org.microg.gms.PublicApi; +import org.microg.gms.common.PublicApi; import org.microg.gms.common.api.ApiBuilder; /** diff --git a/src/com/google/android/gms/common/api/GoogleApiClient.java b/src/com/google/android/gms/common/api/GoogleApiClient.java index 672a1a7e..e44f988e 100644 --- a/src/com/google/android/gms/common/api/GoogleApiClient.java +++ b/src/com/google/android/gms/common/api/GoogleApiClient.java @@ -10,8 +10,8 @@ import android.view.View; import com.google.android.gms.common.ConnectionResult; -import org.microg.gms.Constants; -import org.microg.gms.PublicApi; +import org.microg.gms.common.Constants; +import org.microg.gms.common.PublicApi; import org.microg.gms.common.api.GoogleApiClientImpl; import java.util.HashMap; diff --git a/src/com/google/android/gms/location/FusedLocationProviderApi.java b/src/com/google/android/gms/location/FusedLocationProviderApi.java index 46a91060..8c484537 100644 --- a/src/com/google/android/gms/location/FusedLocationProviderApi.java +++ b/src/com/google/android/gms/location/FusedLocationProviderApi.java @@ -7,7 +7,7 @@ import android.os.Looper; import com.google.android.gms.common.api.GoogleApiClient; import com.google.android.gms.common.api.PendingResult; -import org.microg.gms.Constants; +import org.microg.gms.common.Constants; public interface FusedLocationProviderApi { public static final String KEY_LOCATION_CHANGED = "com.google.android.location.LOCATION"; diff --git a/src/org/microg/gms/common/MultiConnectionKeeper.java b/src/org/microg/gms/common/MultiConnectionKeeper.java index bb454e55..84ce091d 100644 --- a/src/org/microg/gms/common/MultiConnectionKeeper.java +++ b/src/org/microg/gms/common/MultiConnectionKeeper.java @@ -28,7 +28,7 @@ import java.util.HashSet; import java.util.Map; import java.util.Set; -import static org.microg.gms.Constants.GMS_PACKAGE_NAME; +import static org.microg.gms.common.Constants.GMS_PACKAGE_NAME; public class MultiConnectionKeeper { private static final String TAG = "GmsMultiConnectionKeeper"; @@ -48,7 +48,7 @@ public class MultiConnectionKeeper { return INSTANCE; } - public boolean bind(String action, ServiceConnection connection) { + public synchronized boolean bind(String action, ServiceConnection connection) { Log.d(TAG, "bind(" + action + ", " + connection + ")"); Connection con = connections.get(action); if (con != null) { @@ -66,7 +66,7 @@ public class MultiConnectionKeeper { return con.isBound(); } - public void unbind(String action, ServiceConnection connection) { + public synchronized void unbind(String action, ServiceConnection connection) { Log.d(TAG, "unbind(" + action + ", " + connection + ")"); Connection con = connections.get(action); if (con != null) { @@ -108,6 +108,7 @@ public class MultiConnectionKeeper { connection.onServiceDisconnected(componentName); } connected = false; + bound = false; } }; @@ -135,7 +136,11 @@ public class MultiConnectionKeeper { public void unbind() { Log.d(TAG, "Connection(" + actionString + ") : unbind()"); - context.unbindService(serviceConnection); + try { + context.unbindService(serviceConnection); + } catch (IllegalArgumentException e) { // not bound (whatever reason) + Log.w(TAG, e); + } bound = false; } diff --git a/src/org/microg/gms/location/GoogleLocationManagerClient.java b/src/org/microg/gms/location/GoogleLocationManagerClient.java index cbc24b21..8da05e69 100644 --- a/src/org/microg/gms/location/GoogleLocationManagerClient.java +++ b/src/org/microg/gms/location/GoogleLocationManagerClient.java @@ -25,7 +25,7 @@ import com.google.android.gms.common.api.GoogleApiClient; import com.google.android.gms.common.internal.IGmsServiceBroker; import com.google.android.gms.location.internal.IGoogleLocationManagerService; -import org.microg.gms.Constants; +import org.microg.gms.common.Constants; import org.microg.gms.common.GmsClient; public abstract class GoogleLocationManagerClient extends GmsClient { From 19b0b0f1d782640c0e5a9a381a0191665de0b053 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Tue, 3 Feb 2015 23:07:55 +0100 Subject: [PATCH 037/293] Add SHA1 to Constants --- src/org/microg/gms/common/Constants.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/org/microg/gms/common/Constants.java b/src/org/microg/gms/common/Constants.java index 1197f46a..3f7e65cb 100644 --- a/src/org/microg/gms/common/Constants.java +++ b/src/org/microg/gms/common/Constants.java @@ -10,6 +10,7 @@ public class Constants { public static final String KEY_MOCK_LOCATION = "mockLocation"; public static final String DEFAULT_ACCOUNT = "<>"; public static final String GMS_PACKAGE_NAME = "com.google.android.gms"; + public static final String GMS_PACKAGE_SIGNATURE_SHA1 = "38918a453d07199354f8b19af05ec6562ced5788"; /** * No base map tiles. From 60d7da6dc6730f7c393eaef295bd6a9ffa2287e6 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Wed, 4 Feb 2015 23:12:23 +0100 Subject: [PATCH 038/293] Update sublib --- GmsApi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GmsApi b/GmsApi index 5d2364f3..19b0b0f1 160000 --- a/GmsApi +++ b/GmsApi @@ -1 +1 @@ -Subproject commit 5d2364f3dcc66bdd1ae19c91d76d77d2a4a785b6 +Subproject commit 19b0b0f1d782640c0e5a9a381a0191665de0b053 From 2a3cdfed4f51031d6260f4c707c88ef53dc03177 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Fri, 6 Feb 2015 13:00:31 +0100 Subject: [PATCH 039/293] Synchronize connections --- .../android/gms/location/LocationClient.java | 8 ++++ src/org/microg/gms/common/GmsClient.java | 40 ++++++++++++------- src/org/microg/gms/common/GmsConnector.java | 2 +- .../api/AbstractPlayServicesClient.java | 4 ++ .../gms/common/api/GoogleApiClientImpl.java | 14 ++++--- 5 files changed, 48 insertions(+), 20 deletions(-) diff --git a/src/com/google/android/gms/location/LocationClient.java b/src/com/google/android/gms/location/LocationClient.java index 06b766d1..04190cef 100644 --- a/src/com/google/android/gms/location/LocationClient.java +++ b/src/com/google/android/gms/location/LocationClient.java @@ -31,41 +31,49 @@ public class LocationClient extends AbstractPlayServicesClient { } public Location getLastLocation() { + assertConnected(); return LocationServices.FusedLocationApi.getLastLocation(googleApiClient); } public PendingResult requestLocationUpdates(LocationRequest request, LocationListener listener) { + assertConnected(); return LocationServices.FusedLocationApi.requestLocationUpdates(googleApiClient, request, listener); } public PendingResult requestLocationUpdates(LocationRequest request, LocationListener listener, Looper looper) { + assertConnected(); return LocationServices.FusedLocationApi.requestLocationUpdates(googleApiClient, request, listener, looper); } public PendingResult requestLocationUpdates(LocationRequest request, PendingIntent callbackIntent) { + assertConnected(); return LocationServices.FusedLocationApi.requestLocationUpdates(googleApiClient, request, callbackIntent); } public PendingResult removeLocationUpdates(LocationListener listener) { + assertConnected(); return LocationServices.FusedLocationApi.removeLocationUpdates(googleApiClient, listener); } public PendingResult removeLocationUpdates(PendingIntent callbackIntent) { + assertConnected(); return LocationServices.FusedLocationApi.removeLocationUpdates(googleApiClient, callbackIntent); } public PendingResult setMockMode(boolean isMockMode) { + assertConnected(); return LocationServices.FusedLocationApi.setMockMode(googleApiClient, isMockMode); } public PendingResult setMockLocation(Location mockLocation) { + assertConnected(); return LocationServices.FusedLocationApi.setMockLocation(googleApiClient, mockLocation); } } diff --git a/src/org/microg/gms/common/GmsClient.java b/src/org/microg/gms/common/GmsClient.java index 800b8df8..80bf78cf 100644 --- a/src/org/microg/gms/common/GmsClient.java +++ b/src/org/microg/gms/common/GmsClient.java @@ -43,7 +43,7 @@ public abstract class GmsClient implements ApiConnection { private I serviceInterface; public GmsClient(Context context, GoogleApiClient.ConnectionCallbacks callbacks, - GoogleApiClient.OnConnectionFailedListener connectionFailedListener) { + GoogleApiClient.OnConnectionFailedListener connectionFailedListener) { this.context = context; this.callbacks = callbacks; this.connectionFailedListener = connectionFailedListener; @@ -57,9 +57,11 @@ public abstract class GmsClient implements ApiConnection { protected abstract I interfaceFromBinder(IBinder binder); @Override - public void connect() { + public synchronized void connect() { Log.d(TAG, "connect()"); - if (state == ConnectionState.CONNECTED || state == ConnectionState.CONNECTING) return; + if (state == ConnectionState.CONNECTED || state == ConnectionState.CONNECTING) { + Log.d(TAG, "Already connected/connecting - nothing to do"); + } state = ConnectionState.CONNECTING; if (serviceConnection != null) { MultiConnectionKeeper.getInstance(context) @@ -79,7 +81,7 @@ public abstract class GmsClient implements ApiConnection { } @Override - public void disconnect() { + public synchronized void disconnect() { Log.d(TAG, "disconnect()"); if (state == ConnectionState.DISCONNECTING) return; if (state == ConnectionState.CONNECTING) { @@ -95,16 +97,16 @@ public abstract class GmsClient implements ApiConnection { } @Override - public boolean isConnected() { + public synchronized boolean isConnected() { return state == ConnectionState.CONNECTED || state == ConnectionState.PSEUDO_CONNECTED; } @Override - public boolean isConnecting() { + public synchronized boolean isConnecting() { return state == ConnectionState.CONNECTING; } - public boolean hasError() { + public synchronized boolean hasError() { return state == ConnectionState.ERROR; } @@ -112,7 +114,13 @@ public abstract class GmsClient implements ApiConnection { return context; } - public I getServiceInterface() { + public synchronized I getServiceInterface() { + if (isConnecting()) { + // TODO: wait for connection to be established and return afterwards. + throw new IllegalStateException("Waiting for connection"); + } else if (!isConnected()) { + throw new IllegalStateException("interface only available once connected!"); + } return serviceInterface; } @@ -135,7 +143,9 @@ public abstract class GmsClient implements ApiConnection { @Override public void onServiceDisconnected(ComponentName componentName) { - state = ConnectionState.NOT_CONNECTED; + synchronized (GmsClient.this) { + state = ConnectionState.NOT_CONNECTED; + } } } @@ -144,13 +154,15 @@ public abstract class GmsClient implements ApiConnection { @Override public void onPostInitComplete(int statusCode, IBinder binder, Bundle params) throws RemoteException { - if (state == ConnectionState.DISCONNECTING) { + synchronized (GmsClient.this) { + if (state == ConnectionState.DISCONNECTING) { + state = ConnectionState.CONNECTED; + disconnect(); + return; + } state = ConnectionState.CONNECTED; - disconnect(); - return; + serviceInterface = interfaceFromBinder(binder); } - state = ConnectionState.CONNECTED; - serviceInterface = interfaceFromBinder(binder); Log.d(TAG, "GmsCallbacks : onPostInitComplete(" + serviceInterface + ")"); callbacks.onConnected(params); } diff --git a/src/org/microg/gms/common/GmsConnector.java b/src/org/microg/gms/common/GmsConnector.java index cd23afc7..90712d9a 100644 --- a/src/org/microg/gms/common/GmsConnector.java +++ b/src/org/microg/gms/common/GmsConnector.java @@ -64,7 +64,7 @@ public class GmsConnector result = (AbstractPendingResult) msg.obj; try { result.deliverResult(callback.onClientAvailable((C) apiClient.getApiConnection diff --git a/src/org/microg/gms/common/api/AbstractPlayServicesClient.java b/src/org/microg/gms/common/api/AbstractPlayServicesClient.java index 6ff1be44..0bd98141 100644 --- a/src/org/microg/gms/common/api/AbstractPlayServicesClient.java +++ b/src/org/microg/gms/common/api/AbstractPlayServicesClient.java @@ -30,6 +30,10 @@ public class AbstractPlayServicesClient implements GooglePlayServicesClient { this.googleApiClient = googleApiClient; } + public void assertConnected() { + if (!isConnected()) throw new IllegalStateException("Not connected!"); + } + @Override public void connect() { googleApiClient.connect(); diff --git a/src/org/microg/gms/common/api/GoogleApiClientImpl.java b/src/org/microg/gms/common/api/GoogleApiClientImpl.java index ff2fa9ce..10878613 100644 --- a/src/org/microg/gms/common/api/GoogleApiClientImpl.java +++ b/src/org/microg/gms/common/api/GoogleApiClientImpl.java @@ -120,8 +120,12 @@ public class GoogleApiClientImpl implements GoogleApiClient { } @Override - public void connect() { + public synchronized void connect() { Log.d(TAG, "connect()"); + if (isConnected() || isConnecting()) { + Log.d(TAG, "Already connected/connecting, noting to do"); + return; + } for (ApiConnection connection : apiConnections.values()) { if (!connection.isConnected()) { connection.connect(); @@ -130,7 +134,7 @@ public class GoogleApiClientImpl implements GoogleApiClient { } @Override - public void disconnect() { + public synchronized void disconnect() { Log.d(TAG, "disconnect()"); for (ApiConnection connection : apiConnections.values()) { if (connection.isConnected()) { @@ -140,7 +144,7 @@ public class GoogleApiClientImpl implements GoogleApiClient { } @Override - public boolean isConnected() { + public synchronized boolean isConnected() { for (ApiConnection connection : apiConnections.values()) { if (!connection.isConnected()) return false; } @@ -148,7 +152,7 @@ public class GoogleApiClientImpl implements GoogleApiClient { } @Override - public boolean isConnecting() { + public synchronized boolean isConnecting() { for (ApiConnection connection : apiConnections.values()) { if (connection.isConnecting()) return true; } @@ -167,7 +171,7 @@ public class GoogleApiClientImpl implements GoogleApiClient { } @Override - public void reconnect() { + public synchronized void reconnect() { Log.d(TAG, "reconnect()"); disconnect(); connect(); From 5ef9d262b405d0b0ba241d4e740d87bf22e0a5a9 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Tue, 10 Feb 2015 03:31:53 +0100 Subject: [PATCH 040/293] Add missing AuthManager method --- .../android/auth/IAuthManagerService.aidl | 4 ++ .../android/gms/auth/AccountChangeEvent.java | 5 ++- .../gms/auth/AccountChangeEventsRequest.aidl | 3 ++ .../gms/auth/AccountChangeEventsRequest.java | 37 +++++++++++++++++++ .../gms/auth/AccountChangeEventsResponse.aidl | 3 ++ .../gms/auth/AccountChangeEventsResponse.java | 37 +++++++++++++++++++ 6 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 src/com/google/android/gms/auth/AccountChangeEventsRequest.aidl create mode 100644 src/com/google/android/gms/auth/AccountChangeEventsRequest.java create mode 100644 src/com/google/android/gms/auth/AccountChangeEventsResponse.aidl create mode 100644 src/com/google/android/gms/auth/AccountChangeEventsResponse.java diff --git a/src/com/google/android/auth/IAuthManagerService.aidl b/src/com/google/android/auth/IAuthManagerService.aidl index 0b84c375..94ced65c 100644 --- a/src/com/google/android/auth/IAuthManagerService.aidl +++ b/src/com/google/android/auth/IAuthManagerService.aidl @@ -1,6 +1,10 @@ package com.google.android.auth; +import com.google.android.gms.auth.AccountChangeEventsResponse; +import com.google.android.gms.auth.AccountChangeEventsRequest; + interface IAuthManagerService { Bundle getToken(String accountName, String scope, in Bundle extras); Bundle clearToken(String token, in Bundle extras); + AccountChangeEventsResponse getChangeEvents(in AccountChangeEventsRequest request); } diff --git a/src/com/google/android/gms/auth/AccountChangeEvent.java b/src/com/google/android/gms/auth/AccountChangeEvent.java index 4f927ab8..cfa84122 100644 --- a/src/com/google/android/gms/auth/AccountChangeEvent.java +++ b/src/com/google/android/gms/auth/AccountChangeEvent.java @@ -1,4 +1,7 @@ package com.google.android.gms.auth; -public class AccountChangeEvent { +import org.microg.safeparcel.AutoSafeParcelable; + +public class AccountChangeEvent extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator<>(AccountChangeEvent.class); } diff --git a/src/com/google/android/gms/auth/AccountChangeEventsRequest.aidl b/src/com/google/android/gms/auth/AccountChangeEventsRequest.aidl new file mode 100644 index 00000000..206b1a9d --- /dev/null +++ b/src/com/google/android/gms/auth/AccountChangeEventsRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.auth; + +parcelable AccountChangeEventsRequest; \ No newline at end of file diff --git a/src/com/google/android/gms/auth/AccountChangeEventsRequest.java b/src/com/google/android/gms/auth/AccountChangeEventsRequest.java new file mode 100644 index 00000000..940301d3 --- /dev/null +++ b/src/com/google/android/gms/auth/AccountChangeEventsRequest.java @@ -0,0 +1,37 @@ +/* + * Copyright 2013-2015 µg 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.auth; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class AccountChangeEventsRequest extends AutoSafeParcelable { + @SafeParceled(1) + private final int versionCode; + @SafeParceled(2) + private int i; + @SafeParceled(3) + private String s; + + + private AccountChangeEventsRequest() { + versionCode = 1; + } + + public static Creator CREATOR = new AutoCreator<>(AccountChangeEventsRequest.class); + +} diff --git a/src/com/google/android/gms/auth/AccountChangeEventsResponse.aidl b/src/com/google/android/gms/auth/AccountChangeEventsResponse.aidl new file mode 100644 index 00000000..832e5859 --- /dev/null +++ b/src/com/google/android/gms/auth/AccountChangeEventsResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.auth; + +parcelable AccountChangeEventsResponse; \ No newline at end of file diff --git a/src/com/google/android/gms/auth/AccountChangeEventsResponse.java b/src/com/google/android/gms/auth/AccountChangeEventsResponse.java new file mode 100644 index 00000000..a319e621 --- /dev/null +++ b/src/com/google/android/gms/auth/AccountChangeEventsResponse.java @@ -0,0 +1,37 @@ +/* + * Copyright 2013-2015 µg 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.auth; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +import java.util.ArrayList; +import java.util.List; + +public class AccountChangeEventsResponse extends AutoSafeParcelable { + @SafeParceled(1) + private final int versionCode; + @SafeParceled(value = 2, subType = "com.google.android.gms.auth.AccountChangeEvent") + private List events; + + public AccountChangeEventsResponse() { + versionCode = 1; + events = new ArrayList<>(); + } + + public static Creator CREATOR = new AutoCreator<>(AccountChangeEventsResponse.class); +} From 07e3208a26361d35253c1c50abca93689b643081 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Tue, 10 Feb 2015 03:32:55 +0100 Subject: [PATCH 041/293] Update SafeParcel --- SafeParcel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SafeParcel b/SafeParcel index 3efecf38..a650ca5b 160000 --- a/SafeParcel +++ b/SafeParcel @@ -1 +1 @@ -Subproject commit 3efecf38ca8b1f89cd8f0c40eea4b497f1563d90 +Subproject commit a650ca5beac2a374460d820935b40f9539e692db From 3243e7d3ecf2f7ff92279b61c4a7e7831356f5c7 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Tue, 10 Feb 2015 15:29:44 +0100 Subject: [PATCH 042/293] Add PeopleService interface --- build.gradle | 2 +- .../google/android/gms/people/internal/IPeopleService.aidl | 5 +++++ src/org/microg/gms/common/Constants.java | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 src/com/google/android/gms/people/internal/IPeopleService.aidl diff --git a/build.gradle b/build.gradle index dd90597a..eb5bd3cb 100644 --- a/build.gradle +++ b/build.gradle @@ -3,7 +3,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:1.0.0' + classpath 'com.android.tools.build:gradle:1.0.1' } } diff --git a/src/com/google/android/gms/people/internal/IPeopleService.aidl b/src/com/google/android/gms/people/internal/IPeopleService.aidl new file mode 100644 index 00000000..563c976e --- /dev/null +++ b/src/com/google/android/gms/people/internal/IPeopleService.aidl @@ -0,0 +1,5 @@ +package com.google.android.gms.people.internal; + +interface IPeopleService { + +} diff --git a/src/org/microg/gms/common/Constants.java b/src/org/microg/gms/common/Constants.java index 3f7e65cb..bc1642ba 100644 --- a/src/org/microg/gms/common/Constants.java +++ b/src/org/microg/gms/common/Constants.java @@ -7,6 +7,7 @@ public class Constants { */ public static final int MAX_REFERENCE_VERSION = 6599436; public static final String ACTION_GMS_LOCATION_MANAGER_SERVICE_START = "com.google.android.location.internal.GoogleLocationManagerService.START"; + public static final String ACTION_GMS_PEOPLE_SERVICE_START = "com.google.android.gms.people.service.START"; public static final String KEY_MOCK_LOCATION = "mockLocation"; public static final String DEFAULT_ACCOUNT = "<>"; public static final String GMS_PACKAGE_NAME = "com.google.android.gms"; From 4b4e173addb6d4490cf613ba63136fac3fea770a Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Sat, 14 Feb 2015 23:18:28 +0100 Subject: [PATCH 043/293] Fix usage of deprecated LocationClient --- GmsApi | 2 +- SafeParcel | 2 +- build.gradle | 2 +- .../android/gms/location/LocationClient.java | 36 +++++++++---------- src/org/microg/gms/common/GmsConnector.java | 5 +-- .../api/AbstractPlayServicesClient.java | 5 +++ .../gms/common/api/GoogleApiClientImpl.java | 2 +- .../FusedLocationProviderApiImpl.java | 4 +-- 8 files changed, 32 insertions(+), 26 deletions(-) diff --git a/GmsApi b/GmsApi index 19b0b0f1..3243e7d3 160000 --- a/GmsApi +++ b/GmsApi @@ -1 +1 @@ -Subproject commit 19b0b0f1d782640c0e5a9a381a0191665de0b053 +Subproject commit 3243e7d3ecf2f7ff92279b61c4a7e7831356f5c7 diff --git a/SafeParcel b/SafeParcel index 3efecf38..a650ca5b 160000 --- a/SafeParcel +++ b/SafeParcel @@ -1 +1 @@ -Subproject commit 3efecf38ca8b1f89cd8f0c40eea4b497f1563d90 +Subproject commit a650ca5beac2a374460d820935b40f9539e692db diff --git a/build.gradle b/build.gradle index b581ecdf..15771b0c 100644 --- a/build.gradle +++ b/build.gradle @@ -3,7 +3,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:1.0.0' + classpath 'com.android.tools.build:gradle:1.0.1' } } diff --git a/src/com/google/android/gms/location/LocationClient.java b/src/com/google/android/gms/location/LocationClient.java index 04190cef..b9df6c40 100644 --- a/src/com/google/android/gms/location/LocationClient.java +++ b/src/com/google/android/gms/location/LocationClient.java @@ -35,45 +35,45 @@ public class LocationClient extends AbstractPlayServicesClient { return LocationServices.FusedLocationApi.getLastLocation(googleApiClient); } - public PendingResult requestLocationUpdates(LocationRequest request, + public void requestLocationUpdates(LocationRequest request, LocationListener listener) { assertConnected(); - return LocationServices.FusedLocationApi.requestLocationUpdates(googleApiClient, request, - listener); + LocationServices.FusedLocationApi.requestLocationUpdates(googleApiClient, request, + listener).await(); } - public PendingResult requestLocationUpdates(LocationRequest request, + public void requestLocationUpdates(LocationRequest request, LocationListener listener, Looper looper) { assertConnected(); - return LocationServices.FusedLocationApi.requestLocationUpdates(googleApiClient, request, - listener, looper); + LocationServices.FusedLocationApi.requestLocationUpdates(googleApiClient, request, + listener, looper).await(); } - public PendingResult requestLocationUpdates(LocationRequest request, + public void requestLocationUpdates(LocationRequest request, PendingIntent callbackIntent) { assertConnected(); - return LocationServices.FusedLocationApi.requestLocationUpdates(googleApiClient, request, - callbackIntent); + LocationServices.FusedLocationApi.requestLocationUpdates(googleApiClient, request, + callbackIntent).await(); } - public PendingResult removeLocationUpdates(LocationListener listener) { + public void removeLocationUpdates(LocationListener listener) { assertConnected(); - return LocationServices.FusedLocationApi.removeLocationUpdates(googleApiClient, listener); + LocationServices.FusedLocationApi.removeLocationUpdates(googleApiClient, listener).await(); } - public PendingResult removeLocationUpdates(PendingIntent callbackIntent) { + public void removeLocationUpdates(PendingIntent callbackIntent) { assertConnected(); - return LocationServices.FusedLocationApi.removeLocationUpdates(googleApiClient, - callbackIntent); + LocationServices.FusedLocationApi.removeLocationUpdates(googleApiClient, + callbackIntent).await(); } - public PendingResult setMockMode(boolean isMockMode) { + public void setMockMode(boolean isMockMode) { assertConnected(); - return LocationServices.FusedLocationApi.setMockMode(googleApiClient, isMockMode); + LocationServices.FusedLocationApi.setMockMode(googleApiClient, isMockMode).await(); } - public PendingResult setMockLocation(Location mockLocation) { + public void setMockLocation(Location mockLocation) { assertConnected(); - return LocationServices.FusedLocationApi.setMockLocation(googleApiClient, mockLocation); + LocationServices.FusedLocationApi.setMockLocation(googleApiClient, mockLocation).await(); } } diff --git a/src/org/microg/gms/common/GmsConnector.java b/src/org/microg/gms/common/GmsConnector.java index 90712d9a..3621f8ec 100644 --- a/src/org/microg/gms/common/GmsConnector.java +++ b/src/org/microg/gms/common/GmsConnector.java @@ -45,6 +45,7 @@ public class GmsConnector connect() { Log.d(TAG, "connect()"); + apiClient.getApiConnection(api); Looper looper = apiClient.getLooper(); final AbstractPendingResult result = new AbstractPendingResult<>(looper); Message msg = new Message(); @@ -67,8 +68,8 @@ public class GmsConnector result = (AbstractPendingResult) msg.obj; try { - result.deliverResult(callback.onClientAvailable((C) apiClient.getApiConnection - (api))); + C connection = (C)apiClient.getApiConnection(api); + result.deliverResult(callback.onClientAvailable(connection)); } catch (RemoteException ignored) { } diff --git a/src/org/microg/gms/common/api/AbstractPlayServicesClient.java b/src/org/microg/gms/common/api/AbstractPlayServicesClient.java index 0bd98141..50fd1bc3 100644 --- a/src/org/microg/gms/common/api/AbstractPlayServicesClient.java +++ b/src/org/microg/gms/common/api/AbstractPlayServicesClient.java @@ -16,6 +16,8 @@ package org.microg.gms.common.api; +import android.util.Log; + import com.google.android.gms.common.GooglePlayServicesClient; import com.google.android.gms.common.api.GoogleApiClient; @@ -23,6 +25,7 @@ import org.microg.gms.common.ForwardConnectionCallbacks; import org.microg.gms.common.ForwardConnectionFailedListener; public class AbstractPlayServicesClient implements GooglePlayServicesClient { + private static final String TAG = "GmsPlatServicesClient"; protected final GoogleApiClient googleApiClient; @@ -36,11 +39,13 @@ public class AbstractPlayServicesClient implements GooglePlayServicesClient { @Override public void connect() { + Log.d(TAG, "connect()"); googleApiClient.connect(); } @Override public void disconnect() { + Log.d(TAG, "disconnect()"); googleApiClient.disconnect(); } diff --git a/src/org/microg/gms/common/api/GoogleApiClientImpl.java b/src/org/microg/gms/common/api/GoogleApiClientImpl.java index 10878613..db0c707e 100644 --- a/src/org/microg/gms/common/api/GoogleApiClientImpl.java +++ b/src/org/microg/gms/common/api/GoogleApiClientImpl.java @@ -123,7 +123,7 @@ public class GoogleApiClientImpl implements GoogleApiClient { public synchronized void connect() { Log.d(TAG, "connect()"); if (isConnected() || isConnecting()) { - Log.d(TAG, "Already connected/connecting, noting to do"); + Log.d(TAG, "Already connected/connecting, nothing to do"); return; } for (ApiConnection connection : apiConnections.values()) { diff --git a/src/org/microg/gms/location/FusedLocationProviderApiImpl.java b/src/org/microg/gms/location/FusedLocationProviderApiImpl.java index be46f446..f89a79af 100644 --- a/src/org/microg/gms/location/FusedLocationProviderApiImpl.java +++ b/src/org/microg/gms/location/FusedLocationProviderApiImpl.java @@ -129,8 +129,8 @@ public class FusedLocationProviderApiImpl implements FusedLocationProviderApi { @Override public Result onClientAvailable(LocationClientImpl client) throws RemoteException { - runnable.run(client); - return Status.SUCCESS; + runnable.run(client); + return Status.SUCCESS; } }).connect(); } From 6020cd818a17d1d38a85157b0d44e3505fe791ee Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Sun, 1 Mar 2015 14:53:06 +0100 Subject: [PATCH 044/293] Add Lightweight Icing service API --- .../android/gms/appdatasearch/UsageInfo.aidl | 3 +++ .../android/gms/appdatasearch/UsageInfo.java | 24 +++++++++++++++++++ .../internal/ILightweightAppDataSearch.aidl | 8 +++++++ .../ILightweightAppDataSearchCallbacks.aidl | 4 ++++ 4 files changed, 39 insertions(+) create mode 100644 src/com/google/android/gms/appdatasearch/UsageInfo.aidl create mode 100644 src/com/google/android/gms/appdatasearch/UsageInfo.java create mode 100644 src/com/google/android/gms/appdatasearch/internal/ILightweightAppDataSearch.aidl create mode 100644 src/com/google/android/gms/appdatasearch/internal/ILightweightAppDataSearchCallbacks.aidl diff --git a/src/com/google/android/gms/appdatasearch/UsageInfo.aidl b/src/com/google/android/gms/appdatasearch/UsageInfo.aidl new file mode 100644 index 00000000..b52e3d4f --- /dev/null +++ b/src/com/google/android/gms/appdatasearch/UsageInfo.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.appdatasearch; + +parcelable UsageInfo; \ No newline at end of file diff --git a/src/com/google/android/gms/appdatasearch/UsageInfo.java b/src/com/google/android/gms/appdatasearch/UsageInfo.java new file mode 100644 index 00000000..47e12395 --- /dev/null +++ b/src/com/google/android/gms/appdatasearch/UsageInfo.java @@ -0,0 +1,24 @@ +/* + * Copyright 2013-2015 µg 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.appdatasearch; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class UsageInfo extends AutoSafeParcelable { + + public static Creator CREATOR = new AutoCreator<>(UsageInfo.class); +} diff --git a/src/com/google/android/gms/appdatasearch/internal/ILightweightAppDataSearch.aidl b/src/com/google/android/gms/appdatasearch/internal/ILightweightAppDataSearch.aidl new file mode 100644 index 00000000..77e618ac --- /dev/null +++ b/src/com/google/android/gms/appdatasearch/internal/ILightweightAppDataSearch.aidl @@ -0,0 +1,8 @@ +package com.google.android.gms.appdatasearch.internal; + +import com.google.android.gms.appdatasearch.internal.ILightweightAppDataSearchCallbacks; +import com.google.android.gms.appdatasearch.UsageInfo; + +interface ILightweightAppDataSearch { + void view(ILightweightAppDataSearchCallbacks callbacks, String packageName, in UsageInfo[] usageInfos); +} diff --git a/src/com/google/android/gms/appdatasearch/internal/ILightweightAppDataSearchCallbacks.aidl b/src/com/google/android/gms/appdatasearch/internal/ILightweightAppDataSearchCallbacks.aidl new file mode 100644 index 00000000..338a1427 --- /dev/null +++ b/src/com/google/android/gms/appdatasearch/internal/ILightweightAppDataSearchCallbacks.aidl @@ -0,0 +1,4 @@ +package com.google.android.gms.appdatasearch.internal; + +interface ILightweightAppDataSearchCallbacks { +} From c29a2cbc8937b6e41d125aab34328c988d99e345 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Mon, 2 Mar 2015 03:54:11 +0100 Subject: [PATCH 045/293] More reporting API --- .../location/reporting/ReportingState.aidl | 3 ++ .../location/reporting/ReportingState.java | 41 +++++++++++++++++++ .../reporting/internal/IReportingService.aidl | 8 ++++ 3 files changed, 52 insertions(+) create mode 100644 src/com/google/android/gms/location/reporting/ReportingState.aidl create mode 100644 src/com/google/android/gms/location/reporting/ReportingState.java create mode 100644 src/com/google/android/gms/location/reporting/internal/IReportingService.aidl diff --git a/src/com/google/android/gms/location/reporting/ReportingState.aidl b/src/com/google/android/gms/location/reporting/ReportingState.aidl new file mode 100644 index 00000000..4b1bf63c --- /dev/null +++ b/src/com/google/android/gms/location/reporting/ReportingState.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.location.reporting; + +parcelable ReportingState; \ No newline at end of file diff --git a/src/com/google/android/gms/location/reporting/ReportingState.java b/src/com/google/android/gms/location/reporting/ReportingState.java new file mode 100644 index 00000000..b99bde56 --- /dev/null +++ b/src/com/google/android/gms/location/reporting/ReportingState.java @@ -0,0 +1,41 @@ +/* + * Copyright 2013-2015 µg 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.location.reporting; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class ReportingState extends AutoSafeParcelable { + @SafeParceled(1) + public int versionCode; + @SafeParceled(2) + public int reportingEnabled; + @SafeParceled(3) + public int historyEnabled; + @SafeParceled(4) + public boolean allowed; + @SafeParceled(5) + public boolean active; + @SafeParceled(6) + public boolean defer; + @SafeParceled(7) + public int expectedOptInResult; + @SafeParceled(8) + public Integer deviceTag; + + public static final Creator CREATOR = new AutoCreator<>(ReportingState.class); +} diff --git a/src/com/google/android/gms/location/reporting/internal/IReportingService.aidl b/src/com/google/android/gms/location/reporting/internal/IReportingService.aidl new file mode 100644 index 00000000..c9eb0aae --- /dev/null +++ b/src/com/google/android/gms/location/reporting/internal/IReportingService.aidl @@ -0,0 +1,8 @@ +package com.google.android.gms.location.reporting.internal; + +import android.accounts.Account; +import com.google.android.gms.location.reporting.ReportingState; + +interface IReportingService { + ReportingState unknown3(in Account account); +} From 059d4a7b835dc52b99b5313077fa3dfd2e61b831 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Tue, 3 Mar 2015 22:30:51 +0100 Subject: [PATCH 046/293] Start adding IPeopleService --- .../common/server/FavaDiagnosticsEntity.aidl | 3 ++ .../common/server/FavaDiagnosticsEntity.java | 24 ++++++++++++++ .../gms/people/internal/IPeopleCallbacks.aidl | 4 +++ .../gms/people/internal/IPeopleService.aidl | 32 ++++++++++++++++++- 4 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 src/com/google/android/gms/common/server/FavaDiagnosticsEntity.aidl create mode 100644 src/com/google/android/gms/common/server/FavaDiagnosticsEntity.java create mode 100644 src/com/google/android/gms/people/internal/IPeopleCallbacks.aidl diff --git a/src/com/google/android/gms/common/server/FavaDiagnosticsEntity.aidl b/src/com/google/android/gms/common/server/FavaDiagnosticsEntity.aidl new file mode 100644 index 00000000..69b856bc --- /dev/null +++ b/src/com/google/android/gms/common/server/FavaDiagnosticsEntity.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.common.server; + +parcelable FavaDiagnosticsEntity; \ No newline at end of file diff --git a/src/com/google/android/gms/common/server/FavaDiagnosticsEntity.java b/src/com/google/android/gms/common/server/FavaDiagnosticsEntity.java new file mode 100644 index 00000000..6183e2f8 --- /dev/null +++ b/src/com/google/android/gms/common/server/FavaDiagnosticsEntity.java @@ -0,0 +1,24 @@ +/* + * Copyright 2013-2015 µg 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.common.server; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class FavaDiagnosticsEntity extends AutoSafeParcelable { + + public static final Creator CREATOR = new AutoCreator<>(FavaDiagnosticsEntity.class); +} diff --git a/src/com/google/android/gms/people/internal/IPeopleCallbacks.aidl b/src/com/google/android/gms/people/internal/IPeopleCallbacks.aidl new file mode 100644 index 00000000..f1f0d5fa --- /dev/null +++ b/src/com/google/android/gms/people/internal/IPeopleCallbacks.aidl @@ -0,0 +1,4 @@ +package com.google.android.gms.people.internal; + +interface IPeopleCallbacks { +} diff --git a/src/com/google/android/gms/people/internal/IPeopleService.aidl b/src/com/google/android/gms/people/internal/IPeopleService.aidl index 563c976e..8c41d3a0 100644 --- a/src/com/google/android/gms/people/internal/IPeopleService.aidl +++ b/src/com/google/android/gms/people/internal/IPeopleService.aidl @@ -1,5 +1,35 @@ package com.google.android.gms.people.internal; -interface IPeopleService { +import com.google.android.gms.people.internal.IPeopleCallbacks; +import com.google.android.gms.common.server.FavaDiagnosticsEntity; +interface IPeopleService { + void unknown1(); + void loadOwners1(IPeopleCallbacks var1, boolean var2, boolean var3, String var4, String var5); + void loadCirclesOld(IPeopleCallbacks var1, String var2, String var3, String var4, int var5, String var6); + void loadPeopleOld(IPeopleCallbacks var1, String var2, String var3, String var4, in List var5, int var6, boolean var7, long var8); + void loadAvatarLegacy(IPeopleCallbacks var1, String var2, int var3, int var4); + void loadContactImageLegacy(IPeopleCallbacks var1, long var2, boolean var4); + void blockPerson(IPeopleCallbacks var1, String var2, String var3, String var4, boolean var5); + Bundle syncRawContact(in Uri var1); + void loadPeopleForAggregation8(IPeopleCallbacks var1, String var2, String var3, String var4, boolean var5, int var6); + void setSyncToContactsSettings(IPeopleCallbacks var1, String var2, boolean var3, in String[] var4); + Bundle registerDataChangedListener(IPeopleCallbacks var1, boolean var2, String var3, String var4, int var5); + Bundle startSync(String var1, String var2); + void requestSync(IPeopleCallbacks var1, String var2, String var3, in Uri var4); + void updatePersonCirclesOld(IPeopleCallbacks var1, String var2, String var3, String var4, in List var5, in List var6); + void a(boolean var1); + boolean isSyncToContactsEnabled(); + Bundle requestSyncOld(String var1, String var2); + void setAvatar(IPeopleCallbacks var1, String var2, String var3, in Uri var4, boolean var5); + void loadCircles(IPeopleCallbacks var1, String var2, String var3, String var4, int var5, String var6, boolean var7); + Bundle requestSyncOld19(String var1, String var2, long var3); + void loadPeople20(IPeopleCallbacks var1, String var2, String var3, String var4, in List var5, int var6, boolean var7, long var8, String var10, int var11); + void loadPeopleLive(IPeopleCallbacks var1, String var2, String var3, String var4, int var5, String var6); + void updatePersonCircles(IPeopleCallbacks var1, String var2, String var3, String var4, in List var5, in List var6, in FavaDiagnosticsEntity var7); + void loadRemoteImageLegacy(IPeopleCallbacks var1, String var2); + void loadContactsGaiaIds24(IPeopleCallbacks var1, String var2, String var3); + Bundle requestSyncOld25(String var1, String var2, long var3, boolean var5); + void addCircle(IPeopleCallbacks var1, String var2, String var3, String var4, String var5); + void addPeopleToCircle(IPeopleCallbacks var1, String var2, String var3, String var4, in List var5); } From adb160c25bf23be73738a732c94b903db41a338d Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Wed, 4 Mar 2015 23:22:49 +0100 Subject: [PATCH 047/293] Beginning IPeopleService --- .../android/gms/common/data/DataHolder.java | 6 +- .../gms/people/internal/IPeopleCallbacks.aidl | 3 + .../gms/people/internal/IPeopleService.aidl | 56 +++++++++---------- .../gms/people/model/AccountMetadata.java | 28 ++++++++++ 4 files changed, 62 insertions(+), 31 deletions(-) create mode 100644 src/com/google/android/gms/people/model/AccountMetadata.java diff --git a/src/com/google/android/gms/common/data/DataHolder.java b/src/com/google/android/gms/common/data/DataHolder.java index ef5d89ef..6ec81e9e 100644 --- a/src/com/google/android/gms/common/data/DataHolder.java +++ b/src/com/google/android/gms/common/data/DataHolder.java @@ -1,11 +1,11 @@ package com.google.android.gms.common.data; import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; -/** - * TODO: usage - */ public class DataHolder extends AutoSafeParcelable { + @SafeParceled(1000) + private int versionCode = 1; public static final Creator CREATOR = new AutoCreator<>(DataHolder.class); } diff --git a/src/com/google/android/gms/people/internal/IPeopleCallbacks.aidl b/src/com/google/android/gms/people/internal/IPeopleCallbacks.aidl index f1f0d5fa..43d52a41 100644 --- a/src/com/google/android/gms/people/internal/IPeopleCallbacks.aidl +++ b/src/com/google/android/gms/people/internal/IPeopleCallbacks.aidl @@ -1,4 +1,7 @@ package com.google.android.gms.people.internal; +import com.google.android.gms.common.data.DataHolder; + interface IPeopleCallbacks { + void onDataHolders(int code, in Bundle meta, in DataHolder[] data) = 3; } diff --git a/src/com/google/android/gms/people/internal/IPeopleService.aidl b/src/com/google/android/gms/people/internal/IPeopleService.aidl index 8c41d3a0..15a17a33 100644 --- a/src/com/google/android/gms/people/internal/IPeopleService.aidl +++ b/src/com/google/android/gms/people/internal/IPeopleService.aidl @@ -4,32 +4,32 @@ import com.google.android.gms.people.internal.IPeopleCallbacks; import com.google.android.gms.common.server.FavaDiagnosticsEntity; interface IPeopleService { - void unknown1(); - void loadOwners1(IPeopleCallbacks var1, boolean var2, boolean var3, String var4, String var5); - void loadCirclesOld(IPeopleCallbacks var1, String var2, String var3, String var4, int var5, String var6); - void loadPeopleOld(IPeopleCallbacks var1, String var2, String var3, String var4, in List var5, int var6, boolean var7, long var8); - void loadAvatarLegacy(IPeopleCallbacks var1, String var2, int var3, int var4); - void loadContactImageLegacy(IPeopleCallbacks var1, long var2, boolean var4); - void blockPerson(IPeopleCallbacks var1, String var2, String var3, String var4, boolean var5); - Bundle syncRawContact(in Uri var1); - void loadPeopleForAggregation8(IPeopleCallbacks var1, String var2, String var3, String var4, boolean var5, int var6); - void setSyncToContactsSettings(IPeopleCallbacks var1, String var2, boolean var3, in String[] var4); - Bundle registerDataChangedListener(IPeopleCallbacks var1, boolean var2, String var3, String var4, int var5); - Bundle startSync(String var1, String var2); - void requestSync(IPeopleCallbacks var1, String var2, String var3, in Uri var4); - void updatePersonCirclesOld(IPeopleCallbacks var1, String var2, String var3, String var4, in List var5, in List var6); - void a(boolean var1); - boolean isSyncToContactsEnabled(); - Bundle requestSyncOld(String var1, String var2); - void setAvatar(IPeopleCallbacks var1, String var2, String var3, in Uri var4, boolean var5); - void loadCircles(IPeopleCallbacks var1, String var2, String var3, String var4, int var5, String var6, boolean var7); - Bundle requestSyncOld19(String var1, String var2, long var3); - void loadPeople20(IPeopleCallbacks var1, String var2, String var3, String var4, in List var5, int var6, boolean var7, long var8, String var10, int var11); - void loadPeopleLive(IPeopleCallbacks var1, String var2, String var3, String var4, int var5, String var6); - void updatePersonCircles(IPeopleCallbacks var1, String var2, String var3, String var4, in List var5, in List var6, in FavaDiagnosticsEntity var7); - void loadRemoteImageLegacy(IPeopleCallbacks var1, String var2); - void loadContactsGaiaIds24(IPeopleCallbacks var1, String var2, String var3); - Bundle requestSyncOld25(String var1, String var2, long var3, boolean var5); - void addCircle(IPeopleCallbacks var1, String var2, String var3, String var4, String var5); - void addPeopleToCircle(IPeopleCallbacks var1, String var2, String var3, String var4, in List var5); + // void loadOwners1(IPeopleCallbacks var1, boolean var2, boolean var3, String var4, String var5); + // void loadCirclesOld(IPeopleCallbacks var1, String var2, String var3, String var4, int var5, String var6); + // void loadPeopleOld(IPeopleCallbacks var1, String var2, String var3, String var4, in List var5, int var6, boolean var7, long var8); + // void loadAvatarLegacy(IPeopleCallbacks var1, String var2, int var3, int var4); + // void loadContactImageLegacy(IPeopleCallbacks var1, long var2, boolean var4); + // void blockPerson(IPeopleCallbacks var1, String var2, String var3, String var4, boolean var5); + // Bundle syncRawContact(in Uri var1); + // void loadPeopleForAggregation8(IPeopleCallbacks var1, String var2, String var3, String var4, boolean var5, int var6); + // void setSyncToContactsSettings(IPeopleCallbacks var1, String var2, boolean var3, in String[] var4); + // Bundle registerDataChangedListener(IPeopleCallbacks var1, boolean var2, String var3, String var4, int var5); + // Bundle startSync(String var1, String var2); + // void requestSync(IPeopleCallbacks var1, String var2, String var3, in Uri var4); + // void updatePersonCirclesOld(IPeopleCallbacks var1, String var2, String var3, String var4, in List var5, in List var6); + // boolean isSyncToContactsEnabled(); + // Bundle requestSyncOld(String var1, String var2); + // void setAvatar(IPeopleCallbacks var1, String var2, String var3, in Uri var4, boolean var5); + // void loadCircles(IPeopleCallbacks var1, String var2, String var3, String var4, int var5, String var6, boolean var7); + // Bundle requestSyncOld19(String var1, String var2, long var3); + // void loadPeople20(IPeopleCallbacks var1, String var2, String var3, String var4, in List var5, int var6, boolean var7, long var8, String var10, int var11); + // void loadPeopleLive(IPeopleCallbacks var1, String var2, String var3, String var4, int var5, String var6); + // void updatePersonCircles(IPeopleCallbacks var1, String var2, String var3, String var4, in List var5, in List var6, in FavaDiagnosticsEntity var7); + // void loadRemoteImageLegacy(IPeopleCallbacks var1, String var2); + // void loadContactsGaiaIds24(IPeopleCallbacks var1, String var2, String var3); + // Bundle requestSyncOld25(String var1, String var2, long var3, boolean var5); + // void addCircle(IPeopleCallbacks var1, String var2, String var3, String var4, String var5); + // void addPeopleToCircle(IPeopleCallbacks var1, String var2, String var3, String var4, in List var5); + + void loadOwners(IPeopleCallbacks callbacks, boolean var2, boolean var3, String var4, String var5, int var6) = 304; } diff --git a/src/com/google/android/gms/people/model/AccountMetadata.java b/src/com/google/android/gms/people/model/AccountMetadata.java new file mode 100644 index 00000000..943aac86 --- /dev/null +++ b/src/com/google/android/gms/people/model/AccountMetadata.java @@ -0,0 +1,28 @@ +/* + * Copyright 2013-2015 µg 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.people.model; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class AccountMetadata extends AutoSafeParcelable { + + @SafeParceled(1) + private int versionCode = 2; + + public static Creator CREATOR = new AutoCreator<>(AccountMetadata.class); +} From 4b5be5f4bb6b5e4e88a74011e8c150594769bcba Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Thu, 5 Mar 2015 23:26:08 +0100 Subject: [PATCH 048/293] Add DataHolder and SignInButtonCreator --- AndroidManifest.xml | 4 +- SafeParcel | 2 +- .../android/gms/common/data/DataHolder.java | 80 +++++++++++++++++++ .../common/internal/ISignInButtonCreator.aidl | 7 ++ .../gms/people/internal/IPeopleCallbacks.aidl | 3 +- 5 files changed, 92 insertions(+), 4 deletions(-) create mode 100644 src/com/google/android/gms/common/internal/ISignInButtonCreator.aidl diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 39f687cb..7bef5e7d 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -1,6 +1,6 @@ + package="org.microg.gms.api"> - + diff --git a/SafeParcel b/SafeParcel index a650ca5b..462316b1 160000 --- a/SafeParcel +++ b/SafeParcel @@ -1 +1 @@ -Subproject commit a650ca5beac2a374460d820935b40f9539e692db +Subproject commit 462316b18e2620bd5c0cb843abd67671d941300d diff --git a/src/com/google/android/gms/common/data/DataHolder.java b/src/com/google/android/gms/common/data/DataHolder.java index 6ec81e9e..335a004a 100644 --- a/src/com/google/android/gms/common/data/DataHolder.java +++ b/src/com/google/android/gms/common/data/DataHolder.java @@ -1,11 +1,91 @@ package com.google.android.gms.common.data; +import android.database.Cursor; +import android.database.CursorWindow; +import android.os.Bundle; + import org.microg.safeparcel.AutoSafeParcelable; import org.microg.safeparcel.SafeParceled; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +/** + * Class for accessing collections of data, organized into columns. This provides the backing + * support for DataBuffer. Much like a cursor, the holder supports the notion of a current + * position, and has methods for extracting various types of data from named columns. + */ public class DataHolder extends AutoSafeParcelable { @SafeParceled(1000) private int versionCode = 1; + @SafeParceled(1) + private String[] columns; + + @SafeParceled(2) + private CursorWindow[] windows; + + @SafeParceled(3) + private int statusCode; + + @SafeParceled(4) + private Bundle metadata; + + public DataHolder(String[] columns, CursorWindow[] windows, int statusCode, Bundle metadata) { + this.columns = columns; + this.windows = windows; + this.statusCode = statusCode; + this.metadata = metadata; + } + + + public static DataHolder fromCursor(Cursor cursor, int statusCode, Bundle metadata) { + List windows = new ArrayList<>(); + CursorWindow cursorWindow = null; + int row = 0; + while (cursor.moveToNext()) { + if (cursorWindow == null || !cursorWindow.allocRow()) { + cursorWindow = new CursorWindow(false); + cursorWindow.setNumColumns(cursor.getColumnCount()); + windows.add(cursorWindow); + row = 0; + } + for (int i = 0; i < cursor.getColumnCount(); i++) { + switch (cursor.getType(i)) { + case Cursor.FIELD_TYPE_NULL: + cursorWindow.putNull(row, i); + break; + case Cursor.FIELD_TYPE_BLOB: + cursorWindow.putBlob(cursor.getBlob(i), row, i); + break; + case Cursor.FIELD_TYPE_FLOAT: + cursorWindow.putDouble(cursor.getDouble(i), row, i); + break; + case Cursor.FIELD_TYPE_INTEGER: + cursorWindow.putLong(cursor.getLong(i), row, i); + break; + case Cursor.FIELD_TYPE_STRING: + cursorWindow.putString(cursor.getString(i), row, i); + break; + } + } + row++; + } + DataHolder dataHolder = new DataHolder(cursor.getColumnNames(), windows.toArray(new CursorWindow[windows.size()]), statusCode, metadata); + cursor.close(); + return dataHolder; + } + + @Override + public String toString() { + return "DataHolder{" + + "columns=" + Arrays.toString(columns) + + ", windows=" + Arrays.toString(windows) + + ", statusCode=" + statusCode + + ", metadata=" + metadata + + '}'; + } + public static final Creator CREATOR = new AutoCreator<>(DataHolder.class); } diff --git a/src/com/google/android/gms/common/internal/ISignInButtonCreator.aidl b/src/com/google/android/gms/common/internal/ISignInButtonCreator.aidl new file mode 100644 index 00000000..f6c53996 --- /dev/null +++ b/src/com/google/android/gms/common/internal/ISignInButtonCreator.aidl @@ -0,0 +1,7 @@ +package com.google.android.gms.common.internal; + +import com.google.android.gms.dynamic.IObjectWrapper; + +interface ISignInButtonCreator { + IObjectWrapper createSignInButton(IObjectWrapper context, int size, int color); // returns View +} diff --git a/src/com/google/android/gms/people/internal/IPeopleCallbacks.aidl b/src/com/google/android/gms/people/internal/IPeopleCallbacks.aidl index 43d52a41..8738a9ea 100644 --- a/src/com/google/android/gms/people/internal/IPeopleCallbacks.aidl +++ b/src/com/google/android/gms/people/internal/IPeopleCallbacks.aidl @@ -3,5 +3,6 @@ package com.google.android.gms.people.internal; import com.google.android.gms.common.data.DataHolder; interface IPeopleCallbacks { - void onDataHolders(int code, in Bundle meta, in DataHolder[] data) = 3; + void onDataHolder(int code, in Bundle resolution, in DataHolder holder) = 1; + void onDataHolders(int code, in Bundle resolution, in DataHolder[] holders) = 3; } From a19db96290c410e54101396b2109d47005c39eaa Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Sun, 8 Mar 2015 22:47:12 +0100 Subject: [PATCH 049/293] Fix DataHolder --- src/com/google/android/gms/common/data/DataHolder.java | 2 ++ .../google/android/gms/people/internal/IPeopleService.aidl | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/com/google/android/gms/common/data/DataHolder.java b/src/com/google/android/gms/common/data/DataHolder.java index 335a004a..75a57dd4 100644 --- a/src/com/google/android/gms/common/data/DataHolder.java +++ b/src/com/google/android/gms/common/data/DataHolder.java @@ -49,6 +49,8 @@ public class DataHolder extends AutoSafeParcelable { cursorWindow = new CursorWindow(false); cursorWindow.setNumColumns(cursor.getColumnCount()); windows.add(cursorWindow); + if (!cursorWindow.allocRow()) + throw new RuntimeException("Impossible to store Cursor in CursorWindows"); row = 0; } for (int i = 0; i < cursor.getColumnCount(); i++) { diff --git a/src/com/google/android/gms/people/internal/IPeopleService.aidl b/src/com/google/android/gms/people/internal/IPeopleService.aidl index 15a17a33..c6cd04e9 100644 --- a/src/com/google/android/gms/people/internal/IPeopleService.aidl +++ b/src/com/google/android/gms/people/internal/IPeopleService.aidl @@ -13,7 +13,7 @@ interface IPeopleService { // Bundle syncRawContact(in Uri var1); // void loadPeopleForAggregation8(IPeopleCallbacks var1, String var2, String var3, String var4, boolean var5, int var6); // void setSyncToContactsSettings(IPeopleCallbacks var1, String var2, boolean var3, in String[] var4); - // Bundle registerDataChangedListener(IPeopleCallbacks var1, boolean var2, String var3, String var4, int var5); + // Bundle startSync(String var1, String var2); // void requestSync(IPeopleCallbacks var1, String var2, String var3, in Uri var4); // void updatePersonCirclesOld(IPeopleCallbacks var1, String var2, String var3, String var4, in List var5, in List var6); @@ -31,5 +31,6 @@ interface IPeopleService { // void addCircle(IPeopleCallbacks var1, String var2, String var3, String var4, String var5); // void addPeopleToCircle(IPeopleCallbacks var1, String var2, String var3, String var4, in List var5); - void loadOwners(IPeopleCallbacks callbacks, boolean var2, boolean var3, String var4, String var5, int var6) = 304; + Bundle registerDataChangedListener(IPeopleCallbacks callbacks, boolean register, String var3, String var4, int scopes) = 10; + void loadOwners(IPeopleCallbacks callbacks, boolean var2, boolean var3, String account, String var5, int sortOrder) = 304; } From cee8188daef20716b4879be8f34c3ad730161e17 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Mon, 9 Mar 2015 02:59:35 +0100 Subject: [PATCH 050/293] Add loadOwnerAvatar() --- src/com/google/android/gms/common/internal/ICancelToken.aidl | 5 +++++ .../google/android/gms/people/internal/IPeopleService.aidl | 2 ++ 2 files changed, 7 insertions(+) create mode 100644 src/com/google/android/gms/common/internal/ICancelToken.aidl diff --git a/src/com/google/android/gms/common/internal/ICancelToken.aidl b/src/com/google/android/gms/common/internal/ICancelToken.aidl new file mode 100644 index 00000000..aebd4794 --- /dev/null +++ b/src/com/google/android/gms/common/internal/ICancelToken.aidl @@ -0,0 +1,5 @@ +package com.google.android.gms.common.internal; + +interface ICancelToken { + void cancel(); +} diff --git a/src/com/google/android/gms/people/internal/IPeopleService.aidl b/src/com/google/android/gms/people/internal/IPeopleService.aidl index c6cd04e9..e399cd02 100644 --- a/src/com/google/android/gms/people/internal/IPeopleService.aidl +++ b/src/com/google/android/gms/people/internal/IPeopleService.aidl @@ -2,6 +2,7 @@ package com.google.android.gms.people.internal; import com.google.android.gms.people.internal.IPeopleCallbacks; import com.google.android.gms.common.server.FavaDiagnosticsEntity; +import com.google.android.gms.common.internal.ICancelToken; interface IPeopleService { // void loadOwners1(IPeopleCallbacks var1, boolean var2, boolean var3, String var4, String var5); @@ -33,4 +34,5 @@ interface IPeopleService { Bundle registerDataChangedListener(IPeopleCallbacks callbacks, boolean register, String var3, String var4, int scopes) = 10; void loadOwners(IPeopleCallbacks callbacks, boolean var2, boolean var3, String account, String var5, int sortOrder) = 304; + ICancelToken loadOwnerAvatar(IPeopleCallbacks callbacks, String account, String pageId, int size, int flags) = 504; } From 1510aa1b0adeeed9dbe591b25ad75b015f968d82 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Wed, 11 Mar 2015 22:46:22 +0100 Subject: [PATCH 051/293] Start adding IAppDataSearch --- .../gms/appdatasearch/CorpusStatus.aidl | 3 ++ .../gms/appdatasearch/CorpusStatus.java | 42 +++++++++++++++ .../appdatasearch/SuggestSpecification.aidl | 3 ++ .../appdatasearch/SuggestSpecification.java | 27 ++++++++++ .../gms/appdatasearch/SuggestionResults.aidl | 3 ++ .../gms/appdatasearch/SuggestionResults.java | 51 +++++++++++++++++++ .../internal/IAppDataSearch.aidl | 10 ++++ 7 files changed, 139 insertions(+) create mode 100644 src/com/google/android/gms/appdatasearch/CorpusStatus.aidl create mode 100644 src/com/google/android/gms/appdatasearch/CorpusStatus.java create mode 100644 src/com/google/android/gms/appdatasearch/SuggestSpecification.aidl create mode 100644 src/com/google/android/gms/appdatasearch/SuggestSpecification.java create mode 100644 src/com/google/android/gms/appdatasearch/SuggestionResults.aidl create mode 100644 src/com/google/android/gms/appdatasearch/SuggestionResults.java create mode 100644 src/com/google/android/gms/appdatasearch/internal/IAppDataSearch.aidl diff --git a/src/com/google/android/gms/appdatasearch/CorpusStatus.aidl b/src/com/google/android/gms/appdatasearch/CorpusStatus.aidl new file mode 100644 index 00000000..f893aef8 --- /dev/null +++ b/src/com/google/android/gms/appdatasearch/CorpusStatus.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.appdatasearch; + +parcelable CorpusStatus; \ No newline at end of file diff --git a/src/com/google/android/gms/appdatasearch/CorpusStatus.java b/src/com/google/android/gms/appdatasearch/CorpusStatus.java new file mode 100644 index 00000000..99a4fd6d --- /dev/null +++ b/src/com/google/android/gms/appdatasearch/CorpusStatus.java @@ -0,0 +1,42 @@ +/* + * Copyright 2013-2015 µg 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.appdatasearch; + +import android.os.Bundle; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class CorpusStatus extends AutoSafeParcelable { + + @SafeParceled(1000) + private int versionCode = 2; + @SafeParceled(1) + public boolean found; + @SafeParceled(2) + public long lastIndexedSeqno; + @SafeParceled(3) + public long lastCommittedSeqno; + @SafeParceled(4) + public long committedNumDocuments; + @SafeParceled(5) + public Bundle counters; + @SafeParceled(6) + public String g; + + public static final Creator CREATOR = new AutoCreator<>(CorpusStatus.class); +} diff --git a/src/com/google/android/gms/appdatasearch/SuggestSpecification.aidl b/src/com/google/android/gms/appdatasearch/SuggestSpecification.aidl new file mode 100644 index 00000000..0b3c47ff --- /dev/null +++ b/src/com/google/android/gms/appdatasearch/SuggestSpecification.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.appdatasearch; + +parcelable SuggestSpecification; \ No newline at end of file diff --git a/src/com/google/android/gms/appdatasearch/SuggestSpecification.java b/src/com/google/android/gms/appdatasearch/SuggestSpecification.java new file mode 100644 index 00000000..e8433284 --- /dev/null +++ b/src/com/google/android/gms/appdatasearch/SuggestSpecification.java @@ -0,0 +1,27 @@ +/* + * Copyright 2013-2015 µg 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.appdatasearch; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class SuggestSpecification extends AutoSafeParcelable { + @SafeParceled(1000) + private int versionCode = 2; + + public static final Creator CREATOR = new AutoCreator<>(SuggestSpecification.class); +} diff --git a/src/com/google/android/gms/appdatasearch/SuggestionResults.aidl b/src/com/google/android/gms/appdatasearch/SuggestionResults.aidl new file mode 100644 index 00000000..57d2d63b --- /dev/null +++ b/src/com/google/android/gms/appdatasearch/SuggestionResults.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.appdatasearch; + +parcelable SuggestionResults; \ No newline at end of file diff --git a/src/com/google/android/gms/appdatasearch/SuggestionResults.java b/src/com/google/android/gms/appdatasearch/SuggestionResults.java new file mode 100644 index 00000000..83818551 --- /dev/null +++ b/src/com/google/android/gms/appdatasearch/SuggestionResults.java @@ -0,0 +1,51 @@ +/* + * Copyright 2013-2015 µg 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.appdatasearch; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class SuggestionResults extends AutoSafeParcelable { + @SafeParceled(1000) + private int versionCode = 2; + @SafeParceled(1) + public final String errorMessage; + + @SafeParceled(2) + public final String[] s1; + @SafeParceled(3) + public final String[] s2; + + private SuggestionResults() { + errorMessage = null; + s1 = s2 = null; + } + + public SuggestionResults(String errorMessage) { + this.errorMessage = errorMessage; + this.s1 = null; + this.s2 = null; + } + + public SuggestionResults(String[] s1, String[] s2) { + this.errorMessage = null; + this.s1 = s1; + this.s2 = s2; + } + + public static final Creator CREATOR = new AutoCreator<>(SuggestionResults.class); +} diff --git a/src/com/google/android/gms/appdatasearch/internal/IAppDataSearch.aidl b/src/com/google/android/gms/appdatasearch/internal/IAppDataSearch.aidl new file mode 100644 index 00000000..37a6a905 --- /dev/null +++ b/src/com/google/android/gms/appdatasearch/internal/IAppDataSearch.aidl @@ -0,0 +1,10 @@ +package com.google.android.gms.appdatasearch.internal; + +import com.google.android.gms.appdatasearch.CorpusStatus; +import com.google.android.gms.appdatasearch.SuggestionResults; +import com.google.android.gms.appdatasearch.SuggestSpecification; + +interface IAppDataSearch { + SuggestionResults getSuggestions(String var1, String packageName, in String[] accounts, int maxNum, in SuggestSpecification specs) = 1; + CorpusStatus getStatus(String packageName, String accountName) = 4; +} From 32663c095b2539fe8feae0afece83272815327a6 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Fri, 13 Mar 2015 00:13:22 +0100 Subject: [PATCH 052/293] Switch to gradle/maven project structure --- build.gradle | 11 +---- .../main/AndroidManifest.xml | 0 .../android/auth/IAuthManagerService.aidl | 0 .../gms/appdatasearch/CorpusStatus.aidl | 0 .../appdatasearch/SuggestSpecification.aidl | 0 .../gms/appdatasearch/SuggestionResults.aidl | 0 .../android/gms/appdatasearch/UsageInfo.aidl | 0 .../internal/IAppDataSearch.aidl | 0 .../internal/ILightweightAppDataSearch.aidl | 0 .../ILightweightAppDataSearchCallbacks.aidl | 0 .../gms/auth/AccountChangeEventsRequest.aidl | 0 .../gms/auth/AccountChangeEventsResponse.aidl | 0 .../android/gms/common/data/DataHolder.aidl | 0 .../gms/common/internal/ICancelToken.aidl | 0 .../gms/common/internal/IGmsCallbacks.aidl | 0 .../common/internal/IGmsServiceBroker.aidl | 0 .../common/internal/ISignInButtonCreator.aidl | 0 .../common/server/FavaDiagnosticsEntity.aidl | 0 .../android/gms/dynamic/IObjectWrapper.aidl | 0 .../google/android/gms/location/Geofence.aidl | 0 .../gms/location/GeofencingRequest.aidl | 0 .../gms/location/ILocationListener.aidl | 0 .../android/gms/location/LocationRequest.aidl | 0 .../android/gms/location/LocationStatus.aidl | 0 .../internal/IGeofencerCallbacks.aidl | 0 .../IGoogleLocationManagerService.aidl | 0 .../internal/LocationRequestInternal.aidl | 0 .../location/places/AutocompleteFilter.aidl | 0 .../location/places/NearbyAlertRequest.aidl | 0 .../gms/location/places/PlaceFilter.aidl | 0 .../gms/location/places/PlaceReport.aidl | 0 .../gms/location/places/PlaceRequest.aidl | 0 .../gms/location/places/UserAddedPlace.aidl | 0 .../gms/location/places/UserDataType.aidl | 0 .../places/internal/IPlacesCallbacks.aidl | 0 .../places/internal/PlacesParams.aidl | 0 .../location/reporting/ReportingState.aidl | 0 .../reporting/internal/IReportingService.aidl | 0 .../android/gms/maps/GoogleMapOptions.aidl | 0 .../ICameraUpdateFactoryDelegate.aidl | 0 .../maps/internal/ICancelableCallback.aidl | 0 .../android/gms/maps/internal/ICreator.aidl | 0 .../gms/maps/internal/IGoogleMapDelegate.aidl | 0 .../gms/maps/internal/IInfoWindowAdapter.aidl | 0 .../internal/ILocationSourceDelegate.aidl | 0 .../maps/internal/IMapFragmentDelegate.aidl | 0 .../gms/maps/internal/IMapViewDelegate.aidl | 0 .../internal/IOnCameraChangeListener.aidl | 0 .../internal/IOnInfoWindowClickListener.aidl | 0 .../maps/internal/IOnMapClickListener.aidl | 0 .../maps/internal/IOnMapLoadedCallback.aidl | 0 .../internal/IOnMapLongClickListener.aidl | 0 .../maps/internal/IOnMarkerClickListener.aidl | 0 .../maps/internal/IOnMarkerDragListener.aidl | 0 .../IOnMyLocationButtonClickListener.aidl | 0 .../internal/IOnMyLocationChangeListener.aidl | 0 .../maps/internal/IProjectionDelegate.aidl | 0 .../maps/internal/ISnapshotReadyCallback.aidl | 0 .../maps/internal/IUiSettingsDelegate.aidl | 0 .../gms/maps/model/CameraPosition.aidl | 0 .../android/gms/maps/model/CircleOptions.aidl | 0 .../gms/maps/model/GroundOverlayOptions.aidl | 0 .../google/android/gms/maps/model/LatLng.aidl | 0 .../android/gms/maps/model/LatLngBounds.aidl | 0 .../android/gms/maps/model/MarkerOptions.aidl | 0 .../gms/maps/model/PolygonOptions.aidl | 0 .../gms/maps/model/PolylineOptions.aidl | 0 .../google/android/gms/maps/model/Tile.aidl | 0 .../gms/maps/model/TileOverlayOptions.aidl | 0 .../android/gms/maps/model/VisibleRegion.aidl | 0 .../IBitmapDescriptorFactoryDelegate.aidl | 0 .../maps/model/internal/ICircleDelegate.aidl | 0 .../internal/IGroundOverlayDelegate.aidl | 0 .../maps/model/internal/IMarkerDelegate.aidl | 0 .../maps/model/internal/IPolygonDelegate.aidl | 0 .../model/internal/IPolylineDelegate.aidl | 0 .../model/internal/ITileOverlayDelegate.aidl | 0 .../model/internal/ITileProviderDelegate.aidl | 0 .../gms/people/internal/IPeopleCallbacks.aidl | 0 .../gms/people/internal/IPeopleService.aidl | 0 .../plus/internal/IPlusOneButtonCreator.aidl | 0 .../gms/appdatasearch/CorpusStatus.java | 0 .../appdatasearch/SuggestSpecification.java | 0 .../gms/appdatasearch/SuggestionResults.java | 0 .../android/gms/appdatasearch/UsageInfo.java | 0 .../android/gms/auth/AccountChangeEvent.java | 0 .../gms/auth/AccountChangeEventsRequest.java | 0 .../gms/auth/AccountChangeEventsResponse.java | 0 .../firstparty/dataservice/TokenRequest.java | 0 .../firstparty/dataservice/TokenResponse.java | 0 .../firstparty/proximity/data/Permit.java | 0 .../com/google/android/gms/common/Scopes.java | 0 .../android/gms/common/api/AccountInfo.java | 0 .../gms/common/api/CommonStatusCodes.java | 0 .../google/android/gms/common/api/Result.java | 0 .../google/android/gms/common/api/Scope.java | 0 .../google/android/gms/common/api/Status.java | 0 .../android/gms/common/data/DataHolder.java | 46 ++++++++++++++++--- .../common/server/FavaDiagnosticsEntity.java | 0 .../metadata/internal/MetadataBundle.java | 0 .../android/gms/dynamic/ObjectWrapper.java | 0 .../android/gms/fitness/data/DataPoint.java | 0 .../android/gms/fitness/data/Device.java | 0 .../android/gms/fitness/data/Field.java | 0 .../android/gms/fitness/data/Value.java | 0 .../identity/accounts/api/AccountData.java | 0 .../intents/model/CountrySpecification.java | 0 .../identity/intents/model/UserAddress.java | 0 .../google/android/gms/location/Geofence.java | 0 .../gms/location/GeofencingRequest.java | 0 .../android/gms/location/LocationRequest.java | 0 .../android/gms/location/LocationStatus.java | 0 .../gms/location/internal/ClientIdentity.java | 0 .../internal/LocationRequestInternal.java | 0 .../location/places/AutocompleteFilter.java | 0 .../location/places/NearbyAlertRequest.java | 0 .../gms/location/places/PlaceFilter.java | 0 .../gms/location/places/PlaceReport.java | 0 .../gms/location/places/PlaceRequest.java | 0 .../gms/location/places/UserAddedPlace.java | 0 .../gms/location/places/UserDataType.java | 0 .../places/internal/PlacesParams.java | 0 .../location/reporting/ReportingState.java | 0 .../android/gms/maps/GoogleMapOptions.java | 0 .../gms/maps/StreetViewPanoramaOptions.java | 0 .../android/gms/maps/internal/Point.java | 0 .../gms/maps/model/BitmapDescriptor.java | 0 .../gms/maps/model/CameraPosition.java | 0 .../android/gms/maps/model/CircleOptions.java | 0 .../gms/maps/model/GroundOverlayOptions.java | 0 .../google/android/gms/maps/model/LatLng.java | 0 .../android/gms/maps/model/LatLngBounds.java | 0 .../android/gms/maps/model/MarkerOptions.java | 0 .../gms/maps/model/PolygonOptions.java | 0 .../gms/maps/model/PolylineOptions.java | 0 .../maps/model/StreetViewPanoramaCamera.java | 0 .../maps/model/StreetViewPanoramaLink.java | 0 .../model/StreetViewPanoramaLocation.java | 0 .../model/StreetViewPanoramaOrientation.java | 0 .../google/android/gms/maps/model/Tile.java | 0 .../gms/maps/model/TileOverlayOptions.java | 0 .../android/gms/maps/model/TileProvider.java | 0 .../android/gms/maps/model/VisibleRegion.java | 0 .../android/gms/maps/model/package-info.java | 0 .../gms/people/model/AccountMetadata.java | 0 .../gms/plus/internal/PlusCommonExtras.java | 0 .../gms/plus/internal/PlusSession.java | 0 .../model/smart_profile/CardsRequest.java | 0 .../model/smart_profile/CardsResponse.java | 0 .../PeopleForProfilesRequest.java | 0 .../PeopleForProfilesResponse.java | 0 .../android/gms/plus/model/posts/Comment.java | 0 .../android/gms/plus/model/posts/Post.java | 0 .../gms/plus/model/posts/Settings.java | 0 .../gms/wearable/ConnectionConfiguration.java | 0 .../com/google/android/gms/wearable/Node.java | 0 .../gms/wearable/WearableStatusCodes.java | 0 .../gms/wearable/internal/NodeParcelable.java | 0 .../org/microg/gms/common/Constants.java | 0 .../org/microg/gms/common/PublicApi.java | 0 160 files changed, 41 insertions(+), 16 deletions(-) rename AndroidManifest.xml => src/main/AndroidManifest.xml (100%) rename src/{ => main/aidl}/com/google/android/auth/IAuthManagerService.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/appdatasearch/CorpusStatus.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/appdatasearch/SuggestSpecification.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/appdatasearch/SuggestionResults.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/appdatasearch/UsageInfo.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/appdatasearch/internal/IAppDataSearch.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/appdatasearch/internal/ILightweightAppDataSearch.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/appdatasearch/internal/ILightweightAppDataSearchCallbacks.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/auth/AccountChangeEventsRequest.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/auth/AccountChangeEventsResponse.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/common/data/DataHolder.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/common/internal/ICancelToken.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/common/internal/IGmsCallbacks.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/common/internal/IGmsServiceBroker.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/common/internal/ISignInButtonCreator.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/common/server/FavaDiagnosticsEntity.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/dynamic/IObjectWrapper.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/location/Geofence.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/location/GeofencingRequest.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/location/ILocationListener.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/location/LocationRequest.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/location/LocationStatus.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/location/internal/IGeofencerCallbacks.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/location/internal/IGoogleLocationManagerService.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/location/internal/LocationRequestInternal.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/location/places/AutocompleteFilter.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/location/places/NearbyAlertRequest.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/location/places/PlaceFilter.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/location/places/PlaceReport.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/location/places/PlaceRequest.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/location/places/UserAddedPlace.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/location/places/UserDataType.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/location/places/internal/IPlacesCallbacks.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/location/places/internal/PlacesParams.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/location/reporting/ReportingState.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/location/reporting/internal/IReportingService.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/maps/GoogleMapOptions.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/maps/internal/ICameraUpdateFactoryDelegate.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/maps/internal/ICancelableCallback.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/maps/internal/ICreator.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/maps/internal/IGoogleMapDelegate.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/maps/internal/IInfoWindowAdapter.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/maps/internal/ILocationSourceDelegate.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/maps/internal/IMapFragmentDelegate.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/maps/internal/IMapViewDelegate.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/maps/internal/IOnCameraChangeListener.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/maps/internal/IOnInfoWindowClickListener.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/maps/internal/IOnMapClickListener.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/maps/internal/IOnMapLoadedCallback.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/maps/internal/IOnMapLongClickListener.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/maps/internal/IOnMarkerClickListener.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/maps/internal/IOnMarkerDragListener.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/maps/internal/IOnMyLocationButtonClickListener.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/maps/internal/IOnMyLocationChangeListener.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/maps/internal/IProjectionDelegate.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/maps/internal/ISnapshotReadyCallback.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/maps/internal/IUiSettingsDelegate.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/maps/model/CameraPosition.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/maps/model/CircleOptions.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/maps/model/GroundOverlayOptions.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/maps/model/LatLng.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/maps/model/LatLngBounds.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/maps/model/MarkerOptions.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/maps/model/PolygonOptions.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/maps/model/PolylineOptions.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/maps/model/Tile.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/maps/model/TileOverlayOptions.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/maps/model/VisibleRegion.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/maps/model/internal/IBitmapDescriptorFactoryDelegate.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/maps/model/internal/ICircleDelegate.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/maps/model/internal/IGroundOverlayDelegate.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/maps/model/internal/IMarkerDelegate.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/maps/model/internal/IPolygonDelegate.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/maps/model/internal/IPolylineDelegate.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/maps/model/internal/ITileOverlayDelegate.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/maps/model/internal/ITileProviderDelegate.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/people/internal/IPeopleCallbacks.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/people/internal/IPeopleService.aidl (100%) rename src/{ => main/aidl}/com/google/android/gms/plus/internal/IPlusOneButtonCreator.aidl (100%) rename src/{ => main/java}/com/google/android/gms/appdatasearch/CorpusStatus.java (100%) rename src/{ => main/java}/com/google/android/gms/appdatasearch/SuggestSpecification.java (100%) rename src/{ => main/java}/com/google/android/gms/appdatasearch/SuggestionResults.java (100%) rename src/{ => main/java}/com/google/android/gms/appdatasearch/UsageInfo.java (100%) rename src/{ => main/java}/com/google/android/gms/auth/AccountChangeEvent.java (100%) rename src/{ => main/java}/com/google/android/gms/auth/AccountChangeEventsRequest.java (100%) rename src/{ => main/java}/com/google/android/gms/auth/AccountChangeEventsResponse.java (100%) rename src/{ => main/java}/com/google/android/gms/auth/firstparty/dataservice/TokenRequest.java (100%) rename src/{ => main/java}/com/google/android/gms/auth/firstparty/dataservice/TokenResponse.java (100%) rename src/{ => main/java}/com/google/android/gms/auth/firstparty/proximity/data/Permit.java (100%) rename src/{ => main/java}/com/google/android/gms/common/Scopes.java (100%) rename src/{ => main/java}/com/google/android/gms/common/api/AccountInfo.java (100%) rename src/{ => main/java}/com/google/android/gms/common/api/CommonStatusCodes.java (100%) rename src/{ => main/java}/com/google/android/gms/common/api/Result.java (100%) rename src/{ => main/java}/com/google/android/gms/common/api/Scope.java (100%) rename src/{ => main/java}/com/google/android/gms/common/api/Status.java (100%) rename src/{ => main/java}/com/google/android/gms/common/data/DataHolder.java (64%) rename src/{ => main/java}/com/google/android/gms/common/server/FavaDiagnosticsEntity.java (100%) rename src/{ => main/java}/com/google/android/gms/drive/metadata/internal/MetadataBundle.java (100%) rename src/{ => main/java}/com/google/android/gms/dynamic/ObjectWrapper.java (100%) rename src/{ => main/java}/com/google/android/gms/fitness/data/DataPoint.java (100%) rename src/{ => main/java}/com/google/android/gms/fitness/data/Device.java (100%) rename src/{ => main/java}/com/google/android/gms/fitness/data/Field.java (100%) rename src/{ => main/java}/com/google/android/gms/fitness/data/Value.java (100%) rename src/{ => main/java}/com/google/android/gms/identity/accounts/api/AccountData.java (100%) rename src/{ => main/java}/com/google/android/gms/identity/intents/model/CountrySpecification.java (100%) rename src/{ => main/java}/com/google/android/gms/identity/intents/model/UserAddress.java (100%) rename src/{ => main/java}/com/google/android/gms/location/Geofence.java (100%) rename src/{ => main/java}/com/google/android/gms/location/GeofencingRequest.java (100%) rename src/{ => main/java}/com/google/android/gms/location/LocationRequest.java (100%) rename src/{ => main/java}/com/google/android/gms/location/LocationStatus.java (100%) rename src/{ => main/java}/com/google/android/gms/location/internal/ClientIdentity.java (100%) rename src/{ => main/java}/com/google/android/gms/location/internal/LocationRequestInternal.java (100%) rename src/{ => main/java}/com/google/android/gms/location/places/AutocompleteFilter.java (100%) rename src/{ => main/java}/com/google/android/gms/location/places/NearbyAlertRequest.java (100%) rename src/{ => main/java}/com/google/android/gms/location/places/PlaceFilter.java (100%) rename src/{ => main/java}/com/google/android/gms/location/places/PlaceReport.java (100%) rename src/{ => main/java}/com/google/android/gms/location/places/PlaceRequest.java (100%) rename src/{ => main/java}/com/google/android/gms/location/places/UserAddedPlace.java (100%) rename src/{ => main/java}/com/google/android/gms/location/places/UserDataType.java (100%) rename src/{ => main/java}/com/google/android/gms/location/places/internal/PlacesParams.java (100%) rename src/{ => main/java}/com/google/android/gms/location/reporting/ReportingState.java (100%) rename src/{ => main/java}/com/google/android/gms/maps/GoogleMapOptions.java (100%) rename src/{ => main/java}/com/google/android/gms/maps/StreetViewPanoramaOptions.java (100%) rename src/{ => main/java}/com/google/android/gms/maps/internal/Point.java (100%) rename src/{ => main/java}/com/google/android/gms/maps/model/BitmapDescriptor.java (100%) rename src/{ => main/java}/com/google/android/gms/maps/model/CameraPosition.java (100%) rename src/{ => main/java}/com/google/android/gms/maps/model/CircleOptions.java (100%) rename src/{ => main/java}/com/google/android/gms/maps/model/GroundOverlayOptions.java (100%) rename src/{ => main/java}/com/google/android/gms/maps/model/LatLng.java (100%) rename src/{ => main/java}/com/google/android/gms/maps/model/LatLngBounds.java (100%) rename src/{ => main/java}/com/google/android/gms/maps/model/MarkerOptions.java (100%) rename src/{ => main/java}/com/google/android/gms/maps/model/PolygonOptions.java (100%) rename src/{ => main/java}/com/google/android/gms/maps/model/PolylineOptions.java (100%) rename src/{ => main/java}/com/google/android/gms/maps/model/StreetViewPanoramaCamera.java (100%) rename src/{ => main/java}/com/google/android/gms/maps/model/StreetViewPanoramaLink.java (100%) rename src/{ => main/java}/com/google/android/gms/maps/model/StreetViewPanoramaLocation.java (100%) rename src/{ => main/java}/com/google/android/gms/maps/model/StreetViewPanoramaOrientation.java (100%) rename src/{ => main/java}/com/google/android/gms/maps/model/Tile.java (100%) rename src/{ => main/java}/com/google/android/gms/maps/model/TileOverlayOptions.java (100%) rename src/{ => main/java}/com/google/android/gms/maps/model/TileProvider.java (100%) rename src/{ => main/java}/com/google/android/gms/maps/model/VisibleRegion.java (100%) rename src/{ => main/java}/com/google/android/gms/maps/model/package-info.java (100%) rename src/{ => main/java}/com/google/android/gms/people/model/AccountMetadata.java (100%) rename src/{ => main/java}/com/google/android/gms/plus/internal/PlusCommonExtras.java (100%) rename src/{ => main/java}/com/google/android/gms/plus/internal/PlusSession.java (100%) rename src/{ => main/java}/com/google/android/gms/plus/internal/model/smart_profile/CardsRequest.java (100%) rename src/{ => main/java}/com/google/android/gms/plus/internal/model/smart_profile/CardsResponse.java (100%) rename src/{ => main/java}/com/google/android/gms/plus/internal/model/smart_profile/PeopleForProfilesRequest.java (100%) rename src/{ => main/java}/com/google/android/gms/plus/internal/model/smart_profile/PeopleForProfilesResponse.java (100%) rename src/{ => main/java}/com/google/android/gms/plus/model/posts/Comment.java (100%) rename src/{ => main/java}/com/google/android/gms/plus/model/posts/Post.java (100%) rename src/{ => main/java}/com/google/android/gms/plus/model/posts/Settings.java (100%) rename src/{ => main/java}/com/google/android/gms/wearable/ConnectionConfiguration.java (100%) rename src/{ => main/java}/com/google/android/gms/wearable/Node.java (100%) rename src/{ => main/java}/com/google/android/gms/wearable/WearableStatusCodes.java (100%) rename src/{ => main/java}/com/google/android/gms/wearable/internal/NodeParcelable.java (100%) rename src/{ => main/java}/org/microg/gms/common/Constants.java (100%) rename src/{ => main/java}/org/microg/gms/common/PublicApi.java (100%) diff --git a/build.gradle b/build.gradle index eb5bd3cb..48491609 100644 --- a/build.gradle +++ b/build.gradle @@ -10,19 +10,10 @@ buildscript { apply plugin: 'com.android.library' dependencies { - compile project(':SafeParcel') + compile project('SafeParcel') } android { compileSdkVersion 21 buildToolsVersion "21.1.2" - lintOptions.abortOnError false - - sourceSets { - main { - manifest.srcFile 'AndroidManifest.xml' - java.srcDirs = ['src'] - aidl.srcDirs = ['src'] - } - } } diff --git a/AndroidManifest.xml b/src/main/AndroidManifest.xml similarity index 100% rename from AndroidManifest.xml rename to src/main/AndroidManifest.xml diff --git a/src/com/google/android/auth/IAuthManagerService.aidl b/src/main/aidl/com/google/android/auth/IAuthManagerService.aidl similarity index 100% rename from src/com/google/android/auth/IAuthManagerService.aidl rename to src/main/aidl/com/google/android/auth/IAuthManagerService.aidl diff --git a/src/com/google/android/gms/appdatasearch/CorpusStatus.aidl b/src/main/aidl/com/google/android/gms/appdatasearch/CorpusStatus.aidl similarity index 100% rename from src/com/google/android/gms/appdatasearch/CorpusStatus.aidl rename to src/main/aidl/com/google/android/gms/appdatasearch/CorpusStatus.aidl diff --git a/src/com/google/android/gms/appdatasearch/SuggestSpecification.aidl b/src/main/aidl/com/google/android/gms/appdatasearch/SuggestSpecification.aidl similarity index 100% rename from src/com/google/android/gms/appdatasearch/SuggestSpecification.aidl rename to src/main/aidl/com/google/android/gms/appdatasearch/SuggestSpecification.aidl diff --git a/src/com/google/android/gms/appdatasearch/SuggestionResults.aidl b/src/main/aidl/com/google/android/gms/appdatasearch/SuggestionResults.aidl similarity index 100% rename from src/com/google/android/gms/appdatasearch/SuggestionResults.aidl rename to src/main/aidl/com/google/android/gms/appdatasearch/SuggestionResults.aidl diff --git a/src/com/google/android/gms/appdatasearch/UsageInfo.aidl b/src/main/aidl/com/google/android/gms/appdatasearch/UsageInfo.aidl similarity index 100% rename from src/com/google/android/gms/appdatasearch/UsageInfo.aidl rename to src/main/aidl/com/google/android/gms/appdatasearch/UsageInfo.aidl diff --git a/src/com/google/android/gms/appdatasearch/internal/IAppDataSearch.aidl b/src/main/aidl/com/google/android/gms/appdatasearch/internal/IAppDataSearch.aidl similarity index 100% rename from src/com/google/android/gms/appdatasearch/internal/IAppDataSearch.aidl rename to src/main/aidl/com/google/android/gms/appdatasearch/internal/IAppDataSearch.aidl diff --git a/src/com/google/android/gms/appdatasearch/internal/ILightweightAppDataSearch.aidl b/src/main/aidl/com/google/android/gms/appdatasearch/internal/ILightweightAppDataSearch.aidl similarity index 100% rename from src/com/google/android/gms/appdatasearch/internal/ILightweightAppDataSearch.aidl rename to src/main/aidl/com/google/android/gms/appdatasearch/internal/ILightweightAppDataSearch.aidl diff --git a/src/com/google/android/gms/appdatasearch/internal/ILightweightAppDataSearchCallbacks.aidl b/src/main/aidl/com/google/android/gms/appdatasearch/internal/ILightweightAppDataSearchCallbacks.aidl similarity index 100% rename from src/com/google/android/gms/appdatasearch/internal/ILightweightAppDataSearchCallbacks.aidl rename to src/main/aidl/com/google/android/gms/appdatasearch/internal/ILightweightAppDataSearchCallbacks.aidl diff --git a/src/com/google/android/gms/auth/AccountChangeEventsRequest.aidl b/src/main/aidl/com/google/android/gms/auth/AccountChangeEventsRequest.aidl similarity index 100% rename from src/com/google/android/gms/auth/AccountChangeEventsRequest.aidl rename to src/main/aidl/com/google/android/gms/auth/AccountChangeEventsRequest.aidl diff --git a/src/com/google/android/gms/auth/AccountChangeEventsResponse.aidl b/src/main/aidl/com/google/android/gms/auth/AccountChangeEventsResponse.aidl similarity index 100% rename from src/com/google/android/gms/auth/AccountChangeEventsResponse.aidl rename to src/main/aidl/com/google/android/gms/auth/AccountChangeEventsResponse.aidl diff --git a/src/com/google/android/gms/common/data/DataHolder.aidl b/src/main/aidl/com/google/android/gms/common/data/DataHolder.aidl similarity index 100% rename from src/com/google/android/gms/common/data/DataHolder.aidl rename to src/main/aidl/com/google/android/gms/common/data/DataHolder.aidl diff --git a/src/com/google/android/gms/common/internal/ICancelToken.aidl b/src/main/aidl/com/google/android/gms/common/internal/ICancelToken.aidl similarity index 100% rename from src/com/google/android/gms/common/internal/ICancelToken.aidl rename to src/main/aidl/com/google/android/gms/common/internal/ICancelToken.aidl diff --git a/src/com/google/android/gms/common/internal/IGmsCallbacks.aidl b/src/main/aidl/com/google/android/gms/common/internal/IGmsCallbacks.aidl similarity index 100% rename from src/com/google/android/gms/common/internal/IGmsCallbacks.aidl rename to src/main/aidl/com/google/android/gms/common/internal/IGmsCallbacks.aidl diff --git a/src/com/google/android/gms/common/internal/IGmsServiceBroker.aidl b/src/main/aidl/com/google/android/gms/common/internal/IGmsServiceBroker.aidl similarity index 100% rename from src/com/google/android/gms/common/internal/IGmsServiceBroker.aidl rename to src/main/aidl/com/google/android/gms/common/internal/IGmsServiceBroker.aidl diff --git a/src/com/google/android/gms/common/internal/ISignInButtonCreator.aidl b/src/main/aidl/com/google/android/gms/common/internal/ISignInButtonCreator.aidl similarity index 100% rename from src/com/google/android/gms/common/internal/ISignInButtonCreator.aidl rename to src/main/aidl/com/google/android/gms/common/internal/ISignInButtonCreator.aidl diff --git a/src/com/google/android/gms/common/server/FavaDiagnosticsEntity.aidl b/src/main/aidl/com/google/android/gms/common/server/FavaDiagnosticsEntity.aidl similarity index 100% rename from src/com/google/android/gms/common/server/FavaDiagnosticsEntity.aidl rename to src/main/aidl/com/google/android/gms/common/server/FavaDiagnosticsEntity.aidl diff --git a/src/com/google/android/gms/dynamic/IObjectWrapper.aidl b/src/main/aidl/com/google/android/gms/dynamic/IObjectWrapper.aidl similarity index 100% rename from src/com/google/android/gms/dynamic/IObjectWrapper.aidl rename to src/main/aidl/com/google/android/gms/dynamic/IObjectWrapper.aidl diff --git a/src/com/google/android/gms/location/Geofence.aidl b/src/main/aidl/com/google/android/gms/location/Geofence.aidl similarity index 100% rename from src/com/google/android/gms/location/Geofence.aidl rename to src/main/aidl/com/google/android/gms/location/Geofence.aidl diff --git a/src/com/google/android/gms/location/GeofencingRequest.aidl b/src/main/aidl/com/google/android/gms/location/GeofencingRequest.aidl similarity index 100% rename from src/com/google/android/gms/location/GeofencingRequest.aidl rename to src/main/aidl/com/google/android/gms/location/GeofencingRequest.aidl diff --git a/src/com/google/android/gms/location/ILocationListener.aidl b/src/main/aidl/com/google/android/gms/location/ILocationListener.aidl similarity index 100% rename from src/com/google/android/gms/location/ILocationListener.aidl rename to src/main/aidl/com/google/android/gms/location/ILocationListener.aidl diff --git a/src/com/google/android/gms/location/LocationRequest.aidl b/src/main/aidl/com/google/android/gms/location/LocationRequest.aidl similarity index 100% rename from src/com/google/android/gms/location/LocationRequest.aidl rename to src/main/aidl/com/google/android/gms/location/LocationRequest.aidl diff --git a/src/com/google/android/gms/location/LocationStatus.aidl b/src/main/aidl/com/google/android/gms/location/LocationStatus.aidl similarity index 100% rename from src/com/google/android/gms/location/LocationStatus.aidl rename to src/main/aidl/com/google/android/gms/location/LocationStatus.aidl diff --git a/src/com/google/android/gms/location/internal/IGeofencerCallbacks.aidl b/src/main/aidl/com/google/android/gms/location/internal/IGeofencerCallbacks.aidl similarity index 100% rename from src/com/google/android/gms/location/internal/IGeofencerCallbacks.aidl rename to src/main/aidl/com/google/android/gms/location/internal/IGeofencerCallbacks.aidl diff --git a/src/com/google/android/gms/location/internal/IGoogleLocationManagerService.aidl b/src/main/aidl/com/google/android/gms/location/internal/IGoogleLocationManagerService.aidl similarity index 100% rename from src/com/google/android/gms/location/internal/IGoogleLocationManagerService.aidl rename to src/main/aidl/com/google/android/gms/location/internal/IGoogleLocationManagerService.aidl diff --git a/src/com/google/android/gms/location/internal/LocationRequestInternal.aidl b/src/main/aidl/com/google/android/gms/location/internal/LocationRequestInternal.aidl similarity index 100% rename from src/com/google/android/gms/location/internal/LocationRequestInternal.aidl rename to src/main/aidl/com/google/android/gms/location/internal/LocationRequestInternal.aidl diff --git a/src/com/google/android/gms/location/places/AutocompleteFilter.aidl b/src/main/aidl/com/google/android/gms/location/places/AutocompleteFilter.aidl similarity index 100% rename from src/com/google/android/gms/location/places/AutocompleteFilter.aidl rename to src/main/aidl/com/google/android/gms/location/places/AutocompleteFilter.aidl diff --git a/src/com/google/android/gms/location/places/NearbyAlertRequest.aidl b/src/main/aidl/com/google/android/gms/location/places/NearbyAlertRequest.aidl similarity index 100% rename from src/com/google/android/gms/location/places/NearbyAlertRequest.aidl rename to src/main/aidl/com/google/android/gms/location/places/NearbyAlertRequest.aidl diff --git a/src/com/google/android/gms/location/places/PlaceFilter.aidl b/src/main/aidl/com/google/android/gms/location/places/PlaceFilter.aidl similarity index 100% rename from src/com/google/android/gms/location/places/PlaceFilter.aidl rename to src/main/aidl/com/google/android/gms/location/places/PlaceFilter.aidl diff --git a/src/com/google/android/gms/location/places/PlaceReport.aidl b/src/main/aidl/com/google/android/gms/location/places/PlaceReport.aidl similarity index 100% rename from src/com/google/android/gms/location/places/PlaceReport.aidl rename to src/main/aidl/com/google/android/gms/location/places/PlaceReport.aidl diff --git a/src/com/google/android/gms/location/places/PlaceRequest.aidl b/src/main/aidl/com/google/android/gms/location/places/PlaceRequest.aidl similarity index 100% rename from src/com/google/android/gms/location/places/PlaceRequest.aidl rename to src/main/aidl/com/google/android/gms/location/places/PlaceRequest.aidl diff --git a/src/com/google/android/gms/location/places/UserAddedPlace.aidl b/src/main/aidl/com/google/android/gms/location/places/UserAddedPlace.aidl similarity index 100% rename from src/com/google/android/gms/location/places/UserAddedPlace.aidl rename to src/main/aidl/com/google/android/gms/location/places/UserAddedPlace.aidl diff --git a/src/com/google/android/gms/location/places/UserDataType.aidl b/src/main/aidl/com/google/android/gms/location/places/UserDataType.aidl similarity index 100% rename from src/com/google/android/gms/location/places/UserDataType.aidl rename to src/main/aidl/com/google/android/gms/location/places/UserDataType.aidl diff --git a/src/com/google/android/gms/location/places/internal/IPlacesCallbacks.aidl b/src/main/aidl/com/google/android/gms/location/places/internal/IPlacesCallbacks.aidl similarity index 100% rename from src/com/google/android/gms/location/places/internal/IPlacesCallbacks.aidl rename to src/main/aidl/com/google/android/gms/location/places/internal/IPlacesCallbacks.aidl diff --git a/src/com/google/android/gms/location/places/internal/PlacesParams.aidl b/src/main/aidl/com/google/android/gms/location/places/internal/PlacesParams.aidl similarity index 100% rename from src/com/google/android/gms/location/places/internal/PlacesParams.aidl rename to src/main/aidl/com/google/android/gms/location/places/internal/PlacesParams.aidl diff --git a/src/com/google/android/gms/location/reporting/ReportingState.aidl b/src/main/aidl/com/google/android/gms/location/reporting/ReportingState.aidl similarity index 100% rename from src/com/google/android/gms/location/reporting/ReportingState.aidl rename to src/main/aidl/com/google/android/gms/location/reporting/ReportingState.aidl diff --git a/src/com/google/android/gms/location/reporting/internal/IReportingService.aidl b/src/main/aidl/com/google/android/gms/location/reporting/internal/IReportingService.aidl similarity index 100% rename from src/com/google/android/gms/location/reporting/internal/IReportingService.aidl rename to src/main/aidl/com/google/android/gms/location/reporting/internal/IReportingService.aidl diff --git a/src/com/google/android/gms/maps/GoogleMapOptions.aidl b/src/main/aidl/com/google/android/gms/maps/GoogleMapOptions.aidl similarity index 100% rename from src/com/google/android/gms/maps/GoogleMapOptions.aidl rename to src/main/aidl/com/google/android/gms/maps/GoogleMapOptions.aidl diff --git a/src/com/google/android/gms/maps/internal/ICameraUpdateFactoryDelegate.aidl b/src/main/aidl/com/google/android/gms/maps/internal/ICameraUpdateFactoryDelegate.aidl similarity index 100% rename from src/com/google/android/gms/maps/internal/ICameraUpdateFactoryDelegate.aidl rename to src/main/aidl/com/google/android/gms/maps/internal/ICameraUpdateFactoryDelegate.aidl diff --git a/src/com/google/android/gms/maps/internal/ICancelableCallback.aidl b/src/main/aidl/com/google/android/gms/maps/internal/ICancelableCallback.aidl similarity index 100% rename from src/com/google/android/gms/maps/internal/ICancelableCallback.aidl rename to src/main/aidl/com/google/android/gms/maps/internal/ICancelableCallback.aidl diff --git a/src/com/google/android/gms/maps/internal/ICreator.aidl b/src/main/aidl/com/google/android/gms/maps/internal/ICreator.aidl similarity index 100% rename from src/com/google/android/gms/maps/internal/ICreator.aidl rename to src/main/aidl/com/google/android/gms/maps/internal/ICreator.aidl diff --git a/src/com/google/android/gms/maps/internal/IGoogleMapDelegate.aidl b/src/main/aidl/com/google/android/gms/maps/internal/IGoogleMapDelegate.aidl similarity index 100% rename from src/com/google/android/gms/maps/internal/IGoogleMapDelegate.aidl rename to src/main/aidl/com/google/android/gms/maps/internal/IGoogleMapDelegate.aidl diff --git a/src/com/google/android/gms/maps/internal/IInfoWindowAdapter.aidl b/src/main/aidl/com/google/android/gms/maps/internal/IInfoWindowAdapter.aidl similarity index 100% rename from src/com/google/android/gms/maps/internal/IInfoWindowAdapter.aidl rename to src/main/aidl/com/google/android/gms/maps/internal/IInfoWindowAdapter.aidl diff --git a/src/com/google/android/gms/maps/internal/ILocationSourceDelegate.aidl b/src/main/aidl/com/google/android/gms/maps/internal/ILocationSourceDelegate.aidl similarity index 100% rename from src/com/google/android/gms/maps/internal/ILocationSourceDelegate.aidl rename to src/main/aidl/com/google/android/gms/maps/internal/ILocationSourceDelegate.aidl diff --git a/src/com/google/android/gms/maps/internal/IMapFragmentDelegate.aidl b/src/main/aidl/com/google/android/gms/maps/internal/IMapFragmentDelegate.aidl similarity index 100% rename from src/com/google/android/gms/maps/internal/IMapFragmentDelegate.aidl rename to src/main/aidl/com/google/android/gms/maps/internal/IMapFragmentDelegate.aidl diff --git a/src/com/google/android/gms/maps/internal/IMapViewDelegate.aidl b/src/main/aidl/com/google/android/gms/maps/internal/IMapViewDelegate.aidl similarity index 100% rename from src/com/google/android/gms/maps/internal/IMapViewDelegate.aidl rename to src/main/aidl/com/google/android/gms/maps/internal/IMapViewDelegate.aidl diff --git a/src/com/google/android/gms/maps/internal/IOnCameraChangeListener.aidl b/src/main/aidl/com/google/android/gms/maps/internal/IOnCameraChangeListener.aidl similarity index 100% rename from src/com/google/android/gms/maps/internal/IOnCameraChangeListener.aidl rename to src/main/aidl/com/google/android/gms/maps/internal/IOnCameraChangeListener.aidl diff --git a/src/com/google/android/gms/maps/internal/IOnInfoWindowClickListener.aidl b/src/main/aidl/com/google/android/gms/maps/internal/IOnInfoWindowClickListener.aidl similarity index 100% rename from src/com/google/android/gms/maps/internal/IOnInfoWindowClickListener.aidl rename to src/main/aidl/com/google/android/gms/maps/internal/IOnInfoWindowClickListener.aidl diff --git a/src/com/google/android/gms/maps/internal/IOnMapClickListener.aidl b/src/main/aidl/com/google/android/gms/maps/internal/IOnMapClickListener.aidl similarity index 100% rename from src/com/google/android/gms/maps/internal/IOnMapClickListener.aidl rename to src/main/aidl/com/google/android/gms/maps/internal/IOnMapClickListener.aidl diff --git a/src/com/google/android/gms/maps/internal/IOnMapLoadedCallback.aidl b/src/main/aidl/com/google/android/gms/maps/internal/IOnMapLoadedCallback.aidl similarity index 100% rename from src/com/google/android/gms/maps/internal/IOnMapLoadedCallback.aidl rename to src/main/aidl/com/google/android/gms/maps/internal/IOnMapLoadedCallback.aidl diff --git a/src/com/google/android/gms/maps/internal/IOnMapLongClickListener.aidl b/src/main/aidl/com/google/android/gms/maps/internal/IOnMapLongClickListener.aidl similarity index 100% rename from src/com/google/android/gms/maps/internal/IOnMapLongClickListener.aidl rename to src/main/aidl/com/google/android/gms/maps/internal/IOnMapLongClickListener.aidl diff --git a/src/com/google/android/gms/maps/internal/IOnMarkerClickListener.aidl b/src/main/aidl/com/google/android/gms/maps/internal/IOnMarkerClickListener.aidl similarity index 100% rename from src/com/google/android/gms/maps/internal/IOnMarkerClickListener.aidl rename to src/main/aidl/com/google/android/gms/maps/internal/IOnMarkerClickListener.aidl diff --git a/src/com/google/android/gms/maps/internal/IOnMarkerDragListener.aidl b/src/main/aidl/com/google/android/gms/maps/internal/IOnMarkerDragListener.aidl similarity index 100% rename from src/com/google/android/gms/maps/internal/IOnMarkerDragListener.aidl rename to src/main/aidl/com/google/android/gms/maps/internal/IOnMarkerDragListener.aidl diff --git a/src/com/google/android/gms/maps/internal/IOnMyLocationButtonClickListener.aidl b/src/main/aidl/com/google/android/gms/maps/internal/IOnMyLocationButtonClickListener.aidl similarity index 100% rename from src/com/google/android/gms/maps/internal/IOnMyLocationButtonClickListener.aidl rename to src/main/aidl/com/google/android/gms/maps/internal/IOnMyLocationButtonClickListener.aidl diff --git a/src/com/google/android/gms/maps/internal/IOnMyLocationChangeListener.aidl b/src/main/aidl/com/google/android/gms/maps/internal/IOnMyLocationChangeListener.aidl similarity index 100% rename from src/com/google/android/gms/maps/internal/IOnMyLocationChangeListener.aidl rename to src/main/aidl/com/google/android/gms/maps/internal/IOnMyLocationChangeListener.aidl diff --git a/src/com/google/android/gms/maps/internal/IProjectionDelegate.aidl b/src/main/aidl/com/google/android/gms/maps/internal/IProjectionDelegate.aidl similarity index 100% rename from src/com/google/android/gms/maps/internal/IProjectionDelegate.aidl rename to src/main/aidl/com/google/android/gms/maps/internal/IProjectionDelegate.aidl diff --git a/src/com/google/android/gms/maps/internal/ISnapshotReadyCallback.aidl b/src/main/aidl/com/google/android/gms/maps/internal/ISnapshotReadyCallback.aidl similarity index 100% rename from src/com/google/android/gms/maps/internal/ISnapshotReadyCallback.aidl rename to src/main/aidl/com/google/android/gms/maps/internal/ISnapshotReadyCallback.aidl diff --git a/src/com/google/android/gms/maps/internal/IUiSettingsDelegate.aidl b/src/main/aidl/com/google/android/gms/maps/internal/IUiSettingsDelegate.aidl similarity index 100% rename from src/com/google/android/gms/maps/internal/IUiSettingsDelegate.aidl rename to src/main/aidl/com/google/android/gms/maps/internal/IUiSettingsDelegate.aidl diff --git a/src/com/google/android/gms/maps/model/CameraPosition.aidl b/src/main/aidl/com/google/android/gms/maps/model/CameraPosition.aidl similarity index 100% rename from src/com/google/android/gms/maps/model/CameraPosition.aidl rename to src/main/aidl/com/google/android/gms/maps/model/CameraPosition.aidl diff --git a/src/com/google/android/gms/maps/model/CircleOptions.aidl b/src/main/aidl/com/google/android/gms/maps/model/CircleOptions.aidl similarity index 100% rename from src/com/google/android/gms/maps/model/CircleOptions.aidl rename to src/main/aidl/com/google/android/gms/maps/model/CircleOptions.aidl diff --git a/src/com/google/android/gms/maps/model/GroundOverlayOptions.aidl b/src/main/aidl/com/google/android/gms/maps/model/GroundOverlayOptions.aidl similarity index 100% rename from src/com/google/android/gms/maps/model/GroundOverlayOptions.aidl rename to src/main/aidl/com/google/android/gms/maps/model/GroundOverlayOptions.aidl diff --git a/src/com/google/android/gms/maps/model/LatLng.aidl b/src/main/aidl/com/google/android/gms/maps/model/LatLng.aidl similarity index 100% rename from src/com/google/android/gms/maps/model/LatLng.aidl rename to src/main/aidl/com/google/android/gms/maps/model/LatLng.aidl diff --git a/src/com/google/android/gms/maps/model/LatLngBounds.aidl b/src/main/aidl/com/google/android/gms/maps/model/LatLngBounds.aidl similarity index 100% rename from src/com/google/android/gms/maps/model/LatLngBounds.aidl rename to src/main/aidl/com/google/android/gms/maps/model/LatLngBounds.aidl diff --git a/src/com/google/android/gms/maps/model/MarkerOptions.aidl b/src/main/aidl/com/google/android/gms/maps/model/MarkerOptions.aidl similarity index 100% rename from src/com/google/android/gms/maps/model/MarkerOptions.aidl rename to src/main/aidl/com/google/android/gms/maps/model/MarkerOptions.aidl diff --git a/src/com/google/android/gms/maps/model/PolygonOptions.aidl b/src/main/aidl/com/google/android/gms/maps/model/PolygonOptions.aidl similarity index 100% rename from src/com/google/android/gms/maps/model/PolygonOptions.aidl rename to src/main/aidl/com/google/android/gms/maps/model/PolygonOptions.aidl diff --git a/src/com/google/android/gms/maps/model/PolylineOptions.aidl b/src/main/aidl/com/google/android/gms/maps/model/PolylineOptions.aidl similarity index 100% rename from src/com/google/android/gms/maps/model/PolylineOptions.aidl rename to src/main/aidl/com/google/android/gms/maps/model/PolylineOptions.aidl diff --git a/src/com/google/android/gms/maps/model/Tile.aidl b/src/main/aidl/com/google/android/gms/maps/model/Tile.aidl similarity index 100% rename from src/com/google/android/gms/maps/model/Tile.aidl rename to src/main/aidl/com/google/android/gms/maps/model/Tile.aidl diff --git a/src/com/google/android/gms/maps/model/TileOverlayOptions.aidl b/src/main/aidl/com/google/android/gms/maps/model/TileOverlayOptions.aidl similarity index 100% rename from src/com/google/android/gms/maps/model/TileOverlayOptions.aidl rename to src/main/aidl/com/google/android/gms/maps/model/TileOverlayOptions.aidl diff --git a/src/com/google/android/gms/maps/model/VisibleRegion.aidl b/src/main/aidl/com/google/android/gms/maps/model/VisibleRegion.aidl similarity index 100% rename from src/com/google/android/gms/maps/model/VisibleRegion.aidl rename to src/main/aidl/com/google/android/gms/maps/model/VisibleRegion.aidl diff --git a/src/com/google/android/gms/maps/model/internal/IBitmapDescriptorFactoryDelegate.aidl b/src/main/aidl/com/google/android/gms/maps/model/internal/IBitmapDescriptorFactoryDelegate.aidl similarity index 100% rename from src/com/google/android/gms/maps/model/internal/IBitmapDescriptorFactoryDelegate.aidl rename to src/main/aidl/com/google/android/gms/maps/model/internal/IBitmapDescriptorFactoryDelegate.aidl diff --git a/src/com/google/android/gms/maps/model/internal/ICircleDelegate.aidl b/src/main/aidl/com/google/android/gms/maps/model/internal/ICircleDelegate.aidl similarity index 100% rename from src/com/google/android/gms/maps/model/internal/ICircleDelegate.aidl rename to src/main/aidl/com/google/android/gms/maps/model/internal/ICircleDelegate.aidl diff --git a/src/com/google/android/gms/maps/model/internal/IGroundOverlayDelegate.aidl b/src/main/aidl/com/google/android/gms/maps/model/internal/IGroundOverlayDelegate.aidl similarity index 100% rename from src/com/google/android/gms/maps/model/internal/IGroundOverlayDelegate.aidl rename to src/main/aidl/com/google/android/gms/maps/model/internal/IGroundOverlayDelegate.aidl diff --git a/src/com/google/android/gms/maps/model/internal/IMarkerDelegate.aidl b/src/main/aidl/com/google/android/gms/maps/model/internal/IMarkerDelegate.aidl similarity index 100% rename from src/com/google/android/gms/maps/model/internal/IMarkerDelegate.aidl rename to src/main/aidl/com/google/android/gms/maps/model/internal/IMarkerDelegate.aidl diff --git a/src/com/google/android/gms/maps/model/internal/IPolygonDelegate.aidl b/src/main/aidl/com/google/android/gms/maps/model/internal/IPolygonDelegate.aidl similarity index 100% rename from src/com/google/android/gms/maps/model/internal/IPolygonDelegate.aidl rename to src/main/aidl/com/google/android/gms/maps/model/internal/IPolygonDelegate.aidl diff --git a/src/com/google/android/gms/maps/model/internal/IPolylineDelegate.aidl b/src/main/aidl/com/google/android/gms/maps/model/internal/IPolylineDelegate.aidl similarity index 100% rename from src/com/google/android/gms/maps/model/internal/IPolylineDelegate.aidl rename to src/main/aidl/com/google/android/gms/maps/model/internal/IPolylineDelegate.aidl diff --git a/src/com/google/android/gms/maps/model/internal/ITileOverlayDelegate.aidl b/src/main/aidl/com/google/android/gms/maps/model/internal/ITileOverlayDelegate.aidl similarity index 100% rename from src/com/google/android/gms/maps/model/internal/ITileOverlayDelegate.aidl rename to src/main/aidl/com/google/android/gms/maps/model/internal/ITileOverlayDelegate.aidl diff --git a/src/com/google/android/gms/maps/model/internal/ITileProviderDelegate.aidl b/src/main/aidl/com/google/android/gms/maps/model/internal/ITileProviderDelegate.aidl similarity index 100% rename from src/com/google/android/gms/maps/model/internal/ITileProviderDelegate.aidl rename to src/main/aidl/com/google/android/gms/maps/model/internal/ITileProviderDelegate.aidl diff --git a/src/com/google/android/gms/people/internal/IPeopleCallbacks.aidl b/src/main/aidl/com/google/android/gms/people/internal/IPeopleCallbacks.aidl similarity index 100% rename from src/com/google/android/gms/people/internal/IPeopleCallbacks.aidl rename to src/main/aidl/com/google/android/gms/people/internal/IPeopleCallbacks.aidl diff --git a/src/com/google/android/gms/people/internal/IPeopleService.aidl b/src/main/aidl/com/google/android/gms/people/internal/IPeopleService.aidl similarity index 100% rename from src/com/google/android/gms/people/internal/IPeopleService.aidl rename to src/main/aidl/com/google/android/gms/people/internal/IPeopleService.aidl diff --git a/src/com/google/android/gms/plus/internal/IPlusOneButtonCreator.aidl b/src/main/aidl/com/google/android/gms/plus/internal/IPlusOneButtonCreator.aidl similarity index 100% rename from src/com/google/android/gms/plus/internal/IPlusOneButtonCreator.aidl rename to src/main/aidl/com/google/android/gms/plus/internal/IPlusOneButtonCreator.aidl diff --git a/src/com/google/android/gms/appdatasearch/CorpusStatus.java b/src/main/java/com/google/android/gms/appdatasearch/CorpusStatus.java similarity index 100% rename from src/com/google/android/gms/appdatasearch/CorpusStatus.java rename to src/main/java/com/google/android/gms/appdatasearch/CorpusStatus.java diff --git a/src/com/google/android/gms/appdatasearch/SuggestSpecification.java b/src/main/java/com/google/android/gms/appdatasearch/SuggestSpecification.java similarity index 100% rename from src/com/google/android/gms/appdatasearch/SuggestSpecification.java rename to src/main/java/com/google/android/gms/appdatasearch/SuggestSpecification.java diff --git a/src/com/google/android/gms/appdatasearch/SuggestionResults.java b/src/main/java/com/google/android/gms/appdatasearch/SuggestionResults.java similarity index 100% rename from src/com/google/android/gms/appdatasearch/SuggestionResults.java rename to src/main/java/com/google/android/gms/appdatasearch/SuggestionResults.java diff --git a/src/com/google/android/gms/appdatasearch/UsageInfo.java b/src/main/java/com/google/android/gms/appdatasearch/UsageInfo.java similarity index 100% rename from src/com/google/android/gms/appdatasearch/UsageInfo.java rename to src/main/java/com/google/android/gms/appdatasearch/UsageInfo.java diff --git a/src/com/google/android/gms/auth/AccountChangeEvent.java b/src/main/java/com/google/android/gms/auth/AccountChangeEvent.java similarity index 100% rename from src/com/google/android/gms/auth/AccountChangeEvent.java rename to src/main/java/com/google/android/gms/auth/AccountChangeEvent.java diff --git a/src/com/google/android/gms/auth/AccountChangeEventsRequest.java b/src/main/java/com/google/android/gms/auth/AccountChangeEventsRequest.java similarity index 100% rename from src/com/google/android/gms/auth/AccountChangeEventsRequest.java rename to src/main/java/com/google/android/gms/auth/AccountChangeEventsRequest.java diff --git a/src/com/google/android/gms/auth/AccountChangeEventsResponse.java b/src/main/java/com/google/android/gms/auth/AccountChangeEventsResponse.java similarity index 100% rename from src/com/google/android/gms/auth/AccountChangeEventsResponse.java rename to src/main/java/com/google/android/gms/auth/AccountChangeEventsResponse.java diff --git a/src/com/google/android/gms/auth/firstparty/dataservice/TokenRequest.java b/src/main/java/com/google/android/gms/auth/firstparty/dataservice/TokenRequest.java similarity index 100% rename from src/com/google/android/gms/auth/firstparty/dataservice/TokenRequest.java rename to src/main/java/com/google/android/gms/auth/firstparty/dataservice/TokenRequest.java diff --git a/src/com/google/android/gms/auth/firstparty/dataservice/TokenResponse.java b/src/main/java/com/google/android/gms/auth/firstparty/dataservice/TokenResponse.java similarity index 100% rename from src/com/google/android/gms/auth/firstparty/dataservice/TokenResponse.java rename to src/main/java/com/google/android/gms/auth/firstparty/dataservice/TokenResponse.java diff --git a/src/com/google/android/gms/auth/firstparty/proximity/data/Permit.java b/src/main/java/com/google/android/gms/auth/firstparty/proximity/data/Permit.java similarity index 100% rename from src/com/google/android/gms/auth/firstparty/proximity/data/Permit.java rename to src/main/java/com/google/android/gms/auth/firstparty/proximity/data/Permit.java diff --git a/src/com/google/android/gms/common/Scopes.java b/src/main/java/com/google/android/gms/common/Scopes.java similarity index 100% rename from src/com/google/android/gms/common/Scopes.java rename to src/main/java/com/google/android/gms/common/Scopes.java diff --git a/src/com/google/android/gms/common/api/AccountInfo.java b/src/main/java/com/google/android/gms/common/api/AccountInfo.java similarity index 100% rename from src/com/google/android/gms/common/api/AccountInfo.java rename to src/main/java/com/google/android/gms/common/api/AccountInfo.java diff --git a/src/com/google/android/gms/common/api/CommonStatusCodes.java b/src/main/java/com/google/android/gms/common/api/CommonStatusCodes.java similarity index 100% rename from src/com/google/android/gms/common/api/CommonStatusCodes.java rename to src/main/java/com/google/android/gms/common/api/CommonStatusCodes.java diff --git a/src/com/google/android/gms/common/api/Result.java b/src/main/java/com/google/android/gms/common/api/Result.java similarity index 100% rename from src/com/google/android/gms/common/api/Result.java rename to src/main/java/com/google/android/gms/common/api/Result.java diff --git a/src/com/google/android/gms/common/api/Scope.java b/src/main/java/com/google/android/gms/common/api/Scope.java similarity index 100% rename from src/com/google/android/gms/common/api/Scope.java rename to src/main/java/com/google/android/gms/common/api/Scope.java diff --git a/src/com/google/android/gms/common/api/Status.java b/src/main/java/com/google/android/gms/common/api/Status.java similarity index 100% rename from src/com/google/android/gms/common/api/Status.java rename to src/main/java/com/google/android/gms/common/api/Status.java diff --git a/src/com/google/android/gms/common/data/DataHolder.java b/src/main/java/com/google/android/gms/common/data/DataHolder.java similarity index 64% rename from src/com/google/android/gms/common/data/DataHolder.java rename to src/main/java/com/google/android/gms/common/data/DataHolder.java index 75a57dd4..99811a18 100644 --- a/src/com/google/android/gms/common/data/DataHolder.java +++ b/src/main/java/com/google/android/gms/common/data/DataHolder.java @@ -1,7 +1,10 @@ package com.google.android.gms.common.data; +import android.annotation.SuppressLint; +import android.database.AbstractWindowedCursor; import android.database.Cursor; import android.database.CursorWindow; +import android.os.Build; import android.os.Bundle; import org.microg.safeparcel.AutoSafeParcelable; @@ -39,6 +42,37 @@ public class DataHolder extends AutoSafeParcelable { this.metadata = metadata; } + protected static final int FIELD_TYPE_BLOB = 4; + protected static final int FIELD_TYPE_FLOAT = 2; + protected static final int FIELD_TYPE_INTEGER = 1; + protected static final int FIELD_TYPE_NULL = 0; + protected static final int FIELD_TYPE_STRING = 3; + + @SuppressLint("NewApi") + static int getCursorType(Cursor cursor, int i) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { + return cursor.getType(i); + } + if (cursor instanceof AbstractWindowedCursor) { + CursorWindow cursorWindow = ((AbstractWindowedCursor)cursor).getWindow(); + int pos = cursor.getPosition(); + int type = -1; + if (cursorWindow.isNull(pos, i)) { + type = FIELD_TYPE_NULL; + } else if (cursorWindow.isLong(pos, i)) { + type = FIELD_TYPE_INTEGER; + } else if (cursorWindow.isFloat(pos, i)) { + type = FIELD_TYPE_FLOAT; + } else if (cursorWindow.isString(pos, i)) { + type = FIELD_TYPE_STRING; + } else if (cursorWindow.isBlob(pos, i)) { + type = FIELD_TYPE_BLOB; + } + + return type; + } + throw new RuntimeException("Unsupported cursor on this platform!"); + } public static DataHolder fromCursor(Cursor cursor, int statusCode, Bundle metadata) { List windows = new ArrayList<>(); @@ -54,20 +88,20 @@ public class DataHolder extends AutoSafeParcelable { row = 0; } for (int i = 0; i < cursor.getColumnCount(); i++) { - switch (cursor.getType(i)) { - case Cursor.FIELD_TYPE_NULL: + switch (getCursorType(cursor, i)) { + case FIELD_TYPE_NULL: cursorWindow.putNull(row, i); break; - case Cursor.FIELD_TYPE_BLOB: + case FIELD_TYPE_BLOB: cursorWindow.putBlob(cursor.getBlob(i), row, i); break; - case Cursor.FIELD_TYPE_FLOAT: + case FIELD_TYPE_FLOAT: cursorWindow.putDouble(cursor.getDouble(i), row, i); break; - case Cursor.FIELD_TYPE_INTEGER: + case FIELD_TYPE_INTEGER: cursorWindow.putLong(cursor.getLong(i), row, i); break; - case Cursor.FIELD_TYPE_STRING: + case FIELD_TYPE_STRING: cursorWindow.putString(cursor.getString(i), row, i); break; } diff --git a/src/com/google/android/gms/common/server/FavaDiagnosticsEntity.java b/src/main/java/com/google/android/gms/common/server/FavaDiagnosticsEntity.java similarity index 100% rename from src/com/google/android/gms/common/server/FavaDiagnosticsEntity.java rename to src/main/java/com/google/android/gms/common/server/FavaDiagnosticsEntity.java diff --git a/src/com/google/android/gms/drive/metadata/internal/MetadataBundle.java b/src/main/java/com/google/android/gms/drive/metadata/internal/MetadataBundle.java similarity index 100% rename from src/com/google/android/gms/drive/metadata/internal/MetadataBundle.java rename to src/main/java/com/google/android/gms/drive/metadata/internal/MetadataBundle.java diff --git a/src/com/google/android/gms/dynamic/ObjectWrapper.java b/src/main/java/com/google/android/gms/dynamic/ObjectWrapper.java similarity index 100% rename from src/com/google/android/gms/dynamic/ObjectWrapper.java rename to src/main/java/com/google/android/gms/dynamic/ObjectWrapper.java diff --git a/src/com/google/android/gms/fitness/data/DataPoint.java b/src/main/java/com/google/android/gms/fitness/data/DataPoint.java similarity index 100% rename from src/com/google/android/gms/fitness/data/DataPoint.java rename to src/main/java/com/google/android/gms/fitness/data/DataPoint.java diff --git a/src/com/google/android/gms/fitness/data/Device.java b/src/main/java/com/google/android/gms/fitness/data/Device.java similarity index 100% rename from src/com/google/android/gms/fitness/data/Device.java rename to src/main/java/com/google/android/gms/fitness/data/Device.java diff --git a/src/com/google/android/gms/fitness/data/Field.java b/src/main/java/com/google/android/gms/fitness/data/Field.java similarity index 100% rename from src/com/google/android/gms/fitness/data/Field.java rename to src/main/java/com/google/android/gms/fitness/data/Field.java diff --git a/src/com/google/android/gms/fitness/data/Value.java b/src/main/java/com/google/android/gms/fitness/data/Value.java similarity index 100% rename from src/com/google/android/gms/fitness/data/Value.java rename to src/main/java/com/google/android/gms/fitness/data/Value.java diff --git a/src/com/google/android/gms/identity/accounts/api/AccountData.java b/src/main/java/com/google/android/gms/identity/accounts/api/AccountData.java similarity index 100% rename from src/com/google/android/gms/identity/accounts/api/AccountData.java rename to src/main/java/com/google/android/gms/identity/accounts/api/AccountData.java diff --git a/src/com/google/android/gms/identity/intents/model/CountrySpecification.java b/src/main/java/com/google/android/gms/identity/intents/model/CountrySpecification.java similarity index 100% rename from src/com/google/android/gms/identity/intents/model/CountrySpecification.java rename to src/main/java/com/google/android/gms/identity/intents/model/CountrySpecification.java diff --git a/src/com/google/android/gms/identity/intents/model/UserAddress.java b/src/main/java/com/google/android/gms/identity/intents/model/UserAddress.java similarity index 100% rename from src/com/google/android/gms/identity/intents/model/UserAddress.java rename to src/main/java/com/google/android/gms/identity/intents/model/UserAddress.java diff --git a/src/com/google/android/gms/location/Geofence.java b/src/main/java/com/google/android/gms/location/Geofence.java similarity index 100% rename from src/com/google/android/gms/location/Geofence.java rename to src/main/java/com/google/android/gms/location/Geofence.java diff --git a/src/com/google/android/gms/location/GeofencingRequest.java b/src/main/java/com/google/android/gms/location/GeofencingRequest.java similarity index 100% rename from src/com/google/android/gms/location/GeofencingRequest.java rename to src/main/java/com/google/android/gms/location/GeofencingRequest.java diff --git a/src/com/google/android/gms/location/LocationRequest.java b/src/main/java/com/google/android/gms/location/LocationRequest.java similarity index 100% rename from src/com/google/android/gms/location/LocationRequest.java rename to src/main/java/com/google/android/gms/location/LocationRequest.java diff --git a/src/com/google/android/gms/location/LocationStatus.java b/src/main/java/com/google/android/gms/location/LocationStatus.java similarity index 100% rename from src/com/google/android/gms/location/LocationStatus.java rename to src/main/java/com/google/android/gms/location/LocationStatus.java diff --git a/src/com/google/android/gms/location/internal/ClientIdentity.java b/src/main/java/com/google/android/gms/location/internal/ClientIdentity.java similarity index 100% rename from src/com/google/android/gms/location/internal/ClientIdentity.java rename to src/main/java/com/google/android/gms/location/internal/ClientIdentity.java diff --git a/src/com/google/android/gms/location/internal/LocationRequestInternal.java b/src/main/java/com/google/android/gms/location/internal/LocationRequestInternal.java similarity index 100% rename from src/com/google/android/gms/location/internal/LocationRequestInternal.java rename to src/main/java/com/google/android/gms/location/internal/LocationRequestInternal.java diff --git a/src/com/google/android/gms/location/places/AutocompleteFilter.java b/src/main/java/com/google/android/gms/location/places/AutocompleteFilter.java similarity index 100% rename from src/com/google/android/gms/location/places/AutocompleteFilter.java rename to src/main/java/com/google/android/gms/location/places/AutocompleteFilter.java diff --git a/src/com/google/android/gms/location/places/NearbyAlertRequest.java b/src/main/java/com/google/android/gms/location/places/NearbyAlertRequest.java similarity index 100% rename from src/com/google/android/gms/location/places/NearbyAlertRequest.java rename to src/main/java/com/google/android/gms/location/places/NearbyAlertRequest.java diff --git a/src/com/google/android/gms/location/places/PlaceFilter.java b/src/main/java/com/google/android/gms/location/places/PlaceFilter.java similarity index 100% rename from src/com/google/android/gms/location/places/PlaceFilter.java rename to src/main/java/com/google/android/gms/location/places/PlaceFilter.java diff --git a/src/com/google/android/gms/location/places/PlaceReport.java b/src/main/java/com/google/android/gms/location/places/PlaceReport.java similarity index 100% rename from src/com/google/android/gms/location/places/PlaceReport.java rename to src/main/java/com/google/android/gms/location/places/PlaceReport.java diff --git a/src/com/google/android/gms/location/places/PlaceRequest.java b/src/main/java/com/google/android/gms/location/places/PlaceRequest.java similarity index 100% rename from src/com/google/android/gms/location/places/PlaceRequest.java rename to src/main/java/com/google/android/gms/location/places/PlaceRequest.java diff --git a/src/com/google/android/gms/location/places/UserAddedPlace.java b/src/main/java/com/google/android/gms/location/places/UserAddedPlace.java similarity index 100% rename from src/com/google/android/gms/location/places/UserAddedPlace.java rename to src/main/java/com/google/android/gms/location/places/UserAddedPlace.java diff --git a/src/com/google/android/gms/location/places/UserDataType.java b/src/main/java/com/google/android/gms/location/places/UserDataType.java similarity index 100% rename from src/com/google/android/gms/location/places/UserDataType.java rename to src/main/java/com/google/android/gms/location/places/UserDataType.java diff --git a/src/com/google/android/gms/location/places/internal/PlacesParams.java b/src/main/java/com/google/android/gms/location/places/internal/PlacesParams.java similarity index 100% rename from src/com/google/android/gms/location/places/internal/PlacesParams.java rename to src/main/java/com/google/android/gms/location/places/internal/PlacesParams.java diff --git a/src/com/google/android/gms/location/reporting/ReportingState.java b/src/main/java/com/google/android/gms/location/reporting/ReportingState.java similarity index 100% rename from src/com/google/android/gms/location/reporting/ReportingState.java rename to src/main/java/com/google/android/gms/location/reporting/ReportingState.java diff --git a/src/com/google/android/gms/maps/GoogleMapOptions.java b/src/main/java/com/google/android/gms/maps/GoogleMapOptions.java similarity index 100% rename from src/com/google/android/gms/maps/GoogleMapOptions.java rename to src/main/java/com/google/android/gms/maps/GoogleMapOptions.java diff --git a/src/com/google/android/gms/maps/StreetViewPanoramaOptions.java b/src/main/java/com/google/android/gms/maps/StreetViewPanoramaOptions.java similarity index 100% rename from src/com/google/android/gms/maps/StreetViewPanoramaOptions.java rename to src/main/java/com/google/android/gms/maps/StreetViewPanoramaOptions.java diff --git a/src/com/google/android/gms/maps/internal/Point.java b/src/main/java/com/google/android/gms/maps/internal/Point.java similarity index 100% rename from src/com/google/android/gms/maps/internal/Point.java rename to src/main/java/com/google/android/gms/maps/internal/Point.java diff --git a/src/com/google/android/gms/maps/model/BitmapDescriptor.java b/src/main/java/com/google/android/gms/maps/model/BitmapDescriptor.java similarity index 100% rename from src/com/google/android/gms/maps/model/BitmapDescriptor.java rename to src/main/java/com/google/android/gms/maps/model/BitmapDescriptor.java diff --git a/src/com/google/android/gms/maps/model/CameraPosition.java b/src/main/java/com/google/android/gms/maps/model/CameraPosition.java similarity index 100% rename from src/com/google/android/gms/maps/model/CameraPosition.java rename to src/main/java/com/google/android/gms/maps/model/CameraPosition.java diff --git a/src/com/google/android/gms/maps/model/CircleOptions.java b/src/main/java/com/google/android/gms/maps/model/CircleOptions.java similarity index 100% rename from src/com/google/android/gms/maps/model/CircleOptions.java rename to src/main/java/com/google/android/gms/maps/model/CircleOptions.java diff --git a/src/com/google/android/gms/maps/model/GroundOverlayOptions.java b/src/main/java/com/google/android/gms/maps/model/GroundOverlayOptions.java similarity index 100% rename from src/com/google/android/gms/maps/model/GroundOverlayOptions.java rename to src/main/java/com/google/android/gms/maps/model/GroundOverlayOptions.java diff --git a/src/com/google/android/gms/maps/model/LatLng.java b/src/main/java/com/google/android/gms/maps/model/LatLng.java similarity index 100% rename from src/com/google/android/gms/maps/model/LatLng.java rename to src/main/java/com/google/android/gms/maps/model/LatLng.java diff --git a/src/com/google/android/gms/maps/model/LatLngBounds.java b/src/main/java/com/google/android/gms/maps/model/LatLngBounds.java similarity index 100% rename from src/com/google/android/gms/maps/model/LatLngBounds.java rename to src/main/java/com/google/android/gms/maps/model/LatLngBounds.java diff --git a/src/com/google/android/gms/maps/model/MarkerOptions.java b/src/main/java/com/google/android/gms/maps/model/MarkerOptions.java similarity index 100% rename from src/com/google/android/gms/maps/model/MarkerOptions.java rename to src/main/java/com/google/android/gms/maps/model/MarkerOptions.java diff --git a/src/com/google/android/gms/maps/model/PolygonOptions.java b/src/main/java/com/google/android/gms/maps/model/PolygonOptions.java similarity index 100% rename from src/com/google/android/gms/maps/model/PolygonOptions.java rename to src/main/java/com/google/android/gms/maps/model/PolygonOptions.java diff --git a/src/com/google/android/gms/maps/model/PolylineOptions.java b/src/main/java/com/google/android/gms/maps/model/PolylineOptions.java similarity index 100% rename from src/com/google/android/gms/maps/model/PolylineOptions.java rename to src/main/java/com/google/android/gms/maps/model/PolylineOptions.java diff --git a/src/com/google/android/gms/maps/model/StreetViewPanoramaCamera.java b/src/main/java/com/google/android/gms/maps/model/StreetViewPanoramaCamera.java similarity index 100% rename from src/com/google/android/gms/maps/model/StreetViewPanoramaCamera.java rename to src/main/java/com/google/android/gms/maps/model/StreetViewPanoramaCamera.java diff --git a/src/com/google/android/gms/maps/model/StreetViewPanoramaLink.java b/src/main/java/com/google/android/gms/maps/model/StreetViewPanoramaLink.java similarity index 100% rename from src/com/google/android/gms/maps/model/StreetViewPanoramaLink.java rename to src/main/java/com/google/android/gms/maps/model/StreetViewPanoramaLink.java diff --git a/src/com/google/android/gms/maps/model/StreetViewPanoramaLocation.java b/src/main/java/com/google/android/gms/maps/model/StreetViewPanoramaLocation.java similarity index 100% rename from src/com/google/android/gms/maps/model/StreetViewPanoramaLocation.java rename to src/main/java/com/google/android/gms/maps/model/StreetViewPanoramaLocation.java diff --git a/src/com/google/android/gms/maps/model/StreetViewPanoramaOrientation.java b/src/main/java/com/google/android/gms/maps/model/StreetViewPanoramaOrientation.java similarity index 100% rename from src/com/google/android/gms/maps/model/StreetViewPanoramaOrientation.java rename to src/main/java/com/google/android/gms/maps/model/StreetViewPanoramaOrientation.java diff --git a/src/com/google/android/gms/maps/model/Tile.java b/src/main/java/com/google/android/gms/maps/model/Tile.java similarity index 100% rename from src/com/google/android/gms/maps/model/Tile.java rename to src/main/java/com/google/android/gms/maps/model/Tile.java diff --git a/src/com/google/android/gms/maps/model/TileOverlayOptions.java b/src/main/java/com/google/android/gms/maps/model/TileOverlayOptions.java similarity index 100% rename from src/com/google/android/gms/maps/model/TileOverlayOptions.java rename to src/main/java/com/google/android/gms/maps/model/TileOverlayOptions.java diff --git a/src/com/google/android/gms/maps/model/TileProvider.java b/src/main/java/com/google/android/gms/maps/model/TileProvider.java similarity index 100% rename from src/com/google/android/gms/maps/model/TileProvider.java rename to src/main/java/com/google/android/gms/maps/model/TileProvider.java diff --git a/src/com/google/android/gms/maps/model/VisibleRegion.java b/src/main/java/com/google/android/gms/maps/model/VisibleRegion.java similarity index 100% rename from src/com/google/android/gms/maps/model/VisibleRegion.java rename to src/main/java/com/google/android/gms/maps/model/VisibleRegion.java diff --git a/src/com/google/android/gms/maps/model/package-info.java b/src/main/java/com/google/android/gms/maps/model/package-info.java similarity index 100% rename from src/com/google/android/gms/maps/model/package-info.java rename to src/main/java/com/google/android/gms/maps/model/package-info.java diff --git a/src/com/google/android/gms/people/model/AccountMetadata.java b/src/main/java/com/google/android/gms/people/model/AccountMetadata.java similarity index 100% rename from src/com/google/android/gms/people/model/AccountMetadata.java rename to src/main/java/com/google/android/gms/people/model/AccountMetadata.java diff --git a/src/com/google/android/gms/plus/internal/PlusCommonExtras.java b/src/main/java/com/google/android/gms/plus/internal/PlusCommonExtras.java similarity index 100% rename from src/com/google/android/gms/plus/internal/PlusCommonExtras.java rename to src/main/java/com/google/android/gms/plus/internal/PlusCommonExtras.java diff --git a/src/com/google/android/gms/plus/internal/PlusSession.java b/src/main/java/com/google/android/gms/plus/internal/PlusSession.java similarity index 100% rename from src/com/google/android/gms/plus/internal/PlusSession.java rename to src/main/java/com/google/android/gms/plus/internal/PlusSession.java diff --git a/src/com/google/android/gms/plus/internal/model/smart_profile/CardsRequest.java b/src/main/java/com/google/android/gms/plus/internal/model/smart_profile/CardsRequest.java similarity index 100% rename from src/com/google/android/gms/plus/internal/model/smart_profile/CardsRequest.java rename to src/main/java/com/google/android/gms/plus/internal/model/smart_profile/CardsRequest.java diff --git a/src/com/google/android/gms/plus/internal/model/smart_profile/CardsResponse.java b/src/main/java/com/google/android/gms/plus/internal/model/smart_profile/CardsResponse.java similarity index 100% rename from src/com/google/android/gms/plus/internal/model/smart_profile/CardsResponse.java rename to src/main/java/com/google/android/gms/plus/internal/model/smart_profile/CardsResponse.java diff --git a/src/com/google/android/gms/plus/internal/model/smart_profile/PeopleForProfilesRequest.java b/src/main/java/com/google/android/gms/plus/internal/model/smart_profile/PeopleForProfilesRequest.java similarity index 100% rename from src/com/google/android/gms/plus/internal/model/smart_profile/PeopleForProfilesRequest.java rename to src/main/java/com/google/android/gms/plus/internal/model/smart_profile/PeopleForProfilesRequest.java diff --git a/src/com/google/android/gms/plus/internal/model/smart_profile/PeopleForProfilesResponse.java b/src/main/java/com/google/android/gms/plus/internal/model/smart_profile/PeopleForProfilesResponse.java similarity index 100% rename from src/com/google/android/gms/plus/internal/model/smart_profile/PeopleForProfilesResponse.java rename to src/main/java/com/google/android/gms/plus/internal/model/smart_profile/PeopleForProfilesResponse.java diff --git a/src/com/google/android/gms/plus/model/posts/Comment.java b/src/main/java/com/google/android/gms/plus/model/posts/Comment.java similarity index 100% rename from src/com/google/android/gms/plus/model/posts/Comment.java rename to src/main/java/com/google/android/gms/plus/model/posts/Comment.java diff --git a/src/com/google/android/gms/plus/model/posts/Post.java b/src/main/java/com/google/android/gms/plus/model/posts/Post.java similarity index 100% rename from src/com/google/android/gms/plus/model/posts/Post.java rename to src/main/java/com/google/android/gms/plus/model/posts/Post.java diff --git a/src/com/google/android/gms/plus/model/posts/Settings.java b/src/main/java/com/google/android/gms/plus/model/posts/Settings.java similarity index 100% rename from src/com/google/android/gms/plus/model/posts/Settings.java rename to src/main/java/com/google/android/gms/plus/model/posts/Settings.java diff --git a/src/com/google/android/gms/wearable/ConnectionConfiguration.java b/src/main/java/com/google/android/gms/wearable/ConnectionConfiguration.java similarity index 100% rename from src/com/google/android/gms/wearable/ConnectionConfiguration.java rename to src/main/java/com/google/android/gms/wearable/ConnectionConfiguration.java diff --git a/src/com/google/android/gms/wearable/Node.java b/src/main/java/com/google/android/gms/wearable/Node.java similarity index 100% rename from src/com/google/android/gms/wearable/Node.java rename to src/main/java/com/google/android/gms/wearable/Node.java diff --git a/src/com/google/android/gms/wearable/WearableStatusCodes.java b/src/main/java/com/google/android/gms/wearable/WearableStatusCodes.java similarity index 100% rename from src/com/google/android/gms/wearable/WearableStatusCodes.java rename to src/main/java/com/google/android/gms/wearable/WearableStatusCodes.java diff --git a/src/com/google/android/gms/wearable/internal/NodeParcelable.java b/src/main/java/com/google/android/gms/wearable/internal/NodeParcelable.java similarity index 100% rename from src/com/google/android/gms/wearable/internal/NodeParcelable.java rename to src/main/java/com/google/android/gms/wearable/internal/NodeParcelable.java diff --git a/src/org/microg/gms/common/Constants.java b/src/main/java/org/microg/gms/common/Constants.java similarity index 100% rename from src/org/microg/gms/common/Constants.java rename to src/main/java/org/microg/gms/common/Constants.java diff --git a/src/org/microg/gms/common/PublicApi.java b/src/main/java/org/microg/gms/common/PublicApi.java similarity index 100% rename from src/org/microg/gms/common/PublicApi.java rename to src/main/java/org/microg/gms/common/PublicApi.java From d2ec5f52fa6c1aed0640e65130b20e3ffce5f8b0 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Fri, 13 Mar 2015 00:22:54 +0100 Subject: [PATCH 053/293] Fix build.gradle/Android.mk --- Android.mk | 5 +++-- SafeParcel | 2 +- build.gradle | 7 ++++++- settings.gradle | 2 ++ 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Android.mk b/Android.mk index 4b9abaa0..88845431 100644 --- a/Android.mk +++ b/Android.mk @@ -3,7 +3,8 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := GmsApi -LOCAL_SRC_FILES := $(call all-java-files-under, src) -LOCAL_SRC_FILES := $(call all-Iaidl-files-under, src) +LOCAL_SRC_FILES := $(call all-java-files-under, src/main/java) +LOCAL_SRC_FILES := $(call all-Iaidl-files-under, src/main/aidl) +LOCAL_STATIC_JAVA_LIBRARIES := SafeParcel include $(BUILD_STATIC_JAVA_LIBRARY) diff --git a/SafeParcel b/SafeParcel index 462316b1..0bb4f3d6 160000 --- a/SafeParcel +++ b/SafeParcel @@ -1 +1 @@ -Subproject commit 462316b18e2620bd5c0cb843abd67671d941300d +Subproject commit 0bb4f3d602d8565bbf500a880f563a2b1fa47d1d diff --git a/build.gradle b/build.gradle index 48491609..cd548167 100644 --- a/build.gradle +++ b/build.gradle @@ -4,13 +4,18 @@ buildscript { } dependencies { classpath 'com.android.tools.build:gradle:1.0.1' + classpath 'com.github.dcendents:android-maven-plugin:1.2' } } apply plugin: 'com.android.library' +apply plugin: 'com.github.dcendents.android-maven' + +group = 'org.microg.gms' +version = '1.0-SNAPSHOT' dependencies { - compile project('SafeParcel') + compile project(':SafeParcel') } android { diff --git a/settings.gradle b/settings.gradle index 0151283d..930a2c14 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1,3 @@ +rootProject.name = 'play-services-api' + include ':SafeParcel' From c790480c40826cecd5d115c50d6fb7dfb6060b2b Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Fri, 13 Mar 2015 01:41:14 +0100 Subject: [PATCH 054/293] Update structure, add maven support --- .gitmodules | 7 +--- GmsApi | 1 - SafeParcel | 2 +- build.gradle | 41 ++++++------------- play-services-api | 1 + play-services-base/build.gradle | 12 ++++++ .../src/main/AndroidManifest.xml | 6 +++ .../android/gms/common/ConnectionResult.java | 0 .../gms/common/GooglePlayServicesClient.java | 0 .../gms/common/GooglePlayServicesUtil.java | 0 .../google/android/gms/common/api/Api.java | 0 .../gms/common/api/GoogleApiClient.java | 0 .../android/gms/common/api/PendingResult.java | 0 .../android/gms/common/api/Releasable.java | 0 .../gms/common/api/ResultCallback.java | 0 .../common/ForwardConnectionCallbacks.java | 0 .../ForwardConnectionFailedListener.java | 0 .../org/microg/gms/common/GmsClient.java | 0 .../org/microg/gms/common/GmsConnector.java | 0 .../gms/common/MultiConnectionKeeper.java | 0 .../gms/common/api/AbstractPendingResult.java | 0 .../api/AbstractPlayServicesClient.java | 0 .../org/microg/gms/common/api/ApiBuilder.java | 0 .../microg/gms/common/api/ApiConnection.java | 0 .../gms/common/api/GoogleApiClientImpl.java | 0 .../gms/common/api/ResultCallbackHandler.java | 0 play-services-location/build.gradle | 11 +++++ .../src/main/AndroidManifest.xml | 0 .../location/FusedLocationProviderApi.java | 0 .../android/gms/location/GeofencingApi.java | 0 .../android/gms/location/LocationClient.java | 0 .../gms/location/LocationListener.java | 0 .../gms/location/LocationServices.java | 0 .../FusedLocationProviderApiImpl.java | 0 .../gms/location/GeofencingApiImpl.java | 0 .../location/GoogleLocationManagerClient.java | 0 .../gms/location/LocationClientImpl.java | 0 .../location/LocationServicesApiBuilder.java | 0 .../location/NativeLocationClientImpl.java | 0 play-services-wearable/build.gradle | 11 +++++ .../src/main/AndroidManifest.xml | 6 +++ .../google/android/gms/wearable/DataApi.java | 0 .../android/gms/wearable/MessageApi.java | 0 .../google/android/gms/wearable/NodeApi.java | 0 .../google/android/gms/wearable/Wearable.java | 0 .../org/microg/gms/wearable/DataApiImpl.java | 0 .../microg/gms/wearable/MessageApiImpl.java | 0 .../org/microg/gms/wearable/NodeApiImpl.java | 0 .../gms/wearable/WearableApiBuilder.java | 0 play-services/build.gradle | 14 +++++++ {res => play-services/res}/values/version.xml | 0 play-services/src/main/AndroidManifest.xml | 6 +++ settings.gradle | 9 +++- 53 files changed, 91 insertions(+), 36 deletions(-) delete mode 160000 GmsApi mode change 160000 => 120000 SafeParcel create mode 160000 play-services-api create mode 100644 play-services-base/build.gradle create mode 100644 play-services-base/src/main/AndroidManifest.xml rename {src => play-services-base/src/main/java}/com/google/android/gms/common/ConnectionResult.java (100%) rename {src => play-services-base/src/main/java}/com/google/android/gms/common/GooglePlayServicesClient.java (100%) rename {src => play-services-base/src/main/java}/com/google/android/gms/common/GooglePlayServicesUtil.java (100%) rename {src => play-services-base/src/main/java}/com/google/android/gms/common/api/Api.java (100%) rename {src => play-services-base/src/main/java}/com/google/android/gms/common/api/GoogleApiClient.java (100%) rename {src => play-services-base/src/main/java}/com/google/android/gms/common/api/PendingResult.java (100%) rename {src => play-services-base/src/main/java}/com/google/android/gms/common/api/Releasable.java (100%) rename {src => play-services-base/src/main/java}/com/google/android/gms/common/api/ResultCallback.java (100%) rename {src => play-services-base/src/main/java}/org/microg/gms/common/ForwardConnectionCallbacks.java (100%) rename {src => play-services-base/src/main/java}/org/microg/gms/common/ForwardConnectionFailedListener.java (100%) rename {src => play-services-base/src/main/java}/org/microg/gms/common/GmsClient.java (100%) rename {src => play-services-base/src/main/java}/org/microg/gms/common/GmsConnector.java (100%) rename {src => play-services-base/src/main/java}/org/microg/gms/common/MultiConnectionKeeper.java (100%) rename {src => play-services-base/src/main/java}/org/microg/gms/common/api/AbstractPendingResult.java (100%) rename {src => play-services-base/src/main/java}/org/microg/gms/common/api/AbstractPlayServicesClient.java (100%) rename {src => play-services-base/src/main/java}/org/microg/gms/common/api/ApiBuilder.java (100%) rename {src => play-services-base/src/main/java}/org/microg/gms/common/api/ApiConnection.java (100%) rename {src => play-services-base/src/main/java}/org/microg/gms/common/api/GoogleApiClientImpl.java (100%) rename {src => play-services-base/src/main/java}/org/microg/gms/common/api/ResultCallbackHandler.java (100%) create mode 100644 play-services-location/build.gradle rename AndroidManifest.xml => play-services-location/src/main/AndroidManifest.xml (100%) rename {src => play-services-location/src/main/java}/com/google/android/gms/location/FusedLocationProviderApi.java (100%) rename {src => play-services-location/src/main/java}/com/google/android/gms/location/GeofencingApi.java (100%) rename {src => play-services-location/src/main/java}/com/google/android/gms/location/LocationClient.java (100%) rename {src => play-services-location/src/main/java}/com/google/android/gms/location/LocationListener.java (100%) rename {src => play-services-location/src/main/java}/com/google/android/gms/location/LocationServices.java (100%) rename {src => play-services-location/src/main/java}/org/microg/gms/location/FusedLocationProviderApiImpl.java (100%) rename {src => play-services-location/src/main/java}/org/microg/gms/location/GeofencingApiImpl.java (100%) rename {src => play-services-location/src/main/java}/org/microg/gms/location/GoogleLocationManagerClient.java (100%) rename {src => play-services-location/src/main/java}/org/microg/gms/location/LocationClientImpl.java (100%) rename {src => play-services-location/src/main/java}/org/microg/gms/location/LocationServicesApiBuilder.java (100%) rename {src => play-services-location/src/main/java}/org/microg/gms/location/NativeLocationClientImpl.java (100%) create mode 100644 play-services-wearable/build.gradle create mode 100644 play-services-wearable/src/main/AndroidManifest.xml rename {src => play-services-wearable/src/main/java}/com/google/android/gms/wearable/DataApi.java (100%) rename {src => play-services-wearable/src/main/java}/com/google/android/gms/wearable/MessageApi.java (100%) rename {src => play-services-wearable/src/main/java}/com/google/android/gms/wearable/NodeApi.java (100%) rename {src => play-services-wearable/src/main/java}/com/google/android/gms/wearable/Wearable.java (100%) rename {src => play-services-wearable/src/main/java}/org/microg/gms/wearable/DataApiImpl.java (100%) rename {src => play-services-wearable/src/main/java}/org/microg/gms/wearable/MessageApiImpl.java (100%) rename {src => play-services-wearable/src/main/java}/org/microg/gms/wearable/NodeApiImpl.java (100%) rename {src => play-services-wearable/src/main/java}/org/microg/gms/wearable/WearableApiBuilder.java (100%) create mode 100644 play-services/build.gradle rename {res => play-services/res}/values/version.xml (100%) create mode 100644 play-services/src/main/AndroidManifest.xml diff --git a/.gitmodules b/.gitmodules index 2be15080..bddcb0cc 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,3 @@ -[submodule "GmsApi"] - path = GmsApi +[submodule "play-services-api"] + path = play-services-api url = https://github.com/microg/android_external_GmsApi.git -[submodule "SafeParcel"] - path = SafeParcel - url = https://github.com/microg/android_external_SafeParcel.git diff --git a/GmsApi b/GmsApi deleted file mode 160000 index 3243e7d3..00000000 --- a/GmsApi +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3243e7d3ecf2f7ff92279b61c4a7e7831356f5c7 diff --git a/SafeParcel b/SafeParcel deleted file mode 160000 index a650ca5b..00000000 --- a/SafeParcel +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a650ca5beac2a374460d820935b40f9539e692db diff --git a/SafeParcel b/SafeParcel new file mode 120000 index 00000000..18f7aa75 --- /dev/null +++ b/SafeParcel @@ -0,0 +1 @@ +play-services-api/SafeParcel/ \ No newline at end of file diff --git a/build.gradle b/build.gradle index 15771b0c..252327cb 100644 --- a/build.gradle +++ b/build.gradle @@ -1,30 +1,15 @@ -buildscript { - repositories { - mavenCentral() - } - dependencies { - classpath 'com.android.tools.build:gradle:1.0.1' - } -} - -apply plugin: 'com.android.library' - -dependencies { - compile 'com.android.support:support-v4:21.0.3' - compile project(':GmsApi') -} - -android { - compileSdkVersion 21 - buildToolsVersion "21.1.2" - lintOptions.abortOnError false - - sourceSets { - main { - manifest.srcFile 'AndroidManifest.xml' - java.srcDirs = ['src'] - aidl.srcDirs = ['src'] - res.srcDirs = ['res'] +// Top-level build file where you can add configuration options common to all sub-projects/modules. +subprojects { + buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:1.0.1' + classpath 'com.github.dcendents:android-maven-plugin:1.2' } } -} + + group = 'org.microg.gms' + version = '1.0-SNAPSHOT' +} \ No newline at end of file diff --git a/play-services-api b/play-services-api new file mode 160000 index 00000000..d2ec5f52 --- /dev/null +++ b/play-services-api @@ -0,0 +1 @@ +Subproject commit d2ec5f52fa6c1aed0640e65130b20e3ffce5f8b0 diff --git a/play-services-base/build.gradle b/play-services-base/build.gradle new file mode 100644 index 00000000..8a308f2f --- /dev/null +++ b/play-services-base/build.gradle @@ -0,0 +1,12 @@ +apply plugin: 'com.android.library' +apply plugin: 'com.github.dcendents.android-maven' + +dependencies { + compile 'com.android.support:support-v4:22.0.0' + compile project(':play-services-api') +} + +android { + compileSdkVersion 22 + buildToolsVersion "21.1.2" +} diff --git a/play-services-base/src/main/AndroidManifest.xml b/play-services-base/src/main/AndroidManifest.xml new file mode 100644 index 00000000..9fa720e3 --- /dev/null +++ b/play-services-base/src/main/AndroidManifest.xml @@ -0,0 +1,6 @@ + + + + + diff --git a/src/com/google/android/gms/common/ConnectionResult.java b/play-services-base/src/main/java/com/google/android/gms/common/ConnectionResult.java similarity index 100% rename from src/com/google/android/gms/common/ConnectionResult.java rename to play-services-base/src/main/java/com/google/android/gms/common/ConnectionResult.java diff --git a/src/com/google/android/gms/common/GooglePlayServicesClient.java b/play-services-base/src/main/java/com/google/android/gms/common/GooglePlayServicesClient.java similarity index 100% rename from src/com/google/android/gms/common/GooglePlayServicesClient.java rename to play-services-base/src/main/java/com/google/android/gms/common/GooglePlayServicesClient.java diff --git a/src/com/google/android/gms/common/GooglePlayServicesUtil.java b/play-services-base/src/main/java/com/google/android/gms/common/GooglePlayServicesUtil.java similarity index 100% rename from src/com/google/android/gms/common/GooglePlayServicesUtil.java rename to play-services-base/src/main/java/com/google/android/gms/common/GooglePlayServicesUtil.java diff --git a/src/com/google/android/gms/common/api/Api.java b/play-services-base/src/main/java/com/google/android/gms/common/api/Api.java similarity index 100% rename from src/com/google/android/gms/common/api/Api.java rename to play-services-base/src/main/java/com/google/android/gms/common/api/Api.java diff --git a/src/com/google/android/gms/common/api/GoogleApiClient.java b/play-services-base/src/main/java/com/google/android/gms/common/api/GoogleApiClient.java similarity index 100% rename from src/com/google/android/gms/common/api/GoogleApiClient.java rename to play-services-base/src/main/java/com/google/android/gms/common/api/GoogleApiClient.java diff --git a/src/com/google/android/gms/common/api/PendingResult.java b/play-services-base/src/main/java/com/google/android/gms/common/api/PendingResult.java similarity index 100% rename from src/com/google/android/gms/common/api/PendingResult.java rename to play-services-base/src/main/java/com/google/android/gms/common/api/PendingResult.java diff --git a/src/com/google/android/gms/common/api/Releasable.java b/play-services-base/src/main/java/com/google/android/gms/common/api/Releasable.java similarity index 100% rename from src/com/google/android/gms/common/api/Releasable.java rename to play-services-base/src/main/java/com/google/android/gms/common/api/Releasable.java diff --git a/src/com/google/android/gms/common/api/ResultCallback.java b/play-services-base/src/main/java/com/google/android/gms/common/api/ResultCallback.java similarity index 100% rename from src/com/google/android/gms/common/api/ResultCallback.java rename to play-services-base/src/main/java/com/google/android/gms/common/api/ResultCallback.java diff --git a/src/org/microg/gms/common/ForwardConnectionCallbacks.java b/play-services-base/src/main/java/org/microg/gms/common/ForwardConnectionCallbacks.java similarity index 100% rename from src/org/microg/gms/common/ForwardConnectionCallbacks.java rename to play-services-base/src/main/java/org/microg/gms/common/ForwardConnectionCallbacks.java diff --git a/src/org/microg/gms/common/ForwardConnectionFailedListener.java b/play-services-base/src/main/java/org/microg/gms/common/ForwardConnectionFailedListener.java similarity index 100% rename from src/org/microg/gms/common/ForwardConnectionFailedListener.java rename to play-services-base/src/main/java/org/microg/gms/common/ForwardConnectionFailedListener.java diff --git a/src/org/microg/gms/common/GmsClient.java b/play-services-base/src/main/java/org/microg/gms/common/GmsClient.java similarity index 100% rename from src/org/microg/gms/common/GmsClient.java rename to play-services-base/src/main/java/org/microg/gms/common/GmsClient.java diff --git a/src/org/microg/gms/common/GmsConnector.java b/play-services-base/src/main/java/org/microg/gms/common/GmsConnector.java similarity index 100% rename from src/org/microg/gms/common/GmsConnector.java rename to play-services-base/src/main/java/org/microg/gms/common/GmsConnector.java diff --git a/src/org/microg/gms/common/MultiConnectionKeeper.java b/play-services-base/src/main/java/org/microg/gms/common/MultiConnectionKeeper.java similarity index 100% rename from src/org/microg/gms/common/MultiConnectionKeeper.java rename to play-services-base/src/main/java/org/microg/gms/common/MultiConnectionKeeper.java diff --git a/src/org/microg/gms/common/api/AbstractPendingResult.java b/play-services-base/src/main/java/org/microg/gms/common/api/AbstractPendingResult.java similarity index 100% rename from src/org/microg/gms/common/api/AbstractPendingResult.java rename to play-services-base/src/main/java/org/microg/gms/common/api/AbstractPendingResult.java diff --git a/src/org/microg/gms/common/api/AbstractPlayServicesClient.java b/play-services-base/src/main/java/org/microg/gms/common/api/AbstractPlayServicesClient.java similarity index 100% rename from src/org/microg/gms/common/api/AbstractPlayServicesClient.java rename to play-services-base/src/main/java/org/microg/gms/common/api/AbstractPlayServicesClient.java diff --git a/src/org/microg/gms/common/api/ApiBuilder.java b/play-services-base/src/main/java/org/microg/gms/common/api/ApiBuilder.java similarity index 100% rename from src/org/microg/gms/common/api/ApiBuilder.java rename to play-services-base/src/main/java/org/microg/gms/common/api/ApiBuilder.java diff --git a/src/org/microg/gms/common/api/ApiConnection.java b/play-services-base/src/main/java/org/microg/gms/common/api/ApiConnection.java similarity index 100% rename from src/org/microg/gms/common/api/ApiConnection.java rename to play-services-base/src/main/java/org/microg/gms/common/api/ApiConnection.java diff --git a/src/org/microg/gms/common/api/GoogleApiClientImpl.java b/play-services-base/src/main/java/org/microg/gms/common/api/GoogleApiClientImpl.java similarity index 100% rename from src/org/microg/gms/common/api/GoogleApiClientImpl.java rename to play-services-base/src/main/java/org/microg/gms/common/api/GoogleApiClientImpl.java diff --git a/src/org/microg/gms/common/api/ResultCallbackHandler.java b/play-services-base/src/main/java/org/microg/gms/common/api/ResultCallbackHandler.java similarity index 100% rename from src/org/microg/gms/common/api/ResultCallbackHandler.java rename to play-services-base/src/main/java/org/microg/gms/common/api/ResultCallbackHandler.java diff --git a/play-services-location/build.gradle b/play-services-location/build.gradle new file mode 100644 index 00000000..f79b92c5 --- /dev/null +++ b/play-services-location/build.gradle @@ -0,0 +1,11 @@ +apply plugin: 'com.android.library' +apply plugin: 'com.github.dcendents.android-maven' + +dependencies { + compile project(':play-services-base') +} + +android { + compileSdkVersion 22 + buildToolsVersion "22.0.0" +} \ No newline at end of file diff --git a/AndroidManifest.xml b/play-services-location/src/main/AndroidManifest.xml similarity index 100% rename from AndroidManifest.xml rename to play-services-location/src/main/AndroidManifest.xml diff --git a/src/com/google/android/gms/location/FusedLocationProviderApi.java b/play-services-location/src/main/java/com/google/android/gms/location/FusedLocationProviderApi.java similarity index 100% rename from src/com/google/android/gms/location/FusedLocationProviderApi.java rename to play-services-location/src/main/java/com/google/android/gms/location/FusedLocationProviderApi.java diff --git a/src/com/google/android/gms/location/GeofencingApi.java b/play-services-location/src/main/java/com/google/android/gms/location/GeofencingApi.java similarity index 100% rename from src/com/google/android/gms/location/GeofencingApi.java rename to play-services-location/src/main/java/com/google/android/gms/location/GeofencingApi.java diff --git a/src/com/google/android/gms/location/LocationClient.java b/play-services-location/src/main/java/com/google/android/gms/location/LocationClient.java similarity index 100% rename from src/com/google/android/gms/location/LocationClient.java rename to play-services-location/src/main/java/com/google/android/gms/location/LocationClient.java diff --git a/src/com/google/android/gms/location/LocationListener.java b/play-services-location/src/main/java/com/google/android/gms/location/LocationListener.java similarity index 100% rename from src/com/google/android/gms/location/LocationListener.java rename to play-services-location/src/main/java/com/google/android/gms/location/LocationListener.java diff --git a/src/com/google/android/gms/location/LocationServices.java b/play-services-location/src/main/java/com/google/android/gms/location/LocationServices.java similarity index 100% rename from src/com/google/android/gms/location/LocationServices.java rename to play-services-location/src/main/java/com/google/android/gms/location/LocationServices.java diff --git a/src/org/microg/gms/location/FusedLocationProviderApiImpl.java b/play-services-location/src/main/java/org/microg/gms/location/FusedLocationProviderApiImpl.java similarity index 100% rename from src/org/microg/gms/location/FusedLocationProviderApiImpl.java rename to play-services-location/src/main/java/org/microg/gms/location/FusedLocationProviderApiImpl.java diff --git a/src/org/microg/gms/location/GeofencingApiImpl.java b/play-services-location/src/main/java/org/microg/gms/location/GeofencingApiImpl.java similarity index 100% rename from src/org/microg/gms/location/GeofencingApiImpl.java rename to play-services-location/src/main/java/org/microg/gms/location/GeofencingApiImpl.java diff --git a/src/org/microg/gms/location/GoogleLocationManagerClient.java b/play-services-location/src/main/java/org/microg/gms/location/GoogleLocationManagerClient.java similarity index 100% rename from src/org/microg/gms/location/GoogleLocationManagerClient.java rename to play-services-location/src/main/java/org/microg/gms/location/GoogleLocationManagerClient.java diff --git a/src/org/microg/gms/location/LocationClientImpl.java b/play-services-location/src/main/java/org/microg/gms/location/LocationClientImpl.java similarity index 100% rename from src/org/microg/gms/location/LocationClientImpl.java rename to play-services-location/src/main/java/org/microg/gms/location/LocationClientImpl.java diff --git a/src/org/microg/gms/location/LocationServicesApiBuilder.java b/play-services-location/src/main/java/org/microg/gms/location/LocationServicesApiBuilder.java similarity index 100% rename from src/org/microg/gms/location/LocationServicesApiBuilder.java rename to play-services-location/src/main/java/org/microg/gms/location/LocationServicesApiBuilder.java diff --git a/src/org/microg/gms/location/NativeLocationClientImpl.java b/play-services-location/src/main/java/org/microg/gms/location/NativeLocationClientImpl.java similarity index 100% rename from src/org/microg/gms/location/NativeLocationClientImpl.java rename to play-services-location/src/main/java/org/microg/gms/location/NativeLocationClientImpl.java diff --git a/play-services-wearable/build.gradle b/play-services-wearable/build.gradle new file mode 100644 index 00000000..5e701f76 --- /dev/null +++ b/play-services-wearable/build.gradle @@ -0,0 +1,11 @@ +apply plugin: 'com.android.library' +apply plugin: 'com.github.dcendents.android-maven' + +dependencies { + compile project(':play-services-base') +} + +android { + compileSdkVersion 21 + buildToolsVersion "21.1.2" +} diff --git a/play-services-wearable/src/main/AndroidManifest.xml b/play-services-wearable/src/main/AndroidManifest.xml new file mode 100644 index 00000000..9fa720e3 --- /dev/null +++ b/play-services-wearable/src/main/AndroidManifest.xml @@ -0,0 +1,6 @@ + + + + + diff --git a/src/com/google/android/gms/wearable/DataApi.java b/play-services-wearable/src/main/java/com/google/android/gms/wearable/DataApi.java similarity index 100% rename from src/com/google/android/gms/wearable/DataApi.java rename to play-services-wearable/src/main/java/com/google/android/gms/wearable/DataApi.java diff --git a/src/com/google/android/gms/wearable/MessageApi.java b/play-services-wearable/src/main/java/com/google/android/gms/wearable/MessageApi.java similarity index 100% rename from src/com/google/android/gms/wearable/MessageApi.java rename to play-services-wearable/src/main/java/com/google/android/gms/wearable/MessageApi.java diff --git a/src/com/google/android/gms/wearable/NodeApi.java b/play-services-wearable/src/main/java/com/google/android/gms/wearable/NodeApi.java similarity index 100% rename from src/com/google/android/gms/wearable/NodeApi.java rename to play-services-wearable/src/main/java/com/google/android/gms/wearable/NodeApi.java diff --git a/src/com/google/android/gms/wearable/Wearable.java b/play-services-wearable/src/main/java/com/google/android/gms/wearable/Wearable.java similarity index 100% rename from src/com/google/android/gms/wearable/Wearable.java rename to play-services-wearable/src/main/java/com/google/android/gms/wearable/Wearable.java diff --git a/src/org/microg/gms/wearable/DataApiImpl.java b/play-services-wearable/src/main/java/org/microg/gms/wearable/DataApiImpl.java similarity index 100% rename from src/org/microg/gms/wearable/DataApiImpl.java rename to play-services-wearable/src/main/java/org/microg/gms/wearable/DataApiImpl.java diff --git a/src/org/microg/gms/wearable/MessageApiImpl.java b/play-services-wearable/src/main/java/org/microg/gms/wearable/MessageApiImpl.java similarity index 100% rename from src/org/microg/gms/wearable/MessageApiImpl.java rename to play-services-wearable/src/main/java/org/microg/gms/wearable/MessageApiImpl.java diff --git a/src/org/microg/gms/wearable/NodeApiImpl.java b/play-services-wearable/src/main/java/org/microg/gms/wearable/NodeApiImpl.java similarity index 100% rename from src/org/microg/gms/wearable/NodeApiImpl.java rename to play-services-wearable/src/main/java/org/microg/gms/wearable/NodeApiImpl.java diff --git a/src/org/microg/gms/wearable/WearableApiBuilder.java b/play-services-wearable/src/main/java/org/microg/gms/wearable/WearableApiBuilder.java similarity index 100% rename from src/org/microg/gms/wearable/WearableApiBuilder.java rename to play-services-wearable/src/main/java/org/microg/gms/wearable/WearableApiBuilder.java diff --git a/play-services/build.gradle b/play-services/build.gradle new file mode 100644 index 00000000..4d357641 --- /dev/null +++ b/play-services/build.gradle @@ -0,0 +1,14 @@ +apply plugin: 'com.android.library' +apply plugin: 'com.github.dcendents.android-maven' + +dependencies { + compile 'com.android.support:support-v4:21.0.3' + compile project(':play-services-base') + compile project(':play-services-location') + compile project(':play-services-wearable') +} + +android { + compileSdkVersion 21 + buildToolsVersion "22.0.0" +} diff --git a/res/values/version.xml b/play-services/res/values/version.xml similarity index 100% rename from res/values/version.xml rename to play-services/res/values/version.xml diff --git a/play-services/src/main/AndroidManifest.xml b/play-services/src/main/AndroidManifest.xml new file mode 100644 index 00000000..9fa720e3 --- /dev/null +++ b/play-services/src/main/AndroidManifest.xml @@ -0,0 +1,6 @@ + + + + + diff --git a/settings.gradle b/settings.gradle index 87e5535f..c87b1990 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1,8 @@ -include ':GmsApi', ':SafeParcel' +include ':SafeParcel' +include ':play-services-api' + +include ':play-services-base' +include ':play-services-location' +include ':play-services-wearable' + +include ':play-services' From dbae4add94505fb0765ca9a18896848df6ae6ae4 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Fri, 13 Mar 2015 02:32:32 +0100 Subject: [PATCH 055/293] Make older gradle happy --- src/main/AndroidManifest.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/AndroidManifest.xml b/src/main/AndroidManifest.xml index 7bef5e7d..52b6af60 100644 --- a/src/main/AndroidManifest.xml +++ b/src/main/AndroidManifest.xml @@ -3,4 +3,6 @@ package="org.microg.gms.api"> + + From d47deb067f661d777ff02ce04e9910cd2f205555 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Fri, 13 Mar 2015 02:24:01 +0100 Subject: [PATCH 056/293] Various fixes for gradle/maven --- .gitignore | 1 + play-services-api | 2 +- play-services-base/src/main/AndroidManifest.xml | 2 ++ .../src/main}/res/values/version.xml | 0 play-services-location/src/main/AndroidManifest.xml | 2 +- play-services-wearable/src/main/AndroidManifest.xml | 4 +++- play-services/build.gradle | 1 - play-services/src/main/AndroidManifest.xml | 4 +++- 8 files changed, 11 insertions(+), 5 deletions(-) rename {play-services => play-services-base/src/main}/res/values/version.xml (100%) diff --git a/.gitignore b/.gitignore index 5a0e68a2..769ee68c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ out/ build/ +.idea/ *.iml local.properties .gradle/ diff --git a/play-services-api b/play-services-api index d2ec5f52..dbae4add 160000 --- a/play-services-api +++ b/play-services-api @@ -1 +1 @@ -Subproject commit d2ec5f52fa6c1aed0640e65130b20e3ffce5f8b0 +Subproject commit dbae4add94505fb0765ca9a18896848df6ae6ae4 diff --git a/play-services-base/src/main/AndroidManifest.xml b/play-services-base/src/main/AndroidManifest.xml index 9fa720e3..d3685676 100644 --- a/play-services-base/src/main/AndroidManifest.xml +++ b/play-services-base/src/main/AndroidManifest.xml @@ -3,4 +3,6 @@ package="com.google.android.gms"> + + diff --git a/play-services/res/values/version.xml b/play-services-base/src/main/res/values/version.xml similarity index 100% rename from play-services/res/values/version.xml rename to play-services-base/src/main/res/values/version.xml diff --git a/play-services-location/src/main/AndroidManifest.xml b/play-services-location/src/main/AndroidManifest.xml index b0fcdc8e..32fad327 100644 --- a/play-services-location/src/main/AndroidManifest.xml +++ b/play-services-location/src/main/AndroidManifest.xml @@ -1,6 +1,6 @@ + package="org.microg.gms.location"> diff --git a/play-services-wearable/src/main/AndroidManifest.xml b/play-services-wearable/src/main/AndroidManifest.xml index 9fa720e3..33723d79 100644 --- a/play-services-wearable/src/main/AndroidManifest.xml +++ b/play-services-wearable/src/main/AndroidManifest.xml @@ -1,6 +1,8 @@ + package="org.microg.gms.wearable"> + + diff --git a/play-services/build.gradle b/play-services/build.gradle index 4d357641..1646fc2f 100644 --- a/play-services/build.gradle +++ b/play-services/build.gradle @@ -2,7 +2,6 @@ apply plugin: 'com.android.library' apply plugin: 'com.github.dcendents.android-maven' dependencies { - compile 'com.android.support:support-v4:21.0.3' compile project(':play-services-base') compile project(':play-services-location') compile project(':play-services-wearable') diff --git a/play-services/src/main/AndroidManifest.xml b/play-services/src/main/AndroidManifest.xml index 9fa720e3..336be92b 100644 --- a/play-services/src/main/AndroidManifest.xml +++ b/play-services/src/main/AndroidManifest.xml @@ -1,6 +1,8 @@ + package="org.microg.gms"> + + From 76602a343f6655be951b71277cbba97146139ca5 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Fri, 13 Mar 2015 03:08:00 +0100 Subject: [PATCH 057/293] Update DashClock example --- README.md | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index d03a1ce4..1154cef8 100644 --- a/README.md +++ b/README.md @@ -15,11 +15,32 @@ Example: DashClock However it uses play services as location backend and thus requires proprietary libraries to compile it. However, it is possible to build DashClock using GmsLib, supporting all it's location features, with or without play services installed. -To do this, download and build GmsLib plus its submodules and copy the three resulting .aar files (SafeParcel.aar, GmsApi.aar, GmsLib.aar) to `$DASHCLOCK_DIR/local_aars/`. -Then replace `compile 'com.google.android.gms:play-services:4.0.30'` in `$DASHCLOCK_SRC/main/build.gradle` with +To do this, download and build GmsLib plus its submodules and install it to the local gradle repository: - compile(name:'GmsLib', ext:'aar') - compile(name:'GmsApi', ext:'aar') - compile(name:'SafeParcel', ext:'aar') + $ git clone https://github.com/microg/android_external_GmsLib.git GmsLib + $ cd GmsLib + $ git submodule update --init --recursive + $ gradle install -and build as usual. +Then update the main/build.gradle to point to non-google gms in local maven: + + repositories { + + maven { url "${System.env.HOME}/.m2/repository" } // This can be mavenLocal() since Gradle 2.0 + mavenCentral() + flatDir { + dirs '../local_aars' + } + } + + dependencies { + compile 'com.android.support:support-v13:22.0.0' + - compile 'com.google.android.gms:play-services:4.0.30' + + compile 'org.microg.gms:play-services:1.0-SNAPSHOT' + //compile 'com.mobeta.android.dslv:drag-sort-listview:0.6.1-SNAPSHOT-AAR' + compile 'com.mobeta.android.dslv:drag-sort-listview:0.6.1-SNAPSHOT-AAR@aar' + compile project(':api') + } + +Afterwards you can compile dashclock the usual way: + + $ gradle :main:assembleDebug From c24447d5d32e4c35cf412a16ad7e5353ed33c5bf Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Fri, 13 Mar 2015 03:15:24 +0100 Subject: [PATCH 058/293] Allow sub-projects to exist stand-alone --- build.gradle | 10 ---------- play-services-base/build.gradle | 12 +++++++++++- play-services-location/build.gradle | 10 ++++++++++ play-services-wearable/build.gradle | 14 ++++++++++++-- play-services/build.gradle | 12 +++++++++++- 5 files changed, 44 insertions(+), 14 deletions(-) diff --git a/build.gradle b/build.gradle index 252327cb..135b35aa 100644 --- a/build.gradle +++ b/build.gradle @@ -1,15 +1,5 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. subprojects { - buildscript { - repositories { - mavenCentral() - } - dependencies { - classpath 'com.android.tools.build:gradle:1.0.1' - classpath 'com.github.dcendents:android-maven-plugin:1.2' - } - } - group = 'org.microg.gms' version = '1.0-SNAPSHOT' } \ No newline at end of file diff --git a/play-services-base/build.gradle b/play-services-base/build.gradle index 8a308f2f..c6903999 100644 --- a/play-services-base/build.gradle +++ b/play-services-base/build.gradle @@ -1,3 +1,13 @@ +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:1.0.1' + classpath 'com.github.dcendents:android-maven-plugin:1.2' + } +} + apply plugin: 'com.android.library' apply plugin: 'com.github.dcendents.android-maven' @@ -8,5 +18,5 @@ dependencies { android { compileSdkVersion 22 - buildToolsVersion "21.1.2" + buildToolsVersion "22.0.0" } diff --git a/play-services-location/build.gradle b/play-services-location/build.gradle index f79b92c5..918f297c 100644 --- a/play-services-location/build.gradle +++ b/play-services-location/build.gradle @@ -1,3 +1,13 @@ +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:1.0.1' + classpath 'com.github.dcendents:android-maven-plugin:1.2' + } +} + apply plugin: 'com.android.library' apply plugin: 'com.github.dcendents.android-maven' diff --git a/play-services-wearable/build.gradle b/play-services-wearable/build.gradle index 5e701f76..923eb4b0 100644 --- a/play-services-wearable/build.gradle +++ b/play-services-wearable/build.gradle @@ -1,3 +1,13 @@ +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:1.0.1' + classpath 'com.github.dcendents:android-maven-plugin:1.2' + } +} + apply plugin: 'com.android.library' apply plugin: 'com.github.dcendents.android-maven' @@ -6,6 +16,6 @@ dependencies { } android { - compileSdkVersion 21 - buildToolsVersion "21.1.2" + compileSdkVersion 22 + buildToolsVersion "22.0.0" } diff --git a/play-services/build.gradle b/play-services/build.gradle index 1646fc2f..1f73cbcc 100644 --- a/play-services/build.gradle +++ b/play-services/build.gradle @@ -1,3 +1,13 @@ +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:1.0.1' + classpath 'com.github.dcendents:android-maven-plugin:1.2' + } +} + apply plugin: 'com.android.library' apply plugin: 'com.github.dcendents.android-maven' @@ -8,6 +18,6 @@ dependencies { } android { - compileSdkVersion 21 + compileSdkVersion 22 buildToolsVersion "22.0.0" } From c0c4a78eab3064cdd7545cb7fcdddfe93ca1674d Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Sat, 14 Mar 2015 22:09:18 +0100 Subject: [PATCH 059/293] Update safe-parcel --- .gitmodules | 2 +- Android.mk | 4 ++-- SafeParcel | 1 - extern/SafeParcel | 1 + build.gradle => play-services-api/build.gradle | 4 ++-- {src => play-services-api/src}/main/AndroidManifest.xml | 0 .../aidl/com/google/android/auth/IAuthManagerService.aidl | 0 .../com/google/android/gms/appdatasearch/CorpusStatus.aidl | 0 .../android/gms/appdatasearch/SuggestSpecification.aidl | 0 .../google/android/gms/appdatasearch/SuggestionResults.aidl | 0 .../aidl/com/google/android/gms/appdatasearch/UsageInfo.aidl | 0 .../android/gms/appdatasearch/internal/IAppDataSearch.aidl | 0 .../appdatasearch/internal/ILightweightAppDataSearch.aidl | 0 .../internal/ILightweightAppDataSearchCallbacks.aidl | 0 .../google/android/gms/auth/AccountChangeEventsRequest.aidl | 0 .../google/android/gms/auth/AccountChangeEventsResponse.aidl | 0 .../aidl/com/google/android/gms/common/data/DataHolder.aidl | 0 .../com/google/android/gms/common/internal/ICancelToken.aidl | 0 .../google/android/gms/common/internal/IGmsCallbacks.aidl | 0 .../android/gms/common/internal/IGmsServiceBroker.aidl | 0 .../android/gms/common/internal/ISignInButtonCreator.aidl | 0 .../android/gms/common/server/FavaDiagnosticsEntity.aidl | 0 .../aidl/com/google/android/gms/dynamic/IObjectWrapper.aidl | 0 .../main/aidl/com/google/android/gms/location/Geofence.aidl | 0 .../com/google/android/gms/location/GeofencingRequest.aidl | 0 .../com/google/android/gms/location/ILocationListener.aidl | 0 .../com/google/android/gms/location/LocationRequest.aidl | 0 .../aidl/com/google/android/gms/location/LocationStatus.aidl | 0 .../android/gms/location/internal/IGeofencerCallbacks.aidl | 0 .../gms/location/internal/IGoogleLocationManagerService.aidl | 0 .../gms/location/internal/LocationRequestInternal.aidl | 0 .../android/gms/location/places/AutocompleteFilter.aidl | 0 .../android/gms/location/places/NearbyAlertRequest.aidl | 0 .../com/google/android/gms/location/places/PlaceFilter.aidl | 0 .../com/google/android/gms/location/places/PlaceReport.aidl | 0 .../com/google/android/gms/location/places/PlaceRequest.aidl | 0 .../google/android/gms/location/places/UserAddedPlace.aidl | 0 .../com/google/android/gms/location/places/UserDataType.aidl | 0 .../gms/location/places/internal/IPlacesCallbacks.aidl | 0 .../android/gms/location/places/internal/PlacesParams.aidl | 0 .../android/gms/location/reporting/ReportingState.aidl | 0 .../gms/location/reporting/internal/IReportingService.aidl | 0 .../aidl/com/google/android/gms/maps/GoogleMapOptions.aidl | 0 .../gms/maps/internal/ICameraUpdateFactoryDelegate.aidl | 0 .../android/gms/maps/internal/ICancelableCallback.aidl | 0 .../aidl/com/google/android/gms/maps/internal/ICreator.aidl | 0 .../google/android/gms/maps/internal/IGoogleMapDelegate.aidl | 0 .../google/android/gms/maps/internal/IInfoWindowAdapter.aidl | 0 .../android/gms/maps/internal/ILocationSourceDelegate.aidl | 0 .../android/gms/maps/internal/IMapFragmentDelegate.aidl | 0 .../google/android/gms/maps/internal/IMapViewDelegate.aidl | 0 .../android/gms/maps/internal/IOnCameraChangeListener.aidl | 0 .../gms/maps/internal/IOnInfoWindowClickListener.aidl | 0 .../android/gms/maps/internal/IOnMapClickListener.aidl | 0 .../android/gms/maps/internal/IOnMapLoadedCallback.aidl | 0 .../android/gms/maps/internal/IOnMapLongClickListener.aidl | 0 .../android/gms/maps/internal/IOnMarkerClickListener.aidl | 0 .../android/gms/maps/internal/IOnMarkerDragListener.aidl | 0 .../gms/maps/internal/IOnMyLocationButtonClickListener.aidl | 0 .../gms/maps/internal/IOnMyLocationChangeListener.aidl | 0 .../android/gms/maps/internal/IProjectionDelegate.aidl | 0 .../android/gms/maps/internal/ISnapshotReadyCallback.aidl | 0 .../android/gms/maps/internal/IUiSettingsDelegate.aidl | 0 .../com/google/android/gms/maps/model/CameraPosition.aidl | 0 .../com/google/android/gms/maps/model/CircleOptions.aidl | 0 .../google/android/gms/maps/model/GroundOverlayOptions.aidl | 0 .../main/aidl/com/google/android/gms/maps/model/LatLng.aidl | 0 .../aidl/com/google/android/gms/maps/model/LatLngBounds.aidl | 0 .../com/google/android/gms/maps/model/MarkerOptions.aidl | 0 .../com/google/android/gms/maps/model/PolygonOptions.aidl | 0 .../com/google/android/gms/maps/model/PolylineOptions.aidl | 0 .../main/aidl/com/google/android/gms/maps/model/Tile.aidl | 0 .../google/android/gms/maps/model/TileOverlayOptions.aidl | 0 .../com/google/android/gms/maps/model/VisibleRegion.aidl | 0 .../model/internal/IBitmapDescriptorFactoryDelegate.aidl | 0 .../android/gms/maps/model/internal/ICircleDelegate.aidl | 0 .../gms/maps/model/internal/IGroundOverlayDelegate.aidl | 0 .../android/gms/maps/model/internal/IMarkerDelegate.aidl | 0 .../android/gms/maps/model/internal/IPolygonDelegate.aidl | 0 .../android/gms/maps/model/internal/IPolylineDelegate.aidl | 0 .../gms/maps/model/internal/ITileOverlayDelegate.aidl | 0 .../gms/maps/model/internal/ITileProviderDelegate.aidl | 0 .../google/android/gms/people/internal/IPeopleCallbacks.aidl | 0 .../google/android/gms/people/internal/IPeopleService.aidl | 0 .../android/gms/plus/internal/IPlusOneButtonCreator.aidl | 0 .../com/google/android/gms/appdatasearch/CorpusStatus.java | 0 .../android/gms/appdatasearch/SuggestSpecification.java | 0 .../google/android/gms/appdatasearch/SuggestionResults.java | 0 .../java/com/google/android/gms/appdatasearch/UsageInfo.java | 0 .../java/com/google/android/gms/auth/AccountChangeEvent.java | 0 .../google/android/gms/auth/AccountChangeEventsRequest.java | 0 .../google/android/gms/auth/AccountChangeEventsResponse.java | 0 .../gms/auth/firstparty/dataservice/TokenRequest.java | 0 .../gms/auth/firstparty/dataservice/TokenResponse.java | 0 .../android/gms/auth/firstparty/proximity/data/Permit.java | 0 .../src}/main/java/com/google/android/gms/common/Scopes.java | 0 .../java/com/google/android/gms/common/api/AccountInfo.java | 0 .../com/google/android/gms/common/api/CommonStatusCodes.java | 0 .../main/java/com/google/android/gms/common/api/Result.java | 0 .../main/java/com/google/android/gms/common/api/Scope.java | 0 .../main/java/com/google/android/gms/common/api/Status.java | 0 .../java/com/google/android/gms/common/data/DataHolder.java | 0 .../android/gms/common/server/FavaDiagnosticsEntity.java | 0 .../android/gms/drive/metadata/internal/MetadataBundle.java | 0 .../java/com/google/android/gms/dynamic/ObjectWrapper.java | 0 .../java/com/google/android/gms/fitness/data/DataPoint.java | 0 .../java/com/google/android/gms/fitness/data/Device.java | 0 .../main/java/com/google/android/gms/fitness/data/Field.java | 0 .../main/java/com/google/android/gms/fitness/data/Value.java | 0 .../android/gms/identity/accounts/api/AccountData.java | 0 .../gms/identity/intents/model/CountrySpecification.java | 0 .../android/gms/identity/intents/model/UserAddress.java | 0 .../main/java/com/google/android/gms/location/Geofence.java | 0 .../com/google/android/gms/location/GeofencingRequest.java | 0 .../com/google/android/gms/location/LocationRequest.java | 0 .../java/com/google/android/gms/location/LocationStatus.java | 0 .../google/android/gms/location/internal/ClientIdentity.java | 0 .../gms/location/internal/LocationRequestInternal.java | 0 .../android/gms/location/places/AutocompleteFilter.java | 0 .../android/gms/location/places/NearbyAlertRequest.java | 0 .../com/google/android/gms/location/places/PlaceFilter.java | 0 .../com/google/android/gms/location/places/PlaceReport.java | 0 .../com/google/android/gms/location/places/PlaceRequest.java | 0 .../google/android/gms/location/places/UserAddedPlace.java | 0 .../com/google/android/gms/location/places/UserDataType.java | 0 .../android/gms/location/places/internal/PlacesParams.java | 0 .../android/gms/location/reporting/ReportingState.java | 0 .../java/com/google/android/gms/maps/GoogleMapOptions.java | 0 .../google/android/gms/maps/StreetViewPanoramaOptions.java | 0 .../java/com/google/android/gms/maps/internal/Point.java | 0 .../com/google/android/gms/maps/model/BitmapDescriptor.java | 0 .../com/google/android/gms/maps/model/CameraPosition.java | 0 .../com/google/android/gms/maps/model/CircleOptions.java | 0 .../google/android/gms/maps/model/GroundOverlayOptions.java | 0 .../main/java/com/google/android/gms/maps/model/LatLng.java | 0 .../java/com/google/android/gms/maps/model/LatLngBounds.java | 0 .../com/google/android/gms/maps/model/MarkerOptions.java | 0 .../com/google/android/gms/maps/model/PolygonOptions.java | 0 .../com/google/android/gms/maps/model/PolylineOptions.java | 0 .../android/gms/maps/model/StreetViewPanoramaCamera.java | 0 .../android/gms/maps/model/StreetViewPanoramaLink.java | 0 .../android/gms/maps/model/StreetViewPanoramaLocation.java | 0 .../gms/maps/model/StreetViewPanoramaOrientation.java | 0 .../main/java/com/google/android/gms/maps/model/Tile.java | 0 .../google/android/gms/maps/model/TileOverlayOptions.java | 0 .../java/com/google/android/gms/maps/model/TileProvider.java | 0 .../com/google/android/gms/maps/model/VisibleRegion.java | 0 .../java/com/google/android/gms/maps/model/package-info.java | 0 .../com/google/android/gms/people/model/AccountMetadata.java | 0 .../google/android/gms/plus/internal/PlusCommonExtras.java | 0 .../com/google/android/gms/plus/internal/PlusSession.java | 0 .../gms/plus/internal/model/smart_profile/CardsRequest.java | 0 .../gms/plus/internal/model/smart_profile/CardsResponse.java | 0 .../model/smart_profile/PeopleForProfilesRequest.java | 0 .../model/smart_profile/PeopleForProfilesResponse.java | 0 .../com/google/android/gms/plus/model/posts/Comment.java | 0 .../java/com/google/android/gms/plus/model/posts/Post.java | 0 .../com/google/android/gms/plus/model/posts/Settings.java | 0 .../google/android/gms/wearable/ConnectionConfiguration.java | 0 .../src}/main/java/com/google/android/gms/wearable/Node.java | 0 .../com/google/android/gms/wearable/WearableStatusCodes.java | 0 .../google/android/gms/wearable/internal/NodeParcelable.java | 0 .../src}/main/java/org/microg/gms/common/Constants.java | 0 .../src}/main/java/org/microg/gms/common/PublicApi.java | 0 safe-parcel | 1 + settings.gradle | 5 ++--- 166 files changed, 9 insertions(+), 9 deletions(-) delete mode 160000 SafeParcel create mode 160000 extern/SafeParcel rename build.gradle => play-services-api/build.gradle (87%) rename {src => play-services-api/src}/main/AndroidManifest.xml (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/auth/IAuthManagerService.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/appdatasearch/CorpusStatus.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/appdatasearch/SuggestSpecification.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/appdatasearch/SuggestionResults.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/appdatasearch/UsageInfo.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/appdatasearch/internal/IAppDataSearch.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/appdatasearch/internal/ILightweightAppDataSearch.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/appdatasearch/internal/ILightweightAppDataSearchCallbacks.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/auth/AccountChangeEventsRequest.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/auth/AccountChangeEventsResponse.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/common/data/DataHolder.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/common/internal/ICancelToken.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/common/internal/IGmsCallbacks.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/common/internal/IGmsServiceBroker.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/common/internal/ISignInButtonCreator.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/common/server/FavaDiagnosticsEntity.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/dynamic/IObjectWrapper.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/location/Geofence.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/location/GeofencingRequest.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/location/ILocationListener.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/location/LocationRequest.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/location/LocationStatus.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/location/internal/IGeofencerCallbacks.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/location/internal/IGoogleLocationManagerService.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/location/internal/LocationRequestInternal.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/location/places/AutocompleteFilter.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/location/places/NearbyAlertRequest.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/location/places/PlaceFilter.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/location/places/PlaceReport.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/location/places/PlaceRequest.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/location/places/UserAddedPlace.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/location/places/UserDataType.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/location/places/internal/IPlacesCallbacks.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/location/places/internal/PlacesParams.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/location/reporting/ReportingState.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/location/reporting/internal/IReportingService.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/maps/GoogleMapOptions.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/maps/internal/ICameraUpdateFactoryDelegate.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/maps/internal/ICancelableCallback.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/maps/internal/ICreator.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/maps/internal/IGoogleMapDelegate.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/maps/internal/IInfoWindowAdapter.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/maps/internal/ILocationSourceDelegate.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/maps/internal/IMapFragmentDelegate.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/maps/internal/IMapViewDelegate.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/maps/internal/IOnCameraChangeListener.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/maps/internal/IOnInfoWindowClickListener.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/maps/internal/IOnMapClickListener.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/maps/internal/IOnMapLoadedCallback.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/maps/internal/IOnMapLongClickListener.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/maps/internal/IOnMarkerClickListener.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/maps/internal/IOnMarkerDragListener.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/maps/internal/IOnMyLocationButtonClickListener.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/maps/internal/IOnMyLocationChangeListener.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/maps/internal/IProjectionDelegate.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/maps/internal/ISnapshotReadyCallback.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/maps/internal/IUiSettingsDelegate.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/maps/model/CameraPosition.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/maps/model/CircleOptions.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/maps/model/GroundOverlayOptions.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/maps/model/LatLng.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/maps/model/LatLngBounds.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/maps/model/MarkerOptions.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/maps/model/PolygonOptions.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/maps/model/PolylineOptions.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/maps/model/Tile.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/maps/model/TileOverlayOptions.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/maps/model/VisibleRegion.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/maps/model/internal/IBitmapDescriptorFactoryDelegate.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/maps/model/internal/ICircleDelegate.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/maps/model/internal/IGroundOverlayDelegate.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/maps/model/internal/IMarkerDelegate.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/maps/model/internal/IPolygonDelegate.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/maps/model/internal/IPolylineDelegate.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/maps/model/internal/ITileOverlayDelegate.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/maps/model/internal/ITileProviderDelegate.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/people/internal/IPeopleCallbacks.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/people/internal/IPeopleService.aidl (100%) rename {src => play-services-api/src}/main/aidl/com/google/android/gms/plus/internal/IPlusOneButtonCreator.aidl (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/appdatasearch/CorpusStatus.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/appdatasearch/SuggestSpecification.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/appdatasearch/SuggestionResults.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/appdatasearch/UsageInfo.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/auth/AccountChangeEvent.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/auth/AccountChangeEventsRequest.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/auth/AccountChangeEventsResponse.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/auth/firstparty/dataservice/TokenRequest.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/auth/firstparty/dataservice/TokenResponse.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/auth/firstparty/proximity/data/Permit.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/common/Scopes.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/common/api/AccountInfo.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/common/api/CommonStatusCodes.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/common/api/Result.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/common/api/Scope.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/common/api/Status.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/common/data/DataHolder.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/common/server/FavaDiagnosticsEntity.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/drive/metadata/internal/MetadataBundle.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/dynamic/ObjectWrapper.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/fitness/data/DataPoint.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/fitness/data/Device.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/fitness/data/Field.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/fitness/data/Value.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/identity/accounts/api/AccountData.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/identity/intents/model/CountrySpecification.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/identity/intents/model/UserAddress.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/location/Geofence.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/location/GeofencingRequest.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/location/LocationRequest.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/location/LocationStatus.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/location/internal/ClientIdentity.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/location/internal/LocationRequestInternal.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/location/places/AutocompleteFilter.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/location/places/NearbyAlertRequest.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/location/places/PlaceFilter.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/location/places/PlaceReport.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/location/places/PlaceRequest.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/location/places/UserAddedPlace.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/location/places/UserDataType.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/location/places/internal/PlacesParams.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/location/reporting/ReportingState.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/maps/GoogleMapOptions.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/maps/StreetViewPanoramaOptions.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/maps/internal/Point.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/maps/model/BitmapDescriptor.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/maps/model/CameraPosition.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/maps/model/CircleOptions.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/maps/model/GroundOverlayOptions.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/maps/model/LatLng.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/maps/model/LatLngBounds.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/maps/model/MarkerOptions.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/maps/model/PolygonOptions.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/maps/model/PolylineOptions.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/maps/model/StreetViewPanoramaCamera.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/maps/model/StreetViewPanoramaLink.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/maps/model/StreetViewPanoramaLocation.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/maps/model/StreetViewPanoramaOrientation.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/maps/model/Tile.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/maps/model/TileOverlayOptions.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/maps/model/TileProvider.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/maps/model/VisibleRegion.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/maps/model/package-info.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/people/model/AccountMetadata.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/plus/internal/PlusCommonExtras.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/plus/internal/PlusSession.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/plus/internal/model/smart_profile/CardsRequest.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/plus/internal/model/smart_profile/CardsResponse.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/plus/internal/model/smart_profile/PeopleForProfilesRequest.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/plus/internal/model/smart_profile/PeopleForProfilesResponse.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/plus/model/posts/Comment.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/plus/model/posts/Post.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/plus/model/posts/Settings.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/wearable/ConnectionConfiguration.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/wearable/Node.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/wearable/WearableStatusCodes.java (100%) rename {src => play-services-api/src}/main/java/com/google/android/gms/wearable/internal/NodeParcelable.java (100%) rename {src => play-services-api/src}/main/java/org/microg/gms/common/Constants.java (100%) rename {src => play-services-api/src}/main/java/org/microg/gms/common/PublicApi.java (100%) create mode 120000 safe-parcel diff --git a/.gitmodules b/.gitmodules index 20fd0301..134f71c7 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "SafeParcel"] - path = SafeParcel + path = extern/SafeParcel url = https://github.com/microg/android_external_SafeParcel.git diff --git a/Android.mk b/Android.mk index 88845431..fb4008de 100644 --- a/Android.mk +++ b/Android.mk @@ -3,8 +3,8 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := GmsApi -LOCAL_SRC_FILES := $(call all-java-files-under, src/main/java) -LOCAL_SRC_FILES := $(call all-Iaidl-files-under, src/main/aidl) +LOCAL_SRC_FILES := $(call all-java-files-under, play-services-api/src/main/java) +LOCAL_SRC_FILES := $(call all-Iaidl-files-under, play-services-api/src/main/aidl) LOCAL_STATIC_JAVA_LIBRARIES := SafeParcel include $(BUILD_STATIC_JAVA_LIBRARY) diff --git a/SafeParcel b/SafeParcel deleted file mode 160000 index 0bb4f3d6..00000000 --- a/SafeParcel +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 0bb4f3d602d8565bbf500a880f563a2b1fa47d1d diff --git a/extern/SafeParcel b/extern/SafeParcel new file mode 160000 index 00000000..454265fd --- /dev/null +++ b/extern/SafeParcel @@ -0,0 +1 @@ +Subproject commit 454265fd3ee465cc0741a57f3a74a6e747c2fcd5 diff --git a/build.gradle b/play-services-api/build.gradle similarity index 87% rename from build.gradle rename to play-services-api/build.gradle index cd548167..2e94b779 100644 --- a/build.gradle +++ b/play-services-api/build.gradle @@ -11,11 +11,11 @@ buildscript { apply plugin: 'com.android.library' apply plugin: 'com.github.dcendents.android-maven' -group = 'org.microg.gms' +group = 'org.microg' version = '1.0-SNAPSHOT' dependencies { - compile project(':SafeParcel') + compile project(':safe-parcel') } android { diff --git a/src/main/AndroidManifest.xml b/play-services-api/src/main/AndroidManifest.xml similarity index 100% rename from src/main/AndroidManifest.xml rename to play-services-api/src/main/AndroidManifest.xml diff --git a/src/main/aidl/com/google/android/auth/IAuthManagerService.aidl b/play-services-api/src/main/aidl/com/google/android/auth/IAuthManagerService.aidl similarity index 100% rename from src/main/aidl/com/google/android/auth/IAuthManagerService.aidl rename to play-services-api/src/main/aidl/com/google/android/auth/IAuthManagerService.aidl diff --git a/src/main/aidl/com/google/android/gms/appdatasearch/CorpusStatus.aidl b/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/CorpusStatus.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/appdatasearch/CorpusStatus.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/CorpusStatus.aidl diff --git a/src/main/aidl/com/google/android/gms/appdatasearch/SuggestSpecification.aidl b/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/SuggestSpecification.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/appdatasearch/SuggestSpecification.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/SuggestSpecification.aidl diff --git a/src/main/aidl/com/google/android/gms/appdatasearch/SuggestionResults.aidl b/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/SuggestionResults.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/appdatasearch/SuggestionResults.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/SuggestionResults.aidl diff --git a/src/main/aidl/com/google/android/gms/appdatasearch/UsageInfo.aidl b/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/UsageInfo.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/appdatasearch/UsageInfo.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/UsageInfo.aidl diff --git a/src/main/aidl/com/google/android/gms/appdatasearch/internal/IAppDataSearch.aidl b/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/internal/IAppDataSearch.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/appdatasearch/internal/IAppDataSearch.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/internal/IAppDataSearch.aidl diff --git a/src/main/aidl/com/google/android/gms/appdatasearch/internal/ILightweightAppDataSearch.aidl b/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/internal/ILightweightAppDataSearch.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/appdatasearch/internal/ILightweightAppDataSearch.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/internal/ILightweightAppDataSearch.aidl diff --git a/src/main/aidl/com/google/android/gms/appdatasearch/internal/ILightweightAppDataSearchCallbacks.aidl b/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/internal/ILightweightAppDataSearchCallbacks.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/appdatasearch/internal/ILightweightAppDataSearchCallbacks.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/internal/ILightweightAppDataSearchCallbacks.aidl diff --git a/src/main/aidl/com/google/android/gms/auth/AccountChangeEventsRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/auth/AccountChangeEventsRequest.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/auth/AccountChangeEventsRequest.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/auth/AccountChangeEventsRequest.aidl diff --git a/src/main/aidl/com/google/android/gms/auth/AccountChangeEventsResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/auth/AccountChangeEventsResponse.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/auth/AccountChangeEventsResponse.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/auth/AccountChangeEventsResponse.aidl diff --git a/src/main/aidl/com/google/android/gms/common/data/DataHolder.aidl b/play-services-api/src/main/aidl/com/google/android/gms/common/data/DataHolder.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/common/data/DataHolder.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/common/data/DataHolder.aidl diff --git a/src/main/aidl/com/google/android/gms/common/internal/ICancelToken.aidl b/play-services-api/src/main/aidl/com/google/android/gms/common/internal/ICancelToken.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/common/internal/ICancelToken.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/common/internal/ICancelToken.aidl diff --git a/src/main/aidl/com/google/android/gms/common/internal/IGmsCallbacks.aidl b/play-services-api/src/main/aidl/com/google/android/gms/common/internal/IGmsCallbacks.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/common/internal/IGmsCallbacks.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/common/internal/IGmsCallbacks.aidl diff --git a/src/main/aidl/com/google/android/gms/common/internal/IGmsServiceBroker.aidl b/play-services-api/src/main/aidl/com/google/android/gms/common/internal/IGmsServiceBroker.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/common/internal/IGmsServiceBroker.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/common/internal/IGmsServiceBroker.aidl diff --git a/src/main/aidl/com/google/android/gms/common/internal/ISignInButtonCreator.aidl b/play-services-api/src/main/aidl/com/google/android/gms/common/internal/ISignInButtonCreator.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/common/internal/ISignInButtonCreator.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/common/internal/ISignInButtonCreator.aidl diff --git a/src/main/aidl/com/google/android/gms/common/server/FavaDiagnosticsEntity.aidl b/play-services-api/src/main/aidl/com/google/android/gms/common/server/FavaDiagnosticsEntity.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/common/server/FavaDiagnosticsEntity.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/common/server/FavaDiagnosticsEntity.aidl diff --git a/src/main/aidl/com/google/android/gms/dynamic/IObjectWrapper.aidl b/play-services-api/src/main/aidl/com/google/android/gms/dynamic/IObjectWrapper.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/dynamic/IObjectWrapper.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/dynamic/IObjectWrapper.aidl diff --git a/src/main/aidl/com/google/android/gms/location/Geofence.aidl b/play-services-api/src/main/aidl/com/google/android/gms/location/Geofence.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/location/Geofence.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/location/Geofence.aidl diff --git a/src/main/aidl/com/google/android/gms/location/GeofencingRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/location/GeofencingRequest.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/location/GeofencingRequest.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/location/GeofencingRequest.aidl diff --git a/src/main/aidl/com/google/android/gms/location/ILocationListener.aidl b/play-services-api/src/main/aidl/com/google/android/gms/location/ILocationListener.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/location/ILocationListener.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/location/ILocationListener.aidl diff --git a/src/main/aidl/com/google/android/gms/location/LocationRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/location/LocationRequest.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/location/LocationRequest.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/location/LocationRequest.aidl diff --git a/src/main/aidl/com/google/android/gms/location/LocationStatus.aidl b/play-services-api/src/main/aidl/com/google/android/gms/location/LocationStatus.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/location/LocationStatus.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/location/LocationStatus.aidl diff --git a/src/main/aidl/com/google/android/gms/location/internal/IGeofencerCallbacks.aidl b/play-services-api/src/main/aidl/com/google/android/gms/location/internal/IGeofencerCallbacks.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/location/internal/IGeofencerCallbacks.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/location/internal/IGeofencerCallbacks.aidl diff --git a/src/main/aidl/com/google/android/gms/location/internal/IGoogleLocationManagerService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/location/internal/IGoogleLocationManagerService.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/location/internal/IGoogleLocationManagerService.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/location/internal/IGoogleLocationManagerService.aidl diff --git a/src/main/aidl/com/google/android/gms/location/internal/LocationRequestInternal.aidl b/play-services-api/src/main/aidl/com/google/android/gms/location/internal/LocationRequestInternal.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/location/internal/LocationRequestInternal.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/location/internal/LocationRequestInternal.aidl diff --git a/src/main/aidl/com/google/android/gms/location/places/AutocompleteFilter.aidl b/play-services-api/src/main/aidl/com/google/android/gms/location/places/AutocompleteFilter.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/location/places/AutocompleteFilter.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/location/places/AutocompleteFilter.aidl diff --git a/src/main/aidl/com/google/android/gms/location/places/NearbyAlertRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/location/places/NearbyAlertRequest.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/location/places/NearbyAlertRequest.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/location/places/NearbyAlertRequest.aidl diff --git a/src/main/aidl/com/google/android/gms/location/places/PlaceFilter.aidl b/play-services-api/src/main/aidl/com/google/android/gms/location/places/PlaceFilter.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/location/places/PlaceFilter.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/location/places/PlaceFilter.aidl diff --git a/src/main/aidl/com/google/android/gms/location/places/PlaceReport.aidl b/play-services-api/src/main/aidl/com/google/android/gms/location/places/PlaceReport.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/location/places/PlaceReport.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/location/places/PlaceReport.aidl diff --git a/src/main/aidl/com/google/android/gms/location/places/PlaceRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/location/places/PlaceRequest.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/location/places/PlaceRequest.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/location/places/PlaceRequest.aidl diff --git a/src/main/aidl/com/google/android/gms/location/places/UserAddedPlace.aidl b/play-services-api/src/main/aidl/com/google/android/gms/location/places/UserAddedPlace.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/location/places/UserAddedPlace.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/location/places/UserAddedPlace.aidl diff --git a/src/main/aidl/com/google/android/gms/location/places/UserDataType.aidl b/play-services-api/src/main/aidl/com/google/android/gms/location/places/UserDataType.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/location/places/UserDataType.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/location/places/UserDataType.aidl diff --git a/src/main/aidl/com/google/android/gms/location/places/internal/IPlacesCallbacks.aidl b/play-services-api/src/main/aidl/com/google/android/gms/location/places/internal/IPlacesCallbacks.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/location/places/internal/IPlacesCallbacks.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/location/places/internal/IPlacesCallbacks.aidl diff --git a/src/main/aidl/com/google/android/gms/location/places/internal/PlacesParams.aidl b/play-services-api/src/main/aidl/com/google/android/gms/location/places/internal/PlacesParams.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/location/places/internal/PlacesParams.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/location/places/internal/PlacesParams.aidl diff --git a/src/main/aidl/com/google/android/gms/location/reporting/ReportingState.aidl b/play-services-api/src/main/aidl/com/google/android/gms/location/reporting/ReportingState.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/location/reporting/ReportingState.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/location/reporting/ReportingState.aidl diff --git a/src/main/aidl/com/google/android/gms/location/reporting/internal/IReportingService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/location/reporting/internal/IReportingService.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/location/reporting/internal/IReportingService.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/location/reporting/internal/IReportingService.aidl diff --git a/src/main/aidl/com/google/android/gms/maps/GoogleMapOptions.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/GoogleMapOptions.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/maps/GoogleMapOptions.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/maps/GoogleMapOptions.aidl diff --git a/src/main/aidl/com/google/android/gms/maps/internal/ICameraUpdateFactoryDelegate.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/ICameraUpdateFactoryDelegate.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/maps/internal/ICameraUpdateFactoryDelegate.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/maps/internal/ICameraUpdateFactoryDelegate.aidl diff --git a/src/main/aidl/com/google/android/gms/maps/internal/ICancelableCallback.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/ICancelableCallback.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/maps/internal/ICancelableCallback.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/maps/internal/ICancelableCallback.aidl diff --git a/src/main/aidl/com/google/android/gms/maps/internal/ICreator.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/ICreator.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/maps/internal/ICreator.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/maps/internal/ICreator.aidl diff --git a/src/main/aidl/com/google/android/gms/maps/internal/IGoogleMapDelegate.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IGoogleMapDelegate.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/maps/internal/IGoogleMapDelegate.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IGoogleMapDelegate.aidl diff --git a/src/main/aidl/com/google/android/gms/maps/internal/IInfoWindowAdapter.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IInfoWindowAdapter.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/maps/internal/IInfoWindowAdapter.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IInfoWindowAdapter.aidl diff --git a/src/main/aidl/com/google/android/gms/maps/internal/ILocationSourceDelegate.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/ILocationSourceDelegate.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/maps/internal/ILocationSourceDelegate.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/maps/internal/ILocationSourceDelegate.aidl diff --git a/src/main/aidl/com/google/android/gms/maps/internal/IMapFragmentDelegate.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IMapFragmentDelegate.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/maps/internal/IMapFragmentDelegate.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IMapFragmentDelegate.aidl diff --git a/src/main/aidl/com/google/android/gms/maps/internal/IMapViewDelegate.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IMapViewDelegate.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/maps/internal/IMapViewDelegate.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IMapViewDelegate.aidl diff --git a/src/main/aidl/com/google/android/gms/maps/internal/IOnCameraChangeListener.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnCameraChangeListener.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/maps/internal/IOnCameraChangeListener.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnCameraChangeListener.aidl diff --git a/src/main/aidl/com/google/android/gms/maps/internal/IOnInfoWindowClickListener.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnInfoWindowClickListener.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/maps/internal/IOnInfoWindowClickListener.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnInfoWindowClickListener.aidl diff --git a/src/main/aidl/com/google/android/gms/maps/internal/IOnMapClickListener.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnMapClickListener.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/maps/internal/IOnMapClickListener.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnMapClickListener.aidl diff --git a/src/main/aidl/com/google/android/gms/maps/internal/IOnMapLoadedCallback.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnMapLoadedCallback.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/maps/internal/IOnMapLoadedCallback.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnMapLoadedCallback.aidl diff --git a/src/main/aidl/com/google/android/gms/maps/internal/IOnMapLongClickListener.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnMapLongClickListener.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/maps/internal/IOnMapLongClickListener.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnMapLongClickListener.aidl diff --git a/src/main/aidl/com/google/android/gms/maps/internal/IOnMarkerClickListener.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnMarkerClickListener.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/maps/internal/IOnMarkerClickListener.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnMarkerClickListener.aidl diff --git a/src/main/aidl/com/google/android/gms/maps/internal/IOnMarkerDragListener.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnMarkerDragListener.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/maps/internal/IOnMarkerDragListener.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnMarkerDragListener.aidl diff --git a/src/main/aidl/com/google/android/gms/maps/internal/IOnMyLocationButtonClickListener.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnMyLocationButtonClickListener.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/maps/internal/IOnMyLocationButtonClickListener.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnMyLocationButtonClickListener.aidl diff --git a/src/main/aidl/com/google/android/gms/maps/internal/IOnMyLocationChangeListener.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnMyLocationChangeListener.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/maps/internal/IOnMyLocationChangeListener.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnMyLocationChangeListener.aidl diff --git a/src/main/aidl/com/google/android/gms/maps/internal/IProjectionDelegate.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IProjectionDelegate.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/maps/internal/IProjectionDelegate.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IProjectionDelegate.aidl diff --git a/src/main/aidl/com/google/android/gms/maps/internal/ISnapshotReadyCallback.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/ISnapshotReadyCallback.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/maps/internal/ISnapshotReadyCallback.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/maps/internal/ISnapshotReadyCallback.aidl diff --git a/src/main/aidl/com/google/android/gms/maps/internal/IUiSettingsDelegate.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IUiSettingsDelegate.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/maps/internal/IUiSettingsDelegate.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IUiSettingsDelegate.aidl diff --git a/src/main/aidl/com/google/android/gms/maps/model/CameraPosition.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/model/CameraPosition.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/maps/model/CameraPosition.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/maps/model/CameraPosition.aidl diff --git a/src/main/aidl/com/google/android/gms/maps/model/CircleOptions.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/model/CircleOptions.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/maps/model/CircleOptions.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/maps/model/CircleOptions.aidl diff --git a/src/main/aidl/com/google/android/gms/maps/model/GroundOverlayOptions.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/model/GroundOverlayOptions.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/maps/model/GroundOverlayOptions.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/maps/model/GroundOverlayOptions.aidl diff --git a/src/main/aidl/com/google/android/gms/maps/model/LatLng.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/model/LatLng.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/maps/model/LatLng.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/maps/model/LatLng.aidl diff --git a/src/main/aidl/com/google/android/gms/maps/model/LatLngBounds.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/model/LatLngBounds.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/maps/model/LatLngBounds.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/maps/model/LatLngBounds.aidl diff --git a/src/main/aidl/com/google/android/gms/maps/model/MarkerOptions.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/model/MarkerOptions.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/maps/model/MarkerOptions.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/maps/model/MarkerOptions.aidl diff --git a/src/main/aidl/com/google/android/gms/maps/model/PolygonOptions.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/model/PolygonOptions.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/maps/model/PolygonOptions.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/maps/model/PolygonOptions.aidl diff --git a/src/main/aidl/com/google/android/gms/maps/model/PolylineOptions.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/model/PolylineOptions.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/maps/model/PolylineOptions.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/maps/model/PolylineOptions.aidl diff --git a/src/main/aidl/com/google/android/gms/maps/model/Tile.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/model/Tile.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/maps/model/Tile.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/maps/model/Tile.aidl diff --git a/src/main/aidl/com/google/android/gms/maps/model/TileOverlayOptions.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/model/TileOverlayOptions.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/maps/model/TileOverlayOptions.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/maps/model/TileOverlayOptions.aidl diff --git a/src/main/aidl/com/google/android/gms/maps/model/VisibleRegion.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/model/VisibleRegion.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/maps/model/VisibleRegion.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/maps/model/VisibleRegion.aidl diff --git a/src/main/aidl/com/google/android/gms/maps/model/internal/IBitmapDescriptorFactoryDelegate.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/model/internal/IBitmapDescriptorFactoryDelegate.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/maps/model/internal/IBitmapDescriptorFactoryDelegate.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/maps/model/internal/IBitmapDescriptorFactoryDelegate.aidl diff --git a/src/main/aidl/com/google/android/gms/maps/model/internal/ICircleDelegate.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/model/internal/ICircleDelegate.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/maps/model/internal/ICircleDelegate.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/maps/model/internal/ICircleDelegate.aidl diff --git a/src/main/aidl/com/google/android/gms/maps/model/internal/IGroundOverlayDelegate.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/model/internal/IGroundOverlayDelegate.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/maps/model/internal/IGroundOverlayDelegate.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/maps/model/internal/IGroundOverlayDelegate.aidl diff --git a/src/main/aidl/com/google/android/gms/maps/model/internal/IMarkerDelegate.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/model/internal/IMarkerDelegate.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/maps/model/internal/IMarkerDelegate.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/maps/model/internal/IMarkerDelegate.aidl diff --git a/src/main/aidl/com/google/android/gms/maps/model/internal/IPolygonDelegate.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/model/internal/IPolygonDelegate.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/maps/model/internal/IPolygonDelegate.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/maps/model/internal/IPolygonDelegate.aidl diff --git a/src/main/aidl/com/google/android/gms/maps/model/internal/IPolylineDelegate.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/model/internal/IPolylineDelegate.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/maps/model/internal/IPolylineDelegate.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/maps/model/internal/IPolylineDelegate.aidl diff --git a/src/main/aidl/com/google/android/gms/maps/model/internal/ITileOverlayDelegate.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/model/internal/ITileOverlayDelegate.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/maps/model/internal/ITileOverlayDelegate.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/maps/model/internal/ITileOverlayDelegate.aidl diff --git a/src/main/aidl/com/google/android/gms/maps/model/internal/ITileProviderDelegate.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/model/internal/ITileProviderDelegate.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/maps/model/internal/ITileProviderDelegate.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/maps/model/internal/ITileProviderDelegate.aidl diff --git a/src/main/aidl/com/google/android/gms/people/internal/IPeopleCallbacks.aidl b/play-services-api/src/main/aidl/com/google/android/gms/people/internal/IPeopleCallbacks.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/people/internal/IPeopleCallbacks.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/people/internal/IPeopleCallbacks.aidl diff --git a/src/main/aidl/com/google/android/gms/people/internal/IPeopleService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/people/internal/IPeopleService.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/people/internal/IPeopleService.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/people/internal/IPeopleService.aidl diff --git a/src/main/aidl/com/google/android/gms/plus/internal/IPlusOneButtonCreator.aidl b/play-services-api/src/main/aidl/com/google/android/gms/plus/internal/IPlusOneButtonCreator.aidl similarity index 100% rename from src/main/aidl/com/google/android/gms/plus/internal/IPlusOneButtonCreator.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/plus/internal/IPlusOneButtonCreator.aidl diff --git a/src/main/java/com/google/android/gms/appdatasearch/CorpusStatus.java b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/CorpusStatus.java similarity index 100% rename from src/main/java/com/google/android/gms/appdatasearch/CorpusStatus.java rename to play-services-api/src/main/java/com/google/android/gms/appdatasearch/CorpusStatus.java diff --git a/src/main/java/com/google/android/gms/appdatasearch/SuggestSpecification.java b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/SuggestSpecification.java similarity index 100% rename from src/main/java/com/google/android/gms/appdatasearch/SuggestSpecification.java rename to play-services-api/src/main/java/com/google/android/gms/appdatasearch/SuggestSpecification.java diff --git a/src/main/java/com/google/android/gms/appdatasearch/SuggestionResults.java b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/SuggestionResults.java similarity index 100% rename from src/main/java/com/google/android/gms/appdatasearch/SuggestionResults.java rename to play-services-api/src/main/java/com/google/android/gms/appdatasearch/SuggestionResults.java diff --git a/src/main/java/com/google/android/gms/appdatasearch/UsageInfo.java b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/UsageInfo.java similarity index 100% rename from src/main/java/com/google/android/gms/appdatasearch/UsageInfo.java rename to play-services-api/src/main/java/com/google/android/gms/appdatasearch/UsageInfo.java diff --git a/src/main/java/com/google/android/gms/auth/AccountChangeEvent.java b/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEvent.java similarity index 100% rename from src/main/java/com/google/android/gms/auth/AccountChangeEvent.java rename to play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEvent.java diff --git a/src/main/java/com/google/android/gms/auth/AccountChangeEventsRequest.java b/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEventsRequest.java similarity index 100% rename from src/main/java/com/google/android/gms/auth/AccountChangeEventsRequest.java rename to play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEventsRequest.java diff --git a/src/main/java/com/google/android/gms/auth/AccountChangeEventsResponse.java b/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEventsResponse.java similarity index 100% rename from src/main/java/com/google/android/gms/auth/AccountChangeEventsResponse.java rename to play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEventsResponse.java diff --git a/src/main/java/com/google/android/gms/auth/firstparty/dataservice/TokenRequest.java b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/TokenRequest.java similarity index 100% rename from src/main/java/com/google/android/gms/auth/firstparty/dataservice/TokenRequest.java rename to play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/TokenRequest.java diff --git a/src/main/java/com/google/android/gms/auth/firstparty/dataservice/TokenResponse.java b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/TokenResponse.java similarity index 100% rename from src/main/java/com/google/android/gms/auth/firstparty/dataservice/TokenResponse.java rename to play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/TokenResponse.java diff --git a/src/main/java/com/google/android/gms/auth/firstparty/proximity/data/Permit.java b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/proximity/data/Permit.java similarity index 100% rename from src/main/java/com/google/android/gms/auth/firstparty/proximity/data/Permit.java rename to play-services-api/src/main/java/com/google/android/gms/auth/firstparty/proximity/data/Permit.java diff --git a/src/main/java/com/google/android/gms/common/Scopes.java b/play-services-api/src/main/java/com/google/android/gms/common/Scopes.java similarity index 100% rename from src/main/java/com/google/android/gms/common/Scopes.java rename to play-services-api/src/main/java/com/google/android/gms/common/Scopes.java diff --git a/src/main/java/com/google/android/gms/common/api/AccountInfo.java b/play-services-api/src/main/java/com/google/android/gms/common/api/AccountInfo.java similarity index 100% rename from src/main/java/com/google/android/gms/common/api/AccountInfo.java rename to play-services-api/src/main/java/com/google/android/gms/common/api/AccountInfo.java diff --git a/src/main/java/com/google/android/gms/common/api/CommonStatusCodes.java b/play-services-api/src/main/java/com/google/android/gms/common/api/CommonStatusCodes.java similarity index 100% rename from src/main/java/com/google/android/gms/common/api/CommonStatusCodes.java rename to play-services-api/src/main/java/com/google/android/gms/common/api/CommonStatusCodes.java diff --git a/src/main/java/com/google/android/gms/common/api/Result.java b/play-services-api/src/main/java/com/google/android/gms/common/api/Result.java similarity index 100% rename from src/main/java/com/google/android/gms/common/api/Result.java rename to play-services-api/src/main/java/com/google/android/gms/common/api/Result.java diff --git a/src/main/java/com/google/android/gms/common/api/Scope.java b/play-services-api/src/main/java/com/google/android/gms/common/api/Scope.java similarity index 100% rename from src/main/java/com/google/android/gms/common/api/Scope.java rename to play-services-api/src/main/java/com/google/android/gms/common/api/Scope.java diff --git a/src/main/java/com/google/android/gms/common/api/Status.java b/play-services-api/src/main/java/com/google/android/gms/common/api/Status.java similarity index 100% rename from src/main/java/com/google/android/gms/common/api/Status.java rename to play-services-api/src/main/java/com/google/android/gms/common/api/Status.java diff --git a/src/main/java/com/google/android/gms/common/data/DataHolder.java b/play-services-api/src/main/java/com/google/android/gms/common/data/DataHolder.java similarity index 100% rename from src/main/java/com/google/android/gms/common/data/DataHolder.java rename to play-services-api/src/main/java/com/google/android/gms/common/data/DataHolder.java diff --git a/src/main/java/com/google/android/gms/common/server/FavaDiagnosticsEntity.java b/play-services-api/src/main/java/com/google/android/gms/common/server/FavaDiagnosticsEntity.java similarity index 100% rename from src/main/java/com/google/android/gms/common/server/FavaDiagnosticsEntity.java rename to play-services-api/src/main/java/com/google/android/gms/common/server/FavaDiagnosticsEntity.java diff --git a/src/main/java/com/google/android/gms/drive/metadata/internal/MetadataBundle.java b/play-services-api/src/main/java/com/google/android/gms/drive/metadata/internal/MetadataBundle.java similarity index 100% rename from src/main/java/com/google/android/gms/drive/metadata/internal/MetadataBundle.java rename to play-services-api/src/main/java/com/google/android/gms/drive/metadata/internal/MetadataBundle.java diff --git a/src/main/java/com/google/android/gms/dynamic/ObjectWrapper.java b/play-services-api/src/main/java/com/google/android/gms/dynamic/ObjectWrapper.java similarity index 100% rename from src/main/java/com/google/android/gms/dynamic/ObjectWrapper.java rename to play-services-api/src/main/java/com/google/android/gms/dynamic/ObjectWrapper.java diff --git a/src/main/java/com/google/android/gms/fitness/data/DataPoint.java b/play-services-api/src/main/java/com/google/android/gms/fitness/data/DataPoint.java similarity index 100% rename from src/main/java/com/google/android/gms/fitness/data/DataPoint.java rename to play-services-api/src/main/java/com/google/android/gms/fitness/data/DataPoint.java diff --git a/src/main/java/com/google/android/gms/fitness/data/Device.java b/play-services-api/src/main/java/com/google/android/gms/fitness/data/Device.java similarity index 100% rename from src/main/java/com/google/android/gms/fitness/data/Device.java rename to play-services-api/src/main/java/com/google/android/gms/fitness/data/Device.java diff --git a/src/main/java/com/google/android/gms/fitness/data/Field.java b/play-services-api/src/main/java/com/google/android/gms/fitness/data/Field.java similarity index 100% rename from src/main/java/com/google/android/gms/fitness/data/Field.java rename to play-services-api/src/main/java/com/google/android/gms/fitness/data/Field.java diff --git a/src/main/java/com/google/android/gms/fitness/data/Value.java b/play-services-api/src/main/java/com/google/android/gms/fitness/data/Value.java similarity index 100% rename from src/main/java/com/google/android/gms/fitness/data/Value.java rename to play-services-api/src/main/java/com/google/android/gms/fitness/data/Value.java diff --git a/src/main/java/com/google/android/gms/identity/accounts/api/AccountData.java b/play-services-api/src/main/java/com/google/android/gms/identity/accounts/api/AccountData.java similarity index 100% rename from src/main/java/com/google/android/gms/identity/accounts/api/AccountData.java rename to play-services-api/src/main/java/com/google/android/gms/identity/accounts/api/AccountData.java diff --git a/src/main/java/com/google/android/gms/identity/intents/model/CountrySpecification.java b/play-services-api/src/main/java/com/google/android/gms/identity/intents/model/CountrySpecification.java similarity index 100% rename from src/main/java/com/google/android/gms/identity/intents/model/CountrySpecification.java rename to play-services-api/src/main/java/com/google/android/gms/identity/intents/model/CountrySpecification.java diff --git a/src/main/java/com/google/android/gms/identity/intents/model/UserAddress.java b/play-services-api/src/main/java/com/google/android/gms/identity/intents/model/UserAddress.java similarity index 100% rename from src/main/java/com/google/android/gms/identity/intents/model/UserAddress.java rename to play-services-api/src/main/java/com/google/android/gms/identity/intents/model/UserAddress.java diff --git a/src/main/java/com/google/android/gms/location/Geofence.java b/play-services-api/src/main/java/com/google/android/gms/location/Geofence.java similarity index 100% rename from src/main/java/com/google/android/gms/location/Geofence.java rename to play-services-api/src/main/java/com/google/android/gms/location/Geofence.java diff --git a/src/main/java/com/google/android/gms/location/GeofencingRequest.java b/play-services-api/src/main/java/com/google/android/gms/location/GeofencingRequest.java similarity index 100% rename from src/main/java/com/google/android/gms/location/GeofencingRequest.java rename to play-services-api/src/main/java/com/google/android/gms/location/GeofencingRequest.java diff --git a/src/main/java/com/google/android/gms/location/LocationRequest.java b/play-services-api/src/main/java/com/google/android/gms/location/LocationRequest.java similarity index 100% rename from src/main/java/com/google/android/gms/location/LocationRequest.java rename to play-services-api/src/main/java/com/google/android/gms/location/LocationRequest.java diff --git a/src/main/java/com/google/android/gms/location/LocationStatus.java b/play-services-api/src/main/java/com/google/android/gms/location/LocationStatus.java similarity index 100% rename from src/main/java/com/google/android/gms/location/LocationStatus.java rename to play-services-api/src/main/java/com/google/android/gms/location/LocationStatus.java diff --git a/src/main/java/com/google/android/gms/location/internal/ClientIdentity.java b/play-services-api/src/main/java/com/google/android/gms/location/internal/ClientIdentity.java similarity index 100% rename from src/main/java/com/google/android/gms/location/internal/ClientIdentity.java rename to play-services-api/src/main/java/com/google/android/gms/location/internal/ClientIdentity.java diff --git a/src/main/java/com/google/android/gms/location/internal/LocationRequestInternal.java b/play-services-api/src/main/java/com/google/android/gms/location/internal/LocationRequestInternal.java similarity index 100% rename from src/main/java/com/google/android/gms/location/internal/LocationRequestInternal.java rename to play-services-api/src/main/java/com/google/android/gms/location/internal/LocationRequestInternal.java diff --git a/src/main/java/com/google/android/gms/location/places/AutocompleteFilter.java b/play-services-api/src/main/java/com/google/android/gms/location/places/AutocompleteFilter.java similarity index 100% rename from src/main/java/com/google/android/gms/location/places/AutocompleteFilter.java rename to play-services-api/src/main/java/com/google/android/gms/location/places/AutocompleteFilter.java diff --git a/src/main/java/com/google/android/gms/location/places/NearbyAlertRequest.java b/play-services-api/src/main/java/com/google/android/gms/location/places/NearbyAlertRequest.java similarity index 100% rename from src/main/java/com/google/android/gms/location/places/NearbyAlertRequest.java rename to play-services-api/src/main/java/com/google/android/gms/location/places/NearbyAlertRequest.java diff --git a/src/main/java/com/google/android/gms/location/places/PlaceFilter.java b/play-services-api/src/main/java/com/google/android/gms/location/places/PlaceFilter.java similarity index 100% rename from src/main/java/com/google/android/gms/location/places/PlaceFilter.java rename to play-services-api/src/main/java/com/google/android/gms/location/places/PlaceFilter.java diff --git a/src/main/java/com/google/android/gms/location/places/PlaceReport.java b/play-services-api/src/main/java/com/google/android/gms/location/places/PlaceReport.java similarity index 100% rename from src/main/java/com/google/android/gms/location/places/PlaceReport.java rename to play-services-api/src/main/java/com/google/android/gms/location/places/PlaceReport.java diff --git a/src/main/java/com/google/android/gms/location/places/PlaceRequest.java b/play-services-api/src/main/java/com/google/android/gms/location/places/PlaceRequest.java similarity index 100% rename from src/main/java/com/google/android/gms/location/places/PlaceRequest.java rename to play-services-api/src/main/java/com/google/android/gms/location/places/PlaceRequest.java diff --git a/src/main/java/com/google/android/gms/location/places/UserAddedPlace.java b/play-services-api/src/main/java/com/google/android/gms/location/places/UserAddedPlace.java similarity index 100% rename from src/main/java/com/google/android/gms/location/places/UserAddedPlace.java rename to play-services-api/src/main/java/com/google/android/gms/location/places/UserAddedPlace.java diff --git a/src/main/java/com/google/android/gms/location/places/UserDataType.java b/play-services-api/src/main/java/com/google/android/gms/location/places/UserDataType.java similarity index 100% rename from src/main/java/com/google/android/gms/location/places/UserDataType.java rename to play-services-api/src/main/java/com/google/android/gms/location/places/UserDataType.java diff --git a/src/main/java/com/google/android/gms/location/places/internal/PlacesParams.java b/play-services-api/src/main/java/com/google/android/gms/location/places/internal/PlacesParams.java similarity index 100% rename from src/main/java/com/google/android/gms/location/places/internal/PlacesParams.java rename to play-services-api/src/main/java/com/google/android/gms/location/places/internal/PlacesParams.java diff --git a/src/main/java/com/google/android/gms/location/reporting/ReportingState.java b/play-services-api/src/main/java/com/google/android/gms/location/reporting/ReportingState.java similarity index 100% rename from src/main/java/com/google/android/gms/location/reporting/ReportingState.java rename to play-services-api/src/main/java/com/google/android/gms/location/reporting/ReportingState.java diff --git a/src/main/java/com/google/android/gms/maps/GoogleMapOptions.java b/play-services-api/src/main/java/com/google/android/gms/maps/GoogleMapOptions.java similarity index 100% rename from src/main/java/com/google/android/gms/maps/GoogleMapOptions.java rename to play-services-api/src/main/java/com/google/android/gms/maps/GoogleMapOptions.java diff --git a/src/main/java/com/google/android/gms/maps/StreetViewPanoramaOptions.java b/play-services-api/src/main/java/com/google/android/gms/maps/StreetViewPanoramaOptions.java similarity index 100% rename from src/main/java/com/google/android/gms/maps/StreetViewPanoramaOptions.java rename to play-services-api/src/main/java/com/google/android/gms/maps/StreetViewPanoramaOptions.java diff --git a/src/main/java/com/google/android/gms/maps/internal/Point.java b/play-services-api/src/main/java/com/google/android/gms/maps/internal/Point.java similarity index 100% rename from src/main/java/com/google/android/gms/maps/internal/Point.java rename to play-services-api/src/main/java/com/google/android/gms/maps/internal/Point.java diff --git a/src/main/java/com/google/android/gms/maps/model/BitmapDescriptor.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/BitmapDescriptor.java similarity index 100% rename from src/main/java/com/google/android/gms/maps/model/BitmapDescriptor.java rename to play-services-api/src/main/java/com/google/android/gms/maps/model/BitmapDescriptor.java diff --git a/src/main/java/com/google/android/gms/maps/model/CameraPosition.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/CameraPosition.java similarity index 100% rename from src/main/java/com/google/android/gms/maps/model/CameraPosition.java rename to play-services-api/src/main/java/com/google/android/gms/maps/model/CameraPosition.java diff --git a/src/main/java/com/google/android/gms/maps/model/CircleOptions.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/CircleOptions.java similarity index 100% rename from src/main/java/com/google/android/gms/maps/model/CircleOptions.java rename to play-services-api/src/main/java/com/google/android/gms/maps/model/CircleOptions.java diff --git a/src/main/java/com/google/android/gms/maps/model/GroundOverlayOptions.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/GroundOverlayOptions.java similarity index 100% rename from src/main/java/com/google/android/gms/maps/model/GroundOverlayOptions.java rename to play-services-api/src/main/java/com/google/android/gms/maps/model/GroundOverlayOptions.java diff --git a/src/main/java/com/google/android/gms/maps/model/LatLng.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/LatLng.java similarity index 100% rename from src/main/java/com/google/android/gms/maps/model/LatLng.java rename to play-services-api/src/main/java/com/google/android/gms/maps/model/LatLng.java diff --git a/src/main/java/com/google/android/gms/maps/model/LatLngBounds.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/LatLngBounds.java similarity index 100% rename from src/main/java/com/google/android/gms/maps/model/LatLngBounds.java rename to play-services-api/src/main/java/com/google/android/gms/maps/model/LatLngBounds.java diff --git a/src/main/java/com/google/android/gms/maps/model/MarkerOptions.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/MarkerOptions.java similarity index 100% rename from src/main/java/com/google/android/gms/maps/model/MarkerOptions.java rename to play-services-api/src/main/java/com/google/android/gms/maps/model/MarkerOptions.java diff --git a/src/main/java/com/google/android/gms/maps/model/PolygonOptions.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/PolygonOptions.java similarity index 100% rename from src/main/java/com/google/android/gms/maps/model/PolygonOptions.java rename to play-services-api/src/main/java/com/google/android/gms/maps/model/PolygonOptions.java diff --git a/src/main/java/com/google/android/gms/maps/model/PolylineOptions.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/PolylineOptions.java similarity index 100% rename from src/main/java/com/google/android/gms/maps/model/PolylineOptions.java rename to play-services-api/src/main/java/com/google/android/gms/maps/model/PolylineOptions.java diff --git a/src/main/java/com/google/android/gms/maps/model/StreetViewPanoramaCamera.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/StreetViewPanoramaCamera.java similarity index 100% rename from src/main/java/com/google/android/gms/maps/model/StreetViewPanoramaCamera.java rename to play-services-api/src/main/java/com/google/android/gms/maps/model/StreetViewPanoramaCamera.java diff --git a/src/main/java/com/google/android/gms/maps/model/StreetViewPanoramaLink.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/StreetViewPanoramaLink.java similarity index 100% rename from src/main/java/com/google/android/gms/maps/model/StreetViewPanoramaLink.java rename to play-services-api/src/main/java/com/google/android/gms/maps/model/StreetViewPanoramaLink.java diff --git a/src/main/java/com/google/android/gms/maps/model/StreetViewPanoramaLocation.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/StreetViewPanoramaLocation.java similarity index 100% rename from src/main/java/com/google/android/gms/maps/model/StreetViewPanoramaLocation.java rename to play-services-api/src/main/java/com/google/android/gms/maps/model/StreetViewPanoramaLocation.java diff --git a/src/main/java/com/google/android/gms/maps/model/StreetViewPanoramaOrientation.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/StreetViewPanoramaOrientation.java similarity index 100% rename from src/main/java/com/google/android/gms/maps/model/StreetViewPanoramaOrientation.java rename to play-services-api/src/main/java/com/google/android/gms/maps/model/StreetViewPanoramaOrientation.java diff --git a/src/main/java/com/google/android/gms/maps/model/Tile.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/Tile.java similarity index 100% rename from src/main/java/com/google/android/gms/maps/model/Tile.java rename to play-services-api/src/main/java/com/google/android/gms/maps/model/Tile.java diff --git a/src/main/java/com/google/android/gms/maps/model/TileOverlayOptions.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/TileOverlayOptions.java similarity index 100% rename from src/main/java/com/google/android/gms/maps/model/TileOverlayOptions.java rename to play-services-api/src/main/java/com/google/android/gms/maps/model/TileOverlayOptions.java diff --git a/src/main/java/com/google/android/gms/maps/model/TileProvider.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/TileProvider.java similarity index 100% rename from src/main/java/com/google/android/gms/maps/model/TileProvider.java rename to play-services-api/src/main/java/com/google/android/gms/maps/model/TileProvider.java diff --git a/src/main/java/com/google/android/gms/maps/model/VisibleRegion.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/VisibleRegion.java similarity index 100% rename from src/main/java/com/google/android/gms/maps/model/VisibleRegion.java rename to play-services-api/src/main/java/com/google/android/gms/maps/model/VisibleRegion.java diff --git a/src/main/java/com/google/android/gms/maps/model/package-info.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/package-info.java similarity index 100% rename from src/main/java/com/google/android/gms/maps/model/package-info.java rename to play-services-api/src/main/java/com/google/android/gms/maps/model/package-info.java diff --git a/src/main/java/com/google/android/gms/people/model/AccountMetadata.java b/play-services-api/src/main/java/com/google/android/gms/people/model/AccountMetadata.java similarity index 100% rename from src/main/java/com/google/android/gms/people/model/AccountMetadata.java rename to play-services-api/src/main/java/com/google/android/gms/people/model/AccountMetadata.java diff --git a/src/main/java/com/google/android/gms/plus/internal/PlusCommonExtras.java b/play-services-api/src/main/java/com/google/android/gms/plus/internal/PlusCommonExtras.java similarity index 100% rename from src/main/java/com/google/android/gms/plus/internal/PlusCommonExtras.java rename to play-services-api/src/main/java/com/google/android/gms/plus/internal/PlusCommonExtras.java diff --git a/src/main/java/com/google/android/gms/plus/internal/PlusSession.java b/play-services-api/src/main/java/com/google/android/gms/plus/internal/PlusSession.java similarity index 100% rename from src/main/java/com/google/android/gms/plus/internal/PlusSession.java rename to play-services-api/src/main/java/com/google/android/gms/plus/internal/PlusSession.java diff --git a/src/main/java/com/google/android/gms/plus/internal/model/smart_profile/CardsRequest.java b/play-services-api/src/main/java/com/google/android/gms/plus/internal/model/smart_profile/CardsRequest.java similarity index 100% rename from src/main/java/com/google/android/gms/plus/internal/model/smart_profile/CardsRequest.java rename to play-services-api/src/main/java/com/google/android/gms/plus/internal/model/smart_profile/CardsRequest.java diff --git a/src/main/java/com/google/android/gms/plus/internal/model/smart_profile/CardsResponse.java b/play-services-api/src/main/java/com/google/android/gms/plus/internal/model/smart_profile/CardsResponse.java similarity index 100% rename from src/main/java/com/google/android/gms/plus/internal/model/smart_profile/CardsResponse.java rename to play-services-api/src/main/java/com/google/android/gms/plus/internal/model/smart_profile/CardsResponse.java diff --git a/src/main/java/com/google/android/gms/plus/internal/model/smart_profile/PeopleForProfilesRequest.java b/play-services-api/src/main/java/com/google/android/gms/plus/internal/model/smart_profile/PeopleForProfilesRequest.java similarity index 100% rename from src/main/java/com/google/android/gms/plus/internal/model/smart_profile/PeopleForProfilesRequest.java rename to play-services-api/src/main/java/com/google/android/gms/plus/internal/model/smart_profile/PeopleForProfilesRequest.java diff --git a/src/main/java/com/google/android/gms/plus/internal/model/smart_profile/PeopleForProfilesResponse.java b/play-services-api/src/main/java/com/google/android/gms/plus/internal/model/smart_profile/PeopleForProfilesResponse.java similarity index 100% rename from src/main/java/com/google/android/gms/plus/internal/model/smart_profile/PeopleForProfilesResponse.java rename to play-services-api/src/main/java/com/google/android/gms/plus/internal/model/smart_profile/PeopleForProfilesResponse.java diff --git a/src/main/java/com/google/android/gms/plus/model/posts/Comment.java b/play-services-api/src/main/java/com/google/android/gms/plus/model/posts/Comment.java similarity index 100% rename from src/main/java/com/google/android/gms/plus/model/posts/Comment.java rename to play-services-api/src/main/java/com/google/android/gms/plus/model/posts/Comment.java diff --git a/src/main/java/com/google/android/gms/plus/model/posts/Post.java b/play-services-api/src/main/java/com/google/android/gms/plus/model/posts/Post.java similarity index 100% rename from src/main/java/com/google/android/gms/plus/model/posts/Post.java rename to play-services-api/src/main/java/com/google/android/gms/plus/model/posts/Post.java diff --git a/src/main/java/com/google/android/gms/plus/model/posts/Settings.java b/play-services-api/src/main/java/com/google/android/gms/plus/model/posts/Settings.java similarity index 100% rename from src/main/java/com/google/android/gms/plus/model/posts/Settings.java rename to play-services-api/src/main/java/com/google/android/gms/plus/model/posts/Settings.java diff --git a/src/main/java/com/google/android/gms/wearable/ConnectionConfiguration.java b/play-services-api/src/main/java/com/google/android/gms/wearable/ConnectionConfiguration.java similarity index 100% rename from src/main/java/com/google/android/gms/wearable/ConnectionConfiguration.java rename to play-services-api/src/main/java/com/google/android/gms/wearable/ConnectionConfiguration.java diff --git a/src/main/java/com/google/android/gms/wearable/Node.java b/play-services-api/src/main/java/com/google/android/gms/wearable/Node.java similarity index 100% rename from src/main/java/com/google/android/gms/wearable/Node.java rename to play-services-api/src/main/java/com/google/android/gms/wearable/Node.java diff --git a/src/main/java/com/google/android/gms/wearable/WearableStatusCodes.java b/play-services-api/src/main/java/com/google/android/gms/wearable/WearableStatusCodes.java similarity index 100% rename from src/main/java/com/google/android/gms/wearable/WearableStatusCodes.java rename to play-services-api/src/main/java/com/google/android/gms/wearable/WearableStatusCodes.java diff --git a/src/main/java/com/google/android/gms/wearable/internal/NodeParcelable.java b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/NodeParcelable.java similarity index 100% rename from src/main/java/com/google/android/gms/wearable/internal/NodeParcelable.java rename to play-services-api/src/main/java/com/google/android/gms/wearable/internal/NodeParcelable.java diff --git a/src/main/java/org/microg/gms/common/Constants.java b/play-services-api/src/main/java/org/microg/gms/common/Constants.java similarity index 100% rename from src/main/java/org/microg/gms/common/Constants.java rename to play-services-api/src/main/java/org/microg/gms/common/Constants.java diff --git a/src/main/java/org/microg/gms/common/PublicApi.java b/play-services-api/src/main/java/org/microg/gms/common/PublicApi.java similarity index 100% rename from src/main/java/org/microg/gms/common/PublicApi.java rename to play-services-api/src/main/java/org/microg/gms/common/PublicApi.java diff --git a/safe-parcel b/safe-parcel new file mode 120000 index 00000000..76875b71 --- /dev/null +++ b/safe-parcel @@ -0,0 +1 @@ +extern/SafeParcel/safe-parcel \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index 930a2c14..22f70d94 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,3 +1,2 @@ -rootProject.name = 'play-services-api' - -include ':SafeParcel' +include ':play-services-api' +include ':safe-parcel' From 588df8f17bcaa3e1be3686374d502c49b370fb91 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Sat, 14 Mar 2015 22:21:35 +0100 Subject: [PATCH 060/293] Update api --- .gitmodules | 4 ++-- SafeParcel | 1 - build.gradle | 4 ++-- extern/GmsApi | 1 + play-services-api | 2 +- safe-parcel | 1 + settings.gradle | 3 ++- 7 files changed, 9 insertions(+), 7 deletions(-) delete mode 120000 SafeParcel create mode 160000 extern/GmsApi mode change 160000 => 120000 play-services-api create mode 120000 safe-parcel diff --git a/.gitmodules b/.gitmodules index bddcb0cc..634ab4ca 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ -[submodule "play-services-api"] - path = play-services-api +[submodule "GmsApi"] + path = extern/GmsApi url = https://github.com/microg/android_external_GmsApi.git diff --git a/SafeParcel b/SafeParcel deleted file mode 120000 index 18f7aa75..00000000 --- a/SafeParcel +++ /dev/null @@ -1 +0,0 @@ -play-services-api/SafeParcel/ \ No newline at end of file diff --git a/build.gradle b/build.gradle index 135b35aa..4cb7b45f 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. subprojects { - group = 'org.microg.gms' + group = 'org.microg' version = '1.0-SNAPSHOT' -} \ No newline at end of file +} diff --git a/extern/GmsApi b/extern/GmsApi new file mode 160000 index 00000000..c0c4a78e --- /dev/null +++ b/extern/GmsApi @@ -0,0 +1 @@ +Subproject commit c0c4a78eab3064cdd7545cb7fcdddfe93ca1674d diff --git a/play-services-api b/play-services-api deleted file mode 160000 index dbae4add..00000000 --- a/play-services-api +++ /dev/null @@ -1 +0,0 @@ -Subproject commit dbae4add94505fb0765ca9a18896848df6ae6ae4 diff --git a/play-services-api b/play-services-api new file mode 120000 index 00000000..ce1f09ca --- /dev/null +++ b/play-services-api @@ -0,0 +1 @@ +extern/GmsApi/play-services-api \ No newline at end of file diff --git a/safe-parcel b/safe-parcel new file mode 120000 index 00000000..5c222c0b --- /dev/null +++ b/safe-parcel @@ -0,0 +1 @@ +extern/GmsApi/safe-parcel \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index c87b1990..9ec62cf1 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,4 +1,5 @@ -include ':SafeParcel' +include ':safe-parcel' + include ':play-services-api' include ':play-services-base' From bce1d500c93fbf04a25a0045919098f71abd3127 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Wed, 25 Mar 2015 23:07:07 +0100 Subject: [PATCH 061/293] Add some AIDL specs --- .../aidl/com/google/android/gms/http/IGoogleHttpService.aidl | 5 +++++ .../google/android/gms/people/internal/IPeopleCallbacks.aidl | 1 + .../google/android/gms/people/internal/IPeopleService.aidl | 3 +++ .../google/android/gms/playlog/internal/IPlayLogService.aidl | 4 ++++ 4 files changed, 13 insertions(+) create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/http/IGoogleHttpService.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/playlog/internal/IPlayLogService.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/http/IGoogleHttpService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/http/IGoogleHttpService.aidl new file mode 100644 index 00000000..1503e8d1 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/http/IGoogleHttpService.aidl @@ -0,0 +1,5 @@ +package com.google.android.gms.http; + +interface IGoogleHttpService { + Bundle checkUrl(String url); +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/people/internal/IPeopleCallbacks.aidl b/play-services-api/src/main/aidl/com/google/android/gms/people/internal/IPeopleCallbacks.aidl index 8738a9ea..8aa1e23c 100644 --- a/play-services-api/src/main/aidl/com/google/android/gms/people/internal/IPeopleCallbacks.aidl +++ b/play-services-api/src/main/aidl/com/google/android/gms/people/internal/IPeopleCallbacks.aidl @@ -5,4 +5,5 @@ import com.google.android.gms.common.data.DataHolder; interface IPeopleCallbacks { void onDataHolder(int code, in Bundle resolution, in DataHolder holder) = 1; void onDataHolders(int code, in Bundle resolution, in DataHolder[] holders) = 3; + void onParcelFileDescriptor(int code, in Bundle resolution, in ParcelFileDescriptor fileDescriptor, in Bundle extras) = 4; } diff --git a/play-services-api/src/main/aidl/com/google/android/gms/people/internal/IPeopleService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/people/internal/IPeopleService.aidl index e399cd02..e46f354e 100644 --- a/play-services-api/src/main/aidl/com/google/android/gms/people/internal/IPeopleService.aidl +++ b/play-services-api/src/main/aidl/com/google/android/gms/people/internal/IPeopleService.aidl @@ -33,6 +33,9 @@ interface IPeopleService { // void addPeopleToCircle(IPeopleCallbacks var1, String var2, String var3, String var4, in List var5); Bundle registerDataChangedListener(IPeopleCallbacks callbacks, boolean register, String var3, String var4, int scopes) = 10; + void loadCircles(IPeopleCallbacks callbacks, String account, String pageGaiaId, String circleId, int type, String var6, boolean var7) = 18; + Bundle requestSync(String account, String var2, long var3, boolean var5, boolean var6) = 204; void loadOwners(IPeopleCallbacks callbacks, boolean var2, boolean var3, String account, String var5, int sortOrder) = 304; + void loadPeopleForAggregation(IPeopleCallbacks callbacks, String account, String var3, String filter, int var5, boolean var6, int var7, int var8, String var9, boolean var10, int var11, int var12) = 401; ICancelToken loadOwnerAvatar(IPeopleCallbacks callbacks, String account, String pageId, int size, int flags) = 504; } diff --git a/play-services-api/src/main/aidl/com/google/android/gms/playlog/internal/IPlayLogService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/playlog/internal/IPlayLogService.aidl new file mode 100644 index 00000000..38e620ea --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/playlog/internal/IPlayLogService.aidl @@ -0,0 +1,4 @@ +package com.google.android.gms.playlog.internal; + +interface IPlayLogService { +} From 712f24a59fd7b79449842945d7d383cc4559a68b Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Wed, 25 Mar 2015 23:10:19 +0100 Subject: [PATCH 062/293] Fix Android.mk --- Android.mk | 3 ++- .../aidl/com/google/android/auth/IAuthManagerService.aidl | 2 ++ .../com/google/android/gms/common/internal/IGmsCallbacks.aidl | 2 ++ .../google/android/gms/common/internal/IGmsServiceBroker.aidl | 2 ++ .../gms/location/internal/IGoogleLocationManagerService.aidl | 4 ++++ .../google/android/gms/maps/internal/IGoogleMapDelegate.aidl | 2 ++ .../android/gms/maps/internal/IMapFragmentDelegate.aidl | 2 ++ .../google/android/gms/maps/internal/IMapViewDelegate.aidl | 2 ++ .../google/android/gms/people/internal/IPeopleCallbacks.aidl | 2 ++ .../google/android/gms/people/internal/IPeopleService.aidl | 2 ++ 10 files changed, 22 insertions(+), 1 deletion(-) diff --git a/Android.mk b/Android.mk index fb4008de..74850272 100644 --- a/Android.mk +++ b/Android.mk @@ -4,7 +4,8 @@ include $(CLEAR_VARS) LOCAL_MODULE := GmsApi LOCAL_SRC_FILES := $(call all-java-files-under, play-services-api/src/main/java) -LOCAL_SRC_FILES := $(call all-Iaidl-files-under, play-services-api/src/main/aidl) +LOCAL_SRC_FILES += $(call all-Iaidl-files-under, play-services-api/src/main/aidl) +LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/play-services-api/src/main/aidl LOCAL_STATIC_JAVA_LIBRARIES := SafeParcel include $(BUILD_STATIC_JAVA_LIBRARY) diff --git a/play-services-api/src/main/aidl/com/google/android/auth/IAuthManagerService.aidl b/play-services-api/src/main/aidl/com/google/android/auth/IAuthManagerService.aidl index 94ced65c..ac46a323 100644 --- a/play-services-api/src/main/aidl/com/google/android/auth/IAuthManagerService.aidl +++ b/play-services-api/src/main/aidl/com/google/android/auth/IAuthManagerService.aidl @@ -1,5 +1,7 @@ package com.google.android.auth; +import android.os.Bundle; + import com.google.android.gms.auth.AccountChangeEventsResponse; import com.google.android.gms.auth.AccountChangeEventsRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/common/internal/IGmsCallbacks.aidl b/play-services-api/src/main/aidl/com/google/android/gms/common/internal/IGmsCallbacks.aidl index 9a36b0ed..b0210281 100644 --- a/play-services-api/src/main/aidl/com/google/android/gms/common/internal/IGmsCallbacks.aidl +++ b/play-services-api/src/main/aidl/com/google/android/gms/common/internal/IGmsCallbacks.aidl @@ -1,5 +1,7 @@ package com.google.android.gms.common.internal; +import android.os.Bundle; + interface IGmsCallbacks { void onPostInitComplete(int statusCode, IBinder binder, in Bundle params); } diff --git a/play-services-api/src/main/aidl/com/google/android/gms/common/internal/IGmsServiceBroker.aidl b/play-services-api/src/main/aidl/com/google/android/gms/common/internal/IGmsServiceBroker.aidl index 318c4dab..185b394a 100644 --- a/play-services-api/src/main/aidl/com/google/android/gms/common/internal/IGmsServiceBroker.aidl +++ b/play-services-api/src/main/aidl/com/google/android/gms/common/internal/IGmsServiceBroker.aidl @@ -1,5 +1,7 @@ package com.google.android.gms.common.internal; +import android.os.Bundle; + import com.google.android.gms.common.internal.IGmsCallbacks; interface IGmsServiceBroker { diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/internal/IGoogleLocationManagerService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/location/internal/IGoogleLocationManagerService.aidl index a60350fd..e2fb3acc 100644 --- a/play-services-api/src/main/aidl/com/google/android/gms/location/internal/IGoogleLocationManagerService.aidl +++ b/play-services-api/src/main/aidl/com/google/android/gms/location/internal/IGoogleLocationManagerService.aidl @@ -1,5 +1,9 @@ package com.google.android.gms.location.internal; +import android.app.PendingIntent; +import android.location.Location; +import android.os.Bundle; + import com.google.android.gms.location.places.AutocompleteFilter; import com.google.android.gms.location.places.internal.IPlacesCallbacks; import com.google.android.gms.location.internal.LocationRequestInternal; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IGoogleMapDelegate.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IGoogleMapDelegate.aidl index ac474c35..ae5e402b 100644 --- a/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IGoogleMapDelegate.aidl +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IGoogleMapDelegate.aidl @@ -1,5 +1,7 @@ package com.google.android.gms.maps.internal; +import android.location.Location; + import com.google.android.gms.dynamic.IObjectWrapper; import com.google.android.gms.maps.model.CameraPosition; import com.google.android.gms.maps.internal.ICancelableCallback; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IMapFragmentDelegate.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IMapFragmentDelegate.aidl index 966c4e4b..ebfee0d1 100644 --- a/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IMapFragmentDelegate.aidl +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IMapFragmentDelegate.aidl @@ -1,5 +1,7 @@ package com.google.android.gms.maps.internal; +import android.os.Bundle; + import com.google.android.gms.maps.internal.IGoogleMapDelegate; import com.google.android.gms.maps.GoogleMapOptions; import com.google.android.gms.dynamic.IObjectWrapper; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IMapViewDelegate.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IMapViewDelegate.aidl index 820e27b4..2efb5649 100644 --- a/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IMapViewDelegate.aidl +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IMapViewDelegate.aidl @@ -1,5 +1,7 @@ package com.google.android.gms.maps.internal; +import android.os.Bundle; + import com.google.android.gms.maps.internal.IGoogleMapDelegate; import com.google.android.gms.dynamic.IObjectWrapper; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/people/internal/IPeopleCallbacks.aidl b/play-services-api/src/main/aidl/com/google/android/gms/people/internal/IPeopleCallbacks.aidl index 8738a9ea..66b35e43 100644 --- a/play-services-api/src/main/aidl/com/google/android/gms/people/internal/IPeopleCallbacks.aidl +++ b/play-services-api/src/main/aidl/com/google/android/gms/people/internal/IPeopleCallbacks.aidl @@ -1,5 +1,7 @@ package com.google.android.gms.people.internal; +import android.os.Bundle; + import com.google.android.gms.common.data.DataHolder; interface IPeopleCallbacks { diff --git a/play-services-api/src/main/aidl/com/google/android/gms/people/internal/IPeopleService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/people/internal/IPeopleService.aidl index e399cd02..d50aee4a 100644 --- a/play-services-api/src/main/aidl/com/google/android/gms/people/internal/IPeopleService.aidl +++ b/play-services-api/src/main/aidl/com/google/android/gms/people/internal/IPeopleService.aidl @@ -1,5 +1,7 @@ package com.google.android.gms.people.internal; +import android.os.Bundle; + import com.google.android.gms.people.internal.IPeopleCallbacks; import com.google.android.gms.common.server.FavaDiagnosticsEntity; import com.google.android.gms.common.internal.ICancelToken; From a5813321171b4e606443708ae27cde72a7c88722 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Sat, 28 Mar 2015 23:21:09 +0100 Subject: [PATCH 063/293] Update api, add gcm basics --- extern/GmsApi | 2 +- .../android/gms/gcm/GoogleCloudMessaging.java | 115 ++++++++++++++++++ 2 files changed, 116 insertions(+), 1 deletion(-) create mode 100644 play-services-base/src/main/java/com/google/android/gms/gcm/GoogleCloudMessaging.java diff --git a/extern/GmsApi b/extern/GmsApi index c0c4a78e..c43facae 160000 --- a/extern/GmsApi +++ b/extern/GmsApi @@ -1 +1 @@ -Subproject commit c0c4a78eab3064cdd7545cb7fcdddfe93ca1674d +Subproject commit c43facae3dba6fcf4139c6a36e3a6f364d6db057 diff --git a/play-services-base/src/main/java/com/google/android/gms/gcm/GoogleCloudMessaging.java b/play-services-base/src/main/java/com/google/android/gms/gcm/GoogleCloudMessaging.java new file mode 100644 index 00000000..91f00fd5 --- /dev/null +++ b/play-services-base/src/main/java/com/google/android/gms/gcm/GoogleCloudMessaging.java @@ -0,0 +1,115 @@ +/* + * Copyright 2013-2015 µg 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.gcm; + +import android.content.Context; +import android.content.Intent; +import android.os.Bundle; + +import java.io.IOException; + +public class GoogleCloudMessaging { + + /** + * The GCM {@link #register(String...)} and {@link #unregister()} methods are blocking. You + * should not run them in the main thread or in broadcast receivers. + */ + public static final String ERROR_MAIN_THREAD = "MAIN_THREAD"; + + /** + * The device can't read the response, or there was a 500/503 from the server that can be + * retried later. The application should use exponential back off and retry. + */ + public static final String ERROR_SERVICE_NOT_AVAILABLE = "SERVICE_NOT_AVAILABLE"; + + /** + * Returned by {@link #getMessageType(Intent)} to indicate that the server deleted some + * pending messages because they were collapsible. + */ + public static final String MESSAGE_TYPE_DELETED = "deleted_messages"; + + /** + * Returned by {@link #getMessageType(Intent)} to indicate a regular message. + */ + public static final String MESSAGE_TYPE_MESSAGE = "gcm"; + + /** + * Returned by {@link #getMessageType(Intent)} to indicate a send error. The intent includes + * the message ID of the message and an error code. + */ + public static final String MESSAGE_TYPE_SEND_ERROR = "send_error"; + + /** + * Return the singleton instance of GCM. + */ + public static synchronized GoogleCloudMessaging getInstance(Context context) { + return null; + } + + /** + * Must be called when your application is done using GCM, to release internal resources. + */ + public void close() { + + } + + /** + * Return the message type from an intent passed into a client app's broadcast receiver. + * There are two general categories of messages passed from the server: regular GCM messages, + * and special GCM status messages. The possible types are: + *

    + *
  • {@link #MESSAGE_TYPE_MESSAGE}—regular message from your server.
  • + *
  • {@link #MESSAGE_TYPE_DELETED}—special status message indicating that some messages have been collapsed by GCM.
  • + *
  • {@link #MESSAGE_TYPE_SEND_ERROR}—special status message indicating that there were errors sending one of the messages.
  • + *
+ * You can use this method to filter based on message type. Since it is likely that GCM will + * be extended in the future with new message types, just ignore any message types you're not + * interested in, or that you don't recognize. + * + * @param intent + * @return + */ + public String getMessageType(Intent intent) { + return null; + } + + public String register(String... senderIds) { + return null; + } + + public void send(String to, String msgId, long timeToLive, Bundle data) { + + } + + public void send(String to, String msgId, Bundle data) { + + } + + /** + * Unregister the application. Calling unregister() stops any messages from the server. + * This is a blocking call—you shouldn't call it from the UI thread. + * You should rarely (if ever) need to call this method. Not only is it expensive in terms of + * resources, but it invalidates your registration ID, which you should never change + * unnecessarily. A better approach is to simply have your server stop sending messages. + * Only use unregister if you want to change your sender ID. + * + * @throws IOException if we can't connect to server to unregister. + */ + public void unregister() throws IOException { + + } +} From b852fefd86cb1583b41dc5ca00467a61fe67808a Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Mon, 30 Mar 2015 23:49:40 +0200 Subject: [PATCH 064/293] Update SafeParcel to 1.0.0 release --- extern/SafeParcel | 2 +- play-services-api/build.gradle | 7 +- play-services-api/gradle-mvn-push.gradle | 114 +++++++++++++++++++++++ play-services-api/gradle.properties | 22 +++++ 4 files changed, 140 insertions(+), 5 deletions(-) create mode 100644 play-services-api/gradle-mvn-push.gradle create mode 100644 play-services-api/gradle.properties diff --git a/extern/SafeParcel b/extern/SafeParcel index 454265fd..b3837016 160000 --- a/extern/SafeParcel +++ b/extern/SafeParcel @@ -1 +1 @@ -Subproject commit 454265fd3ee465cc0741a57f3a74a6e747c2fcd5 +Subproject commit b383701659ca342ee08ff2b2f15b5611daaac2f4 diff --git a/play-services-api/build.gradle b/play-services-api/build.gradle index 2e94b779..1013422a 100644 --- a/play-services-api/build.gradle +++ b/play-services-api/build.gradle @@ -4,12 +4,11 @@ buildscript { } dependencies { classpath 'com.android.tools.build:gradle:1.0.1' - classpath 'com.github.dcendents:android-maven-plugin:1.2' } } apply plugin: 'com.android.library' -apply plugin: 'com.github.dcendents.android-maven' +apply from: 'gradle-mvn-push.gradle' group = 'org.microg' version = '1.0-SNAPSHOT' @@ -19,6 +18,6 @@ dependencies { } android { - compileSdkVersion 21 - buildToolsVersion "21.1.2" + compileSdkVersion 22 + buildToolsVersion "22.0.0" } diff --git a/play-services-api/gradle-mvn-push.gradle b/play-services-api/gradle-mvn-push.gradle new file mode 100644 index 00000000..f5f4129c --- /dev/null +++ b/play-services-api/gradle-mvn-push.gradle @@ -0,0 +1,114 @@ +/* + * Copyright 2013 Chris Banes + * + * 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: 'maven' +apply plugin: 'signing' + +def isReleaseBuild() { + return VERSION_NAME.contains("SNAPSHOT") == false +} + +def getReleaseRepositoryUrl() { + return hasProperty('RELEASE_REPOSITORY_URL') ? RELEASE_REPOSITORY_URL + : "https://oss.sonatype.org/service/local/staging/deploy/maven2/" +} + +def getSnapshotRepositoryUrl() { + return hasProperty('SNAPSHOT_REPOSITORY_URL') ? SNAPSHOT_REPOSITORY_URL + : "https://oss.sonatype.org/content/repositories/snapshots/" +} + +def getRepositoryUsername() { + return hasProperty('NEXUS_USERNAME') ? NEXUS_USERNAME : "" +} + +def getRepositoryPassword() { + return hasProperty('NEXUS_PASSWORD') ? NEXUS_PASSWORD : "" +} + +afterEvaluate { project -> + uploadArchives { + repositories { + mavenDeployer { + beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } + + pom.groupId = GROUP + pom.artifactId = POM_ARTIFACT_ID + pom.version = VERSION_NAME + + repository(url: getReleaseRepositoryUrl()) { + authentication(userName: getRepositoryUsername(), password: getRepositoryPassword()) + } + snapshotRepository(url: getSnapshotRepositoryUrl()) { + authentication(userName: getRepositoryUsername(), password: getRepositoryPassword()) + } + + pom.project { + name POM_NAME + packaging POM_PACKAGING + description POM_DESCRIPTION + url POM_URL + + scm { + url POM_SCM_URL + connection POM_SCM_CONNECTION + developerConnection POM_SCM_DEV_CONNECTION + } + + licenses { + license { + name POM_LICENCE_NAME + url POM_LICENCE_URL + distribution POM_LICENCE_DIST + } + } + + developers { + developer { + id POM_DEVELOPER_ID + name POM_DEVELOPER_NAME + } + } + } + } + } + } + + signing { + required { isReleaseBuild() && gradle.taskGraph.hasTask("uploadArchives") } + sign configurations.archives + } + + task androidJavadocs(type: Javadoc) { + source = android.sourceSets.main.java.srcDirs + classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) + } + + task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) { + classifier = 'javadoc' + from androidJavadocs.destinationDir + } + + task androidSourcesJar(type: Jar) { + classifier = 'sources' + from android.sourceSets.main.java.sourceFiles + } + + artifacts { + archives androidSourcesJar + archives androidJavadocsJar + } +} diff --git a/play-services-api/gradle.properties b/play-services-api/gradle.properties new file mode 100644 index 00000000..0859459b --- /dev/null +++ b/play-services-api/gradle.properties @@ -0,0 +1,22 @@ +GROUP=org.microg +POM_ARTIFACT_ID=play-services-api +VERSION_NAME=1.0-SNAPSHOT + +POM_NAME=µg GmsApi +POM_DESCRIPTION=Interfaces and objects for IPC between Play Services Library and Play Services Core + +POM_PACKAGING=aar + +POM_URL=https://github.com/microg/android_external_GmsApi + +POM_SCM_URL=https://github.com/microg/android_external_GmsApi +POM_SCM_CONNECTION=scm:git@github.com:microg/android_external_GmsApi.git +POM_SCM_DEV_CONNECTION=scm:git@github.com:microg/android_external_GmsApi.git + +POM_LICENCE_NAME=The Apache Software License, Version 2.0 +POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt +POM_LICENCE_DIST=repo + +POM_DEVELOPER_ID=mar-v-in +POM_DEVELOPER_NAME=Marvin W + From 704199355e1c6f8b14402e01063fbae7b187b35b Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Mon, 30 Mar 2015 23:55:35 +0200 Subject: [PATCH 065/293] Add some wearable APIs --- .../android/gms/common/data/DataHolder.java | 29 ++++- .../android/gms/common/data/Freezable.java | 39 +++++++ .../google/android/gms/wearable/Asset.java | 89 ++++++++++++++++ .../google/android/gms/wearable/DataItem.java | 56 ++++++++++ .../android/gms/wearable/DataItemAsset.java | 36 +++++++ .../com/google/android/gms/wearable/Node.java | 4 +- .../android/gms/wearable/PutDataRequest.java | 100 ++++++++++++++++++ .../java/org/microg/gms/common/PublicApi.java | 6 +- 8 files changed, 350 insertions(+), 9 deletions(-) create mode 100644 play-services-api/src/main/java/com/google/android/gms/common/data/Freezable.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/wearable/Asset.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/wearable/DataItem.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/wearable/DataItemAsset.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/wearable/PutDataRequest.java diff --git a/play-services-api/src/main/java/com/google/android/gms/common/data/DataHolder.java b/play-services-api/src/main/java/com/google/android/gms/common/data/DataHolder.java index 99811a18..91bfbd68 100644 --- a/play-services-api/src/main/java/com/google/android/gms/common/data/DataHolder.java +++ b/play-services-api/src/main/java/com/google/android/gms/common/data/DataHolder.java @@ -24,16 +24,23 @@ public class DataHolder extends AutoSafeParcelable { private int versionCode = 1; @SafeParceled(1) - private String[] columns; + public final String[] columns; @SafeParceled(2) - private CursorWindow[] windows; + public final CursorWindow[] windows; @SafeParceled(3) - private int statusCode; + public final int statusCode; @SafeParceled(4) - private Bundle metadata; + public final Bundle metadata; + + private DataHolder() { + columns = null; + windows = null; + statusCode = 0; + metadata = null; + } public DataHolder(String[] columns, CursorWindow[] windows, int statusCode, Bundle metadata) { this.columns = columns; @@ -48,13 +55,14 @@ public class DataHolder extends AutoSafeParcelable { protected static final int FIELD_TYPE_NULL = 0; protected static final int FIELD_TYPE_STRING = 3; + @SuppressWarnings("deprecation") @SuppressLint("NewApi") static int getCursorType(Cursor cursor, int i) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { return cursor.getType(i); } if (cursor instanceof AbstractWindowedCursor) { - CursorWindow cursorWindow = ((AbstractWindowedCursor)cursor).getWindow(); + CursorWindow cursorWindow = ((AbstractWindowedCursor) cursor).getWindow(); int pos = cursor.getPosition(); int type = -1; if (cursorWindow.isNull(pos, i)) { @@ -113,6 +121,17 @@ public class DataHolder extends AutoSafeParcelable { return dataHolder; } + + public int getCount() { + int c = 0; + if (windows != null) { + for (CursorWindow window : windows) { + c += window.getNumRows(); + } + } + return c; + } + @Override public String toString() { return "DataHolder{" + diff --git a/play-services-api/src/main/java/com/google/android/gms/common/data/Freezable.java b/play-services-api/src/main/java/com/google/android/gms/common/data/Freezable.java new file mode 100644 index 00000000..a6d69d46 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/common/data/Freezable.java @@ -0,0 +1,39 @@ +/* + * Copyright 2013-2015 µg 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.common.data; + +public interface Freezable { + /** + * Freeze a volatile representation into an immutable representation. Objects returned from + * this call are safe to cache. + *

+ * Note that the output of {@link #freeze} may not be identical to the parent object, but + * should be equal. + * + * @return A concrete implementation of the data object. + */ + T freeze(); + + /** + * Check to see if this object is valid for use. If the object is still volatile, this method + * will indicate whether or not the object can be safely used. + * The output of a call to {@link #freeze()} will always be valid. + * + * @return whether or not the object is valid for use. + */ + boolean isDataValid(); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/Asset.java b/play-services-api/src/main/java/com/google/android/gms/wearable/Asset.java new file mode 100644 index 00000000..6967fbdd --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/Asset.java @@ -0,0 +1,89 @@ +/* + * Copyright 2013-2015 µg 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; + +import android.net.Uri; +import android.os.ParcelFileDescriptor; + +import org.microg.gms.common.PublicApi; +import org.microg.safeparcel.AutoSafeParcelable; + +/** + * An asset is a binary blob shared between data items that is replicated across the wearable + * network on demand. + *

+ * It may represent an asset not yet added with the Android Wear network. DataItemAssets + * are representations of an asset after it has been added to the network through a + * {@link PutDataRequest}. + */ +@PublicApi +public class Asset extends AutoSafeParcelable { + + /** + * Creates an Asset using a byte array. + */ + public static Asset createFromBytes(byte[] assetData) { + return null; + } + + /** + * Creates an Asset using a file descriptor. The FD should be closed after being successfully + * sent in a putDataItem request. + */ + public static Asset createFromFd(ParcelFileDescriptor fd) { + return null; + } + + /** + * Create an Asset using an existing Asset's digest. + */ + public static Asset createFromRef(String digest) { + return null; + } + + /** + * Creates an Asset using a content URI. Google Play services must have permission to read this + * Uri. + */ + public static Asset createFromUri(Uri uri) { + return null; + } + + /** + * @return the digest associated with the asset data. A digest is a content identifier used to + * identify the asset across devices. + */ + public String getDigest() { + return null; + } + + /** + * @return the file descriptor referencing the asset. + */ + public ParcelFileDescriptor getFd() { + return null; + } + + /** + * @return the uri referencing the asset data. + */ + public Uri getUri() { + return null; + } + + public static final Creator CREATOR = new AutoCreator<>(Asset.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/DataItem.java b/play-services-api/src/main/java/com/google/android/gms/wearable/DataItem.java new file mode 100644 index 00000000..9acb48f8 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/DataItem.java @@ -0,0 +1,56 @@ +/* + * Copyright 2013-2015 µg 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; + +import android.net.Uri; + +import com.google.android.gms.common.data.Freezable; + +import org.microg.gms.common.PublicApi; + +import java.util.Map; + +/** + * The base object of data stored in the Android Wear network. {@link DataItem} are replicated + * across all devices in the network. It contains a small blob of data and associated assets. + *

+ * A {@link DataItem} is identified by its Uri, which contains its creator and a path. + */ +@PublicApi +public interface DataItem extends Freezable { + /** + * A map of assets associated with this data item. + */ + Map getAssets(); + + /** + * An array of data stored at the specified {@link Uri}. + */ + byte[] getData(); + + /** + * Returns the DataItem's Uri. {@link Uri#getHost()} returns the id of the node that created it. + */ + Uri getUri(); + + /** + * Sets the data in a data item. + *

+ * The current maximum data item size limit is approximately 100k. Data items should generally be much smaller than this limit. + */ + DataItem setData(byte[] data); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/DataItemAsset.java b/play-services-api/src/main/java/com/google/android/gms/wearable/DataItemAsset.java new file mode 100644 index 00000000..70057975 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/DataItemAsset.java @@ -0,0 +1,36 @@ +/* + * Copyright 2013-2015 µg 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; + +import com.google.android.gms.common.data.Freezable; + +/** + * A reference to an asset stored in a data item. Used to fetch file descriptors using + * DataApi#getFdForAsset(GoogleApiClient, DataItemAsset). + */ +public interface DataItemAsset extends Freezable { + /** + * @return the identifier used to address this asset in the context of an existing + * {@link DataItem}. + */ + String getDataItemKey(); + + /** + * @return the Android Wear-wide unique identifier for a particular asset. + */ + String getId(); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/Node.java b/play-services-api/src/main/java/com/google/android/gms/wearable/Node.java index f308c611..f52fe4df 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wearable/Node.java +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/Node.java @@ -27,10 +27,10 @@ public interface Node { * Returns a human readable description of the node. Sometimes generated from the Bluetooth * device name */ - public abstract String getDisplayName(); + String getDisplayName(); /** * Returns an opaque string that represents a node in the Android Wear network. */ - public abstract String getId(); + String getId(); } diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/PutDataRequest.java b/play-services-api/src/main/java/com/google/android/gms/wearable/PutDataRequest.java new file mode 100644 index 00000000..8d049eba --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/PutDataRequest.java @@ -0,0 +1,100 @@ +/* + * Copyright 2013-2015 µg 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; + +import android.net.Uri; + +import org.microg.gms.common.PublicApi; +import org.microg.safeparcel.AutoSafeParcelable; + +import java.util.Collections; +import java.util.Map; + +/** + * {@link PutDataRequest} is used to create new data items in the Android Wear network. + */ +@PublicApi +public class PutDataRequest extends AutoSafeParcelable { + public static final String WEAR_URI_SCHEME = "wear"; + + private DataItem dataItem; + + private PutDataRequest(DataItem dataItem) { + this.dataItem = dataItem; + } + + public static PutDataRequest create(String path) { + // TODO + return new PutDataRequest(null); + } + + public static PutDataRequest createFromDataItem(DataItem source) { + return new PutDataRequest(source); + } + + public static PutDataRequest createWithAutoAppendedId(String pathPrefix) { + return new PutDataRequest(null); + } + + public Asset getAsset(String key) { + // TODO + return null; + } + + public Map getAssets() { + // TODO + return Collections.emptyMap(); + } + + public byte[] getData() { + return dataItem.getData(); + } + + public Uri getUri() { + return dataItem.getUri(); + } + + public boolean hasAsset(String key) { + return dataItem.getAssets().containsKey(key); + } + + public PutDataRequest putAsset(String key, Asset value) { + // TODO + return this; + } + + public PutDataRequest removeAsset(String key) { + // TODO + return this; + } + + public PutDataRequest setData(byte[] data) { + // TODO + return this; + } + + @Override + public String toString() { + return toString(false); + } + + public String toString(boolean verbose) { + return "PutDataRequest{data=" + dataItem + "}"; + } + + public static final Creator CREATOR = new AutoCreator<>(PutDataRequest.class); +} diff --git a/play-services-api/src/main/java/org/microg/gms/common/PublicApi.java b/play-services-api/src/main/java/org/microg/gms/common/PublicApi.java index 45afeb22..94f84583 100644 --- a/play-services-api/src/main/java/org/microg/gms/common/PublicApi.java +++ b/play-services-api/src/main/java/org/microg/gms/common/PublicApi.java @@ -39,8 +39,10 @@ public @interface PublicApi { String until() default "latest"; /** - * @return used on a method or field to exclude it from the public api if the corresponding - * class was marked as public api + * Used on a method or field to exclude it from the public api if the corresponding class was + * marked as public api. + * + * @return true if the method or field is not part of the public api */ boolean exclude() default false; } From 1374dfa01201561418230b4c5afeacb5a249b4d8 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Tue, 31 Mar 2015 23:56:13 +0200 Subject: [PATCH 066/293] Add numerous wearable APIs --- extern/GmsApi | 2 +- .../android/gms/common/data/DataBuffer.java | 89 +++++ .../microg/gms/common/api/ApiConnection.java | 6 +- .../FusedLocationProviderApiImpl.java | 2 +- .../google/android/gms/wearable/DataApi.java | 145 +++++++ .../android/gms/wearable/DataEvent.java | 50 +++ .../android/gms/wearable/DataEventBuffer.java | 48 +++ .../android/gms/wearable/DataItemBuffer.java | 45 +++ .../google/android/gms/wearable/DataMap.java | 369 ++++++++++++++++++ .../android/gms/wearable/DataMapItem.java | 45 +++ .../android/gms/wearable/MessageApi.java | 68 ++++ .../android/gms/wearable/MessageEvent.java | 42 ++ .../google/android/gms/wearable/NodeApi.java | 78 ++++ .../gms/wearable/PutDataMapRequest.java | 83 ++++ .../gms/wearable/WearableListenerService.java | 58 +++ .../org/microg/gms/wearable/DataApiImpl.java | 53 +++ .../microg/gms/wearable/MessageApiImpl.java | 17 + .../org/microg/gms/wearable/NodeApiImpl.java | 22 ++ 18 files changed, 1217 insertions(+), 5 deletions(-) create mode 100644 play-services-base/src/main/java/com/google/android/gms/common/data/DataBuffer.java create mode 100644 play-services-wearable/src/main/java/com/google/android/gms/wearable/DataEvent.java create mode 100644 play-services-wearable/src/main/java/com/google/android/gms/wearable/DataEventBuffer.java create mode 100644 play-services-wearable/src/main/java/com/google/android/gms/wearable/DataItemBuffer.java create mode 100644 play-services-wearable/src/main/java/com/google/android/gms/wearable/DataMap.java create mode 100644 play-services-wearable/src/main/java/com/google/android/gms/wearable/DataMapItem.java create mode 100644 play-services-wearable/src/main/java/com/google/android/gms/wearable/MessageEvent.java create mode 100644 play-services-wearable/src/main/java/com/google/android/gms/wearable/PutDataMapRequest.java create mode 100644 play-services-wearable/src/main/java/com/google/android/gms/wearable/WearableListenerService.java diff --git a/extern/GmsApi b/extern/GmsApi index c43facae..70419935 160000 --- a/extern/GmsApi +++ b/extern/GmsApi @@ -1 +1 @@ -Subproject commit c43facae3dba6fcf4139c6a36e3a6f364d6db057 +Subproject commit 704199355e1c6f8b14402e01063fbae7b187b35b diff --git a/play-services-base/src/main/java/com/google/android/gms/common/data/DataBuffer.java b/play-services-base/src/main/java/com/google/android/gms/common/data/DataBuffer.java new file mode 100644 index 00000000..0d406cbd --- /dev/null +++ b/play-services-base/src/main/java/com/google/android/gms/common/data/DataBuffer.java @@ -0,0 +1,89 @@ +/* + * Copyright 2013-2015 µg 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.common.data; + +import com.google.android.gms.common.api.Releasable; + +import org.microg.gms.common.PublicApi; + +import java.util.Iterator; + +/** + * TODO + */ +@PublicApi +public abstract class DataBuffer implements Releasable, Iterable { + + private DataHolder dataHolder; + + @PublicApi(exclude = true) + public DataBuffer(DataHolder dataHolder) { + this.dataHolder = dataHolder; + } + + /** + * @deprecated use {@link #release()} instead + */ + @Deprecated + public final void close() { + release(); + } + + /** + * Get the item at the specified position. Note that the objects returned from subsequent + * invocations of this method for the same position may not be identical objects, but will be + * equal in value. + * + * @param position The position of the item to retrieve. + * @return the item at {@code position} in this buffer. + */ + public abstract T get(int position); + + public int getCount() { + return dataHolder == null ? 0 : dataHolder.getCount(); + } + + /** + * @deprecated {@link #release()} is idempotent, and so is safe to call multiple times + */ + @Deprecated + public boolean isClosed() { + return false; + } + + @Override + public Iterator iterator() { + return null; + } + + /** + * Releases resources used by the buffer. This method is idempotent. + */ + @Override + public void release() { + + } + + /** + * In order to use this one should correctly override setDataRow(int) in his DataBufferRef + * implementation. Be careful: there will be single DataBufferRef while iterating. + * If you are not sure - DO NOT USE this iterator. + */ + public Iterator singleRefIterator() { + return null; + } +} diff --git a/play-services-base/src/main/java/org/microg/gms/common/api/ApiConnection.java b/play-services-base/src/main/java/org/microg/gms/common/api/ApiConnection.java index d5697e4a..77c9af9d 100644 --- a/play-services-base/src/main/java/org/microg/gms/common/api/ApiConnection.java +++ b/play-services-base/src/main/java/org/microg/gms/common/api/ApiConnection.java @@ -17,11 +17,11 @@ package org.microg.gms.common.api; public interface ApiConnection { - public void connect(); + void connect(); - public void disconnect(); + void disconnect(); - public boolean isConnected(); + boolean isConnected(); boolean isConnecting(); } diff --git a/play-services-location/src/main/java/org/microg/gms/location/FusedLocationProviderApiImpl.java b/play-services-location/src/main/java/org/microg/gms/location/FusedLocationProviderApiImpl.java index f89a79af..08e90c5b 100644 --- a/play-services-location/src/main/java/org/microg/gms/location/FusedLocationProviderApiImpl.java +++ b/play-services-location/src/main/java/org/microg/gms/location/FusedLocationProviderApiImpl.java @@ -136,7 +136,7 @@ public class FusedLocationProviderApiImpl implements FusedLocationProviderApi { } private interface Runnable { - public void run(LocationClientImpl client) throws RemoteException; + void run(LocationClientImpl client) throws RemoteException; } } 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 c26bdf22..25ef04bc 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 @@ -16,5 +16,150 @@ 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 com.google.android.gms.common.data.Freezable; + +import org.microg.gms.common.PublicApi; + +import java.io.InputStream; + +/** + * Exposes an API for components to read or write data items and assets. + *

+ * A {@link DataItem} is synchronized across all devices in an Android Wear network. It is possible + * to set data items while not connected to any nodes. Those data items will be synchronized when + * the nodes eventually come online. + *

+ * Data items are private to the application that created them, and are only accessible by that + * application on other nodes. They should generally be small in size, relying on assets for the + * transfer of larger, more persistent data objects such as images. + *

+ * Each data item is identified by a URI, accessible with {@link DataItem#getUri()}, that indicates + * the item's creator and path. Fully specified URIs follow the following format: + * {@code wear:///}, where is the node ID of the wearable node that + * created the data item, and is an application-defined path. This means that given a data + * item's URI, calling {@link Uri#getHost()} will return the creator's node ID. + *

+ * In some of the methods below (such as {@link #getDataItems(GoogleApiClient, Uri)}), it is + * possible to omit the node ID from the URI, and only leave a path. In that case, the URI may + * refer to multiple data items, since multiple nodes may create data items with the same path. + * Partially specified data item URIs follow the following format: + * {@ocde wear:/} + * Note the single / after wear:. + */ +@PublicApi public interface DataApi { + /** + * Registers a listener to receive data item changed and deleted events. This call should be + * balanced with a call to {@link #removeListener(GoogleApiClient, DataListener)}, to avoid + * leaking resources. + *

+ * The listener will be notified of changes initiated by this node. + */ + PendingResult addListener(GoogleApiClient client, DataListener listener); + + /** + * Removes all specified data items from the Android Wear network. + *

+ * If uri is fully specified, this method will delete at most one data item. If {@code uri} + * contains no host, multiple data items may be deleted, since different nodes may create data + * items with the same path. See {@link DataApi} for details of the URI format. + */ + PendingResult deleteDataItems(GoogleApiClient client, Uri uri); + + /** + * Retrieves a single {@link DataItem} from the Android Wear network. A fully qualified URI + * must be specified. The URI's host must be the ID of the node that created the item. + *

+ * See {@link DataApi} for details of the URI format. + */ + PendingResult getDataItem(GoogleApiClient client, Uri uri); + + /** + * Retrieves all data items from the Android Wear network. + *

+ * Callers must call {@link DataItemBuffer#release()} on the returned buffer when finished + * processing results. + */ + PendingResult getDataItems(GoogleApiClient client); + + /** + * Retrieves all data items matching the provided URI, from the Android Wear network. + *

+ * The URI must contain a path. If {@code uri} is fully specified, at most one data item will + * be returned. If uri contains no host, multiple data items may be returned, since different + * nodes may create data items with the same path. See {@link DataApi} for details of the URI + * format. + *

+ * Callers must call {@link DataItemBuffer#release()} on the returned buffer when finished + * processing results. + */ + PendingResult getDataItems(GoogleApiClient client, Uri uri); + + /** + * Retrieves a {@link ParcelFileDescriptor} pointing at the bytes of an asset. Only assets + * previously stored in a {@link DataItem} may be retrieved. + */ + PendingResult getFdForAsset(GoogleApiClient client, DataItemAsset asset); + + /** + * Retrieves a {@link ParcelFileDescriptor} pointing at the bytes of an asset. Only assets + * previously stored in a {@link DataItem} may be retrieved. + */ + PendingResult getFdForAsset(GoogleApiClient client, Asset asset); + + /** + * Adds a {@link DataItem} to the Android Wear network. The updated item is synchronized across + * all devices. + */ + PendingResult putDataItem(GoogleApiClient client, PutDataRequest request); + + /** + * Removes a data listener which was previously added through + * {@link #addListener(GoogleApiClient, DataListener)}. + */ + PendingResult removeListener(GoogleApiClient client, DataListener listener); + + interface DataItemResult extends Result { + /** + * @return data item, or {@code null} if the item does not exit. + */ + DataItem getDataItem(); + } + + interface DataListener { + /** + * Notification that a set of data items have been changed or deleted. The data buffer is + * released upon completion of this method. If a caller wishes to use the events outside + * this callback, they should be sure to {@link Freezable#freeze()} the DataEvent objects + * they wish to use. + */ + void onDataChanged(DataEventBuffer dataEvents); + } + + interface DeleteDataItemsResult extends Result { + /** + * @return the number of items deleted by + * {@link DataApi#deleteDataItems(GoogleApiClient, Uri)}. + */ + int getNumDeleted(); + } + + interface GetFdForAssetResult extends Result { + /** + * @return a file descriptor for the requested asset. + */ + ParcelFileDescriptor getFd(); + + /** + * @return an input stream wrapping the file descriptor. When this input stream is closed, the file descriptor is, as well. + */ + InputStream getInputStream(); + } } diff --git a/play-services-wearable/src/main/java/com/google/android/gms/wearable/DataEvent.java b/play-services-wearable/src/main/java/com/google/android/gms/wearable/DataEvent.java new file mode 100644 index 00000000..0d72101e --- /dev/null +++ b/play-services-wearable/src/main/java/com/google/android/gms/wearable/DataEvent.java @@ -0,0 +1,50 @@ +/* + * Copyright 2013-2015 µg 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; + +import com.google.android.gms.common.data.Freezable; + +import org.microg.gms.common.PublicApi; + +/** + * Data interface for data events. + */ +@PublicApi +public interface DataEvent extends Freezable { + + /** + * Indicates that the enclosing {@link DataEvent} was triggered by a data item being added or + * changed. + */ + int TYPE_CHANGED = 1; + + /** + * Indicates that the enclosing {@link DataEvent} was triggered by a data item being deleted. + */ + int TYPE_DELETED = 2; + + /** + * @return the data item modified in this event. An event of {@link #TYPE_DELETED} will only + * have its {@link DataItem#getUri} populated. + */ + DataItem getDataItem(); + + /** + * @return the type of event this is. One of {@link #TYPE_CHANGED}, {@link #TYPE_DELETED}. + */ + int getType(); +} diff --git a/play-services-wearable/src/main/java/com/google/android/gms/wearable/DataEventBuffer.java b/play-services-wearable/src/main/java/com/google/android/gms/wearable/DataEventBuffer.java new file mode 100644 index 00000000..1d4f6a45 --- /dev/null +++ b/play-services-wearable/src/main/java/com/google/android/gms/wearable/DataEventBuffer.java @@ -0,0 +1,48 @@ +/* + * Copyright 2013-2015 µg 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; + +import com.google.android.gms.common.api.Result; +import com.google.android.gms.common.api.Status; +import com.google.android.gms.common.data.DataBuffer; +import com.google.android.gms.common.data.DataHolder; + +import org.microg.gms.common.PublicApi; + +/** + * Data structure holding references to a set of events. + */ +@PublicApi +public class DataEventBuffer extends DataBuffer implements Result { + private Status status; + + @PublicApi(exclude = true) + public DataEventBuffer(DataHolder dataHolder) { + super(dataHolder); + status = new Status(dataHolder.statusCode); + } + + @Override + public DataEvent get(int position) { + return null; + } + + @Override + public Status getStatus() { + return null; + } +} diff --git a/play-services-wearable/src/main/java/com/google/android/gms/wearable/DataItemBuffer.java b/play-services-wearable/src/main/java/com/google/android/gms/wearable/DataItemBuffer.java new file mode 100644 index 00000000..991b79f4 --- /dev/null +++ b/play-services-wearable/src/main/java/com/google/android/gms/wearable/DataItemBuffer.java @@ -0,0 +1,45 @@ +/* + * Copyright 2013-2015 µg 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; + +import com.google.android.gms.common.api.Result; +import com.google.android.gms.common.api.Status; +import com.google.android.gms.common.data.DataBuffer; +import com.google.android.gms.common.data.DataHolder; + +import org.microg.gms.common.PublicApi; + +@PublicApi +public class DataItemBuffer extends DataBuffer implements Result { + private Status status; + + @PublicApi(exclude = true) + public DataItemBuffer(DataHolder dataHolder) { + super(dataHolder); + status = new Status(dataHolder.statusCode); + } + + @Override + public DataItem get(int position) { + return null; + } + + @Override + public Status getStatus() { + return null; + } +} diff --git a/play-services-wearable/src/main/java/com/google/android/gms/wearable/DataMap.java b/play-services-wearable/src/main/java/com/google/android/gms/wearable/DataMap.java new file mode 100644 index 00000000..aad96e14 --- /dev/null +++ b/play-services-wearable/src/main/java/com/google/android/gms/wearable/DataMap.java @@ -0,0 +1,369 @@ +/* + * Copyright 2013-2015 µg 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; + +import android.os.Bundle; + +import org.microg.gms.common.PublicApi; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; + +/** + * A map of data supported by {@link PutDataMapRequest} and {@link DataMapItem}s. DataMap may + * convert to and from Bundles, but will drop any types not explicitly supported by DataMap in the + * conversion process. + */ +@PublicApi +public class DataMap { + public static String TAG = "GmsDataMap"; + + private Map data = new HashMap<>(); + private Map types = new HashMap<>(); + + public DataMap() { + + } + + /** + * @return an ArrayList of DataMaps from an ArrayList of Bundles. Any elements in the Bundles not supported by DataMap will be dropped. + */ + public static ArrayList arrayListFromBundleArrayList(ArrayList bundleArrayList) { + ArrayList res = new ArrayList<>(); + for (Bundle bundle : bundleArrayList) { + res.add(fromBundle(bundle)); + } + return res; + } + + /** + * Removes all elements from the mapping of this DataMap. + */ + public void clear() { + data.clear(); + } + + /** + * @return true if the given key is contained in the mapping of this DataMap. + */ + public boolean containsKey(String key) { + return data.containsKey(key); + } + + /** + * @return true if the given Object is a DataMap equivalent to this one. + */ + @Override + public boolean equals(Object o) { + return o instanceof DataMap && data.equals(((DataMap) o).data); + } + + /** + * @return a DataMap from a Bundle. The input Bundle is expected to contain only elements + * supported by DataMap. Any elements in the Bundle not supported by DataMap will be dropped. + */ + public static DataMap fromBundle(Bundle bundle) { + DataMap res = new DataMap(); + if (bundle != null) { + for (String key : bundle.keySet()) { + res.data.put(key, bundle.get(key)); + } + } + return res; + } + + /** + * @return a DataMap from a byte[]. + */ + public static DataMap fromByteArray(byte[] bytes) { + return null; // TODO + } + + /** + * @return the entry with the given key as an object, or null + */ + public T get(String key) { + return (T) data.get(key); + } + + public Asset getAsset(String key) { + return types.get(key) == StoredType.Asset ? (Asset) data.get(key) : null; + } + + public boolean getBoolean(String key) { + return getBoolean(key, false); + } + + public boolean getBoolean(String key, boolean defaultValue) { + return types.get(key) == StoredType.Boolean ? (Boolean) data.get(key) : defaultValue; + } + + public byte getByte(String key) { + return getByte(key, (byte) 0); + } + + public byte getByte(String key, byte defaultValue) { + return types.get(key) == StoredType.Byte ? (Byte) data.get(key) : defaultValue; + } + + public byte[] getByteArray(String key) { + return types.get(key) == StoredType.ByteArray ? (byte[]) data.get(key) : null; + } + + public DataMap getDataMap(String key) { + return types.get(key) == StoredType.DataMap ? (DataMap) data.get(key) : null; + } + + public ArrayList getDataMapArrayList(String key) { + return types.get(key) == StoredType.DataMapArrayList ? (ArrayList) data.get(key) : null; + } + + public double getDouble(String key) { + return getDouble(key, 0.0); + } + + public double getDouble(String key, double defaultValue) { + return types.get(key) == StoredType.Double ? (Double) data.get(key) : defaultValue; + } + + public float getFloat(String key) { + return getFloat(key, 0.0f); + } + + public float getFloat(String key, float defaultValue) { + return types.get(key) == StoredType.Float ? (Float) data.get(key) : defaultValue; + } + + public float[] getFloatArray(String key) { + return types.get(key) == StoredType.FloatArray ? (float[]) data.get(key) : null; + } + + public int getInt(String key) { + return getInt(key, 0); + } + + public int getInt(String key, int defaultValue) { + return types.get(key) == StoredType.Integer ? (Integer) data.get(key) : defaultValue; + } + + public ArrayList getIntegerArrayList(String key) { + return types.get(key) == StoredType.IntegerArrayList ? (ArrayList) data.get(key) : null; + } + + public long getLong(String key) { + return getLong(key, 0L); + } + + public long getLong(String key, long defaultValue) { + return types.get(key) == StoredType.Long ? (Long) data.get(key) : defaultValue; + } + + public long[] getLongArray(String key) { + return types.get(key) == StoredType.LongArray ? (long[]) data.get(key) : null; + } + + public String getString(String key) { + return getString(key, null); + } + + public String getString(String key, String defaultValue) { + return types.get(key) == StoredType.String ? (String) data.get(key) : defaultValue; + } + + public String[] getStringArray(String key) { + return types.get(key) == StoredType.StringArray ? (String[]) data.get(key) : null; + } + + public ArrayList getStringArrayList(String key) { + return types.get(key) == StoredType.StringArrayList ? (ArrayList) data.get(key) : null; + } + + public int hashCode() { + return data.hashCode(); + } + + public boolean isEmpty() { + return data.isEmpty(); + } + + public Set keySet() { + return data.keySet(); + } + + public void putAll(DataMap dataMap) { + for (String key : dataMap.keySet()) { + data.put(key, dataMap.data.get(key)); + types.put(key, dataMap.types.get(key)); + } + } + + public void putBoolean(String key, boolean value) { + data.put(key, value); + types.put(key, StoredType.Boolean); + } + + public void putByte(String key, byte value) { + data.put(key, value); + types.put(key, StoredType.Byte); + } + + public void putByteArray(String key, byte[] value) { + data.put(key, value); + types.put(key, StoredType.ByteArray); + } + + public void putDataMap(String key, DataMap value) { + data.put(key, value); + types.put(key, StoredType.DataMap); + } + + public void putDataMapArrayList(String key, ArrayList value) { + data.put(key, value); + types.put(key, StoredType.DataMapArrayList); + } + + public void putDouble(String key, double value) { + data.put(key, value); + types.put(key, StoredType.Double); + } + + public void putFloat(String key, float value) { + data.put(key, value); + types.put(key, StoredType.Float); + } + + public void putFloatArray(String key, float[] value) { + data.put(key, value); + types.put(key, StoredType.FloatArray); + } + + public void putInt(String key, int value) { + data.put(key, value); + types.put(key, StoredType.Integer); + } + + public void putIntegerArrayList(String key, ArrayList value) { + data.put(key, value); + types.put(key, StoredType.IntegerArrayList); + } + + public void putLong(String key, long value) { + data.put(key, value); + types.put(key, StoredType.Long); + } + + public void putLongArray(String key, long[] value) { + data.put(key, value); + types.put(key, StoredType.LongArray); + } + + public void putString(String key, String value) { + data.put(key, value); + types.put(key, StoredType.String); + } + + public void putStringArray(String key, String[] value) { + data.put(key, value); + types.put(key, StoredType.StringArray); + } + + public void putStringArrayList(String key, ArrayList value) { + data.put(key, value); + types.put(key, StoredType.StringArrayList); + } + + public Object remove(String key) { + types.remove(key); + return data.remove(key); + } + + public int size() { + return data.size(); + } + + public Bundle toBundle() { + Bundle bundle = new Bundle(); + for (String key : data.keySet()) { + switch (types.get(key)) { + case Asset: + bundle.putParcelable(key, (Asset)data.get(key)); + break; + case Boolean: + bundle.putBoolean(key, (Boolean) data.get(key)); + break; + case Byte: + bundle.putByte(key, (Byte) data.get(key)); + break; + case ByteArray: + bundle.putByteArray(key, (byte[]) data.get(key)); + break; + case DataMap: + bundle.putBundle(key, ((DataMap) data.get(key)).toBundle()); + break; + case DataMapArrayList: + // TODO + break; + case Double: + bundle.putDouble(key, (Double) data.get(key)); + break; + case Float: + bundle.putFloat(key, (Float) data.get(key)); + break; + case FloatArray: + bundle.putFloatArray(key, (float[]) data.get(key)); + break; + case Integer: + bundle.putInt(key, (Integer) data.get(key)); + break; + case IntegerArrayList: + bundle.putIntegerArrayList(key, (ArrayList) data.get(key)); + break; + case Long: + bundle.putLong(key, (Long) data.get(key)); + break; + case LongArray: + bundle.putLongArray(key, (long[]) data.get(key)); + break; + case String: + bundle.putString(key, (String) data.get(key)); + break; + case StringArray: + bundle.putStringArray(key, (String[]) data.get(key)); + break; + case StringArrayList: + bundle.putStringArrayList(key, (ArrayList) data.get(key)); + break; + } + } + return bundle; + } + + public byte[] toByteArray() { + return null; // TODO + } + + public String toString() { + return "DataMap{size=" + size() + "}"; + } + + private enum StoredType { + Asset, Boolean, Byte, ByteArray, DataMap, DataMapArrayList, Double, Float, FloatArray, + Integer, IntegerArrayList, Long, LongArray, String, StringArray, StringArrayList + } +} diff --git a/play-services-wearable/src/main/java/com/google/android/gms/wearable/DataMapItem.java b/play-services-wearable/src/main/java/com/google/android/gms/wearable/DataMapItem.java new file mode 100644 index 00000000..7eb6fb0f --- /dev/null +++ b/play-services-wearable/src/main/java/com/google/android/gms/wearable/DataMapItem.java @@ -0,0 +1,45 @@ +/* + * Copyright 2013-2015 µg 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; + +import android.net.Uri; + +import org.microg.gms.common.PublicApi; + +/** + * Creates a new dataItem-like object containing structured and serializable data. + */ +@PublicApi +public class DataMapItem { + /** + * Provides a {@link DataMapItem} wrapping a dataItem. + * + * @param dataItem the base for the wrapped {@link DataMapItem}. {@code dataItem} should not + * be modified after wrapping it. + */ + public static DataMapItem fromDataItem(DataItem dataItem) { + return null; + } + + public DataMap getDataMap() { + return null; + } + + public Uri getUri() { + return null; + } +} diff --git a/play-services-wearable/src/main/java/com/google/android/gms/wearable/MessageApi.java b/play-services-wearable/src/main/java/com/google/android/gms/wearable/MessageApi.java index 730ebe4a..999d615f 100644 --- a/play-services-wearable/src/main/java/com/google/android/gms/wearable/MessageApi.java +++ b/play-services-wearable/src/main/java/com/google/android/gms/wearable/MessageApi.java @@ -16,5 +16,73 @@ package com.google.android.gms.wearable; +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; + +@PublicApi public interface MessageApi { + + /** + * A value returned by {@link SendMessageResult#getRequestId()} when + * {@link #sendMessage(GoogleApiClient, String, String, byte[])} fails. + */ + int UNKNOWN_REQUEST_ID = -1; + + /** + * Registers a listener to be notified of received messages. Calls to this method should + * balanced with {@link #removeListener(GoogleApiClient, MessageListener)} to avoid leaking + * resources. + *

+ * Callers wishing to be notified of events in the background should use {@link WearableListenerService}. + */ + PendingResult addListener(GoogleApiClient client, MessageListener listener); + + /** + * Removes a message listener which was previously added through + * {@link #addListener(GoogleApiClient, MessageListener)}. + */ + PendingResult removeListener(GoogleApiClient client, MessageListener listener); + + /** + * Sends {@code byte[]} data to the specified node. + * + * @param nodeId identifier for a particular node on the Android Wear network. Valid targets + * may be obtained through {@link NodeApi#getConnectedNodes(GoogleApiClient)} + * or from the host in {@link DataItem#getUri()}. + * @param path identifier used to specify a particular endpoint at the receiving node + * @param data small array of information to pass to the target node. Generally not larger + * than 100k + */ + PendingResult sendMessage(GoogleApiClient client, String nodeId, + String path, byte[] data); + + /** + * Used with {@link MessageApi#addListener(GoogleApiClient, MessageListener)} to receive + * message events. + *

+ * Callers wishing to be notified of events in the background should use + * {@link WearableListenerService}. + */ + interface MessageListener { + /** + * Notification that a message has been received. + */ + void onMessageReceived(MessageEvent messageEvent); + } + + /** + * Contains the request id assigned to the message. On failure, the id will be + * {@link MessageApi#UNKNOWN_REQUEST_ID} and the status will be unsuccessful. + */ + interface SendMessageResult extends Result { + /** + * @return an ID used to identify the sent message. If {@link #getStatus()} is not + * successful, this value will be {@link MessageApi#UNKNOWN_REQUEST_ID}. + */ + int getRequestId(); + } } diff --git a/play-services-wearable/src/main/java/com/google/android/gms/wearable/MessageEvent.java b/play-services-wearable/src/main/java/com/google/android/gms/wearable/MessageEvent.java new file mode 100644 index 00000000..c5dd0d33 --- /dev/null +++ b/play-services-wearable/src/main/java/com/google/android/gms/wearable/MessageEvent.java @@ -0,0 +1,42 @@ +/* + * Copyright 2013-2015 µg 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; + +import org.microg.gms.common.PublicApi; + +@PublicApi +public interface MessageEvent { + /** + * @return the data passed by the message. + */ + byte[] getData(); + + /** + * @return the path the message is being delivered to + */ + String getPath(); + + /** + * @return the request id of the message, generated by the sender + */ + int getRequestId(); + + /** + * @return the node ID of the sender. + */ + String getSourceNodeId(); +} 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 4aa57284..86088446 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 @@ -16,5 +16,83 @@ package com.google.android.gms.wearable; +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; + +import java.util.List; + +/** + * Exposes an API for to learn about local or connected Nodes. + *

+ * Node events are delivered to all applications on a device. + */ +@PublicApi public interface NodeApi { + + /** + * Registers a listener to receive all node events. Calls to this method should balanced with + * {@link #removeListener(GoogleApiClient, NodeListener)}, to avoid leaking resources. + *

+ * Callers wishing to be notified of node events in the background should use WearableListenerService. + */ + PendingResult addListener(GoogleApiClient client, NodeListener listener); + + /** + * Gets a list of nodes to which this device is currently connected. + *

+ * The returned list will not include the {@link #getLocalNode(GoogleApiClient) local node}. + */ + PendingResult getConnectedNodes(GoogleApiClient client); + + /** + * Gets the {@link Node} that refers to this device. The information in the returned Node + * can be passed to other devices using the {@link MessageApi}, for example. + */ + PendingResult getLocalNode(GoogleApiClient client); + + /** + * Removes a listener which was previously added through + * {@link #addListener(GoogleApiClient, NodeListener)}. + */ + PendingResult removeListener(GoogleApiClient client, NodeListener listener); + + + /** + * Contains a list of connected nodes. + */ + interface GetConnectedNodesResult extends Result { + /** + * @return a list of connected nodes. This list doesn't include the local node. + */ + List getNodes(); + } + + /** + * Contains the name and id that represents this device. + */ + interface GetLocalNodeResult extends Result { + /** + * @return a {@link Node} object which represents this device. + */ + Node getNode(); + } + + /** + * Used with {@link NodeApi#addListener(GoogleApiClient, NodeListener)} to receive node events. + */ + interface NodeListener { + /** + * Notification that a peer has been connected. + */ + void onPeerConnected(Node peer); + + /** + * Notification that a peer has been disconnected. + */ + void onPeerDisconnected(Node peer); + } } diff --git a/play-services-wearable/src/main/java/com/google/android/gms/wearable/PutDataMapRequest.java b/play-services-wearable/src/main/java/com/google/android/gms/wearable/PutDataMapRequest.java new file mode 100644 index 00000000..f70e3c6c --- /dev/null +++ b/play-services-wearable/src/main/java/com/google/android/gms/wearable/PutDataMapRequest.java @@ -0,0 +1,83 @@ +/* + * Copyright 2013-2015 µg 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; + +import android.net.Uri; + +import org.microg.gms.common.PublicApi; + +/** + * PutDataMapRequest is a DataMap-aware version of {@link PutDataRequest}. + */ +@PublicApi +public class PutDataMapRequest { + + private DataMapItem dataMapItem; + + private PutDataMapRequest(DataMapItem dataMapItem) { + this.dataMapItem = dataMapItem; + } + + /** + * Creates a {@link PutDataRequest} containing the data and assets in this + * {@link PutDataMapRequest}. + */ + public PutDataRequest asPutDataRequest() { + // TODO + return new PutDataRequest(); + } + + /** + * Creates a {@link PutDataMapRequest} with the provided, complete, path. + */ + public static PutDataMapRequest create(String path) { + // TODO + return new PutDataMapRequest(null); + } + + /** + * Creates a {@link PutDataMapRequest} from a {@link DataMapItem} using the provided source. + */ + public static PutDataMapRequest createFromDataMapItem(DataMapItem source) { + return new PutDataMapRequest(source); + } + + /** + * Creates a {@link PutDataMapRequest} with a randomly generated id prefixed with the provided + * path. + */ + public static PutDataMapRequest createWithAutoAppendedId(String pathPrefix) { + // TODO + return new PutDataMapRequest(null); + } + + /** + * @return the structured data associated with this data item. + */ + public DataMap getDataMap() { + return dataMapItem.getDataMap(); + } + + /** + * @return a {@link Uri} for the pending data item. If this is a modification of an existing + * data item, {@link Uri#getHost()} will return the id of the node that originally created it. + * Otherwise, a new data item will be created with the requesting device's node. + */ + public Uri getUri() { + return dataMapItem.getUri(); + } +} diff --git a/play-services-wearable/src/main/java/com/google/android/gms/wearable/WearableListenerService.java b/play-services-wearable/src/main/java/com/google/android/gms/wearable/WearableListenerService.java new file mode 100644 index 00000000..61a552d0 --- /dev/null +++ b/play-services-wearable/src/main/java/com/google/android/gms/wearable/WearableListenerService.java @@ -0,0 +1,58 @@ +/* + * Copyright 2013-2015 µg 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; + +import android.app.Service; +import android.content.Intent; +import android.os.IBinder; + +public abstract class WearableListenerService extends Service implements DataApi.DataListener, MessageApi.MessageListener, NodeApi.NodeListener { + @Override + public IBinder onBind(Intent intent) { + return null; + } + + @Override + public void onCreate() { + super.onCreate(); + } + + @Override + public void onDataChanged(DataEventBuffer dataEvents) { + + } + + @Override + public void onDestroy() { + super.onDestroy(); + } + + @Override + public void onMessageReceived(MessageEvent messageEvent) { + + } + + @Override + public void onPeerConnected(Node peer) { + + } + + @Override + public void onPeerDisconnected(Node peer) { + + } +} diff --git a/play-services-wearable/src/main/java/org/microg/gms/wearable/DataApiImpl.java b/play-services-wearable/src/main/java/org/microg/gms/wearable/DataApiImpl.java index 5d8f07ec..bdfa778e 100644 --- a/play-services-wearable/src/main/java/org/microg/gms/wearable/DataApiImpl.java +++ b/play-services-wearable/src/main/java/org/microg/gms/wearable/DataApiImpl.java @@ -16,7 +16,60 @@ package org.microg.gms.wearable; +import android.net.Uri; + +import com.google.android.gms.common.api.GoogleApiClient; +import com.google.android.gms.common.api.PendingResult; +import com.google.android.gms.common.api.Status; +import com.google.android.gms.wearable.Asset; import com.google.android.gms.wearable.DataApi; +import com.google.android.gms.wearable.DataItemAsset; +import com.google.android.gms.wearable.DataItemBuffer; +import com.google.android.gms.wearable.PutDataRequest; public class DataApiImpl implements DataApi { + @Override + public PendingResult addListener(GoogleApiClient client, DataListener listener) { + return null; + } + + @Override + public PendingResult deleteDataItems(GoogleApiClient client, Uri uri) { + return null; + } + + @Override + public PendingResult getDataItem(GoogleApiClient client, Uri uri) { + return null; + } + + @Override + public PendingResult getDataItems(GoogleApiClient client) { + return null; + } + + @Override + public PendingResult getDataItems(GoogleApiClient client, Uri uri) { + return null; + } + + @Override + public PendingResult getFdForAsset(GoogleApiClient client, DataItemAsset asset) { + return null; + } + + @Override + public PendingResult getFdForAsset(GoogleApiClient client, Asset asset) { + return null; + } + + @Override + public PendingResult putDataItem(GoogleApiClient client, PutDataRequest request) { + return null; + } + + @Override + public PendingResult removeListener(GoogleApiClient client, DataListener listener) { + return null; + } } diff --git a/play-services-wearable/src/main/java/org/microg/gms/wearable/MessageApiImpl.java b/play-services-wearable/src/main/java/org/microg/gms/wearable/MessageApiImpl.java index 6f055d5e..667eaa77 100644 --- a/play-services-wearable/src/main/java/org/microg/gms/wearable/MessageApiImpl.java +++ b/play-services-wearable/src/main/java/org/microg/gms/wearable/MessageApiImpl.java @@ -16,7 +16,24 @@ package org.microg.gms.wearable; +import com.google.android.gms.common.api.GoogleApiClient; +import com.google.android.gms.common.api.PendingResult; +import com.google.android.gms.common.api.Status; import com.google.android.gms.wearable.MessageApi; public class MessageApiImpl implements MessageApi { + @Override + public PendingResult addListener(GoogleApiClient client, MessageListener listener) { + return null; + } + + @Override + public PendingResult removeListener(GoogleApiClient client, MessageListener listener) { + return null; + } + + @Override + public PendingResult sendMessage(GoogleApiClient client, String nodeId, String path, byte[] data) { + return null; + } } diff --git a/play-services-wearable/src/main/java/org/microg/gms/wearable/NodeApiImpl.java b/play-services-wearable/src/main/java/org/microg/gms/wearable/NodeApiImpl.java index bf8bf5ed..2aca31ee 100644 --- a/play-services-wearable/src/main/java/org/microg/gms/wearable/NodeApiImpl.java +++ b/play-services-wearable/src/main/java/org/microg/gms/wearable/NodeApiImpl.java @@ -16,7 +16,29 @@ package org.microg.gms.wearable; +import com.google.android.gms.common.api.GoogleApiClient; +import com.google.android.gms.common.api.PendingResult; +import com.google.android.gms.common.api.Status; import com.google.android.gms.wearable.NodeApi; public class NodeApiImpl implements NodeApi { + @Override + public PendingResult addListener(GoogleApiClient client, NodeListener listener) { + return null; + } + + @Override + public PendingResult getConnectedNodes(GoogleApiClient client) { + return null; + } + + @Override + public PendingResult getLocalNode(GoogleApiClient client) { + return null; + } + + @Override + public PendingResult removeListener(GoogleApiClient client, NodeListener listener) { + return null; + } } From 0ea075dd1179382d7d4a127133162dfd376ce6ce Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Wed, 1 Apr 2015 00:13:40 +0200 Subject: [PATCH 067/293] Small fixes --- .../gms/common/MultiConnectionKeeper.java | 17 ++++++++++++----- .../android/gms/wearable/PutDataMapRequest.java | 2 +- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/play-services-base/src/main/java/org/microg/gms/common/MultiConnectionKeeper.java b/play-services-base/src/main/java/org/microg/gms/common/MultiConnectionKeeper.java index 84ce091d..d88bc5ed 100644 --- a/play-services-base/src/main/java/org/microg/gms/common/MultiConnectionKeeper.java +++ b/play-services-base/src/main/java/org/microg/gms/common/MultiConnectionKeeper.java @@ -16,6 +16,7 @@ package org.microg.gms.common; +import android.annotation.SuppressLint; import android.content.ComponentName; import android.content.Context; import android.content.Intent; @@ -28,10 +29,12 @@ import java.util.HashSet; import java.util.Map; import java.util.Set; +import static android.os.Build.VERSION.SDK_INT; +import static android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH; import static org.microg.gms.common.Constants.GMS_PACKAGE_NAME; public class MultiConnectionKeeper { - private static final String TAG = "GmsMultiConnectionKeeper"; + private static final String TAG = "GmsMultiConKeeper"; private static MultiConnectionKeeper INSTANCE; @@ -89,7 +92,7 @@ public class MultiConnectionKeeper { @Override public void onServiceConnected(ComponentName componentName, IBinder iBinder) { Log.d(TAG, "Connection(" + actionString + ") : ServiceConnection : " + - "onServiceConnected("+componentName+")"); + "onServiceConnected(" + componentName + ")"); binder = iBinder; component = componentName; for (ServiceConnection connection : connectionForwards) { @@ -101,7 +104,7 @@ public class MultiConnectionKeeper { @Override public void onServiceDisconnected(ComponentName componentName) { Log.d(TAG, "Connection(" + actionString + ") : ServiceConnection : " + - "onServiceDisconnected("+componentName+")"); + "onServiceDisconnected(" + componentName + ")"); binder = null; component = componentName; for (ServiceConnection connection : connectionForwards) { @@ -116,11 +119,15 @@ public class MultiConnectionKeeper { this.actionString = actionString; } + @SuppressLint("InlinedApi") public void bind() { Log.d(TAG, "Connection(" + actionString + ") : bind()"); Intent intent = new Intent(actionString).setPackage(GMS_PACKAGE_NAME); - bound = context.bindService(intent, serviceConnection, - Context.BIND_ADJUST_WITH_ACTIVITY | Context.BIND_AUTO_CREATE); + int flags = Context.BIND_AUTO_CREATE; + if (SDK_INT >= ICE_CREAM_SANDWICH) { + flags |= Context.BIND_ADJUST_WITH_ACTIVITY; + } + bound = context.bindService(intent, serviceConnection, flags); if (!bound) { context.unbindService(serviceConnection); } diff --git a/play-services-wearable/src/main/java/com/google/android/gms/wearable/PutDataMapRequest.java b/play-services-wearable/src/main/java/com/google/android/gms/wearable/PutDataMapRequest.java index f70e3c6c..339c23ef 100644 --- a/play-services-wearable/src/main/java/com/google/android/gms/wearable/PutDataMapRequest.java +++ b/play-services-wearable/src/main/java/com/google/android/gms/wearable/PutDataMapRequest.java @@ -38,7 +38,7 @@ public class PutDataMapRequest { */ public PutDataRequest asPutDataRequest() { // TODO - return new PutDataRequest(); + return PutDataRequest.create(null); } /** From 9dea25dca4c45e12dd9e72580d67d9e252837325 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Mon, 6 Apr 2015 23:54:07 +0200 Subject: [PATCH 068/293] Extend ServiceBroker --- .../common/internal/GetServiceRequest.aidl | 3 + .../common/internal/IGmsServiceBroker.aidl | 53 +++++++++------- .../internal/ValidateAccountRequest.aidl | 3 + .../common/internal/GetServiceRequest.java | 63 +++++++++++++++++++ .../internal/ValidateAccountRequest.java | 23 +++++++ 5 files changed, 121 insertions(+), 24 deletions(-) create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/common/internal/GetServiceRequest.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/common/internal/ValidateAccountRequest.aidl create mode 100644 play-services-api/src/main/java/com/google/android/gms/common/internal/GetServiceRequest.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/common/internal/ValidateAccountRequest.java diff --git a/play-services-api/src/main/aidl/com/google/android/gms/common/internal/GetServiceRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/common/internal/GetServiceRequest.aidl new file mode 100644 index 00000000..791dbe90 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/common/internal/GetServiceRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.common.internal; + +parcelable GetServiceRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/common/internal/IGmsServiceBroker.aidl b/play-services-api/src/main/aidl/com/google/android/gms/common/internal/IGmsServiceBroker.aidl index 185b394a..2074e4aa 100644 --- a/play-services-api/src/main/aidl/com/google/android/gms/common/internal/IGmsServiceBroker.aidl +++ b/play-services-api/src/main/aidl/com/google/android/gms/common/internal/IGmsServiceBroker.aidl @@ -3,30 +3,35 @@ package com.google.android.gms.common.internal; import android.os.Bundle; import com.google.android.gms.common.internal.IGmsCallbacks; +import com.google.android.gms.common.internal.GetServiceRequest; +import com.google.android.gms.common.internal.ValidateAccountRequest; interface IGmsServiceBroker { - void getPlusService(IGmsCallbacks callback, int code, String str1, String str2, in String[] paramArrayOfString, String str3, in Bundle params); - void getPanoramaService(IGmsCallbacks callback, int code, String str, in Bundle params); - void getAppDataSearchService(IGmsCallbacks callback, int code, String str); - void getWalletService(IGmsCallbacks callback, int code); - void getPeopleService(IGmsCallbacks callback, int code, String str, in Bundle params); - void getReportingService(IGmsCallbacks callback, int code, String str, in Bundle params); - void getLocationService(IGmsCallbacks callback, int code, String str, in Bundle params); - void getGoogleLocationManagerService(IGmsCallbacks callback, int code, String str, in Bundle params); - void getGamesService(IGmsCallbacks callback, int code, String str1, String str2, in String[] args, String str3, IBinder binder, String str4, in Bundle params); - void getAppStateService(IGmsCallbacks callback, int code, String str1, String str2, in String[] args); - void getPlayLogService(IGmsCallbacks callback, int code, String str, in Bundle params); - void getAdMobService(IGmsCallbacks callback, int code, String str, in Bundle params); - void getDroidGuardService(IGmsCallbacks callback, int code, String str, in Bundle params); - void getLockboxService(IGmsCallbacks callback, int code, String str, in Bundle params); - void getCastMirroringService(IGmsCallbacks callback, int code, String str, in Bundle params); - void getNetworkQualityService(IGmsCallbacks callback, int code, String str, in Bundle params); - void getGoogleIdentityService(IGmsCallbacks callback, int code, String str, in Bundle params); - void getGoogleFeedbackService(IGmsCallbacks callback, int code, String str, in Bundle params); - void getCastService(IGmsCallbacks callback, int code, String str, IBinder binder, in Bundle params); - void getDriveService(IGmsCallbacks callback, int code, String str1, in String[] args, String str2, in Bundle params); - void getLightweightAppDataSearchService(IGmsCallbacks callback, int code, String str); - void getSearchAdministrationService(IGmsCallbacks callback, int code, String str); - void getAutoBackupService(IGmsCallbacks callback, int code, String str, in Bundle params); - void getAddressService(IGmsCallbacks callback, int code, String str); + void getPlusService(IGmsCallbacks callback, int code, String str1, String str2, in String[] paramArrayOfString, String str3, in Bundle params) = 0; + void getPanoramaService(IGmsCallbacks callback, int code, String str, in Bundle params) = 1; + void getAppDataSearchService(IGmsCallbacks callback, int code, String str) = 2; + void getWalletService(IGmsCallbacks callback, int code) = 3; + void getPeopleService(IGmsCallbacks callback, int code, String str, in Bundle params) = 4; + void getReportingService(IGmsCallbacks callback, int code, String str, in Bundle params) = 5; + void getLocationService(IGmsCallbacks callback, int code, String str, in Bundle params) = 6; + void getGoogleLocationManagerService(IGmsCallbacks callback, int code, String str, in Bundle params) = 7; + void getGamesService(IGmsCallbacks callback, int code, String str1, String str2, in String[] args, String str3, IBinder binder, String str4, in Bundle params) = 8; + void getAppStateService(IGmsCallbacks callback, int code, String str1, String str2, in String[] args) = 9; + void getPlayLogService(IGmsCallbacks callback, int code, String str, in Bundle params) = 10; + void getAdMobService(IGmsCallbacks callback, int code, String str, in Bundle params) = 11; + void getDroidGuardService(IGmsCallbacks callback, int code, String str, in Bundle params) = 12; + void getLockboxService(IGmsCallbacks callback, int code, String str, in Bundle params) = 13; + void getCastMirroringService(IGmsCallbacks callback, int code, String str, in Bundle params) = 14; + void getNetworkQualityService(IGmsCallbacks callback, int code, String str, in Bundle params) = 15; + void getGoogleIdentityService(IGmsCallbacks callback, int code, String str, in Bundle params) = 16; + void getGoogleFeedbackService(IGmsCallbacks callback, int code, String str, in Bundle params) = 17; + void getCastService(IGmsCallbacks callback, int code, String str, IBinder binder, in Bundle params) = 18; + void getDriveService(IGmsCallbacks callback, int code, String str1, in String[] args, String str2, in Bundle params) = 19; + void getLightweightAppDataSearchService(IGmsCallbacks callback, int code, String str) = 20; + void getSearchAdministrationService(IGmsCallbacks callback, int code, String str) = 21; + void getAutoBackupService(IGmsCallbacks callback, int code, String str, in Bundle params) = 22; + void getAddressService(IGmsCallbacks callback, int code, String str) = 23; + + void getService(IGmsCallbacks callback, in GetServiceRequest request) = 45; + void validateAccount(IGmsCallbacks callback, in ValidateAccountRequest request) = 46; } diff --git a/play-services-api/src/main/aidl/com/google/android/gms/common/internal/ValidateAccountRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/common/internal/ValidateAccountRequest.aidl new file mode 100644 index 00000000..cef6ad7e --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/common/internal/ValidateAccountRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.common.internal; + +parcelable ValidateAccountRequest; diff --git a/play-services-api/src/main/java/com/google/android/gms/common/internal/GetServiceRequest.java b/play-services-api/src/main/java/com/google/android/gms/common/internal/GetServiceRequest.java new file mode 100644 index 00000000..ecaa97ff --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/common/internal/GetServiceRequest.java @@ -0,0 +1,63 @@ +/* + * Copyright 2013-2015 µg 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.common.internal; + +import android.accounts.Account; +import android.os.Bundle; +import android.os.IBinder; + +import com.google.android.gms.common.api.Scope; + +import org.microg.gms.common.Constants; +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class GetServiceRequest extends AutoSafeParcelable { + @SafeParceled(1) + private final int versionCode = 2; + + @SafeParceled(2) + public final int serviceId; + + @SafeParceled(3) + public int gmsVersion = Constants.MAX_REFERENCE_VERSION; + + @SafeParceled(4) + public String packageName; + + @SafeParceled(5) + public IBinder accountAccessor; + + @SafeParceled(6) + public Scope[] scopes; + + @SafeParceled(7) + public Bundle extras; + + @SafeParceled(8) + public Account account; + + private GetServiceRequest() { + serviceId = -1; + } + + public GetServiceRequest(int serviceId) { + this.serviceId = serviceId; + } + + public static Creator CREATOR = new AutoCreator<>(GetServiceRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/common/internal/ValidateAccountRequest.java b/play-services-api/src/main/java/com/google/android/gms/common/internal/ValidateAccountRequest.java new file mode 100644 index 00000000..0c93abba --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/common/internal/ValidateAccountRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 µg 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.common.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class ValidateAccountRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator<>(ValidateAccountRequest.class); +} From a0e9645c796dfd8af38f8cdedf21f5a299c9c5b0 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Tue, 7 Apr 2015 23:56:09 +0200 Subject: [PATCH 069/293] Add info about services --- .../java/org/microg/gms/common/Constants.java | 2 - .../java/org/microg/gms/common/Services.java | 310 ++++++++++++++++++ 2 files changed, 310 insertions(+), 2 deletions(-) create mode 100644 play-services-api/src/main/java/org/microg/gms/common/Services.java diff --git a/play-services-api/src/main/java/org/microg/gms/common/Constants.java b/play-services-api/src/main/java/org/microg/gms/common/Constants.java index bc1642ba..097d36ef 100644 --- a/play-services-api/src/main/java/org/microg/gms/common/Constants.java +++ b/play-services-api/src/main/java/org/microg/gms/common/Constants.java @@ -6,8 +6,6 @@ public class Constants { * Does not necessarily mean anything. */ public static final int MAX_REFERENCE_VERSION = 6599436; - public static final String ACTION_GMS_LOCATION_MANAGER_SERVICE_START = "com.google.android.location.internal.GoogleLocationManagerService.START"; - public static final String ACTION_GMS_PEOPLE_SERVICE_START = "com.google.android.gms.people.service.START"; public static final String KEY_MOCK_LOCATION = "mockLocation"; public static final String DEFAULT_ACCOUNT = "<>"; public static final String GMS_PACKAGE_NAME = "com.google.android.gms"; diff --git a/play-services-api/src/main/java/org/microg/gms/common/Services.java b/play-services-api/src/main/java/org/microg/gms/common/Services.java new file mode 100644 index 00000000..9d717e7d --- /dev/null +++ b/play-services-api/src/main/java/org/microg/gms/common/Services.java @@ -0,0 +1,310 @@ +/* + * Copyright 2013-2015 µg 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 org.microg.gms.common; + +public final class Services { + public static final class GAMES { + public static final int SERVICE_ID = 1; + public static final String ACTION = "com.google.android.gms.games.service.START"; + } + + public static final class PLUS { + public static final int SERVICE_ID = 2; + public static final String ACTION = "com.google.android.gms.plus.service.START"; + public static final String ACTION_INTERNAL = "com.google.android.gms.plus.service.internal.START"; + } + + public static final class PANORAMA { + public static final int SERVICE_ID = 3; + public static final String ACTION = "com.google.android.gms.panorama.service.START"; + } + + public static final class WALLET { + public static final int SERVICE_ID = 4; + public static final String ACTION = "com.google.android.gms.wallet.service.BIND"; + } + + public static final class PEOPLE { + public static final int SERVICE_ID = 5; + public static final String ACTION = "com.google.android.gms.people.service.START"; + } + + @Deprecated + public static final class LOCATION { + public static final int SERVICE_ID = 5; + } + + public static final class APPSTATE { + public static final int SERVICE_ID = 7; + public static final String ACTION = "com.google.android.gms.appstate.service.START"; + } + + public static final class ADREQUEST { + public static final int SERVICE_ID = 8; + public static final String ACTION = "com.google.android.gms.ads.service.START"; + } + + public static final class ACCOUNT { + public static final int SERVICE_ID = 9; + public static final String ACTION = "com.google.android.gms.accounts.ACCOUNT_SERVICE"; + } + + public static final class CAST { + public static final int SERVICE_ID = 10; + public static final String ACTION = "com.google.android.gms.cast.service.BIND_CAST_DEVICE_CONTROLLER_SERVICE"; + } + + public static final class DRIVE { + public static final int SERVICE_ID = 11; + public static final String ACTION = "com.google.android.gms.drive.ApiService.START"; + } + + public static final class ADDRESS { + public static final int SERVICE_ID = 12; + public static final String ACTION = "com.google.android.gms.identity.service.BIND"; + } + + public static final class CAR { + public static final int SERVICE_ID = 13; + public static final String ACTION = "com.google.android.gms.car.service.START"; + } + + public static final class WEARABLE { + public static final int SERVICE_ID = 14; + public static final String ACTION = "com.google.android.gms.wearable.BIND"; + } + + public static final class AUTH { + public static final int SERVICE_ID = 16; + public static final String ACTION = "com.google.android.gms.auth.service.START"; + } + + public static final class FITNESS { + public static final int SERVICE_ID = 17; + public static final String ACTION = "com.google.android.gms.fitness.GoogleFitnessService.START"; + } + + public static final class REMINDERS { + public static final int SERVICE_ID = 18; + public static final String ACTION = "com.google.android.gms.reminders.service.START"; + } + + public static final class LIGHTWEIGHT_INDEX { + public static final int SERVICE_ID = 19; + public static final String ACTION = "com.google.android.gms.icing.LIGHTWEIGHT_INDEX_SERVICE"; + } + + public static final class DEVICE_CONNECTION { + public static final int SERVICE_ID = 20; + public static final String ACTION = "com.google.android.gms.deviceconnection.service.START"; + } + + public static final class INDEX { + public static final int SERVICE_ID = 21; + public static final String ACTION = "com.google.android.gms.icing.INDEX_SERVICE"; + } + + public static final class LOCATION_REPORTING { + public static final int SERVICE_ID = 22; + public static final String ACTION = "com.google.android.gms.location.reporting.service.START"; + } + + public static final class LOCATION_MANAGER { + public static final int SERVICE_ID = 23; + public static final String ACTION = "com.google.android.location.internal.GoogleLocationManagerService.START"; + } + + public static final class DROIDGUARD { + public static final int SERVICE_ID = 25; + public static final String ACTION = "com.google.android.gms.droidguard.service.START"; + } + + public static final class LOCKBOX { + public static final int SERVICE_ID = 26; + public static final String ACTION = "com.google.android.gms.lockbox.service.START"; + } + + public static final class CAST_MIRRORING { + public static final int SERVICE_ID = 27; + public static final String ACTION = "com.google.android.gms.cast_mirroring.service.START"; + } + + @Deprecated + public static final class NETWORK_QUALITY { + public static final int SERVICE_ID = 28; + public static final String ACTION = "com.google.android.gms.mdm.services.START"; + } + + public static final class FEEDBACK { + public static final int SERVICE_ID = 29; + public static final String ACTION = "com.google.android.gms.feedback.internal.IFeedbackService"; + } + + public static final class PHOTO_AUTO_BACKUP { + public static final int SERVICE_ID = 31; + public static final String ACTION = "com.google.android.gms.photos.autobackup.service.START"; + } + + public static final class UDC { + public static final int SERVICE_ID = 35; + public static final String ACTION = "com.google.android.gms.udc.service.START"; + } + + public static final class DEVICE_MANAGER { + public static final int SERVICE_ID = 37; + public static final String ACTION = "com.google.android.gms.mdm.services.DeviceManagerApiService.START"; + } + + public static final class PSEUDONYMOUS_ID { + public static final int SERVICE_ID = 38; + public static final String ACTION = "com.google.android.gms.pseudonymous.service.START"; + } + + public static final class COMMON { + public static final int SERVICE_ID = 39; + public static final String ACTION = "com.google.android.gms.common.service.START"; + } + + public static final class CLEARCUT_LOGGER { + public static final int SERVICE_ID = 40; + public static final String ACTION = "com.google.android.gms.clearcut.service.START"; + } + + public static final class USAGE_REPORTING { + public static final int SERVICE_ID = 41; + public static final String ACTION = "com.google.android.gms.usagereporting.service.START"; + } + + public static final class KIDS { + public static final int SERVICE_ID = 42; + public static final String ACTION = "com.google.android.gms.kids.service.START"; + } + + public static final class DOWNLOAD { + public static final int SERVICE_ID = 43; + public static final String ACTION = "com.google.android.gms.common.download.START"; + } + + public static final class SIGN_IN { + public static final int SERVICE_ID = 44; + public static final String ACTION = "com.google.android.gms.signin.service.START"; + } + + public static final class SAFETY_NET_CLIENT { + public static final int SERVICE_ID = 45; + public static final String ACTION = "com.google.android.gms.safetynet.service.START"; + } + + public static final class GSERVICES { + public static final int SERVICE_ID = 46; + public static final String ACTION = "com.google.android.gms.ads.gservice.START"; + } + + public static final class CONTEXT_MANAGER { + public static final int SERVICE_ID = 47; + public static final String ACTION = "com.google.android.contextmanager.service.ContextManagerService.START"; + } + + public static final class AUDIO_MODEM { + public static final int SERVICE_ID = 48; + public static final String ACTION = "com.google.android.gms.audiomodem.service.AudioModemService.START"; + } + + public static final class NEARBY_SHARING { + public static final int SERVICE_ID = 49; + public static final String ACTION = "com.google.android.gms.nearby.sharing.service.NearbySharingService.START"; + } + + public static final class LIGHTWEIGHT_NETWORK_QUALITY { + public static final int SERVICE_ID = 51; + public static final String ACTION = "com.google.android.gms.herrevad.services.LightweightNetworkQualityAndroidService.START"; + } + + public static final class PHENOTYPE { + public static final int SERVICE_ID = 51; + public static final String ACTION = "com.google.android.gms.phenotype.service.START"; + } + + public static final class VOICE_UNLOCK { + public static final int SERVICE_ID = 52; + public static final String ACTION = "com.google.android.gms.speech.service.START"; + } + + public static final class NEARBY_CONNECTIONS { + public static final int SERVICE_ID = 54; + public static final String ACTION = "com.google.android.gms.nearby.connection.service.START"; + } + + public static final class FITNESS_SENSORS { + public static final int SERVICE_ID = 55; + public static final String ACTION = "com.google.android.gms.fitness.SensorsApi"; + } + + public static final class FITNESS_RECORDING { + public static final int SERVICE_ID = 56; + public static final String ACTION = "com.google.android.gms.fitness.RecordingApi"; + } + + public static final class FITNESS_HISTORY { + public static final int SERVICE_ID = 57; + public static final String ACTION = "com.google.android.gms.fitness.HistoryApi"; + } + + public static final class FITNESS_SESSIONS { + public static final int SERVICE_ID = 58; + public static final String ACTION = "com.google.android.gms.fitness.SessionsApi"; + } + + /** + * BLE = Bluetooth Low Energy + */ + public static final class FITNESS_BLE { + public static final int SERVICE_ID = 59; + public static final String ACTION = "com.google.android.gms.fitness.BleApi"; + } + + public static final class FITNESS_CONFIG { + public static final int SERVICE_ID = 60; + public static final String ACTION = "com.google.android.gms.fitness.ConfigApi"; + } + + public static final class FITNESS_INTERNAL { + public static final int SERVICE_ID = 61; + public static final String ACTION = "com.google.android.gms.fitness.InternalApi"; + } + + public static final class NEARBY_MESSAGES { + public static final int SERVICE_ID = 62; + public static final String ACTION = "com.google.android.gms.nearby.messages.service.NearbyMessagesService.START"; + } + + public static final class HELP { + public static final int SERVICE_ID = 63; + public static final String ACTION = "com.google.android.gms.googlehelp.service.GoogleHelpService.START"; + } + + public static final class CONFIG { + public static final int SERVICE_ID = 64; + public static final String ACTION = "com.google.android.gms.config.START"; + } + + public static final class CREDENTIALS { + public static final int SERVICE_ID = 68; + public static final String ACTION = "com.google.android.gms.auth.api.credentials.service.START"; + } + +} From a181a0f3b98c682d9d1e0b522c5ada9e749433f3 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Wed, 8 Apr 2015 02:48:25 +0200 Subject: [PATCH 070/293] Add some Logging APIs, fix services list --- .../common/internal/IGmsServiceBroker.aidl | 12 +-- .../gms/playlog/internal/IPlayLogService.aidl | 4 + .../gms/playlog/internal/LogEvent.aidl | 3 + .../playlog/internal/PlayLoggerContext.aidl | 3 + .../common/internal/GetServiceRequest.java | 23 +++++- .../gms/maps/model/TileOverlayOptions.java | 3 +- .../gms/playlog/internal/LogEvent.java | 55 ++++++++++++++ .../playlog/internal/PlayLoggerContext.java | 75 +++++++++++++++++++ .../java/org/microg/gms/common/Constants.java | 2 +- .../java/org/microg/gms/common/Services.java | 48 +++++++++++- 10 files changed, 216 insertions(+), 12 deletions(-) create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/playlog/internal/LogEvent.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/playlog/internal/PlayLoggerContext.aidl create mode 100644 play-services-api/src/main/java/com/google/android/gms/playlog/internal/LogEvent.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/playlog/internal/PlayLoggerContext.java diff --git a/play-services-api/src/main/aidl/com/google/android/gms/common/internal/IGmsServiceBroker.aidl b/play-services-api/src/main/aidl/com/google/android/gms/common/internal/IGmsServiceBroker.aidl index 2074e4aa..9649150d 100644 --- a/play-services-api/src/main/aidl/com/google/android/gms/common/internal/IGmsServiceBroker.aidl +++ b/play-services-api/src/main/aidl/com/google/android/gms/common/internal/IGmsServiceBroker.aidl @@ -7,16 +7,16 @@ import com.google.android.gms.common.internal.GetServiceRequest; import com.google.android.gms.common.internal.ValidateAccountRequest; interface IGmsServiceBroker { - void getPlusService(IGmsCallbacks callback, int code, String str1, String str2, in String[] paramArrayOfString, String str3, in Bundle params) = 0; - void getPanoramaService(IGmsCallbacks callback, int code, String str, in Bundle params) = 1; - void getAppDataSearchService(IGmsCallbacks callback, int code, String str) = 2; + void getPlusService(IGmsCallbacks callback, int code, String packageName, String authPackage, in String[] scopes, String accountName, in Bundle params) = 0; + void getPanoramaService(IGmsCallbacks callback, int code, String packageName, in Bundle params) = 1; + void getAppDataSearchService(IGmsCallbacks callback, int code, String packageName) = 2; void getWalletService(IGmsCallbacks callback, int code) = 3; void getPeopleService(IGmsCallbacks callback, int code, String str, in Bundle params) = 4; void getReportingService(IGmsCallbacks callback, int code, String str, in Bundle params) = 5; void getLocationService(IGmsCallbacks callback, int code, String str, in Bundle params) = 6; void getGoogleLocationManagerService(IGmsCallbacks callback, int code, String str, in Bundle params) = 7; - void getGamesService(IGmsCallbacks callback, int code, String str1, String str2, in String[] args, String str3, IBinder binder, String str4, in Bundle params) = 8; - void getAppStateService(IGmsCallbacks callback, int code, String str1, String str2, in String[] args) = 9; + void getGamesService(IGmsCallbacks callback, int code, String packageName, String accountName, in String[] scopes, String gamePackageName, IBinder popupWindowToken, String desiredLocale, in Bundle params) = 8; + void getAppStateService(IGmsCallbacks callback, int code, String packageName, String accountName, in String[] scopes) = 9; void getPlayLogService(IGmsCallbacks callback, int code, String str, in Bundle params) = 10; void getAdMobService(IGmsCallbacks callback, int code, String str, in Bundle params) = 11; void getDroidGuardService(IGmsCallbacks callback, int code, String str, in Bundle params) = 12; @@ -32,6 +32,8 @@ interface IGmsServiceBroker { void getAutoBackupService(IGmsCallbacks callback, int code, String str, in Bundle params) = 22; void getAddressService(IGmsCallbacks callback, int code, String str) = 23; + void getWalletServiceWithPackageName(IGmsCallbacks callback, int code, String packageName) = 41; + void getService(IGmsCallbacks callback, in GetServiceRequest request) = 45; void validateAccount(IGmsCallbacks callback, in ValidateAccountRequest request) = 46; } diff --git a/play-services-api/src/main/aidl/com/google/android/gms/playlog/internal/IPlayLogService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/playlog/internal/IPlayLogService.aidl index 38e620ea..521df957 100644 --- a/play-services-api/src/main/aidl/com/google/android/gms/playlog/internal/IPlayLogService.aidl +++ b/play-services-api/src/main/aidl/com/google/android/gms/playlog/internal/IPlayLogService.aidl @@ -1,4 +1,8 @@ package com.google.android.gms.playlog.internal; +import com.google.android.gms.playlog.internal.LogEvent; +import com.google.android.gms.playlog.internal.PlayLoggerContext; + interface IPlayLogService { + void event(String packageName, in PlayLoggerContext context, in LogEvent event) = 1; } diff --git a/play-services-api/src/main/aidl/com/google/android/gms/playlog/internal/LogEvent.aidl b/play-services-api/src/main/aidl/com/google/android/gms/playlog/internal/LogEvent.aidl new file mode 100644 index 00000000..6e7bed53 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/playlog/internal/LogEvent.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.playlog.internal; + +parcelable LogEvent; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/playlog/internal/PlayLoggerContext.aidl b/play-services-api/src/main/aidl/com/google/android/gms/playlog/internal/PlayLoggerContext.aidl new file mode 100644 index 00000000..9cc0e0e4 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/playlog/internal/PlayLoggerContext.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.playlog.internal; + +parcelable PlayLoggerContext; diff --git a/play-services-api/src/main/java/com/google/android/gms/common/internal/GetServiceRequest.java b/play-services-api/src/main/java/com/google/android/gms/common/internal/GetServiceRequest.java index ecaa97ff..29660700 100644 --- a/play-services-api/src/main/java/com/google/android/gms/common/internal/GetServiceRequest.java +++ b/play-services-api/src/main/java/com/google/android/gms/common/internal/GetServiceRequest.java @@ -23,18 +23,21 @@ import android.os.IBinder; import com.google.android.gms.common.api.Scope; import org.microg.gms.common.Constants; +import org.microg.gms.common.Services; import org.microg.safeparcel.AutoSafeParcelable; import org.microg.safeparcel.SafeParceled; +import java.util.Arrays; + public class GetServiceRequest extends AutoSafeParcelable { @SafeParceled(1) - private final int versionCode = 2; + private final int versionCode; @SafeParceled(2) public final int serviceId; @SafeParceled(3) - public int gmsVersion = Constants.MAX_REFERENCE_VERSION; + public int gmsVersion; @SafeParceled(4) public String packageName; @@ -52,11 +55,27 @@ public class GetServiceRequest extends AutoSafeParcelable { public Account account; private GetServiceRequest() { + versionCode = 2; serviceId = -1; + gmsVersion = Constants.MAX_REFERENCE_VERSION; } public GetServiceRequest(int serviceId) { + this.versionCode = 2; this.serviceId = serviceId; + this.gmsVersion = Constants.MAX_REFERENCE_VERSION; + } + + @Override + public String toString() { + return "GetServiceRequest{" + + "serviceId=" + Services.nameFromServiceId(serviceId) + + ", gmsVersion=" + gmsVersion + + ", packageName='" + packageName + '\'' + + (scopes == null || scopes.length == 0 ? "" : (", scopes=" + Arrays.toString(scopes))) + + (extras == null ? "" : (", extras=" + extras)) + + (account == null ? "" : (", account=" + account)) + + '}'; } public static Creator CREATOR = new AutoCreator<>(GetServiceRequest.class); diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/model/TileOverlayOptions.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/TileOverlayOptions.java index 85ab38f0..7f2df331 100644 --- a/play-services-api/src/main/java/com/google/android/gms/maps/model/TileOverlayOptions.java +++ b/play-services-api/src/main/java/com/google/android/gms/maps/model/TileOverlayOptions.java @@ -31,7 +31,7 @@ import org.microg.safeparcel.SafeParceled; public class TileOverlayOptions extends AutoSafeParcelable { @SafeParceled(1) - private final int versionCode = 1; + private final int versionCode; /** * This is a IBinder to the {@link #tileProvider}, built using {@link ITileProviderDelegate}. */ @@ -49,6 +49,7 @@ public class TileOverlayOptions extends AutoSafeParcelable { * Creates a new set of tile overlay options. */ public TileOverlayOptions() { + versionCode = 1; } /** diff --git a/play-services-api/src/main/java/com/google/android/gms/playlog/internal/LogEvent.java b/play-services-api/src/main/java/com/google/android/gms/playlog/internal/LogEvent.java new file mode 100644 index 00000000..3f2469f9 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/playlog/internal/LogEvent.java @@ -0,0 +1,55 @@ +/* + * Copyright 2013-2015 µg 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.playlog.internal; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +import java.util.Date; + +public class LogEvent extends AutoSafeParcelable { + + @SafeParceled(1) + public final int versionCode; + + @SafeParceled(2) + public final long eventTime; + + @SafeParceled(3) + public final String tag; + + @SafeParceled(4) + public final byte[] data; + + private LogEvent() { + versionCode = 1; + eventTime = -1; + tag = null; + data = null; + } + + @Override + public String toString() { + return "LogEvent{" + + "eventTime=" + new Date(eventTime) + + ", tag='" + tag + '\'' + + ", data='" + new String(data) + '\'' + + '}'; + } + + public static Creator CREATOR = new AutoCreator<>(LogEvent.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/playlog/internal/PlayLoggerContext.java b/play-services-api/src/main/java/com/google/android/gms/playlog/internal/PlayLoggerContext.java new file mode 100644 index 00000000..3dcd4f92 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/playlog/internal/PlayLoggerContext.java @@ -0,0 +1,75 @@ +/* + * Copyright 2013-2015 µg 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.playlog.internal; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class PlayLoggerContext extends AutoSafeParcelable { + + @SafeParceled(1) + public final int versionCode; + + @SafeParceled(2) + public final String packageName; + + @SafeParceled(4) + public final int logSource; + + @SafeParceled(5) + public final String uploadAccount; + + @SafeParceled(6) + public final int loggingId; + + @SafeParceled(7) + public final boolean logAndroidId; + + @SafeParceled(8) + public final String logSourceName; + + private PlayLoggerContext() { + this.versionCode = 1; + packageName = uploadAccount = logSourceName = null; + logSource = loggingId = -1; + logAndroidId = false; + } + + public PlayLoggerContext(String packageName, int logSource, String uploadAccount, int loggingId, String logSourceName) { + this.versionCode = 1; + this.packageName = packageName; + this.logSource = logSource; + this.uploadAccount = uploadAccount; + this.loggingId = loggingId; + this.logSourceName = logSourceName; + this.logAndroidId = true; + } + + @Override + public String toString() { + return "PlayLoggerContext{" + + "packageName='" + packageName + '\'' + + ", logSource=" + logSource + + ", uploadAccount='" + uploadAccount + '\'' + + ", loggingId=" + loggingId + + ", logAndroidId=" + logAndroidId + + ", logSourceName='" + logSourceName + '\'' + + '}'; + } + + public static Creator CREATOR = new AutoCreator<>(PlayLoggerContext.class); +} diff --git a/play-services-api/src/main/java/org/microg/gms/common/Constants.java b/play-services-api/src/main/java/org/microg/gms/common/Constants.java index 097d36ef..7e53ce71 100644 --- a/play-services-api/src/main/java/org/microg/gms/common/Constants.java +++ b/play-services-api/src/main/java/org/microg/gms/common/Constants.java @@ -5,7 +5,7 @@ public class Constants { * This is the highest version that was looked at during development. * Does not necessarily mean anything. */ - public static final int MAX_REFERENCE_VERSION = 6599436; + public static final int MAX_REFERENCE_VERSION = 7099448; public static final String KEY_MOCK_LOCATION = "mockLocation"; public static final String DEFAULT_ACCOUNT = "<>"; public static final String GMS_PACKAGE_NAME = "com.google.android.gms"; diff --git a/play-services-api/src/main/java/org/microg/gms/common/Services.java b/play-services-api/src/main/java/org/microg/gms/common/Services.java index 9d717e7d..f4a73ea6 100644 --- a/play-services-api/src/main/java/org/microg/gms/common/Services.java +++ b/play-services-api/src/main/java/org/microg/gms/common/Services.java @@ -16,6 +16,8 @@ package org.microg.gms.common; +import java.lang.reflect.Field; + public final class Services { public static final class GAMES { public static final int SERVICE_ID = 1; @@ -43,9 +45,8 @@ public final class Services { public static final String ACTION = "com.google.android.gms.people.service.START"; } - @Deprecated public static final class LOCATION { - public static final int SERVICE_ID = 5; + public static final int SERVICE_ID = 6; } public static final class APPSTATE { @@ -128,6 +129,10 @@ public final class Services { public static final String ACTION = "com.google.android.location.internal.GoogleLocationManagerService.START"; } + public static final class PLAY_LOG { + public static final int SERVICE_ID = 24; + } + public static final class DROIDGUARD { public static final int SERVICE_ID = 25; public static final String ACTION = "com.google.android.gms.droidguard.service.START"; @@ -143,7 +148,6 @@ public final class Services { public static final String ACTION = "com.google.android.gms.cast_mirroring.service.START"; } - @Deprecated public static final class NETWORK_QUALITY { public static final int SERVICE_ID = 28; public static final String ACTION = "com.google.android.gms.mdm.services.START"; @@ -154,16 +158,32 @@ public final class Services { public static final String ACTION = "com.google.android.gms.feedback.internal.IFeedbackService"; } + public static final class SEARCH_ADMINISTRATION { + public static final int SERVICE_ID = 30; + } + public static final class PHOTO_AUTO_BACKUP { public static final int SERVICE_ID = 31; public static final String ACTION = "com.google.android.gms.photos.autobackup.service.START"; } + public static final class SEARCH_QUERIES { + public static final int SERVICE_ID = 32; + } + + public static final class SEARCH_GLOBAL { + public static final int SERVICE_ID = 33; + } + public static final class UDC { public static final int SERVICE_ID = 35; public static final String ACTION = "com.google.android.gms.udc.service.START"; } + public static final class SEARCH_CORPORA { + public static final int SERVICE_ID = 36; + } + public static final class DEVICE_MANAGER { public static final int SERVICE_ID = 37; public static final String ACTION = "com.google.android.gms.mdm.services.DeviceManagerApiService.START"; @@ -302,9 +322,31 @@ public final class Services { public static final String ACTION = "com.google.android.gms.config.START"; } + public static final class GEODATA { + public static final int SERVICE_ID = 65; + } + + public static final class SEARCH_IME { + public static final int SERVICE_ID = 66; + } + + public static final class PLACE_DETECTION { + public static final int SERVICE_ID = 67; + } + public static final class CREDENTIALS { public static final int SERVICE_ID = 68; public static final String ACTION = "com.google.android.gms.auth.api.credentials.service.START"; } + public static String nameFromServiceId(int serviceId) { + for (Class cls : Services.class.getDeclaredClasses()) { + try { + Field serviceIdField = cls.getDeclaredField("SERVICE_ID"); + if ((Integer) serviceIdField.get(null) == serviceId) return cls.getSimpleName(); + } catch (Exception e) { + } + } + return "UNKNOWN(" + serviceId + ")"; + } } From 0f8febb7056490d38f2e8e900cc863cbba038386 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Wed, 8 Apr 2015 23:10:50 +0200 Subject: [PATCH 071/293] Update sublib --- extern/GmsApi | 2 +- .../org/microg/gms/location/GoogleLocationManagerClient.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/extern/GmsApi b/extern/GmsApi index 70419935..a0e9645c 160000 --- a/extern/GmsApi +++ b/extern/GmsApi @@ -1 +1 @@ -Subproject commit 704199355e1c6f8b14402e01063fbae7b187b35b +Subproject commit a0e9645c796dfd8af38f8cdedf21f5a299c9c5b0 diff --git a/play-services-location/src/main/java/org/microg/gms/location/GoogleLocationManagerClient.java b/play-services-location/src/main/java/org/microg/gms/location/GoogleLocationManagerClient.java index 8da05e69..68f8d4c9 100644 --- a/play-services-location/src/main/java/org/microg/gms/location/GoogleLocationManagerClient.java +++ b/play-services-location/src/main/java/org/microg/gms/location/GoogleLocationManagerClient.java @@ -27,6 +27,7 @@ import com.google.android.gms.location.internal.IGoogleLocationManagerService; import org.microg.gms.common.Constants; import org.microg.gms.common.GmsClient; +import org.microg.gms.common.Services; public abstract class GoogleLocationManagerClient extends GmsClient { public GoogleLocationManagerClient(Context context, GoogleApiClient.ConnectionCallbacks @@ -36,7 +37,7 @@ public abstract class GoogleLocationManagerClient extends GmsClient Date: Fri, 10 Apr 2015 20:57:58 +0200 Subject: [PATCH 072/293] Update API --- .../google/android/gms/checkin/internal/ICheckinService.aidl | 5 +++++ .../com/google/android/gms/playlog/internal/LogEvent.java | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/checkin/internal/ICheckinService.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/checkin/internal/ICheckinService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/checkin/internal/ICheckinService.aidl new file mode 100644 index 00000000..6ac61289 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/checkin/internal/ICheckinService.aidl @@ -0,0 +1,5 @@ +package com.google.android.gms.checkin.internal; + +interface ICheckinService { + String getDeviceDataVersionInfo(); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/playlog/internal/LogEvent.java b/play-services-api/src/main/java/com/google/android/gms/playlog/internal/LogEvent.java index 3f2469f9..94f066b9 100644 --- a/play-services-api/src/main/java/com/google/android/gms/playlog/internal/LogEvent.java +++ b/play-services-api/src/main/java/com/google/android/gms/playlog/internal/LogEvent.java @@ -47,7 +47,7 @@ public class LogEvent extends AutoSafeParcelable { return "LogEvent{" + "eventTime=" + new Date(eventTime) + ", tag='" + tag + '\'' + - ", data='" + new String(data) + '\'' + + ", data=" + (data == null ? "null" : ('\'' + new String(data) + '\'')) + '}'; } From 8928053170b6a819befa297f264e5ba7e2f9342b Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Sat, 11 Apr 2015 13:46:48 +0200 Subject: [PATCH 073/293] Update safe-parcel, add new features to icing --- extern/SafeParcel | 2 +- .../android/gms/appdatasearch/PIMEUpdate.aidl | 3 ++ .../gms/appdatasearch/PIMEUpdateResponse.aidl | 3 ++ .../RequestIndexingSpecification.aidl | 3 ++ .../internal/IAppDataSearch.aidl | 4 ++ .../ISearchAdministrationService.aidl | 5 +++ .../internal/ISearchCorporaService.aidl | 5 +++ .../android/gms/appdatasearch/PIMEUpdate.java | 24 +++++++++++ .../gms/appdatasearch/PIMEUpdateResponse.java | 41 +++++++++++++++++++ .../RequestIndexingSpecification.java | 28 +++++++++++++ .../java/org/microg/gms/common/Services.java | 1 + 11 files changed, 118 insertions(+), 1 deletion(-) create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/PIMEUpdate.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/PIMEUpdateResponse.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/RequestIndexingSpecification.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/search/administration/internal/ISearchAdministrationService.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/search/corpora/internal/ISearchCorporaService.aidl create mode 100644 play-services-api/src/main/java/com/google/android/gms/appdatasearch/PIMEUpdate.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/appdatasearch/PIMEUpdateResponse.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/appdatasearch/RequestIndexingSpecification.java diff --git a/extern/SafeParcel b/extern/SafeParcel index b3837016..26d9c429 160000 --- a/extern/SafeParcel +++ b/extern/SafeParcel @@ -1 +1 @@ -Subproject commit b383701659ca342ee08ff2b2f15b5611daaac2f4 +Subproject commit 26d9c429770c37ad3e087d4469c4d4b3042e4f25 diff --git a/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/PIMEUpdate.aidl b/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/PIMEUpdate.aidl new file mode 100644 index 00000000..c7f5e432 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/PIMEUpdate.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.appdatasearch; + +parcelable PIMEUpdate; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/PIMEUpdateResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/PIMEUpdateResponse.aidl new file mode 100644 index 00000000..0ae6e4bc --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/PIMEUpdateResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.appdatasearch; + +parcelable PIMEUpdateResponse; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/RequestIndexingSpecification.aidl b/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/RequestIndexingSpecification.aidl new file mode 100644 index 00000000..a0a785c1 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/RequestIndexingSpecification.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.appdatasearch; + +parcelable RequestIndexingSpecification; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/internal/IAppDataSearch.aidl b/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/internal/IAppDataSearch.aidl index 37a6a905..ebc204c7 100644 --- a/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/internal/IAppDataSearch.aidl +++ b/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/internal/IAppDataSearch.aidl @@ -1,10 +1,14 @@ package com.google.android.gms.appdatasearch.internal; import com.google.android.gms.appdatasearch.CorpusStatus; +import com.google.android.gms.appdatasearch.PIMEUpdateResponse; +import com.google.android.gms.appdatasearch.RequestIndexingSpecification; import com.google.android.gms.appdatasearch.SuggestionResults; import com.google.android.gms.appdatasearch.SuggestSpecification; interface IAppDataSearch { SuggestionResults getSuggestions(String var1, String packageName, in String[] accounts, int maxNum, in SuggestSpecification specs) = 1; + boolean requestIndexing(String packageName, String accountName, long l, in RequestIndexingSpecification specs) = 3; CorpusStatus getStatus(String packageName, String accountName) = 4; + PIMEUpdateResponse requestPIMEUpdate(String s1, String s2, int i, in byte[] bs) = 34; } diff --git a/play-services-api/src/main/aidl/com/google/android/gms/search/administration/internal/ISearchAdministrationService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/search/administration/internal/ISearchAdministrationService.aidl new file mode 100644 index 00000000..404544c2 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/search/administration/internal/ISearchAdministrationService.aidl @@ -0,0 +1,5 @@ +package com.google.android.gms.search.administration.internal; + +interface ISearchAdministrationService { + +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/internal/ISearchCorporaService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/internal/ISearchCorporaService.aidl new file mode 100644 index 00000000..8c54aa09 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/internal/ISearchCorporaService.aidl @@ -0,0 +1,5 @@ +package com.google.android.gms.search.corpora.internal; + +interface ISearchCorporaService { + +} diff --git a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/PIMEUpdate.java b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/PIMEUpdate.java new file mode 100644 index 00000000..c78564ba --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/PIMEUpdate.java @@ -0,0 +1,24 @@ +/* + * Copyright 2013-2015 µg 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.appdatasearch; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class PIMEUpdate extends AutoSafeParcelable { + + public static final Creator CREATOR = new AutoCreator<>(PIMEUpdate.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/PIMEUpdateResponse.java b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/PIMEUpdateResponse.java new file mode 100644 index 00000000..82fc2507 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/PIMEUpdateResponse.java @@ -0,0 +1,41 @@ +/* + * Copyright 2013-2015 µg 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.appdatasearch; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class PIMEUpdateResponse extends AutoSafeParcelable { + @SafeParceled(1000) + private int versionCode = 1; + + @SafeParceled(1) + private String b; + + @SafeParceled(2) + public final byte[] bytes; + + @SafeParceled(3) + public final PIMEUpdate[] updates; + + public PIMEUpdateResponse() { + this.bytes = null; + this.updates = new PIMEUpdate[0]; + } + + public static final Creator CREATOR = new AutoCreator<>(PIMEUpdateResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/RequestIndexingSpecification.java b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/RequestIndexingSpecification.java new file mode 100644 index 00000000..05bf1b83 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/RequestIndexingSpecification.java @@ -0,0 +1,28 @@ +/* + * Copyright 2013-2015 µg 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.appdatasearch; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class RequestIndexingSpecification extends AutoSafeParcelable { + + @SafeParceled(1000) + private int versionCode; + + public static final Creator CREATOR = new AutoCreator<>(RequestIndexingSpecification.class); +} diff --git a/play-services-api/src/main/java/org/microg/gms/common/Services.java b/play-services-api/src/main/java/org/microg/gms/common/Services.java index f4a73ea6..01a24ecf 100644 --- a/play-services-api/src/main/java/org/microg/gms/common/Services.java +++ b/play-services-api/src/main/java/org/microg/gms/common/Services.java @@ -131,6 +131,7 @@ public final class Services { public static final class PLAY_LOG { public static final int SERVICE_ID = 24; + public static final String ACTION = "com.google.android.gms.playlog.service.START"; } public static final class DROIDGUARD { From deb757edfb0684f41ccc493b7c35a98878571a56 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Mon, 13 Apr 2015 23:52:26 +0200 Subject: [PATCH 074/293] Java 6 compat --- extern/SafeParcel | 2 +- play-services-api/build.gradle | 3 +++ .../com/google/android/gms/appdatasearch/CorpusStatus.java | 2 +- .../java/com/google/android/gms/appdatasearch/PIMEUpdate.java | 2 +- .../google/android/gms/appdatasearch/PIMEUpdateResponse.java | 2 +- .../gms/appdatasearch/RequestIndexingSpecification.java | 2 +- .../android/gms/appdatasearch/SuggestSpecification.java | 2 +- .../google/android/gms/appdatasearch/SuggestionResults.java | 2 +- .../java/com/google/android/gms/appdatasearch/UsageInfo.java | 2 +- .../java/com/google/android/gms/auth/AccountChangeEvent.java | 2 +- .../google/android/gms/auth/AccountChangeEventsRequest.java | 2 +- .../google/android/gms/auth/AccountChangeEventsResponse.java | 4 ++-- .../java/com/google/android/gms/common/api/AccountInfo.java | 2 +- .../main/java/com/google/android/gms/common/api/Scope.java | 2 +- .../main/java/com/google/android/gms/common/api/Status.java | 2 +- .../java/com/google/android/gms/common/data/DataHolder.java | 4 ++-- .../google/android/gms/common/internal/GetServiceRequest.java | 2 +- .../android/gms/common/internal/ValidateAccountRequest.java | 2 +- .../android/gms/common/server/FavaDiagnosticsEntity.java | 2 +- .../main/java/com/google/android/gms/location/Geofence.java | 2 +- .../com/google/android/gms/location/GeofencingRequest.java | 3 +-- .../java/com/google/android/gms/location/LocationRequest.java | 2 +- .../java/com/google/android/gms/location/LocationStatus.java | 2 +- .../gms/location/internal/LocationRequestInternal.java | 3 +-- .../android/gms/location/places/AutocompleteFilter.java | 3 +-- .../android/gms/location/places/NearbyAlertRequest.java | 3 +-- .../com/google/android/gms/location/places/PlaceFilter.java | 2 +- .../com/google/android/gms/location/places/PlaceReport.java | 2 +- .../com/google/android/gms/location/places/PlaceRequest.java | 2 +- .../google/android/gms/location/places/UserAddedPlace.java | 2 +- .../com/google/android/gms/location/places/UserDataType.java | 2 +- .../android/gms/location/places/internal/PlacesParams.java | 2 +- .../google/android/gms/location/reporting/ReportingState.java | 2 +- .../java/com/google/android/gms/maps/GoogleMapOptions.java | 2 +- .../com/google/android/gms/maps/model/CameraPosition.java | 2 +- .../java/com/google/android/gms/maps/model/CircleOptions.java | 2 +- .../google/android/gms/maps/model/GroundOverlayOptions.java | 4 ++-- .../main/java/com/google/android/gms/maps/model/LatLng.java | 2 +- .../java/com/google/android/gms/maps/model/LatLngBounds.java | 2 +- .../java/com/google/android/gms/maps/model/MarkerOptions.java | 2 +- .../com/google/android/gms/maps/model/PolygonOptions.java | 2 +- .../com/google/android/gms/maps/model/PolylineOptions.java | 2 +- .../src/main/java/com/google/android/gms/maps/model/Tile.java | 2 +- .../com/google/android/gms/maps/model/TileOverlayOptions.java | 2 +- .../java/com/google/android/gms/maps/model/VisibleRegion.java | 2 +- .../com/google/android/gms/people/model/AccountMetadata.java | 2 +- .../com/google/android/gms/playlog/internal/LogEvent.java | 2 +- .../android/gms/playlog/internal/PlayLoggerContext.java | 2 +- .../src/main/java/com/google/android/gms/wearable/Asset.java | 2 +- .../java/com/google/android/gms/wearable/PutDataRequest.java | 2 +- .../google/android/gms/wearable/internal/NodeParcelable.java | 2 +- 51 files changed, 56 insertions(+), 57 deletions(-) diff --git a/extern/SafeParcel b/extern/SafeParcel index 26d9c429..d7b18b06 160000 --- a/extern/SafeParcel +++ b/extern/SafeParcel @@ -1 +1 @@ -Subproject commit 26d9c429770c37ad3e087d4469c4d4b3042e4f25 +Subproject commit d7b18b06734e4109bc3131345a26aa261d369605 diff --git a/play-services-api/build.gradle b/play-services-api/build.gradle index 1013422a..909d7a67 100644 --- a/play-services-api/build.gradle +++ b/play-services-api/build.gradle @@ -20,4 +20,7 @@ dependencies { android { compileSdkVersion 22 buildToolsVersion "22.0.0" + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_6 + } } diff --git a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/CorpusStatus.java b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/CorpusStatus.java index 99a4fd6d..b90a3f59 100644 --- a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/CorpusStatus.java +++ b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/CorpusStatus.java @@ -38,5 +38,5 @@ public class CorpusStatus extends AutoSafeParcelable { @SafeParceled(6) public String g; - public static final Creator CREATOR = new AutoCreator<>(CorpusStatus.class); + public static final Creator CREATOR = new AutoCreator(CorpusStatus.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/PIMEUpdate.java b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/PIMEUpdate.java index c78564ba..d42634b5 100644 --- a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/PIMEUpdate.java +++ b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/PIMEUpdate.java @@ -20,5 +20,5 @@ import org.microg.safeparcel.AutoSafeParcelable; public class PIMEUpdate extends AutoSafeParcelable { - public static final Creator CREATOR = new AutoCreator<>(PIMEUpdate.class); + public static final Creator CREATOR = new AutoCreator(PIMEUpdate.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/PIMEUpdateResponse.java b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/PIMEUpdateResponse.java index 82fc2507..4d34120f 100644 --- a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/PIMEUpdateResponse.java +++ b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/PIMEUpdateResponse.java @@ -37,5 +37,5 @@ public class PIMEUpdateResponse extends AutoSafeParcelable { this.updates = new PIMEUpdate[0]; } - public static final Creator CREATOR = new AutoCreator<>(PIMEUpdateResponse.class); + public static final Creator CREATOR = new AutoCreator(PIMEUpdateResponse.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/RequestIndexingSpecification.java b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/RequestIndexingSpecification.java index 05bf1b83..ca32c018 100644 --- a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/RequestIndexingSpecification.java +++ b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/RequestIndexingSpecification.java @@ -24,5 +24,5 @@ public class RequestIndexingSpecification extends AutoSafeParcelable { @SafeParceled(1000) private int versionCode; - public static final Creator CREATOR = new AutoCreator<>(RequestIndexingSpecification.class); + public static final Creator CREATOR = new AutoCreator(RequestIndexingSpecification.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/SuggestSpecification.java b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/SuggestSpecification.java index e8433284..d45addee 100644 --- a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/SuggestSpecification.java +++ b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/SuggestSpecification.java @@ -23,5 +23,5 @@ public class SuggestSpecification extends AutoSafeParcelable { @SafeParceled(1000) private int versionCode = 2; - public static final Creator CREATOR = new AutoCreator<>(SuggestSpecification.class); + public static final Creator CREATOR = new AutoCreator(SuggestSpecification.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/SuggestionResults.java b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/SuggestionResults.java index 83818551..e6f9476b 100644 --- a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/SuggestionResults.java +++ b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/SuggestionResults.java @@ -47,5 +47,5 @@ public class SuggestionResults extends AutoSafeParcelable { this.s2 = s2; } - public static final Creator CREATOR = new AutoCreator<>(SuggestionResults.class); + public static final Creator CREATOR = new AutoCreator(SuggestionResults.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/UsageInfo.java b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/UsageInfo.java index 47e12395..adb7e2b3 100644 --- a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/UsageInfo.java +++ b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/UsageInfo.java @@ -20,5 +20,5 @@ import org.microg.safeparcel.AutoSafeParcelable; public class UsageInfo extends AutoSafeParcelable { - public static Creator CREATOR = new AutoCreator<>(UsageInfo.class); + public static Creator CREATOR = new AutoCreator(UsageInfo.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEvent.java b/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEvent.java index cfa84122..b7b5269f 100644 --- a/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEvent.java +++ b/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEvent.java @@ -3,5 +3,5 @@ package com.google.android.gms.auth; import org.microg.safeparcel.AutoSafeParcelable; public class AccountChangeEvent extends AutoSafeParcelable { - public static Creator CREATOR = new AutoCreator<>(AccountChangeEvent.class); + public static Creator CREATOR = new AutoCreator(AccountChangeEvent.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEventsRequest.java b/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEventsRequest.java index 940301d3..1ce15b38 100644 --- a/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEventsRequest.java +++ b/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEventsRequest.java @@ -32,6 +32,6 @@ public class AccountChangeEventsRequest extends AutoSafeParcelable { versionCode = 1; } - public static Creator CREATOR = new AutoCreator<>(AccountChangeEventsRequest.class); + public static Creator CREATOR = new AutoCreator(AccountChangeEventsRequest.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEventsResponse.java b/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEventsResponse.java index a319e621..fa37e5c5 100644 --- a/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEventsResponse.java +++ b/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEventsResponse.java @@ -30,8 +30,8 @@ public class AccountChangeEventsResponse extends AutoSafeParcelable { public AccountChangeEventsResponse() { versionCode = 1; - events = new ArrayList<>(); + events = new ArrayList(); } - public static Creator CREATOR = new AutoCreator<>(AccountChangeEventsResponse.class); + public static Creator CREATOR = new AutoCreator(AccountChangeEventsResponse.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/common/api/AccountInfo.java b/play-services-api/src/main/java/com/google/android/gms/common/api/AccountInfo.java index e482b9fd..ad7e899b 100644 --- a/play-services-api/src/main/java/com/google/android/gms/common/api/AccountInfo.java +++ b/play-services-api/src/main/java/com/google/android/gms/common/api/AccountInfo.java @@ -3,5 +3,5 @@ package com.google.android.gms.common.api; import org.microg.safeparcel.AutoSafeParcelable; public class AccountInfo extends AutoSafeParcelable { - public static final Creator CREATOR = new AutoCreator<>(AccountInfo.class); + public static final Creator CREATOR = new AutoCreator(AccountInfo.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/common/api/Scope.java b/play-services-api/src/main/java/com/google/android/gms/common/api/Scope.java index 47c05291..2226936b 100644 --- a/play-services-api/src/main/java/com/google/android/gms/common/api/Scope.java +++ b/play-services-api/src/main/java/com/google/android/gms/common/api/Scope.java @@ -47,5 +47,5 @@ public class Scope extends AutoSafeParcelable { return scopeUri; } - public static final Creator CREATOR = new AutoCreator<>(Scope.class); + public static final Creator CREATOR = new AutoCreator(Scope.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/common/api/Status.java b/play-services-api/src/main/java/com/google/android/gms/common/api/Status.java index 52e2cf7f..49b637a1 100644 --- a/play-services-api/src/main/java/com/google/android/gms/common/api/Status.java +++ b/play-services-api/src/main/java/com/google/android/gms/common/api/Status.java @@ -79,5 +79,5 @@ public final class Status extends AutoSafeParcelable implements Result { return this; } - public static final Creator CREATOR = new AutoCreator<>(Status.class); + public static final Creator CREATOR = new AutoCreator(Status.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/common/data/DataHolder.java b/play-services-api/src/main/java/com/google/android/gms/common/data/DataHolder.java index 91bfbd68..e3bc9c1d 100644 --- a/play-services-api/src/main/java/com/google/android/gms/common/data/DataHolder.java +++ b/play-services-api/src/main/java/com/google/android/gms/common/data/DataHolder.java @@ -83,7 +83,7 @@ public class DataHolder extends AutoSafeParcelable { } public static DataHolder fromCursor(Cursor cursor, int statusCode, Bundle metadata) { - List windows = new ArrayList<>(); + List windows = new ArrayList(); CursorWindow cursorWindow = null; int row = 0; while (cursor.moveToNext()) { @@ -142,5 +142,5 @@ public class DataHolder extends AutoSafeParcelable { '}'; } - public static final Creator CREATOR = new AutoCreator<>(DataHolder.class); + public static final Creator CREATOR = new AutoCreator(DataHolder.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/common/internal/GetServiceRequest.java b/play-services-api/src/main/java/com/google/android/gms/common/internal/GetServiceRequest.java index 29660700..69641a16 100644 --- a/play-services-api/src/main/java/com/google/android/gms/common/internal/GetServiceRequest.java +++ b/play-services-api/src/main/java/com/google/android/gms/common/internal/GetServiceRequest.java @@ -78,5 +78,5 @@ public class GetServiceRequest extends AutoSafeParcelable { '}'; } - public static Creator CREATOR = new AutoCreator<>(GetServiceRequest.class); + public static Creator CREATOR = new AutoCreator(GetServiceRequest.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/common/internal/ValidateAccountRequest.java b/play-services-api/src/main/java/com/google/android/gms/common/internal/ValidateAccountRequest.java index 0c93abba..88587e7a 100644 --- a/play-services-api/src/main/java/com/google/android/gms/common/internal/ValidateAccountRequest.java +++ b/play-services-api/src/main/java/com/google/android/gms/common/internal/ValidateAccountRequest.java @@ -19,5 +19,5 @@ package com.google.android.gms.common.internal; import org.microg.safeparcel.AutoSafeParcelable; public class ValidateAccountRequest extends AutoSafeParcelable { - public static Creator CREATOR = new AutoCreator<>(ValidateAccountRequest.class); + public static Creator CREATOR = new AutoCreator(ValidateAccountRequest.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/common/server/FavaDiagnosticsEntity.java b/play-services-api/src/main/java/com/google/android/gms/common/server/FavaDiagnosticsEntity.java index 6183e2f8..b63d8f79 100644 --- a/play-services-api/src/main/java/com/google/android/gms/common/server/FavaDiagnosticsEntity.java +++ b/play-services-api/src/main/java/com/google/android/gms/common/server/FavaDiagnosticsEntity.java @@ -20,5 +20,5 @@ import org.microg.safeparcel.AutoSafeParcelable; public class FavaDiagnosticsEntity extends AutoSafeParcelable { - public static final Creator CREATOR = new AutoCreator<>(FavaDiagnosticsEntity.class); + public static final Creator CREATOR = new AutoCreator(FavaDiagnosticsEntity.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/location/Geofence.java b/play-services-api/src/main/java/com/google/android/gms/location/Geofence.java index c47a90d8..5b02f833 100644 --- a/play-services-api/src/main/java/com/google/android/gms/location/Geofence.java +++ b/play-services-api/src/main/java/com/google/android/gms/location/Geofence.java @@ -20,5 +20,5 @@ import org.microg.safeparcel.AutoSafeParcelable; public class Geofence extends AutoSafeParcelable { - public static Creator CREATOR = new AutoCreator<>(Geofence.class); + public static Creator CREATOR = new AutoCreator(Geofence.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/location/GeofencingRequest.java b/play-services-api/src/main/java/com/google/android/gms/location/GeofencingRequest.java index a36d29e6..73f955d8 100644 --- a/play-services-api/src/main/java/com/google/android/gms/location/GeofencingRequest.java +++ b/play-services-api/src/main/java/com/google/android/gms/location/GeofencingRequest.java @@ -7,6 +7,5 @@ import org.microg.safeparcel.AutoSafeParcelable; */ public class GeofencingRequest extends AutoSafeParcelable { - public static final Creator CREATOR = new AutoCreator<>( - GeofencingRequest.class); + public static final Creator CREATOR = new AutoCreator(GeofencingRequest.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/location/LocationRequest.java b/play-services-api/src/main/java/com/google/android/gms/location/LocationRequest.java index a5369fd0..52253aad 100644 --- a/play-services-api/src/main/java/com/google/android/gms/location/LocationRequest.java +++ b/play-services-api/src/main/java/com/google/android/gms/location/LocationRequest.java @@ -412,5 +412,5 @@ public class LocationRequest extends AutoSafeParcelable { return super.toString(); } - public static final Creator CREATOR = new AutoCreator<>(LocationRequest.class); + public static final Creator CREATOR = new AutoCreator(LocationRequest.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/location/LocationStatus.java b/play-services-api/src/main/java/com/google/android/gms/location/LocationStatus.java index e60c531f..ad578503 100644 --- a/play-services-api/src/main/java/com/google/android/gms/location/LocationStatus.java +++ b/play-services-api/src/main/java/com/google/android/gms/location/LocationStatus.java @@ -76,5 +76,5 @@ public class LocationStatus extends AutoSafeParcelable { } } - public static final Creator CREATOR = new AutoCreator<>(LocationStatus.class); + public static final Creator CREATOR = new AutoCreator(LocationStatus.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/location/internal/LocationRequestInternal.java b/play-services-api/src/main/java/com/google/android/gms/location/internal/LocationRequestInternal.java index 3ab5568d..6bd6108e 100644 --- a/play-services-api/src/main/java/com/google/android/gms/location/internal/LocationRequestInternal.java +++ b/play-services-api/src/main/java/com/google/android/gms/location/internal/LocationRequestInternal.java @@ -7,6 +7,5 @@ import org.microg.safeparcel.AutoSafeParcelable; */ public class LocationRequestInternal extends AutoSafeParcelable { - public static final Creator CREATOR = new AutoCreator<>( - LocationRequestInternal.class); + public static final Creator CREATOR = new AutoCreator(LocationRequestInternal.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/location/places/AutocompleteFilter.java b/play-services-api/src/main/java/com/google/android/gms/location/places/AutocompleteFilter.java index 23ffa4d4..8870ca74 100644 --- a/play-services-api/src/main/java/com/google/android/gms/location/places/AutocompleteFilter.java +++ b/play-services-api/src/main/java/com/google/android/gms/location/places/AutocompleteFilter.java @@ -15,6 +15,5 @@ public class AutocompleteFilter extends AutoSafeParcelable { this.versionCode = 1; } - public static final Creator CREATOR = new AutoCreator<>( - AutocompleteFilter.class); + public static final Creator CREATOR = new AutoCreator(AutocompleteFilter.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/location/places/NearbyAlertRequest.java b/play-services-api/src/main/java/com/google/android/gms/location/places/NearbyAlertRequest.java index 94c415a5..add70cce 100644 --- a/play-services-api/src/main/java/com/google/android/gms/location/places/NearbyAlertRequest.java +++ b/play-services-api/src/main/java/com/google/android/gms/location/places/NearbyAlertRequest.java @@ -7,6 +7,5 @@ import org.microg.safeparcel.AutoSafeParcelable; */ public class NearbyAlertRequest extends AutoSafeParcelable { - public static final Creator CREATOR = new AutoCreator<>( - NearbyAlertRequest.class); + public static final Creator CREATOR = new AutoCreator(NearbyAlertRequest.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/location/places/PlaceFilter.java b/play-services-api/src/main/java/com/google/android/gms/location/places/PlaceFilter.java index 2bbc41f6..57bebb51 100644 --- a/play-services-api/src/main/java/com/google/android/gms/location/places/PlaceFilter.java +++ b/play-services-api/src/main/java/com/google/android/gms/location/places/PlaceFilter.java @@ -7,5 +7,5 @@ import org.microg.safeparcel.AutoSafeParcelable; */ public class PlaceFilter extends AutoSafeParcelable { - public static final Creator CREATOR = new AutoCreator<>(PlaceFilter.class); + public static final Creator CREATOR = new AutoCreator(PlaceFilter.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/location/places/PlaceReport.java b/play-services-api/src/main/java/com/google/android/gms/location/places/PlaceReport.java index 38d39007..eaef07eb 100644 --- a/play-services-api/src/main/java/com/google/android/gms/location/places/PlaceReport.java +++ b/play-services-api/src/main/java/com/google/android/gms/location/places/PlaceReport.java @@ -6,5 +6,5 @@ import org.microg.safeparcel.AutoSafeParcelable; * TODO: usage */ public class PlaceReport extends AutoSafeParcelable { - public static final Creator CREATOR = new AutoCreator<>(PlaceReport.class); + public static final Creator CREATOR = new AutoCreator(PlaceReport.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/location/places/PlaceRequest.java b/play-services-api/src/main/java/com/google/android/gms/location/places/PlaceRequest.java index ad46244e..6817f7d1 100644 --- a/play-services-api/src/main/java/com/google/android/gms/location/places/PlaceRequest.java +++ b/play-services-api/src/main/java/com/google/android/gms/location/places/PlaceRequest.java @@ -6,5 +6,5 @@ import org.microg.safeparcel.AutoSafeParcelable; * TODO: usage */ public class PlaceRequest extends AutoSafeParcelable { - public static final Creator CREATOR = new AutoCreator<>(PlaceRequest.class); + public static final Creator CREATOR = new AutoCreator(PlaceRequest.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/location/places/UserAddedPlace.java b/play-services-api/src/main/java/com/google/android/gms/location/places/UserAddedPlace.java index 534dac3e..eea28f6e 100644 --- a/play-services-api/src/main/java/com/google/android/gms/location/places/UserAddedPlace.java +++ b/play-services-api/src/main/java/com/google/android/gms/location/places/UserAddedPlace.java @@ -15,5 +15,5 @@ public class UserAddedPlace extends AutoSafeParcelable { versionCode = 1; } - public static final Creator CREATOR = new AutoCreator<>(UserAddedPlace.class); + public static final Creator CREATOR = new AutoCreator(UserAddedPlace.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/location/places/UserDataType.java b/play-services-api/src/main/java/com/google/android/gms/location/places/UserDataType.java index 7ac8579a..cb253f68 100644 --- a/play-services-api/src/main/java/com/google/android/gms/location/places/UserDataType.java +++ b/play-services-api/src/main/java/com/google/android/gms/location/places/UserDataType.java @@ -7,5 +7,5 @@ import org.microg.safeparcel.AutoSafeParcelable; */ public class UserDataType extends AutoSafeParcelable { - public static final Creator CREATOR = new AutoCreator<>(UserDataType.class); + public static final Creator CREATOR = new AutoCreator(UserDataType.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/location/places/internal/PlacesParams.java b/play-services-api/src/main/java/com/google/android/gms/location/places/internal/PlacesParams.java index ad739c40..74642be6 100644 --- a/play-services-api/src/main/java/com/google/android/gms/location/places/internal/PlacesParams.java +++ b/play-services-api/src/main/java/com/google/android/gms/location/places/internal/PlacesParams.java @@ -21,5 +21,5 @@ public class PlacesParams extends AutoSafeParcelable { clientPackageName = locale = accountName = gCoreClientName = null; } - public static final Creator CREATOR = new AutoCreator<>(PlacesParams.class); + public static final Creator CREATOR = new AutoCreator(PlacesParams.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/location/reporting/ReportingState.java b/play-services-api/src/main/java/com/google/android/gms/location/reporting/ReportingState.java index b99bde56..f30b7c10 100644 --- a/play-services-api/src/main/java/com/google/android/gms/location/reporting/ReportingState.java +++ b/play-services-api/src/main/java/com/google/android/gms/location/reporting/ReportingState.java @@ -37,5 +37,5 @@ public class ReportingState extends AutoSafeParcelable { @SafeParceled(8) public Integer deviceTag; - public static final Creator CREATOR = new AutoCreator<>(ReportingState.class); + public static final Creator CREATOR = new AutoCreator(ReportingState.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/GoogleMapOptions.java b/play-services-api/src/main/java/com/google/android/gms/maps/GoogleMapOptions.java index 19e62bba..e7521751 100644 --- a/play-services-api/src/main/java/com/google/android/gms/maps/GoogleMapOptions.java +++ b/play-services-api/src/main/java/com/google/android/gms/maps/GoogleMapOptions.java @@ -79,5 +79,5 @@ public final class GoogleMapOptions extends AutoSafeParcelable { return rotateGesturesEnabled; } - public static Creator CREATOR = new AutoCreator<>(GoogleMapOptions.class); + public static Creator CREATOR = new AutoCreator(GoogleMapOptions.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/model/CameraPosition.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/CameraPosition.java index 86c2b255..717a7bdf 100644 --- a/play-services-api/src/main/java/com/google/android/gms/maps/model/CameraPosition.java +++ b/play-services-api/src/main/java/com/google/android/gms/maps/model/CameraPosition.java @@ -170,7 +170,7 @@ public final class CameraPosition extends AutoSafeParcelable { '}'; } - public static Creator CREATOR = new AutoCreator<>(CameraPosition.class); + public static Creator CREATOR = new AutoCreator(CameraPosition.class); /** * Builds camera position. diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/model/CircleOptions.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/CircleOptions.java index 0629d6fa..4f528850 100644 --- a/play-services-api/src/main/java/com/google/android/gms/maps/model/CircleOptions.java +++ b/play-services-api/src/main/java/com/google/android/gms/maps/model/CircleOptions.java @@ -217,5 +217,5 @@ public class CircleOptions extends AutoSafeParcelable { return this; } - public static Creator CREATOR = new AutoCreator<>(CircleOptions.class); + public static Creator CREATOR = new AutoCreator(CircleOptions.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/model/GroundOverlayOptions.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/GroundOverlayOptions.java index 191afda1..920c43a7 100644 --- a/play-services-api/src/main/java/com/google/android/gms/maps/model/GroundOverlayOptions.java +++ b/play-services-api/src/main/java/com/google/android/gms/maps/model/GroundOverlayOptions.java @@ -17,6 +17,7 @@ package com.google.android.gms.maps.model; import android.os.IBinder; + import com.google.android.gms.dynamic.ObjectWrapper; import org.microg.gms.common.PublicApi; @@ -336,6 +337,5 @@ public class GroundOverlayOptions extends AutoSafeParcelable { return this; } - public static Creator CREATOR = new AutoCreator<>( - GroundOverlayOptions.class); + public static Creator CREATOR = new AutoCreator(GroundOverlayOptions.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/model/LatLng.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/LatLng.java index 356e04d6..ac434bca 100644 --- a/play-services-api/src/main/java/com/google/android/gms/maps/model/LatLng.java +++ b/play-services-api/src/main/java/com/google/android/gms/maps/model/LatLng.java @@ -102,5 +102,5 @@ public final class LatLng extends AutoSafeParcelable { return "lat/lng: (" + latitude + "," + longitude + ")"; } - public static Creator CREATOR = new AutoCreator<>(LatLng.class); + public static Creator CREATOR = new AutoCreator(LatLng.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/model/LatLngBounds.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/LatLngBounds.java index eae9cb2d..371505f4 100644 --- a/play-services-api/src/main/java/com/google/android/gms/maps/model/LatLngBounds.java +++ b/play-services-api/src/main/java/com/google/android/gms/maps/model/LatLngBounds.java @@ -180,7 +180,7 @@ public final class LatLngBounds extends AutoSafeParcelable { '}'; } - public static Creator CREATOR = new AutoCreator<>(LatLngBounds.class); + public static Creator CREATOR = new AutoCreator(LatLngBounds.class); /** * This is a builder that is able to create a minimum bound based on a set of LatLng points. diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/model/MarkerOptions.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/MarkerOptions.java index bb289362..79a49d87 100644 --- a/play-services-api/src/main/java/com/google/android/gms/maps/model/MarkerOptions.java +++ b/play-services-api/src/main/java/com/google/android/gms/maps/model/MarkerOptions.java @@ -326,5 +326,5 @@ public class MarkerOptions extends AutoSafeParcelable { return this; } - public static Creator CREATOR = new AutoCreator<>(MarkerOptions.class); + public static Creator CREATOR = new AutoCreator(MarkerOptions.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/model/PolygonOptions.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/PolygonOptions.java index 0b5aaa59..252a360f 100644 --- a/play-services-api/src/main/java/com/google/android/gms/maps/model/PolygonOptions.java +++ b/play-services-api/src/main/java/com/google/android/gms/maps/model/PolygonOptions.java @@ -28,5 +28,5 @@ public class PolygonOptions extends AutoSafeParcelable { public PolygonOptions() { } - public static Creator CREATOR = new AutoCreator<>(PolygonOptions.class); + public static Creator CREATOR = new AutoCreator(PolygonOptions.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/model/PolylineOptions.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/PolylineOptions.java index ce34b343..f6e30a73 100644 --- a/play-services-api/src/main/java/com/google/android/gms/maps/model/PolylineOptions.java +++ b/play-services-api/src/main/java/com/google/android/gms/maps/model/PolylineOptions.java @@ -41,5 +41,5 @@ public class PolylineOptions extends AutoSafeParcelable { public PolylineOptions() { } - public static Creator CREATOR = new AutoCreator<>(PolylineOptions.class); + public static Creator CREATOR = new AutoCreator(PolylineOptions.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/model/Tile.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/Tile.java index cf6f437a..aa3b5013 100644 --- a/play-services-api/src/main/java/com/google/android/gms/maps/model/Tile.java +++ b/play-services-api/src/main/java/com/google/android/gms/maps/model/Tile.java @@ -51,5 +51,5 @@ public class Tile extends AutoSafeParcelable { this.data = data; } - public static Creator CREATOR = new AutoCreator<>(Tile.class); + public static Creator CREATOR = new AutoCreator(Tile.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/model/TileOverlayOptions.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/TileOverlayOptions.java index 7f2df331..68fdaade 100644 --- a/play-services-api/src/main/java/com/google/android/gms/maps/model/TileOverlayOptions.java +++ b/play-services-api/src/main/java/com/google/android/gms/maps/model/TileOverlayOptions.java @@ -137,5 +137,5 @@ public class TileOverlayOptions extends AutoSafeParcelable { return this; } - public static Creator CREATOR = new AutoCreator<>(TileOverlayOptions.class); + public static Creator CREATOR = new AutoCreator(TileOverlayOptions.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/model/VisibleRegion.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/VisibleRegion.java index ab0e20b7..105c1089 100644 --- a/play-services-api/src/main/java/com/google/android/gms/maps/model/VisibleRegion.java +++ b/play-services-api/src/main/java/com/google/android/gms/maps/model/VisibleRegion.java @@ -63,5 +63,5 @@ public class VisibleRegion extends AutoSafeParcelable { bounds); } - public static Creator CREATOR = new AutoCreator<>(VisibleRegion.class); + public static Creator CREATOR = new AutoCreator(VisibleRegion.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/people/model/AccountMetadata.java b/play-services-api/src/main/java/com/google/android/gms/people/model/AccountMetadata.java index 943aac86..f62e3eb0 100644 --- a/play-services-api/src/main/java/com/google/android/gms/people/model/AccountMetadata.java +++ b/play-services-api/src/main/java/com/google/android/gms/people/model/AccountMetadata.java @@ -24,5 +24,5 @@ public class AccountMetadata extends AutoSafeParcelable { @SafeParceled(1) private int versionCode = 2; - public static Creator CREATOR = new AutoCreator<>(AccountMetadata.class); + public static Creator CREATOR = new AutoCreator(AccountMetadata.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/playlog/internal/LogEvent.java b/play-services-api/src/main/java/com/google/android/gms/playlog/internal/LogEvent.java index 94f066b9..3dc6b6ee 100644 --- a/play-services-api/src/main/java/com/google/android/gms/playlog/internal/LogEvent.java +++ b/play-services-api/src/main/java/com/google/android/gms/playlog/internal/LogEvent.java @@ -51,5 +51,5 @@ public class LogEvent extends AutoSafeParcelable { '}'; } - public static Creator CREATOR = new AutoCreator<>(LogEvent.class); + public static Creator CREATOR = new AutoCreator(LogEvent.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/playlog/internal/PlayLoggerContext.java b/play-services-api/src/main/java/com/google/android/gms/playlog/internal/PlayLoggerContext.java index 3dcd4f92..f35bf750 100644 --- a/play-services-api/src/main/java/com/google/android/gms/playlog/internal/PlayLoggerContext.java +++ b/play-services-api/src/main/java/com/google/android/gms/playlog/internal/PlayLoggerContext.java @@ -71,5 +71,5 @@ public class PlayLoggerContext extends AutoSafeParcelable { '}'; } - public static Creator CREATOR = new AutoCreator<>(PlayLoggerContext.class); + public static Creator CREATOR = new AutoCreator(PlayLoggerContext.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/Asset.java b/play-services-api/src/main/java/com/google/android/gms/wearable/Asset.java index 6967fbdd..0fa11be6 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wearable/Asset.java +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/Asset.java @@ -85,5 +85,5 @@ public class Asset extends AutoSafeParcelable { return null; } - public static final Creator CREATOR = new AutoCreator<>(Asset.class); + public static final Creator CREATOR = new AutoCreator(Asset.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/PutDataRequest.java b/play-services-api/src/main/java/com/google/android/gms/wearable/PutDataRequest.java index 8d049eba..8b8503d9 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wearable/PutDataRequest.java +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/PutDataRequest.java @@ -96,5 +96,5 @@ public class PutDataRequest extends AutoSafeParcelable { return "PutDataRequest{data=" + dataItem + "}"; } - public static final Creator CREATOR = new AutoCreator<>(PutDataRequest.class); + public static final Creator CREATOR = new AutoCreator(PutDataRequest.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/NodeParcelable.java b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/NodeParcelable.java index d673c1bb..6bdbce7f 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/NodeParcelable.java +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/NodeParcelable.java @@ -77,5 +77,5 @@ public class NodeParcelable extends AutoSafeParcelable implements Node { return "NodeParcelable{" + id + "," + displayName + "}"; } - public static final Creator CREATOR = new AutoCreator<>(NodeParcelable.class); + public static final Creator CREATOR = new AutoCreator(NodeParcelable.class); } From 6743f1d4b1a3cf0202b9d62f2ebc5dfb385b5576 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Tue, 14 Apr 2015 23:13:02 +0200 Subject: [PATCH 075/293] Update tools to 22.0.1 --- extern/SafeParcel | 2 +- play-services-api/build.gradle | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/extern/SafeParcel b/extern/SafeParcel index d7b18b06..2408cfd9 160000 --- a/extern/SafeParcel +++ b/extern/SafeParcel @@ -1 +1 @@ -Subproject commit d7b18b06734e4109bc3131345a26aa261d369605 +Subproject commit 2408cfd92aae226fa9941579e9da462948f22e60 diff --git a/play-services-api/build.gradle b/play-services-api/build.gradle index 909d7a67..7fb57d54 100644 --- a/play-services-api/build.gradle +++ b/play-services-api/build.gradle @@ -19,7 +19,7 @@ dependencies { android { compileSdkVersion 22 - buildToolsVersion "22.0.0" + buildToolsVersion "22.0.1" compileOptions { sourceCompatibility JavaVersion.VERSION_1_6 } From e1281984264d06a0b88f960ce87977098ec6e5b8 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Wed, 15 Apr 2015 01:19:40 +0200 Subject: [PATCH 076/293] Update tools to 22.0.1 --- extern/GmsApi | 2 +- play-services-base/build.gradle | 5 ++++- play-services-location/build.gradle | 7 +++++-- play-services-wearable/build.gradle | 5 ++++- play-services/build.gradle | 5 ++++- 5 files changed, 18 insertions(+), 6 deletions(-) diff --git a/extern/GmsApi b/extern/GmsApi index a0e9645c..6743f1d4 160000 --- a/extern/GmsApi +++ b/extern/GmsApi @@ -1 +1 @@ -Subproject commit a0e9645c796dfd8af38f8cdedf21f5a299c9c5b0 +Subproject commit 6743f1d4b1a3cf0202b9d62f2ebc5dfb385b5576 diff --git a/play-services-base/build.gradle b/play-services-base/build.gradle index c6903999..f0caf02f 100644 --- a/play-services-base/build.gradle +++ b/play-services-base/build.gradle @@ -18,5 +18,8 @@ dependencies { android { compileSdkVersion 22 - buildToolsVersion "22.0.0" + buildToolsVersion "22.0.1" + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_6 + } } diff --git a/play-services-location/build.gradle b/play-services-location/build.gradle index 918f297c..041610d5 100644 --- a/play-services-location/build.gradle +++ b/play-services-location/build.gradle @@ -17,5 +17,8 @@ dependencies { android { compileSdkVersion 22 - buildToolsVersion "22.0.0" -} \ No newline at end of file + buildToolsVersion "22.0.1" + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_6 + } +} diff --git a/play-services-wearable/build.gradle b/play-services-wearable/build.gradle index 923eb4b0..041610d5 100644 --- a/play-services-wearable/build.gradle +++ b/play-services-wearable/build.gradle @@ -17,5 +17,8 @@ dependencies { android { compileSdkVersion 22 - buildToolsVersion "22.0.0" + buildToolsVersion "22.0.1" + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_6 + } } diff --git a/play-services/build.gradle b/play-services/build.gradle index 1f73cbcc..75aa8dd3 100644 --- a/play-services/build.gradle +++ b/play-services/build.gradle @@ -19,5 +19,8 @@ dependencies { android { compileSdkVersion 22 - buildToolsVersion "22.0.0" + buildToolsVersion "22.0.1" + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_6 + } } From 2edcd4d5b355ae89c7baba25f2c650daa8ca5524 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20W=C3=B6rner?= Date: Thu, 30 Apr 2015 22:55:55 +0200 Subject: [PATCH 077/293] added missing import --- .../aidl/com/google/android/gms/http/IGoogleHttpService.aidl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/play-services-api/src/main/aidl/com/google/android/gms/http/IGoogleHttpService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/http/IGoogleHttpService.aidl index 1503e8d1..58ea0ba5 100644 --- a/play-services-api/src/main/aidl/com/google/android/gms/http/IGoogleHttpService.aidl +++ b/play-services-api/src/main/aidl/com/google/android/gms/http/IGoogleHttpService.aidl @@ -1,5 +1,7 @@ package com.google.android.gms.http; +import android.os.Bundle; + interface IGoogleHttpService { Bundle checkUrl(String url); } From 07f31a99fe1bf68d0b79cebc7cd9b8297a870ac8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20W=C3=B6rner?= Date: Thu, 30 Apr 2015 22:58:42 +0200 Subject: [PATCH 078/293] added import --- .../com/google/android/gms/people/internal/IPeopleCallbacks.aidl | 1 + 1 file changed, 1 insertion(+) diff --git a/play-services-api/src/main/aidl/com/google/android/gms/people/internal/IPeopleCallbacks.aidl b/play-services-api/src/main/aidl/com/google/android/gms/people/internal/IPeopleCallbacks.aidl index 2a7cf8db..75db9fae 100644 --- a/play-services-api/src/main/aidl/com/google/android/gms/people/internal/IPeopleCallbacks.aidl +++ b/play-services-api/src/main/aidl/com/google/android/gms/people/internal/IPeopleCallbacks.aidl @@ -1,6 +1,7 @@ package com.google.android.gms.people.internal; import android.os.Bundle; +import android.os.ParcelFileDescriptor; import com.google.android.gms.common.data.DataHolder; From ceb0f9f2c60285180a0c5520687439f15fa7e504 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Mon, 22 Jun 2015 23:24:05 +0200 Subject: [PATCH 079/293] Add empty AdManagerCreator --- .../aidl/com/google/android/gms/ads/AdManagerCreator.aidl | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/ads/AdManagerCreator.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/ads/AdManagerCreator.aidl b/play-services-api/src/main/aidl/com/google/android/gms/ads/AdManagerCreator.aidl new file mode 100644 index 00000000..7e07dd01 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/ads/AdManagerCreator.aidl @@ -0,0 +1,4 @@ +package com.google.android.gms.ads; + +interface AdManagerCreator { +} \ No newline at end of file From 37e3b4dc398cb349e9637471d6df09db9c8910c8 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Mon, 22 Jun 2015 23:24:18 +0200 Subject: [PATCH 080/293] Update IAuthManagerService --- .../aidl/com/google/android/auth/IAuthManagerService.aidl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/play-services-api/src/main/aidl/com/google/android/auth/IAuthManagerService.aidl b/play-services-api/src/main/aidl/com/google/android/auth/IAuthManagerService.aidl index ac46a323..75a949b8 100644 --- a/play-services-api/src/main/aidl/com/google/android/auth/IAuthManagerService.aidl +++ b/play-services-api/src/main/aidl/com/google/android/auth/IAuthManagerService.aidl @@ -1,12 +1,14 @@ package com.google.android.auth; import android.os.Bundle; +import android.accounts.Account; import com.google.android.gms.auth.AccountChangeEventsResponse; import com.google.android.gms.auth.AccountChangeEventsRequest; interface IAuthManagerService { - Bundle getToken(String accountName, String scope, in Bundle extras); - Bundle clearToken(String token, in Bundle extras); - AccountChangeEventsResponse getChangeEvents(in AccountChangeEventsRequest request); + Bundle getToken(String accountName, String scope, in Bundle extras) = 0; + Bundle clearToken(String token, in Bundle extras) = 1; + AccountChangeEventsResponse getChangeEvents(in AccountChangeEventsRequest request) = 2; + Bundle getTokenWithAccount(in Account account, String scope, in Bundle extras) = 4; } From d3c11f1e82949e364c3c36cdb9e2e5071cf42ab4 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Tue, 23 Jun 2015 00:19:41 +0200 Subject: [PATCH 081/293] Add PeopleServce.loadAutocompleteList --- .../com/google/android/gms/people/internal/IPeopleService.aidl | 1 + 1 file changed, 1 insertion(+) diff --git a/play-services-api/src/main/aidl/com/google/android/gms/people/internal/IPeopleService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/people/internal/IPeopleService.aidl index e6857c0c..62ae1478 100644 --- a/play-services-api/src/main/aidl/com/google/android/gms/people/internal/IPeopleService.aidl +++ b/play-services-api/src/main/aidl/com/google/android/gms/people/internal/IPeopleService.aidl @@ -40,4 +40,5 @@ interface IPeopleService { void loadOwners(IPeopleCallbacks callbacks, boolean var2, boolean var3, String account, String var5, int sortOrder) = 304; void loadPeopleForAggregation(IPeopleCallbacks callbacks, String account, String var3, String filter, int var5, boolean var6, int var7, int var8, String var9, boolean var10, int var11, int var12) = 401; ICancelToken loadOwnerAvatar(IPeopleCallbacks callbacks, String account, String pageId, int size, int flags) = 504; + ICancelToken loadAutocompleteList(IPeopleCallbacks callbacks, String account, String pageId, boolean directorySearch, String var5, String query, int autocompleteType, int var8, int numberOfResults, boolean var10) = 506; } From ef5e6dc0668a8ca152aa38a78f0e91d65120d3b6 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Tue, 23 Jun 2015 19:21:32 +0200 Subject: [PATCH 082/293] Add some search APIs --- .../gms/playlog/internal/IPlayLogService.aidl | 3 +- .../search/corpora/ClearCorpusRequest.aidl | 3 + .../search/corpora/GetCorpusInfoRequest.aidl | 3 + .../corpora/GetCorpusStatusRequest.aidl | 3 + .../corpora/GetCorpusStatusResponse.aidl | 3 + .../corpora/RequestIndexingRequest.aidl | 3 + .../corpora/RequestIndexingResponse.aidl | 3 + .../internal/ISearchCorporaCallbacks.aidl | 9 +++ .../internal/ISearchCorporaService.aidl | 11 ++- .../internal/IGlobalSearchAdminService.aidl | 5 ++ .../gms/search/queries/QueryRequest.aidl | 3 + .../gms/search/queries/QueryResponse.aidl | 3 + .../internal/ISearchQueriesCallbacks.aidl | 7 ++ .../internal/ISearchQueriesService.aidl | 8 ++ .../gms/appdatasearch/QuerySpecification.java | 73 +++++++++++++++++++ .../gms/appdatasearch/SearchResults.java | 27 +++++++ .../search/corpora/ClearCorpusRequest.java | 23 ++++++ .../search/corpora/GetCorpusInfoRequest.java | 23 ++++++ .../corpora/GetCorpusStatusRequest.java | 49 +++++++++++++ .../corpora/GetCorpusStatusResponse.java | 49 +++++++++++++ .../corpora/RequestIndexingRequest.java | 54 ++++++++++++++ .../corpora/RequestIndexingResponse.java | 48 ++++++++++++ .../gms/search/queries/QueryRequest.java | 57 +++++++++++++++ .../gms/search/queries/QueryResponse.java | 49 +++++++++++++ 24 files changed, 517 insertions(+), 2 deletions(-) create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/search/corpora/ClearCorpusRequest.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/search/corpora/GetCorpusInfoRequest.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/search/corpora/GetCorpusStatusRequest.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/search/corpora/GetCorpusStatusResponse.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/search/corpora/RequestIndexingRequest.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/search/corpora/RequestIndexingResponse.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/search/corpora/internal/ISearchCorporaCallbacks.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/search/global/internal/IGlobalSearchAdminService.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/search/queries/QueryRequest.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/search/queries/QueryResponse.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/search/queries/internal/ISearchQueriesCallbacks.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/search/queries/internal/ISearchQueriesService.aidl create mode 100644 play-services-api/src/main/java/com/google/android/gms/appdatasearch/QuerySpecification.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/appdatasearch/SearchResults.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/search/corpora/ClearCorpusRequest.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/search/corpora/GetCorpusInfoRequest.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/search/corpora/GetCorpusStatusRequest.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/search/corpora/GetCorpusStatusResponse.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/search/corpora/RequestIndexingRequest.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/search/corpora/RequestIndexingResponse.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/search/queries/QueryRequest.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/search/queries/QueryResponse.java diff --git a/play-services-api/src/main/aidl/com/google/android/gms/playlog/internal/IPlayLogService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/playlog/internal/IPlayLogService.aidl index 521df957..86169b99 100644 --- a/play-services-api/src/main/aidl/com/google/android/gms/playlog/internal/IPlayLogService.aidl +++ b/play-services-api/src/main/aidl/com/google/android/gms/playlog/internal/IPlayLogService.aidl @@ -4,5 +4,6 @@ import com.google.android.gms.playlog.internal.LogEvent; import com.google.android.gms.playlog.internal.PlayLoggerContext; interface IPlayLogService { - void event(String packageName, in PlayLoggerContext context, in LogEvent event) = 1; + void onEvent(String packageName, in PlayLoggerContext context, in LogEvent event) = 1; + void onMultiEvent(String packageName, in PlayLoggerContext context, in List events) = 2; } diff --git a/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/ClearCorpusRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/ClearCorpusRequest.aidl new file mode 100644 index 00000000..9f718934 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/ClearCorpusRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.search.corpora; + +parcelable ClearCorpusRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/GetCorpusInfoRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/GetCorpusInfoRequest.aidl new file mode 100644 index 00000000..11b0a4dc --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/GetCorpusInfoRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.search.corpora; + +parcelable GetCorpusInfoRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/GetCorpusStatusRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/GetCorpusStatusRequest.aidl new file mode 100644 index 00000000..b2e549d7 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/GetCorpusStatusRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.search.corpora; + +parcelable GetCorpusStatusRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/GetCorpusStatusResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/GetCorpusStatusResponse.aidl new file mode 100644 index 00000000..a837a7db --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/GetCorpusStatusResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.search.corpora; + +parcelable GetCorpusStatusResponse; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/RequestIndexingRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/RequestIndexingRequest.aidl new file mode 100644 index 00000000..ad68ef35 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/RequestIndexingRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.search.corpora; + +parcelable RequestIndexingRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/RequestIndexingResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/RequestIndexingResponse.aidl new file mode 100644 index 00000000..7aaa548c --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/RequestIndexingResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.search.corpora; + +parcelable RequestIndexingResponse; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/internal/ISearchCorporaCallbacks.aidl b/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/internal/ISearchCorporaCallbacks.aidl new file mode 100644 index 00000000..863b016f --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/internal/ISearchCorporaCallbacks.aidl @@ -0,0 +1,9 @@ +package com.google.android.gms.search.corpora.internal; + +import com.google.android.gms.search.corpora.RequestIndexingResponse; +import com.google.android.gms.search.corpora.GetCorpusStatusResponse; + +interface ISearchCorporaCallbacks { + void onRequestIndexing(in RequestIndexingResponse response) = 1; + void onGetCorpusStatus(in GetCorpusStatusResponse response) = 3; +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/internal/ISearchCorporaService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/internal/ISearchCorporaService.aidl index 8c54aa09..fe2073c0 100644 --- a/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/internal/ISearchCorporaService.aidl +++ b/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/internal/ISearchCorporaService.aidl @@ -1,5 +1,14 @@ package com.google.android.gms.search.corpora.internal; -interface ISearchCorporaService { +import com.google.android.gms.search.corpora.ClearCorpusRequest; +import com.google.android.gms.search.corpora.GetCorpusStatusRequest; +import com.google.android.gms.search.corpora.GetCorpusInfoRequest; +import com.google.android.gms.search.corpora.RequestIndexingRequest; +import com.google.android.gms.search.corpora.internal.ISearchCorporaCallbacks; +interface ISearchCorporaService { + void requestIndexing(in RequestIndexingRequest request, ISearchCorporaCallbacks callbacks) = 1; + void clearCorpus(in ClearCorpusRequest request, ISearchCorporaCallbacks callbacks) = 2; + void getCorpusStatus(in GetCorpusStatusRequest request, ISearchCorporaCallbacks callbacks) = 3; + void getCorpusInfo(in GetCorpusInfoRequest request, ISearchCorporaCallbacks callbacks) = 4; } diff --git a/play-services-api/src/main/aidl/com/google/android/gms/search/global/internal/IGlobalSearchAdminService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/search/global/internal/IGlobalSearchAdminService.aidl new file mode 100644 index 00000000..35ed0dbe --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/search/global/internal/IGlobalSearchAdminService.aidl @@ -0,0 +1,5 @@ +package com.google.android.gms.search.global.internal; + +interface IGlobalSearchAdminService { + +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/search/queries/QueryRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/search/queries/QueryRequest.aidl new file mode 100644 index 00000000..1986e95d --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/search/queries/QueryRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.search.queries; + +parcelable QueryRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/search/queries/QueryResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/search/queries/QueryResponse.aidl new file mode 100644 index 00000000..97047253 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/search/queries/QueryResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.search.queries; + +parcelable QueryResponse; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/search/queries/internal/ISearchQueriesCallbacks.aidl b/play-services-api/src/main/aidl/com/google/android/gms/search/queries/internal/ISearchQueriesCallbacks.aidl new file mode 100644 index 00000000..8bcb891e --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/search/queries/internal/ISearchQueriesCallbacks.aidl @@ -0,0 +1,7 @@ +package com.google.android.gms.search.queries.internal; + +import com.google.android.gms.search.queries.QueryResponse; + +interface ISearchQueriesCallbacks { + void onQuery(in QueryResponse response) = 1; +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/search/queries/internal/ISearchQueriesService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/search/queries/internal/ISearchQueriesService.aidl new file mode 100644 index 00000000..091cdae5 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/search/queries/internal/ISearchQueriesService.aidl @@ -0,0 +1,8 @@ +package com.google.android.gms.search.queries.internal; + +import com.google.android.gms.search.queries.QueryRequest; +import com.google.android.gms.search.queries.internal.ISearchQueriesCallbacks; + +interface ISearchQueriesService { + void query(in QueryRequest request, ISearchQueriesCallbacks callbacks) = 1; +} diff --git a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/QuerySpecification.java b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/QuerySpecification.java new file mode 100644 index 00000000..9a77eb06 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/QuerySpecification.java @@ -0,0 +1,73 @@ +/* + * Copyright 2013-2015 µg 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.appdatasearch; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +import java.util.List; + +public class QuerySpecification extends AutoSafeParcelable { + + @SafeParceled(1000) + public final int versionCode; + @SafeParceled(1) + public final boolean b; + //@SafeParceled(value = 2, subType = "TODO") + public final List c; + //@SafeParceled(value = 3, subType = "TODO") + public final List d; + @SafeParceled(4) + public final boolean e; + @SafeParceled(5) + public final int f; + @SafeParceled(6) + public final int g; + @SafeParceled(7) + public final boolean h; + @SafeParceled(8) + public final int i; + + private QuerySpecification() { + versionCode = 2; + b = false; + c = null; + d = null; + e = false; + f = 0; + g = 0; + h = false; + i = 0; + } + + @Override + public String toString() { + return "QuerySpecification{" + + "versionCode=" + versionCode + + ", b=" + b + + ", c=" + c + + ", d=" + d + + ", e=" + e + + ", f=" + f + + ", g=" + g + + ", h=" + h + + ", i=" + i + + '}'; + } + + public static final Creator CREATOR = new AutoCreator(QuerySpecification.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/SearchResults.java b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/SearchResults.java new file mode 100644 index 00000000..59c7244b --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/SearchResults.java @@ -0,0 +1,27 @@ +/* + * Copyright 2013-2015 µg 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.appdatasearch; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class SearchResults extends AutoSafeParcelable { + @SafeParceled(1000) + public final int versionCode = 2; + + public static Creator CREATOR = new AutoCreator(SearchResults.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/search/corpora/ClearCorpusRequest.java b/play-services-api/src/main/java/com/google/android/gms/search/corpora/ClearCorpusRequest.java new file mode 100644 index 00000000..9bd5d83b --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/search/corpora/ClearCorpusRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 µg 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.search.corpora; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class ClearCorpusRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(ClearCorpusRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/search/corpora/GetCorpusInfoRequest.java b/play-services-api/src/main/java/com/google/android/gms/search/corpora/GetCorpusInfoRequest.java new file mode 100644 index 00000000..bdc842ff --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/search/corpora/GetCorpusInfoRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 µg 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.search.corpora; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class GetCorpusInfoRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(GetCorpusInfoRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/search/corpora/GetCorpusStatusRequest.java b/play-services-api/src/main/java/com/google/android/gms/search/corpora/GetCorpusStatusRequest.java new file mode 100644 index 00000000..9ccfc30a --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/search/corpora/GetCorpusStatusRequest.java @@ -0,0 +1,49 @@ +/* + * Copyright 2013-2015 µg 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.search.corpora; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class GetCorpusStatusRequest extends AutoSafeParcelable { + + @SafeParceled(1000) + public final int versionCode; + + @SafeParceled(1) + public final String packageName; + + @SafeParceled(2) + public final String corpus; + + private GetCorpusStatusRequest() { + versionCode = 1; + packageName = null; + corpus = null; + } + + @Override + public String toString() { + return "GetCorpusStatusRequest{" + + "versionCode=" + versionCode + + ", packageName='" + packageName + '\'' + + ", corpus='" + corpus + '\'' + + '}'; + } + + public static Creator CREATOR = new AutoCreator(GetCorpusStatusRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/search/corpora/GetCorpusStatusResponse.java b/play-services-api/src/main/java/com/google/android/gms/search/corpora/GetCorpusStatusResponse.java new file mode 100644 index 00000000..79f2846a --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/search/corpora/GetCorpusStatusResponse.java @@ -0,0 +1,49 @@ +/* + * Copyright 2013-2015 µg 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.search.corpora; + +import com.google.android.gms.appdatasearch.CorpusStatus; +import com.google.android.gms.common.api.Status; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class GetCorpusStatusResponse extends AutoSafeParcelable { + + @SafeParceled(1000) + public final int versionCode; + + @SafeParceled(1) + public final Status status; + + @SafeParceled(2) + public final CorpusStatus corpusStatus; + + private GetCorpusStatusResponse() { + versionCode = 1; + status = null; + corpusStatus = null; + } + + public GetCorpusStatusResponse(Status status, CorpusStatus corpusStatus) { + this.versionCode = 1; + this.status = status; + this.corpusStatus = corpusStatus; + } + + public static Creator CREATOR = new AutoCreator(GetCorpusStatusResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/search/corpora/RequestIndexingRequest.java b/play-services-api/src/main/java/com/google/android/gms/search/corpora/RequestIndexingRequest.java new file mode 100644 index 00000000..5cec94b3 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/search/corpora/RequestIndexingRequest.java @@ -0,0 +1,54 @@ +/* + * Copyright 2013-2015 µg 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.search.corpora; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class RequestIndexingRequest extends AutoSafeParcelable { + + @SafeParceled(1000) + public final int versionCode; + + @SafeParceled(1) + public final String packageName; + + @SafeParceled(2) + public final String corpus; + + @SafeParceled(3) + public final long sequenceNumber; + + private RequestIndexingRequest() { + versionCode = 1; + packageName = null; + corpus = null; + sequenceNumber = 0; + } + + @Override + public String toString() { + return "RequestIndexingRequest{" + + "versionCode=" + versionCode + + ", packageName='" + packageName + '\'' + + ", corpus='" + corpus + '\'' + + ", sequenceNumber=" + sequenceNumber + + '}'; + } + + public static Creator CREATOR = new AutoCreator(RequestIndexingRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/search/corpora/RequestIndexingResponse.java b/play-services-api/src/main/java/com/google/android/gms/search/corpora/RequestIndexingResponse.java new file mode 100644 index 00000000..024db887 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/search/corpora/RequestIndexingResponse.java @@ -0,0 +1,48 @@ +/* + * Copyright 2013-2015 µg 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.search.corpora; + +import com.google.android.gms.common.api.Status; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class RequestIndexingResponse extends AutoSafeParcelable { + + @SafeParceled(1000) + public final int versionCode; + + @SafeParceled(1) + public final Status status; + + @SafeParceled(2) + public final boolean scheduledIndexing; + + private RequestIndexingResponse() { + versionCode = 1; + status = null; + scheduledIndexing = false; + } + + public RequestIndexingResponse(Status status, boolean scheduledIndexing) { + this.versionCode = 1; + this.status = status; + this.scheduledIndexing = scheduledIndexing; + } + + public static Creator CREATOR = new AutoCreator(RequestIndexingResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/search/queries/QueryRequest.java b/play-services-api/src/main/java/com/google/android/gms/search/queries/QueryRequest.java new file mode 100644 index 00000000..4ac607de --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/search/queries/QueryRequest.java @@ -0,0 +1,57 @@ +/* + * Copyright 2013-2015 µg 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.search.queries; + +import com.google.android.gms.appdatasearch.QuerySpecification; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +import java.util.Arrays; + +public class QueryRequest extends AutoSafeParcelable { + + @SafeParceled(1000) + public int versionCode = 1; + @SafeParceled(1) + public String searchString; + @SafeParceled(2) + public String packageName; + @SafeParceled(3) + public String[] corpora; + @SafeParceled(4) + public int d; + @SafeParceled(5) + public int e; + @SafeParceled(6) + public QuerySpecification spec; + + @Override + public String toString() { + return "QueryRequest{" + + "versionCode=" + versionCode + + ", searchString='" + searchString + '\'' + + ", packageName='" + packageName + '\'' + + ", corpora=" + Arrays.toString(corpora) + + ", d=" + d + + ", e=" + e + + ", spec=" + spec + + '}'; + } + + public static Creator CREATOR = new AutoCreator(QueryRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/search/queries/QueryResponse.java b/play-services-api/src/main/java/com/google/android/gms/search/queries/QueryResponse.java new file mode 100644 index 00000000..a58a7be6 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/search/queries/QueryResponse.java @@ -0,0 +1,49 @@ +/* + * Copyright 2013-2015 µg 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.search.queries; + +import com.google.android.gms.appdatasearch.SearchResults; +import com.google.android.gms.common.api.Status; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class QueryResponse extends AutoSafeParcelable { + + @SafeParceled(1000) + public final int versionCode; + + @SafeParceled(1) + public final Status status; + + @SafeParceled(2) + public final SearchResults results; + + private QueryResponse() { + versionCode = 1; + status = null; + results = null; + } + + public QueryResponse(Status status, SearchResults results) { + this.versionCode = 1; + this.status = status; + this.results = results; + } + + public static Creator CREATOR = new AutoCreator(QueryResponse.class); +} From 3c2fdf86eb899bdcff7b215ad9c5f58a152246fc Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Sat, 4 Jul 2015 13:11:15 +0200 Subject: [PATCH 083/293] Update build tools --- play-services-api/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/play-services-api/build.gradle b/play-services-api/build.gradle index 7fb57d54..f48d82b3 100644 --- a/play-services-api/build.gradle +++ b/play-services-api/build.gradle @@ -1,9 +1,9 @@ buildscript { repositories { - mavenCentral() + jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:1.0.1' + classpath 'com.android.tools.build:gradle:1.2.3' } } From 2c847ce6e8ac1604356dc45fd672cfdd6ad4d73b Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Sat, 4 Jul 2015 13:16:33 +0200 Subject: [PATCH 084/293] Update SafeParcel --- extern/SafeParcel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extern/SafeParcel b/extern/SafeParcel index 2408cfd9..cfbcc9db 160000 --- a/extern/SafeParcel +++ b/extern/SafeParcel @@ -1 +1 @@ -Subproject commit 2408cfd92aae226fa9941579e9da462948f22e60 +Subproject commit cfbcc9db09d98a2d32e996f5ff9fe587aa9f21f4 From f77b09dc0c3c750f7c99d901b6e5ced5f17d9465 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Fri, 24 Jul 2015 02:52:23 +0200 Subject: [PATCH 085/293] Adding some wearable APIs and various smaller changes --- extern/SafeParcel | 2 +- .../google/android/gms/common/api/Status.aidl | 3 + .../gms/wearable/AddListenerRequest.aidl | 3 + .../gms/wearable/ConnectionConfiguration.aidl | 3 + .../gms/wearable/DeleteDataItemsResponse.aidl | 3 + .../gms/wearable/GetConfigResponse.aidl | 3 + .../gms/wearable/GetConfigsResponse.aidl | 3 + .../wearable/GetConnectedNodesResponse.aidl | 3 + .../gms/wearable/GetDataItemResponse.aidl | 3 + .../gms/wearable/GetFdForAssetResponse.aidl | 3 + .../gms/wearable/GetLocalNodeResponse.aidl | 3 + .../android/gms/wearable/PutDataRequest.aidl | 3 + .../android/gms/wearable/PutDataResponse.aidl | 3 + .../gms/wearable/RemoveListenerRequest.aidl | 3 + .../gms/wearable/SendMessageResponse.aidl | 3 + .../gms/wearable/StorageInfoResponse.aidl | 3 + .../wearable/internal/IWearableCallbacks.aidl | 29 +++++++ .../wearable/internal/IWearableListener.aidl | 5 ++ .../wearable/internal/IWearableService.aidl | 23 ++++++ .../gms/appdatasearch/CorpusStatus.java | 6 +- .../gms/appdatasearch/PIMEUpdateResponse.java | 3 +- .../gms/appdatasearch/QuerySpecification.java | 3 +- .../gms/appdatasearch/SearchResults.java | 2 +- .../appdatasearch/SuggestSpecification.java | 6 +- .../gms/appdatasearch/SuggestionResults.java | 5 +- .../gms/auth/AccountChangeEventsRequest.java | 7 +- .../gms/auth/AccountChangeEventsResponse.java | 3 +- .../google/android/gms/common/api/Scope.java | 4 +- .../google/android/gms/common/api/Status.java | 4 +- .../common/internal/GetServiceRequest.java | 4 +- .../android/gms/location/LocationRequest.java | 3 +- .../android/gms/location/LocationStatus.java | 6 +- .../location/places/AutocompleteFilter.java | 6 +- .../gms/location/places/UserAddedPlace.java | 6 +- .../places/internal/PlacesParams.java | 3 +- .../gms/maps/model/CameraPosition.java | 4 +- .../google/android/gms/maps/model/LatLng.java | 4 +- .../android/gms/maps/model/LatLngBounds.java | 4 +- .../google/android/gms/maps/model/Tile.java | 4 +- .../gms/maps/model/TileOverlayOptions.java | 4 +- .../gms/playlog/internal/LogEvent.java | 3 +- .../playlog/internal/PlayLoggerContext.java | 4 +- .../corpora/GetCorpusStatusRequest.java | 3 +- .../corpora/GetCorpusStatusResponse.java | 4 +- .../corpora/RequestIndexingRequest.java | 3 +- .../corpora/RequestIndexingResponse.java | 4 +- .../gms/search/queries/QueryResponse.java | 4 +- .../gms/wearable/AddListenerRequest.java | 45 +++++++++++ .../gms/wearable/ConnectionConfiguration.java | 51 ++++++++++++- .../gms/wearable/DeleteDataItemsResponse.java | 23 ++++++ .../gms/wearable/GetConfigResponse.java | 41 ++++++++++ .../gms/wearable/GetConfigsResponse.java | 41 ++++++++++ .../wearable/GetConnectedNodesResponse.java | 45 +++++++++++ .../gms/wearable/GetDataItemResponse.java | 43 +++++++++++ .../gms/wearable/GetFdForAssetResponse.java | 23 ++++++ .../gms/wearable/GetLocalNodeResponse.java | 43 +++++++++++ .../android/gms/wearable/PutDataRequest.java | 75 ++++++++++++++----- .../android/gms/wearable/PutDataResponse.java | 43 +++++++++++ .../gms/wearable/RemoveListenerRequest.java | 39 ++++++++++ .../gms/wearable/SendMessageResponse.java | 23 ++++++ .../gms/wearable/StorageInfoResponse.java | 23 ++++++ .../internal/DataItemAssetParcelable.java | 23 ++++++ .../wearable/internal/DataItemParcelable.java | 67 +++++++++++++++++ .../gms/wearable/internal/NodeParcelable.java | 4 +- 64 files changed, 774 insertions(+), 98 deletions(-) create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/common/api/Status.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/wearable/AddListenerRequest.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/wearable/ConnectionConfiguration.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/wearable/DeleteDataItemsResponse.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/wearable/GetConfigResponse.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/wearable/GetConfigsResponse.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/wearable/GetConnectedNodesResponse.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/wearable/GetDataItemResponse.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/wearable/GetFdForAssetResponse.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/wearable/GetLocalNodeResponse.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/wearable/PutDataRequest.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/wearable/PutDataResponse.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/wearable/RemoveListenerRequest.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/wearable/SendMessageResponse.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/wearable/StorageInfoResponse.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableCallbacks.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableListener.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableService.aidl create mode 100644 play-services-api/src/main/java/com/google/android/gms/wearable/AddListenerRequest.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/wearable/DeleteDataItemsResponse.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/wearable/GetConfigResponse.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/wearable/GetConfigsResponse.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/wearable/GetConnectedNodesResponse.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/wearable/GetDataItemResponse.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/wearable/GetFdForAssetResponse.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/wearable/GetLocalNodeResponse.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/wearable/PutDataResponse.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/wearable/RemoveListenerRequest.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/wearable/SendMessageResponse.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/wearable/StorageInfoResponse.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/wearable/internal/DataItemAssetParcelable.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/wearable/internal/DataItemParcelable.java diff --git a/extern/SafeParcel b/extern/SafeParcel index cfbcc9db..ef1568e2 160000 --- a/extern/SafeParcel +++ b/extern/SafeParcel @@ -1 +1 @@ -Subproject commit cfbcc9db09d98a2d32e996f5ff9fe587aa9f21f4 +Subproject commit ef1568e2614f29c3f13a6b6536989aba7f1a1b5d diff --git a/play-services-api/src/main/aidl/com/google/android/gms/common/api/Status.aidl b/play-services-api/src/main/aidl/com/google/android/gms/common/api/Status.aidl new file mode 100644 index 00000000..701f99a9 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/common/api/Status.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.common.api; + +parcelable Status; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/AddListenerRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/AddListenerRequest.aidl new file mode 100644 index 00000000..bb1726dd --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/wearable/AddListenerRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.wearable; + +parcelable AddListenerRequest; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/ConnectionConfiguration.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/ConnectionConfiguration.aidl new file mode 100644 index 00000000..973008ad --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/wearable/ConnectionConfiguration.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.wearable; + +parcelable ConnectionConfiguration; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/DeleteDataItemsResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/DeleteDataItemsResponse.aidl new file mode 100644 index 00000000..87691545 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/wearable/DeleteDataItemsResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.wearable; + +parcelable DeleteDataItemsResponse; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/GetConfigResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/GetConfigResponse.aidl new file mode 100644 index 00000000..611e1443 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/wearable/GetConfigResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.wearable; + +parcelable GetConfigResponse; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/GetConfigsResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/GetConfigsResponse.aidl new file mode 100644 index 00000000..21f56aab --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/wearable/GetConfigsResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.wearable; + +parcelable GetConfigsResponse; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/GetConnectedNodesResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/GetConnectedNodesResponse.aidl new file mode 100644 index 00000000..8068de2a --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/wearable/GetConnectedNodesResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.wearable; + +parcelable GetConnectedNodesResponse; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/GetDataItemResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/GetDataItemResponse.aidl new file mode 100644 index 00000000..1c22d749 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/wearable/GetDataItemResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.wearable; + +parcelable GetDataItemResponse; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/GetFdForAssetResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/GetFdForAssetResponse.aidl new file mode 100644 index 00000000..d12974ff --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/wearable/GetFdForAssetResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.wearable; + +parcelable GetFdForAssetResponse; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/GetLocalNodeResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/GetLocalNodeResponse.aidl new file mode 100644 index 00000000..da6b6ae3 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/wearable/GetLocalNodeResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.wearable; + +parcelable GetLocalNodeResponse; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/PutDataRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/PutDataRequest.aidl new file mode 100644 index 00000000..5714b4cf --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/wearable/PutDataRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.wearable; + +parcelable PutDataRequest; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/PutDataResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/PutDataResponse.aidl new file mode 100644 index 00000000..4f0723f5 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/wearable/PutDataResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.wearable; + +parcelable PutDataResponse; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/RemoveListenerRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/RemoveListenerRequest.aidl new file mode 100644 index 00000000..4e5f7d98 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/wearable/RemoveListenerRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.wearable; + +parcelable RemoveListenerRequest; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/SendMessageResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/SendMessageResponse.aidl new file mode 100644 index 00000000..296f5439 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/wearable/SendMessageResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.wearable; + +parcelable SendMessageResponse; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/StorageInfoResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/StorageInfoResponse.aidl new file mode 100644 index 00000000..66ce05ac --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/wearable/StorageInfoResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.wearable; + +parcelable StorageInfoResponse; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableCallbacks.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableCallbacks.aidl new file mode 100644 index 00000000..410fd09a --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableCallbacks.aidl @@ -0,0 +1,29 @@ +package com.google.android.gms.wearable.internal; + +import com.google.android.gms.common.api.Status; +import com.google.android.gms.common.data.DataHolder; +import com.google.android.gms.wearable.DeleteDataItemsResponse; +import com.google.android.gms.wearable.GetConfigResponse; +import com.google.android.gms.wearable.GetConfigsResponse; +import com.google.android.gms.wearable.GetConnectedNodesResponse; +import com.google.android.gms.wearable.GetDataItemResponse; +import com.google.android.gms.wearable.GetFdForAssetResponse; +import com.google.android.gms.wearable.GetLocalNodeResponse; +import com.google.android.gms.wearable.PutDataResponse; +import com.google.android.gms.wearable.SendMessageResponse; +import com.google.android.gms.wearable.StorageInfoResponse; + +interface IWearableCallbacks { + void onGetConfigResponse(in GetConfigResponse response) = 1; + void onPutDataResponse(in PutDataResponse response) = 2; + void onGetDataItemResponse(in GetDataItemResponse response) = 3; + void onDataHolder(in DataHolder dataHolder) = 4; + void onDeleteDataItemsResponse(in DeleteDataItemsResponse response) = 5; + void onSendMessageResponse(in SendMessageResponse response) = 6; + void onGetFdForAssetResponse(in GetFdForAssetResponse response) = 7; + void onGetLocalNodeResponse(in GetLocalNodeResponse response) = 8; + void onGetConnectedNodesResponse(in GetConnectedNodesResponse response) = 9; + void onStatus(in Status status) = 10; + void onStorageInfoResponse(in StorageInfoResponse response) = 11; + void onGetConfigsResponse(in GetConfigsResponse response) = 12; +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableListener.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableListener.aidl new file mode 100644 index 00000000..1c2eb92b --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableListener.aidl @@ -0,0 +1,5 @@ +package com.google.android.gms.wearable.internal; + +interface IWearableListener { + +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableService.aidl new file mode 100644 index 00000000..3bf532c0 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableService.aidl @@ -0,0 +1,23 @@ +package com.google.android.gms.wearable.internal; + +import com.google.android.gms.wearable.AddListenerRequest; +import com.google.android.gms.wearable.ConnectionConfiguration; +import com.google.android.gms.wearable.PutDataRequest; +import com.google.android.gms.wearable.RemoveListenerRequest; +import com.google.android.gms.wearable.internal.IWearableCallbacks; +import com.google.android.gms.wearable.internal.IWearableService; + +interface IWearableService { + void getConfig(IWearableCallbacks callbacks) = 2; + void putData(IWearableCallbacks callbacks, in PutDataRequest request) = 5; + void getDataItem(IWearableCallbacks callbacks, in Uri uri) = 6; + void getDataItems(IWearableCallbacks callbacks) = 7; + void getLocalNode(IWearableCallbacks callbacks) = 13; + void getConnectedNodes(IWearableCallbacks callbacks) = 14; + void addListener(IWearableCallbacks callbacks, in AddListenerRequest request) = 15; + void removeListener(IWearableCallbacks callbacks, in RemoveListenerRequest request) = 16; + void putConfig(IWearableCallbacks callbacks, in ConnectionConfiguration config) = 19; + void getConfigs(IWearableCallbacks callbacks) = 21; + void getDataItemsByUri(IWearableCallbacks callbacks, in Uri uri, int i) = 39; + void deleteDataItems(IWearableCallbacks callbacks, in Uri uri) = 40; +} diff --git a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/CorpusStatus.java b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/CorpusStatus.java index b90a3f59..59208421 100644 --- a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/CorpusStatus.java +++ b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/CorpusStatus.java @@ -24,7 +24,7 @@ import org.microg.safeparcel.SafeParceled; public class CorpusStatus extends AutoSafeParcelable { @SafeParceled(1000) - private int versionCode = 2; + private int versionCode; @SafeParceled(1) public boolean found; @SafeParceled(2) @@ -38,5 +38,9 @@ public class CorpusStatus extends AutoSafeParcelable { @SafeParceled(6) public String g; + public CorpusStatus() { + versionCode = 2; + } + public static final Creator CREATOR = new AutoCreator(CorpusStatus.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/PIMEUpdateResponse.java b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/PIMEUpdateResponse.java index 4d34120f..f82c8656 100644 --- a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/PIMEUpdateResponse.java +++ b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/PIMEUpdateResponse.java @@ -21,7 +21,7 @@ import org.microg.safeparcel.SafeParceled; public class PIMEUpdateResponse extends AutoSafeParcelable { @SafeParceled(1000) - private int versionCode = 1; + private int versionCode; @SafeParceled(1) private String b; @@ -33,6 +33,7 @@ public class PIMEUpdateResponse extends AutoSafeParcelable { public final PIMEUpdate[] updates; public PIMEUpdateResponse() { + versionCode = 1; this.bytes = null; this.updates = new PIMEUpdate[0]; } diff --git a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/QuerySpecification.java b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/QuerySpecification.java index 9a77eb06..b45e8744 100644 --- a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/QuerySpecification.java +++ b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/QuerySpecification.java @@ -24,7 +24,7 @@ import java.util.List; public class QuerySpecification extends AutoSafeParcelable { @SafeParceled(1000) - public final int versionCode; + private int versionCode = 2; @SafeParceled(1) public final boolean b; //@SafeParceled(value = 2, subType = "TODO") @@ -43,7 +43,6 @@ public class QuerySpecification extends AutoSafeParcelable { public final int i; private QuerySpecification() { - versionCode = 2; b = false; c = null; d = null; diff --git a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/SearchResults.java b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/SearchResults.java index 59c7244b..6f3619a9 100644 --- a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/SearchResults.java +++ b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/SearchResults.java @@ -21,7 +21,7 @@ import org.microg.safeparcel.SafeParceled; public class SearchResults extends AutoSafeParcelable { @SafeParceled(1000) - public final int versionCode = 2; + private int versionCode = 2; public static Creator CREATOR = new AutoCreator(SearchResults.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/SuggestSpecification.java b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/SuggestSpecification.java index d45addee..0c224091 100644 --- a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/SuggestSpecification.java +++ b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/SuggestSpecification.java @@ -21,7 +21,11 @@ import org.microg.safeparcel.SafeParceled; public class SuggestSpecification extends AutoSafeParcelable { @SafeParceled(1000) - private int versionCode = 2; + private int versionCode; + + public SuggestSpecification() { + versionCode = 2; + } public static final Creator CREATOR = new AutoCreator(SuggestSpecification.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/SuggestionResults.java b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/SuggestionResults.java index e6f9476b..8b51c8aa 100644 --- a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/SuggestionResults.java +++ b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/SuggestionResults.java @@ -21,7 +21,7 @@ import org.microg.safeparcel.SafeParceled; public class SuggestionResults extends AutoSafeParcelable { @SafeParceled(1000) - private int versionCode = 2; + private int versionCode; @SafeParceled(1) public final String errorMessage; @@ -31,17 +31,20 @@ public class SuggestionResults extends AutoSafeParcelable { public final String[] s2; private SuggestionResults() { + versionCode = 2; errorMessage = null; s1 = s2 = null; } public SuggestionResults(String errorMessage) { + versionCode = 2; this.errorMessage = errorMessage; this.s1 = null; this.s2 = null; } public SuggestionResults(String[] s1, String[] s2) { + versionCode = 2; this.errorMessage = null; this.s1 = s1; this.s2 = s2; diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEventsRequest.java b/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEventsRequest.java index 1ce15b38..323bd223 100644 --- a/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEventsRequest.java +++ b/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEventsRequest.java @@ -21,17 +21,12 @@ import org.microg.safeparcel.SafeParceled; public class AccountChangeEventsRequest extends AutoSafeParcelable { @SafeParceled(1) - private final int versionCode; + private int versionCode = 1; @SafeParceled(2) private int i; @SafeParceled(3) private String s; - - private AccountChangeEventsRequest() { - versionCode = 1; - } - public static Creator CREATOR = new AutoCreator(AccountChangeEventsRequest.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEventsResponse.java b/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEventsResponse.java index fa37e5c5..bc68a42c 100644 --- a/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEventsResponse.java +++ b/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEventsResponse.java @@ -24,12 +24,11 @@ import java.util.List; public class AccountChangeEventsResponse extends AutoSafeParcelable { @SafeParceled(1) - private final int versionCode; + private int versionCode = 1; @SafeParceled(value = 2, subType = "com.google.android.gms.auth.AccountChangeEvent") private List events; public AccountChangeEventsResponse() { - versionCode = 1; events = new ArrayList(); } diff --git a/play-services-api/src/main/java/com/google/android/gms/common/api/Scope.java b/play-services-api/src/main/java/com/google/android/gms/common/api/Scope.java index 2226936b..5334f1e5 100644 --- a/play-services-api/src/main/java/com/google/android/gms/common/api/Scope.java +++ b/play-services-api/src/main/java/com/google/android/gms/common/api/Scope.java @@ -11,12 +11,11 @@ import org.microg.safeparcel.SafeParceled; @PublicApi public class Scope extends AutoSafeParcelable { @SafeParceled(1) - private final int versionCode; + private int versionCode = 1; @SafeParceled(2) private final String scopeUri; private Scope() { - versionCode = -1; scopeUri = null; } @@ -24,7 +23,6 @@ public class Scope extends AutoSafeParcelable { * Creates a new scope with the given URI. */ public Scope(String scopeUri) { - versionCode = 1; this.scopeUri = scopeUri; } diff --git a/play-services-api/src/main/java/com/google/android/gms/common/api/Status.java b/play-services-api/src/main/java/com/google/android/gms/common/api/Status.java index 49b637a1..cb918f5b 100644 --- a/play-services-api/src/main/java/com/google/android/gms/common/api/Status.java +++ b/play-services-api/src/main/java/com/google/android/gms/common/api/Status.java @@ -19,13 +19,12 @@ public final class Status extends AutoSafeParcelable implements Result { public static final Status CANCELED = new Status(STATUS_CODE_CANCELED); public static final Status SUCCESS = new Status(0); - private final int versionCode; + private int versionCode = 1; private final int statusCode; private final String statusMessage; private final PendingIntent resolution; private Status() { - versionCode = 1; statusCode = 0; statusMessage = null; resolution = null; @@ -40,7 +39,6 @@ public final class Status extends AutoSafeParcelable implements Result { } public Status(int statusCode, String statusMessage, PendingIntent resolution) { - this.versionCode = 1; this.statusCode = statusCode; this.statusMessage = statusMessage; this.resolution = resolution; diff --git a/play-services-api/src/main/java/com/google/android/gms/common/internal/GetServiceRequest.java b/play-services-api/src/main/java/com/google/android/gms/common/internal/GetServiceRequest.java index 69641a16..80bbc234 100644 --- a/play-services-api/src/main/java/com/google/android/gms/common/internal/GetServiceRequest.java +++ b/play-services-api/src/main/java/com/google/android/gms/common/internal/GetServiceRequest.java @@ -31,7 +31,7 @@ import java.util.Arrays; public class GetServiceRequest extends AutoSafeParcelable { @SafeParceled(1) - private final int versionCode; + private int versionCode = 2; @SafeParceled(2) public final int serviceId; @@ -55,13 +55,11 @@ public class GetServiceRequest extends AutoSafeParcelable { public Account account; private GetServiceRequest() { - versionCode = 2; serviceId = -1; gmsVersion = Constants.MAX_REFERENCE_VERSION; } public GetServiceRequest(int serviceId) { - this.versionCode = 2; this.serviceId = serviceId; this.gmsVersion = Constants.MAX_REFERENCE_VERSION; } diff --git a/play-services-api/src/main/java/com/google/android/gms/location/LocationRequest.java b/play-services-api/src/main/java/com/google/android/gms/location/LocationRequest.java index 52253aad..b5249b3e 100644 --- a/play-services-api/src/main/java/com/google/android/gms/location/LocationRequest.java +++ b/play-services-api/src/main/java/com/google/android/gms/location/LocationRequest.java @@ -86,7 +86,7 @@ public class LocationRequest extends AutoSafeParcelable { public static final int PRIORITY_NO_POWER = 105; @SafeParceled(1000) - private final int versionCode; + private int versionCode = 1; @SafeParceled(1) private int priority; @SafeParceled(2) @@ -105,7 +105,6 @@ public class LocationRequest extends AutoSafeParcelable { private long maxWaitTime; public LocationRequest() { - this.versionCode = 1; this.priority = PRIORITY_BALANCED_POWER_ACCURACY; this.interval = 3600000; this.fastestInterval = 600000; diff --git a/play-services-api/src/main/java/com/google/android/gms/location/LocationStatus.java b/play-services-api/src/main/java/com/google/android/gms/location/LocationStatus.java index ad578503..7fcd9079 100644 --- a/play-services-api/src/main/java/com/google/android/gms/location/LocationStatus.java +++ b/play-services-api/src/main/java/com/google/android/gms/location/LocationStatus.java @@ -16,7 +16,7 @@ public class LocationStatus extends AutoSafeParcelable { public static final int STATUS_LOCATION_DISABLED_IN_SETTINGS = 7; public static final int STATUS_IN_PROGRESS = 8; @SafeParceled(1000) - private final int versionCode; + private int versionCode = 1; @SafeParceled(1) int cellStatus; @SafeParceled(2) @@ -24,10 +24,6 @@ public class LocationStatus extends AutoSafeParcelable { @SafeParceled(3) long elapsedRealtimeNanos; - private LocationStatus() { - versionCode = 1; - } - @Override public boolean equals(Object o) { if (this == o) diff --git a/play-services-api/src/main/java/com/google/android/gms/location/places/AutocompleteFilter.java b/play-services-api/src/main/java/com/google/android/gms/location/places/AutocompleteFilter.java index 8870ca74..a0d85e33 100644 --- a/play-services-api/src/main/java/com/google/android/gms/location/places/AutocompleteFilter.java +++ b/play-services-api/src/main/java/com/google/android/gms/location/places/AutocompleteFilter.java @@ -9,11 +9,7 @@ import org.microg.safeparcel.SafeParceled; public class AutocompleteFilter extends AutoSafeParcelable { @SafeParceled(1000) - private final int versionCode; - - private AutocompleteFilter() { - this.versionCode = 1; - } + private int versionCode = 1; public static final Creator CREATOR = new AutoCreator(AutocompleteFilter.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/location/places/UserAddedPlace.java b/play-services-api/src/main/java/com/google/android/gms/location/places/UserAddedPlace.java index eea28f6e..2b46a618 100644 --- a/play-services-api/src/main/java/com/google/android/gms/location/places/UserAddedPlace.java +++ b/play-services-api/src/main/java/com/google/android/gms/location/places/UserAddedPlace.java @@ -9,11 +9,7 @@ import org.microg.safeparcel.SafeParceled; public class UserAddedPlace extends AutoSafeParcelable { @SafeParceled(1000) - private final int versionCode; - - private UserAddedPlace() { - versionCode = 1; - } + private int versionCode = 1; public static final Creator CREATOR = new AutoCreator(UserAddedPlace.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/location/places/internal/PlacesParams.java b/play-services-api/src/main/java/com/google/android/gms/location/places/internal/PlacesParams.java index 74642be6..fce36072 100644 --- a/play-services-api/src/main/java/com/google/android/gms/location/places/internal/PlacesParams.java +++ b/play-services-api/src/main/java/com/google/android/gms/location/places/internal/PlacesParams.java @@ -6,7 +6,7 @@ import org.microg.safeparcel.SafeParceled; public class PlacesParams extends AutoSafeParcelable { @SafeParceled(1000) - private final int versionCode; + private int versionCode = 1; @SafeParceled(1) public final String clientPackageName; @SafeParceled(2) @@ -17,7 +17,6 @@ public class PlacesParams extends AutoSafeParcelable { public final String gCoreClientName; private PlacesParams() { - versionCode = 1; clientPackageName = locale = accountName = gCoreClientName = null; } diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/model/CameraPosition.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/CameraPosition.java index 717a7bdf..d2efd7e1 100644 --- a/play-services-api/src/main/java/com/google/android/gms/maps/model/CameraPosition.java +++ b/play-services-api/src/main/java/com/google/android/gms/maps/model/CameraPosition.java @@ -31,7 +31,7 @@ import java.util.Arrays; @PublicApi public final class CameraPosition extends AutoSafeParcelable { @SafeParceled(1) - private final int versionCode; + private int versionCode = 1; /** * The location that the camera is pointing at. */ @@ -61,7 +61,6 @@ public final class CameraPosition extends AutoSafeParcelable { */ private CameraPosition() { target = null; - versionCode = 1; zoom = tilt = bearing = 0; } @@ -81,7 +80,6 @@ public final class CameraPosition extends AutoSafeParcelable { */ public CameraPosition(LatLng target, float zoom, float tilt, float bearing) throws NullPointerException, IllegalArgumentException { - versionCode = 1; if (target == null) { throw new NullPointerException("null camera target"); } diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/model/LatLng.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/LatLng.java index ac434bca..8bd58e9d 100644 --- a/play-services-api/src/main/java/com/google/android/gms/maps/model/LatLng.java +++ b/play-services-api/src/main/java/com/google/android/gms/maps/model/LatLng.java @@ -26,7 +26,7 @@ import org.microg.safeparcel.SafeParceled; @PublicApi public final class LatLng extends AutoSafeParcelable { @SafeParceled(1) - private final int versionCode; + private int versionCode = 1; /** * Latitude, in degrees. This value is in the range [-90, 90]. */ @@ -43,7 +43,6 @@ public final class LatLng extends AutoSafeParcelable { * In fact, those are replaced by their real values later using SafeParcelUtil. */ private LatLng() { - versionCode = 1; latitude = longitude = 0; } @@ -56,7 +55,6 @@ public final class LatLng extends AutoSafeParcelable { * inclusive and +180 degrees exclusive. */ public LatLng(double latitude, double longitude) { - this.versionCode = 1; this.latitude = Math.max(-90, Math.min(90, latitude)); if ((-180 <= longitude) && (longitude < 180)) { this.longitude = longitude; diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/model/LatLngBounds.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/LatLngBounds.java index 371505f4..648ccf7b 100644 --- a/play-services-api/src/main/java/com/google/android/gms/maps/model/LatLngBounds.java +++ b/play-services-api/src/main/java/com/google/android/gms/maps/model/LatLngBounds.java @@ -28,7 +28,7 @@ import java.util.Arrays; @PublicApi public final class LatLngBounds extends AutoSafeParcelable { @SafeParceled(1) - private final int versionCode; + private int versionCode = 1; /** * Southwest corner of the bound. */ @@ -45,7 +45,6 @@ public final class LatLngBounds extends AutoSafeParcelable { * In fact, those are replaced by their real values later using SafeParcelUtil. */ private LatLngBounds() { - this.versionCode = 1; southwest = northeast = null; } @@ -70,7 +69,6 @@ public final class LatLngBounds extends AutoSafeParcelable { if (northeast.latitude < southwest.latitude) throw new IllegalArgumentException("latitude of northeast corner must not be" + " lower than latitude of southwest corner"); - this.versionCode = 1; this.southwest = southwest; this.northeast = northeast; } diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/model/Tile.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/Tile.java index aa3b5013..5063bcdf 100644 --- a/play-services-api/src/main/java/com/google/android/gms/maps/model/Tile.java +++ b/play-services-api/src/main/java/com/google/android/gms/maps/model/Tile.java @@ -11,7 +11,7 @@ import org.microg.safeparcel.SafeParceled; @PublicApi public class Tile extends AutoSafeParcelable { @SafeParceled(1) - private final int versionCode; + private int versionCode = 1; /** * The width of the image encoded by {@link #data} in pixels. */ @@ -30,7 +30,6 @@ public class Tile extends AutoSafeParcelable { public final byte[] data; private Tile() { - versionCode = 1; width = height = 0; data = null; } @@ -45,7 +44,6 @@ public class Tile extends AutoSafeParcelable { * {@link android.graphics.BitmapFactory#decodeByteArray(byte[], int, int)}. */ public Tile(int width, int height, byte[] data) { - this.versionCode = 1; this.width = width; this.height = height; this.data = data; diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/model/TileOverlayOptions.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/TileOverlayOptions.java index 68fdaade..70c967ec 100644 --- a/play-services-api/src/main/java/com/google/android/gms/maps/model/TileOverlayOptions.java +++ b/play-services-api/src/main/java/com/google/android/gms/maps/model/TileOverlayOptions.java @@ -18,6 +18,7 @@ package com.google.android.gms.maps.model; import android.os.IBinder; import android.os.RemoteException; + import com.google.android.gms.maps.model.internal.ITileProviderDelegate; import org.microg.gms.common.PublicApi; @@ -31,7 +32,7 @@ import org.microg.safeparcel.SafeParceled; public class TileOverlayOptions extends AutoSafeParcelable { @SafeParceled(1) - private final int versionCode; + private int versionCode = 1; /** * This is a IBinder to the {@link #tileProvider}, built using {@link ITileProviderDelegate}. */ @@ -49,7 +50,6 @@ public class TileOverlayOptions extends AutoSafeParcelable { * Creates a new set of tile overlay options. */ public TileOverlayOptions() { - versionCode = 1; } /** diff --git a/play-services-api/src/main/java/com/google/android/gms/playlog/internal/LogEvent.java b/play-services-api/src/main/java/com/google/android/gms/playlog/internal/LogEvent.java index 3dc6b6ee..96758caf 100644 --- a/play-services-api/src/main/java/com/google/android/gms/playlog/internal/LogEvent.java +++ b/play-services-api/src/main/java/com/google/android/gms/playlog/internal/LogEvent.java @@ -24,7 +24,7 @@ import java.util.Date; public class LogEvent extends AutoSafeParcelable { @SafeParceled(1) - public final int versionCode; + private int versionCode = 1; @SafeParceled(2) public final long eventTime; @@ -36,7 +36,6 @@ public class LogEvent extends AutoSafeParcelable { public final byte[] data; private LogEvent() { - versionCode = 1; eventTime = -1; tag = null; data = null; diff --git a/play-services-api/src/main/java/com/google/android/gms/playlog/internal/PlayLoggerContext.java b/play-services-api/src/main/java/com/google/android/gms/playlog/internal/PlayLoggerContext.java index f35bf750..f524b62c 100644 --- a/play-services-api/src/main/java/com/google/android/gms/playlog/internal/PlayLoggerContext.java +++ b/play-services-api/src/main/java/com/google/android/gms/playlog/internal/PlayLoggerContext.java @@ -22,7 +22,7 @@ import org.microg.safeparcel.SafeParceled; public class PlayLoggerContext extends AutoSafeParcelable { @SafeParceled(1) - public final int versionCode; + private int versionCode = 1; @SafeParceled(2) public final String packageName; @@ -43,14 +43,12 @@ public class PlayLoggerContext extends AutoSafeParcelable { public final String logSourceName; private PlayLoggerContext() { - this.versionCode = 1; packageName = uploadAccount = logSourceName = null; logSource = loggingId = -1; logAndroidId = false; } public PlayLoggerContext(String packageName, int logSource, String uploadAccount, int loggingId, String logSourceName) { - this.versionCode = 1; this.packageName = packageName; this.logSource = logSource; this.uploadAccount = uploadAccount; diff --git a/play-services-api/src/main/java/com/google/android/gms/search/corpora/GetCorpusStatusRequest.java b/play-services-api/src/main/java/com/google/android/gms/search/corpora/GetCorpusStatusRequest.java index 9ccfc30a..d1a93896 100644 --- a/play-services-api/src/main/java/com/google/android/gms/search/corpora/GetCorpusStatusRequest.java +++ b/play-services-api/src/main/java/com/google/android/gms/search/corpora/GetCorpusStatusRequest.java @@ -22,7 +22,7 @@ import org.microg.safeparcel.SafeParceled; public class GetCorpusStatusRequest extends AutoSafeParcelable { @SafeParceled(1000) - public final int versionCode; + private int versionCode = 1; @SafeParceled(1) public final String packageName; @@ -31,7 +31,6 @@ public class GetCorpusStatusRequest extends AutoSafeParcelable { public final String corpus; private GetCorpusStatusRequest() { - versionCode = 1; packageName = null; corpus = null; } diff --git a/play-services-api/src/main/java/com/google/android/gms/search/corpora/GetCorpusStatusResponse.java b/play-services-api/src/main/java/com/google/android/gms/search/corpora/GetCorpusStatusResponse.java index 79f2846a..bbccbec9 100644 --- a/play-services-api/src/main/java/com/google/android/gms/search/corpora/GetCorpusStatusResponse.java +++ b/play-services-api/src/main/java/com/google/android/gms/search/corpora/GetCorpusStatusResponse.java @@ -25,7 +25,7 @@ import org.microg.safeparcel.SafeParceled; public class GetCorpusStatusResponse extends AutoSafeParcelable { @SafeParceled(1000) - public final int versionCode; + private int versionCode; @SafeParceled(1) public final Status status; @@ -34,13 +34,11 @@ public class GetCorpusStatusResponse extends AutoSafeParcelable { public final CorpusStatus corpusStatus; private GetCorpusStatusResponse() { - versionCode = 1; status = null; corpusStatus = null; } public GetCorpusStatusResponse(Status status, CorpusStatus corpusStatus) { - this.versionCode = 1; this.status = status; this.corpusStatus = corpusStatus; } diff --git a/play-services-api/src/main/java/com/google/android/gms/search/corpora/RequestIndexingRequest.java b/play-services-api/src/main/java/com/google/android/gms/search/corpora/RequestIndexingRequest.java index 5cec94b3..b0f2b460 100644 --- a/play-services-api/src/main/java/com/google/android/gms/search/corpora/RequestIndexingRequest.java +++ b/play-services-api/src/main/java/com/google/android/gms/search/corpora/RequestIndexingRequest.java @@ -22,7 +22,7 @@ import org.microg.safeparcel.SafeParceled; public class RequestIndexingRequest extends AutoSafeParcelable { @SafeParceled(1000) - public final int versionCode; + private int versionCode = 1; @SafeParceled(1) public final String packageName; @@ -34,7 +34,6 @@ public class RequestIndexingRequest extends AutoSafeParcelable { public final long sequenceNumber; private RequestIndexingRequest() { - versionCode = 1; packageName = null; corpus = null; sequenceNumber = 0; diff --git a/play-services-api/src/main/java/com/google/android/gms/search/corpora/RequestIndexingResponse.java b/play-services-api/src/main/java/com/google/android/gms/search/corpora/RequestIndexingResponse.java index 024db887..7490f988 100644 --- a/play-services-api/src/main/java/com/google/android/gms/search/corpora/RequestIndexingResponse.java +++ b/play-services-api/src/main/java/com/google/android/gms/search/corpora/RequestIndexingResponse.java @@ -24,7 +24,7 @@ import org.microg.safeparcel.SafeParceled; public class RequestIndexingResponse extends AutoSafeParcelable { @SafeParceled(1000) - public final int versionCode; + private int versionCode; @SafeParceled(1) public final Status status; @@ -33,13 +33,11 @@ public class RequestIndexingResponse extends AutoSafeParcelable { public final boolean scheduledIndexing; private RequestIndexingResponse() { - versionCode = 1; status = null; scheduledIndexing = false; } public RequestIndexingResponse(Status status, boolean scheduledIndexing) { - this.versionCode = 1; this.status = status; this.scheduledIndexing = scheduledIndexing; } diff --git a/play-services-api/src/main/java/com/google/android/gms/search/queries/QueryResponse.java b/play-services-api/src/main/java/com/google/android/gms/search/queries/QueryResponse.java index a58a7be6..e97779f1 100644 --- a/play-services-api/src/main/java/com/google/android/gms/search/queries/QueryResponse.java +++ b/play-services-api/src/main/java/com/google/android/gms/search/queries/QueryResponse.java @@ -25,7 +25,7 @@ import org.microg.safeparcel.SafeParceled; public class QueryResponse extends AutoSafeParcelable { @SafeParceled(1000) - public final int versionCode; + private int versionCode = 1; @SafeParceled(1) public final Status status; @@ -34,13 +34,11 @@ public class QueryResponse extends AutoSafeParcelable { public final SearchResults results; private QueryResponse() { - versionCode = 1; status = null; results = null; } public QueryResponse(Status status, SearchResults results) { - this.versionCode = 1; this.status = status; this.results = results; } diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/AddListenerRequest.java b/play-services-api/src/main/java/com/google/android/gms/wearable/AddListenerRequest.java new file mode 100644 index 00000000..3de65208 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/AddListenerRequest.java @@ -0,0 +1,45 @@ +/* + * Copyright 2013-2015 µg 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; + +import android.content.IntentFilter; + +import com.google.android.gms.wearable.internal.IWearableListener; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class AddListenerRequest extends AutoSafeParcelable { + @SafeParceled(1) + private int versionCode = 1; + @SafeParceled(2) + public final IWearableListener listener; + @SafeParceled(3) + public final IntentFilter[] intentFilters; + + private AddListenerRequest() { + listener = null; + intentFilters = null; + } + + public AddListenerRequest(IWearableListener listener, IntentFilter[] intentFilters) { + this.listener = listener; + this.intentFilters = intentFilters; + } + + public static final Creator CREATOR = new AutoCreator(AddListenerRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/ConnectionConfiguration.java b/play-services-api/src/main/java/com/google/android/gms/wearable/ConnectionConfiguration.java index 1539f85d..aebd7d49 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wearable/ConnectionConfiguration.java +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/ConnectionConfiguration.java @@ -1,4 +1,53 @@ package com.google.android.gms.wearable; -public class ConnectionConfiguration { +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class ConnectionConfiguration extends AutoSafeParcelable { + + @SafeParceled(1) + private int versionCode = 1; + @SafeParceled(2) + public final String name; + @SafeParceled(3) + public final String address; + @SafeParceled(4) + public final int type; + @SafeParceled(5) + public final int role; + @SafeParceled(6) + public final boolean enabled; + @SafeParceled(7) + public boolean connected = false; + @SafeParceled(8) + public String peerNodeId; + @SafeParceled(9) + public boolean btlePriority = true; + @SafeParceled(10) + public String nodeId; + + private ConnectionConfiguration() { + name = address = null; + type = role = 0; + enabled = false; + } + + public ConnectionConfiguration(String name, String address, int type, int role, boolean enabled) { + this.name = name; + this.address = address; + this.type = type; + this.role = role; + this.enabled = enabled; + } + + public ConnectionConfiguration(String name, String address, int type, int role, boolean enabled, String nodeId) { + this.name = name; + this.address = address; + this.type = type; + this.role = role; + this.enabled = enabled; + this.nodeId = nodeId; + } + + public static final Creator CREATOR = new AutoCreator(ConnectionConfiguration.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/DeleteDataItemsResponse.java b/play-services-api/src/main/java/com/google/android/gms/wearable/DeleteDataItemsResponse.java new file mode 100644 index 00000000..de727a00 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/DeleteDataItemsResponse.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 µg 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; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class DeleteDataItemsResponse extends AutoSafeParcelable { + public static final Creator CREATOR = new AutoCreator(DeleteDataItemsResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/GetConfigResponse.java b/play-services-api/src/main/java/com/google/android/gms/wearable/GetConfigResponse.java new file mode 100644 index 00000000..a1435257 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/GetConfigResponse.java @@ -0,0 +1,41 @@ +/* + * Copyright 2013-2015 µg 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; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class GetConfigResponse extends AutoSafeParcelable { + @SafeParceled(1) + private int versionCode = 1; + @SafeParceled(2) + public final int statusCode; + @SafeParceled(3) + public final ConnectionConfiguration connectionConfiguration; + + private GetConfigResponse() { + statusCode = 0; + connectionConfiguration = null; + } + + public GetConfigResponse(int statusCode, ConnectionConfiguration connectionConfiguration) { + this.statusCode = statusCode; + this.connectionConfiguration = connectionConfiguration; + } + + public static final Creator CREATOR = new AutoCreator(GetConfigResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/GetConfigsResponse.java b/play-services-api/src/main/java/com/google/android/gms/wearable/GetConfigsResponse.java new file mode 100644 index 00000000..256aebdd --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/GetConfigsResponse.java @@ -0,0 +1,41 @@ +/* + * Copyright 2013-2015 µg 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; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class GetConfigsResponse extends AutoSafeParcelable { + @SafeParceled(1) + private int versionCode = 1; + @SafeParceled(2) + public final int statusCode; + @SafeParceled(3) + public final ConnectionConfiguration[] configurations; + + private GetConfigsResponse() { + statusCode = 0; + configurations = null; + } + + public GetConfigsResponse(int statusCode, ConnectionConfiguration[] configurations) { + this.statusCode = statusCode; + this.configurations = configurations; + } + + public static final Creator CREATOR = new AutoCreator(GetConfigsResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/GetConnectedNodesResponse.java b/play-services-api/src/main/java/com/google/android/gms/wearable/GetConnectedNodesResponse.java new file mode 100644 index 00000000..625b25ad --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/GetConnectedNodesResponse.java @@ -0,0 +1,45 @@ +/* + * Copyright 2013-2015 µg 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; + +import com.google.android.gms.wearable.internal.NodeParcelable; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +import java.util.List; + +public class GetConnectedNodesResponse extends AutoSafeParcelable { + @SafeParceled(1) + private int versionCode = 1; + @SafeParceled(2) + public final int statusCode; + @SafeParceled(3) + public final List nodes; + + private GetConnectedNodesResponse() { + statusCode = 0; + nodes = null; + } + + public GetConnectedNodesResponse(int statusCode, List nodes) { + this.statusCode = statusCode; + this.nodes = nodes; + } + + public static final Creator CREATOR = new AutoCreator(GetConnectedNodesResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/GetDataItemResponse.java b/play-services-api/src/main/java/com/google/android/gms/wearable/GetDataItemResponse.java new file mode 100644 index 00000000..a1ae10d6 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/GetDataItemResponse.java @@ -0,0 +1,43 @@ +/* + * Copyright 2013-2015 µg 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; + +import com.google.android.gms.wearable.internal.DataItemParcelable; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class GetDataItemResponse extends AutoSafeParcelable { + @SafeParceled(1) + private int versionCode = 1; + @SafeParceled(2) + public final int statusCode; + @SafeParceled(3) + public final DataItemParcelable dataItem; + + private GetDataItemResponse() { + statusCode = 0; + dataItem = null; + } + + public GetDataItemResponse(int statusCode, DataItemParcelable dataItem) { + this.statusCode = statusCode; + this.dataItem = dataItem; + } + + public static final Creator CREATOR = new AutoCreator(GetDataItemResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/GetFdForAssetResponse.java b/play-services-api/src/main/java/com/google/android/gms/wearable/GetFdForAssetResponse.java new file mode 100644 index 00000000..4f83e64c --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/GetFdForAssetResponse.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 µg 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; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class GetFdForAssetResponse extends AutoSafeParcelable { + public static final Creator CREATOR = new AutoCreator(GetFdForAssetResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/GetLocalNodeResponse.java b/play-services-api/src/main/java/com/google/android/gms/wearable/GetLocalNodeResponse.java new file mode 100644 index 00000000..b99bb6b7 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/GetLocalNodeResponse.java @@ -0,0 +1,43 @@ +/* + * Copyright 2013-2015 µg 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; + +import com.google.android.gms.wearable.internal.NodeParcelable; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class GetLocalNodeResponse extends AutoSafeParcelable { + @SafeParceled(1) + private int versionCode = 1; + @SafeParceled(2) + public final int statusCode; + @SafeParceled(3) + public final NodeParcelable node; + + private GetLocalNodeResponse() { + statusCode = 0; + node = null; + } + + public GetLocalNodeResponse(int statusCode, NodeParcelable node) { + this.statusCode = statusCode; + this.node = node; + } + + public static final Creator CREATOR = new AutoCreator(GetLocalNodeResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/PutDataRequest.java b/play-services-api/src/main/java/com/google/android/gms/wearable/PutDataRequest.java index 8b8503d9..1df9edf0 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wearable/PutDataRequest.java +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/PutDataRequest.java @@ -17,11 +17,17 @@ package com.google.android.gms.wearable; import android.net.Uri; +import android.os.Bundle; +import android.text.TextUtils; +import android.util.Base64; + +import com.google.android.gms.wearable.internal.DataItemAssetParcelable; import org.microg.gms.common.PublicApi; import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; -import java.util.Collections; +import java.util.HashMap; import java.util.Map; /** @@ -31,19 +37,46 @@ import java.util.Map; public class PutDataRequest extends AutoSafeParcelable { public static final String WEAR_URI_SCHEME = "wear"; - private DataItem dataItem; + @SafeParceled(1) + private int versionCode = 1; + @SafeParceled(2) + final Uri uri; + @SafeParceled(4) + private final Bundle assets; + @SafeParceled(5) + byte[] data; - private PutDataRequest(DataItem dataItem) { - this.dataItem = dataItem; + private PutDataRequest() { + uri = null; + assets = new Bundle(); + } + + private PutDataRequest(Uri uri) { + this.uri = uri; + assets = new Bundle(); + } + + public static PutDataRequest create(Uri uri) { + return new PutDataRequest(uri); } public static PutDataRequest create(String path) { - // TODO - return new PutDataRequest(null); + if (TextUtils.isEmpty(path)) { + throw new IllegalArgumentException("An empty path was supplied."); + } else if (!path.startsWith("/")) { + throw new IllegalArgumentException("A path must start with a single / ."); + } else if (path.startsWith("//")) { + throw new IllegalArgumentException("A path must start with a single / ."); + } else { + return create((new Uri.Builder()).scheme(WEAR_URI_SCHEME).path(path).build()); + } } public static PutDataRequest createFromDataItem(DataItem source) { - return new PutDataRequest(source); + PutDataRequest dataRequest = new PutDataRequest(source.getUri()); + dataRequest.data = source.getData(); + // TODO: assets + return dataRequest; } public static PutDataRequest createWithAutoAppendedId(String pathPrefix) { @@ -51,39 +84,42 @@ public class PutDataRequest extends AutoSafeParcelable { } public Asset getAsset(String key) { - // TODO - return null; + return assets.getParcelable(key); } public Map getAssets() { - // TODO - return Collections.emptyMap(); + Map map = new HashMap(); + assets.setClassLoader(DataItemAssetParcelable.class.getClassLoader()); + for (String key : assets.keySet()) { + map.put(key, (Asset) assets.getParcelable(key)); + } + return map; } public byte[] getData() { - return dataItem.getData(); + return data; } public Uri getUri() { - return dataItem.getUri(); + return uri; } public boolean hasAsset(String key) { - return dataItem.getAssets().containsKey(key); + return assets.containsKey(key); } public PutDataRequest putAsset(String key, Asset value) { - // TODO + assets.putParcelable(key, value); return this; } public PutDataRequest removeAsset(String key) { - // TODO + assets.remove(key); return this; } public PutDataRequest setData(byte[] data) { - // TODO + this.data = data; return this; } @@ -93,7 +129,10 @@ public class PutDataRequest extends AutoSafeParcelable { } public String toString(boolean verbose) { - return "PutDataRequest{data=" + dataItem + "}"; + return "PutDataRequest[data=" + (data == null ? "null" : Base64.encodeToString(data, Base64.NO_WRAP)) + + ", numAssets=" + getAssets().size() + + ", uri=" + uri + "]"; + // TODO: Verbose: dump all assets } public static final Creator CREATOR = new AutoCreator(PutDataRequest.class); diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/PutDataResponse.java b/play-services-api/src/main/java/com/google/android/gms/wearable/PutDataResponse.java new file mode 100644 index 00000000..f44f4319 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/PutDataResponse.java @@ -0,0 +1,43 @@ +/* + * Copyright 2013-2015 µg 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; + +import com.google.android.gms.wearable.internal.DataItemParcelable; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class PutDataResponse extends AutoSafeParcelable { + @SafeParceled(1) + private int versionCode = 1; + @SafeParceled(2) + public final int statusCode; + @SafeParceled(3) + public final DataItemParcelable dataItem; + + private PutDataResponse() { + statusCode = 0; + dataItem = null; + } + + public PutDataResponse(int statusCode, DataItemParcelable dataItem) { + this.statusCode = statusCode; + this.dataItem = dataItem; + } + + public static final Creator CREATOR = new AutoCreator(PutDataResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/RemoveListenerRequest.java b/play-services-api/src/main/java/com/google/android/gms/wearable/RemoveListenerRequest.java new file mode 100644 index 00000000..6edc53f0 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/RemoveListenerRequest.java @@ -0,0 +1,39 @@ +/* + * Copyright 2013-2015 µg 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; + +import com.google.android.gms.wearable.internal.IWearableListener; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class RemoveListenerRequest extends AutoSafeParcelable { + @SafeParceled(1) + private int versionCode = 1; + @SafeParceled(2) + public final IWearableListener listener; + + private RemoveListenerRequest() { + listener = null; + } + + public RemoveListenerRequest(IWearableListener listener) { + this.listener = listener; + } + + public static final Creator CREATOR = new AutoCreator(RemoveListenerRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/SendMessageResponse.java b/play-services-api/src/main/java/com/google/android/gms/wearable/SendMessageResponse.java new file mode 100644 index 00000000..570ab0ef --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/SendMessageResponse.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 µg 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; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class SendMessageResponse extends AutoSafeParcelable { + public static final Creator CREATOR = new AutoCreator(SendMessageResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/StorageInfoResponse.java b/play-services-api/src/main/java/com/google/android/gms/wearable/StorageInfoResponse.java new file mode 100644 index 00000000..42307d72 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/StorageInfoResponse.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 µg 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; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class StorageInfoResponse extends AutoSafeParcelable { + public static final Creator CREATOR = new AutoCreator(StorageInfoResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/DataItemAssetParcelable.java b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/DataItemAssetParcelable.java new file mode 100644 index 00000000..f124a627 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/DataItemAssetParcelable.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 µg 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.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class DataItemAssetParcelable extends AutoSafeParcelable { + public static final Creator CREATOR = new AutoCreator(DataItemAssetParcelable.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/DataItemParcelable.java b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/DataItemParcelable.java new file mode 100644 index 00000000..f7c880e1 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/DataItemParcelable.java @@ -0,0 +1,67 @@ +/* + * Copyright 2013-2015 µg 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.internal; + +import android.net.Uri; +import android.os.Bundle; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +import java.util.HashMap; +import java.util.Map; + +public class DataItemParcelable extends AutoSafeParcelable { + @SafeParceled(1) + private int versionCode = 1; + @SafeParceled(2) + public final Uri uri; + @SafeParceled(4) + private final Bundle assets; + @SafeParceled(5) + public byte[] data; + + private DataItemParcelable() { + uri = null; + assets = new Bundle(); + data = null; + } + + public DataItemParcelable(Uri uri) { + this(uri, new HashMap()); + } + + public DataItemParcelable(Uri uri, Map assets) { + this.uri = uri; + this.assets = new Bundle(); + for (String key : assets.keySet()) { + this.assets.putParcelable(key, assets.get(key)); + } + data = null; + } + + public Map getAssets() { + Map assets = new HashMap(); + this.assets.setClassLoader(DataItemAssetParcelable.class.getClassLoader()); + for (String key : this.assets.keySet()) { + assets.put(key, (DataItemAssetParcelable) this.assets.getParcelable(key)); + } + return assets; + } + + public static final Creator CREATOR = new AutoCreator(DataItemParcelable.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/NodeParcelable.java b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/NodeParcelable.java index 6bdbce7f..6d9e071d 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/NodeParcelable.java +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/NodeParcelable.java @@ -26,19 +26,17 @@ import org.microg.safeparcel.SafeParceled; */ public class NodeParcelable extends AutoSafeParcelable implements Node { @SafeParceled(1) - private final int versionCode; + private int versionCode = 1; @SafeParceled(2) private final String id; @SafeParceled(3) private final String displayName; private NodeParcelable() { - versionCode = 1; id = displayName = null; } public NodeParcelable(String id, String displayName) { - versionCode = 1; this.id = id; this.displayName = displayName; } From 0890bf454651e90274949af9dca09fbcfbf50d36 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Tue, 4 Aug 2015 13:02:08 +0200 Subject: [PATCH 086/293] Extend wearable APIs, update Maps API --- .../gms/maps/internal/IMapViewDelegate.aidl | 2 + .../maps/internal/IOnMapReadyCallback.aidl | 7 ++ .../gms/wearable/AddListenerRequest.aidl | 3 - .../gms/wearable/DeleteDataItemsResponse.aidl | 3 - .../gms/wearable/GetConfigResponse.aidl | 3 - .../gms/wearable/GetConfigsResponse.aidl | 3 - .../wearable/GetConnectedNodesResponse.aidl | 3 - .../gms/wearable/GetDataItemResponse.aidl | 3 - .../gms/wearable/GetFdForAssetResponse.aidl | 3 - .../gms/wearable/GetLocalNodeResponse.aidl | 3 - .../android/gms/wearable/PutDataRequest.aidl | 3 - .../android/gms/wearable/PutDataResponse.aidl | 3 - .../gms/wearable/RemoveListenerRequest.aidl | 3 - .../gms/wearable/SendMessageResponse.aidl | 3 - .../gms/wearable/StorageInfoResponse.aidl | 3 - .../wearable/internal/AddListenerRequest.aidl | 3 + .../internal/CapabilityInfoParcelable.aidl | 3 + .../internal/ChannelEventParcelable.aidl | 3 + .../internal/DeleteDataItemsResponse.aidl | 3 + .../wearable/internal/GetConfigResponse.aidl | 3 + .../wearable/internal/GetConfigsResponse.aidl | 3 + .../internal/GetConnectedNodesResponse.aidl | 3 + .../internal/GetDataItemResponse.aidl | 3 + .../internal/GetFdForAssetResponse.aidl | 3 + .../internal/GetLocalNodeResponse.aidl | 3 + .../wearable/internal/IWearableCallbacks.aidl | 20 ++--- .../wearable/internal/IWearableListener.aidl | 15 +++- .../wearable/internal/IWearableService.aidl | 8 +- .../internal/MessageEventParcelable.aidl | 3 + .../gms/wearable/internal/NodeParcelable.aidl | 3 + .../gms/wearable/internal/PutDataRequest.aidl | 3 + .../wearable/internal/PutDataResponse.aidl | 3 + .../internal/RemoveListenerRequest.aidl | 3 + .../internal/SendMessageResponse.aidl | 3 + .../internal/StorageInfoResponse.aidl | 3 + .../google/android/gms/wearable/Asset.java | 75 +++++++++++++++++-- .../{ => internal}/AddListenerRequest.java | 4 +- .../internal/CapabilityInfoParcelable.java | 23 ++++++ .../ChannelEventParcelable.java} | 6 +- .../internal/DataItemAssetParcelable.java | 43 ++++++++++- .../wearable/internal/DataItemParcelable.java | 12 +-- .../internal/DeleteDataItemsResponse.java | 40 ++++++++++ .../{ => internal}/GetConfigResponse.java | 4 +- .../{ => internal}/GetConfigsResponse.java | 4 +- .../GetConnectedNodesResponse.java | 4 +- .../{ => internal}/GetDataItemResponse.java | 4 +- .../{ => internal}/GetFdForAssetResponse.java | 2 +- .../{ => internal}/GetLocalNodeResponse.java | 4 +- .../internal/MessageEventParcelable.java | 23 ++++++ .../{ => internal}/PutDataRequest.java | 11 +-- .../{ => internal}/PutDataResponse.java | 4 +- .../{ => internal}/RemoveListenerRequest.java | 4 +- .../{ => internal}/SendMessageResponse.java | 2 +- .../{ => internal}/StorageInfoResponse.java | 2 +- .../java/org/microg/gms/common/Constants.java | 2 +- 55 files changed, 317 insertions(+), 98 deletions(-) create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnMapReadyCallback.aidl delete mode 100644 play-services-api/src/main/aidl/com/google/android/gms/wearable/AddListenerRequest.aidl delete mode 100644 play-services-api/src/main/aidl/com/google/android/gms/wearable/DeleteDataItemsResponse.aidl delete mode 100644 play-services-api/src/main/aidl/com/google/android/gms/wearable/GetConfigResponse.aidl delete mode 100644 play-services-api/src/main/aidl/com/google/android/gms/wearable/GetConfigsResponse.aidl delete mode 100644 play-services-api/src/main/aidl/com/google/android/gms/wearable/GetConnectedNodesResponse.aidl delete mode 100644 play-services-api/src/main/aidl/com/google/android/gms/wearable/GetDataItemResponse.aidl delete mode 100644 play-services-api/src/main/aidl/com/google/android/gms/wearable/GetFdForAssetResponse.aidl delete mode 100644 play-services-api/src/main/aidl/com/google/android/gms/wearable/GetLocalNodeResponse.aidl delete mode 100644 play-services-api/src/main/aidl/com/google/android/gms/wearable/PutDataRequest.aidl delete mode 100644 play-services-api/src/main/aidl/com/google/android/gms/wearable/PutDataResponse.aidl delete mode 100644 play-services-api/src/main/aidl/com/google/android/gms/wearable/RemoveListenerRequest.aidl delete mode 100644 play-services-api/src/main/aidl/com/google/android/gms/wearable/SendMessageResponse.aidl delete mode 100644 play-services-api/src/main/aidl/com/google/android/gms/wearable/StorageInfoResponse.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/AddListenerRequest.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/CapabilityInfoParcelable.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/ChannelEventParcelable.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/DeleteDataItemsResponse.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/GetConfigResponse.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/GetConfigsResponse.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/GetConnectedNodesResponse.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/GetDataItemResponse.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/GetFdForAssetResponse.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/GetLocalNodeResponse.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/MessageEventParcelable.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/NodeParcelable.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/PutDataRequest.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/PutDataResponse.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/RemoveListenerRequest.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/SendMessageResponse.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/StorageInfoResponse.aidl rename play-services-api/src/main/java/com/google/android/gms/wearable/{ => internal}/AddListenerRequest.java (92%) create mode 100644 play-services-api/src/main/java/com/google/android/gms/wearable/internal/CapabilityInfoParcelable.java rename play-services-api/src/main/java/com/google/android/gms/wearable/{DeleteDataItemsResponse.java => internal/ChannelEventParcelable.java} (72%) create mode 100644 play-services-api/src/main/java/com/google/android/gms/wearable/internal/DeleteDataItemsResponse.java rename play-services-api/src/main/java/com/google/android/gms/wearable/{ => internal}/GetConfigResponse.java (92%) rename play-services-api/src/main/java/com/google/android/gms/wearable/{ => internal}/GetConfigsResponse.java (92%) rename play-services-api/src/main/java/com/google/android/gms/wearable/{ => internal}/GetConnectedNodesResponse.java (92%) rename play-services-api/src/main/java/com/google/android/gms/wearable/{ => internal}/GetDataItemResponse.java (92%) rename play-services-api/src/main/java/com/google/android/gms/wearable/{ => internal}/GetFdForAssetResponse.java (94%) rename play-services-api/src/main/java/com/google/android/gms/wearable/{ => internal}/GetLocalNodeResponse.java (92%) create mode 100644 play-services-api/src/main/java/com/google/android/gms/wearable/internal/MessageEventParcelable.java rename play-services-api/src/main/java/com/google/android/gms/wearable/{ => internal}/PutDataRequest.java (91%) rename play-services-api/src/main/java/com/google/android/gms/wearable/{ => internal}/PutDataResponse.java (92%) rename play-services-api/src/main/java/com/google/android/gms/wearable/{ => internal}/RemoveListenerRequest.java (91%) rename play-services-api/src/main/java/com/google/android/gms/wearable/{ => internal}/SendMessageResponse.java (94%) rename play-services-api/src/main/java/com/google/android/gms/wearable/{ => internal}/StorageInfoResponse.java (94%) diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IMapViewDelegate.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IMapViewDelegate.aidl index 2efb5649..b53e364f 100644 --- a/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IMapViewDelegate.aidl +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IMapViewDelegate.aidl @@ -3,6 +3,7 @@ package com.google.android.gms.maps.internal; import android.os.Bundle; import com.google.android.gms.maps.internal.IGoogleMapDelegate; +import com.google.android.gms.maps.internal.IOnMapReadyCallback; import com.google.android.gms.dynamic.IObjectWrapper; interface IMapViewDelegate { @@ -14,4 +15,5 @@ interface IMapViewDelegate { void onLowMemory(); void onSaveInstanceState(inout Bundle outState); IObjectWrapper getView(); + void addOnMapReadyCallback(IOnMapReadyCallback callback); } diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnMapReadyCallback.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnMapReadyCallback.aidl new file mode 100644 index 00000000..1e6760ef --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnMapReadyCallback.aidl @@ -0,0 +1,7 @@ +package com.google.android.gms.maps.internal; + +import com.google.android.gms.maps.internal.IGoogleMapDelegate; + +interface IOnMapReadyCallback { + void onMapReady(IGoogleMapDelegate map); +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/AddListenerRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/AddListenerRequest.aidl deleted file mode 100644 index bb1726dd..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/wearable/AddListenerRequest.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.wearable; - -parcelable AddListenerRequest; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/DeleteDataItemsResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/DeleteDataItemsResponse.aidl deleted file mode 100644 index 87691545..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/wearable/DeleteDataItemsResponse.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.wearable; - -parcelable DeleteDataItemsResponse; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/GetConfigResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/GetConfigResponse.aidl deleted file mode 100644 index 611e1443..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/wearable/GetConfigResponse.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.wearable; - -parcelable GetConfigResponse; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/GetConfigsResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/GetConfigsResponse.aidl deleted file mode 100644 index 21f56aab..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/wearable/GetConfigsResponse.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.wearable; - -parcelable GetConfigsResponse; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/GetConnectedNodesResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/GetConnectedNodesResponse.aidl deleted file mode 100644 index 8068de2a..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/wearable/GetConnectedNodesResponse.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.wearable; - -parcelable GetConnectedNodesResponse; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/GetDataItemResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/GetDataItemResponse.aidl deleted file mode 100644 index 1c22d749..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/wearable/GetDataItemResponse.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.wearable; - -parcelable GetDataItemResponse; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/GetFdForAssetResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/GetFdForAssetResponse.aidl deleted file mode 100644 index d12974ff..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/wearable/GetFdForAssetResponse.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.wearable; - -parcelable GetFdForAssetResponse; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/GetLocalNodeResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/GetLocalNodeResponse.aidl deleted file mode 100644 index da6b6ae3..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/wearable/GetLocalNodeResponse.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.wearable; - -parcelable GetLocalNodeResponse; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/PutDataRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/PutDataRequest.aidl deleted file mode 100644 index 5714b4cf..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/wearable/PutDataRequest.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.wearable; - -parcelable PutDataRequest; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/PutDataResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/PutDataResponse.aidl deleted file mode 100644 index 4f0723f5..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/wearable/PutDataResponse.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.wearable; - -parcelable PutDataResponse; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/RemoveListenerRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/RemoveListenerRequest.aidl deleted file mode 100644 index 4e5f7d98..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/wearable/RemoveListenerRequest.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.wearable; - -parcelable RemoveListenerRequest; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/SendMessageResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/SendMessageResponse.aidl deleted file mode 100644 index 296f5439..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/wearable/SendMessageResponse.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.wearable; - -parcelable SendMessageResponse; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/StorageInfoResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/StorageInfoResponse.aidl deleted file mode 100644 index 66ce05ac..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/wearable/StorageInfoResponse.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.wearable; - -parcelable StorageInfoResponse; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/AddListenerRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/AddListenerRequest.aidl new file mode 100644 index 00000000..21b8bba6 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/AddListenerRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.wearable.internal; + +parcelable AddListenerRequest; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/CapabilityInfoParcelable.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/CapabilityInfoParcelable.aidl new file mode 100644 index 00000000..15742eed --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/CapabilityInfoParcelable.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.wearable.internal; + +parcelable CapabilityInfoParcelable; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/ChannelEventParcelable.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/ChannelEventParcelable.aidl new file mode 100644 index 00000000..1f86443a --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/ChannelEventParcelable.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.wearable.internal; + +parcelable ChannelEventParcelable; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/DeleteDataItemsResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/DeleteDataItemsResponse.aidl new file mode 100644 index 00000000..d5402cd6 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/DeleteDataItemsResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.wearable.internal; + +parcelable DeleteDataItemsResponse; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/GetConfigResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/GetConfigResponse.aidl new file mode 100644 index 00000000..14f6b6ee --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/GetConfigResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.wearable.internal; + +parcelable GetConfigResponse; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/GetConfigsResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/GetConfigsResponse.aidl new file mode 100644 index 00000000..2cb7207a --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/GetConfigsResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.wearable.internal; + +parcelable GetConfigsResponse; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/GetConnectedNodesResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/GetConnectedNodesResponse.aidl new file mode 100644 index 00000000..9c0706e7 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/GetConnectedNodesResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.wearable.internal; + +parcelable GetConnectedNodesResponse; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/GetDataItemResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/GetDataItemResponse.aidl new file mode 100644 index 00000000..b523f669 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/GetDataItemResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.wearable.internal; + +parcelable GetDataItemResponse; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/GetFdForAssetResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/GetFdForAssetResponse.aidl new file mode 100644 index 00000000..662ccfb6 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/GetFdForAssetResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.wearable.internal; + +parcelable GetFdForAssetResponse; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/GetLocalNodeResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/GetLocalNodeResponse.aidl new file mode 100644 index 00000000..90178068 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/GetLocalNodeResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.wearable.internal; + +parcelable GetLocalNodeResponse; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableCallbacks.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableCallbacks.aidl index 410fd09a..6af80335 100644 --- a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableCallbacks.aidl +++ b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableCallbacks.aidl @@ -2,16 +2,16 @@ package com.google.android.gms.wearable.internal; import com.google.android.gms.common.api.Status; import com.google.android.gms.common.data.DataHolder; -import com.google.android.gms.wearable.DeleteDataItemsResponse; -import com.google.android.gms.wearable.GetConfigResponse; -import com.google.android.gms.wearable.GetConfigsResponse; -import com.google.android.gms.wearable.GetConnectedNodesResponse; -import com.google.android.gms.wearable.GetDataItemResponse; -import com.google.android.gms.wearable.GetFdForAssetResponse; -import com.google.android.gms.wearable.GetLocalNodeResponse; -import com.google.android.gms.wearable.PutDataResponse; -import com.google.android.gms.wearable.SendMessageResponse; -import com.google.android.gms.wearable.StorageInfoResponse; +import com.google.android.gms.wearable.internal.DeleteDataItemsResponse; +import com.google.android.gms.wearable.internal.GetConfigResponse; +import com.google.android.gms.wearable.internal.GetConfigsResponse; +import com.google.android.gms.wearable.internal.GetConnectedNodesResponse; +import com.google.android.gms.wearable.internal.GetDataItemResponse; +import com.google.android.gms.wearable.internal.GetFdForAssetResponse; +import com.google.android.gms.wearable.internal.GetLocalNodeResponse; +import com.google.android.gms.wearable.internal.PutDataResponse; +import com.google.android.gms.wearable.internal.SendMessageResponse; +import com.google.android.gms.wearable.internal.StorageInfoResponse; interface IWearableCallbacks { void onGetConfigResponse(in GetConfigResponse response) = 1; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableListener.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableListener.aidl index 1c2eb92b..491f5d2f 100644 --- a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableListener.aidl +++ b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableListener.aidl @@ -1,5 +1,18 @@ package com.google.android.gms.wearable.internal; -interface IWearableListener { +import com.google.android.gms.common.data.DataHolder; +import com.google.android.gms.wearable.internal.CapabilityInfoParcelable; +import com.google.android.gms.wearable.internal.ChannelEventParcelable; +import com.google.android.gms.wearable.internal.MessageEventParcelable; +import com.google.android.gms.wearable.internal.NodeParcelable; +interface IWearableListener { + void onDataChanged(in DataHolder data) = 0; + void onMessageReceived(in MessageEventParcelable messageEvent) = 1; + void onPeerConnected(in NodeParcelable node) = 2; + void onPeerDisconnected(in NodeParcelable node) = 3; + void onConnectedNodes(in List nodes) = 4; + + void onChannelEvent(in ChannelEventParcelable channelEvent) = 6; + void onConnectedCapabilityChanged(in CapabilityInfoParcelable capabilityInfo) = 7; } diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableService.aidl index 3bf532c0..e341a186 100644 --- a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableService.aidl +++ b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableService.aidl @@ -1,9 +1,9 @@ package com.google.android.gms.wearable.internal; -import com.google.android.gms.wearable.AddListenerRequest; +import com.google.android.gms.wearable.internal.AddListenerRequest; import com.google.android.gms.wearable.ConnectionConfiguration; -import com.google.android.gms.wearable.PutDataRequest; -import com.google.android.gms.wearable.RemoveListenerRequest; +import com.google.android.gms.wearable.internal.PutDataRequest; +import com.google.android.gms.wearable.internal.RemoveListenerRequest; import com.google.android.gms.wearable.internal.IWearableCallbacks; import com.google.android.gms.wearable.internal.IWearableService; @@ -18,6 +18,8 @@ interface IWearableService { void removeListener(IWearableCallbacks callbacks, in RemoveListenerRequest request) = 16; void putConfig(IWearableCallbacks callbacks, in ConnectionConfiguration config) = 19; void getConfigs(IWearableCallbacks callbacks) = 21; + void disableConnection(IWearableCallbacks callbacks, String name) = 23; void getDataItemsByUri(IWearableCallbacks callbacks, in Uri uri, int i) = 39; void deleteDataItems(IWearableCallbacks callbacks, in Uri uri) = 40; + void optInCloudSync(IWearableCallbacks callbacks, boolean enable) = 47; } diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/MessageEventParcelable.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/MessageEventParcelable.aidl new file mode 100644 index 00000000..a3968f06 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/MessageEventParcelable.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.wearable.internal; + +parcelable MessageEventParcelable; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/NodeParcelable.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/NodeParcelable.aidl new file mode 100644 index 00000000..f10069df --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/NodeParcelable.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.wearable.internal; + +parcelable NodeParcelable; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/PutDataRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/PutDataRequest.aidl new file mode 100644 index 00000000..7fe2a19b --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/PutDataRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.wearable.internal; + +parcelable PutDataRequest; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/PutDataResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/PutDataResponse.aidl new file mode 100644 index 00000000..6f6f23e0 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/PutDataResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.wearable.internal; + +parcelable PutDataResponse; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/RemoveListenerRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/RemoveListenerRequest.aidl new file mode 100644 index 00000000..bf28d18f --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/RemoveListenerRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.wearable.internal; + +parcelable RemoveListenerRequest; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/SendMessageResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/SendMessageResponse.aidl new file mode 100644 index 00000000..3c83498f --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/SendMessageResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.wearable.internal; + +parcelable SendMessageResponse; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/StorageInfoResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/StorageInfoResponse.aidl new file mode 100644 index 00000000..ea1ab215 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/StorageInfoResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.wearable.internal; + +parcelable StorageInfoResponse; \ No newline at end of file diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/Asset.java b/play-services-api/src/main/java/com/google/android/gms/wearable/Asset.java index 0fa11be6..03480221 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wearable/Asset.java +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/Asset.java @@ -19,8 +19,13 @@ package com.google.android.gms.wearable; import android.net.Uri; import android.os.ParcelFileDescriptor; +import com.google.android.gms.wearable.internal.PutDataRequest; + import org.microg.gms.common.PublicApi; import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +import java.util.Arrays; /** * An asset is a binary blob shared between data items that is replicated across the wearable @@ -33,6 +38,28 @@ import org.microg.safeparcel.AutoSafeParcelable; @PublicApi public class Asset extends AutoSafeParcelable { + @SafeParceled(1) + private int versionCode = 1; + @SafeParceled(2) + @PublicApi(exclude = true) + public byte[] data; + @SafeParceled(3) + private String digest; + @SafeParceled(4) + private ParcelFileDescriptor fd; + @SafeParceled(5) + private Uri uri; + + private Asset() { + } + + private Asset(byte[] data, String digest, ParcelFileDescriptor fd, Uri uri) { + this.data = data; + this.digest = digest; + this.fd = fd; + this.uri = uri; + } + /** * Creates an Asset using a byte array. */ @@ -45,14 +72,20 @@ public class Asset extends AutoSafeParcelable { * sent in a putDataItem request. */ public static Asset createFromFd(ParcelFileDescriptor fd) { - return null; + if (fd == null) { + throw new IllegalArgumentException("Asset fd cannot be null"); + } + return new Asset(null, null, fd, null); } /** * Create an Asset using an existing Asset's digest. */ public static Asset createFromRef(String digest) { - return null; + if (digest == null) { + throw new IllegalArgumentException("Asset digest cannot be null"); + } + return new Asset(null, digest, null, null); } /** @@ -68,21 +101,53 @@ public class Asset extends AutoSafeParcelable { * identify the asset across devices. */ public String getDigest() { - return null; + return digest; } /** * @return the file descriptor referencing the asset. */ public ParcelFileDescriptor getFd() { - return null; + return fd; } /** * @return the uri referencing the asset data. */ public Uri getUri() { - return null; + return uri; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + Asset asset = (Asset) o; + + if (!Arrays.equals(data, asset.data)) return false; + if (digest != null ? !digest.equals(asset.digest) : asset.digest != null) return false; + if (fd != null ? !fd.equals(asset.fd) : asset.fd != null) return false; + return !(uri != null ? !uri.equals(asset.uri) : asset.uri != null); + + } + + @Override + public int hashCode() { + return Arrays.hashCode(new Object[]{data, digest, fd, uri}); + } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("Asset[@") + .append(Integer.toHexString(hashCode())) + .append(", ") + .append(digest != null ? digest : "nodigest"); + if (this.data != null) sb.append(", size=").append(data.length); + if (this.fd != null) sb.append(", fd=").append(fd); + if (this.uri != null) sb.append(", uri=").append(uri); + return sb.append("]").toString(); } public static final Creator CREATOR = new AutoCreator(Asset.class); diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/AddListenerRequest.java b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/AddListenerRequest.java similarity index 92% rename from play-services-api/src/main/java/com/google/android/gms/wearable/AddListenerRequest.java rename to play-services-api/src/main/java/com/google/android/gms/wearable/internal/AddListenerRequest.java index 3de65208..9e928948 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wearable/AddListenerRequest.java +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/AddListenerRequest.java @@ -14,12 +14,10 @@ * limitations under the License. */ -package com.google.android.gms.wearable; +package com.google.android.gms.wearable.internal; import android.content.IntentFilter; -import com.google.android.gms.wearable.internal.IWearableListener; - import org.microg.safeparcel.AutoSafeParcelable; import org.microg.safeparcel.SafeParceled; diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/CapabilityInfoParcelable.java b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/CapabilityInfoParcelable.java new file mode 100644 index 00000000..92fe8ad9 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/CapabilityInfoParcelable.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 µg 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.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class CapabilityInfoParcelable extends AutoSafeParcelable { + public static final Creator CREATOR = new AutoCreator(CapabilityInfoParcelable.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/DeleteDataItemsResponse.java b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/ChannelEventParcelable.java similarity index 72% rename from play-services-api/src/main/java/com/google/android/gms/wearable/DeleteDataItemsResponse.java rename to play-services-api/src/main/java/com/google/android/gms/wearable/internal/ChannelEventParcelable.java index de727a00..e7eb9c9a 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wearable/DeleteDataItemsResponse.java +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/ChannelEventParcelable.java @@ -14,10 +14,10 @@ * limitations under the License. */ -package com.google.android.gms.wearable; +package com.google.android.gms.wearable.internal; import org.microg.safeparcel.AutoSafeParcelable; -public class DeleteDataItemsResponse extends AutoSafeParcelable { - public static final Creator CREATOR = new AutoCreator(DeleteDataItemsResponse.class); +public class ChannelEventParcelable extends AutoSafeParcelable { + public static final Creator CREATOR = new AutoCreator(ChannelEventParcelable.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/DataItemAssetParcelable.java b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/DataItemAssetParcelable.java index f124a627..f0ec6160 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/DataItemAssetParcelable.java +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/DataItemAssetParcelable.java @@ -16,8 +16,47 @@ package com.google.android.gms.wearable.internal; -import org.microg.safeparcel.AutoSafeParcelable; +import com.google.android.gms.wearable.DataItemAsset; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class DataItemAssetParcelable extends AutoSafeParcelable implements DataItemAsset { + + @SafeParceled(1) + private int versionCode = 1; + @SafeParceled(2) + private String id; + @SafeParceled(3) + private String key; + + private DataItemAssetParcelable() { + } + + public DataItemAssetParcelable(String id, String key) { + this.id = id; + this.key = key; + } + + @Override + public String getDataItemKey() { + return key; + } + + @Override + public String getId() { + return id; + } + + @Override + public DataItemAsset freeze() { + return this; + } + + @Override + public boolean isDataValid() { + return true; + } -public class DataItemAssetParcelable extends AutoSafeParcelable { public static final Creator CREATOR = new AutoCreator(DataItemAssetParcelable.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/DataItemParcelable.java b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/DataItemParcelable.java index f7c880e1..9fc7b528 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/DataItemParcelable.java +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/DataItemParcelable.java @@ -29,16 +29,13 @@ public class DataItemParcelable extends AutoSafeParcelable { @SafeParceled(1) private int versionCode = 1; @SafeParceled(2) - public final Uri uri; + private Uri uri; @SafeParceled(4) - private final Bundle assets; + private Bundle assets = new Bundle(); @SafeParceled(5) public byte[] data; private DataItemParcelable() { - uri = null; - assets = new Bundle(); - data = null; } public DataItemParcelable(Uri uri) { @@ -47,7 +44,6 @@ public class DataItemParcelable extends AutoSafeParcelable { public DataItemParcelable(Uri uri, Map assets) { this.uri = uri; - this.assets = new Bundle(); for (String key : assets.keySet()) { this.assets.putParcelable(key, assets.get(key)); } @@ -63,5 +59,9 @@ public class DataItemParcelable extends AutoSafeParcelable { return assets; } + public Uri getUri() { + return uri; + } + public static final Creator CREATOR = new AutoCreator(DataItemParcelable.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/DeleteDataItemsResponse.java b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/DeleteDataItemsResponse.java new file mode 100644 index 00000000..220fba4d --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/DeleteDataItemsResponse.java @@ -0,0 +1,40 @@ +/* + * Copyright 2013-2015 µg 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.internal; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class DeleteDataItemsResponse extends AutoSafeParcelable { + + @SafeParceled(1) + private int versionCode = 1; + @SafeParceled(2) + private int status; + @SafeParceled(3) + private int count; + + private DeleteDataItemsResponse() { + } + + public DeleteDataItemsResponse(int status, int count) { + this.status = status; + this.count = count; + } + + public static final Creator CREATOR = new AutoCreator(DeleteDataItemsResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/GetConfigResponse.java b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetConfigResponse.java similarity index 92% rename from play-services-api/src/main/java/com/google/android/gms/wearable/GetConfigResponse.java rename to play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetConfigResponse.java index a1435257..b2923e6a 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wearable/GetConfigResponse.java +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetConfigResponse.java @@ -14,7 +14,9 @@ * limitations under the License. */ -package com.google.android.gms.wearable; +package com.google.android.gms.wearable.internal; + +import com.google.android.gms.wearable.ConnectionConfiguration; import org.microg.safeparcel.AutoSafeParcelable; import org.microg.safeparcel.SafeParceled; diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/GetConfigsResponse.java b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetConfigsResponse.java similarity index 92% rename from play-services-api/src/main/java/com/google/android/gms/wearable/GetConfigsResponse.java rename to play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetConfigsResponse.java index 256aebdd..37a16066 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wearable/GetConfigsResponse.java +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetConfigsResponse.java @@ -14,7 +14,9 @@ * limitations under the License. */ -package com.google.android.gms.wearable; +package com.google.android.gms.wearable.internal; + +import com.google.android.gms.wearable.ConnectionConfiguration; import org.microg.safeparcel.AutoSafeParcelable; import org.microg.safeparcel.SafeParceled; diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/GetConnectedNodesResponse.java b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetConnectedNodesResponse.java similarity index 92% rename from play-services-api/src/main/java/com/google/android/gms/wearable/GetConnectedNodesResponse.java rename to play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetConnectedNodesResponse.java index 625b25ad..cf6e1781 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wearable/GetConnectedNodesResponse.java +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetConnectedNodesResponse.java @@ -14,9 +14,7 @@ * limitations under the License. */ -package com.google.android.gms.wearable; - -import com.google.android.gms.wearable.internal.NodeParcelable; +package com.google.android.gms.wearable.internal; import org.microg.safeparcel.AutoSafeParcelable; import org.microg.safeparcel.SafeParceled; diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/GetDataItemResponse.java b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetDataItemResponse.java similarity index 92% rename from play-services-api/src/main/java/com/google/android/gms/wearable/GetDataItemResponse.java rename to play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetDataItemResponse.java index a1ae10d6..3b1d89c5 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wearable/GetDataItemResponse.java +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetDataItemResponse.java @@ -14,9 +14,7 @@ * limitations under the License. */ -package com.google.android.gms.wearable; - -import com.google.android.gms.wearable.internal.DataItemParcelable; +package com.google.android.gms.wearable.internal; import org.microg.safeparcel.AutoSafeParcelable; import org.microg.safeparcel.SafeParceled; diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/GetFdForAssetResponse.java b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetFdForAssetResponse.java similarity index 94% rename from play-services-api/src/main/java/com/google/android/gms/wearable/GetFdForAssetResponse.java rename to play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetFdForAssetResponse.java index 4f83e64c..19294116 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wearable/GetFdForAssetResponse.java +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetFdForAssetResponse.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.google.android.gms.wearable; +package com.google.android.gms.wearable.internal; import org.microg.safeparcel.AutoSafeParcelable; diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/GetLocalNodeResponse.java b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetLocalNodeResponse.java similarity index 92% rename from play-services-api/src/main/java/com/google/android/gms/wearable/GetLocalNodeResponse.java rename to play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetLocalNodeResponse.java index b99bb6b7..601d23db 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wearable/GetLocalNodeResponse.java +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetLocalNodeResponse.java @@ -14,9 +14,7 @@ * limitations under the License. */ -package com.google.android.gms.wearable; - -import com.google.android.gms.wearable.internal.NodeParcelable; +package com.google.android.gms.wearable.internal; import org.microg.safeparcel.AutoSafeParcelable; import org.microg.safeparcel.SafeParceled; diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/MessageEventParcelable.java b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/MessageEventParcelable.java new file mode 100644 index 00000000..4dd4ef7f --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/MessageEventParcelable.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 µg 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.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class MessageEventParcelable extends AutoSafeParcelable { + public static final Creator CREATOR = new AutoCreator(MessageEventParcelable.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/PutDataRequest.java b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/PutDataRequest.java similarity index 91% rename from play-services-api/src/main/java/com/google/android/gms/wearable/PutDataRequest.java rename to play-services-api/src/main/java/com/google/android/gms/wearable/internal/PutDataRequest.java index 1df9edf0..56e0abb5 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wearable/PutDataRequest.java +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/PutDataRequest.java @@ -14,14 +14,15 @@ * limitations under the License. */ -package com.google.android.gms.wearable; +package com.google.android.gms.wearable.internal; import android.net.Uri; import android.os.Bundle; import android.text.TextUtils; import android.util.Base64; -import com.google.android.gms.wearable.internal.DataItemAssetParcelable; +import com.google.android.gms.wearable.Asset; +import com.google.android.gms.wearable.DataItem; import org.microg.gms.common.PublicApi; import org.microg.safeparcel.AutoSafeParcelable; @@ -129,9 +130,9 @@ public class PutDataRequest extends AutoSafeParcelable { } public String toString(boolean verbose) { - return "PutDataRequest[data=" + (data == null ? "null" : Base64.encodeToString(data, Base64.NO_WRAP)) + - ", numAssets=" + getAssets().size() + - ", uri=" + uri + "]"; + return "PutDataRequest[uri=" + uri + + ", data=" + (data == null ? "null" : Base64.encodeToString(data, Base64.NO_WRAP)) + + ", numAssets=" + getAssets().size() + "]"; // TODO: Verbose: dump all assets } diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/PutDataResponse.java b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/PutDataResponse.java similarity index 92% rename from play-services-api/src/main/java/com/google/android/gms/wearable/PutDataResponse.java rename to play-services-api/src/main/java/com/google/android/gms/wearable/internal/PutDataResponse.java index f44f4319..ef04746e 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wearable/PutDataResponse.java +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/PutDataResponse.java @@ -14,9 +14,7 @@ * limitations under the License. */ -package com.google.android.gms.wearable; - -import com.google.android.gms.wearable.internal.DataItemParcelable; +package com.google.android.gms.wearable.internal; import org.microg.safeparcel.AutoSafeParcelable; import org.microg.safeparcel.SafeParceled; diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/RemoveListenerRequest.java b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/RemoveListenerRequest.java similarity index 91% rename from play-services-api/src/main/java/com/google/android/gms/wearable/RemoveListenerRequest.java rename to play-services-api/src/main/java/com/google/android/gms/wearable/internal/RemoveListenerRequest.java index 6edc53f0..ed19d18b 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wearable/RemoveListenerRequest.java +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/RemoveListenerRequest.java @@ -14,9 +14,7 @@ * limitations under the License. */ -package com.google.android.gms.wearable; - -import com.google.android.gms.wearable.internal.IWearableListener; +package com.google.android.gms.wearable.internal; import org.microg.safeparcel.AutoSafeParcelable; import org.microg.safeparcel.SafeParceled; diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/SendMessageResponse.java b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/SendMessageResponse.java similarity index 94% rename from play-services-api/src/main/java/com/google/android/gms/wearable/SendMessageResponse.java rename to play-services-api/src/main/java/com/google/android/gms/wearable/internal/SendMessageResponse.java index 570ab0ef..03f46d5f 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wearable/SendMessageResponse.java +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/SendMessageResponse.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.google.android.gms.wearable; +package com.google.android.gms.wearable.internal; import org.microg.safeparcel.AutoSafeParcelable; diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/StorageInfoResponse.java b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/StorageInfoResponse.java similarity index 94% rename from play-services-api/src/main/java/com/google/android/gms/wearable/StorageInfoResponse.java rename to play-services-api/src/main/java/com/google/android/gms/wearable/internal/StorageInfoResponse.java index 42307d72..d96fd391 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wearable/StorageInfoResponse.java +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/StorageInfoResponse.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.google.android.gms.wearable; +package com.google.android.gms.wearable.internal; import org.microg.safeparcel.AutoSafeParcelable; diff --git a/play-services-api/src/main/java/org/microg/gms/common/Constants.java b/play-services-api/src/main/java/org/microg/gms/common/Constants.java index 7e53ce71..d2ac6ddf 100644 --- a/play-services-api/src/main/java/org/microg/gms/common/Constants.java +++ b/play-services-api/src/main/java/org/microg/gms/common/Constants.java @@ -5,7 +5,7 @@ public class Constants { * This is the highest version that was looked at during development. * Does not necessarily mean anything. */ - public static final int MAX_REFERENCE_VERSION = 7099448; + public static final int MAX_REFERENCE_VERSION = 7887000; public static final String KEY_MOCK_LOCATION = "mockLocation"; public static final String DEFAULT_ACCOUNT = "<>"; public static final String GMS_PACKAGE_NAME = "com.google.android.gms"; From 28ff7f36f2b75a29cead8efc25fc0418065db601 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Thu, 6 Aug 2015 16:58:39 +0200 Subject: [PATCH 087/293] Update SafeParcel, Add PolylineOptions --- extern/SafeParcel | 2 +- .../gms/auth/AccountChangeEventsResponse.java | 2 +- .../gms/maps/model/PolylineOptions.java | 92 +++++++++++++++++-- 3 files changed, 86 insertions(+), 10 deletions(-) diff --git a/extern/SafeParcel b/extern/SafeParcel index ef1568e2..e0556cbf 160000 --- a/extern/SafeParcel +++ b/extern/SafeParcel @@ -1 +1 @@ -Subproject commit ef1568e2614f29c3f13a6b6536989aba7f1a1b5d +Subproject commit e0556cbfac91c0d42bbca4119aa712638a925d6b diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEventsResponse.java b/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEventsResponse.java index bc68a42c..1aebe5bf 100644 --- a/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEventsResponse.java +++ b/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEventsResponse.java @@ -25,7 +25,7 @@ import java.util.List; public class AccountChangeEventsResponse extends AutoSafeParcelable { @SafeParceled(1) private int versionCode = 1; - @SafeParceled(value = 2, subType = "com.google.android.gms.auth.AccountChangeEvent") + @SafeParceled(value = 2, subClass = AccountChangeEvent.class) private List events; public AccountChangeEventsResponse() { diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/model/PolylineOptions.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/PolylineOptions.java index f6e30a73..a42fac5f 100644 --- a/play-services-api/src/main/java/com/google/android/gms/maps/model/PolylineOptions.java +++ b/play-services-api/src/main/java/com/google/android/gms/maps/model/PolylineOptions.java @@ -16,10 +16,13 @@ package com.google.android.gms.maps.model; +import android.graphics.Color; + import org.microg.gms.common.PublicApi; import org.microg.safeparcel.AutoSafeParcelable; import org.microg.safeparcel.SafeParceled; +import java.util.ArrayList; import java.util.List; /** @@ -29,17 +32,90 @@ import java.util.List; @PublicApi public class PolylineOptions extends AutoSafeParcelable { @SafeParceled(1) - private int versionCode; - // TODO - private List points; - private float width; - private int color; - private float zIndex; - private boolean visible; - private boolean geodesic; + private int versionCode = 1; + @SafeParceled(value = 2, subClass = LatLng.class) + private List points = new ArrayList(); + @SafeParceled(3) + private float width = 10; + @SafeParceled(4) + private int color = Color.BLACK; + @SafeParceled(5) + private float zIndex = 0; + @SafeParceled(6) + private boolean visible = true; + @SafeParceled(7) + private boolean geodesic = false; public PolylineOptions() { } + public PolylineOptions add(LatLng point) { + points.add(point); + return this; + } + + public PolylineOptions add(LatLng... points) { + for (LatLng point : points) { + this.points.add(point); + } + return this; + } + + public PolylineOptions addAll(Iterable points) { + for (LatLng point : points) { + this.points.add(point); + } + return this; + } + + public PolylineOptions color(int color) { + this.color = color; + return this; + } + + public PolylineOptions geodesic(boolean geodesic) { + this.geodesic = geodesic; + return this; + } + + public int getColor() { + return color; + } + + public List getPoints() { + return points; + } + + public float getWidth() { + return width; + } + + public float getZIndex() { + return zIndex; + } + + public boolean isGeodesic() { + return geodesic; + } + + public boolean isVisible() { + return visible; + } + + public PolylineOptions visible(boolean visible) { + this.visible = visible; + return this; + } + + public PolylineOptions width(float width) { + this.width = width; + return this; + } + + public PolylineOptions zIndex(float zIndex) { + this.zIndex = zIndex; + return this; + } + public static Creator CREATOR = new AutoCreator(PolylineOptions.class); } From 4f1840dbb92223b28282b3388cbccb2f769d0ffe Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Mon, 28 Sep 2015 18:26:29 +0200 Subject: [PATCH 088/293] Update SafeParcel submodule --- extern/SafeParcel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extern/SafeParcel b/extern/SafeParcel index e0556cbf..02b94fdd 160000 --- a/extern/SafeParcel +++ b/extern/SafeParcel @@ -1 +1 @@ -Subproject commit e0556cbfac91c0d42bbca4119aa712638a925d6b +Subproject commit 02b94fdd0af1c127fa14500b2c3d4bec0701e1d6 From 266795a39f11d58697a2e94e78ac13d79d6a9119 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Mon, 28 Sep 2015 18:27:29 +0200 Subject: [PATCH 089/293] Add and update APIs --- play-services-api/build.gradle | 33 +++-- play-services-api/gradle.properties | 6 +- .../android/gms/cast/ApplicationMetadata.java | 68 ++++++++++ .../google/android/gms/cast/CastDevice.java | 124 ++++++++++++++++++ .../android/gms/cast/LaunchOptions.java | 47 +++++++ .../android/gms/common/images/WebImage.java | 23 ++++ .../gms/maps/model/PolygonOptions.java | 120 ++++++++++++++++- 7 files changed, 407 insertions(+), 14 deletions(-) create mode 100644 play-services-api/src/main/java/com/google/android/gms/cast/ApplicationMetadata.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/cast/CastDevice.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/cast/LaunchOptions.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/common/images/WebImage.java diff --git a/play-services-api/build.gradle b/play-services-api/build.gradle index f48d82b3..c5c36494 100644 --- a/play-services-api/build.gradle +++ b/play-services-api/build.gradle @@ -1,26 +1,43 @@ +/* + * Copyright 2013-2015 µg 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. + */ + buildscript { repositories { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:1.2.3' + classpath 'com.android.tools.build:gradle:1.3.0' + classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3' } } apply plugin: 'com.android.library' -apply from: 'gradle-mvn-push.gradle' +apply plugin: 'com.github.dcendents.android-maven' group = 'org.microg' version = '1.0-SNAPSHOT' -dependencies { - compile project(':safe-parcel') -} - android { - compileSdkVersion 22 - buildToolsVersion "22.0.1" + compileSdkVersion 23 + buildToolsVersion "23.0.1" compileOptions { sourceCompatibility JavaVersion.VERSION_1_6 } } + +dependencies { + compile project(':safe-parcel') +} diff --git a/play-services-api/gradle.properties b/play-services-api/gradle.properties index 0859459b..263c3740 100644 --- a/play-services-api/gradle.properties +++ b/play-services-api/gradle.properties @@ -1,8 +1,4 @@ -GROUP=org.microg -POM_ARTIFACT_ID=play-services-api -VERSION_NAME=1.0-SNAPSHOT - -POM_NAME=µg GmsApi +POM_NAME=GmsApi POM_DESCRIPTION=Interfaces and objects for IPC between Play Services Library and Play Services Core POM_PACKAGING=aar diff --git a/play-services-api/src/main/java/com/google/android/gms/cast/ApplicationMetadata.java b/play-services-api/src/main/java/com/google/android/gms/cast/ApplicationMetadata.java new file mode 100644 index 00000000..46cf7751 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/cast/ApplicationMetadata.java @@ -0,0 +1,68 @@ +/* + * Copyright 2013-2015 µg 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.cast; + +import android.net.Uri; + +import com.google.android.gms.common.images.WebImage; + +import org.microg.gms.common.PublicApi; +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +import java.util.List; + +@PublicApi +public class ApplicationMetadata extends AutoSafeParcelable { + + @SafeParceled(1) + private int versionCode = 1; + @SafeParceled(2) + private String applicationId; + @SafeParceled(3) + private String name; + @SafeParceled(value = 4, subClass = WebImage.class) + private List images; + @SafeParceled(value = 5, subClass = String.class) + private List namespaces; + @SafeParceled(6) + private String senderAppIdentifier; + @SafeParceled(7) + private Uri senderAppLaunchUri; + + public String getApplicationId() { + return applicationId; + } + + public List getImages() { + return images; + } + + public String getName() { + return name; + } + + public String getSenderAppIdentifier() { + return senderAppIdentifier; + } + + public boolean isNamespaceSupported(String namespace) { + return namespaces.contains(namespace); + } + + public static final Creator CREATOR = new AutoCreator(ApplicationMetadata.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/cast/CastDevice.java b/play-services-api/src/main/java/com/google/android/gms/cast/CastDevice.java new file mode 100644 index 00000000..22ab65c8 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/cast/CastDevice.java @@ -0,0 +1,124 @@ +/* + * Copyright 2013-2015 µg 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.cast; + +import android.os.Bundle; +import android.text.TextUtils; + +import com.google.android.gms.common.images.WebImage; + +import org.microg.gms.common.PublicApi; +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +import java.net.Inet4Address; +import java.util.ArrayList; +import java.util.List; + +@PublicApi +public class CastDevice extends AutoSafeParcelable { + private static final String EXTRA_CAST_DEVICE = "com.google.android.gms.cast.EXTRA_CAST_DEVICE"; + + public static final int CAPABILITY_VIDEO_OUT = 1; + public static final int CAPABILITY_VIDEO_IN = 2; + public static final int CAPABILITY_AUDIO_OUT = 4; + public static final int CAPABILITY_AUDIO_IN = 8; + + @SafeParceled(1) + private int versionCode; + + @SafeParceled(3) + private String addrString; + private Inet4Address addr; + + private String deviceId; + + private String deviceVersion; + + private String friendlyName; + + private int servicePort; + + @SafeParceled(value = 8, subClass = WebImage.class) + private ArrayList icons; + + public String getDeviceId() { + return deviceId; + } + + public String getDeviceVersion() { + return deviceVersion; + } + + public String getFriendlyName() { + return friendlyName; + } + + public static CastDevice getFromBundle(Bundle extras) { + if (extras == null) { + return null; + } + extras.setClassLoader(CastDevice.class.getClassLoader()); + return extras.getParcelable(EXTRA_CAST_DEVICE); + } + + public WebImage getIcon(int preferredWidth, int preferredHeight) { + return null; + } + + public List getIcons() { + return icons; + } + + public Inet4Address getIpAddress() { + return addr; + } + + public String getModelName() { + return null; + } + + public int getServicePort() { + return servicePort; + } + + public boolean hasCapabilities(int[] capabilities) { + return false; + } + + public boolean hasCapability(int capability) { + return false; + } + + public boolean hasIcons() { + return !icons.isEmpty(); + } + + public boolean isOnLocalNetwork() { + return false; + } + + public boolean isSameDevice(CastDevice castDevice) { + return TextUtils.equals(castDevice.deviceId, deviceId); + } + + public void putInBundle(Bundle bundle) { + bundle.putParcelable(EXTRA_CAST_DEVICE, this); + } + + public static Creator CREATOR = new AutoCreator(CastDevice.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/cast/LaunchOptions.java b/play-services-api/src/main/java/com/google/android/gms/cast/LaunchOptions.java new file mode 100644 index 00000000..3a550360 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/cast/LaunchOptions.java @@ -0,0 +1,47 @@ +/* + * Copyright 2013-2015 µg 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.cast; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class LaunchOptions extends AutoSafeParcelable { + @SafeParceled(1) + private int versionCode = 1; + @SafeParceled(2) + private boolean relaunchIfRunning; + @SafeParceled(3) + private String language; + + public String getLanguage() { + return language; + } + + public boolean getRelaunchIfRunning() { + return relaunchIfRunning; + } + + public void setLanguage(String language) { + this.language = language; + } + + public void setRelaunchIfRunning(boolean relaunchIfRunning) { + this.relaunchIfRunning = relaunchIfRunning; + } + + public static Creator CREATOR = new AutoCreator(LaunchOptions.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/common/images/WebImage.java b/play-services-api/src/main/java/com/google/android/gms/common/images/WebImage.java new file mode 100644 index 00000000..58e29863 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/common/images/WebImage.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 µg 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.common.images; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class WebImage extends AutoSafeParcelable { + public static final Creator CREATOR = new AutoCreator(WebImage.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/model/PolygonOptions.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/PolygonOptions.java index 252a360f..a65e782d 100644 --- a/play-services-api/src/main/java/com/google/android/gms/maps/model/PolygonOptions.java +++ b/play-services-api/src/main/java/com/google/android/gms/maps/model/PolygonOptions.java @@ -16,17 +16,135 @@ package com.google.android.gms.maps.model; +import android.graphics.Color; + import org.microg.gms.common.PublicApi; import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +import java.util.ArrayList; +import java.util.List; /** * Defines options for a polygon. - * TODO + * TODO: Docs */ @PublicApi public class PolygonOptions extends AutoSafeParcelable { + @SafeParceled(1) + private int versionCode = 1; + @SafeParceled(value = 2, subClass = LatLng.class) + private List points = new ArrayList(); + @SafeParceled(value = 3, subClass = LatLng.class, useClassLoader = true) + private List> holes = new ArrayList>(); + @SafeParceled(4) + private float strokeWidth = 10; + @SafeParceled(5) + private int strokeColor = Color.BLACK; + @SafeParceled(6) + private int fillColor = Color.TRANSPARENT; + @SafeParceled(7) + private float zIndex = 0; + @SafeParceled(8) + private boolean visible = true; + @SafeParceled(9) + private boolean geodesic = false; + + /** + * Creates polygon options. + */ public PolygonOptions() { } + public PolygonOptions add(LatLng point) { + points.add(point); + return this; + } + + public PolygonOptions add(LatLng... points) { + for (LatLng point : points) { + this.points.add(point); + } + return this; + } + + public PolygonOptions add(Iterable points) { + for (LatLng point : points) { + this.points.add(point); + } + return this; + } + + public PolygonOptions addHole(Iterable points) { + ArrayList hole = new ArrayList(); + for (LatLng point : points) { + hole.add(point); + } + holes.add(hole); + return this; + } + + public PolygonOptions fillColor(int color) { + this.fillColor = color; + return this; + } + + public PolygonOptions geodesic(boolean geodesic) { + this.geodesic = geodesic; + return this; + } + + public int getFillColor() { + return fillColor; + } + + public List> getHoles() { + return holes; + } + + public List getPoints() { + return points; + } + + public int getStrokeColor() { + return strokeColor; + } + + public float getStrokeWidth() { + return strokeWidth; + } + + public float getZIndex() { + return zIndex; + } + + public boolean isGeodesic() { + return geodesic; + } + + public boolean isVisible() { + return visible; + } + + public PolygonOptions strokeColor(int color) { + this.strokeColor = color; + return this; + } + + public PolygonOptions strokeWidth(float width) { + this.strokeWidth = width; + return this; + } + + public PolygonOptions visible(boolean visible) { + this.visible = visible; + return this; + } + + public PolygonOptions zIndex(float zIndex) { + this.zIndex = zIndex; + return this; + } + public static Creator CREATOR = new AutoCreator(PolygonOptions.class); } From 9f3ff53e69ad7d31557689176d4dbab55ff4873f Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Mon, 28 Sep 2015 18:30:12 +0200 Subject: [PATCH 090/293] Update copyright --- play-services-api/build.gradle | 2 +- play-services-api/gradle-mvn-push.gradle | 114 ------------------ play-services-api/gradle.properties | 16 +++ .../src/main/AndroidManifest.xml | 16 +++ .../gms/appdatasearch/CorpusStatus.java | 2 +- .../android/gms/appdatasearch/PIMEUpdate.java | 2 +- .../gms/appdatasearch/PIMEUpdateResponse.java | 2 +- .../gms/appdatasearch/QuerySpecification.java | 2 +- .../RequestIndexingSpecification.java | 2 +- .../gms/appdatasearch/SearchResults.java | 2 +- .../appdatasearch/SuggestSpecification.java | 2 +- .../gms/appdatasearch/SuggestionResults.java | 2 +- .../android/gms/appdatasearch/UsageInfo.java | 2 +- .../android/gms/auth/AccountChangeEvent.java | 16 +++ .../gms/auth/AccountChangeEventsRequest.java | 2 +- .../gms/auth/AccountChangeEventsResponse.java | 2 +- .../firstparty/dataservice/TokenRequest.java | 16 +++ .../firstparty/dataservice/TokenResponse.java | 16 +++ .../firstparty/proximity/data/Permit.java | 16 +++ .../android/gms/cast/ApplicationMetadata.java | 2 +- .../google/android/gms/cast/CastDevice.java | 2 +- .../android/gms/cast/LaunchOptions.java | 2 +- .../com/google/android/gms/common/Scopes.java | 16 +++ .../android/gms/common/api/AccountInfo.java | 16 +++ .../gms/common/api/CommonStatusCodes.java | 2 +- .../google/android/gms/common/api/Result.java | 16 +++ .../google/android/gms/common/api/Scope.java | 16 +++ .../google/android/gms/common/api/Status.java | 16 +++ .../android/gms/common/data/DataHolder.java | 16 +++ .../android/gms/common/data/Freezable.java | 2 +- .../android/gms/common/images/WebImage.java | 2 +- .../common/internal/GetServiceRequest.java | 2 +- .../internal/ValidateAccountRequest.java | 2 +- .../common/server/FavaDiagnosticsEntity.java | 2 +- .../metadata/internal/MetadataBundle.java | 16 +++ .../android/gms/dynamic/ObjectWrapper.java | 4 +- .../android/gms/fitness/data/DataPoint.java | 16 +++ .../android/gms/fitness/data/Device.java | 16 +++ .../android/gms/fitness/data/Field.java | 16 +++ .../android/gms/fitness/data/Value.java | 16 +++ .../identity/accounts/api/AccountData.java | 16 +++ .../intents/model/CountrySpecification.java | 16 +++ .../identity/intents/model/UserAddress.java | 16 +++ .../google/android/gms/location/Geofence.java | 4 +- .../gms/location/GeofencingRequest.java | 16 +++ .../android/gms/location/LocationRequest.java | 16 +++ .../android/gms/location/LocationStatus.java | 16 +++ .../gms/location/internal/ClientIdentity.java | 16 +++ .../internal/LocationRequestInternal.java | 16 +++ .../location/places/AutocompleteFilter.java | 16 +++ .../location/places/NearbyAlertRequest.java | 16 +++ .../gms/location/places/PlaceFilter.java | 16 +++ .../gms/location/places/PlaceReport.java | 16 +++ .../gms/location/places/PlaceRequest.java | 16 +++ .../gms/location/places/UserAddedPlace.java | 16 +++ .../gms/location/places/UserDataType.java | 16 +++ .../places/internal/PlacesParams.java | 16 +++ .../location/reporting/ReportingState.java | 2 +- .../android/gms/maps/GoogleMapOptions.java | 4 +- .../gms/maps/StreetViewPanoramaOptions.java | 16 +++ .../android/gms/maps/internal/Point.java | 16 +++ .../gms/maps/model/BitmapDescriptor.java | 4 +- .../gms/maps/model/CameraPosition.java | 4 +- .../android/gms/maps/model/CircleOptions.java | 4 +- .../gms/maps/model/GroundOverlayOptions.java | 4 +- .../google/android/gms/maps/model/LatLng.java | 4 +- .../android/gms/maps/model/LatLngBounds.java | 4 +- .../android/gms/maps/model/MarkerOptions.java | 4 +- .../gms/maps/model/PolygonOptions.java | 4 +- .../gms/maps/model/PolylineOptions.java | 4 +- .../maps/model/StreetViewPanoramaCamera.java | 16 +++ .../maps/model/StreetViewPanoramaLink.java | 16 +++ .../model/StreetViewPanoramaLocation.java | 16 +++ .../model/StreetViewPanoramaOrientation.java | 16 +++ .../google/android/gms/maps/model/Tile.java | 16 +++ .../gms/maps/model/TileOverlayOptions.java | 4 +- .../android/gms/maps/model/TileProvider.java | 16 +++ .../android/gms/maps/model/VisibleRegion.java | 4 +- .../android/gms/maps/model/package-info.java | 16 +++ .../gms/people/model/AccountMetadata.java | 2 +- .../gms/playlog/internal/LogEvent.java | 2 +- .../playlog/internal/PlayLoggerContext.java | 2 +- .../gms/plus/internal/PlusCommonExtras.java | 16 +++ .../gms/plus/internal/PlusSession.java | 16 +++ .../model/smart_profile/CardsRequest.java | 16 +++ .../model/smart_profile/CardsResponse.java | 16 +++ .../PeopleForProfilesRequest.java | 16 +++ .../PeopleForProfilesResponse.java | 16 +++ .../android/gms/plus/model/posts/Comment.java | 16 +++ .../android/gms/plus/model/posts/Post.java | 16 +++ .../gms/plus/model/posts/Settings.java | 16 +++ .../search/corpora/ClearCorpusRequest.java | 2 +- .../search/corpora/GetCorpusInfoRequest.java | 2 +- .../corpora/GetCorpusStatusRequest.java | 2 +- .../corpora/GetCorpusStatusResponse.java | 2 +- .../corpora/RequestIndexingRequest.java | 2 +- .../corpora/RequestIndexingResponse.java | 2 +- .../gms/search/queries/QueryRequest.java | 2 +- .../gms/search/queries/QueryResponse.java | 2 +- .../google/android/gms/wearable/Asset.java | 2 +- .../gms/wearable/ConnectionConfiguration.java | 16 +++ .../google/android/gms/wearable/DataItem.java | 2 +- .../android/gms/wearable/DataItemAsset.java | 2 +- .../com/google/android/gms/wearable/Node.java | 2 +- .../gms/wearable/WearableStatusCodes.java | 2 +- .../wearable/internal/AddListenerRequest.java | 2 +- .../internal/CapabilityInfoParcelable.java | 2 +- .../internal/ChannelEventParcelable.java | 2 +- .../internal/DataItemAssetParcelable.java | 2 +- .../wearable/internal/DataItemParcelable.java | 2 +- .../internal/DeleteDataItemsResponse.java | 2 +- .../wearable/internal/GetConfigResponse.java | 2 +- .../wearable/internal/GetConfigsResponse.java | 2 +- .../internal/GetConnectedNodesResponse.java | 2 +- .../internal/GetDataItemResponse.java | 2 +- .../internal/GetFdForAssetResponse.java | 2 +- .../internal/GetLocalNodeResponse.java | 2 +- .../internal/MessageEventParcelable.java | 2 +- .../gms/wearable/internal/NodeParcelable.java | 2 +- .../gms/wearable/internal/PutDataRequest.java | 2 +- .../wearable/internal/PutDataResponse.java | 2 +- .../internal/RemoveListenerRequest.java | 2 +- .../internal/SendMessageResponse.java | 2 +- .../internal/StorageInfoResponse.java | 2 +- .../java/org/microg/gms/common/Constants.java | 16 +++ .../java/org/microg/gms/common/PublicApi.java | 2 +- .../java/org/microg/gms/common/Services.java | 2 +- 127 files changed, 935 insertions(+), 201 deletions(-) delete mode 100644 play-services-api/gradle-mvn-push.gradle diff --git a/play-services-api/build.gradle b/play-services-api/build.gradle index c5c36494..b5fa30b8 100644 --- a/play-services-api/build.gradle +++ b/play-services-api/build.gradle @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-api/gradle-mvn-push.gradle b/play-services-api/gradle-mvn-push.gradle deleted file mode 100644 index f5f4129c..00000000 --- a/play-services-api/gradle-mvn-push.gradle +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright 2013 Chris Banes - * - * 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: 'maven' -apply plugin: 'signing' - -def isReleaseBuild() { - return VERSION_NAME.contains("SNAPSHOT") == false -} - -def getReleaseRepositoryUrl() { - return hasProperty('RELEASE_REPOSITORY_URL') ? RELEASE_REPOSITORY_URL - : "https://oss.sonatype.org/service/local/staging/deploy/maven2/" -} - -def getSnapshotRepositoryUrl() { - return hasProperty('SNAPSHOT_REPOSITORY_URL') ? SNAPSHOT_REPOSITORY_URL - : "https://oss.sonatype.org/content/repositories/snapshots/" -} - -def getRepositoryUsername() { - return hasProperty('NEXUS_USERNAME') ? NEXUS_USERNAME : "" -} - -def getRepositoryPassword() { - return hasProperty('NEXUS_PASSWORD') ? NEXUS_PASSWORD : "" -} - -afterEvaluate { project -> - uploadArchives { - repositories { - mavenDeployer { - beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } - - pom.groupId = GROUP - pom.artifactId = POM_ARTIFACT_ID - pom.version = VERSION_NAME - - repository(url: getReleaseRepositoryUrl()) { - authentication(userName: getRepositoryUsername(), password: getRepositoryPassword()) - } - snapshotRepository(url: getSnapshotRepositoryUrl()) { - authentication(userName: getRepositoryUsername(), password: getRepositoryPassword()) - } - - pom.project { - name POM_NAME - packaging POM_PACKAGING - description POM_DESCRIPTION - url POM_URL - - scm { - url POM_SCM_URL - connection POM_SCM_CONNECTION - developerConnection POM_SCM_DEV_CONNECTION - } - - licenses { - license { - name POM_LICENCE_NAME - url POM_LICENCE_URL - distribution POM_LICENCE_DIST - } - } - - developers { - developer { - id POM_DEVELOPER_ID - name POM_DEVELOPER_NAME - } - } - } - } - } - } - - signing { - required { isReleaseBuild() && gradle.taskGraph.hasTask("uploadArchives") } - sign configurations.archives - } - - task androidJavadocs(type: Javadoc) { - source = android.sourceSets.main.java.srcDirs - classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) - } - - task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) { - classifier = 'javadoc' - from androidJavadocs.destinationDir - } - - task androidSourcesJar(type: Jar) { - classifier = 'sources' - from android.sourceSets.main.java.sourceFiles - } - - artifacts { - archives androidSourcesJar - archives androidJavadocsJar - } -} diff --git a/play-services-api/gradle.properties b/play-services-api/gradle.properties index 263c3740..f547fef2 100644 --- a/play-services-api/gradle.properties +++ b/play-services-api/gradle.properties @@ -1,3 +1,19 @@ +# +# Copyright 2013-2015 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. +# + POM_NAME=GmsApi POM_DESCRIPTION=Interfaces and objects for IPC between Play Services Library and Play Services Core diff --git a/play-services-api/src/main/AndroidManifest.xml b/play-services-api/src/main/AndroidManifest.xml index 52b6af60..6e6ebf08 100644 --- a/play-services-api/src/main/AndroidManifest.xml +++ b/play-services-api/src/main/AndroidManifest.xml @@ -1,4 +1,20 @@ + + diff --git a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/CorpusStatus.java b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/CorpusStatus.java index 59208421..39cfeb98 100644 --- a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/CorpusStatus.java +++ b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/CorpusStatus.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/PIMEUpdate.java b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/PIMEUpdate.java index d42634b5..fc3aa09a 100644 --- a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/PIMEUpdate.java +++ b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/PIMEUpdate.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/PIMEUpdateResponse.java b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/PIMEUpdateResponse.java index f82c8656..8e765504 100644 --- a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/PIMEUpdateResponse.java +++ b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/PIMEUpdateResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/QuerySpecification.java b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/QuerySpecification.java index b45e8744..ea2e88f8 100644 --- a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/QuerySpecification.java +++ b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/QuerySpecification.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/RequestIndexingSpecification.java b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/RequestIndexingSpecification.java index ca32c018..55cceb01 100644 --- a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/RequestIndexingSpecification.java +++ b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/RequestIndexingSpecification.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/SearchResults.java b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/SearchResults.java index 6f3619a9..567914d7 100644 --- a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/SearchResults.java +++ b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/SearchResults.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/SuggestSpecification.java b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/SuggestSpecification.java index 0c224091..66984162 100644 --- a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/SuggestSpecification.java +++ b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/SuggestSpecification.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/SuggestionResults.java b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/SuggestionResults.java index 8b51c8aa..159c3d3d 100644 --- a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/SuggestionResults.java +++ b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/SuggestionResults.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/UsageInfo.java b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/UsageInfo.java index adb7e2b3..6ed3ab34 100644 --- a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/UsageInfo.java +++ b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/UsageInfo.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEvent.java b/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEvent.java index b7b5269f..e745c838 100644 --- a/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEvent.java +++ b/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEvent.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.auth; import org.microg.safeparcel.AutoSafeParcelable; diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEventsRequest.java b/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEventsRequest.java index 323bd223..abca68a4 100644 --- a/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEventsRequest.java +++ b/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEventsRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEventsResponse.java b/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEventsResponse.java index 1aebe5bf..f424e473 100644 --- a/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEventsResponse.java +++ b/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEventsResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/TokenRequest.java b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/TokenRequest.java index 1388bbdc..f9325a0d 100644 --- a/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/TokenRequest.java +++ b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/TokenRequest.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.auth.firstparty.dataservice; public class TokenRequest { diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/TokenResponse.java b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/TokenResponse.java index 3b1b22ac..d0285d6e 100644 --- a/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/TokenResponse.java +++ b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/TokenResponse.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.auth.firstparty.dataservice; public class TokenResponse { diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/proximity/data/Permit.java b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/proximity/data/Permit.java index fcd07ddd..88153f4d 100644 --- a/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/proximity/data/Permit.java +++ b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/proximity/data/Permit.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.auth.firstparty.proximity.data; public class Permit { diff --git a/play-services-api/src/main/java/com/google/android/gms/cast/ApplicationMetadata.java b/play-services-api/src/main/java/com/google/android/gms/cast/ApplicationMetadata.java index 46cf7751..67ddc104 100644 --- a/play-services-api/src/main/java/com/google/android/gms/cast/ApplicationMetadata.java +++ b/play-services-api/src/main/java/com/google/android/gms/cast/ApplicationMetadata.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-api/src/main/java/com/google/android/gms/cast/CastDevice.java b/play-services-api/src/main/java/com/google/android/gms/cast/CastDevice.java index 22ab65c8..6645c95e 100644 --- a/play-services-api/src/main/java/com/google/android/gms/cast/CastDevice.java +++ b/play-services-api/src/main/java/com/google/android/gms/cast/CastDevice.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-api/src/main/java/com/google/android/gms/cast/LaunchOptions.java b/play-services-api/src/main/java/com/google/android/gms/cast/LaunchOptions.java index 3a550360..08e9268e 100644 --- a/play-services-api/src/main/java/com/google/android/gms/cast/LaunchOptions.java +++ b/play-services-api/src/main/java/com/google/android/gms/cast/LaunchOptions.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-api/src/main/java/com/google/android/gms/common/Scopes.java b/play-services-api/src/main/java/com/google/android/gms/common/Scopes.java index bbc0f55f..68c09de3 100644 --- a/play-services-api/src/main/java/com/google/android/gms/common/Scopes.java +++ b/play-services-api/src/main/java/com/google/android/gms/common/Scopes.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.common; public class Scopes { diff --git a/play-services-api/src/main/java/com/google/android/gms/common/api/AccountInfo.java b/play-services-api/src/main/java/com/google/android/gms/common/api/AccountInfo.java index ad7e899b..109be301 100644 --- a/play-services-api/src/main/java/com/google/android/gms/common/api/AccountInfo.java +++ b/play-services-api/src/main/java/com/google/android/gms/common/api/AccountInfo.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.common.api; import org.microg.safeparcel.AutoSafeParcelable; diff --git a/play-services-api/src/main/java/com/google/android/gms/common/api/CommonStatusCodes.java b/play-services-api/src/main/java/com/google/android/gms/common/api/CommonStatusCodes.java index 402d501e..aee720c4 100644 --- a/play-services-api/src/main/java/com/google/android/gms/common/api/CommonStatusCodes.java +++ b/play-services-api/src/main/java/com/google/android/gms/common/api/CommonStatusCodes.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-api/src/main/java/com/google/android/gms/common/api/Result.java b/play-services-api/src/main/java/com/google/android/gms/common/api/Result.java index 394234d0..2b24dd63 100644 --- a/play-services-api/src/main/java/com/google/android/gms/common/api/Result.java +++ b/play-services-api/src/main/java/com/google/android/gms/common/api/Result.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.common.api; import org.microg.gms.common.PublicApi; diff --git a/play-services-api/src/main/java/com/google/android/gms/common/api/Scope.java b/play-services-api/src/main/java/com/google/android/gms/common/api/Scope.java index 5334f1e5..cc2cf6a9 100644 --- a/play-services-api/src/main/java/com/google/android/gms/common/api/Scope.java +++ b/play-services-api/src/main/java/com/google/android/gms/common/api/Scope.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.common.api; import org.microg.gms.common.PublicApi; diff --git a/play-services-api/src/main/java/com/google/android/gms/common/api/Status.java b/play-services-api/src/main/java/com/google/android/gms/common/api/Status.java index cb918f5b..480ea072 100644 --- a/play-services-api/src/main/java/com/google/android/gms/common/api/Status.java +++ b/play-services-api/src/main/java/com/google/android/gms/common/api/Status.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.common.api; import android.app.PendingIntent; diff --git a/play-services-api/src/main/java/com/google/android/gms/common/data/DataHolder.java b/play-services-api/src/main/java/com/google/android/gms/common/data/DataHolder.java index e3bc9c1d..bd1efdcb 100644 --- a/play-services-api/src/main/java/com/google/android/gms/common/data/DataHolder.java +++ b/play-services-api/src/main/java/com/google/android/gms/common/data/DataHolder.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.common.data; import android.annotation.SuppressLint; diff --git a/play-services-api/src/main/java/com/google/android/gms/common/data/Freezable.java b/play-services-api/src/main/java/com/google/android/gms/common/data/Freezable.java index a6d69d46..78b66ff5 100644 --- a/play-services-api/src/main/java/com/google/android/gms/common/data/Freezable.java +++ b/play-services-api/src/main/java/com/google/android/gms/common/data/Freezable.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-api/src/main/java/com/google/android/gms/common/images/WebImage.java b/play-services-api/src/main/java/com/google/android/gms/common/images/WebImage.java index 58e29863..57d775dd 100644 --- a/play-services-api/src/main/java/com/google/android/gms/common/images/WebImage.java +++ b/play-services-api/src/main/java/com/google/android/gms/common/images/WebImage.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-api/src/main/java/com/google/android/gms/common/internal/GetServiceRequest.java b/play-services-api/src/main/java/com/google/android/gms/common/internal/GetServiceRequest.java index 80bbc234..9633516d 100644 --- a/play-services-api/src/main/java/com/google/android/gms/common/internal/GetServiceRequest.java +++ b/play-services-api/src/main/java/com/google/android/gms/common/internal/GetServiceRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-api/src/main/java/com/google/android/gms/common/internal/ValidateAccountRequest.java b/play-services-api/src/main/java/com/google/android/gms/common/internal/ValidateAccountRequest.java index 88587e7a..a294b8b2 100644 --- a/play-services-api/src/main/java/com/google/android/gms/common/internal/ValidateAccountRequest.java +++ b/play-services-api/src/main/java/com/google/android/gms/common/internal/ValidateAccountRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-api/src/main/java/com/google/android/gms/common/server/FavaDiagnosticsEntity.java b/play-services-api/src/main/java/com/google/android/gms/common/server/FavaDiagnosticsEntity.java index b63d8f79..1efefe58 100644 --- a/play-services-api/src/main/java/com/google/android/gms/common/server/FavaDiagnosticsEntity.java +++ b/play-services-api/src/main/java/com/google/android/gms/common/server/FavaDiagnosticsEntity.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/metadata/internal/MetadataBundle.java b/play-services-api/src/main/java/com/google/android/gms/drive/metadata/internal/MetadataBundle.java index 538defa0..a3cdf3bf 100644 --- a/play-services-api/src/main/java/com/google/android/gms/drive/metadata/internal/MetadataBundle.java +++ b/play-services-api/src/main/java/com/google/android/gms/drive/metadata/internal/MetadataBundle.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.drive.metadata.internal; public class MetadataBundle { diff --git a/play-services-api/src/main/java/com/google/android/gms/dynamic/ObjectWrapper.java b/play-services-api/src/main/java/com/google/android/gms/dynamic/ObjectWrapper.java index 04a5e582..9e53e1da 100644 --- a/play-services-api/src/main/java/com/google/android/gms/dynamic/ObjectWrapper.java +++ b/play-services-api/src/main/java/com/google/android/gms/dynamic/ObjectWrapper.java @@ -1,11 +1,11 @@ /* - * Copyright (c) 2014 μg Project Team + * Copyright 2013-2015 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 + * 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, diff --git a/play-services-api/src/main/java/com/google/android/gms/fitness/data/DataPoint.java b/play-services-api/src/main/java/com/google/android/gms/fitness/data/DataPoint.java index e81a0172..638d69b0 100644 --- a/play-services-api/src/main/java/com/google/android/gms/fitness/data/DataPoint.java +++ b/play-services-api/src/main/java/com/google/android/gms/fitness/data/DataPoint.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.fitness.data; public class DataPoint { diff --git a/play-services-api/src/main/java/com/google/android/gms/fitness/data/Device.java b/play-services-api/src/main/java/com/google/android/gms/fitness/data/Device.java index 173f134f..e4ecc867 100644 --- a/play-services-api/src/main/java/com/google/android/gms/fitness/data/Device.java +++ b/play-services-api/src/main/java/com/google/android/gms/fitness/data/Device.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.fitness.data; public class Device { diff --git a/play-services-api/src/main/java/com/google/android/gms/fitness/data/Field.java b/play-services-api/src/main/java/com/google/android/gms/fitness/data/Field.java index ee2211d4..1fe541c9 100644 --- a/play-services-api/src/main/java/com/google/android/gms/fitness/data/Field.java +++ b/play-services-api/src/main/java/com/google/android/gms/fitness/data/Field.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.fitness.data; public class Field { diff --git a/play-services-api/src/main/java/com/google/android/gms/fitness/data/Value.java b/play-services-api/src/main/java/com/google/android/gms/fitness/data/Value.java index 91cd4b78..70135548 100644 --- a/play-services-api/src/main/java/com/google/android/gms/fitness/data/Value.java +++ b/play-services-api/src/main/java/com/google/android/gms/fitness/data/Value.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.fitness.data; public class Value { diff --git a/play-services-api/src/main/java/com/google/android/gms/identity/accounts/api/AccountData.java b/play-services-api/src/main/java/com/google/android/gms/identity/accounts/api/AccountData.java index 993f6417..8c50d6a2 100644 --- a/play-services-api/src/main/java/com/google/android/gms/identity/accounts/api/AccountData.java +++ b/play-services-api/src/main/java/com/google/android/gms/identity/accounts/api/AccountData.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.identity.accounts.api; public class AccountData { diff --git a/play-services-api/src/main/java/com/google/android/gms/identity/intents/model/CountrySpecification.java b/play-services-api/src/main/java/com/google/android/gms/identity/intents/model/CountrySpecification.java index 1c9fe39b..1c02f8c2 100644 --- a/play-services-api/src/main/java/com/google/android/gms/identity/intents/model/CountrySpecification.java +++ b/play-services-api/src/main/java/com/google/android/gms/identity/intents/model/CountrySpecification.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.identity.intents.model; public class CountrySpecification { diff --git a/play-services-api/src/main/java/com/google/android/gms/identity/intents/model/UserAddress.java b/play-services-api/src/main/java/com/google/android/gms/identity/intents/model/UserAddress.java index 3595f666..5b574221 100644 --- a/play-services-api/src/main/java/com/google/android/gms/identity/intents/model/UserAddress.java +++ b/play-services-api/src/main/java/com/google/android/gms/identity/intents/model/UserAddress.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.identity.intents.model; public class UserAddress { diff --git a/play-services-api/src/main/java/com/google/android/gms/location/Geofence.java b/play-services-api/src/main/java/com/google/android/gms/location/Geofence.java index 5b02f833..c48aef56 100644 --- a/play-services-api/src/main/java/com/google/android/gms/location/Geofence.java +++ b/play-services-api/src/main/java/com/google/android/gms/location/Geofence.java @@ -1,11 +1,11 @@ /* - * Copyright (c) 2014 μg Project Team + * Copyright 2013-2015 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 + * 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, diff --git a/play-services-api/src/main/java/com/google/android/gms/location/GeofencingRequest.java b/play-services-api/src/main/java/com/google/android/gms/location/GeofencingRequest.java index 73f955d8..2c9fb176 100644 --- a/play-services-api/src/main/java/com/google/android/gms/location/GeofencingRequest.java +++ b/play-services-api/src/main/java/com/google/android/gms/location/GeofencingRequest.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.location; import org.microg.safeparcel.AutoSafeParcelable; diff --git a/play-services-api/src/main/java/com/google/android/gms/location/LocationRequest.java b/play-services-api/src/main/java/com/google/android/gms/location/LocationRequest.java index b5249b3e..41660fac 100644 --- a/play-services-api/src/main/java/com/google/android/gms/location/LocationRequest.java +++ b/play-services-api/src/main/java/com/google/android/gms/location/LocationRequest.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.location; import android.os.SystemClock; diff --git a/play-services-api/src/main/java/com/google/android/gms/location/LocationStatus.java b/play-services-api/src/main/java/com/google/android/gms/location/LocationStatus.java index 7fcd9079..9e3e77a8 100644 --- a/play-services-api/src/main/java/com/google/android/gms/location/LocationStatus.java +++ b/play-services-api/src/main/java/com/google/android/gms/location/LocationStatus.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.location; import org.microg.safeparcel.AutoSafeParcelable; diff --git a/play-services-api/src/main/java/com/google/android/gms/location/internal/ClientIdentity.java b/play-services-api/src/main/java/com/google/android/gms/location/internal/ClientIdentity.java index afb034ba..7c707529 100644 --- a/play-services-api/src/main/java/com/google/android/gms/location/internal/ClientIdentity.java +++ b/play-services-api/src/main/java/com/google/android/gms/location/internal/ClientIdentity.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.location.internal; public class ClientIdentity { diff --git a/play-services-api/src/main/java/com/google/android/gms/location/internal/LocationRequestInternal.java b/play-services-api/src/main/java/com/google/android/gms/location/internal/LocationRequestInternal.java index 6bd6108e..c7eb2e15 100644 --- a/play-services-api/src/main/java/com/google/android/gms/location/internal/LocationRequestInternal.java +++ b/play-services-api/src/main/java/com/google/android/gms/location/internal/LocationRequestInternal.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.location.internal; import org.microg.safeparcel.AutoSafeParcelable; diff --git a/play-services-api/src/main/java/com/google/android/gms/location/places/AutocompleteFilter.java b/play-services-api/src/main/java/com/google/android/gms/location/places/AutocompleteFilter.java index a0d85e33..c0816ac1 100644 --- a/play-services-api/src/main/java/com/google/android/gms/location/places/AutocompleteFilter.java +++ b/play-services-api/src/main/java/com/google/android/gms/location/places/AutocompleteFilter.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.location.places; import org.microg.safeparcel.AutoSafeParcelable; diff --git a/play-services-api/src/main/java/com/google/android/gms/location/places/NearbyAlertRequest.java b/play-services-api/src/main/java/com/google/android/gms/location/places/NearbyAlertRequest.java index add70cce..35c05ddc 100644 --- a/play-services-api/src/main/java/com/google/android/gms/location/places/NearbyAlertRequest.java +++ b/play-services-api/src/main/java/com/google/android/gms/location/places/NearbyAlertRequest.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.location.places; import org.microg.safeparcel.AutoSafeParcelable; diff --git a/play-services-api/src/main/java/com/google/android/gms/location/places/PlaceFilter.java b/play-services-api/src/main/java/com/google/android/gms/location/places/PlaceFilter.java index 57bebb51..e0c27975 100644 --- a/play-services-api/src/main/java/com/google/android/gms/location/places/PlaceFilter.java +++ b/play-services-api/src/main/java/com/google/android/gms/location/places/PlaceFilter.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.location.places; import org.microg.safeparcel.AutoSafeParcelable; diff --git a/play-services-api/src/main/java/com/google/android/gms/location/places/PlaceReport.java b/play-services-api/src/main/java/com/google/android/gms/location/places/PlaceReport.java index eaef07eb..77c230e7 100644 --- a/play-services-api/src/main/java/com/google/android/gms/location/places/PlaceReport.java +++ b/play-services-api/src/main/java/com/google/android/gms/location/places/PlaceReport.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.location.places; import org.microg.safeparcel.AutoSafeParcelable; diff --git a/play-services-api/src/main/java/com/google/android/gms/location/places/PlaceRequest.java b/play-services-api/src/main/java/com/google/android/gms/location/places/PlaceRequest.java index 6817f7d1..9b1f7d64 100644 --- a/play-services-api/src/main/java/com/google/android/gms/location/places/PlaceRequest.java +++ b/play-services-api/src/main/java/com/google/android/gms/location/places/PlaceRequest.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.location.places; import org.microg.safeparcel.AutoSafeParcelable; diff --git a/play-services-api/src/main/java/com/google/android/gms/location/places/UserAddedPlace.java b/play-services-api/src/main/java/com/google/android/gms/location/places/UserAddedPlace.java index 2b46a618..ba26477a 100644 --- a/play-services-api/src/main/java/com/google/android/gms/location/places/UserAddedPlace.java +++ b/play-services-api/src/main/java/com/google/android/gms/location/places/UserAddedPlace.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.location.places; import org.microg.safeparcel.AutoSafeParcelable; diff --git a/play-services-api/src/main/java/com/google/android/gms/location/places/UserDataType.java b/play-services-api/src/main/java/com/google/android/gms/location/places/UserDataType.java index cb253f68..67da13e8 100644 --- a/play-services-api/src/main/java/com/google/android/gms/location/places/UserDataType.java +++ b/play-services-api/src/main/java/com/google/android/gms/location/places/UserDataType.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.location.places; import org.microg.safeparcel.AutoSafeParcelable; diff --git a/play-services-api/src/main/java/com/google/android/gms/location/places/internal/PlacesParams.java b/play-services-api/src/main/java/com/google/android/gms/location/places/internal/PlacesParams.java index fce36072..f131094e 100644 --- a/play-services-api/src/main/java/com/google/android/gms/location/places/internal/PlacesParams.java +++ b/play-services-api/src/main/java/com/google/android/gms/location/places/internal/PlacesParams.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.location.places.internal; import org.microg.safeparcel.AutoSafeParcelable; diff --git a/play-services-api/src/main/java/com/google/android/gms/location/reporting/ReportingState.java b/play-services-api/src/main/java/com/google/android/gms/location/reporting/ReportingState.java index f30b7c10..bca2b791 100644 --- a/play-services-api/src/main/java/com/google/android/gms/location/reporting/ReportingState.java +++ b/play-services-api/src/main/java/com/google/android/gms/location/reporting/ReportingState.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/GoogleMapOptions.java b/play-services-api/src/main/java/com/google/android/gms/maps/GoogleMapOptions.java index e7521751..7e24955c 100644 --- a/play-services-api/src/main/java/com/google/android/gms/maps/GoogleMapOptions.java +++ b/play-services-api/src/main/java/com/google/android/gms/maps/GoogleMapOptions.java @@ -1,11 +1,11 @@ /* - * Copyright (c) 2014 μg Project Team + * Copyright 2013-2015 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 + * 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, diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/StreetViewPanoramaOptions.java b/play-services-api/src/main/java/com/google/android/gms/maps/StreetViewPanoramaOptions.java index 3d1810c4..19ecb9a9 100644 --- a/play-services-api/src/main/java/com/google/android/gms/maps/StreetViewPanoramaOptions.java +++ b/play-services-api/src/main/java/com/google/android/gms/maps/StreetViewPanoramaOptions.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.maps; public class StreetViewPanoramaOptions { diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/internal/Point.java b/play-services-api/src/main/java/com/google/android/gms/maps/internal/Point.java index 43ada12e..b3454104 100644 --- a/play-services-api/src/main/java/com/google/android/gms/maps/internal/Point.java +++ b/play-services-api/src/main/java/com/google/android/gms/maps/internal/Point.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.maps.internal; public class Point { diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/model/BitmapDescriptor.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/BitmapDescriptor.java index 9b45597b..4815cbb0 100644 --- a/play-services-api/src/main/java/com/google/android/gms/maps/model/BitmapDescriptor.java +++ b/play-services-api/src/main/java/com/google/android/gms/maps/model/BitmapDescriptor.java @@ -1,11 +1,11 @@ /* - * Copyright (c) 2014 μg Project Team + * Copyright 2013-2015 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 + * 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, diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/model/CameraPosition.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/CameraPosition.java index d2efd7e1..3ceb21f5 100644 --- a/play-services-api/src/main/java/com/google/android/gms/maps/model/CameraPosition.java +++ b/play-services-api/src/main/java/com/google/android/gms/maps/model/CameraPosition.java @@ -1,11 +1,11 @@ /* - * Copyright (c) 2014 μg Project Team + * Copyright 2013-2015 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 + * 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, diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/model/CircleOptions.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/CircleOptions.java index 4f528850..29a17b1e 100644 --- a/play-services-api/src/main/java/com/google/android/gms/maps/model/CircleOptions.java +++ b/play-services-api/src/main/java/com/google/android/gms/maps/model/CircleOptions.java @@ -1,11 +1,11 @@ /* - * Copyright (c) 2014 μg Project Team + * Copyright 2013-2015 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 + * 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, diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/model/GroundOverlayOptions.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/GroundOverlayOptions.java index 920c43a7..086916b5 100644 --- a/play-services-api/src/main/java/com/google/android/gms/maps/model/GroundOverlayOptions.java +++ b/play-services-api/src/main/java/com/google/android/gms/maps/model/GroundOverlayOptions.java @@ -1,11 +1,11 @@ /* - * Copyright (c) 2014 μg Project Team + * Copyright 2013-2015 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 + * 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, diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/model/LatLng.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/LatLng.java index 8bd58e9d..8339202b 100644 --- a/play-services-api/src/main/java/com/google/android/gms/maps/model/LatLng.java +++ b/play-services-api/src/main/java/com/google/android/gms/maps/model/LatLng.java @@ -1,11 +1,11 @@ /* - * Copyright (c) 2014 μg Project Team + * Copyright 2013-2015 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 + * 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, diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/model/LatLngBounds.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/LatLngBounds.java index 648ccf7b..0c44d95f 100644 --- a/play-services-api/src/main/java/com/google/android/gms/maps/model/LatLngBounds.java +++ b/play-services-api/src/main/java/com/google/android/gms/maps/model/LatLngBounds.java @@ -1,11 +1,11 @@ /* - * Copyright (c) 2014 μg Project Team + * Copyright 2013-2015 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 + * 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, diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/model/MarkerOptions.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/MarkerOptions.java index 79a49d87..59bb805a 100644 --- a/play-services-api/src/main/java/com/google/android/gms/maps/model/MarkerOptions.java +++ b/play-services-api/src/main/java/com/google/android/gms/maps/model/MarkerOptions.java @@ -1,11 +1,11 @@ /* - * Copyright (c) 2014 μg Project Team + * Copyright 2013-2015 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 + * 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, diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/model/PolygonOptions.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/PolygonOptions.java index a65e782d..92c42a1a 100644 --- a/play-services-api/src/main/java/com/google/android/gms/maps/model/PolygonOptions.java +++ b/play-services-api/src/main/java/com/google/android/gms/maps/model/PolygonOptions.java @@ -1,11 +1,11 @@ /* - * Copyright (c) 2014 μg Project Team + * Copyright 2013-2015 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 + * 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, diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/model/PolylineOptions.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/PolylineOptions.java index a42fac5f..dc3db1f0 100644 --- a/play-services-api/src/main/java/com/google/android/gms/maps/model/PolylineOptions.java +++ b/play-services-api/src/main/java/com/google/android/gms/maps/model/PolylineOptions.java @@ -1,11 +1,11 @@ /* - * Copyright (c) 2014 μg Project Team + * Copyright 2013-2015 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 + * 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, diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/model/StreetViewPanoramaCamera.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/StreetViewPanoramaCamera.java index 585fc072..285018aa 100644 --- a/play-services-api/src/main/java/com/google/android/gms/maps/model/StreetViewPanoramaCamera.java +++ b/play-services-api/src/main/java/com/google/android/gms/maps/model/StreetViewPanoramaCamera.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.maps.model; import org.microg.gms.common.PublicApi; diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/model/StreetViewPanoramaLink.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/StreetViewPanoramaLink.java index 88cf0542..b3bb524f 100644 --- a/play-services-api/src/main/java/com/google/android/gms/maps/model/StreetViewPanoramaLink.java +++ b/play-services-api/src/main/java/com/google/android/gms/maps/model/StreetViewPanoramaLink.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.maps.model; import org.microg.gms.common.PublicApi; diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/model/StreetViewPanoramaLocation.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/StreetViewPanoramaLocation.java index 75422e12..0c1ffb25 100644 --- a/play-services-api/src/main/java/com/google/android/gms/maps/model/StreetViewPanoramaLocation.java +++ b/play-services-api/src/main/java/com/google/android/gms/maps/model/StreetViewPanoramaLocation.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.maps.model; import org.microg.gms.common.PublicApi; diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/model/StreetViewPanoramaOrientation.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/StreetViewPanoramaOrientation.java index 9b77f9b4..e0d2df12 100644 --- a/play-services-api/src/main/java/com/google/android/gms/maps/model/StreetViewPanoramaOrientation.java +++ b/play-services-api/src/main/java/com/google/android/gms/maps/model/StreetViewPanoramaOrientation.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.maps.model; import org.microg.gms.common.PublicApi; diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/model/Tile.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/Tile.java index 5063bcdf..b5ac4730 100644 --- a/play-services-api/src/main/java/com/google/android/gms/maps/model/Tile.java +++ b/play-services-api/src/main/java/com/google/android/gms/maps/model/Tile.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.maps.model; import org.microg.gms.common.PublicApi; diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/model/TileOverlayOptions.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/TileOverlayOptions.java index 70c967ec..88d9334a 100644 --- a/play-services-api/src/main/java/com/google/android/gms/maps/model/TileOverlayOptions.java +++ b/play-services-api/src/main/java/com/google/android/gms/maps/model/TileOverlayOptions.java @@ -1,11 +1,11 @@ /* - * Copyright (c) 2014 μg Project Team + * Copyright 2013-2015 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 + * 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, diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/model/TileProvider.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/TileProvider.java index 21eaaadc..d20bf2d2 100644 --- a/play-services-api/src/main/java/com/google/android/gms/maps/model/TileProvider.java +++ b/play-services-api/src/main/java/com/google/android/gms/maps/model/TileProvider.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.maps.model; /** diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/model/VisibleRegion.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/VisibleRegion.java index 105c1089..0e418ecf 100644 --- a/play-services-api/src/main/java/com/google/android/gms/maps/model/VisibleRegion.java +++ b/play-services-api/src/main/java/com/google/android/gms/maps/model/VisibleRegion.java @@ -1,11 +1,11 @@ /* - * Copyright (c) 2014 μg Project Team + * Copyright 2013-2015 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 + * 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, diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/model/package-info.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/package-info.java index de5998b2..fa64f30b 100644 --- a/play-services-api/src/main/java/com/google/android/gms/maps/model/package-info.java +++ b/play-services-api/src/main/java/com/google/android/gms/maps/model/package-info.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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. + */ + /** * Contains the Google Maps Android API model classes. */ diff --git a/play-services-api/src/main/java/com/google/android/gms/people/model/AccountMetadata.java b/play-services-api/src/main/java/com/google/android/gms/people/model/AccountMetadata.java index f62e3eb0..f14fcc56 100644 --- a/play-services-api/src/main/java/com/google/android/gms/people/model/AccountMetadata.java +++ b/play-services-api/src/main/java/com/google/android/gms/people/model/AccountMetadata.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-api/src/main/java/com/google/android/gms/playlog/internal/LogEvent.java b/play-services-api/src/main/java/com/google/android/gms/playlog/internal/LogEvent.java index 96758caf..dbc38c20 100644 --- a/play-services-api/src/main/java/com/google/android/gms/playlog/internal/LogEvent.java +++ b/play-services-api/src/main/java/com/google/android/gms/playlog/internal/LogEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-api/src/main/java/com/google/android/gms/playlog/internal/PlayLoggerContext.java b/play-services-api/src/main/java/com/google/android/gms/playlog/internal/PlayLoggerContext.java index f524b62c..ce6818db 100644 --- a/play-services-api/src/main/java/com/google/android/gms/playlog/internal/PlayLoggerContext.java +++ b/play-services-api/src/main/java/com/google/android/gms/playlog/internal/PlayLoggerContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-api/src/main/java/com/google/android/gms/plus/internal/PlusCommonExtras.java b/play-services-api/src/main/java/com/google/android/gms/plus/internal/PlusCommonExtras.java index b8735781..2f4893ac 100644 --- a/play-services-api/src/main/java/com/google/android/gms/plus/internal/PlusCommonExtras.java +++ b/play-services-api/src/main/java/com/google/android/gms/plus/internal/PlusCommonExtras.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.plus.internal; public class PlusCommonExtras { diff --git a/play-services-api/src/main/java/com/google/android/gms/plus/internal/PlusSession.java b/play-services-api/src/main/java/com/google/android/gms/plus/internal/PlusSession.java index d8b6c9a1..efed1606 100644 --- a/play-services-api/src/main/java/com/google/android/gms/plus/internal/PlusSession.java +++ b/play-services-api/src/main/java/com/google/android/gms/plus/internal/PlusSession.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.plus.internal; public class PlusSession { diff --git a/play-services-api/src/main/java/com/google/android/gms/plus/internal/model/smart_profile/CardsRequest.java b/play-services-api/src/main/java/com/google/android/gms/plus/internal/model/smart_profile/CardsRequest.java index 2237e011..dab078f0 100644 --- a/play-services-api/src/main/java/com/google/android/gms/plus/internal/model/smart_profile/CardsRequest.java +++ b/play-services-api/src/main/java/com/google/android/gms/plus/internal/model/smart_profile/CardsRequest.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.plus.internal.model.smart_profile; public class CardsRequest { diff --git a/play-services-api/src/main/java/com/google/android/gms/plus/internal/model/smart_profile/CardsResponse.java b/play-services-api/src/main/java/com/google/android/gms/plus/internal/model/smart_profile/CardsResponse.java index c6f3f23a..219f0030 100644 --- a/play-services-api/src/main/java/com/google/android/gms/plus/internal/model/smart_profile/CardsResponse.java +++ b/play-services-api/src/main/java/com/google/android/gms/plus/internal/model/smart_profile/CardsResponse.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.plus.internal.model.smart_profile; public class CardsResponse { diff --git a/play-services-api/src/main/java/com/google/android/gms/plus/internal/model/smart_profile/PeopleForProfilesRequest.java b/play-services-api/src/main/java/com/google/android/gms/plus/internal/model/smart_profile/PeopleForProfilesRequest.java index 7f4374c3..bd4e9fcf 100644 --- a/play-services-api/src/main/java/com/google/android/gms/plus/internal/model/smart_profile/PeopleForProfilesRequest.java +++ b/play-services-api/src/main/java/com/google/android/gms/plus/internal/model/smart_profile/PeopleForProfilesRequest.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.plus.internal.model.smart_profile; public class PeopleForProfilesRequest { diff --git a/play-services-api/src/main/java/com/google/android/gms/plus/internal/model/smart_profile/PeopleForProfilesResponse.java b/play-services-api/src/main/java/com/google/android/gms/plus/internal/model/smart_profile/PeopleForProfilesResponse.java index 28bc9b79..eea61723 100644 --- a/play-services-api/src/main/java/com/google/android/gms/plus/internal/model/smart_profile/PeopleForProfilesResponse.java +++ b/play-services-api/src/main/java/com/google/android/gms/plus/internal/model/smart_profile/PeopleForProfilesResponse.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.plus.internal.model.smart_profile; public class PeopleForProfilesResponse { diff --git a/play-services-api/src/main/java/com/google/android/gms/plus/model/posts/Comment.java b/play-services-api/src/main/java/com/google/android/gms/plus/model/posts/Comment.java index 34b179a5..6901aed0 100644 --- a/play-services-api/src/main/java/com/google/android/gms/plus/model/posts/Comment.java +++ b/play-services-api/src/main/java/com/google/android/gms/plus/model/posts/Comment.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.plus.model.posts; public class Comment { diff --git a/play-services-api/src/main/java/com/google/android/gms/plus/model/posts/Post.java b/play-services-api/src/main/java/com/google/android/gms/plus/model/posts/Post.java index 68d73f26..3bcd6450 100644 --- a/play-services-api/src/main/java/com/google/android/gms/plus/model/posts/Post.java +++ b/play-services-api/src/main/java/com/google/android/gms/plus/model/posts/Post.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.plus.model.posts; public class Post { diff --git a/play-services-api/src/main/java/com/google/android/gms/plus/model/posts/Settings.java b/play-services-api/src/main/java/com/google/android/gms/plus/model/posts/Settings.java index 943d0ced..877aacea 100644 --- a/play-services-api/src/main/java/com/google/android/gms/plus/model/posts/Settings.java +++ b/play-services-api/src/main/java/com/google/android/gms/plus/model/posts/Settings.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.plus.model.posts; public class Settings { diff --git a/play-services-api/src/main/java/com/google/android/gms/search/corpora/ClearCorpusRequest.java b/play-services-api/src/main/java/com/google/android/gms/search/corpora/ClearCorpusRequest.java index 9bd5d83b..1c4843be 100644 --- a/play-services-api/src/main/java/com/google/android/gms/search/corpora/ClearCorpusRequest.java +++ b/play-services-api/src/main/java/com/google/android/gms/search/corpora/ClearCorpusRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-api/src/main/java/com/google/android/gms/search/corpora/GetCorpusInfoRequest.java b/play-services-api/src/main/java/com/google/android/gms/search/corpora/GetCorpusInfoRequest.java index bdc842ff..8f27b0a1 100644 --- a/play-services-api/src/main/java/com/google/android/gms/search/corpora/GetCorpusInfoRequest.java +++ b/play-services-api/src/main/java/com/google/android/gms/search/corpora/GetCorpusInfoRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-api/src/main/java/com/google/android/gms/search/corpora/GetCorpusStatusRequest.java b/play-services-api/src/main/java/com/google/android/gms/search/corpora/GetCorpusStatusRequest.java index d1a93896..8e35527b 100644 --- a/play-services-api/src/main/java/com/google/android/gms/search/corpora/GetCorpusStatusRequest.java +++ b/play-services-api/src/main/java/com/google/android/gms/search/corpora/GetCorpusStatusRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-api/src/main/java/com/google/android/gms/search/corpora/GetCorpusStatusResponse.java b/play-services-api/src/main/java/com/google/android/gms/search/corpora/GetCorpusStatusResponse.java index bbccbec9..7a96d775 100644 --- a/play-services-api/src/main/java/com/google/android/gms/search/corpora/GetCorpusStatusResponse.java +++ b/play-services-api/src/main/java/com/google/android/gms/search/corpora/GetCorpusStatusResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-api/src/main/java/com/google/android/gms/search/corpora/RequestIndexingRequest.java b/play-services-api/src/main/java/com/google/android/gms/search/corpora/RequestIndexingRequest.java index b0f2b460..5920b5cc 100644 --- a/play-services-api/src/main/java/com/google/android/gms/search/corpora/RequestIndexingRequest.java +++ b/play-services-api/src/main/java/com/google/android/gms/search/corpora/RequestIndexingRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-api/src/main/java/com/google/android/gms/search/corpora/RequestIndexingResponse.java b/play-services-api/src/main/java/com/google/android/gms/search/corpora/RequestIndexingResponse.java index 7490f988..fc428b55 100644 --- a/play-services-api/src/main/java/com/google/android/gms/search/corpora/RequestIndexingResponse.java +++ b/play-services-api/src/main/java/com/google/android/gms/search/corpora/RequestIndexingResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-api/src/main/java/com/google/android/gms/search/queries/QueryRequest.java b/play-services-api/src/main/java/com/google/android/gms/search/queries/QueryRequest.java index 4ac607de..24affd75 100644 --- a/play-services-api/src/main/java/com/google/android/gms/search/queries/QueryRequest.java +++ b/play-services-api/src/main/java/com/google/android/gms/search/queries/QueryRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-api/src/main/java/com/google/android/gms/search/queries/QueryResponse.java b/play-services-api/src/main/java/com/google/android/gms/search/queries/QueryResponse.java index e97779f1..3f567097 100644 --- a/play-services-api/src/main/java/com/google/android/gms/search/queries/QueryResponse.java +++ b/play-services-api/src/main/java/com/google/android/gms/search/queries/QueryResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/Asset.java b/play-services-api/src/main/java/com/google/android/gms/wearable/Asset.java index 03480221..92e51be3 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wearable/Asset.java +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/Asset.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/ConnectionConfiguration.java b/play-services-api/src/main/java/com/google/android/gms/wearable/ConnectionConfiguration.java index aebd7d49..eb707a9a 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wearable/ConnectionConfiguration.java +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/ConnectionConfiguration.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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; import org.microg.safeparcel.AutoSafeParcelable; diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/DataItem.java b/play-services-api/src/main/java/com/google/android/gms/wearable/DataItem.java index 9acb48f8..da1a28e0 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wearable/DataItem.java +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/DataItem.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/DataItemAsset.java b/play-services-api/src/main/java/com/google/android/gms/wearable/DataItemAsset.java index 70057975..0dde17d8 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wearable/DataItemAsset.java +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/DataItemAsset.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/Node.java b/play-services-api/src/main/java/com/google/android/gms/wearable/Node.java index f52fe4df..00ed1a47 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wearable/Node.java +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/Node.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/WearableStatusCodes.java b/play-services-api/src/main/java/com/google/android/gms/wearable/WearableStatusCodes.java index 13cc75d2..6f5549d4 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wearable/WearableStatusCodes.java +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/WearableStatusCodes.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/AddListenerRequest.java b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/AddListenerRequest.java index 9e928948..173c2be7 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/AddListenerRequest.java +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/AddListenerRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/CapabilityInfoParcelable.java b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/CapabilityInfoParcelable.java index 92fe8ad9..cdc5d6c4 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/CapabilityInfoParcelable.java +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/CapabilityInfoParcelable.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/ChannelEventParcelable.java b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/ChannelEventParcelable.java index e7eb9c9a..b562032b 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/ChannelEventParcelable.java +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/ChannelEventParcelable.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/DataItemAssetParcelable.java b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/DataItemAssetParcelable.java index f0ec6160..c6fc8768 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/DataItemAssetParcelable.java +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/DataItemAssetParcelable.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/DataItemParcelable.java b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/DataItemParcelable.java index 9fc7b528..1d6bef63 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/DataItemParcelable.java +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/DataItemParcelable.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/DeleteDataItemsResponse.java b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/DeleteDataItemsResponse.java index 220fba4d..d6dc0b0b 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/DeleteDataItemsResponse.java +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/DeleteDataItemsResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetConfigResponse.java b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetConfigResponse.java index b2923e6a..e0ed7e6e 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetConfigResponse.java +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetConfigResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetConfigsResponse.java b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetConfigsResponse.java index 37a16066..8d853489 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetConfigsResponse.java +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetConfigsResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetConnectedNodesResponse.java b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetConnectedNodesResponse.java index cf6e1781..ae25d65d 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetConnectedNodesResponse.java +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetConnectedNodesResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetDataItemResponse.java b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetDataItemResponse.java index 3b1d89c5..cd2d5b02 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetDataItemResponse.java +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetDataItemResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetFdForAssetResponse.java b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetFdForAssetResponse.java index 19294116..4b75d203 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetFdForAssetResponse.java +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetFdForAssetResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetLocalNodeResponse.java b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetLocalNodeResponse.java index 601d23db..ffe8af17 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetLocalNodeResponse.java +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetLocalNodeResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/MessageEventParcelable.java b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/MessageEventParcelable.java index 4dd4ef7f..ef4ffc48 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/MessageEventParcelable.java +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/MessageEventParcelable.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/NodeParcelable.java b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/NodeParcelable.java index 6d9e071d..d1728692 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/NodeParcelable.java +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/NodeParcelable.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/PutDataRequest.java b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/PutDataRequest.java index 56e0abb5..97559a8a 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/PutDataRequest.java +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/PutDataRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/PutDataResponse.java b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/PutDataResponse.java index ef04746e..f722d5c5 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/PutDataResponse.java +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/PutDataResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/RemoveListenerRequest.java b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/RemoveListenerRequest.java index ed19d18b..487bbe58 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/RemoveListenerRequest.java +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/RemoveListenerRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/SendMessageResponse.java b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/SendMessageResponse.java index 03f46d5f..f54fd04f 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/SendMessageResponse.java +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/SendMessageResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/StorageInfoResponse.java b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/StorageInfoResponse.java index d96fd391..755810e5 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/StorageInfoResponse.java +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/StorageInfoResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-api/src/main/java/org/microg/gms/common/Constants.java b/play-services-api/src/main/java/org/microg/gms/common/Constants.java index d2ac6ddf..7e652d6a 100644 --- a/play-services-api/src/main/java/org/microg/gms/common/Constants.java +++ b/play-services-api/src/main/java/org/microg/gms/common/Constants.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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 org.microg.gms.common; public class Constants { diff --git a/play-services-api/src/main/java/org/microg/gms/common/PublicApi.java b/play-services-api/src/main/java/org/microg/gms/common/PublicApi.java index 94f84583..abbb8f1b 100644 --- a/play-services-api/src/main/java/org/microg/gms/common/PublicApi.java +++ b/play-services-api/src/main/java/org/microg/gms/common/PublicApi.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-api/src/main/java/org/microg/gms/common/Services.java b/play-services-api/src/main/java/org/microg/gms/common/Services.java index 01a24ecf..7173d02c 100644 --- a/play-services-api/src/main/java/org/microg/gms/common/Services.java +++ b/play-services-api/src/main/java/org/microg/gms/common/Services.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. From 500032ab2a470cbe0214d8d8ca082add3402545c Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Mon, 28 Sep 2015 18:31:31 +0200 Subject: [PATCH 091/293] Add Gradle wrapper --- .gitignore | 2 - gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 49896 bytes gradle/wrapper/gradle-wrapper.properties | 6 + gradlew | 164 +++++++++++++++++++++++ 4 files changed, 170 insertions(+), 2 deletions(-) create mode 100644 gradle/wrapper/gradle-wrapper.jar create mode 100755 gradle/wrapper/gradle-wrapper.properties create mode 100755 gradlew diff --git a/.gitignore b/.gitignore index bf3b44e9..7e94e073 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,4 @@ out/ build/ *.iml local.properties -gradle/ -gradlew .gradle/ diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000000000000000000000000000000000..8c0fb64a8698b08ecc4158d828ca593c4928e9dd GIT binary patch literal 49896 zcmagFb986H(k`5d^NVfUwr$(C?M#x1ZQHiZiEVpg+jrjgoQrerx!>1o_ul)D>ebz~ zs=Mmxr&>W81QY-S1PKWQ%N-;H^tS;2*XwVA`dej1RRn1z<;3VgfE4~kaG`A%QSPsR z#ovnZe+tS9%1MfeDyz`RirvdjPRK~p(#^q2(^5@O&NM19EHdvN-A&StN>0g6QA^VN z0Gx%Gq#PD$QMRFzmK+utjS^Y1F0e8&u&^=w5K<;4Rz|i3A=o|IKLY+g`iK6vfr9?+ z-`>gmU&i?FGSL5&F?TXFu`&Js6h;15QFkXp2M1H9|Eq~bpov-GU(uz%mH0n55wUl- zv#~ccAz`F5wlQ>e_KlJS3@{)B?^v*EQM=IxLa&76^y51a((wq|2-`qON>+4dLc{Oo z51}}o^Zen(oAjxDK7b++9_Yg`67p$bPo3~BCpGM7uAWmvIhWc5Gi+gQZ|Pwa-Gll@<1xmcPy z|NZmu6m)g5Ftu~BG&Xdxclw7Cij{xbBMBn-LMII#Slp`AElb&2^Hw+w>(3crLH!;I zN+Vk$D+wP1#^!MDCiad@vM>H#6+`Ct#~6VHL4lzmy;lSdk>`z6)=>Wh15Q2)dQtGqvn0vJU@+(B5{MUc*qs4!T+V=q=wy)<6$~ z!G>e_4dN@lGeF_$q9`Ju6Ncb*x?O7=l{anm7Eahuj_6lA{*#Gv*TaJclevPVbbVYu z(NY?5q+xxbO6%g1xF0r@Ix8fJ~u)VRUp`S%&rN$&e!Od`~s+64J z5*)*WSi*i{k%JjMSIN#X;jC{HG$-^iX+5f5BGOIHWAl*%15Z#!xntpk($-EGKCzKa zT7{siZ9;4TICsWQ$pu&wKZQTCvpI$Xvzwxoi+XkkpeE&&kFb!B?h2hi%^YlXt|-@5 zHJ~%AN!g_^tmn1?HSm^|gCE#!GRtK2(L{9pL#hp0xh zME}|DB>(5)`iE7CM)&_+S}-Bslc#@B5W4_+k4Cp$l>iVyg$KP>CN?SVGZ(&02>iZK zB<^HP$g$Lq*L$BWd?2(F?-MUbNWTJVQdW7$#8a|k_30#vHAD1Z{c#p;bETk0VnU5A zBgLe2HFJ3032$G<`m*OB!KM$*sdM20jm)It5OSru@tXpK5LT>#8)N!*skNu1$TpIw zufjjdp#lyH5bZ%|Iuo|iu9vG1HrIVWLH>278xo>aVBkPN3V$~!=KnlXQ4eDqS7%E% zQ!z^$Q$b^6Q)g#cLpwur(|<0gWHo6A6jc;n`t(V9T;LzTAU{IAu*uEQ%Ort1k+Kn+f_N`9|bxYC+~Z1 zCC1UCWv*Orx$_@ydv9mIe(liLfOr7mhbV@tKw{6)q^1DH1nmvZ0cj215R<~&I<4S| zgnr;9Cdjqpz#o8i0CQjtl`}{c*P)aSdH|abxGdrR)-3z+02-eX(k*B)Uqv6~^nh** z zGh0A%o~bd$iYvP!egRY{hObDIvy_vXAOkeTgl5o!33m!l4VLm@<-FwT0+k|yl~vUh z@RFcL4=b(QQQmwQ;>FS_e96dyIU`jmR%&&Amxcb8^&?wvpK{_V_IbmqHh);$hBa~S z;^ph!k~noKv{`Ix7Hi&;Hq%y3wpqUsYO%HhI3Oe~HPmjnSTEasoU;Q_UfYbzd?Vv@ zD6ztDG|W|%xq)xqSx%bU1f>fF#;p9g=Hnjph>Pp$ZHaHS@-DkHw#H&vb1gARf4A*zm3Z75QQ6l( z=-MPMjish$J$0I49EEg^Ykw8IqSY`XkCP&TC?!7zmO`ILgJ9R{56s-ZY$f> zU9GwXt`(^0LGOD9@WoNFK0owGKDC1)QACY_r#@IuE2<`tep4B#I^(PRQ_-Fw(5nws zpkX=rVeVXzR;+%UzoNa;jjx<&@ABmU5X926KsQsz40o*{@47S2 z)p9z@lt=9?A2~!G*QqJWYT5z^CTeckRwhSWiC3h8PQ0M9R}_#QC+lz>`?kgy2DZio zz&2Ozo=yTXVf-?&E;_t`qY{Oy>?+7+I= zWl!tZM_YCLmGXY1nKbIHc;*Mag{Nzx-#yA{ zTATrWj;Nn;NWm6_1#0zy9SQiQV=38f(`DRgD|RxwggL(!^`}lcDTuL4RtLB2F5)lt z=mNMJN|1gcui=?#{NfL{r^nQY+_|N|6Gp5L^vRgt5&tZjSRIk{_*y<3^NrX6PTkze zD|*8!08ZVN)-72TA4Wo3B=+Rg1sc>SX9*X>a!rR~ntLVYeWF5MrLl zA&1L8oli@9ERY|geFokJq^O$2hEpVpIW8G>PPH0;=|7|#AQChL2Hz)4XtpAk zNrN2@Ju^8y&42HCvGddK3)r8FM?oM!3oeQ??bjoYjl$2^3|T7~s}_^835Q(&b>~3} z2kybqM_%CIKk1KSOuXDo@Y=OG2o!SL{Eb4H0-QCc+BwE8x6{rq9j$6EQUYK5a7JL! z`#NqLkDC^u0$R1Wh@%&;yj?39HRipTeiy6#+?5OF%pWyN{0+dVIf*7@T&}{v%_aC8 zCCD1xJ+^*uRsDT%lLxEUuiFqSnBZu`0yIFSv*ajhO^DNoi35o1**16bg1JB z{jl8@msjlAn3`qW{1^SIklxN^q#w|#gqFgkAZ4xtaoJN*u z{YUf|`W)RJfq)@6F&LfUxoMQz%@3SuEJHU;-YXb7a$%W=2RWu5;j44cMjC0oYy|1! zed@H>VQ!7=f~DVYkWT0nfQfAp*<@FZh{^;wmhr|K(D)i?fq9r2FEIatP=^0(s{f8GBn<8T zVz_@sKhbLE&d91L-?o`13zv6PNeK}O5dv>f{-`!ms#4U+JtPV=fgQ5;iNPl9Hf&9( zsJSm5iXIqN7|;I5M08MjUJ{J2@M3 zYN9ft?xIjx&{$K_>S%;Wfwf9N>#|ArVF^shFb9vS)v9Gm00m_%^wcLxe;gIx$7^xR zz$-JDB|>2tnGG@Rrt@R>O40AreXSU|kB3Bm)NILHlrcQ&jak^+~b`)2;otjI(n8A_X~kvp4N$+4|{8IIIv zw*(i}tt+)Kife9&xo-TyoPffGYe;D0a%!Uk(Nd^m?SvaF-gdAz4~-DTm3|Qzf%Pfd zC&tA;D2b4F@d23KV)Csxg6fyOD2>pLy#n+rU&KaQU*txfUj&D3aryVj!Lnz*;xHvl zzo}=X>kl0mBeSRXoZ^SeF94hlCU*cg+b}8p#>JZvWj8gh#66A0ODJ`AX>rubFqbBw z-WR3Z5`33S;7D5J8nq%Z^JqvZj^l)wZUX#7^q&*R+XVPln{wtnJ~;_WQzO{BIFV55 zLRuAKXu+A|7*2L*<_P${>0VdVjlC|n^@lRi}r?wnzQQm z3&h~C3!4C`w<92{?Dpea@5nLP2RJrxvCCBh%Tjobl2FupWZfayq_U$Q@L%$uEB6#X zrm_1TZA8FEtkd`tg)a_jaqnv3BC_O*AUq-*RNLOT)$>2D!r>FZdH&$x5G_FiAPaw4 zgK*7>(qd6R?+M3s@h>Z|H%7eGPxJWn_U$w`fb(Mp+_IK2Kj37YT#Xe5e6KS-_~mW} z`NXEovDJh7n!#q4b+=ne<7uB7Y2(TAR<3@PS&o3P$h#cZ-xF$~JiH6_gsv9v(#ehK zhSB_#AI%lF#+!MB5DMUN+Zhf}=t~{B|Fn{rGM?dOaSvX!D{oGXfS*%~g`W84JJAy4 zMdS?9Bb$vx?`91$J`pD-MGCTHNxU+SxLg&QY+*b_pk0R=A`F}jw$pN*BNM8`6Y=cm zgRh#vab$N$0=XjH6vMyTHQg*+1~gwOO9yhnzZx#e!1H#|Mr<`jJGetsM;$TnciSPJ z5I-R0)$)0r8ABy-2y&`2$33xx#%1mp+@1Vr|q_e=#t7YjjWXH#3F|Fu<G#+-tE2K7 zOJkYxNa74@UT_K4CyJ%mR9Yfa$l=z}lB(6)tZ1Ksp2bv$^OUn3Oed@=Q0M}imYTwX zQoO^_H7SKzf_#kPgKcs%r4BFUyAK9MzfYReHCd=l)YJEgPKq-^z3C%4lq%{&8c{2CGQ3jo!iD|wSEhZ# zjJoH87Rt{4*M_1GdBnBU3trC*hn@KCFABd=Zu`hK;@!TW`hp~;4Aac@24m|GI)Ula z4y%}ClnEu;AL4XVQ6^*!()W#P>BYC@K5mw7c4X|Hk^(mS9ZtfMsVLoPIiwI?w_X0- z#vyiV5q9(xq~fS`_FiUZw->8Awktga>2SrWyvZ|h@LVFtnY#T z%OX30{yiSov4!43kFd(8)cPRMyrN z={af_ONd;m=`^wc7lL|b7V!;zmCI}&8qz=?-6t=uOV;X>G{8pAwf9UJ`Hm=ubIbgR zs6bw3pFeQHL`1P1m5fP~fL*s?rX_|8%tB`Phrij^Nkj{o0oCo*g|ELexQU+2gt66=7}w5A+Qr}mHXC%)(ODT# zK#XTuzqOmMsO~*wgoYjDcy)P7G`5x7mYVB?DOXV^D3nN89P#?cp?A~c%c$#;+|10O z8z(C>mwk#A*LDlpv2~JXY_y_OLZ*Mt)>@gqKf-Ym+cZ{8d%+!1xNm3_xMygTp-!A5 zUTpYFd=!lz&4IFq)Ni7kxLYWhd0o2)ngenV-QP@VCu;147_Lo9f~=+=Nw$6=xyZzp zn7zAe41Sac>O60(dgwPd5a^umFVSH;<7vN>o;}YlMYhBZFZ}-sz`P^3oAI>SCZy&zUtwKSewH;CYysPQN7H>&m215&e2J? zY}>5N-LhaDeRF~C0cB>M z7@y&xh9q??*EIKnh*;1)n-WuSl6HkrI?OUiS^lx$Sr2C-jUm6zhd{nd(>#O8k9*kF zPom7-%w1NjFpj7WP=^!>Vx^6SG^r`r+M&s7V(uh~!T7aE;_ubqNSy)<5(Vi)-^Mp9 zEH@8Vs-+FEeJK%M0z3FzqjkXz$n~BzrtjQv`LagAMo>=?dO8-(af?k@UpL5J#;18~ zHCnWuB(m6G6a2gDq2s`^^5km@A3Rqg-oHZ68v5NqVc zHX_Iw!OOMhzS=gfR7k;K1gkEwuFs|MYTeNhc0js>Wo#^=wX4T<`p zR2$8p6%A9ZTac;OvA4u#Oe3(OUep%&QgqpR8-&{0gjRE()!Ikc?ClygFmGa(7Z^9X zWzmV0$<8Uh)#qaH1`2YCV4Zu6@~*c*bhtHXw~1I6q4I>{92Eq+ZS@_nSQU43bZyidk@hd$j-_iL=^^2CwPcaXnBP;s;b zA4C!k+~rg4U)}=bZ2q*)c4BZ#a&o!uJo*6hK3JRBhOOUQ6fQI;dU#3v>_#yi62&Sp z-%9JJxwIfQ`@w(_qH0J0z~(lbh`P zHoyp2?Oppx^WXwD<~20v!lYm~n53G1w*Ej z9^B*j@lrd>XGW43ff)F;5k|HnGGRu=wmZG9c~#%vDWQHlOIA9(;&TBr#yza{(?k0> zcGF&nOI}JhuPl`kLViBEd)~p2nY9QLdX42u9C~EUWsl-@CE;05y@^V1^wM$ z&zemD1oZd$Z))kEw9)_Mf+X#nT?}n({(+aXHK2S@j$MDsdrw-iLb?#r{?Vud?I5+I zVQ8U?LXsQ}8-)JBGaoawyOsTTK_f8~gFFJ&lhDLs8@Rw$ey-wr&eqSEU^~1jtHmz6 z!D2g4Yh?3VE*W8=*r&G`?u?M~AdO;uTRPfE(@=Gkg z7gh=EGu!6VJJ?S_>|5ZwY?dGFBp3B9m4J1=7u=HcGjsCW+y6`W?OWxfH?S#X8&Zk& zvz6tWcnaS1@~3FTH}q_*$)AjYA_j;yl0H0{I(CW7Rq|;5Q2>Ngd(tmJDp+~qHe_8y zPU_fiCrn!SJ3x&>o6;WDnjUVEt`2fhc9+uLI>99(l$(>Tzwpbh>O775OA5i`jaBdp zXnCwUgomyF3K$0tXzgQhSAc!6nhyRh_$fP}Rd$|*Y7?ah(JrN=I7+)+Hp4BLJJ2P~ zFD!)H^uR2*m7GQZpLUVS#R3^?2wCd}(gcFcz!u5KN9ldNJdh@%onf06z9m~T0n;dqg6@?>G@S|rPO*Kj>{su+R|7bH>osA&uD4eqxtr**k($ii`uO? z7-&VkiL4Rp3S&e+T}2Z#;NtWHZco(v8O3QMvN0g7l8GV|U2>x-DbamkZo5)bjaSFR zr~Y9(EvF9{o*@|nBPj+e5o$_K`%TH1hD=|its}|qS^o6EQu_gOuDUH=Dtzik;P7G$ zq%_T<>9O}bGIB?;IQ*H`BJ5NWF6+XLv@G7aZwcy(&BoepG~u`aIcG>y+;J7+L=wTZ zB=%n@O}=+mjBO%1lMo6C0@1*+mhBqqY((%QMUBhyeC~r*5WVqzisOXFncr*5Lr0q6 zyPU&NOV}Vt2jl>&yig4I6j93?D>Ft=keRh=Y;3*^Z-I26nkZ#Jj5OJ89_?@#9lNjp z#gfAO6i937)~I|98P%xAWxwmk(F&@lTMx63*FZ~2b{NHU+}EV8+kMAB0bM*Zn#&7ubt98!PT^ZcMOfwMgkYz6+;?CKbvV zQ}Z@s_3JcMPhF&y1?}9uZFIBiPR3g7lf=+XEr9Bl%zRfGcaKb*ZQq5b35ZkR@=JEw zP#iqgh2^#@VA-h)>r`7R-$1_ddGr&oWWV$rx;pkG0Yohp9p@In_p)hKvMo@qIv zcN2t{23&^Nj=Y&gX;*vJ;kjM zHE2`jtjVRRn;=WqVAY&m$z=IoKa{>DgJ;To@OPqNbh=#jiS$WE+O4TZIOv?niWs47 zQfRBG&WGmU~>2O{}h17wXGEnigSIhCkg%N~|e?hG8a- zG!Wv&NMu5z!*80>;c^G9h3n#e>SBt5JpCm0o-03o2u=@v^n+#6Q^r#96J5Q=Dd=>s z(n0{v%yj)=j_Je2`DoyT#yykulwTB+@ejCB{dA7VUnG>4`oE?GFV4sx$5;%9&}yxfz<-wWk|IlA|g&! zN_Emw#w*2GT=f95(%Y1#Viop;Yro3SqUrW~2`Fl?Ten{jAt==a>hx$0$zXN`^7>V_ zG*o7iqeZV)txtHUU2#SDTyU#@paP;_yxp!SAG##cB= zr@LoQg4f~Uy5QM++W`WlbNrDa*U;54`3$T;^YVNSHX4?%z|`B~i7W+kl0wBB`8|(l zAyI6dXL&-Sei0=f#P^m`z=JJ`=W;PPX18HF;5AaB%Zlze`#pz;t#7Bzq0;k8IyvdK=R zBW+4GhjOv+oNq^~#!5(+pDz)Ku{u60bVjyym8Or8L;iqR|qTcxEKTRm^Y%QjFYU=ab+^a|!{!hYc+= z%Qc02=prKpzD+jiiOwzyb(dELO|-iyWzizeLugO!<1(j|3cbR!8Ty1$C|l@cWoi?v zLe<5+(Z-eH++=fX**O-I8^ceYZgiA!!dH+7zfoP-Q+@$>;ab&~cLFg!uOUX7h0r== z`@*QP9tnV1cu1!9pHc43C!{3?-GUBJEzI(&#~vY9MEUcRNR*61)mo!RG>_Yb^rNN7 zR9^bI45V?3Lq`^^BMD!GONuO4NH#v9OP3@s%6*Ha3#S*;f z6JEi)qW#Iq#5BtIXT9Gby|H?NJG}DN#Li82kZ_Rt1=T0Z@U6OAdyf}4OD|Sk^2%-1 zzgvqZ@b6~kL!^sZLO$r{s!3fQ5bHW}8r$uTVS*iw1u8^9{YlPp_^Xm5IN zF|@)ZOReX zB*#tEbWEX~@f)ST|s$oUKS@drycE1tYtdJ9b*(uFTxNZ{n3BI*kF7wXgT6+@PI@vwH7iQS{1T!Nauk>fm8gOLe`->Pi~ z8)3=UL_$OLl2n7QZlHt846nkYFu4V};3LpYA%5VaF#a2#d2g0&ZO~3WA%1XlerVpg zCAlM;(9OqH@`(>Tha{*@R%twB!}1ng4V=^+R`Q{#fkRk)C|suozf-uCXrkIH2SC^C z6wlxR`yS;-U#uu#`OnD%U<41%C4mp>LYLPIbgVO~WsT1if)Y)T*8nUB`2*(B;U_ha1NWv2`GqrZ z3MWWpT3tZ!*N@d*!j3=@K4>X*gX4A^@QPAz24?7u90AXaLiFq=Z$|5p$Ok2|YCX_Z zFgNPiY2r_Bg2BQE!0z=_N*G?%0cNITmAru*!Mws=F+F&Qw!&1?DBN{vSy%IvGRV@1 zS->PARgL^XS!-aZj zi@`~LhWfD!H-L0kNv=Jil9zR0>jZLqu)cLq?$yXVyk%EteKcWbe^qh#spHJPa#?92 za(N(Kw0se^$7nQUQZBet;C_Dj5(2_?TdrXFYwmebq}YGQbN5Ex7M zGSCX~Ey;5AqAzEDNr%p^!cuG?&wIeY&Bm5guVg>8F=!nT%7QZTGR(uGM&IZuMw0V_ zhPiIFWm?H?aw*(v6#uVT@NEzi2h5I$cZ-n0~m$tmwdMTjG*of^Y%1 zW?Y%o*-_iMqEJhXo^!Qo?tGFUn1Mb|urN4_;a)9bila2}5rBS#hZ5wV+t1xbyF1TW zj+~cdjbcMgY$zTOq6;ODaxzNA@PZIXX(-=cT8DBd;9ihfqqtbDr9#gXGtK24BPxjZ z9+Xp>W1(s)->-}VX~BoQv$I|-CBdO`gULrvNL>;@*HvTdh@wyNf}~IB5mFnTitX2i z;>W>tlQyc2)T4Mq+f!(i3#KuK-I8Kj3Wm(UYx?KWWt8DEPR_Jdb9CE~Fjc7Rkh#gh zowNv()KRO@##-C+ig0l!^*ol!Bj%d32_N*~d!|&>{t!k3lc?6VrdlCCb1?qyoR42m zv;4KdwCgvMT*{?tJKa(T?cl|b;k4P>c&O@~g71K5@}ys$)?}WSxD;<5%4wEz7h=+q ztLumn6>leWdDk#*@{=v9p)MsvuJMyf_VEs;pJh?i3z7_W@Q|3p$a}P@MQ-NpMtDUBgH!h4Ia#L&POr4Qw0Tqdw^}gCmQAB z8Dgkzn?V!_@04(cx0~-pqJOpeP1_}@Ml3pCb45EJoghLows9ET13J8kt0;m$6-jO( z4F|p+JFD1NT%4bpn4?&)d+~<360$z5on`eS6{H`S>t`VS$>(D`#mC*XK6zULj1Da# zpV$gw$2Ui{07NiYJQQNK;rOepRxA>soNK~B2;>z;{Ovx`k}(dlOHHuNHfeR}7tmIp zcM}q4*Fq8vSNJYi@4-;}`@bC?nrUy`3jR%HXhs79qWI5;hyTpH5%n-NcKu&j(aGwT z1~{geeq?Jd>>HL+?2`0K8dB2pvTS=LO~tb~vx_<=iN8^rW!y@~lBTAaxHmvVQJSeJ z!cb9ffMdP1lgI=>QJN{XpM4{reRrdIt|v|0-8!p}M*Qw^uV1@Ho-YsNd0!a(os$F* zT0tGHA#0%u0j*%S>kL*73@~7|iP;;!JbWSTA@`#VHv_l_%Z7CgX@>dhg_ zgn0|U)SY~U-E5{QiT@(uPp#1jaz!(_3^Cbz2 z4ZgWWz=PdGCiGznk{^4TBfx_;ZjAHQ>dB4YI}zfEnTbf60lR%=@VWt0yc=fd38Ig* z)Q38#e9^+tA7K}IDG5Z~>JE?J+n%0_-|i2{E*$jb4h?|_^$HRHjVkiyX6@Y+)0C2a zA+eegpT1dUpqQFIwx;!ayQcWQBQTj1n5&h<%Lggt@&tE19Rm~Rijtqw6nmYip_xg0 zO_IYpU304embcWP+**H|Z5~%R*mqq+y{KbTVqugkb)JFSgjVljsR{-c>u+{?moCCl zTL)?85;LXk0HIDC3v*|bB-r_z%zvL6Dp__L*A~Z*o?$rm>cYux&)W=6#+Cb}TF&Kd zdCgz3(ZrNA>-V>$C{a^Y^2F!l_%3lFe$s(IOfLBLEJ4Mcd!y&Ah9r)7q?oc z5L(+S8{AhZ)@3bw0*8(}Xw{94Vmz6FrK&VFrJN;xB96QmqYEibFz|yHgUluA-=+yS}I-+#_Pk zN67-#8W(R^e7f!;i0tXbJgMmJZH%yEwn*-}5ew13D<_FYWnt?{Mv1+MI~u;FN~?~m z{hUnlD1|RkN}c1HQ6l@^WYbHAXPJ^m0te1woe;LDJ}XEJqh1tPf=sD0%b+OuR1aCoP>I>GBn4C24Zu$D)qg=gq;D??5 zUSj%;-Hvk_ffj-+SI{ZCp`gZcNu=L@_N}kCcs?TyMr-37fhy$?a<7lt1`fZw<%$8@B6(Wgo!#!z9z{ab|x`+&;kP!(gfdY}A-GP&4Cbh-S< z1(kmgnMyB2z3ipEj5;4<{(=&<7a>A_Jl`ujUKYV@%k(oD=cD7W@8~5O=R*zdjM_y; zXwme~0wo0aDa~9rDnjF=B}Bbj|DHRQjN|?@(F^=bVFdr!#mwr|c0843k>%~5J|7|v zSY=T)iPU6rEAwrM(xTZwPio%D4y9Z4kL0bMLKvu4yd)0ZJA3<;>a2q~rEfcREn}~1 zCJ~3c?Afvx?3^@+!lnf(kB6YwfsJ*u^y7kZA?VmM%nBmaMspWu?WXq4)jQsq`9EbT zlF2zJ)wXuAF*2u|yd5hNrG>~|i}R&ZyeetTQ!?Hz6xGZZb3W6|vR>Hq=}*m=V=Lsp zUOMxh;ZfP4za~C{Ppn^%rhitvpnu^G{Z#o-r?TdEgSbtK_+~_iD49xM;$}X*mJF02|WBL{SDqK9}p4N!G$3m=x#@T+4QcapM{4j|Q zwO!(hldpuSW#by!zHEP@tzIC|KdD z%BJzQ7Ho1(HemWm`Z8m_D#*`PZ-(R%sZmPrS$aHS#WPjH3EDitxN|DY+ zYC|3S?PQ3NNYau$Qk8f>{w}~xCX;;CE=7;Kp4^xXR8#&^L+y-jep7oO^wnQ840tg1 zuN17QKsfdqZPlB8OzwF+)q#IsmenEmIbRAJHJ$JjxzawKpk8^sBm3iy=*kB%LppNb zhSdk`^n?01FKQ;=iU+McN7Mk0^`KE>mMe1CQ2a_R26_}^$bogFm=2vqJake7x)KN( zYz;gRPL+r4*KD>1U+DU+1jh{mT8#P#(z9^(aDljpeN{mRmx{AZX&hXKXNuxj3x*RrpjvOaZ#`1EqK!$+8=0yv8}=;>f=E?5tGbRUd4%?QL zy$kq6mZeF%k6E1&8nwAYMd!-lRkhQTob$7s`*XqcHs;l~mHV}fx&0I&i!CHaPVSM{ zHdRh7a>hP)t@YTrWm9y zl-ENWSVzlKVvTdWK>)enmGCEw(WYS=FtY{srdE{Z(3~4svwd)ct;`6Y{^qiW+9E@A ztzd?lj5F#k`=E1U-n*1JJc0{x{0q!_tkD<_S6bGsW)^RxGu%Rj^Mvw|R0WP1SqvAI zs(MiAd@Y5x!UKu376&|quQNxir;{Iz(+}3k-GNb29HaQh?K30u=6sXpIc?j0hF{VY zM$Do*>pN)eRljAOgpx7fMfSrnZ7>fi@@>Jh;qxj1#-Vj}JC3E^GCbC(r55_AG>6cq z4ru34FtVuBt)bkX4>ZFWjToyu)VA>IE6hXc+^(3ruUaKRqHnx3z)(GXetm;^0D95s zQ&drwfjhM4*|q=;i5Io0eDf?I{p}qo@7i7abHX5qLu~VDwYf4bmV~-^M_U?DL(+cG z{AyE^a|*73Ft)o5k-p)+GLXj#q01VlJ9#ZJkf|+c%6qfRgVp&6NsU3~F?!uh}HJm73xq>v$h zYoW3wJE6n9P|;{8U<^%UE2wjR4x^G_Nc$J(i)!>;g4`CCh2z^Dth#ah#<`#axDR?F z4>~hnN2%B2ZUuU6j>m1Qjj~5jQSdA&Q#7hOky#=Ue)}7LPJ!8nbZO_0Sw{G>>M7&E zb1dy|0Zi$(ubk`4^XkVI%4WIpe?Bh!D~IjvZs14yHw=aQ8-`N-=P*?Kzi&eRGZ_6Z zT>eis`!Dy3eT3=vt#Lbc+;}i5XJf7zM3QneL{t?w=U<1rk7+z2Cu^|~=~54tAeSYF zsXHsU;nM0dpK>+71yo(NFLV-^Lf7%U?Q$*q{^j04Gl71ya2)^j`nmJ$cmI9eFMjp+ z#)jKmi4lZc<;l>!={@jTm%?!5jS;6;c*Ml55~r6Y?22B^K3bPhKQ(ICc&z%w<4W1= zjTTtz_}IA$%kCqU)h#$!Yq>>2mVG}qYL}!avmCWYV}x4!YEeq)pgTp| zR;+skHuc7YXRLrcbYXt>?@pa{l^2pL>RrZ!22zMmi1ZR?nkaWF*`@XFK4jGh&Em3vn(l z3~^Q9&tM^eV=f^lccCUc9v02z%^n5VV6s$~k0uq5B#Ipd6`M1Kptg^v<2jiNdlAWQ z_MmtNEaeYIHaiuaFQdG&df7miiB5lZkSbg&kxY*Eh|KTW`Tk~VwKC~+-GoYE+pvwc{+nIEizq6!xP>7ZQ(S2%48l$Y98L zvs7s<&0ArXqOb*GdLH0>Yq-f!{I~e~Z@FUIPm?jzqFZvz9VeZLYNGO}>Vh<=!Er7W zS!X6RF^et7)IM1pq57z*^hP5w7HKSDd8jHX!*gkKrGc-GssrNu5H%7-cNE{h$!aEQK3g*qy;= z)}pxO8;}nLVYm_24@iEs8)R7i;Th0n4->&$8m6(LKCRd(yn7KY%QHu_f=*#e`H^U( z{u!`9JaRD?Z?23fEXrjx>A@+a!y-_oaDB)o@2s{2%A97-ctFfrN0cXQ@6aGH`X~Nr z144?qk;MzDU-cgQOLfT3-ZR#hKmYtKG*iGf4ZJ`|`9!^SkBDUUSJCba)>mM!)k~(z zdjUqB`)~!UObMHB1b$UItM$<0kwlqHH;c z=)+~bkOcIT7vI0Iy(wD)vsg9|oi##%Rgrq`Ek;pN)}lbpz`iv{F4K*{ZZ?Zjixxxr zY|SPl2NsXH+5pimj+MvbZ_+HrfvdC13|9Zs)Y=nW$z<0mhl}%irBSm5T3ZrN#2AhY z_ZrTmS(L`U#y}VZ@~QL9wUS6AnU*7LWS02Xyz`b>%rTml#Wb0yr>@c(Ym*40g;P{V zjV1XSHdU>oY!&Jh7MzhzUV8(9E+yl5UJYga>=0Ldjwtc`5!1>LxaB-kVW;IlSPs+0 zUBx=m8OKVp<`frNvMK>WMO(iKY%PuvqD+PK*vP6f?_o!O)MCW5Ic zv(%f5PLHyOJ2h@Yn_to@54Yq;fdoy40&sbe3A$4uUXHsHP_~K}h#)p&TyOx(~JE?y(IBAQKl}~VQjVC-c6oZwmESL;`Xth?2)-b6ImNcJi z;w|`Q*k?`L(+Dp}t(FocvzWB(%~9$EAB6_J6CrA}hMj-Vy*6iA$FdV}!lvk%6}M)4 zTf<)EbXr9^hveAav1yA?>O0aNEpv0&rju{(Gt|dP=AP%)uQm~OE7@+wEhILrRLt&E zoEsF^nz>4yK1|EOU*kM+9317S;+bb7?TJM2UUpc!%sDp}7!<`i=W!ot8*C&fpj>mk#qt~GCeqcy)?W6sl>eUnR%yCBR&Ow-rc|q;lhnI+f-%`6Xf)% zIYZru;27%vA{Qi2=J`PQC<28;tFx(V^sgXf>)8WNxxQwT14M9I6- z+V0@tiCiDkv`7r-06sJS8@s|Lf>mV+8h}SPT4ZGPSMaFK7_SMXH$3KN7b2V?iV-jA zh1!Z>2tv^HVbHnNUAf-wQW#zMV(h8=3x2Swd|-%AczEIWLcm~EAu7rc3s%56b;7ME zj}$pe#fc^314Mb9i)xH^_#({)tTD4hsoz!7XcHUh9*G|}?k=D?9LBkTm2?fgaIG(%%$DL#}a-_990rQBU+M;jrf zCcvgM`+oyZmsUqc?lly9axZfO)02l$TMS#I+jHYY`Uk!gtDv|@GBQ||uaG^n*QR3Q z@tV?D;R;KmkxSDQh<2DkDC1?m?jTvf2i^T;+}aYhzL?ymNZmdns2e)}2V>tDCRw{= zTV3q3ZQDkdZQHi3?y{@8Y@1!SZQHi(y7|qSx$~Vl=iX<2`@y3eSYpsBV zI`Q-6;)B=p(ZbX55C*pu1C&yqS|@Pytis3$VDux0kxKK}2tO&GC;cH~759o?W2V)2 z)`;U(nCHBE!-maQz%z#zoRNpJR+GmJ!3N^@cA>0EGg?OtgM_h|j1X=!4N%!`g~%hdI3%yz&wq4rYChPIGnSg{H%i>96! z-(@qsCOfnz7ozXoUXzfzDmr>gg$5Z1DK$z#;wn9nnfJhy6T5-oi9fT^_CY%VrL?l} zGvnrMZP_P|XC$*}{V}b^|Hc38YaZQESOWqA1|tiXKtIxxiQ%Zthz?_wfx@<8I{XUW z+LH%eO9RxR_)8gia6-1>ZjZB2(=`?uuX|MkX082Dz*=ep%hMwK$TVTyr2*|gDy&QOWu zorR#*(SDS{S|DzOU$<-I#JTKxj#@0(__e&GRz4NuZZLUS8}$w+$QBgWMMaKge*2-) zrm62RUyB?YSUCWTiP_j-thgG>#(ZEN+~bMuqT~i3;Ri`l${s0OCvCM>sqtIX?Cy`8 zm)MRz-s^YOw>9`aR#J^tJz6$S-et%elmR2iuSqMd(gr6a#gA_+=N(I6%Cc+-mg$?_1>PlK zbgD2`hLZ?z4S~uhJf=rraLBL?H#c$cXyqt{u^?#2vX2sFb z^EU-9jmp{IZ~^ii@+7ogf!n_QawvItcLiC}w^$~vgEi(mX79UwDdBg`IlF42E5lWE zbSibqoIx*0>WWMT{Z_NadHkSg8{YW4*mZ@6!>VP>ey}2PuGwo%>W7FwVv7R!OD32n zW6ArEJX8g_aIxkbBl^YeTy5mhl1kFGI#n>%3hI>b(^`1uh}2+>kKJh0NUC|1&(l)D zh3Barl&yHRG+Le2#~u>KoY-#GSF>v)>xsEp%zgpq4;V6upzm3>V&yk^AD}uIF{vIn zRN-^d4(Sk6ioqcK@EObsAi#Z-u&Hh#kZdv1rjm4u=$2QF<6$mgJ4BE0yefFI zT7HWn?f668n!;x>!CrbdA~lDfjX?)315k1fMR~lG)|X_o()w|NX&iYUTKxI2TLl|r z{&TWcBxP>*;|XSZ1GkL&lSg?XL9rR4Ub&4&03kf};+6$F)%2rsI%9W_i_P|P%Z^b@ zDHH2LV*jB@Izq0~E4F^j04+C|SFiV8{!bth%bz(KfCg42^ zGz5P7xor$)I4VX}Cf6|DqZ$-hG7(}91tg#AknfMLFozF1-R~KS3&5I0GNb`P1+hIB z?OPmW8md3RB6v#N{4S5jm@$WTT{Sg{rVEs*)vA^CQLx?XrMKM@*gcB3mk@j#l0(~2 z9I=(Xh8)bcR(@8=&9sl1C?1}w(z+FA2`Z^NXw1t(!rpYH3(gf7&m=mm3+-sls8vRq z#E(Os4ZNSDdxRo&`NiRpo)Ai|7^GziBL6s@;1DZqlN@P_rfv4Ce1={V2BI~@(;N`A zMqjHDayBZ);7{j>)-eo~ZwBHz0eMGRu`43F`@I0g!%s~ANs>Vum~RicKT1sUXnL=gOG zDR`d=#>s?m+Af1fiaxYxSx{c5@u%@gvoHf#s6g>u57#@#a2~fNvb%uTYPfBoT_$~a^w96(}#d;-wELAoaiZCbM zxY4fKlS6-l1!b1!yra|`LOQoJB))=CxUAYqFcTDThhA?d}6FD$gYlk**!# zD=!KW>>tg1EtmSejwz{usaTPgyQm~o+NDg`MvNo)*2eWX*qAQ)4_I?Pl__?+UL>zU zvoT(dQ)pe9z1y}qa^fi-NawtuXXM>*o6Al~8~$6e>l*vX)3pB_2NFKR#2f&zqbDp7 z5aGX%gMYRH3R1Q3LS91k6-#2tzadzwbwGd{Z~z+fBD5iJ6bz4o1Rj#7cBL|x8k%jO z{cW0%iYUcCODdCIB(++gAsK(^OkY5tbWY;)>IeTp{{d~Y#hpaDa-5r#&Ha?+G{tn~ zb(#A1=WG1~q1*ReXb4CcR7gFcFK*I6Lr8bXLt9>9IybMR&%ZK15Pg4p_(v5Sya_70 ziuUYG@EBKKbKYLWbDZ)|jXpJJZ&bB|>%8bcJ7>l2>hXuf-h5Bm+ zHZ55e9(Sg>G@8a`P@3e2(YWbpKayoLQ}ar?bOh2hs89=v+ifONL~;q(d^X$7qfw=; zENCt`J*+G;dV_85dL3Tm5qz2K4m$dvUXh>H*6A@*)DSZ2og!!0GMoCPTbcd!h z@fRl3f;{F%##~e|?vw6>4VLOJXrgF2O{)k7={TiDIE=(Dq*Qy@oTM*zDr{&ElSiYM zp<=R4r36J69aTWU+R9Hfd$H5gWmJ?V){KU3!FGyE(^@i!wFjeZHzi@5dLM387u=ld zDuI1Y9aR$wW>s#I{2!yLDaVkbP0&*0Rw%6bi(LtieJQ4(1V!z!ec zxPd)Ro0iU%RP#L|_l?KE=8&DRHK>jyVOYvhGeH+Dg_E%lgA(HtS6e$v%D7I;JSA2x zJyAuin-tvpN9g7>R_VAk2y;z??3BAp?u`h-AVDA;hP#m+Ie`7qbROGh%_UTW#R8yfGp<`u zT0}L)#f%(XEE)^iXVkO8^cvjflS zqgCxM310)JQde*o>fUl#>ZVeKsgO|j#uKGi)nF_ur&_f+8#C0&TfHnfsLOL|l(2qn zzdv^wdTi|o>$q(G;+tkTKrC4rE)BY?U`NHrct*gVx&Fq2&`!3htkZEOfODxftr4Te zoseFuag=IL1Nmq45nu|G#!^@0vYG5IueVyabw#q#aMxI9byjs99WGL*y)AKSaV(zx z_`(}GNM*1y<}4H9wYYSFJyg9J)H?v((!TfFaWx(sU*fU823wPgN}sS|an>&UvI;9B(IW(V)zPBm!iHD} z#^w74Lpmu7Q-GzlVS%*T-z*?q9;ZE1rs0ART4jnba~>D}G#opcQ=0H)af6HcoRn+b z<2rB{evcd1C9+1D2J<8wZ*NxIgjZtv5GLmCgt?t)h#_#ke{c+R6mv6))J@*}Y25ef z&~LoA&qL-#o=tcfhjH{wqDJ;~-TG^?2bCf~s0k4Rr!xwz%Aef_LeAklxE=Yzv|3jf zgD0G~)e9wr@)BCjlY84wz?$NS8KC9I$wf(T&+79JjF#n?BTI)Oub%4wiOcqw+R`R_q<`dcuoF z%~hKeL&tDFFYqCY)LkC&5y(k7TTrD>35rIAx}tH4k!g9bwYVJ>Vdir4F$T*wC@$08 z9Vo*Q0>*RcvK##h>MGUhA9xix+?c1wc6xJhn)^9;@BE6i*Rl8VQdstnLOP1mq$2;!bfASHmiW7|=fA{k$rs^-8n{D6_ z!O0=_K}HvcZJLSOC6z-L^pl3Gg>8-rU#Sp1VHMqgXPE@9x&IHe;K3;!^SQLDP1Gk&szPtk| z!gP;D7|#y~yVQ?sOFiT*V(Z-}5w1H6Q_U5JM#iW16yZiFRP1Re z6d4#47#NzEm};1qRP9}1;S?AECZC5?6r)p;GIW%UGW3$tBN7WTlOy|7R1?%A<1!8Z zWcm5P6(|@=;*K&3_$9aiP>2C|H*~SEHl}qnF*32RcmCVYu#s!C?PGvhf1vgQ({MEQ z0-#j>--RMe{&5&$0wkE87$5Ic5_O3gm&0wuE-r3wCp?G1zA70H{;-u#8CM~=RwB~( zn~C`<6feUh$bdO1%&N3!qbu6nGRd5`MM1E_qrbKh-8UYp5Bn)+3H>W^BhAn;{BMii zQ6h=TvFrK)^wKK>Ii6gKj}shWFYof%+9iCj?ME4sR7F+EI)n8FL{{PKEFvB65==*@ ztYjjVTJCuAFf8I~yB-pN_PJtqH&j$`#<<`CruB zL=_u3WB~-;t3q)iNn0eU(mFTih<4nOAb>1#WtBpLi(I)^zeYIHtkMGXCMx+I zxn4BT0V=+JPzPeY=!gAL9H~Iu%!rH0-S@IcG%~=tB#6 z3?WE7GAfJ{>GE{?Cn3T!QE}GK9b*EdSJ02&x@t|}JrL{^wrM@w^&})o;&q816M5`} zv)GB;AU7`haa1_vGQ}a$!m-zkV(+M>q!vI0Swo18{;<>GYZw7-V-`G#FZ z;+`vsBihuCk1RFz1IPbPX8$W|nDk6yiU8Si40!zy{^nmv_P1=2H*j<^as01|W>BQS zU)H`NU*-*((5?rqp;kgu@+hDpJ;?p8CA1d65)bxtJikJal(bvzdGGk}O*hXz+<}J? zLcR+L2OeA7Hg4Ngrc@8htV!xzT1}8!;I6q4U&S$O9SdTrot<`XEF=(`1{T&NmQ>K7 zMhGtK9(g1p@`t)<)=eZjN8=Kn#0pC2gzXjXcadjHMc_pfV(@^3541)LC1fY~k2zn&2PdaW`RPEHoKW^(p_b=LxpW&kF?v&nzb z1`@60=JZj9zNXk(E6D5D}(@k4Oi@$e2^M%grhlEuRwVGjDDay$Qpj z`_X-Y_!4e-Y*GVgF==F0ow5MlTTAsnKR;h#b0TF>AyJe`6r|%==oiwd6xDy5ky6qQ z)}Rd0f)8xoNo)1jj59p;ChIv4Eo7z*{m2yXq6)lJrnziw9jn%Ez|A-2Xg4@1)ET2u zIX8`u5M4m=+-6?`S;?VDFJkEMf+=q?0D7?rRv)mH=gptBFJGuQo21rlIyP>%ymGWk z=PsJ>>q~i>EN~{zO0TklBIe(8i>xkd=+U@;C{SdQ`E03*KXmWm4v#DEJi_-F+3lrR z;0al0yXA&axWr)U%1VZ@(83WozZbaogIoGYpl!5vz@Tz5?u36m;N=*f0UY$ssXR!q zWj~U)qW9Q9Fg9UW?|XPnelikeqa9R^Gk77PgEyEqW$1j=P@L z*ndO!fwPeq_7J_H1Sx>#L$EO_;MfYj{lKuD8ZrUtgQLUUEhvaXA$)-<61v`C=qUhI zioV&KR#l50fn!-2VT`aMv|LycLOFPT{rRSRGTBMc)A`Cl%K&4KIgMf}G%Qpb2@cB* zw8obt-BI3q8Lab!O<#zeaz{P-lI2l`2@qrjD+Qy)^VKks5&SeT(I)i?&Kf59{F`Rw zuh7Q>SQNwqLO%cu2lzcJ7eR*3!g}U)9=EQ}js-q{d%h!wl6X3%H0Z2^8f&^H;yqti4z6TNWc& zDUU8YV(ZHA*34HHaj#C43PFZq7a>=PMmj4+?C4&l=Y-W1D#1VYvJ1~K%$&g-o*-heAgLXXIGRhU zufonwl1R<@Kc8dPKkb`i5P9VFT_NOiRA=#tM0WX2Zut)_ zLjAlJS1&nnrL8x8!o$G+*z|kmgv4DMjvfnvH)7s$X=-nQC3(eU!ioQwIkaXrl+58 z@v)uj$7>i`^#+Xu%21!F#AuX|6lD-uelN9ggShOX&ZIN+G#y5T0q+RL*(T(EP)(nP744-ML= z+Rs3|2`L4I;b=WHwvKX_AD56GU+z92_Q9D*P|HjPYa$yW0o|NO{>4B1Uvq!T;g_N- zAbNf%J0QBo1cL@iahigvWJ9~A4-glDJEK?>9*+GI6)I~UIWi>7ybj#%Po}yT6d6Li z^AGh(W{NJwz#a~Qs!IvGKjqYir%cY1+8(5lFgGvl(nhFHc7H2^A(P}yeOa_;%+bh` zcql{#E$kdu?yhRNS$iE@F8!9E5NISAlyeuOhRD)&xMf0gz^J927u5aK|P- z>B%*9vSHy?L_q)OD>4+P;^tz4T>d(rqGI7Qp@@@EQ-v9w-;n;7N05{)V4c7}&Y^!`kH3}Q z4RtMV6gAARY~y$hG7uSbU|4hRMn97Dv0$Le@1jDIq&DKy{D$FOjqw{NruxivljBGw zP4iM(4Nrz^^~;{QBD7TVrb6PB=B$<-e9!0QeE8lcZLdDeb?Gv$ePllO2jgy&FSbW* zSDjDUV^=`S(Oo0;k(Idvzh}aXkfO)F6AqB?wWqYJw-1wOn5!{-ghaHb^v|B^92LmQ9QZj zHA&X)fd%B$^+TQaM@FPXM$$DdW|Vl)4bM-#?Slb^qUX1`$Yh6Lhc4>9J$I4ba->f3 z9CeGO>T!W3w(){M{OJ+?9!MK68KovK#k9TSX#R?++W4A+N>W8nnk**6AB)e;rev=$ zN_+(?(YEX;vsZ{EkEGw%J#iJYgR8A}p+iW;c@V>Z1&K->wI>!x-+!0*pn|{f=XA7J zfjw88LeeJgs4YI?&dHkBL|PRX`ULOIZlnniTUgo-k`2O2RXx4FC76;K^|ZC6WOAEw zz~V0bZ29xe=!#Xk?*b{sjw+^8l0Koy+e7HjWXgmPa4sITz+$VP!YlJ$eyfi3^6gGx6jZLpbUzX;!Z6K}aoc!1CRi zB6Lhwt%-GMcUW;Yiy6Y7hX(2oksbsi;Z6k*=;y;1!taBcCNBXkhuVPTi+1N*z*}bf z`R=&hH*Ck5oWz>FR~>MO$3dbDSJ!y|wrff-H$y(5KadrA_PR|rR>jS=*9&J*ykWLr z-1Z^QOxE=!6I z%Bozo)mW7#2Hd$-`hzg=F@6*cNz^$#BbGlIf${ZV1ADc}sNl=B72g`41|F7JtZ^BT z+y}nqn3Ug`2scS_{MjykPW2~*k$i6PhvvxJCW;n!SK5B8Rpm41fCEdy=ea-4F`rN5 zF>ClKp#4?}pI7eR#6U|}t`DA!GQJB7nT$HVV*{qPjIRU1Ou3W;I^pCt54o|ZHvWaH zooFx9L%#yv)!P;^er5LCU$5@qXMhJ-*T5Ah8|}byGNU5oMp3V)yR;hWJKojJEregX z<1UPt%&~=5OuP(|B{ty);vLdoe7o^?`tkQa7zoXKAW6D@lc+FTzucotaOfJ!(Bm zHE8f8j@6||lH`y2<&hP}Q1wr(=6ze0D6NRL{7QaE1=nTAzqjIeD}Be&@#_d*dyurz z&L7xo-D9!dS`i>^GaIPArR@r=N#-ppIh!UBcb!N*?nLUO+*%C>_dCF1IH)q>5oT(t zjQo{AoDB;mWL;3&;vTt?;bvJSj>^Gq4Jrh}S}D>G)+b!>oRDWI?c_d77$kF5ms{Gx zak*>~*5AvaB-Xl)IgdZ^Cupv6HxQ0 zM(KPaDpPsPOd)e)aFw}|=tfzg@J1P8oJx2ZBY=g4>_G(Hkgld(u&~jN((eJ}5@b1} zI(P7j443AZj*I@%q!$JQ2?DZV47U!|Tt6_;tlb`mSP3 z74DE4#|1FMDqwYbT4P6#wSI%s?*wDc>)MR$4z9ZtJg04+CTUds>1JSDwI}=vpRoRR zLqx(Tvf34CvkTMOPkoH~$CG~fSZb;(2S4Q6Vpe9G83V={hwQ>acu+MCX)@0i>Vd`% z4I8Ye+7&Kcbh(*bN1etKmrpN)v|=eI+$oD=zzii6nP&w|kn2Y-f!(v<aE zKmOz#{6PZB(8zD={il`RO6D}v(@mN_66KXUAEefgg|;VmBfP?UrfB$&zaRw7oanna zkNmVGz4Vhd!vZSnp1(&_5^t;eSv6O771BloJAHi=Pnn+aa6y(e2iiE97uZ{evzQ^8 z*lN@ZYx<-hLXP^IuYLGf<01O*>nDp0fo;;Iyt`JADrxt7-jEF(vv_btyp6CT8=@5t zm`I0lW+2+_xj2CRL|40kcYysuyYeiGihGe&a)yilqP}5h+^)m8$=mzrUe`$(?BIY> zfF7-V10Gu0CkWF)wz04&hhI>es0NS7d`cnT`4y8K!wUAKv$H09fa>KeNQvwUNDT1zn}_*RHykC$CD%*h7vRCQ&Z z4&N-!L>(@8i?K$l5)13n0%VPPV`iG7Q$2{1T3JypLSvN%1kX73goBIOEmg=Uf$9e? zm}g>JFu}EQKH>|K!)m9teoCmTc`y2Ll}msZYyy0Pkqjeid66>DP_?C{KCw94lHvLW z-+X!2YSm70s833lH0o+|A%Xwsw`@8lE3ia0n_Dve;LC7@I+i~@%$lD|3fNf&R6ob6 z@iGfx^OC4s`$|vO!0jTWwVpX;X^EqJF{i324I>N=f@u+rTN+xJGGR0LsCQc;iFD=F zbZJrgOpS;04o^wP7HF5QBaJ$KJgS2V4u02ViWD=6+7rcu`uc&MOoyf%ZBU|gQZkUg z<}ax>*Fo?d*77Ia)+{(`X45{a8>Bi$u-0BWSteyp#GJnTs?&k&<0NeHA$Qb3;SAJK zl}H*~eyD-0qHI3SEcn`_7d zq@YRsFdBig+k490BZSQwW)j}~GvM7x>2ymO4zakaHZ!q6C2{fz^NvvD8+e%7?BQBH z-}%B{oROo2+|6g%#+XmyyIJrK_(uEbg%MHlBn3^!&hWi+9c0iqM69enep#5FvV_^r z?Yr(k*5FbG{==#CGI1zU0Wk{V?UGhBBfv9HP9A-AmcJmL^f4S zY3E2$WQa&n#WRQ5DOqty_Pu z-NWQGCR^Hnu^Vo2rm`-M>zzf|uMCUd1X0{wISJL2Pp=AO5 zF@(50!g|SYw3n<_VP0T~`WUjtY**6Npphr5bD%i3#*p7h8$#;XTLJAt5J-x~O1~`z z`2C~P4%XSI(JbrEmVMEwqdsa^aqXWg;A6KBn^jDxTl!}Q!^WhprL$kb(Iqq zUS`i$tIPs#hdE-zAaMGoxcG?Z;RO2L0Y|gcjV_)FFo|e)MtTl`msLTwq>po$`H6_U zhdWK97~M>idl9GE_WgobQkK_P85H_0jN?s3O)+m&68B`_;FnbZ3W*Qm++ghSs7|T4b7m~VVV%j0gl`Iw!?+-9#Lsb!j3O%fSTVuK z37V>qM81D+Atl};23`TqEAfEkQDpz$-1$e__>X2jN>xh@Sq)I6sj@< ziJ^66GSmW9c%F7eu6&_t$UaLXF4KweZecS1ZiHPWy-$e_7`jVk74OS*!z=l#(CQ^K zW-ke|g^&0o=hn+4uh-8lUh0>!VIXXnQXwKr>`94+2~<;+`k z$|}QZ>#pm2g}8k*;)`@EnM~ZQtci%_$ink9t6`HP{gn}P1==;WDAld3JX?k%^GcTU za>m|CH|UsyFhyJBwG5=`6562hkVRMQ=_ron-Vlm$4bG^GFz|Jh5mM{J1`!!hAr~8F^w> z^YhQ=c|bFn_6~9X$v(30v$5IX;#Nl-XXRPgs{g_~RS*znH^6Vhe}8>T?aMA|qfnWO zQpf(wr^PfygfM+m2u!9}F|frrZPBQ!dh(varsYo!tCV)WA(Wn^_t=WR_G7cQU`AGx zrK^B6<}9+$w;$vra)QWMKf_Tnqg93AMVZ6Qd=q6rdB{;ZhsoT zWy9QhnpEnc@Dauz4!8gq zqDanAX#$^vf-4~ZqUJtSe?SO+Hmb?)l2#}v(8}2+P{ZZuhlib0$3G0|a5?JR>QgUUP$HTE5hb`h>imq#7P+Y*-UVLm@9km|V# zoigziFt$bxgQMwqKKhd!c--&ciywIED>faY3zHLrA{V#IA)!mq!FXxf?1coGK~N(b zjwu*@2B1^(bzFVBJO`4EJ$=it!a0kbgUvPL;Er(0io{W4G7Bkqh)=g)uS|l0YfD}f zaCJwY7vR-D=P9M68`cmtmQ^!F-$lt@0S|9G7cHgT13A0xMv)HmH#Z<4{~iYo_VOD{ z5!kU+>mUOvHouw+-y?*cNlUlDwD#;6ZvAIc$YcwG&qKZFh>EtM(Eda+w)E$HcfZyB zG*$<*ae_ApE%gxWx%O^~XMnRSNLv!y`g99F(J_m)spJAc95P|_joOIoru%atbw z9PYgkcE*8x#)-W{>96KDl&74iW<#wrK)1s zxzU{`rW5af+dT6Z@_1dG<}CtDMT`EGVEXSL_5D9)Z;6UJe-TW7)M?bY%E;8G?Yc!$ zic;F5=#dba^P~7f#qvC}Nd#XEo2r_UlgfR_`B2^W0QjXU?RAi$>f&{G_Lu8Fp0qDp z?vAdm%z#3kcZmaJ@afooB=A@>8_N~O9Yzu=ZCEikM>UgU+{%>pPvmSNzGk@*jnc5~ z(Z#H4OL^gw>)gqZ!9X|3i4LAdp9vo)?F9QCR3##{BHoZ73Uk^Ha={2rc*TBijfKH- z=$cZQdc<5%*$kVo|{+bL3 zEoU&tq*YPR)^y-SISeQNQ)YZ9v>Hm4O=J)lf(y=Yu1ao&zj#5GVGxyj%V%vl9}dw< zO;@NRd4qe@Et}E@Q;SChBR2QPKll1{*5*jT*<$$5TywvC77vt=1=0xZ46>_17YzbiBoDffH(1_qFP7v2SVhZmA_7JDB50t#C39 z8V<9(E?bVWI<7d6MzcS^w!XmZ**{AO!~DZNU)pgr=yY1 zT@!AapE;yg&hmj*g{I3vd## zx+d%^O?d%%?Dba|l~X6ZOW|>FPsrjPjn-h4swysH!RNJUWofC?K(^0uHrBPrH5#W> zMn8^@USzjUucqo%+5&))Dnnw`5l1mp>roaA99Nkk4keZl2wAF7oa(!x?@8uGWzc5Q zM}g`}zf-D@B6lVFYWmmJ8a+_%z8g$C7Ww~PD9&jki08NY!b!fK288R;E?e3Z+Pk{is%HxQU`xu9+y5 zq?DWJD7kKp(B2J$t5Ij8-)?g!T9_n<&0L8F5-D0dp>9!Qnl#E{eDtkNo#lw6rMJG$ z9Gz_Z&a_6ie?;F1Y^6I$Mg9_sml@-z6t!YLr=ml<6{^U~UIbZUUa_zy>fBtR3Rpig zc1kLSJj!rEJILzL^uE1mQ}hjMCkA|ZlWVC9T-#=~ip%McP%6QscEGlYLuUxDUC=aX zCK@}@!_@~@z;70I+Hp5#Tq4h#d4r!$Np1KhXkAGlY$ap7IZ9DY})&(xoTyle8^dBXbQUhPE6ehWHrfMh&0=d<)E2+pxvWo=@`^ zIk@;-$}a4zJmK;rnaC)^a1_a_ie7OE*|hYEq1<6EG>r}!XI9+(j>oe!fVBG%7d}?U z#ja?T@`XO(;q~fe2CfFm-g8FbVD;O7y9c;J)k0>#q7z-%oMy4l+ zW>V~Y?s`NoXkBeHlXg&u*8B7)B%alfYcCriYwFQWeZ6Qre!4timF`d$=YN~_fPM5Kc8P;B-WIDrg^-j=|{Szq6(TC)oa!V7y zLmMFN1&0lM`+TC$7}on;!51{d^&M`UW ztI$U4S&}_R?G;2sI)g4)uS-t}sbnRoXVwM!&vi3GfYsU?fSI5Hn2GCOJ5IpPZ%Y#+ z=l@;;{XiY_r#^RJSr?s1) z4b@ve?p5(@YTD-<%79-%w)Iv@!Nf+6F4F1`&t~S{b4!B3fl-!~58a~Uj~d4-xRt`k zsmGHs$D~Wr&+DWK$cy07NH@_z(Ku8gdSN989efXqpreBSw$I%17RdxoE<5C^N&9sk!s2b9*#}#v@O@Hgm z2|U7Gs*@hu1JO$H(Mk)%buh~*>paY&Z|_AKf-?cz6jlT-v6 zF>l9?C6EBRpV2&c1~{1$VeSA|G7T(VqyzZr&G>vm87oBq2S%H0D+RbZm}Z`t5Hf$C zFn7X*;R_D^ z#Ug0tYczRP$s!6w<27;5Mw0QT3uNO5xY($|*-DoR1cq8H9l}_^O(=g5jLnbU5*SLx zGpjfy(NPyjL`^Oln_$uI6(aEh(iS4G=$%0;n39C(iw79RlXG>W&8;R1h;oVaODw2nw^v{~`j(1K8$ z5pHKrj2wJhMfw0Sos}kyOS48Dw_~=ka$0ZPb!9=_FhfOx9NpMxd80!a-$dKOmOGDW zi$G74Sd(-u8c!%35lL|GkyxZdlYUCML{V-Ovq{g}SXea9t`pYM^ioot&1_(85oVZ6 zUhCw#HkfCg7mRT3|>99{swr3FlA@_$RnE?714^o;vps4j4}u=PfUAd zMmV3j;Rogci^f!ms$Z;gqiy7>soQwo7clLNJ4=JAyrz;=*Yhe8q7*$Du970BXW89Xyq92M4GSkNS-6uVN~Y4r7iG>{OyW=R?@DmRoi9GS^QtbP zFy2DB`|uZTv8|ow|Jcz6?C=10U$*_l2oWiacRwyoLafS!EO%Lv8N-*U8V+2<_~eEA zgPG-klSM19k%(%;3YM|>F||hE4>7GMA(GaOvZBrE{$t|Hvg(C2^PEsi4+)w#P4jE2XDi2SBm1?6NiSkOp-IT<|r}L9)4tLI_KJ*GKhv16IV}An+Jyx z=Mk`vCXkt-qg|ah5=GD;g5gZQugsv!#)$@ zkE=6=6W9u9VWiGjr|MgyF<&XcKX&S3oN{c{jt-*1HHaQgY({yjZiWW97rha^TxZy< z2%-5X;0EBP>(Y9|x*603*Pz-eMF5*#4M;F`QjTBH>rrO$r3iz5 z?_nHysyjnizhZQMXo1gz7b{p`yZ8Q78^ zFJ3&CzM9fzAqb6ac}@00d*zjW`)TBzL=s$M`X*0{z8$pkd2@#4CGyKEhzqQR!7*Lo@mhw`yNEE6~+nF3p;Qp;x#-C)N5qQD)z#rmZ#)g*~Nk z)#HPdF_V$0wlJ4f3HFy&fTB#7Iq|HwGdd#P3k=p3dcpfCfn$O)C7;y;;J4Za_;+DEH%|8nKwnWcD zBgHX)JrDRqtn(hC+?fV5QVpv1^3=t2!q~AVwMBXohuW@6p`!h>>C58%sth4+Baw|u zh&>N1`t(FHKv(P+@nT$Mvcl){&d%Y5dx|&jkUxjpUO3ii1*^l$zCE*>59`AvAja%`Bfry-`?(Oo?5wY|b4YM0lC?*o7_G$QC~QwKslQTWac z#;%`sWIt8-mVa1|2KH=u!^ukn-3xyQcm4@|+Ra&~nNBi0F81BZT$XgH@$2h2wk2W% znpo1OZuQ1N>bX52II+lsnQ`WVUxmZ?4fR_f0243_m`mbc3`?iy*HBJI)p2 z`GQ{`uS;@;e1COn-vgE2D!>EheLBCF-+ok-x5X8Cu>4H}98dH^O(VlqQwE>jlLcs> zNG`aSgDNHnH8zWw?h!tye^aN|%>@k;h`Z_H6*py3hHO^6PE1-GSbkhG%wg;+vVo&dc)3~9&` zPtZtJyCqCdrFUIEt%Gs_?J``ycD16pKm^bZn>4xq3i>9{b`Ri6yH|K>kfC; zI5l&P)4NHPR)*R0DUcyB4!|2cir(Y1&Bsn3X8v4D(#QW8Dtv@D)CCO zadQC85Zy=Rkrhm9&csynbm>B_nwMTFah9ETdNcLU@J{haekA|9*DA2pY&A|FS*L!*O+>@Q$00FeL+2lg2NWLITxH5 z0l;yj=vQWI@q~jVn~+5MG!mV@Y`gE958tV#UcO#56hn>b69 zM;lq+P@MW=cIvIXkQmKS$*7l|}AW%6zETA2b`qD*cL z(=k4-4=t6FzQo#uMXVwF{4HvE%%tGbiOlO)Q3Y6D<5W$ z9pm>%TBUI99MC`N9S$crpOCr4sWJHP)$Zg#NXa~j?WeVo03P3}_w%##A@F|Bjo-nNxJZX%lbcyQtG8sO zWKHes>38e-!hu1$6VvY+W-z?<942r=i&i<88UGWdQHuMQjWC-rs$7xE<_-PNgC z_aIqBfG^4puRkogKc%I-rLIVF=M8jCh?C4!M|Q=_kO&3gwwjv$ay{FUDs?k7xr%jD zHreor1+#e1_;6|2wGPtz$``x}nzWQFj8V&Wm8Tu#oaqM<$BLh+Xis=Tt+bzEpC}w) z_c&qJ6u&eWHDb<>p;%F_>|`0p6kXYpw0B_3sIT@!=fWHH`M{FYdkF}*CxT|`v%pvx z#F#^4tdS0|O9M1#db%MF(5Opy;i( zL(Pc2aM4*f_Bme@o{xMrsO=)&>YKQw+)P-`FwEHR4vjU>#9~X7ElQ#sRMjR^Cd)wl zg^67Bgn9CK=WP%Ar>T4J!}DcLDe z=ehSmTp##KyQ78cmArL=IjOD6+n@jHCbOatm)#4l$t5YV?q-J86T&;>lEyK&9(XLh zr{kPuX+P8LN%rd%8&&Ia)iKX_%=j`Mr*)c)cO1`-B$XBvoT3yQCDKA>8F0KL$GpHL zPe?6dkE&T+VX=uJOjXyrq$BQ`a8H@wN1%0nw4qBI$2zBx)ID^6;Ux+? zu{?X$_1hoz9d^jkDJpT-N6+HDNo%^MQ2~yqsSBJj4@5;|1@w+BE04#@Jo4I63<~?O?ok%g%vQakTJKpMsk&oeVES1>cnaF7ZkFpqN6lx` zzD+YhR%wq2DP0fJCNC}CXK`g{AA6*}!O}%#0!Tdho4ooh&a5&{xtcFmjO4%Kj$f(1 zTk||{u|*?tAT{{<)?PmD_$JVA;dw;UF+x~|!q-EE*Oy?gFIlB*^``@ob2VL?rogtP z0M34@?2$;}n;^OAV2?o|zHg`+@Adk+&@Syd!rS zWvW$e5w{onua4sp+jHuJ&olMz#V53Z5y-FkcJDz>Wk%_J>COk5<0ya*aZLZl9LH}A zJhJ`Q-n9K+c8=0`FWE^x^xn4Fa7PDUc;v2+us(dSaoIUR4D#QQh91R!${|j{)=Zy1 zG;hqgdhSklM-VKL6HNC3&B(p1B)2Nshe7)F=-HBe=8o%OhK1MN*Gq6dBuPvqDRVJ{ z;zVNY?wSB%W0s^OMR_HL(Ws)va7eWGF*MWx<1wG7hZ}o=B62D?i|&0b14_7UG287YDr%?aYMMpeCkY1i`b+H!J9sqrvKc#Y6c8At@QiLSwj)@ifz~Z|c$lOMA@?cPqFRmZ%_>bz2X4(B=`^3;MDjsEeAO=? zSoD&+L>A|fGt7+6kF2@LqhL06sD%|~YsIe=EcWqy{e_61N_D(*CacnMvyXMjP87HI z4PT6!$fzxx{}=>jeqzkkoN+!r9e|@lZUN4pn(T28v`k=_vIhTn^i9O3qTqd)-%!QQ zYB6*6B@&b(!#X4C~59SLZuorNU_wWZA36{>O%iX)VS5NNZh49C_ppI>?)wwml}_0MLzOXT>lmo#&Ew6d?mu8~~I_^4VGBQtCAke;RQa5DL` z1PFDPsKb3CS$v;RhlQ1J@AHa1VRuuxp}NOIvrC>4$$A0Ix0VpAc0lfG%8{mR{TRQ( zbXM#1Tci3H*Wt>cVuMta^6^z`=^B@j+YhJqq9?>zZPxyg2U(wvod=uwJs{8gtpyab zXHQX<0FOGW6+dw&%c_qMUOI^+Rnb?&HB7Fee|33p4#8i>%_ev(aTm7N1f#6lV%28O zQ`tQh$VDjy8x(Lh#$rg1Kco$Bw%gULq+lc4$&HFGvLMO30QBSDvZ#*~hEHVZ`5=Kw z3y^9D512@P%d~s{x!lrHeL4!TzL`9(ITC97`Cwnn8PSdxPG@0_v{No|kfu3DbtF}K zuoP+88j4dP+Bn7hlGwU$BJy+LN6g&d3HJWMAd1P9xCXG-_P)raipYg5R{KQO$j;I9 z1y1cw#13K|&kfsRZ@qQC<>j=|OC?*v1|VrY$s=2!{}e33aQcZghqc@YsHKq^)kpkg z>B;CWNX+K=u|y#N)O>n5YuyvPl5cO6B^scmG?J zC8ix)E1PlhNaw8FpD+b|D$z`Id^4)rJe78MNiBga?Z- z0$L&MRTieSB1_E#KaN*H#Ns1}?zOA%Ybr{G+Sn3moXTVZj=L`nt?D&-MjOMz-Yq&@ z$P3h23d_F8Dcf*?txX7}p>nM*s+65t z1il8bHHsBynUK|aEXSjzY6sz1nZ%|%XeWTcGLRyRl@q4YAR)JovbdTTY&7u>@}28A zgV^Npp?}I!?3K7IXu9ml-Lw;w@9m zBYTeU+Seh8uJ-w?4e_6byq0f7>O3xm(hO}Y=fgU5^vW|>0yQ^0+?}LT55ei$i zzlU-iRbd8TRX9Ept%h%ariV=%u%F@@FA>U*XdAalcH%>#5_a&w)g`uW%3}m?vP- zc5}DkuF6ruKDwEYj+2YTSQ9=rkp19U5P@(zRm(nLod(sG9{~nw1BUoS2OFDXa{xfw zZ~UaZLFUZxfQ*9?_X?*~`d;nn-BbaefLJ`DT13KF6?T5Mnt;v5d>H}s)aAIzJcs#B z|CuXPJKww}hWBKsUfks#Kh$)ptp?5U1b@ttXFRbe_BZ&_R9XC6CA4WhWhMUE9Y2H4 z{w#CBCR<)Fd1M;mx*m?Z=L-^1kv1WKtqG(BjMiR4M^5yN4rlFM6oGUS2Wf~7Z@e*- ze84Vr`Bmi!(a1y}-m^HHMpbAiKPVEv|(7=|}D#Ihfk+-S5Hlkfch02z&$(zS3vrYz2g*ic{xBy~*gIp(eG}^gMc7 zPu2Eivnp@BH3SOgx!aJXttx*()!=2)%Bf$Gs^4cCs@)=(PJNxhH5lVY&qSZYaa?A^LhZW`B9(N?fx<^gCb(VE%3QpA*_Pohgp6vCB36iVaq zc1TI%L2Le?kuv?6Dq`H+W>AqnjyEzUBK948|DB|)U0_4DzWF#7L{agwo%y$hC>->r z4|_g_6ZC!n2=GF4RqVh6$$reQ(bG0K)i9(oC1t6kY)R@DNxicxGxejwL2sB<>l#w4 zE$QkyFI^(kZ#eE5srv*JDRIqRp2Totc8I%{jWhC$GrPWVc&gE1(8#?k!xDEQ)Tu~e zdU@aD8enALmN@%1FmWUz;4p}41)@c>Fg}1vv~q>xD}KC#sF|L&FU);^Ye|Q;1#^ps z)WmmdQI2;%?S%6i86-GD88>r|(nJackvJ#50vG6fm$1GWf*f6>oBiDKG0Kkwb17KPnS%7CKb zB7$V58cTd8x*NXg=uEX8Man_cDu;)4+P}BuCvYH6P|`x-#CMOp;%u$e z&BZNHgXz-KlbLp;j)si^~BI{!yNLWs5fK+!##G;yVWq|<>7TlosfaWN-;C@oag~V`3rZM_HN`kpF`u1p# ztNTl4`j*Lf>>3NIoiu{ZrM9&E5H~ozq-Qz@Lkbp-xdm>FbHQ2KCc8WD7kt?=R*kG# z!rQ178&ZoU(~U<;lsg@n216Ze3rB2FwqjbZ=u|J?nN%<4J9(Bl(90xevE|7ejUYm9 zg@E_xX}u2d%O1mpA2XzjRwWinvSeg)gHABeMH(2!A^g@~4l%8e0WWAkBvv60Cr>TR zQB1%EQ zUoZeUdqjh+1gFo6h~C~z#A57mf5ibmq$y_uVtA_kWv8X)CzfVEooDaY!#P?5$Y zGPKXbE<75nc%D-|w4OrP#;87oL@2^4+sxKah;a-5&z_&SUf~-z(1}bP=tM^GYtR3a z!x4zjSa^)KWG6jxfUI#{<26g$iAI;o_+B{LXY@WfWEdEl6%#8s3@b`?&Tm#aSK!~| z^%DdrXnijW`d!ajWuKApw&{L+WCPpFialo&^dZ9jC7A%BO`2ZF&YUDe;Yu|zFuv`2 z)BE*7Lkay)M7uohJ)446X``0x0%PzPTWY92`1Oq4a2D_7V0wypPnXFR)WM0IlFgg@ zqz#hv2xJEQL8eu}O;e(w4rSA?5|eZHbS6jENytJBq59?bOf>Wrl8ySZH36H(6fGR#vHM6q zn}!7!I@4$*+LFXs{x?|=q2*QtYT%Lw3+5(8uc0j8o3}TrG(zSV#>4wo6~)u|R+Yx# z?0$AspZDjv{dfv417~C17Oy%Fal{%+B6H(NX`$Bl>II-L3N3 zZc+sKZbqewU*&_Xt;9k=%4*aVYBvE1n&JZS7Uqjd%n8nOQmzh^x#vWK{;In~=QO)g zT-n3OU(1@3QfL|$g1d2xeBb@O15Rl01+hmpup2De7p%Yrd$E7(In!*R+;IJZh}v!svi z;7N~pq8KZDXXap0qd_D=Y^B)rz4S0^SF=&v6YYTAV$ad43#x!+n~-6< zK{8*vWoAdW(gGGt&URD}@g6tMoY(+Lw=vvxhfIIK9AjvNF_(W}1Rxn(mp;tJfDV<0 zbJN0t(@Xb8UeO{&T{$$uDrs7)j$}=?WsuDl+T2N5Y<4TMHGOMcocPr$%~(yvtKv(n z`U96d!D0cb9>Dx2zz$m&lAhazs%UeR^K*gb>d8CPs+?qlpfA;t{InXa)^2ryC(FU(Zc6Xbnnh`lg`K&g^JeS>}^c0MJKUCfV+~ zV(EN0Z5ztoN;hqcj!8V+VRbSltJ<~|y`U+9#wv|~H zNE!j9uXa=dec@JQSgJ6N6@Il&tzCBJv9#ldR`Lm*<)YwH4tdlAlG0Fl8Nfa(J~c%DQ2AA-}x8D=p(l#n1+hgx;N;1Aq?lq@{Lt9FKu89CjnnHD1G_@p;%Lp`+b@ttb33!E_Xt;QUD9~nRQl&xAro9-{+&6^ljK2f-d>&qy&d#0xwH z@slNv@ULKp!Cf*JHuS@#4c?F->WjPc)yiuSargAIEg>muRxzY?Hzdq@G5CS)U1*Et zE2SLh=@DI1J(guiy2Igq(?(xI9WL%g^f@{5Hmr|!Qz4`vn|LjrtO=b~I6~5EU5Fxy z;-#<)6w#w=DkpSthAu+E;OL?!?6C9Mwt*o(@68(Jhvs-eX4V z=d=>HI|`3J%H5X|gSrC8KH^IL?h5=3ID6svwHH@(wRbSG`Zsor^q4`3PCn#-(YX?< z_q8+T)51$E0xyKR{L!LN(G=+9K6$3#PDT^IAe|Igkx=!4#rqKWoXiZdh`&ocjp=Ok zemJe6*{it~>;sr(B0fSmp(S#*y5I0)OOz~Oe6Im+($S}e3tyx7Y6pA8vKCBmSEQDa zLfkm*;uMbTLpcR0)tF_v-lbK%`5>POyI2E(!)2=Rj0p;WKi=|UNt6HsQv0xR3QIK9 zsew(AFyzH!7Azxum{%VC^`cqhGdGbABGQ4cYdNBPTx+XpJ=NUEDeP^e^w^AOE1pQI zP{Us-sk!v$gj}@684E!uWjzvpoF|%v-6hwnitN1sCSg@(>RDCVgU8Ile_-xX`hL6u zzI4*Q)AVu(-ef8{#~P9STQ5t|qIMRoh&S?7Oq+cL6vxG?{NUr@k(~7^%w)P6nPbDa~4Jw}*p-|cT4p1?)!c0FoB(^DNJ+FDg+LoP6=RgB7Or673WD5MG&C!4< zerd6q$ODkBvFoy*%cpHGKSt z3uDC6Sc=xvv@kDzRD)aIO`x}BaWLycA%(w-D`Pd+uL*rL|etagQ;U&xt_9?7#}=}5HI)cU-0 z%pMA`>Xb7s)|Y)4HKSZOu;{lg=KjeIyXb0{@EM`FTDkLRH`!W%z*lQJ74P%Ka76)H zblrSIzf+dMWbO`g;=(b@{pS)zUcO&GrIFe%&?YeX4r8B2bBArB%-5ZrQ+vonr%AYy z1+u0*K{UVUmV>h5vD!F;6}a%KdMZQLs04oGkpiaC)zI( zT2U9qta5o|6Y+It1)sE8>u&0)W~l$NX@ZQ8UZfB=`($EW6?FT%{EoRhOrb9)z@3r8y?Z99FNLDE;7V=Q zotj&igu*Rh^VQn3MQKBq!T{yTwGhn1YL6k*?j?{_ek5xe8#i#GG4S-a_Re2lssG!} z`Y-d0BcOdB@!m?4y&hMN68}#0-IIlm_xO)d#}ugX{q^OZe{-@LeJyv`cY&ze4t2~! zKb{qX-j;kt{?gC(vW%}X4pm@1F?~LH{^Q8d@X$dy@5ff~p!J3zmA>H`A)y+6RB_h* zZfIO+bd=*LiymRw{asW%xxaVl33_xtdVrrqIPn zc@y8oMJvNtgcO~4i0`f)GCFkWY8EF?4duLVjHTdb6oYLnO9}Q-pe{CKQJL)hV8)JI z$mVA0Dq&7Z1TbYdSC(WbJ+IBjXngZTu&I+vHF|>Zo$757{8lL;8Zr-Exkf?3jzN5k z_d9I>{>^J?!l)< zNd$7E9FVrta}3qy3L7Ys$^fRWNuu^hs^{*eXvazd&+Q*?lTfc>2+EdP(o0P_Z05HX zVKsfFAQ{t^CRu~Dw(CuJ>tvx*p$5@flA>QRl455b&{*U?xU8`)nF2T$uu_(l8VNtq z?pBiRQIckGzk8W&SFSB=g6eG`ZC;6v9w`?eF*S}3E@N`2ropeHP)E}o?qJkyVEI;K$!)bWY zt9>4WmDVJh7U~m$|K`T#hF!v|znj^=M;69uXrFys#51XT;DbMr4H)>7UQ1e2(cuQf z4kr~Tt1tpBB2GaJ(|j~lHgW40EgMMVqR6eJoJig1SBg|2=$~4I3P0eP$q%_`sS&4~ z26=&a&tLjQbch1`cVXa-2fTl1y8}->|Nqu?uVrNTov!=VKh)g89wUPTgAzkSKZ57_ zr=B^mcldE3K04t4{;RaG53&9yovq;@aR#VHx+R1^^*kr-vEEd!uea68Z<{R%_DD6fn&T4 zu;fDj07L-(_fLSJGdkeh&c&7A(ZLj`7iwnkAcqUexU;WjUkqeg1m1-IUZTIZA(4dtr2Gr`e{BIejlCgS<33MB=1!8?a74!F%=Uo7N`F@k} ze+1C_eU4Y_$mvdjci zwEtCIphA2PBzBhng5=M#e4r%)RW5rVD|_`PvY$7BK`}w~d>%0O9sY#*LUAq=^OjMF^PY5m<7!=s5jyRfosCQAo#hL`h5vN-M}6Q z0Li}){5?wi8)GVHNkF|U9*8V5ej)nhb^TLw1KqiPK(@{P1^L&P=`ZNt?_+}&0(8Uh zfyyZFPgMV7ECt;Jdw|`|{}b$w4&x77VxR>8wUs|GQ5FBf1UlvasqX$qfk5rI4>Wfr zztH>y`=daAef**C12yJ7;LDf&3;h3X+5@dGPy@vS(RSs3CWimbTp=g \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >&- +APP_HOME="`pwd -P`" +cd "$SAVED" >&- + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" From ba032d748206656ba6f3a4eee3c5ea77db9d6c5b Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Thu, 1 Oct 2015 21:26:10 +0200 Subject: [PATCH 092/293] Update location reporting API --- .../gms/location/reporting/UploadRequest.aidl | 3 ++ .../reporting/UploadRequestResult.aidl | 3 ++ .../reporting/internal/IReportingService.aidl | 9 +++- .../gms/location/places/PlaceReport.java | 23 +++++++++-- .../location/reporting/ReportingState.java | 4 +- .../gms/location/reporting/UploadRequest.java | 41 +++++++++++++++++++ .../reporting/UploadRequestResult.java | 34 +++++++++++++++ 7 files changed, 112 insertions(+), 5 deletions(-) create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/location/reporting/UploadRequest.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/location/reporting/UploadRequestResult.aidl create mode 100644 play-services-api/src/main/java/com/google/android/gms/location/reporting/UploadRequest.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/location/reporting/UploadRequestResult.java diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/reporting/UploadRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/location/reporting/UploadRequest.aidl new file mode 100644 index 00000000..69547d7e --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/location/reporting/UploadRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.location.reporting; + +parcelable UploadRequest; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/reporting/UploadRequestResult.aidl b/play-services-api/src/main/aidl/com/google/android/gms/location/reporting/UploadRequestResult.aidl new file mode 100644 index 00000000..cf3ec3be --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/location/reporting/UploadRequestResult.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.location.reporting; + +parcelable UploadRequestResult; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/reporting/internal/IReportingService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/location/reporting/internal/IReportingService.aidl index c9eb0aae..715b6779 100644 --- a/play-services-api/src/main/aidl/com/google/android/gms/location/reporting/internal/IReportingService.aidl +++ b/play-services-api/src/main/aidl/com/google/android/gms/location/reporting/internal/IReportingService.aidl @@ -1,8 +1,15 @@ package com.google.android.gms.location.reporting.internal; import android.accounts.Account; +import com.google.android.gms.location.places.PlaceReport; import com.google.android.gms.location.reporting.ReportingState; +import com.google.android.gms.location.reporting.UploadRequest; +import com.google.android.gms.location.reporting.UploadRequestResult; interface IReportingService { - ReportingState unknown3(in Account account); + ReportingState getReportingState(in Account account) = 0; + int tryOptIn(in Account account) = 1; + UploadRequestResult requestUpload(in UploadRequest request) = 2; + int cancelUploadRequest(long l) = 3; + int reportDeviceAtPlace(in Account account, in PlaceReport report) = 4; } diff --git a/play-services-api/src/main/java/com/google/android/gms/location/places/PlaceReport.java b/play-services-api/src/main/java/com/google/android/gms/location/places/PlaceReport.java index 77c230e7..ecfd52c5 100644 --- a/play-services-api/src/main/java/com/google/android/gms/location/places/PlaceReport.java +++ b/play-services-api/src/main/java/com/google/android/gms/location/places/PlaceReport.java @@ -16,11 +16,28 @@ package com.google.android.gms.location.places; +import org.microg.gms.common.PublicApi; import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; -/** - * TODO: usage - */ +@PublicApi public class PlaceReport extends AutoSafeParcelable { + @SafeParceled(1) + private int versionCode; + @SafeParceled(2) + private String placeId; + @SafeParceled(3) + private String tag; + @SafeParceled(4) + private String source; + + public String getPlaceId() { + return placeId; + } + + public String getTag() { + return tag; + } + public static final Creator CREATOR = new AutoCreator(PlaceReport.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/location/reporting/ReportingState.java b/play-services-api/src/main/java/com/google/android/gms/location/reporting/ReportingState.java index bca2b791..f09022a0 100644 --- a/play-services-api/src/main/java/com/google/android/gms/location/reporting/ReportingState.java +++ b/play-services-api/src/main/java/com/google/android/gms/location/reporting/ReportingState.java @@ -21,7 +21,7 @@ import org.microg.safeparcel.SafeParceled; public class ReportingState extends AutoSafeParcelable { @SafeParceled(1) - public int versionCode; + public int versionCode = 2; @SafeParceled(2) public int reportingEnabled; @SafeParceled(3) @@ -36,6 +36,8 @@ public class ReportingState extends AutoSafeParcelable { public int expectedOptInResult; @SafeParceled(8) public Integer deviceTag; + @SafeParceled(9) + public int expectedOptInResultAssumingLocationEnabled; public static final Creator CREATOR = new AutoCreator(ReportingState.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/location/reporting/UploadRequest.java b/play-services-api/src/main/java/com/google/android/gms/location/reporting/UploadRequest.java new file mode 100644 index 00000000..8a1f8e69 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/location/reporting/UploadRequest.java @@ -0,0 +1,41 @@ +/* + * Copyright 2013-2015 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.location.reporting; + +import android.accounts.Account; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class UploadRequest extends AutoSafeParcelable { + @SafeParceled(1) + public int versionCode = 1; + @SafeParceled(2) + public Account account; + @SafeParceled(3) + public String reason; + @SafeParceled(4) + public long durationMillis; + @SafeParceled(5) + public long movingLatencyMillis; + @SafeParceled(6) + public long stationaryLatencyMillis; + @SafeParceled(7) + public String appSpecificKey; + + public static final Creator CREATOR = new AutoCreator(UploadRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/location/reporting/UploadRequestResult.java b/play-services-api/src/main/java/com/google/android/gms/location/reporting/UploadRequestResult.java new file mode 100644 index 00000000..37740e72 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/location/reporting/UploadRequestResult.java @@ -0,0 +1,34 @@ +/* + * Copyright 2013-2015 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.location.reporting; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class UploadRequestResult extends AutoSafeParcelable { + @SafeParceled(1) + public int versionCode = 1; + @SafeParceled(2) + public int resultCode; + @SafeParceled(3) + public long requestId; + + public UploadRequestResult() { + } + + public static final Creator CREATOR = new AutoCreator(UploadRequestResult.class); +} From 607fb4ae5f7950223a957cd3b7d8406c8d019340 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Thu, 1 Oct 2015 21:27:54 +0200 Subject: [PATCH 093/293] Increase reference version number --- .../src/main/java/org/microg/gms/common/Constants.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/play-services-api/src/main/java/org/microg/gms/common/Constants.java b/play-services-api/src/main/java/org/microg/gms/common/Constants.java index 7e652d6a..6e1bd63e 100644 --- a/play-services-api/src/main/java/org/microg/gms/common/Constants.java +++ b/play-services-api/src/main/java/org/microg/gms/common/Constants.java @@ -21,7 +21,7 @@ public class Constants { * This is the highest version that was looked at during development. * Does not necessarily mean anything. */ - public static final int MAX_REFERENCE_VERSION = 7887000; + public static final int MAX_REFERENCE_VERSION = 8115000; public static final String KEY_MOCK_LOCATION = "mockLocation"; public static final String DEFAULT_ACCOUNT = "<>"; public static final String GMS_PACKAGE_NAME = "com.google.android.gms"; From 1df0066367669d470cb44154e251c6796a04659f Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Thu, 1 Oct 2015 21:31:52 +0200 Subject: [PATCH 094/293] Update Gms API --- extern/GmsApi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extern/GmsApi b/extern/GmsApi index 6743f1d4..607fb4ae 160000 --- a/extern/GmsApi +++ b/extern/GmsApi @@ -1 +1 @@ -Subproject commit 6743f1d4b1a3cf0202b9d62f2ebc5dfb385b5576 +Subproject commit 607fb4ae5f7950223a957cd3b7d8406c8d019340 From d8a5f3351f201b21bb13ed2864d019347d877552 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Thu, 1 Oct 2015 21:36:38 +0200 Subject: [PATCH 095/293] Add basic play-services-cast --- build.gradle | 16 ++ play-services-cast/build.gradle | 40 +++++ .../src/main/AndroidManifest.xml | 24 +++ .../com/google/android/gms/cast/Cast.java | 153 ++++++++++++++++++ .../gms/cast/CastMediaControlIntent.java | 64 ++++++++ .../android/gms/cast/CastPresentation.java | 33 ++++ play-services/build.gradle | 39 +++-- play-services/src/main/AndroidManifest.xml | 16 ++ settings.gradle | 17 ++ 9 files changed, 391 insertions(+), 11 deletions(-) create mode 100644 play-services-cast/build.gradle create mode 100644 play-services-cast/src/main/AndroidManifest.xml create mode 100644 play-services-cast/src/main/java/com/google/android/gms/cast/Cast.java create mode 100644 play-services-cast/src/main/java/com/google/android/gms/cast/CastMediaControlIntent.java create mode 100644 play-services-cast/src/main/java/com/google/android/gms/cast/CastPresentation.java diff --git a/build.gradle b/build.gradle index 4cb7b45f..49dfafa1 100644 --- a/build.gradle +++ b/build.gradle @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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. + */ + // Top-level build file where you can add configuration options common to all sub-projects/modules. subprojects { group = 'org.microg' diff --git a/play-services-cast/build.gradle b/play-services-cast/build.gradle new file mode 100644 index 00000000..2d7747bc --- /dev/null +++ b/play-services-cast/build.gradle @@ -0,0 +1,40 @@ +/* + * Copyright 2013-2015 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. + */ + +buildscript { + repositories { + jcenter() + } + dependencies { + classpath 'com.android.tools.build:gradle:1.3.0' + classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3' + } +} + +apply plugin: 'com.android.library' +apply plugin: 'com.github.dcendents.android-maven' + +android { + compileSdkVersion 23 + buildToolsVersion "23.0.1" + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_6 + } +} + +dependencies { + compile project(':play-services-base') +} diff --git a/play-services-cast/src/main/AndroidManifest.xml b/play-services-cast/src/main/AndroidManifest.xml new file mode 100644 index 00000000..bb22a334 --- /dev/null +++ b/play-services-cast/src/main/AndroidManifest.xml @@ -0,0 +1,24 @@ + + + + + + + + + diff --git a/play-services-cast/src/main/java/com/google/android/gms/cast/Cast.java b/play-services-cast/src/main/java/com/google/android/gms/cast/Cast.java new file mode 100644 index 00000000..c84bab98 --- /dev/null +++ b/play-services-cast/src/main/java/com/google/android/gms/cast/Cast.java @@ -0,0 +1,153 @@ +/* + * Copyright 2013-2015 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.cast; + +import com.google.android.gms.common.api.Api; +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.io.IOException; + +public class Cast { + + public static final Api API = new Api(null); // TODO + public static final Cast.CastApi CastApi = null; // TODO + + public interface ApplicationConnectionResult extends Result { + ApplicationMetadata getApplicationMetadata(); + + String getApplicationStatus(); + + String getSessionId(); + + boolean getWasLaunched(); + } + + public interface CastApi { + int getActiveInputState(GoogleApiClient client); + + ApplicationMetadata getApplicationMetadata(GoogleApiClient client); + + String getApplicationStatus(GoogleApiClient client); + + int getStandbyState(GoogleApiClient client); + + double getVolume(GoogleApiClient client); + + boolean isMute(GoogleApiClient client); + + PendingResult joinApplication(GoogleApiClient client); + + PendingResult joinApplication(GoogleApiClient client, String applicationId, String sessionId); + + PendingResult joinApplication(GoogleApiClient client, String applicationId); + + PendingResult launchApplication(GoogleApiClient client, String applicationId, LaunchOptions launchOptions); + + PendingResult launchApplication(GoogleApiClient client, String applicationId); + + @Deprecated + PendingResult launchApplication(GoogleApiClient client, String applicationId, boolean relaunchIfRunning); + + PendingResult leaveApplication(GoogleApiClient client); + + void removeMessageReceivedCallbacks(GoogleApiClient client, String namespace) throws IOException; + + void requestStatus(GoogleApiClient client) throws IOException; + + PendingResult sendMessage(GoogleApiClient client, String namespace, String message); + + void setMessageReceivedCallbacks(GoogleApiClient client, String namespace, Cast.MessageReceivedCallback callbacks) throws IOException; + + void setMute(GoogleApiClient client, boolean mute) throws IOException; + + void setVolume(GoogleApiClient client, double volume) throws IOException; + + PendingResult stopApplication(GoogleApiClient client); + + PendingResult stopApplication(GoogleApiClient client, String sessionId); + } + + public static class CastOptions implements Api.ApiOptions.HasOptions { + private final CastDevice castDevice; + private final Listener castListener; + private final boolean verboseLoggingEnabled; + + public CastOptions(CastDevice castDevice, Listener castListener, boolean verboseLoggingEnabled) { + this.castDevice = castDevice; + this.castListener = castListener; + this.verboseLoggingEnabled = verboseLoggingEnabled; + } + + @Deprecated + public static Builder builder(CastDevice castDevice, Listener castListener) { + return new Builder(castDevice, castListener); + } + + public static class Builder { + private final CastDevice castDevice; + private final Listener castListener; + private boolean verboseLoggingEnabled; + + public Builder(CastDevice castDevice, Listener castListener) { + this.castDevice = castDevice; + this.castListener = castListener; + } + + public CastOptions build() { + return new CastOptions(castDevice, castListener, verboseLoggingEnabled); + } + + public Builder setVerboseLoggingEnabled(boolean verboseLoggingEnabled) { + this.verboseLoggingEnabled = verboseLoggingEnabled; + return this; + } + } + } + + public static class Listener { + public void onActiveInputStateChanged(int activeInputState) { + + } + + public void onApplicationDisconnected(int statusCode) { + + } + + public void onApplicationMetadataChanged(ApplicationMetadata applicationMetadata) { + + } + + public void onApplicationStatusChanged() { + + } + + public void onStandbyStateChanged(int standbyState) { + + } + + public void onVolumeChanged() { + + } + } + + public interface MessageReceivedCallback { + void onMessageReceived(CastDevice castDevice, String namespace, String message); + } +} diff --git a/play-services-cast/src/main/java/com/google/android/gms/cast/CastMediaControlIntent.java b/play-services-cast/src/main/java/com/google/android/gms/cast/CastMediaControlIntent.java new file mode 100644 index 00000000..e06b87fa --- /dev/null +++ b/play-services-cast/src/main/java/com/google/android/gms/cast/CastMediaControlIntent.java @@ -0,0 +1,64 @@ +/* + * Copyright 2013-2015 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.cast; + +import java.util.Collection; +import java.util.Locale; + +public class CastMediaControlIntent { + public static final String ACTION_SYNC_STATUS = "com.google.android.gms.cast.ACTION_SYNC_STATUS"; + @Deprecated + public static final String CATEGORY_CAST = "com.google.android.gms.cast.CATEGORY_CAST"; + + public static final String EXTRA_CAST_APPLICATION_ID = "com.google.android.gms.cast.EXTRA_CAST_APPLICATION_ID"; + public static final String EXTRA_CAST_LANGUAGE_CODE = "com.google.android.gms.cast.EXTRA_CAST_LANGUAGE_CODE"; + public static final String EXTRA_CAST_RELAUNCH_APPLICATION = "com.google.android.gms.cast.EXTRA_CAST_RELAUNCH_APPLICATION"; + public static final String EXTRA_CAST_STOP_APPLICATION_WHEN_SESSION_ENDS = "com.google.android.gms.cast.EXTRA_CAST_STOP_APPLICATION_WHEN_SESSION_ENDS"; + public static final String EXTRA_CUSTOM_DATA = "com.google.android.gms.cast.EXTRA_CUSTOM_DATA"; + public static final String EXTRA_DEBUG_LOGGING_ENABLED = "com.google.android.gms.cast.EXTRA_DEBUG_LOGGING_ENABLED"; + public static final String EXTRA_ERROR_CODE = "com.google.android.gms.cast.EXTRA_ERROR_CODE"; + + public static final String DEFAULT_MEDIA_RECEIVER_APPLICATION_ID = "CC1AD845"; + + public static final int ERROR_CODE_REQUEST_FAILED = 1; + public static final int ERROR_CODE_SESSION_START_FAILED = 2; + public static final int ERROR_CODE_TEMPORARILY_DISCONNECTED = 3; + + public static String categoryForCast(String applicationId) { + return CATEGORY_CAST; // TODO + } + + public static String categoryForCast(String applicationId, Collection namespaces) { + return CATEGORY_CAST; // TODO + } + + public static String categoryForCast(Collection namespaces) { + return CATEGORY_CAST; // TODO + } + + public static String categoryForRemotePlayback(String applicationId) { + return CATEGORY_CAST; // TODO + } + + public static String categoryForRemotePlayback() { + return CATEGORY_CAST; // TODO + } + + public static String languageTagForLocale(Locale locale) { + return CATEGORY_CAST; // TODO + } +} diff --git a/play-services-cast/src/main/java/com/google/android/gms/cast/CastPresentation.java b/play-services-cast/src/main/java/com/google/android/gms/cast/CastPresentation.java new file mode 100644 index 00000000..4eef8806 --- /dev/null +++ b/play-services-cast/src/main/java/com/google/android/gms/cast/CastPresentation.java @@ -0,0 +1,33 @@ +/* + * Copyright 2013-2015 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.cast; + +import android.annotation.TargetApi; +import android.app.Presentation; +import android.content.Context; +import android.view.Display; + +@TargetApi(17) +public class CastPresentation extends Presentation { + public CastPresentation(Context outerContext, Display display) { + super(outerContext, display); + } + + public CastPresentation(Context outerContext, Display display, int theme) { + super(outerContext, display, theme); + } +} diff --git a/play-services/build.gradle b/play-services/build.gradle index 75aa8dd3..3d51b56e 100644 --- a/play-services/build.gradle +++ b/play-services/build.gradle @@ -1,26 +1,43 @@ +/* + * Copyright 2013-2015 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. + */ + buildscript { repositories { - mavenCentral() + jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:1.0.1' - classpath 'com.github.dcendents:android-maven-plugin:1.2' + classpath 'com.android.tools.build:gradle:1.3.0' + classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3' } } apply plugin: 'com.android.library' apply plugin: 'com.github.dcendents.android-maven' -dependencies { - compile project(':play-services-base') - compile project(':play-services-location') - compile project(':play-services-wearable') -} - android { - compileSdkVersion 22 - buildToolsVersion "22.0.1" + compileSdkVersion 23 + buildToolsVersion "23.0.1" compileOptions { sourceCompatibility JavaVersion.VERSION_1_6 } } + +dependencies { + compile project(':play-services-base') + compile project(':play-services-cast') + compile project(':play-services-location') + compile project(':play-services-wearable') +} diff --git a/play-services/src/main/AndroidManifest.xml b/play-services/src/main/AndroidManifest.xml index 336be92b..3ef46ecf 100644 --- a/play-services/src/main/AndroidManifest.xml +++ b/play-services/src/main/AndroidManifest.xml @@ -1,4 +1,20 @@ + + diff --git a/settings.gradle b/settings.gradle index 9ec62cf1..4adc2f63 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,8 +1,25 @@ +/* + * Copyright 2013-2015 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. + */ + include ':safe-parcel' include ':play-services-api' include ':play-services-base' +include ':play-services-cast' include ':play-services-location' include ':play-services-wearable' From 41a6ee844f3be0a3a0417714a01387ddec6df122 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Thu, 1 Oct 2015 21:37:50 +0200 Subject: [PATCH 096/293] Cleanup for Java 1.6 compatibility, Update copyright --- play-services-base/build.gradle | 36 ++++++++++----- .../src/main/AndroidManifest.xml | 16 +++++++ .../android/gms/common/ConnectionResult.java | 16 +++++++ .../gms/common/GooglePlayServicesClient.java | 16 +++++++ .../gms/common/GooglePlayServicesUtil.java | 17 ++++++- .../google/android/gms/common/api/Api.java | 16 +++++++ .../gms/common/api/GoogleApiClient.java | 24 ++++++++-- .../android/gms/common/api/PendingResult.java | 16 +++++++ .../android/gms/common/api/Releasable.java | 16 +++++++ .../gms/common/api/ResultCallback.java | 16 +++++++ .../android/gms/common/data/DataBuffer.java | 2 +- .../android/gms/gcm/GoogleCloudMessaging.java | 2 +- .../common/ForwardConnectionCallbacks.java | 2 +- .../ForwardConnectionFailedListener.java | 2 +- .../java/org/microg/gms/common/GmsClient.java | 2 +- .../org/microg/gms/common/GmsConnector.java | 4 +- .../gms/common/MultiConnectionKeeper.java | 6 +-- .../gms/common/api/AbstractPendingResult.java | 2 +- .../api/AbstractPlayServicesClient.java | 2 +- .../org/microg/gms/common/api/ApiBuilder.java | 2 +- .../microg/gms/common/api/ApiConnection.java | 2 +- .../gms/common/api/GoogleApiClientImpl.java | 10 ++--- .../gms/common/api/ResultCallbackHandler.java | 2 +- .../src/main/res/values/version.xml | 2 +- play-services-location/build.gradle | 34 ++++++++++---- .../src/main/AndroidManifest.xml | 16 +++++++ .../location/FusedLocationProviderApi.java | 44 +++++++++++++------ .../android/gms/location/GeofencingApi.java | 16 +++++++ .../android/gms/location/LocationClient.java | 16 +++++++ .../gms/location/LocationListener.java | 16 +++++++ .../gms/location/LocationServices.java | 22 ++++++++-- .../FusedLocationProviderApiImpl.java | 5 ++- .../gms/location/GeofencingApiImpl.java | 2 +- .../location/GoogleLocationManagerClient.java | 2 +- .../gms/location/LocationClientImpl.java | 4 +- .../location/LocationServicesApiBuilder.java | 2 +- .../location/NativeLocationClientImpl.java | 10 ++--- play-services-wearable/build.gradle | 34 ++++++++++---- .../src/main/AndroidManifest.xml | 16 +++++++ .../google/android/gms/wearable/DataApi.java | 3 +- .../android/gms/wearable/DataEvent.java | 2 +- .../android/gms/wearable/DataEventBuffer.java | 2 +- .../android/gms/wearable/DataItemBuffer.java | 2 +- .../google/android/gms/wearable/DataMap.java | 8 ++-- .../android/gms/wearable/DataMapItem.java | 2 +- .../android/gms/wearable/MessageApi.java | 2 +- .../android/gms/wearable/MessageEvent.java | 2 +- .../google/android/gms/wearable/NodeApi.java | 2 +- .../gms/wearable/PutDataMapRequest.java | 6 ++- .../google/android/gms/wearable/Wearable.java | 4 +- .../gms/wearable/WearableListenerService.java | 2 +- .../org/microg/gms/wearable/DataApiImpl.java | 4 +- .../microg/gms/wearable/MessageApiImpl.java | 2 +- .../org/microg/gms/wearable/NodeApiImpl.java | 2 +- .../gms/wearable/WearableApiBuilder.java | 2 +- 55 files changed, 411 insertions(+), 106 deletions(-) diff --git a/play-services-base/build.gradle b/play-services-base/build.gradle index f0caf02f..fe05a441 100644 --- a/play-services-base/build.gradle +++ b/play-services-base/build.gradle @@ -1,25 +1,41 @@ +/* + * Copyright 2013-2015 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. + */ + buildscript { repositories { - mavenCentral() + jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:1.0.1' - classpath 'com.github.dcendents:android-maven-plugin:1.2' + classpath 'com.android.tools.build:gradle:1.3.0' + classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3' } } apply plugin: 'com.android.library' apply plugin: 'com.github.dcendents.android-maven' -dependencies { - compile 'com.android.support:support-v4:22.0.0' - compile project(':play-services-api') -} - android { - compileSdkVersion 22 - buildToolsVersion "22.0.1" + compileSdkVersion 23 + buildToolsVersion "23.0.1" compileOptions { sourceCompatibility JavaVersion.VERSION_1_6 } } + +dependencies { + compile 'com.android.support:support-v4:23.0.1' + compile project(':play-services-api') +} diff --git a/play-services-base/src/main/AndroidManifest.xml b/play-services-base/src/main/AndroidManifest.xml index d3685676..8b7acc02 100644 --- a/play-services-base/src/main/AndroidManifest.xml +++ b/play-services-base/src/main/AndroidManifest.xml @@ -1,4 +1,20 @@ + + diff --git a/play-services-base/src/main/java/com/google/android/gms/common/ConnectionResult.java b/play-services-base/src/main/java/com/google/android/gms/common/ConnectionResult.java index 155f0508..dbd87044 100644 --- a/play-services-base/src/main/java/com/google/android/gms/common/ConnectionResult.java +++ b/play-services-base/src/main/java/com/google/android/gms/common/ConnectionResult.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.common; import android.app.Activity; diff --git a/play-services-base/src/main/java/com/google/android/gms/common/GooglePlayServicesClient.java b/play-services-base/src/main/java/com/google/android/gms/common/GooglePlayServicesClient.java index 9796592f..b9cece5c 100644 --- a/play-services-base/src/main/java/com/google/android/gms/common/GooglePlayServicesClient.java +++ b/play-services-base/src/main/java/com/google/android/gms/common/GooglePlayServicesClient.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.common; import android.os.Bundle; diff --git a/play-services-base/src/main/java/com/google/android/gms/common/GooglePlayServicesUtil.java b/play-services-base/src/main/java/com/google/android/gms/common/GooglePlayServicesUtil.java index 01499aec..faaa6adc 100644 --- a/play-services-base/src/main/java/com/google/android/gms/common/GooglePlayServicesUtil.java +++ b/play-services-base/src/main/java/com/google/android/gms/common/GooglePlayServicesUtil.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.common; import android.app.Activity; @@ -20,7 +36,6 @@ import org.microg.gms.common.PublicApi; * TODO: methods :) */ public class GooglePlayServicesUtil { - @PublicApi(exclude = true) private static final String TAG = "GooglePlayServicesUtil"; public static final String GMS_ERROR_DIALOG = "GooglePlayServicesErrorDialog"; diff --git a/play-services-base/src/main/java/com/google/android/gms/common/api/Api.java b/play-services-base/src/main/java/com/google/android/gms/common/api/Api.java index 60ab9a36..8a55af20 100644 --- a/play-services-base/src/main/java/com/google/android/gms/common/api/Api.java +++ b/play-services-base/src/main/java/com/google/android/gms/common/api/Api.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.common.api; import org.microg.gms.common.PublicApi; diff --git a/play-services-base/src/main/java/com/google/android/gms/common/api/GoogleApiClient.java b/play-services-base/src/main/java/com/google/android/gms/common/api/GoogleApiClient.java index e44f988e..c3e44885 100644 --- a/play-services-base/src/main/java/com/google/android/gms/common/api/GoogleApiClient.java +++ b/play-services-base/src/main/java/com/google/android/gms/common/api/GoogleApiClient.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.common.api; import android.app.Activity; @@ -222,10 +238,10 @@ public interface GoogleApiClient { @PublicApi public class Builder { private final Context context; - private final Map apis = new HashMap<>(); - private final Set connectionCallbacks = new HashSet<>(); - private final Set connectionFailedListeners = new HashSet<>(); - private final Set scopes = new HashSet<>(); + private final Map apis = new HashMap(); + private final Set connectionCallbacks = new HashSet(); + private final Set connectionFailedListeners = new HashSet(); + private final Set scopes = new HashSet(); private String accountName; private int clientId = -1; private FragmentActivity fragmentActivity; diff --git a/play-services-base/src/main/java/com/google/android/gms/common/api/PendingResult.java b/play-services-base/src/main/java/com/google/android/gms/common/api/PendingResult.java index 575fc791..28943f18 100644 --- a/play-services-base/src/main/java/com/google/android/gms/common/api/PendingResult.java +++ b/play-services-base/src/main/java/com/google/android/gms/common/api/PendingResult.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.common.api; import java.util.concurrent.TimeUnit; diff --git a/play-services-base/src/main/java/com/google/android/gms/common/api/Releasable.java b/play-services-base/src/main/java/com/google/android/gms/common/api/Releasable.java index ed3d08c6..6856634a 100644 --- a/play-services-base/src/main/java/com/google/android/gms/common/api/Releasable.java +++ b/play-services-base/src/main/java/com/google/android/gms/common/api/Releasable.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.common.api; /** diff --git a/play-services-base/src/main/java/com/google/android/gms/common/api/ResultCallback.java b/play-services-base/src/main/java/com/google/android/gms/common/api/ResultCallback.java index 08335d5b..4695dbcb 100644 --- a/play-services-base/src/main/java/com/google/android/gms/common/api/ResultCallback.java +++ b/play-services-base/src/main/java/com/google/android/gms/common/api/ResultCallback.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.common.api; /** diff --git a/play-services-base/src/main/java/com/google/android/gms/common/data/DataBuffer.java b/play-services-base/src/main/java/com/google/android/gms/common/data/DataBuffer.java index 0d406cbd..485e7bc9 100644 --- a/play-services-base/src/main/java/com/google/android/gms/common/data/DataBuffer.java +++ b/play-services-base/src/main/java/com/google/android/gms/common/data/DataBuffer.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-base/src/main/java/com/google/android/gms/gcm/GoogleCloudMessaging.java b/play-services-base/src/main/java/com/google/android/gms/gcm/GoogleCloudMessaging.java index 91f00fd5..b867ae7a 100644 --- a/play-services-base/src/main/java/com/google/android/gms/gcm/GoogleCloudMessaging.java +++ b/play-services-base/src/main/java/com/google/android/gms/gcm/GoogleCloudMessaging.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-base/src/main/java/org/microg/gms/common/ForwardConnectionCallbacks.java b/play-services-base/src/main/java/org/microg/gms/common/ForwardConnectionCallbacks.java index e38972ff..62497285 100644 --- a/play-services-base/src/main/java/org/microg/gms/common/ForwardConnectionCallbacks.java +++ b/play-services-base/src/main/java/org/microg/gms/common/ForwardConnectionCallbacks.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-base/src/main/java/org/microg/gms/common/ForwardConnectionFailedListener.java b/play-services-base/src/main/java/org/microg/gms/common/ForwardConnectionFailedListener.java index 823a1991..9645b957 100644 --- a/play-services-base/src/main/java/org/microg/gms/common/ForwardConnectionFailedListener.java +++ b/play-services-base/src/main/java/org/microg/gms/common/ForwardConnectionFailedListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-base/src/main/java/org/microg/gms/common/GmsClient.java b/play-services-base/src/main/java/org/microg/gms/common/GmsClient.java index 80bf78cf..2d88a881 100644 --- a/play-services-base/src/main/java/org/microg/gms/common/GmsClient.java +++ b/play-services-base/src/main/java/org/microg/gms/common/GmsClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-base/src/main/java/org/microg/gms/common/GmsConnector.java b/play-services-base/src/main/java/org/microg/gms/common/GmsConnector.java index 3621f8ec..efb66edd 100644 --- a/play-services-base/src/main/java/org/microg/gms/common/GmsConnector.java +++ b/play-services-base/src/main/java/org/microg/gms/common/GmsConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2015 µg Project Team + * Copyright 2013-2015 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. @@ -47,7 +47,7 @@ public class GmsConnector result = new AbstractPendingResult<>(looper); + final AbstractPendingResult result = new AbstractPendingResult(looper); Message msg = new Message(); msg.obj = result; new Handler(looper).sendMessage(msg); diff --git a/play-services-base/src/main/java/org/microg/gms/common/MultiConnectionKeeper.java b/play-services-base/src/main/java/org/microg/gms/common/MultiConnectionKeeper.java index d88bc5ed..75b34039 100644 --- a/play-services-base/src/main/java/org/microg/gms/common/MultiConnectionKeeper.java +++ b/play-services-base/src/main/java/org/microg/gms/common/MultiConnectionKeeper.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2015 µg Project Team + * Copyright 2013-2015 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. @@ -39,7 +39,7 @@ public class MultiConnectionKeeper { private static MultiConnectionKeeper INSTANCE; private final Context context; - private final Map connections = new HashMap<>(); + private final Map connections = new HashMap(); public MultiConnectionKeeper(Context context) { this.context = context; @@ -83,7 +83,7 @@ public class MultiConnectionKeeper { public class Connection { private final String actionString; - private final Set connectionForwards = new HashSet<>(); + private final Set connectionForwards = new HashSet(); private boolean bound = false; private boolean connected = false; private IBinder binder; diff --git a/play-services-base/src/main/java/org/microg/gms/common/api/AbstractPendingResult.java b/play-services-base/src/main/java/org/microg/gms/common/api/AbstractPendingResult.java index 7986adff..013cc8d3 100644 --- a/play-services-base/src/main/java/org/microg/gms/common/api/AbstractPendingResult.java +++ b/play-services-base/src/main/java/org/microg/gms/common/api/AbstractPendingResult.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-base/src/main/java/org/microg/gms/common/api/AbstractPlayServicesClient.java b/play-services-base/src/main/java/org/microg/gms/common/api/AbstractPlayServicesClient.java index 50fd1bc3..32d817da 100644 --- a/play-services-base/src/main/java/org/microg/gms/common/api/AbstractPlayServicesClient.java +++ b/play-services-base/src/main/java/org/microg/gms/common/api/AbstractPlayServicesClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-base/src/main/java/org/microg/gms/common/api/ApiBuilder.java b/play-services-base/src/main/java/org/microg/gms/common/api/ApiBuilder.java index 4ffffebe..b20899df 100644 --- a/play-services-base/src/main/java/org/microg/gms/common/api/ApiBuilder.java +++ b/play-services-base/src/main/java/org/microg/gms/common/api/ApiBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-base/src/main/java/org/microg/gms/common/api/ApiConnection.java b/play-services-base/src/main/java/org/microg/gms/common/api/ApiConnection.java index 77c9af9d..019ea5d8 100644 --- a/play-services-base/src/main/java/org/microg/gms/common/api/ApiConnection.java +++ b/play-services-base/src/main/java/org/microg/gms/common/api/ApiConnection.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-base/src/main/java/org/microg/gms/common/api/GoogleApiClientImpl.java b/play-services-base/src/main/java/org/microg/gms/common/api/GoogleApiClientImpl.java index db0c707e..b47982ca 100644 --- a/play-services-base/src/main/java/org/microg/gms/common/api/GoogleApiClientImpl.java +++ b/play-services-base/src/main/java/org/microg/gms/common/api/GoogleApiClientImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2015 µg Project Team + * Copyright 2013-2015 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. @@ -42,11 +42,11 @@ public class GoogleApiClientImpl implements GoogleApiClient { private final Context context; private final Looper looper; private final AccountInfo accountInfo; - private final Map apis = new HashMap<>(); - private final Map apiConnections = new HashMap<>(); + private final Map apis = new HashMap(); + private final Map apiConnections = new HashMap(); private final Handler handler; - private final Set connectionCallbacks = new HashSet<>(); - private final Set connectionFailedListeners = new HashSet<>(); + private final Set connectionCallbacks = new HashSet(); + private final Set connectionFailedListeners = new HashSet(); private final int clientId; private final ConnectionCallbacks baseConnectionCallbacks = new ConnectionCallbacks() { @Override diff --git a/play-services-base/src/main/java/org/microg/gms/common/api/ResultCallbackHandler.java b/play-services-base/src/main/java/org/microg/gms/common/api/ResultCallbackHandler.java index 0c03a57b..071a6d74 100644 --- a/play-services-base/src/main/java/org/microg/gms/common/api/ResultCallbackHandler.java +++ b/play-services-base/src/main/java/org/microg/gms/common/api/ResultCallbackHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-base/src/main/res/values/version.xml b/play-services-base/src/main/res/values/version.xml index 096db2c0..aca0d060 100644 --- a/play-services-base/src/main/res/values/version.xml +++ b/play-services-base/src/main/res/values/version.xml @@ -1,6 +1,6 @@ + diff --git a/play-services-location/src/main/java/com/google/android/gms/location/FusedLocationProviderApi.java b/play-services-location/src/main/java/com/google/android/gms/location/FusedLocationProviderApi.java index 8c484537..572a6ae1 100644 --- a/play-services-location/src/main/java/com/google/android/gms/location/FusedLocationProviderApi.java +++ b/play-services-location/src/main/java/com/google/android/gms/location/FusedLocationProviderApi.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.location; import android.app.PendingIntent; @@ -10,26 +26,26 @@ import com.google.android.gms.common.api.PendingResult; import org.microg.gms.common.Constants; public interface FusedLocationProviderApi { - public static final String KEY_LOCATION_CHANGED = "com.google.android.location.LOCATION"; - public static final String KEY_MOCK_LOCATION = Constants.KEY_MOCK_LOCATION; + String KEY_LOCATION_CHANGED = "com.google.android.location.LOCATION"; + String KEY_MOCK_LOCATION = Constants.KEY_MOCK_LOCATION; - public Location getLastLocation(GoogleApiClient client); + Location getLastLocation(GoogleApiClient client); - public PendingResult requestLocationUpdates(GoogleApiClient client, LocationRequest request, - LocationListener listener); + PendingResult requestLocationUpdates(GoogleApiClient client, LocationRequest request, + LocationListener listener); - public PendingResult requestLocationUpdates(GoogleApiClient client, LocationRequest request, - LocationListener listener, Looper looper); + PendingResult requestLocationUpdates(GoogleApiClient client, LocationRequest request, + LocationListener listener, Looper looper); - public PendingResult requestLocationUpdates(GoogleApiClient client, LocationRequest request, - PendingIntent callbackIntent); + PendingResult requestLocationUpdates(GoogleApiClient client, LocationRequest request, + PendingIntent callbackIntent); - public PendingResult removeLocationUpdates(GoogleApiClient client, LocationListener listener); + PendingResult removeLocationUpdates(GoogleApiClient client, LocationListener listener); - public PendingResult removeLocationUpdates(GoogleApiClient client, - PendingIntent callbackIntent); + PendingResult removeLocationUpdates(GoogleApiClient client, + PendingIntent callbackIntent); - public PendingResult setMockMode(GoogleApiClient client, boolean isMockMode); + PendingResult setMockMode(GoogleApiClient client, boolean isMockMode); - public PendingResult setMockLocation(GoogleApiClient client, Location mockLocation); + PendingResult setMockLocation(GoogleApiClient client, Location mockLocation); } diff --git a/play-services-location/src/main/java/com/google/android/gms/location/GeofencingApi.java b/play-services-location/src/main/java/com/google/android/gms/location/GeofencingApi.java index fe2f8762..b2b581bf 100644 --- a/play-services-location/src/main/java/com/google/android/gms/location/GeofencingApi.java +++ b/play-services-location/src/main/java/com/google/android/gms/location/GeofencingApi.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.location; public interface GeofencingApi { diff --git a/play-services-location/src/main/java/com/google/android/gms/location/LocationClient.java b/play-services-location/src/main/java/com/google/android/gms/location/LocationClient.java index b9df6c40..ae75d4c0 100644 --- a/play-services-location/src/main/java/com/google/android/gms/location/LocationClient.java +++ b/play-services-location/src/main/java/com/google/android/gms/location/LocationClient.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.location; import android.app.PendingIntent; diff --git a/play-services-location/src/main/java/com/google/android/gms/location/LocationListener.java b/play-services-location/src/main/java/com/google/android/gms/location/LocationListener.java index 86fedc42..805b543a 100644 --- a/play-services-location/src/main/java/com/google/android/gms/location/LocationListener.java +++ b/play-services-location/src/main/java/com/google/android/gms/location/LocationListener.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.location; import android.location.Location; diff --git a/play-services-location/src/main/java/com/google/android/gms/location/LocationServices.java b/play-services-location/src/main/java/com/google/android/gms/location/LocationServices.java index 5dddd2b4..dc575bb9 100644 --- a/play-services-location/src/main/java/com/google/android/gms/location/LocationServices.java +++ b/play-services-location/src/main/java/com/google/android/gms/location/LocationServices.java @@ -1,3 +1,19 @@ +/* + * Copyright 2013-2015 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.location; import com.google.android.gms.common.api.Api; @@ -10,9 +26,7 @@ import org.microg.gms.location.LocationServicesApiBuilder; * The main entry point for location services integration. */ public class LocationServices { - public static final Api API = new Api<>(new - LocationServicesApiBuilder()); - public static final FusedLocationProviderApi FusedLocationApi = new - FusedLocationProviderApiImpl(); + public static final Api API = new Api(new LocationServicesApiBuilder()); + public static final FusedLocationProviderApi FusedLocationApi = new FusedLocationProviderApiImpl(); public static final GeofencingApi GeofencingApi = new GeofencingApiImpl(); } diff --git a/play-services-location/src/main/java/org/microg/gms/location/FusedLocationProviderApiImpl.java b/play-services-location/src/main/java/org/microg/gms/location/FusedLocationProviderApiImpl.java index 08e90c5b..a9d6bf12 100644 --- a/play-services-location/src/main/java/org/microg/gms/location/FusedLocationProviderApiImpl.java +++ b/play-services-location/src/main/java/org/microg/gms/location/FusedLocationProviderApiImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2015 µg Project Team + * Copyright 2013-2015 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. @@ -22,6 +22,7 @@ import android.os.Looper; import android.os.RemoteException; import android.util.Log; +import com.google.android.gms.common.api.Api; import com.google.android.gms.common.api.GoogleApiClient; import com.google.android.gms.common.api.PendingResult; import com.google.android.gms.common.api.Result; @@ -124,7 +125,7 @@ public class FusedLocationProviderApiImpl implements FusedLocationProviderApi { } private PendingResult callVoid(GoogleApiClient client, final Runnable runnable) { - return new GmsConnector<>(client, LocationServices.API, + return new GmsConnector(client, LocationServices.API, new GmsConnector.Callback() { @Override public Result onClientAvailable(LocationClientImpl client) throws diff --git a/play-services-location/src/main/java/org/microg/gms/location/GeofencingApiImpl.java b/play-services-location/src/main/java/org/microg/gms/location/GeofencingApiImpl.java index 81fcfdc7..7b6512b0 100644 --- a/play-services-location/src/main/java/org/microg/gms/location/GeofencingApiImpl.java +++ b/play-services-location/src/main/java/org/microg/gms/location/GeofencingApiImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-location/src/main/java/org/microg/gms/location/GoogleLocationManagerClient.java b/play-services-location/src/main/java/org/microg/gms/location/GoogleLocationManagerClient.java index 68f8d4c9..aab38b0d 100644 --- a/play-services-location/src/main/java/org/microg/gms/location/GoogleLocationManagerClient.java +++ b/play-services-location/src/main/java/org/microg/gms/location/GoogleLocationManagerClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-location/src/main/java/org/microg/gms/location/LocationClientImpl.java b/play-services-location/src/main/java/org/microg/gms/location/LocationClientImpl.java index a79e0c62..e3593198 100644 --- a/play-services-location/src/main/java/org/microg/gms/location/LocationClientImpl.java +++ b/play-services-location/src/main/java/org/microg/gms/location/LocationClientImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2015 µg Project Team + * Copyright 2013-2015 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. @@ -38,7 +38,7 @@ import java.util.Map; public class LocationClientImpl extends GoogleLocationManagerClient { private static final String TAG = "GmsLocationClientImpl"; private NativeLocationClientImpl nativeLocation = null; - private Map listenerMap = new HashMap<>(); + private Map listenerMap = new HashMap(); public LocationClientImpl(Context context, GoogleApiClient.ConnectionCallbacks callbacks, diff --git a/play-services-location/src/main/java/org/microg/gms/location/LocationServicesApiBuilder.java b/play-services-location/src/main/java/org/microg/gms/location/LocationServicesApiBuilder.java index 6876e630..218feebd 100644 --- a/play-services-location/src/main/java/org/microg/gms/location/LocationServicesApiBuilder.java +++ b/play-services-location/src/main/java/org/microg/gms/location/LocationServicesApiBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-location/src/main/java/org/microg/gms/location/NativeLocationClientImpl.java b/play-services-location/src/main/java/org/microg/gms/location/NativeLocationClientImpl.java index 5129c19f..500e5e05 100644 --- a/play-services-location/src/main/java/org/microg/gms/location/NativeLocationClientImpl.java +++ b/play-services-location/src/main/java/org/microg/gms/location/NativeLocationClientImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2015 µg Project Team + * Copyright 2013-2015 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. @@ -35,15 +35,15 @@ import java.util.HashMap; import java.util.Map; public class NativeLocationClientImpl { - private final static String TAG = "GmsToNativeLocationClient"; + private final static String TAG = "GmsToNativeLocClient"; private final static Criteria DEFAULT_CRITERIA = new Criteria(); - private final static Map pendingCount = new HashMap<>(); - private final static Map nativePendingMap = new HashMap<>(); + private final static Map pendingCount = new HashMap(); + private final static Map nativePendingMap = new HashMap(); private static final String EXTRA_PENDING_INTENT = "pending_intent"; private final Context context; private final LocationManager locationManager; - private final Map nativeListenerMap = new HashMap<>(); + private final Map nativeListenerMap = new HashMap(); public NativeLocationClientImpl(LocationClientImpl client) { context = client.getContext(); diff --git a/play-services-wearable/build.gradle b/play-services-wearable/build.gradle index 041610d5..2d7747bc 100644 --- a/play-services-wearable/build.gradle +++ b/play-services-wearable/build.gradle @@ -1,24 +1,40 @@ +/* + * Copyright 2013-2015 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. + */ + buildscript { repositories { - mavenCentral() + jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:1.0.1' - classpath 'com.github.dcendents:android-maven-plugin:1.2' + classpath 'com.android.tools.build:gradle:1.3.0' + classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3' } } apply plugin: 'com.android.library' apply plugin: 'com.github.dcendents.android-maven' -dependencies { - compile project(':play-services-base') -} - android { - compileSdkVersion 22 - buildToolsVersion "22.0.1" + compileSdkVersion 23 + buildToolsVersion "23.0.1" compileOptions { sourceCompatibility JavaVersion.VERSION_1_6 } } + +dependencies { + compile project(':play-services-base') +} diff --git a/play-services-wearable/src/main/AndroidManifest.xml b/play-services-wearable/src/main/AndroidManifest.xml index 33723d79..bb22a334 100644 --- a/play-services-wearable/src/main/AndroidManifest.xml +++ b/play-services-wearable/src/main/AndroidManifest.xml @@ -1,4 +1,20 @@ + + 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 25ef04bc..fffa4079 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,5 +1,5 @@ /* - * Copyright 2014-2015 µg Project Team + * Copyright 2013-2015 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. @@ -24,6 +24,7 @@ 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 com.google.android.gms.common.data.Freezable; +import com.google.android.gms.wearable.internal.PutDataRequest; import org.microg.gms.common.PublicApi; diff --git a/play-services-wearable/src/main/java/com/google/android/gms/wearable/DataEvent.java b/play-services-wearable/src/main/java/com/google/android/gms/wearable/DataEvent.java index 0d72101e..3a665646 100644 --- a/play-services-wearable/src/main/java/com/google/android/gms/wearable/DataEvent.java +++ b/play-services-wearable/src/main/java/com/google/android/gms/wearable/DataEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-wearable/src/main/java/com/google/android/gms/wearable/DataEventBuffer.java b/play-services-wearable/src/main/java/com/google/android/gms/wearable/DataEventBuffer.java index 1d4f6a45..b5cc0952 100644 --- a/play-services-wearable/src/main/java/com/google/android/gms/wearable/DataEventBuffer.java +++ b/play-services-wearable/src/main/java/com/google/android/gms/wearable/DataEventBuffer.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-wearable/src/main/java/com/google/android/gms/wearable/DataItemBuffer.java b/play-services-wearable/src/main/java/com/google/android/gms/wearable/DataItemBuffer.java index 991b79f4..56b71acf 100644 --- a/play-services-wearable/src/main/java/com/google/android/gms/wearable/DataItemBuffer.java +++ b/play-services-wearable/src/main/java/com/google/android/gms/wearable/DataItemBuffer.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-wearable/src/main/java/com/google/android/gms/wearable/DataMap.java b/play-services-wearable/src/main/java/com/google/android/gms/wearable/DataMap.java index aad96e14..0cbb2c63 100644 --- a/play-services-wearable/src/main/java/com/google/android/gms/wearable/DataMap.java +++ b/play-services-wearable/src/main/java/com/google/android/gms/wearable/DataMap.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. @@ -34,8 +34,8 @@ import java.util.Set; public class DataMap { public static String TAG = "GmsDataMap"; - private Map data = new HashMap<>(); - private Map types = new HashMap<>(); + private Map data = new HashMap(); + private Map types = new HashMap(); public DataMap() { @@ -45,7 +45,7 @@ public class DataMap { * @return an ArrayList of DataMaps from an ArrayList of Bundles. Any elements in the Bundles not supported by DataMap will be dropped. */ public static ArrayList arrayListFromBundleArrayList(ArrayList bundleArrayList) { - ArrayList res = new ArrayList<>(); + ArrayList res = new ArrayList(); for (Bundle bundle : bundleArrayList) { res.add(fromBundle(bundle)); } diff --git a/play-services-wearable/src/main/java/com/google/android/gms/wearable/DataMapItem.java b/play-services-wearable/src/main/java/com/google/android/gms/wearable/DataMapItem.java index 7eb6fb0f..3dadd29d 100644 --- a/play-services-wearable/src/main/java/com/google/android/gms/wearable/DataMapItem.java +++ b/play-services-wearable/src/main/java/com/google/android/gms/wearable/DataMapItem.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-wearable/src/main/java/com/google/android/gms/wearable/MessageApi.java b/play-services-wearable/src/main/java/com/google/android/gms/wearable/MessageApi.java index 999d615f..e2016f73 100644 --- a/play-services-wearable/src/main/java/com/google/android/gms/wearable/MessageApi.java +++ b/play-services-wearable/src/main/java/com/google/android/gms/wearable/MessageApi.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-wearable/src/main/java/com/google/android/gms/wearable/MessageEvent.java b/play-services-wearable/src/main/java/com/google/android/gms/wearable/MessageEvent.java index c5dd0d33..5c772334 100644 --- a/play-services-wearable/src/main/java/com/google/android/gms/wearable/MessageEvent.java +++ b/play-services-wearable/src/main/java/com/google/android/gms/wearable/MessageEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. 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 86088446..4e9e19ae 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 2014-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-wearable/src/main/java/com/google/android/gms/wearable/PutDataMapRequest.java b/play-services-wearable/src/main/java/com/google/android/gms/wearable/PutDataMapRequest.java index 339c23ef..6a171425 100644 --- a/play-services-wearable/src/main/java/com/google/android/gms/wearable/PutDataMapRequest.java +++ b/play-services-wearable/src/main/java/com/google/android/gms/wearable/PutDataMapRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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,6 +18,8 @@ package com.google.android.gms.wearable; import android.net.Uri; +import com.google.android.gms.wearable.internal.PutDataRequest; + import org.microg.gms.common.PublicApi; /** @@ -38,7 +40,7 @@ public class PutDataMapRequest { */ public PutDataRequest asPutDataRequest() { // TODO - return PutDataRequest.create(null); + return PutDataRequest.create((Uri) null); } /** 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 72003234..420652a3 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 2014-2015 µg Project Team + * Copyright 2013-2015 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. @@ -31,7 +31,7 @@ public class Wearable { /** * Token to pass to {@link GoogleApiClient.Builder#addApi(Api)} to enable the Wearable features. */ - public static final Api API = new Api<>(new WearableApiBuilder()); + public static final Api API = new Api(new WearableApiBuilder()); public static final DataApi DataApi = new DataApiImpl(); public static final MessageApi MessageApi = new MessageApiImpl(); diff --git a/play-services-wearable/src/main/java/com/google/android/gms/wearable/WearableListenerService.java b/play-services-wearable/src/main/java/com/google/android/gms/wearable/WearableListenerService.java index 61a552d0..5817c5d3 100644 --- a/play-services-wearable/src/main/java/com/google/android/gms/wearable/WearableListenerService.java +++ b/play-services-wearable/src/main/java/com/google/android/gms/wearable/WearableListenerService.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-wearable/src/main/java/org/microg/gms/wearable/DataApiImpl.java b/play-services-wearable/src/main/java/org/microg/gms/wearable/DataApiImpl.java index bdfa778e..f7a09865 100644 --- a/play-services-wearable/src/main/java/org/microg/gms/wearable/DataApiImpl.java +++ b/play-services-wearable/src/main/java/org/microg/gms/wearable/DataApiImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2015 µg Project Team + * Copyright 2013-2015 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. @@ -25,7 +25,7 @@ import com.google.android.gms.wearable.Asset; import com.google.android.gms.wearable.DataApi; import com.google.android.gms.wearable.DataItemAsset; import com.google.android.gms.wearable.DataItemBuffer; -import com.google.android.gms.wearable.PutDataRequest; +import com.google.android.gms.wearable.internal.PutDataRequest; public class DataApiImpl implements DataApi { @Override diff --git a/play-services-wearable/src/main/java/org/microg/gms/wearable/MessageApiImpl.java b/play-services-wearable/src/main/java/org/microg/gms/wearable/MessageApiImpl.java index 667eaa77..3312ad45 100644 --- a/play-services-wearable/src/main/java/org/microg/gms/wearable/MessageApiImpl.java +++ b/play-services-wearable/src/main/java/org/microg/gms/wearable/MessageApiImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-wearable/src/main/java/org/microg/gms/wearable/NodeApiImpl.java b/play-services-wearable/src/main/java/org/microg/gms/wearable/NodeApiImpl.java index 2aca31ee..4cf51a46 100644 --- a/play-services-wearable/src/main/java/org/microg/gms/wearable/NodeApiImpl.java +++ b/play-services-wearable/src/main/java/org/microg/gms/wearable/NodeApiImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2015 µg Project Team + * Copyright 2013-2015 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. diff --git a/play-services-wearable/src/main/java/org/microg/gms/wearable/WearableApiBuilder.java b/play-services-wearable/src/main/java/org/microg/gms/wearable/WearableApiBuilder.java index c19f5da4..1d103230 100644 --- a/play-services-wearable/src/main/java/org/microg/gms/wearable/WearableApiBuilder.java +++ b/play-services-wearable/src/main/java/org/microg/gms/wearable/WearableApiBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2015 µg Project Team + * Copyright 2013-2015 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. From bb4037017c447d8129abf7c5cbaa73e527da5631 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Fri, 2 Oct 2015 03:22:02 +0200 Subject: [PATCH 097/293] Update Cast API --- .../google/android/gms/cast/CastDevice.java | 42 +++++- .../gms/cast/CastMediaControlIntent.java | 133 ++++++++++++++++++ .../android/gms/cast/CastStatusCodes.java | 38 +++++ 3 files changed, 206 insertions(+), 7 deletions(-) create mode 100644 play-services-api/src/main/java/com/google/android/gms/cast/CastMediaControlIntent.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/cast/CastStatusCodes.java diff --git a/play-services-api/src/main/java/com/google/android/gms/cast/CastDevice.java b/play-services-api/src/main/java/com/google/android/gms/cast/CastDevice.java index 6645c95e..a36292b1 100644 --- a/play-services-api/src/main/java/com/google/android/gms/cast/CastDevice.java +++ b/play-services-api/src/main/java/com/google/android/gms/cast/CastDevice.java @@ -33,29 +33,57 @@ import java.util.List; public class CastDevice extends AutoSafeParcelable { private static final String EXTRA_CAST_DEVICE = "com.google.android.gms.cast.EXTRA_CAST_DEVICE"; + /** + * Video-output device capability. + */ public static final int CAPABILITY_VIDEO_OUT = 1; + + /** + * Video-input device capability. + */ public static final int CAPABILITY_VIDEO_IN = 2; + + /** + * Audio-output device capability. + */ public static final int CAPABILITY_AUDIO_OUT = 4; + + /** + * Audio-input device capability. + */ public static final int CAPABILITY_AUDIO_IN = 8; @SafeParceled(1) - private int versionCode; + private int versionCode = 3; + + @SafeParceled(2) + private String deviceId; @SafeParceled(3) private String addrString; private Inet4Address addr; - private String deviceId; - - private String deviceVersion; - + @SafeParceled(4) private String friendlyName; + @SafeParceled(5) + private String modelName; + + @SafeParceled(6) + private String deviceVersion; + + @SafeParceled(7) private int servicePort; @SafeParceled(value = 8, subClass = WebImage.class) private ArrayList icons; + @SafeParceled(8) + private int capabilities; + + @SafeParceled(9) + private int status; + public String getDeviceId() { return deviceId; } @@ -89,7 +117,7 @@ public class CastDevice extends AutoSafeParcelable { } public String getModelName() { - return null; + return modelName; } public int getServicePort() { @@ -101,7 +129,7 @@ public class CastDevice extends AutoSafeParcelable { } public boolean hasCapability(int capability) { - return false; + return (capability & capabilities) == capability; } public boolean hasIcons() { diff --git a/play-services-api/src/main/java/com/google/android/gms/cast/CastMediaControlIntent.java b/play-services-api/src/main/java/com/google/android/gms/cast/CastMediaControlIntent.java new file mode 100644 index 00000000..88e335d5 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/cast/CastMediaControlIntent.java @@ -0,0 +1,133 @@ +/* + * Copyright 2013-2015 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.cast; + +import android.text.TextUtils; + +import java.util.Collection; +import java.util.Locale; + +/** + * Intent constants for use with the Cast MediaRouteProvider. This class also contains utility methods for creating + * a control category for discovering Cast media routes that support a specific app and/or set of namespaces, to be + * used with MediaRouteSelector. + */ +public final class CastMediaControlIntent { + @Deprecated + public static final String CATEGORY_CAST = "com.google.android.gms.cast.CATEGORY_CAST"; + public static final String ACTION_SYNC_STATUS = "com.google.android.gms.cast.ACTION_SYNC_STATUS"; + + /** + * The application ID for the Cast Default Media Receiver. + */ + public static final String DEFAULT_MEDIA_RECEIVER_APPLICATION_ID = "CC1AD845"; + + /** + * An error code indicating that a Cast request has failed. + */ + public static final int ERROR_CODE_REQUEST_FAILED = 1; + + /** + * An error code indicating that the request could not be processed because the session could not be started. + */ + public static final int ERROR_CODE_SESSION_START_FAILED = 2; + + /** + * An error code indicating that the connection to the Cast device has been lost, but the system is actively + * trying to re-establish the connection. + */ + public static final int ERROR_CODE_TEMPORARILY_DISCONNECTED = 3; + + /** + * The extra that contains the ID of the application to launch for an + * {@link android.support.v7.media.MediaContolIntent#ACTION_START_SESSION} request. + * The value is expected to be a String. + */ + public static final String EXTRA_CAST_APPLICATION_ID = "com.google.android.gms.cast.EXTRA_CAST_APPLICATION_ID"; + public static final String EXTRA_CAST_RELAUNCH_APPLICATION = "com.google.android.gms.cast.EXTRA_CAST_RELAUNCH_APPLICATION"; + public static final String EXTRA_CAST_LANGUAGE_CODE = "com.google.android.gms.cast.EXTRA_CAST_LANGUAGE_CODE"; + public static final String EXTRA_CAST_STOP_APPLICATION_WHEN_SESSION_ENDS = "com.google.android.gms.cast.EXTRA_CAST_STOP_APPLICATION_WHEN_SESSION_ENDS"; + public static final String EXTRA_CUSTOM_DATA = "com.google.android.gms.cast.EXTRA_CUSTOM_DATA"; + + /** + * The extra that indicates whether debug logging should be enabled for the Cast session. The value is expected to be a boolean. + */ + public static final String EXTRA_DEBUG_LOGGING_ENABLED = "com.google.android.gms.cast.EXTRA_DEBUG_LOGGING_ENABLED"; + + /** + * n error bundle extra for the error code. The value is an integer, and will be one of the {@code ERROR_CODE_*} + * constants declared in this class. + */ + public static final String EXTRA_ERROR_CODE = "com.google.android.gms.cast.EXTRA_ERROR_CODE"; + + private static final String CATEGORY_CAST_REMOTE_PLAYBACK = "com.google.android.gms.cast.CATEGORY_CAST_REMOTE_PLAYBACK"; + + private CastMediaControlIntent() { + } + + /** + * Returns a custom control category for discovering Cast devices that support running the specified app, independent of whether the app is running or not. + * + * @param applicationId The application ID of the receiver application. + */ + public static String categoryForCast(String applicationId) { + return CATEGORY_CAST + "/" + applicationId; + } + + /** + * Returns a custom control category for discovering Cast devices meeting both application ID and namespace + * restrictions. See {@link #categoryForCast(Collection)} and {@link #categoryForCast(String)} for more details. + */ + public static String categoryForCast(String applicationId, Collection namespaces) { + return CATEGORY_CAST + "" + applicationId + "/" + TextUtils.join(",", namespaces); + } + + /** + * Returns a custom control category for discovering Cast devices currently running an application which supports the specified namespaces. Apps supporting additional namespaces beyond those specified here are still considered supported. + */ + public static String categoryForCast(Collection namespaces) { + return CATEGORY_CAST + "//" + TextUtils.join(",", namespaces); + } + + /** + * Returns a custom control category for discovering Cast devices which support the default Android remote + * playback actions using the specified Cast player. If the Default Media Receiver is desired, use + * {@link #DEFAULT_MEDIA_RECEIVER_APPLICATION_ID} as the applicationId. + * + * @param applicationId The application ID of the receiver application. + */ + public static String categoryForRemotePlayback(String applicationId) { + return CATEGORY_CAST_REMOTE_PLAYBACK + "/" + applicationId; + } + + /** + * Returns a custom control category for discovering Cast devices which support the Default Media Receiver. + */ + public static String categoryForRemotePlayback() { + return CATEGORY_CAST_REMOTE_PLAYBACK; + } + + /** + * Returns an RFC-5646 language tag string fo the given locale. + */ + public static String languageTagForLocale(Locale locale) { + StringBuilder sb = new StringBuilder(locale.getLanguage()); + if (!TextUtils.isEmpty(locale.getCountry())) sb.append('-').append(locale.getCountry()); + if (!TextUtils.isEmpty(locale.getVariant())) sb.append('-').append(locale.getVariant()); + return sb.toString(); + } +} diff --git a/play-services-api/src/main/java/com/google/android/gms/cast/CastStatusCodes.java b/play-services-api/src/main/java/com/google/android/gms/cast/CastStatusCodes.java new file mode 100644 index 00000000..7b2c262e --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/cast/CastStatusCodes.java @@ -0,0 +1,38 @@ +/* + * Copyright 2013-2015 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.cast; + +public final class CastStatusCodes { + public static final int APPLICATION_NOT_FOUND = 2004; + public static final int APPLICATION_NOT_RUNNING = 2005; + public static final int AUTHENTICATION_FAILED = 2000; + public static final int CANCELED = 2002; + public static final int ERROR_SERVICE_CREATION_FAILED = 2200; + public static final int ERROR_SERVICE_DISCONNECTED = 2201; + public static final int FAILED = 2100; + public static final int INTERNAL_ERROR = 8; + public static final int INTERRUPTED = 14; + public static final int INVALID_REQUEST = 2001; + public static final int MESSAGE_SEND_BUFFER_TOO_FULL = 2007; + public static final int MESSAGE_TOO_LARGE = 2006; + public static final int NETWORK_ERROR = 7; + public static final int NOT_ALLOWED = 2003; + public static final int REPLACED = 2103; + public static final int SUCCESS = 0; + public static final int TIMEOUT = 15; + public static final int UNKNOWN_ERROR = 13; +} From 2c18bafa4b37a4fb0f290d2ed6e32af34f9b519b Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Fri, 2 Oct 2015 03:22:45 +0200 Subject: [PATCH 098/293] Update Cast API --- extern/GmsApi | 2 +- .../google/android/gms/common/api/Api.java | 8 +- .../microg/gms/common/DummyApiConnection.java | 43 ++++++ .../com/google/android/gms/cast/Cast.java | 76 +++++++++- .../gms/cast/CastMediaControlIntent.java | 64 --------- .../android/gms/cast/CastRemoteDisplay.java | 76 ++++++++++ .../gms/cast/CastRemoteDisplayApi.java | 26 ++++ .../cast/CastRemoteDisplayLocalService.java | 28 ++++ .../org/microg/gms/cast/CastApiBuilder.java | 34 +++++ .../java/org/microg/gms/cast/CastApiImpl.java | 134 ++++++++++++++++++ .../org/microg/gms/cast/CastClientImpl.java | 29 ++++ .../gms/cast/CastRemoteDisplayApiBuilder.java | 35 +++++ .../gms/cast/CastRemoteDisplayApiImpl.java | 34 +++++ 13 files changed, 517 insertions(+), 72 deletions(-) create mode 100644 play-services-base/src/main/java/org/microg/gms/common/DummyApiConnection.java delete mode 100644 play-services-cast/src/main/java/com/google/android/gms/cast/CastMediaControlIntent.java create mode 100644 play-services-cast/src/main/java/com/google/android/gms/cast/CastRemoteDisplay.java create mode 100644 play-services-cast/src/main/java/com/google/android/gms/cast/CastRemoteDisplayApi.java create mode 100644 play-services-cast/src/main/java/com/google/android/gms/cast/CastRemoteDisplayLocalService.java create mode 100644 play-services-cast/src/main/java/org/microg/gms/cast/CastApiBuilder.java create mode 100644 play-services-cast/src/main/java/org/microg/gms/cast/CastApiImpl.java create mode 100644 play-services-cast/src/main/java/org/microg/gms/cast/CastClientImpl.java create mode 100644 play-services-cast/src/main/java/org/microg/gms/cast/CastRemoteDisplayApiBuilder.java create mode 100644 play-services-cast/src/main/java/org/microg/gms/cast/CastRemoteDisplayApiImpl.java diff --git a/extern/GmsApi b/extern/GmsApi index 607fb4ae..bb403701 160000 --- a/extern/GmsApi +++ b/extern/GmsApi @@ -1 +1 @@ -Subproject commit 607fb4ae5f7950223a957cd3b7d8406c8d019340 +Subproject commit bb4037017c447d8129abf7c5cbaa73e527da5631 diff --git a/play-services-base/src/main/java/com/google/android/gms/common/api/Api.java b/play-services-base/src/main/java/com/google/android/gms/common/api/Api.java index 8a55af20..1b0f03f2 100644 --- a/play-services-base/src/main/java/com/google/android/gms/common/api/Api.java +++ b/play-services-base/src/main/java/com/google/android/gms/common/api/Api.java @@ -56,28 +56,28 @@ public final class Api { * Base interface for {@link ApiOptions} in {@link Api}s that have options. */ @PublicApi - public interface HasOptions extends ApiOptions { + interface HasOptions extends ApiOptions { } /** * Base interface for {@link ApiOptions} that are not required, don't exist. */ @PublicApi - public interface NotRequiredOptions extends ApiOptions { + interface NotRequiredOptions extends ApiOptions { } /** * {@link ApiOptions} implementation for {@link Api}s that do not take any options. */ @PublicApi - public final class NoOptions implements NotRequiredOptions { + final class NoOptions implements NotRequiredOptions { } /** * Base interface for {@link ApiOptions} that are optional. */ @PublicApi - public interface Optional extends HasOptions, NotRequiredOptions { + interface Optional extends HasOptions, NotRequiredOptions { } } diff --git a/play-services-base/src/main/java/org/microg/gms/common/DummyApiConnection.java b/play-services-base/src/main/java/org/microg/gms/common/DummyApiConnection.java new file mode 100644 index 00000000..355a1675 --- /dev/null +++ b/play-services-base/src/main/java/org/microg/gms/common/DummyApiConnection.java @@ -0,0 +1,43 @@ +/* + * Copyright 2013-2015 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 org.microg.gms.common; + +import org.microg.gms.common.api.ApiConnection; + +public class DummyApiConnection implements ApiConnection { + private boolean connected = false; + + @Override + public void connect() { + connected = true; + } + + @Override + public void disconnect() { + connected = false; + } + + @Override + public boolean isConnected() { + return connected; + } + + @Override + public boolean isConnecting() { + return false; + } +} diff --git a/play-services-cast/src/main/java/com/google/android/gms/cast/Cast.java b/play-services-cast/src/main/java/com/google/android/gms/cast/Cast.java index c84bab98..18065ded 100644 --- a/play-services-cast/src/main/java/com/google/android/gms/cast/Cast.java +++ b/play-services-cast/src/main/java/com/google/android/gms/cast/Cast.java @@ -16,18 +16,88 @@ package com.google.android.gms.cast; +import android.os.Bundle; + import com.google.android.gms.common.api.Api; 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.cast.CastApiBuilder; +import org.microg.gms.cast.CastApiImpl; +import org.microg.gms.common.PublicApi; + import java.io.IOException; -public class Cast { +@PublicApi +public final class Cast { - public static final Api API = new Api(null); // TODO - public static final Cast.CastApi CastApi = null; // TODO + /** + * A constant indicating that the Google Cast device is not the currently active video input. + */ + public static final int ACTIVE_INPUT_STATE_NO = 0; + + /** + * A constant indicating that it is not known (and/or not possible to know) whether the Google Cast device is + * the currently active video input. Active input state can only be reported when the Google Cast device is + * connected to a TV or AVR with CEC support. + */ + public static final int ACTIVE_INPUT_STATE_UNKNOWN = -1; + + /** + * A constant indicating that the Google Cast device is the currently active video input. + */ + public static final int ACTIVE_INPUT_STATE_YES = 1; + + /** + * A boolean extra for the connection hint bundle passed to + * {@link GoogleApiClient.ConnectionCallbacks#onConnected(Bundle)} that indicates that the connection was + * re-established, but the receiver application that was in use at the time of the connection loss is no longer + * running on the receiver. + */ + public static final String EXTRA_APP_NO_LONGER_RUNNING = "com.google.android.gms.cast.EXTRA_APP_NO_LONGER_RUNNING"; + + /** + * The maximum raw message length (in bytes) that is supported by a Cast channel. + */ + public static final int MAX_MESSAGE_LENGTH = 65536; + + /** + * The maximum length (in characters) of a namespace name. + */ + public static final int MAX_NAMESPACE_LENGTH = 128; + + /** + * A constant indicating that the Google Cast device is not currently in standby. + */ + public static final int STANDBY_STATE_NO = 0; + + /** + * A constant indicating that it is not known (and/or not possible to know) whether the Google Cast device is + * currently in standby. Standby state can only be reported when the Google Cast device is connected to a TV or + * AVR with CEC support. + */ + public static final int STANDBY_STATE_UNKNOWN = -1; + + /** + * A constant indicating that the Google Cast device is currently in standby. + */ + public static final int STANDBY_STATE_YES = 1; + + + /** + * Token to pass to {@link GoogleApiClient.Builder#addApi(Api)} to enable the Cast features. + */ + public static final Api API = new Api(new CastApiBuilder()); + + /** + * An implementation of the CastApi interface. The interface is used to interact with a cast device. + */ + public static final Cast.CastApi CastApi = new CastApiImpl(); + + private Cast() { + } public interface ApplicationConnectionResult extends Result { ApplicationMetadata getApplicationMetadata(); diff --git a/play-services-cast/src/main/java/com/google/android/gms/cast/CastMediaControlIntent.java b/play-services-cast/src/main/java/com/google/android/gms/cast/CastMediaControlIntent.java deleted file mode 100644 index e06b87fa..00000000 --- a/play-services-cast/src/main/java/com/google/android/gms/cast/CastMediaControlIntent.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2013-2015 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.cast; - -import java.util.Collection; -import java.util.Locale; - -public class CastMediaControlIntent { - public static final String ACTION_SYNC_STATUS = "com.google.android.gms.cast.ACTION_SYNC_STATUS"; - @Deprecated - public static final String CATEGORY_CAST = "com.google.android.gms.cast.CATEGORY_CAST"; - - public static final String EXTRA_CAST_APPLICATION_ID = "com.google.android.gms.cast.EXTRA_CAST_APPLICATION_ID"; - public static final String EXTRA_CAST_LANGUAGE_CODE = "com.google.android.gms.cast.EXTRA_CAST_LANGUAGE_CODE"; - public static final String EXTRA_CAST_RELAUNCH_APPLICATION = "com.google.android.gms.cast.EXTRA_CAST_RELAUNCH_APPLICATION"; - public static final String EXTRA_CAST_STOP_APPLICATION_WHEN_SESSION_ENDS = "com.google.android.gms.cast.EXTRA_CAST_STOP_APPLICATION_WHEN_SESSION_ENDS"; - public static final String EXTRA_CUSTOM_DATA = "com.google.android.gms.cast.EXTRA_CUSTOM_DATA"; - public static final String EXTRA_DEBUG_LOGGING_ENABLED = "com.google.android.gms.cast.EXTRA_DEBUG_LOGGING_ENABLED"; - public static final String EXTRA_ERROR_CODE = "com.google.android.gms.cast.EXTRA_ERROR_CODE"; - - public static final String DEFAULT_MEDIA_RECEIVER_APPLICATION_ID = "CC1AD845"; - - public static final int ERROR_CODE_REQUEST_FAILED = 1; - public static final int ERROR_CODE_SESSION_START_FAILED = 2; - public static final int ERROR_CODE_TEMPORARILY_DISCONNECTED = 3; - - public static String categoryForCast(String applicationId) { - return CATEGORY_CAST; // TODO - } - - public static String categoryForCast(String applicationId, Collection namespaces) { - return CATEGORY_CAST; // TODO - } - - public static String categoryForCast(Collection namespaces) { - return CATEGORY_CAST; // TODO - } - - public static String categoryForRemotePlayback(String applicationId) { - return CATEGORY_CAST; // TODO - } - - public static String categoryForRemotePlayback() { - return CATEGORY_CAST; // TODO - } - - public static String languageTagForLocale(Locale locale) { - return CATEGORY_CAST; // TODO - } -} diff --git a/play-services-cast/src/main/java/com/google/android/gms/cast/CastRemoteDisplay.java b/play-services-cast/src/main/java/com/google/android/gms/cast/CastRemoteDisplay.java new file mode 100644 index 00000000..c6a4bc96 --- /dev/null +++ b/play-services-cast/src/main/java/com/google/android/gms/cast/CastRemoteDisplay.java @@ -0,0 +1,76 @@ +/* + * Copyright 2013-2015 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.cast; + +import android.view.Display; + +import com.google.android.gms.common.api.Api; +import com.google.android.gms.common.api.GoogleApiClient; +import com.google.android.gms.common.api.Result; +import com.google.android.gms.common.api.Status; + +import org.microg.gms.cast.CastRemoteDisplayApiBuilder; +import org.microg.gms.cast.CastRemoteDisplayApiImpl; +import org.microg.gms.common.PublicApi; + +@PublicApi +public final class CastRemoteDisplay { + /** + * Token to pass to {@link GoogleApiClient.Builder#addApi(Api)} to enable the CastRemoteDisplay features. + */ + public static final Api API = new Api(new CastRemoteDisplayApiBuilder()); + + /** + * An implementation of the CastRemoteDisplayAPI interface. The interface is used to interact with a cast device. + */ + public static final CastRemoteDisplayApi CastApi = new CastRemoteDisplayApiImpl(); + + private CastRemoteDisplay() { + } + + public static final class CastRemoteDisplayOptions implements Api.ApiOptions.HasOptions { + private CastDevice castDevice; + private CastRemoteDisplaySessionCallbacks callbacks; + + private CastRemoteDisplayOptions(CastDevice castDevice, CastRemoteDisplaySessionCallbacks callbacks) { + this.castDevice = castDevice; + this.callbacks = callbacks; + } + + public static final class Builder { + private CastDevice castDevice; + private CastRemoteDisplaySessionCallbacks callbacks; + + public Builder(CastDevice castDevice, CastRemoteDisplaySessionCallbacks callbacks) { + this.castDevice = castDevice; + this.callbacks = callbacks; + } + + public CastRemoteDisplayOptions build() { + return new CastRemoteDisplayOptions(castDevice, callbacks); + } + } + } + + public interface CastRemoteDisplaySessionCallbacks { + void onRemoteDisplayEnded(Status status); + } + + public interface CastRemoteDisplaySessionResult extends Result { + Display getPresentationDisplay(); + } +} diff --git a/play-services-cast/src/main/java/com/google/android/gms/cast/CastRemoteDisplayApi.java b/play-services-cast/src/main/java/com/google/android/gms/cast/CastRemoteDisplayApi.java new file mode 100644 index 00000000..3e1c8774 --- /dev/null +++ b/play-services-cast/src/main/java/com/google/android/gms/cast/CastRemoteDisplayApi.java @@ -0,0 +1,26 @@ +/* + * Copyright 2013-2015 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.cast; + +import com.google.android.gms.common.api.GoogleApiClient; +import com.google.android.gms.common.api.PendingResult; + +public interface CastRemoteDisplayApi { + PendingResult startRemoteDisplay(GoogleApiClient apiClient, String applicationId); + + PendingResult stopRemoteDisplay(GoogleApiClient apiClient); +} diff --git a/play-services-cast/src/main/java/com/google/android/gms/cast/CastRemoteDisplayLocalService.java b/play-services-cast/src/main/java/com/google/android/gms/cast/CastRemoteDisplayLocalService.java new file mode 100644 index 00000000..66dd6fef --- /dev/null +++ b/play-services-cast/src/main/java/com/google/android/gms/cast/CastRemoteDisplayLocalService.java @@ -0,0 +1,28 @@ +/* + * Copyright 2013-2015 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.cast; + +import android.app.Service; +import android.content.Intent; +import android.os.IBinder; + +public class CastRemoteDisplayLocalService extends Service { + @Override + public IBinder onBind(Intent intent) { + return null; + } +} diff --git a/play-services-cast/src/main/java/org/microg/gms/cast/CastApiBuilder.java b/play-services-cast/src/main/java/org/microg/gms/cast/CastApiBuilder.java new file mode 100644 index 00000000..ba8704d9 --- /dev/null +++ b/play-services-cast/src/main/java/org/microg/gms/cast/CastApiBuilder.java @@ -0,0 +1,34 @@ +/* + * Copyright 2013-2015 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 org.microg.gms.cast; + +import android.content.Context; +import android.os.Looper; + +import com.google.android.gms.cast.Cast; +import com.google.android.gms.common.api.AccountInfo; +import com.google.android.gms.common.api.GoogleApiClient; + +import org.microg.gms.common.api.ApiBuilder; +import org.microg.gms.common.api.ApiConnection; + +public class CastApiBuilder implements ApiBuilder{ + @Override + public ApiConnection build(Context context, Looper looper, Cast.CastOptions options, AccountInfo accountInfo, GoogleApiClient.ConnectionCallbacks callbacks, GoogleApiClient.OnConnectionFailedListener connectionFailedListener) { + return new CastClientImpl(context, options, callbacks, connectionFailedListener); + } +} diff --git a/play-services-cast/src/main/java/org/microg/gms/cast/CastApiImpl.java b/play-services-cast/src/main/java/org/microg/gms/cast/CastApiImpl.java new file mode 100644 index 00000000..668773e3 --- /dev/null +++ b/play-services-cast/src/main/java/org/microg/gms/cast/CastApiImpl.java @@ -0,0 +1,134 @@ +/* + * Copyright 2013-2015 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 org.microg.gms.cast; + +import com.google.android.gms.cast.ApplicationMetadata; +import com.google.android.gms.cast.Cast; +import com.google.android.gms.cast.LaunchOptions; +import com.google.android.gms.common.api.GoogleApiClient; +import com.google.android.gms.common.api.PendingResult; +import com.google.android.gms.common.api.Status; + +import java.io.IOException; + +// TODO +public class CastApiImpl implements Cast.CastApi { + @Override + public int getActiveInputState(GoogleApiClient client) { + return 0; + } + + @Override + public ApplicationMetadata getApplicationMetadata(GoogleApiClient client) { + return null; + } + + @Override + public String getApplicationStatus(GoogleApiClient client) { + return null; + } + + @Override + public int getStandbyState(GoogleApiClient client) { + return 0; + } + + @Override + public double getVolume(GoogleApiClient client) { + return 0; + } + + @Override + public boolean isMute(GoogleApiClient client) { + return false; + } + + @Override + public PendingResult joinApplication(GoogleApiClient client) { + return null; + } + + @Override + public PendingResult joinApplication(GoogleApiClient client, String applicationId, String sessionId) { + return null; + } + + @Override + public PendingResult joinApplication(GoogleApiClient client, String applicationId) { + return null; + } + + @Override + public PendingResult launchApplication(GoogleApiClient client, String applicationId, LaunchOptions launchOptions) { + return null; + } + + @Override + public PendingResult launchApplication(GoogleApiClient client, String applicationId) { + return null; + } + + @Override + public PendingResult launchApplication(GoogleApiClient client, String applicationId, boolean relaunchIfRunning) { + return null; + } + + @Override + public PendingResult leaveApplication(GoogleApiClient client) { + return null; + } + + @Override + public void removeMessageReceivedCallbacks(GoogleApiClient client, String namespace) throws IOException { + + } + + @Override + public void requestStatus(GoogleApiClient client) throws IOException { + + } + + @Override + public PendingResult sendMessage(GoogleApiClient client, String namespace, String message) { + return null; + } + + @Override + public void setMessageReceivedCallbacks(GoogleApiClient client, String namespace, Cast.MessageReceivedCallback callbacks) throws IOException { + + } + + @Override + public void setMute(GoogleApiClient client, boolean mute) throws IOException { + + } + + @Override + public void setVolume(GoogleApiClient client, double volume) throws IOException { + + } + + @Override + public PendingResult stopApplication(GoogleApiClient client) { + return null; + } + + @Override + public PendingResult stopApplication(GoogleApiClient client, String sessionId) { + return null; + } +} diff --git a/play-services-cast/src/main/java/org/microg/gms/cast/CastClientImpl.java b/play-services-cast/src/main/java/org/microg/gms/cast/CastClientImpl.java new file mode 100644 index 00000000..071ef58d --- /dev/null +++ b/play-services-cast/src/main/java/org/microg/gms/cast/CastClientImpl.java @@ -0,0 +1,29 @@ +/* + * Copyright 2013-2015 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 org.microg.gms.cast; + +import android.content.Context; + +import com.google.android.gms.cast.Cast; +import com.google.android.gms.common.api.GoogleApiClient; + +import org.microg.gms.common.DummyApiConnection; + +public class CastClientImpl extends DummyApiConnection { + public CastClientImpl(Context context, Cast.CastOptions options, GoogleApiClient.ConnectionCallbacks callbacks, GoogleApiClient.OnConnectionFailedListener connectionFailedListener) { + } +} diff --git a/play-services-cast/src/main/java/org/microg/gms/cast/CastRemoteDisplayApiBuilder.java b/play-services-cast/src/main/java/org/microg/gms/cast/CastRemoteDisplayApiBuilder.java new file mode 100644 index 00000000..29f5810c --- /dev/null +++ b/play-services-cast/src/main/java/org/microg/gms/cast/CastRemoteDisplayApiBuilder.java @@ -0,0 +1,35 @@ +/* + * Copyright 2013-2015 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 org.microg.gms.cast; + +import android.content.Context; +import android.os.Looper; + +import com.google.android.gms.cast.CastRemoteDisplay; +import com.google.android.gms.common.api.AccountInfo; +import com.google.android.gms.common.api.GoogleApiClient; + +import org.microg.gms.common.DummyApiConnection; +import org.microg.gms.common.api.ApiBuilder; +import org.microg.gms.common.api.ApiConnection; + +public class CastRemoteDisplayApiBuilder implements ApiBuilder { + @Override + public ApiConnection build(Context context, Looper looper, CastRemoteDisplay.CastRemoteDisplayOptions options, AccountInfo accountInfo, GoogleApiClient.ConnectionCallbacks callbacks, GoogleApiClient.OnConnectionFailedListener connectionFailedListener) { + return new DummyApiConnection(); + } +} diff --git a/play-services-cast/src/main/java/org/microg/gms/cast/CastRemoteDisplayApiImpl.java b/play-services-cast/src/main/java/org/microg/gms/cast/CastRemoteDisplayApiImpl.java new file mode 100644 index 00000000..6803ce46 --- /dev/null +++ b/play-services-cast/src/main/java/org/microg/gms/cast/CastRemoteDisplayApiImpl.java @@ -0,0 +1,34 @@ +/* + * Copyright 2013-2015 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 org.microg.gms.cast; + +import com.google.android.gms.cast.CastRemoteDisplay; +import com.google.android.gms.cast.CastRemoteDisplayApi; +import com.google.android.gms.common.api.GoogleApiClient; +import com.google.android.gms.common.api.PendingResult; + +public class CastRemoteDisplayApiImpl implements CastRemoteDisplayApi { + @Override + public PendingResult startRemoteDisplay(GoogleApiClient apiClient, String applicationId) { + return null; + } + + @Override + public PendingResult stopRemoteDisplay(GoogleApiClient apiClient) { + return null; + } +} From 35e8503273f3b98c36c43dca2bf6174a4183c85b Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Fri, 2 Oct 2015 03:28:33 +0200 Subject: [PATCH 099/293] Add Travis CI --- .travis.yml | 17 +++++++++++++++++ extern/SafeParcel | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..1b3be818 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,17 @@ +language: android +git: + submodules: false +before_install: + - git submodule update --init --recursive +script: + - export JAVA_OPTS="-XX:MaxPermSize=1024m -XX:+CMSClassUnloadingEnabled -XX:+HeapDumpOnOutOfMemoryError -Xmx2048m" + - export TERM=dumb + - echo sdk.dir $ANDROID_HOME > local.properties + - ./gradlew assembleDebug -x lint +android: + components: + - extra-android-m2repository + - build-tools-23.0.1 + - android-23 + + diff --git a/extern/SafeParcel b/extern/SafeParcel index 02b94fdd..cbe7b4b9 160000 --- a/extern/SafeParcel +++ b/extern/SafeParcel @@ -1 +1 @@ -Subproject commit 02b94fdd0af1c127fa14500b2c3d4bec0701e1d6 +Subproject commit cbe7b4b90452670c422f8303ec2a19aac7179d32 From d0f7742d21870f9262486f49c3fea3938f325af0 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Fri, 2 Oct 2015 03:36:08 +0200 Subject: [PATCH 100/293] Add Travis CI --- .travis.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..1b3be818 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,17 @@ +language: android +git: + submodules: false +before_install: + - git submodule update --init --recursive +script: + - export JAVA_OPTS="-XX:MaxPermSize=1024m -XX:+CMSClassUnloadingEnabled -XX:+HeapDumpOnOutOfMemoryError -Xmx2048m" + - export TERM=dumb + - echo sdk.dir $ANDROID_HOME > local.properties + - ./gradlew assembleDebug -x lint +android: + components: + - extra-android-m2repository + - build-tools-23.0.1 + - android-23 + + From 99d95d5b729c958102978e0b0e7d96332b49c82f Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Fri, 2 Oct 2015 03:38:07 +0200 Subject: [PATCH 101/293] Add Gradle Wrapper --- .gitignore | 2 - gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 49896 bytes gradle/wrapper/gradle-wrapper.properties | 22 +++ gradlew | 164 +++++++++++++++++++++++ 4 files changed, 186 insertions(+), 2 deletions(-) create mode 100644 gradle/wrapper/gradle-wrapper.jar create mode 100755 gradle/wrapper/gradle-wrapper.properties create mode 100755 gradlew diff --git a/.gitignore b/.gitignore index 769ee68c..bec3b98b 100644 --- a/.gitignore +++ b/.gitignore @@ -4,5 +4,3 @@ build/ *.iml local.properties .gradle/ -gradle/ -gradlew diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000000000000000000000000000000000..8c0fb64a8698b08ecc4158d828ca593c4928e9dd GIT binary patch literal 49896 zcmagFb986H(k`5d^NVfUwr$(C?M#x1ZQHiZiEVpg+jrjgoQrerx!>1o_ul)D>ebz~ zs=Mmxr&>W81QY-S1PKWQ%N-;H^tS;2*XwVA`dej1RRn1z<;3VgfE4~kaG`A%QSPsR z#ovnZe+tS9%1MfeDyz`RirvdjPRK~p(#^q2(^5@O&NM19EHdvN-A&StN>0g6QA^VN z0Gx%Gq#PD$QMRFzmK+utjS^Y1F0e8&u&^=w5K<;4Rz|i3A=o|IKLY+g`iK6vfr9?+ z-`>gmU&i?FGSL5&F?TXFu`&Js6h;15QFkXp2M1H9|Eq~bpov-GU(uz%mH0n55wUl- zv#~ccAz`F5wlQ>e_KlJS3@{)B?^v*EQM=IxLa&76^y51a((wq|2-`qON>+4dLc{Oo z51}}o^Zen(oAjxDK7b++9_Yg`67p$bPo3~BCpGM7uAWmvIhWc5Gi+gQZ|Pwa-Gll@<1xmcPy z|NZmu6m)g5Ftu~BG&Xdxclw7Cij{xbBMBn-LMII#Slp`AElb&2^Hw+w>(3crLH!;I zN+Vk$D+wP1#^!MDCiad@vM>H#6+`Ct#~6VHL4lzmy;lSdk>`z6)=>Wh15Q2)dQtGqvn0vJU@+(B5{MUc*qs4!T+V=q=wy)<6$~ z!G>e_4dN@lGeF_$q9`Ju6Ncb*x?O7=l{anm7Eahuj_6lA{*#Gv*TaJclevPVbbVYu z(NY?5q+xxbO6%g1xF0r@Ix8fJ~u)VRUp`S%&rN$&e!Od`~s+64J z5*)*WSi*i{k%JjMSIN#X;jC{HG$-^iX+5f5BGOIHWAl*%15Z#!xntpk($-EGKCzKa zT7{siZ9;4TICsWQ$pu&wKZQTCvpI$Xvzwxoi+XkkpeE&&kFb!B?h2hi%^YlXt|-@5 zHJ~%AN!g_^tmn1?HSm^|gCE#!GRtK2(L{9pL#hp0xh zME}|DB>(5)`iE7CM)&_+S}-Bslc#@B5W4_+k4Cp$l>iVyg$KP>CN?SVGZ(&02>iZK zB<^HP$g$Lq*L$BWd?2(F?-MUbNWTJVQdW7$#8a|k_30#vHAD1Z{c#p;bETk0VnU5A zBgLe2HFJ3032$G<`m*OB!KM$*sdM20jm)It5OSru@tXpK5LT>#8)N!*skNu1$TpIw zufjjdp#lyH5bZ%|Iuo|iu9vG1HrIVWLH>278xo>aVBkPN3V$~!=KnlXQ4eDqS7%E% zQ!z^$Q$b^6Q)g#cLpwur(|<0gWHo6A6jc;n`t(V9T;LzTAU{IAu*uEQ%Ort1k+Kn+f_N`9|bxYC+~Z1 zCC1UCWv*Orx$_@ydv9mIe(liLfOr7mhbV@tKw{6)q^1DH1nmvZ0cj215R<~&I<4S| zgnr;9Cdjqpz#o8i0CQjtl`}{c*P)aSdH|abxGdrR)-3z+02-eX(k*B)Uqv6~^nh** z zGh0A%o~bd$iYvP!egRY{hObDIvy_vXAOkeTgl5o!33m!l4VLm@<-FwT0+k|yl~vUh z@RFcL4=b(QQQmwQ;>FS_e96dyIU`jmR%&&Amxcb8^&?wvpK{_V_IbmqHh);$hBa~S z;^ph!k~noKv{`Ix7Hi&;Hq%y3wpqUsYO%HhI3Oe~HPmjnSTEasoU;Q_UfYbzd?Vv@ zD6ztDG|W|%xq)xqSx%bU1f>fF#;p9g=Hnjph>Pp$ZHaHS@-DkHw#H&vb1gARf4A*zm3Z75QQ6l( z=-MPMjish$J$0I49EEg^Ykw8IqSY`XkCP&TC?!7zmO`ILgJ9R{56s-ZY$f> zU9GwXt`(^0LGOD9@WoNFK0owGKDC1)QACY_r#@IuE2<`tep4B#I^(PRQ_-Fw(5nws zpkX=rVeVXzR;+%UzoNa;jjx<&@ABmU5X926KsQsz40o*{@47S2 z)p9z@lt=9?A2~!G*QqJWYT5z^CTeckRwhSWiC3h8PQ0M9R}_#QC+lz>`?kgy2DZio zz&2Ozo=yTXVf-?&E;_t`qY{Oy>?+7+I= zWl!tZM_YCLmGXY1nKbIHc;*Mag{Nzx-#yA{ zTATrWj;Nn;NWm6_1#0zy9SQiQV=38f(`DRgD|RxwggL(!^`}lcDTuL4RtLB2F5)lt z=mNMJN|1gcui=?#{NfL{r^nQY+_|N|6Gp5L^vRgt5&tZjSRIk{_*y<3^NrX6PTkze zD|*8!08ZVN)-72TA4Wo3B=+Rg1sc>SX9*X>a!rR~ntLVYeWF5MrLl zA&1L8oli@9ERY|geFokJq^O$2hEpVpIW8G>PPH0;=|7|#AQChL2Hz)4XtpAk zNrN2@Ju^8y&42HCvGddK3)r8FM?oM!3oeQ??bjoYjl$2^3|T7~s}_^835Q(&b>~3} z2kybqM_%CIKk1KSOuXDo@Y=OG2o!SL{Eb4H0-QCc+BwE8x6{rq9j$6EQUYK5a7JL! z`#NqLkDC^u0$R1Wh@%&;yj?39HRipTeiy6#+?5OF%pWyN{0+dVIf*7@T&}{v%_aC8 zCCD1xJ+^*uRsDT%lLxEUuiFqSnBZu`0yIFSv*ajhO^DNoi35o1**16bg1JB z{jl8@msjlAn3`qW{1^SIklxN^q#w|#gqFgkAZ4xtaoJN*u z{YUf|`W)RJfq)@6F&LfUxoMQz%@3SuEJHU;-YXb7a$%W=2RWu5;j44cMjC0oYy|1! zed@H>VQ!7=f~DVYkWT0nfQfAp*<@FZh{^;wmhr|K(D)i?fq9r2FEIatP=^0(s{f8GBn<8T zVz_@sKhbLE&d91L-?o`13zv6PNeK}O5dv>f{-`!ms#4U+JtPV=fgQ5;iNPl9Hf&9( zsJSm5iXIqN7|;I5M08MjUJ{J2@M3 zYN9ft?xIjx&{$K_>S%;Wfwf9N>#|ArVF^shFb9vS)v9Gm00m_%^wcLxe;gIx$7^xR zz$-JDB|>2tnGG@Rrt@R>O40AreXSU|kB3Bm)NILHlrcQ&jak^+~b`)2;otjI(n8A_X~kvp4N$+4|{8IIIv zw*(i}tt+)Kife9&xo-TyoPffGYe;D0a%!Uk(Nd^m?SvaF-gdAz4~-DTm3|Qzf%Pfd zC&tA;D2b4F@d23KV)Csxg6fyOD2>pLy#n+rU&KaQU*txfUj&D3aryVj!Lnz*;xHvl zzo}=X>kl0mBeSRXoZ^SeF94hlCU*cg+b}8p#>JZvWj8gh#66A0ODJ`AX>rubFqbBw z-WR3Z5`33S;7D5J8nq%Z^JqvZj^l)wZUX#7^q&*R+XVPln{wtnJ~;_WQzO{BIFV55 zLRuAKXu+A|7*2L*<_P${>0VdVjlC|n^@lRi}r?wnzQQm z3&h~C3!4C`w<92{?Dpea@5nLP2RJrxvCCBh%Tjobl2FupWZfayq_U$Q@L%$uEB6#X zrm_1TZA8FEtkd`tg)a_jaqnv3BC_O*AUq-*RNLOT)$>2D!r>FZdH&$x5G_FiAPaw4 zgK*7>(qd6R?+M3s@h>Z|H%7eGPxJWn_U$w`fb(Mp+_IK2Kj37YT#Xe5e6KS-_~mW} z`NXEovDJh7n!#q4b+=ne<7uB7Y2(TAR<3@PS&o3P$h#cZ-xF$~JiH6_gsv9v(#ehK zhSB_#AI%lF#+!MB5DMUN+Zhf}=t~{B|Fn{rGM?dOaSvX!D{oGXfS*%~g`W84JJAy4 zMdS?9Bb$vx?`91$J`pD-MGCTHNxU+SxLg&QY+*b_pk0R=A`F}jw$pN*BNM8`6Y=cm zgRh#vab$N$0=XjH6vMyTHQg*+1~gwOO9yhnzZx#e!1H#|Mr<`jJGetsM;$TnciSPJ z5I-R0)$)0r8ABy-2y&`2$33xx#%1mp+@1Vr|q_e=#t7YjjWXH#3F|Fu<G#+-tE2K7 zOJkYxNa74@UT_K4CyJ%mR9Yfa$l=z}lB(6)tZ1Ksp2bv$^OUn3Oed@=Q0M}imYTwX zQoO^_H7SKzf_#kPgKcs%r4BFUyAK9MzfYReHCd=l)YJEgPKq-^z3C%4lq%{&8c{2CGQ3jo!iD|wSEhZ# zjJoH87Rt{4*M_1GdBnBU3trC*hn@KCFABd=Zu`hK;@!TW`hp~;4Aac@24m|GI)Ula z4y%}ClnEu;AL4XVQ6^*!()W#P>BYC@K5mw7c4X|Hk^(mS9ZtfMsVLoPIiwI?w_X0- z#vyiV5q9(xq~fS`_FiUZw->8Awktga>2SrWyvZ|h@LVFtnY#T z%OX30{yiSov4!43kFd(8)cPRMyrN z={af_ONd;m=`^wc7lL|b7V!;zmCI}&8qz=?-6t=uOV;X>G{8pAwf9UJ`Hm=ubIbgR zs6bw3pFeQHL`1P1m5fP~fL*s?rX_|8%tB`Phrij^Nkj{o0oCo*g|ELexQU+2gt66=7}w5A+Qr}mHXC%)(ODT# zK#XTuzqOmMsO~*wgoYjDcy)P7G`5x7mYVB?DOXV^D3nN89P#?cp?A~c%c$#;+|10O z8z(C>mwk#A*LDlpv2~JXY_y_OLZ*Mt)>@gqKf-Ym+cZ{8d%+!1xNm3_xMygTp-!A5 zUTpYFd=!lz&4IFq)Ni7kxLYWhd0o2)ngenV-QP@VCu;147_Lo9f~=+=Nw$6=xyZzp zn7zAe41Sac>O60(dgwPd5a^umFVSH;<7vN>o;}YlMYhBZFZ}-sz`P^3oAI>SCZy&zUtwKSewH;CYysPQN7H>&m215&e2J? zY}>5N-LhaDeRF~C0cB>M z7@y&xh9q??*EIKnh*;1)n-WuSl6HkrI?OUiS^lx$Sr2C-jUm6zhd{nd(>#O8k9*kF zPom7-%w1NjFpj7WP=^!>Vx^6SG^r`r+M&s7V(uh~!T7aE;_ubqNSy)<5(Vi)-^Mp9 zEH@8Vs-+FEeJK%M0z3FzqjkXz$n~BzrtjQv`LagAMo>=?dO8-(af?k@UpL5J#;18~ zHCnWuB(m6G6a2gDq2s`^^5km@A3Rqg-oHZ68v5NqVc zHX_Iw!OOMhzS=gfR7k;K1gkEwuFs|MYTeNhc0js>Wo#^=wX4T<`p zR2$8p6%A9ZTac;OvA4u#Oe3(OUep%&QgqpR8-&{0gjRE()!Ikc?ClygFmGa(7Z^9X zWzmV0$<8Uh)#qaH1`2YCV4Zu6@~*c*bhtHXw~1I6q4I>{92Eq+ZS@_nSQU43bZyidk@hd$j-_iL=^^2CwPcaXnBP;s;b zA4C!k+~rg4U)}=bZ2q*)c4BZ#a&o!uJo*6hK3JRBhOOUQ6fQI;dU#3v>_#yi62&Sp z-%9JJxwIfQ`@w(_qH0J0z~(lbh`P zHoyp2?Oppx^WXwD<~20v!lYm~n53G1w*Ej z9^B*j@lrd>XGW43ff)F;5k|HnGGRu=wmZG9c~#%vDWQHlOIA9(;&TBr#yza{(?k0> zcGF&nOI}JhuPl`kLViBEd)~p2nY9QLdX42u9C~EUWsl-@CE;05y@^V1^wM$ z&zemD1oZd$Z))kEw9)_Mf+X#nT?}n({(+aXHK2S@j$MDsdrw-iLb?#r{?Vud?I5+I zVQ8U?LXsQ}8-)JBGaoawyOsTTK_f8~gFFJ&lhDLs8@Rw$ey-wr&eqSEU^~1jtHmz6 z!D2g4Yh?3VE*W8=*r&G`?u?M~AdO;uTRPfE(@=Gkg z7gh=EGu!6VJJ?S_>|5ZwY?dGFBp3B9m4J1=7u=HcGjsCW+y6`W?OWxfH?S#X8&Zk& zvz6tWcnaS1@~3FTH}q_*$)AjYA_j;yl0H0{I(CW7Rq|;5Q2>Ngd(tmJDp+~qHe_8y zPU_fiCrn!SJ3x&>o6;WDnjUVEt`2fhc9+uLI>99(l$(>Tzwpbh>O775OA5i`jaBdp zXnCwUgomyF3K$0tXzgQhSAc!6nhyRh_$fP}Rd$|*Y7?ah(JrN=I7+)+Hp4BLJJ2P~ zFD!)H^uR2*m7GQZpLUVS#R3^?2wCd}(gcFcz!u5KN9ldNJdh@%onf06z9m~T0n;dqg6@?>G@S|rPO*Kj>{su+R|7bH>osA&uD4eqxtr**k($ii`uO? z7-&VkiL4Rp3S&e+T}2Z#;NtWHZco(v8O3QMvN0g7l8GV|U2>x-DbamkZo5)bjaSFR zr~Y9(EvF9{o*@|nBPj+e5o$_K`%TH1hD=|its}|qS^o6EQu_gOuDUH=Dtzik;P7G$ zq%_T<>9O}bGIB?;IQ*H`BJ5NWF6+XLv@G7aZwcy(&BoepG~u`aIcG>y+;J7+L=wTZ zB=%n@O}=+mjBO%1lMo6C0@1*+mhBqqY((%QMUBhyeC~r*5WVqzisOXFncr*5Lr0q6 zyPU&NOV}Vt2jl>&yig4I6j93?D>Ft=keRh=Y;3*^Z-I26nkZ#Jj5OJ89_?@#9lNjp z#gfAO6i937)~I|98P%xAWxwmk(F&@lTMx63*FZ~2b{NHU+}EV8+kMAB0bM*Zn#&7ubt98!PT^ZcMOfwMgkYz6+;?CKbvV zQ}Z@s_3JcMPhF&y1?}9uZFIBiPR3g7lf=+XEr9Bl%zRfGcaKb*ZQq5b35ZkR@=JEw zP#iqgh2^#@VA-h)>r`7R-$1_ddGr&oWWV$rx;pkG0Yohp9p@In_p)hKvMo@qIv zcN2t{23&^Nj=Y&gX;*vJ;kjM zHE2`jtjVRRn;=WqVAY&m$z=IoKa{>DgJ;To@OPqNbh=#jiS$WE+O4TZIOv?niWs47 zQfRBG&WGmU~>2O{}h17wXGEnigSIhCkg%N~|e?hG8a- zG!Wv&NMu5z!*80>;c^G9h3n#e>SBt5JpCm0o-03o2u=@v^n+#6Q^r#96J5Q=Dd=>s z(n0{v%yj)=j_Je2`DoyT#yykulwTB+@ejCB{dA7VUnG>4`oE?GFV4sx$5;%9&}yxfz<-wWk|IlA|g&! zN_Emw#w*2GT=f95(%Y1#Viop;Yro3SqUrW~2`Fl?Ten{jAt==a>hx$0$zXN`^7>V_ zG*o7iqeZV)txtHUU2#SDTyU#@paP;_yxp!SAG##cB= zr@LoQg4f~Uy5QM++W`WlbNrDa*U;54`3$T;^YVNSHX4?%z|`B~i7W+kl0wBB`8|(l zAyI6dXL&-Sei0=f#P^m`z=JJ`=W;PPX18HF;5AaB%Zlze`#pz;t#7Bzq0;k8IyvdK=R zBW+4GhjOv+oNq^~#!5(+pDz)Ku{u60bVjyym8Or8L;iqR|qTcxEKTRm^Y%QjFYU=ab+^a|!{!hYc+= z%Qc02=prKpzD+jiiOwzyb(dELO|-iyWzizeLugO!<1(j|3cbR!8Ty1$C|l@cWoi?v zLe<5+(Z-eH++=fX**O-I8^ceYZgiA!!dH+7zfoP-Q+@$>;ab&~cLFg!uOUX7h0r== z`@*QP9tnV1cu1!9pHc43C!{3?-GUBJEzI(&#~vY9MEUcRNR*61)mo!RG>_Yb^rNN7 zR9^bI45V?3Lq`^^BMD!GONuO4NH#v9OP3@s%6*Ha3#S*;f z6JEi)qW#Iq#5BtIXT9Gby|H?NJG}DN#Li82kZ_Rt1=T0Z@U6OAdyf}4OD|Sk^2%-1 zzgvqZ@b6~kL!^sZLO$r{s!3fQ5bHW}8r$uTVS*iw1u8^9{YlPp_^Xm5IN zF|@)ZOReX zB*#tEbWEX~@f)ST|s$oUKS@drycE1tYtdJ9b*(uFTxNZ{n3BI*kF7wXgT6+@PI@vwH7iQS{1T!Nauk>fm8gOLe`->Pi~ z8)3=UL_$OLl2n7QZlHt846nkYFu4V};3LpYA%5VaF#a2#d2g0&ZO~3WA%1XlerVpg zCAlM;(9OqH@`(>Tha{*@R%twB!}1ng4V=^+R`Q{#fkRk)C|suozf-uCXrkIH2SC^C z6wlxR`yS;-U#uu#`OnD%U<41%C4mp>LYLPIbgVO~WsT1if)Y)T*8nUB`2*(B;U_ha1NWv2`GqrZ z3MWWpT3tZ!*N@d*!j3=@K4>X*gX4A^@QPAz24?7u90AXaLiFq=Z$|5p$Ok2|YCX_Z zFgNPiY2r_Bg2BQE!0z=_N*G?%0cNITmAru*!Mws=F+F&Qw!&1?DBN{vSy%IvGRV@1 zS->PARgL^XS!-aZj zi@`~LhWfD!H-L0kNv=Jil9zR0>jZLqu)cLq?$yXVyk%EteKcWbe^qh#spHJPa#?92 za(N(Kw0se^$7nQUQZBet;C_Dj5(2_?TdrXFYwmebq}YGQbN5Ex7M zGSCX~Ey;5AqAzEDNr%p^!cuG?&wIeY&Bm5guVg>8F=!nT%7QZTGR(uGM&IZuMw0V_ zhPiIFWm?H?aw*(v6#uVT@NEzi2h5I$cZ-n0~m$tmwdMTjG*of^Y%1 zW?Y%o*-_iMqEJhXo^!Qo?tGFUn1Mb|urN4_;a)9bila2}5rBS#hZ5wV+t1xbyF1TW zj+~cdjbcMgY$zTOq6;ODaxzNA@PZIXX(-=cT8DBd;9ihfqqtbDr9#gXGtK24BPxjZ z9+Xp>W1(s)->-}VX~BoQv$I|-CBdO`gULrvNL>;@*HvTdh@wyNf}~IB5mFnTitX2i z;>W>tlQyc2)T4Mq+f!(i3#KuK-I8Kj3Wm(UYx?KWWt8DEPR_Jdb9CE~Fjc7Rkh#gh zowNv()KRO@##-C+ig0l!^*ol!Bj%d32_N*~d!|&>{t!k3lc?6VrdlCCb1?qyoR42m zv;4KdwCgvMT*{?tJKa(T?cl|b;k4P>c&O@~g71K5@}ys$)?}WSxD;<5%4wEz7h=+q ztLumn6>leWdDk#*@{=v9p)MsvuJMyf_VEs;pJh?i3z7_W@Q|3p$a}P@MQ-NpMtDUBgH!h4Ia#L&POr4Qw0Tqdw^}gCmQAB z8Dgkzn?V!_@04(cx0~-pqJOpeP1_}@Ml3pCb45EJoghLows9ET13J8kt0;m$6-jO( z4F|p+JFD1NT%4bpn4?&)d+~<360$z5on`eS6{H`S>t`VS$>(D`#mC*XK6zULj1Da# zpV$gw$2Ui{07NiYJQQNK;rOepRxA>soNK~B2;>z;{Ovx`k}(dlOHHuNHfeR}7tmIp zcM}q4*Fq8vSNJYi@4-;}`@bC?nrUy`3jR%HXhs79qWI5;hyTpH5%n-NcKu&j(aGwT z1~{geeq?Jd>>HL+?2`0K8dB2pvTS=LO~tb~vx_<=iN8^rW!y@~lBTAaxHmvVQJSeJ z!cb9ffMdP1lgI=>QJN{XpM4{reRrdIt|v|0-8!p}M*Qw^uV1@Ho-YsNd0!a(os$F* zT0tGHA#0%u0j*%S>kL*73@~7|iP;;!JbWSTA@`#VHv_l_%Z7CgX@>dhg_ zgn0|U)SY~U-E5{QiT@(uPp#1jaz!(_3^Cbz2 z4ZgWWz=PdGCiGznk{^4TBfx_;ZjAHQ>dB4YI}zfEnTbf60lR%=@VWt0yc=fd38Ig* z)Q38#e9^+tA7K}IDG5Z~>JE?J+n%0_-|i2{E*$jb4h?|_^$HRHjVkiyX6@Y+)0C2a zA+eegpT1dUpqQFIwx;!ayQcWQBQTj1n5&h<%Lggt@&tE19Rm~Rijtqw6nmYip_xg0 zO_IYpU304embcWP+**H|Z5~%R*mqq+y{KbTVqugkb)JFSgjVljsR{-c>u+{?moCCl zTL)?85;LXk0HIDC3v*|bB-r_z%zvL6Dp__L*A~Z*o?$rm>cYux&)W=6#+Cb}TF&Kd zdCgz3(ZrNA>-V>$C{a^Y^2F!l_%3lFe$s(IOfLBLEJ4Mcd!y&Ah9r)7q?oc z5L(+S8{AhZ)@3bw0*8(}Xw{94Vmz6FrK&VFrJN;xB96QmqYEibFz|yHgUluA-=+yS}I-+#_Pk zN67-#8W(R^e7f!;i0tXbJgMmJZH%yEwn*-}5ew13D<_FYWnt?{Mv1+MI~u;FN~?~m z{hUnlD1|RkN}c1HQ6l@^WYbHAXPJ^m0te1woe;LDJ}XEJqh1tPf=sD0%b+OuR1aCoP>I>GBn4C24Zu$D)qg=gq;D??5 zUSj%;-Hvk_ffj-+SI{ZCp`gZcNu=L@_N}kCcs?TyMr-37fhy$?a<7lt1`fZw<%$8@B6(Wgo!#!z9z{ab|x`+&;kP!(gfdY}A-GP&4Cbh-S< z1(kmgnMyB2z3ipEj5;4<{(=&<7a>A_Jl`ujUKYV@%k(oD=cD7W@8~5O=R*zdjM_y; zXwme~0wo0aDa~9rDnjF=B}Bbj|DHRQjN|?@(F^=bVFdr!#mwr|c0843k>%~5J|7|v zSY=T)iPU6rEAwrM(xTZwPio%D4y9Z4kL0bMLKvu4yd)0ZJA3<;>a2q~rEfcREn}~1 zCJ~3c?Afvx?3^@+!lnf(kB6YwfsJ*u^y7kZA?VmM%nBmaMspWu?WXq4)jQsq`9EbT zlF2zJ)wXuAF*2u|yd5hNrG>~|i}R&ZyeetTQ!?Hz6xGZZb3W6|vR>Hq=}*m=V=Lsp zUOMxh;ZfP4za~C{Ppn^%rhitvpnu^G{Z#o-r?TdEgSbtK_+~_iD49xM;$}X*mJF02|WBL{SDqK9}p4N!G$3m=x#@T+4QcapM{4j|Q zwO!(hldpuSW#by!zHEP@tzIC|KdD z%BJzQ7Ho1(HemWm`Z8m_D#*`PZ-(R%sZmPrS$aHS#WPjH3EDitxN|DY+ zYC|3S?PQ3NNYau$Qk8f>{w}~xCX;;CE=7;Kp4^xXR8#&^L+y-jep7oO^wnQ840tg1 zuN17QKsfdqZPlB8OzwF+)q#IsmenEmIbRAJHJ$JjxzawKpk8^sBm3iy=*kB%LppNb zhSdk`^n?01FKQ;=iU+McN7Mk0^`KE>mMe1CQ2a_R26_}^$bogFm=2vqJake7x)KN( zYz;gRPL+r4*KD>1U+DU+1jh{mT8#P#(z9^(aDljpeN{mRmx{AZX&hXKXNuxj3x*RrpjvOaZ#`1EqK!$+8=0yv8}=;>f=E?5tGbRUd4%?QL zy$kq6mZeF%k6E1&8nwAYMd!-lRkhQTob$7s`*XqcHs;l~mHV}fx&0I&i!CHaPVSM{ zHdRh7a>hP)t@YTrWm9y zl-ENWSVzlKVvTdWK>)enmGCEw(WYS=FtY{srdE{Z(3~4svwd)ct;`6Y{^qiW+9E@A ztzd?lj5F#k`=E1U-n*1JJc0{x{0q!_tkD<_S6bGsW)^RxGu%Rj^Mvw|R0WP1SqvAI zs(MiAd@Y5x!UKu376&|quQNxir;{Iz(+}3k-GNb29HaQh?K30u=6sXpIc?j0hF{VY zM$Do*>pN)eRljAOgpx7fMfSrnZ7>fi@@>Jh;qxj1#-Vj}JC3E^GCbC(r55_AG>6cq z4ru34FtVuBt)bkX4>ZFWjToyu)VA>IE6hXc+^(3ruUaKRqHnx3z)(GXetm;^0D95s zQ&drwfjhM4*|q=;i5Io0eDf?I{p}qo@7i7abHX5qLu~VDwYf4bmV~-^M_U?DL(+cG z{AyE^a|*73Ft)o5k-p)+GLXj#q01VlJ9#ZJkf|+c%6qfRgVp&6NsU3~F?!uh}HJm73xq>v$h zYoW3wJE6n9P|;{8U<^%UE2wjR4x^G_Nc$J(i)!>;g4`CCh2z^Dth#ah#<`#axDR?F z4>~hnN2%B2ZUuU6j>m1Qjj~5jQSdA&Q#7hOky#=Ue)}7LPJ!8nbZO_0Sw{G>>M7&E zb1dy|0Zi$(ubk`4^XkVI%4WIpe?Bh!D~IjvZs14yHw=aQ8-`N-=P*?Kzi&eRGZ_6Z zT>eis`!Dy3eT3=vt#Lbc+;}i5XJf7zM3QneL{t?w=U<1rk7+z2Cu^|~=~54tAeSYF zsXHsU;nM0dpK>+71yo(NFLV-^Lf7%U?Q$*q{^j04Gl71ya2)^j`nmJ$cmI9eFMjp+ z#)jKmi4lZc<;l>!={@jTm%?!5jS;6;c*Ml55~r6Y?22B^K3bPhKQ(ICc&z%w<4W1= zjTTtz_}IA$%kCqU)h#$!Yq>>2mVG}qYL}!avmCWYV}x4!YEeq)pgTp| zR;+skHuc7YXRLrcbYXt>?@pa{l^2pL>RrZ!22zMmi1ZR?nkaWF*`@XFK4jGh&Em3vn(l z3~^Q9&tM^eV=f^lccCUc9v02z%^n5VV6s$~k0uq5B#Ipd6`M1Kptg^v<2jiNdlAWQ z_MmtNEaeYIHaiuaFQdG&df7miiB5lZkSbg&kxY*Eh|KTW`Tk~VwKC~+-GoYE+pvwc{+nIEizq6!xP>7ZQ(S2%48l$Y98L zvs7s<&0ArXqOb*GdLH0>Yq-f!{I~e~Z@FUIPm?jzqFZvz9VeZLYNGO}>Vh<=!Er7W zS!X6RF^et7)IM1pq57z*^hP5w7HKSDd8jHX!*gkKrGc-GssrNu5H%7-cNE{h$!aEQK3g*qy;= z)}pxO8;}nLVYm_24@iEs8)R7i;Th0n4->&$8m6(LKCRd(yn7KY%QHu_f=*#e`H^U( z{u!`9JaRD?Z?23fEXrjx>A@+a!y-_oaDB)o@2s{2%A97-ctFfrN0cXQ@6aGH`X~Nr z144?qk;MzDU-cgQOLfT3-ZR#hKmYtKG*iGf4ZJ`|`9!^SkBDUUSJCba)>mM!)k~(z zdjUqB`)~!UObMHB1b$UItM$<0kwlqHH;c z=)+~bkOcIT7vI0Iy(wD)vsg9|oi##%Rgrq`Ek;pN)}lbpz`iv{F4K*{ZZ?Zjixxxr zY|SPl2NsXH+5pimj+MvbZ_+HrfvdC13|9Zs)Y=nW$z<0mhl}%irBSm5T3ZrN#2AhY z_ZrTmS(L`U#y}VZ@~QL9wUS6AnU*7LWS02Xyz`b>%rTml#Wb0yr>@c(Ym*40g;P{V zjV1XSHdU>oY!&Jh7MzhzUV8(9E+yl5UJYga>=0Ldjwtc`5!1>LxaB-kVW;IlSPs+0 zUBx=m8OKVp<`frNvMK>WMO(iKY%PuvqD+PK*vP6f?_o!O)MCW5Ic zv(%f5PLHyOJ2h@Yn_to@54Yq;fdoy40&sbe3A$4uUXHsHP_~K}h#)p&TyOx(~JE?y(IBAQKl}~VQjVC-c6oZwmESL;`Xth?2)-b6ImNcJi z;w|`Q*k?`L(+Dp}t(FocvzWB(%~9$EAB6_J6CrA}hMj-Vy*6iA$FdV}!lvk%6}M)4 zTf<)EbXr9^hveAav1yA?>O0aNEpv0&rju{(Gt|dP=AP%)uQm~OE7@+wEhILrRLt&E zoEsF^nz>4yK1|EOU*kM+9317S;+bb7?TJM2UUpc!%sDp}7!<`i=W!ot8*C&fpj>mk#qt~GCeqcy)?W6sl>eUnR%yCBR&Ow-rc|q;lhnI+f-%`6Xf)% zIYZru;27%vA{Qi2=J`PQC<28;tFx(V^sgXf>)8WNxxQwT14M9I6- z+V0@tiCiDkv`7r-06sJS8@s|Lf>mV+8h}SPT4ZGPSMaFK7_SMXH$3KN7b2V?iV-jA zh1!Z>2tv^HVbHnNUAf-wQW#zMV(h8=3x2Swd|-%AczEIWLcm~EAu7rc3s%56b;7ME zj}$pe#fc^314Mb9i)xH^_#({)tTD4hsoz!7XcHUh9*G|}?k=D?9LBkTm2?fgaIG(%%$DL#}a-_990rQBU+M;jrf zCcvgM`+oyZmsUqc?lly9axZfO)02l$TMS#I+jHYY`Uk!gtDv|@GBQ||uaG^n*QR3Q z@tV?D;R;KmkxSDQh<2DkDC1?m?jTvf2i^T;+}aYhzL?ymNZmdns2e)}2V>tDCRw{= zTV3q3ZQDkdZQHi3?y{@8Y@1!SZQHi(y7|qSx$~Vl=iX<2`@y3eSYpsBV zI`Q-6;)B=p(ZbX55C*pu1C&yqS|@Pytis3$VDux0kxKK}2tO&GC;cH~759o?W2V)2 z)`;U(nCHBE!-maQz%z#zoRNpJR+GmJ!3N^@cA>0EGg?OtgM_h|j1X=!4N%!`g~%hdI3%yz&wq4rYChPIGnSg{H%i>96! z-(@qsCOfnz7ozXoUXzfzDmr>gg$5Z1DK$z#;wn9nnfJhy6T5-oi9fT^_CY%VrL?l} zGvnrMZP_P|XC$*}{V}b^|Hc38YaZQESOWqA1|tiXKtIxxiQ%Zthz?_wfx@<8I{XUW z+LH%eO9RxR_)8gia6-1>ZjZB2(=`?uuX|MkX082Dz*=ep%hMwK$TVTyr2*|gDy&QOWu zorR#*(SDS{S|DzOU$<-I#JTKxj#@0(__e&GRz4NuZZLUS8}$w+$QBgWMMaKge*2-) zrm62RUyB?YSUCWTiP_j-thgG>#(ZEN+~bMuqT~i3;Ri`l${s0OCvCM>sqtIX?Cy`8 zm)MRz-s^YOw>9`aR#J^tJz6$S-et%elmR2iuSqMd(gr6a#gA_+=N(I6%Cc+-mg$?_1>PlK zbgD2`hLZ?z4S~uhJf=rraLBL?H#c$cXyqt{u^?#2vX2sFb z^EU-9jmp{IZ~^ii@+7ogf!n_QawvItcLiC}w^$~vgEi(mX79UwDdBg`IlF42E5lWE zbSibqoIx*0>WWMT{Z_NadHkSg8{YW4*mZ@6!>VP>ey}2PuGwo%>W7FwVv7R!OD32n zW6ArEJX8g_aIxkbBl^YeTy5mhl1kFGI#n>%3hI>b(^`1uh}2+>kKJh0NUC|1&(l)D zh3Barl&yHRG+Le2#~u>KoY-#GSF>v)>xsEp%zgpq4;V6upzm3>V&yk^AD}uIF{vIn zRN-^d4(Sk6ioqcK@EObsAi#Z-u&Hh#kZdv1rjm4u=$2QF<6$mgJ4BE0yefFI zT7HWn?f668n!;x>!CrbdA~lDfjX?)315k1fMR~lG)|X_o()w|NX&iYUTKxI2TLl|r z{&TWcBxP>*;|XSZ1GkL&lSg?XL9rR4Ub&4&03kf};+6$F)%2rsI%9W_i_P|P%Z^b@ zDHH2LV*jB@Izq0~E4F^j04+C|SFiV8{!bth%bz(KfCg42^ zGz5P7xor$)I4VX}Cf6|DqZ$-hG7(}91tg#AknfMLFozF1-R~KS3&5I0GNb`P1+hIB z?OPmW8md3RB6v#N{4S5jm@$WTT{Sg{rVEs*)vA^CQLx?XrMKM@*gcB3mk@j#l0(~2 z9I=(Xh8)bcR(@8=&9sl1C?1}w(z+FA2`Z^NXw1t(!rpYH3(gf7&m=mm3+-sls8vRq z#E(Os4ZNSDdxRo&`NiRpo)Ai|7^GziBL6s@;1DZqlN@P_rfv4Ce1={V2BI~@(;N`A zMqjHDayBZ);7{j>)-eo~ZwBHz0eMGRu`43F`@I0g!%s~ANs>Vum~RicKT1sUXnL=gOG zDR`d=#>s?m+Af1fiaxYxSx{c5@u%@gvoHf#s6g>u57#@#a2~fNvb%uTYPfBoT_$~a^w96(}#d;-wELAoaiZCbM zxY4fKlS6-l1!b1!yra|`LOQoJB))=CxUAYqFcTDThhA?d}6FD$gYlk**!# zD=!KW>>tg1EtmSejwz{usaTPgyQm~o+NDg`MvNo)*2eWX*qAQ)4_I?Pl__?+UL>zU zvoT(dQ)pe9z1y}qa^fi-NawtuXXM>*o6Al~8~$6e>l*vX)3pB_2NFKR#2f&zqbDp7 z5aGX%gMYRH3R1Q3LS91k6-#2tzadzwbwGd{Z~z+fBD5iJ6bz4o1Rj#7cBL|x8k%jO z{cW0%iYUcCODdCIB(++gAsK(^OkY5tbWY;)>IeTp{{d~Y#hpaDa-5r#&Ha?+G{tn~ zb(#A1=WG1~q1*ReXb4CcR7gFcFK*I6Lr8bXLt9>9IybMR&%ZK15Pg4p_(v5Sya_70 ziuUYG@EBKKbKYLWbDZ)|jXpJJZ&bB|>%8bcJ7>l2>hXuf-h5Bm+ zHZ55e9(Sg>G@8a`P@3e2(YWbpKayoLQ}ar?bOh2hs89=v+ifONL~;q(d^X$7qfw=; zENCt`J*+G;dV_85dL3Tm5qz2K4m$dvUXh>H*6A@*)DSZ2og!!0GMoCPTbcd!h z@fRl3f;{F%##~e|?vw6>4VLOJXrgF2O{)k7={TiDIE=(Dq*Qy@oTM*zDr{&ElSiYM zp<=R4r36J69aTWU+R9Hfd$H5gWmJ?V){KU3!FGyE(^@i!wFjeZHzi@5dLM387u=ld zDuI1Y9aR$wW>s#I{2!yLDaVkbP0&*0Rw%6bi(LtieJQ4(1V!z!ec zxPd)Ro0iU%RP#L|_l?KE=8&DRHK>jyVOYvhGeH+Dg_E%lgA(HtS6e$v%D7I;JSA2x zJyAuin-tvpN9g7>R_VAk2y;z??3BAp?u`h-AVDA;hP#m+Ie`7qbROGh%_UTW#R8yfGp<`u zT0}L)#f%(XEE)^iXVkO8^cvjflS zqgCxM310)JQde*o>fUl#>ZVeKsgO|j#uKGi)nF_ur&_f+8#C0&TfHnfsLOL|l(2qn zzdv^wdTi|o>$q(G;+tkTKrC4rE)BY?U`NHrct*gVx&Fq2&`!3htkZEOfODxftr4Te zoseFuag=IL1Nmq45nu|G#!^@0vYG5IueVyabw#q#aMxI9byjs99WGL*y)AKSaV(zx z_`(}GNM*1y<}4H9wYYSFJyg9J)H?v((!TfFaWx(sU*fU823wPgN}sS|an>&UvI;9B(IW(V)zPBm!iHD} z#^w74Lpmu7Q-GzlVS%*T-z*?q9;ZE1rs0ART4jnba~>D}G#opcQ=0H)af6HcoRn+b z<2rB{evcd1C9+1D2J<8wZ*NxIgjZtv5GLmCgt?t)h#_#ke{c+R6mv6))J@*}Y25ef z&~LoA&qL-#o=tcfhjH{wqDJ;~-TG^?2bCf~s0k4Rr!xwz%Aef_LeAklxE=Yzv|3jf zgD0G~)e9wr@)BCjlY84wz?$NS8KC9I$wf(T&+79JjF#n?BTI)Oub%4wiOcqw+R`R_q<`dcuoF z%~hKeL&tDFFYqCY)LkC&5y(k7TTrD>35rIAx}tH4k!g9bwYVJ>Vdir4F$T*wC@$08 z9Vo*Q0>*RcvK##h>MGUhA9xix+?c1wc6xJhn)^9;@BE6i*Rl8VQdstnLOP1mq$2;!bfASHmiW7|=fA{k$rs^-8n{D6_ z!O0=_K}HvcZJLSOC6z-L^pl3Gg>8-rU#Sp1VHMqgXPE@9x&IHe;K3;!^SQLDP1Gk&szPtk| z!gP;D7|#y~yVQ?sOFiT*V(Z-}5w1H6Q_U5JM#iW16yZiFRP1Re z6d4#47#NzEm};1qRP9}1;S?AECZC5?6r)p;GIW%UGW3$tBN7WTlOy|7R1?%A<1!8Z zWcm5P6(|@=;*K&3_$9aiP>2C|H*~SEHl}qnF*32RcmCVYu#s!C?PGvhf1vgQ({MEQ z0-#j>--RMe{&5&$0wkE87$5Ic5_O3gm&0wuE-r3wCp?G1zA70H{;-u#8CM~=RwB~( zn~C`<6feUh$bdO1%&N3!qbu6nGRd5`MM1E_qrbKh-8UYp5Bn)+3H>W^BhAn;{BMii zQ6h=TvFrK)^wKK>Ii6gKj}shWFYof%+9iCj?ME4sR7F+EI)n8FL{{PKEFvB65==*@ ztYjjVTJCuAFf8I~yB-pN_PJtqH&j$`#<<`CruB zL=_u3WB~-;t3q)iNn0eU(mFTih<4nOAb>1#WtBpLi(I)^zeYIHtkMGXCMx+I zxn4BT0V=+JPzPeY=!gAL9H~Iu%!rH0-S@IcG%~=tB#6 z3?WE7GAfJ{>GE{?Cn3T!QE}GK9b*EdSJ02&x@t|}JrL{^wrM@w^&})o;&q816M5`} zv)GB;AU7`haa1_vGQ}a$!m-zkV(+M>q!vI0Swo18{;<>GYZw7-V-`G#FZ z;+`vsBihuCk1RFz1IPbPX8$W|nDk6yiU8Si40!zy{^nmv_P1=2H*j<^as01|W>BQS zU)H`NU*-*((5?rqp;kgu@+hDpJ;?p8CA1d65)bxtJikJal(bvzdGGk}O*hXz+<}J? zLcR+L2OeA7Hg4Ngrc@8htV!xzT1}8!;I6q4U&S$O9SdTrot<`XEF=(`1{T&NmQ>K7 zMhGtK9(g1p@`t)<)=eZjN8=Kn#0pC2gzXjXcadjHMc_pfV(@^3541)LC1fY~k2zn&2PdaW`RPEHoKW^(p_b=LxpW&kF?v&nzb z1`@60=JZj9zNXk(E6D5D}(@k4Oi@$e2^M%grhlEuRwVGjDDay$Qpj z`_X-Y_!4e-Y*GVgF==F0ow5MlTTAsnKR;h#b0TF>AyJe`6r|%==oiwd6xDy5ky6qQ z)}Rd0f)8xoNo)1jj59p;ChIv4Eo7z*{m2yXq6)lJrnziw9jn%Ez|A-2Xg4@1)ET2u zIX8`u5M4m=+-6?`S;?VDFJkEMf+=q?0D7?rRv)mH=gptBFJGuQo21rlIyP>%ymGWk z=PsJ>>q~i>EN~{zO0TklBIe(8i>xkd=+U@;C{SdQ`E03*KXmWm4v#DEJi_-F+3lrR z;0al0yXA&axWr)U%1VZ@(83WozZbaogIoGYpl!5vz@Tz5?u36m;N=*f0UY$ssXR!q zWj~U)qW9Q9Fg9UW?|XPnelikeqa9R^Gk77PgEyEqW$1j=P@L z*ndO!fwPeq_7J_H1Sx>#L$EO_;MfYj{lKuD8ZrUtgQLUUEhvaXA$)-<61v`C=qUhI zioV&KR#l50fn!-2VT`aMv|LycLOFPT{rRSRGTBMc)A`Cl%K&4KIgMf}G%Qpb2@cB* zw8obt-BI3q8Lab!O<#zeaz{P-lI2l`2@qrjD+Qy)^VKks5&SeT(I)i?&Kf59{F`Rw zuh7Q>SQNwqLO%cu2lzcJ7eR*3!g}U)9=EQ}js-q{d%h!wl6X3%H0Z2^8f&^H;yqti4z6TNWc& zDUU8YV(ZHA*34HHaj#C43PFZq7a>=PMmj4+?C4&l=Y-W1D#1VYvJ1~K%$&g-o*-heAgLXXIGRhU zufonwl1R<@Kc8dPKkb`i5P9VFT_NOiRA=#tM0WX2Zut)_ zLjAlJS1&nnrL8x8!o$G+*z|kmgv4DMjvfnvH)7s$X=-nQC3(eU!ioQwIkaXrl+58 z@v)uj$7>i`^#+Xu%21!F#AuX|6lD-uelN9ggShOX&ZIN+G#y5T0q+RL*(T(EP)(nP744-ML= z+Rs3|2`L4I;b=WHwvKX_AD56GU+z92_Q9D*P|HjPYa$yW0o|NO{>4B1Uvq!T;g_N- zAbNf%J0QBo1cL@iahigvWJ9~A4-glDJEK?>9*+GI6)I~UIWi>7ybj#%Po}yT6d6Li z^AGh(W{NJwz#a~Qs!IvGKjqYir%cY1+8(5lFgGvl(nhFHc7H2^A(P}yeOa_;%+bh` zcql{#E$kdu?yhRNS$iE@F8!9E5NISAlyeuOhRD)&xMf0gz^J927u5aK|P- z>B%*9vSHy?L_q)OD>4+P;^tz4T>d(rqGI7Qp@@@EQ-v9w-;n;7N05{)V4c7}&Y^!`kH3}Q z4RtMV6gAARY~y$hG7uSbU|4hRMn97Dv0$Le@1jDIq&DKy{D$FOjqw{NruxivljBGw zP4iM(4Nrz^^~;{QBD7TVrb6PB=B$<-e9!0QeE8lcZLdDeb?Gv$ePllO2jgy&FSbW* zSDjDUV^=`S(Oo0;k(Idvzh}aXkfO)F6AqB?wWqYJw-1wOn5!{-ghaHb^v|B^92LmQ9QZj zHA&X)fd%B$^+TQaM@FPXM$$DdW|Vl)4bM-#?Slb^qUX1`$Yh6Lhc4>9J$I4ba->f3 z9CeGO>T!W3w(){M{OJ+?9!MK68KovK#k9TSX#R?++W4A+N>W8nnk**6AB)e;rev=$ zN_+(?(YEX;vsZ{EkEGw%J#iJYgR8A}p+iW;c@V>Z1&K->wI>!x-+!0*pn|{f=XA7J zfjw88LeeJgs4YI?&dHkBL|PRX`ULOIZlnniTUgo-k`2O2RXx4FC76;K^|ZC6WOAEw zz~V0bZ29xe=!#Xk?*b{sjw+^8l0Koy+e7HjWXgmPa4sITz+$VP!YlJ$eyfi3^6gGx6jZLpbUzX;!Z6K}aoc!1CRi zB6Lhwt%-GMcUW;Yiy6Y7hX(2oksbsi;Z6k*=;y;1!taBcCNBXkhuVPTi+1N*z*}bf z`R=&hH*Ck5oWz>FR~>MO$3dbDSJ!y|wrff-H$y(5KadrA_PR|rR>jS=*9&J*ykWLr z-1Z^QOxE=!6I z%Bozo)mW7#2Hd$-`hzg=F@6*cNz^$#BbGlIf${ZV1ADc}sNl=B72g`41|F7JtZ^BT z+y}nqn3Ug`2scS_{MjykPW2~*k$i6PhvvxJCW;n!SK5B8Rpm41fCEdy=ea-4F`rN5 zF>ClKp#4?}pI7eR#6U|}t`DA!GQJB7nT$HVV*{qPjIRU1Ou3W;I^pCt54o|ZHvWaH zooFx9L%#yv)!P;^er5LCU$5@qXMhJ-*T5Ah8|}byGNU5oMp3V)yR;hWJKojJEregX z<1UPt%&~=5OuP(|B{ty);vLdoe7o^?`tkQa7zoXKAW6D@lc+FTzucotaOfJ!(Bm zHE8f8j@6||lH`y2<&hP}Q1wr(=6ze0D6NRL{7QaE1=nTAzqjIeD}Be&@#_d*dyurz z&L7xo-D9!dS`i>^GaIPArR@r=N#-ppIh!UBcb!N*?nLUO+*%C>_dCF1IH)q>5oT(t zjQo{AoDB;mWL;3&;vTt?;bvJSj>^Gq4Jrh}S}D>G)+b!>oRDWI?c_d77$kF5ms{Gx zak*>~*5AvaB-Xl)IgdZ^Cupv6HxQ0 zM(KPaDpPsPOd)e)aFw}|=tfzg@J1P8oJx2ZBY=g4>_G(Hkgld(u&~jN((eJ}5@b1} zI(P7j443AZj*I@%q!$JQ2?DZV47U!|Tt6_;tlb`mSP3 z74DE4#|1FMDqwYbT4P6#wSI%s?*wDc>)MR$4z9ZtJg04+CTUds>1JSDwI}=vpRoRR zLqx(Tvf34CvkTMOPkoH~$CG~fSZb;(2S4Q6Vpe9G83V={hwQ>acu+MCX)@0i>Vd`% z4I8Ye+7&Kcbh(*bN1etKmrpN)v|=eI+$oD=zzii6nP&w|kn2Y-f!(v<aE zKmOz#{6PZB(8zD={il`RO6D}v(@mN_66KXUAEefgg|;VmBfP?UrfB$&zaRw7oanna zkNmVGz4Vhd!vZSnp1(&_5^t;eSv6O771BloJAHi=Pnn+aa6y(e2iiE97uZ{evzQ^8 z*lN@ZYx<-hLXP^IuYLGf<01O*>nDp0fo;;Iyt`JADrxt7-jEF(vv_btyp6CT8=@5t zm`I0lW+2+_xj2CRL|40kcYysuyYeiGihGe&a)yilqP}5h+^)m8$=mzrUe`$(?BIY> zfF7-V10Gu0CkWF)wz04&hhI>es0NS7d`cnT`4y8K!wUAKv$H09fa>KeNQvwUNDT1zn}_*RHykC$CD%*h7vRCQ&Z z4&N-!L>(@8i?K$l5)13n0%VPPV`iG7Q$2{1T3JypLSvN%1kX73goBIOEmg=Uf$9e? zm}g>JFu}EQKH>|K!)m9teoCmTc`y2Ll}msZYyy0Pkqjeid66>DP_?C{KCw94lHvLW z-+X!2YSm70s833lH0o+|A%Xwsw`@8lE3ia0n_Dve;LC7@I+i~@%$lD|3fNf&R6ob6 z@iGfx^OC4s`$|vO!0jTWwVpX;X^EqJF{i324I>N=f@u+rTN+xJGGR0LsCQc;iFD=F zbZJrgOpS;04o^wP7HF5QBaJ$KJgS2V4u02ViWD=6+7rcu`uc&MOoyf%ZBU|gQZkUg z<}ax>*Fo?d*77Ia)+{(`X45{a8>Bi$u-0BWSteyp#GJnTs?&k&<0NeHA$Qb3;SAJK zl}H*~eyD-0qHI3SEcn`_7d zq@YRsFdBig+k490BZSQwW)j}~GvM7x>2ymO4zakaHZ!q6C2{fz^NvvD8+e%7?BQBH z-}%B{oROo2+|6g%#+XmyyIJrK_(uEbg%MHlBn3^!&hWi+9c0iqM69enep#5FvV_^r z?Yr(k*5FbG{==#CGI1zU0Wk{V?UGhBBfv9HP9A-AmcJmL^f4S zY3E2$WQa&n#WRQ5DOqty_Pu z-NWQGCR^Hnu^Vo2rm`-M>zzf|uMCUd1X0{wISJL2Pp=AO5 zF@(50!g|SYw3n<_VP0T~`WUjtY**6Npphr5bD%i3#*p7h8$#;XTLJAt5J-x~O1~`z z`2C~P4%XSI(JbrEmVMEwqdsa^aqXWg;A6KBn^jDxTl!}Q!^WhprL$kb(Iqq zUS`i$tIPs#hdE-zAaMGoxcG?Z;RO2L0Y|gcjV_)FFo|e)MtTl`msLTwq>po$`H6_U zhdWK97~M>idl9GE_WgobQkK_P85H_0jN?s3O)+m&68B`_;FnbZ3W*Qm++ghSs7|T4b7m~VVV%j0gl`Iw!?+-9#Lsb!j3O%fSTVuK z37V>qM81D+Atl};23`TqEAfEkQDpz$-1$e__>X2jN>xh@Sq)I6sj@< ziJ^66GSmW9c%F7eu6&_t$UaLXF4KweZecS1ZiHPWy-$e_7`jVk74OS*!z=l#(CQ^K zW-ke|g^&0o=hn+4uh-8lUh0>!VIXXnQXwKr>`94+2~<;+`k z$|}QZ>#pm2g}8k*;)`@EnM~ZQtci%_$ink9t6`HP{gn}P1==;WDAld3JX?k%^GcTU za>m|CH|UsyFhyJBwG5=`6562hkVRMQ=_ron-Vlm$4bG^GFz|Jh5mM{J1`!!hAr~8F^w> z^YhQ=c|bFn_6~9X$v(30v$5IX;#Nl-XXRPgs{g_~RS*znH^6Vhe}8>T?aMA|qfnWO zQpf(wr^PfygfM+m2u!9}F|frrZPBQ!dh(varsYo!tCV)WA(Wn^_t=WR_G7cQU`AGx zrK^B6<}9+$w;$vra)QWMKf_Tnqg93AMVZ6Qd=q6rdB{;ZhsoT zWy9QhnpEnc@Dauz4!8gq zqDanAX#$^vf-4~ZqUJtSe?SO+Hmb?)l2#}v(8}2+P{ZZuhlib0$3G0|a5?JR>QgUUP$HTE5hb`h>imq#7P+Y*-UVLm@9km|V# zoigziFt$bxgQMwqKKhd!c--&ciywIED>faY3zHLrA{V#IA)!mq!FXxf?1coGK~N(b zjwu*@2B1^(bzFVBJO`4EJ$=it!a0kbgUvPL;Er(0io{W4G7Bkqh)=g)uS|l0YfD}f zaCJwY7vR-D=P9M68`cmtmQ^!F-$lt@0S|9G7cHgT13A0xMv)HmH#Z<4{~iYo_VOD{ z5!kU+>mUOvHouw+-y?*cNlUlDwD#;6ZvAIc$YcwG&qKZFh>EtM(Eda+w)E$HcfZyB zG*$<*ae_ApE%gxWx%O^~XMnRSNLv!y`g99F(J_m)spJAc95P|_joOIoru%atbw z9PYgkcE*8x#)-W{>96KDl&74iW<#wrK)1s zxzU{`rW5af+dT6Z@_1dG<}CtDMT`EGVEXSL_5D9)Z;6UJe-TW7)M?bY%E;8G?Yc!$ zic;F5=#dba^P~7f#qvC}Nd#XEo2r_UlgfR_`B2^W0QjXU?RAi$>f&{G_Lu8Fp0qDp z?vAdm%z#3kcZmaJ@afooB=A@>8_N~O9Yzu=ZCEikM>UgU+{%>pPvmSNzGk@*jnc5~ z(Z#H4OL^gw>)gqZ!9X|3i4LAdp9vo)?F9QCR3##{BHoZ73Uk^Ha={2rc*TBijfKH- z=$cZQdc<5%*$kVo|{+bL3 zEoU&tq*YPR)^y-SISeQNQ)YZ9v>Hm4O=J)lf(y=Yu1ao&zj#5GVGxyj%V%vl9}dw< zO;@NRd4qe@Et}E@Q;SChBR2QPKll1{*5*jT*<$$5TywvC77vt=1=0xZ46>_17YzbiBoDffH(1_qFP7v2SVhZmA_7JDB50t#C39 z8V<9(E?bVWI<7d6MzcS^w!XmZ**{AO!~DZNU)pgr=yY1 zT@!AapE;yg&hmj*g{I3vd## zx+d%^O?d%%?Dba|l~X6ZOW|>FPsrjPjn-h4swysH!RNJUWofC?K(^0uHrBPrH5#W> zMn8^@USzjUucqo%+5&))Dnnw`5l1mp>roaA99Nkk4keZl2wAF7oa(!x?@8uGWzc5Q zM}g`}zf-D@B6lVFYWmmJ8a+_%z8g$C7Ww~PD9&jki08NY!b!fK288R;E?e3Z+Pk{is%HxQU`xu9+y5 zq?DWJD7kKp(B2J$t5Ij8-)?g!T9_n<&0L8F5-D0dp>9!Qnl#E{eDtkNo#lw6rMJG$ z9Gz_Z&a_6ie?;F1Y^6I$Mg9_sml@-z6t!YLr=ml<6{^U~UIbZUUa_zy>fBtR3Rpig zc1kLSJj!rEJILzL^uE1mQ}hjMCkA|ZlWVC9T-#=~ip%McP%6QscEGlYLuUxDUC=aX zCK@}@!_@~@z;70I+Hp5#Tq4h#d4r!$Np1KhXkAGlY$ap7IZ9DY})&(xoTyle8^dBXbQUhPE6ehWHrfMh&0=d<)E2+pxvWo=@`^ zIk@;-$}a4zJmK;rnaC)^a1_a_ie7OE*|hYEq1<6EG>r}!XI9+(j>oe!fVBG%7d}?U z#ja?T@`XO(;q~fe2CfFm-g8FbVD;O7y9c;J)k0>#q7z-%oMy4l+ zW>V~Y?s`NoXkBeHlXg&u*8B7)B%alfYcCriYwFQWeZ6Qre!4timF`d$=YN~_fPM5Kc8P;B-WIDrg^-j=|{Szq6(TC)oa!V7y zLmMFN1&0lM`+TC$7}on;!51{d^&M`UW ztI$U4S&}_R?G;2sI)g4)uS-t}sbnRoXVwM!&vi3GfYsU?fSI5Hn2GCOJ5IpPZ%Y#+ z=l@;;{XiY_r#^RJSr?s1) z4b@ve?p5(@YTD-<%79-%w)Iv@!Nf+6F4F1`&t~S{b4!B3fl-!~58a~Uj~d4-xRt`k zsmGHs$D~Wr&+DWK$cy07NH@_z(Ku8gdSN989efXqpreBSw$I%17RdxoE<5C^N&9sk!s2b9*#}#v@O@Hgm z2|U7Gs*@hu1JO$H(Mk)%buh~*>paY&Z|_AKf-?cz6jlT-v6 zF>l9?C6EBRpV2&c1~{1$VeSA|G7T(VqyzZr&G>vm87oBq2S%H0D+RbZm}Z`t5Hf$C zFn7X*;R_D^ z#Ug0tYczRP$s!6w<27;5Mw0QT3uNO5xY($|*-DoR1cq8H9l}_^O(=g5jLnbU5*SLx zGpjfy(NPyjL`^Oln_$uI6(aEh(iS4G=$%0;n39C(iw79RlXG>W&8;R1h;oVaODw2nw^v{~`j(1K8$ z5pHKrj2wJhMfw0Sos}kyOS48Dw_~=ka$0ZPb!9=_FhfOx9NpMxd80!a-$dKOmOGDW zi$G74Sd(-u8c!%35lL|GkyxZdlYUCML{V-Ovq{g}SXea9t`pYM^ioot&1_(85oVZ6 zUhCw#HkfCg7mRT3|>99{swr3FlA@_$RnE?714^o;vps4j4}u=PfUAd zMmV3j;Rogci^f!ms$Z;gqiy7>soQwo7clLNJ4=JAyrz;=*Yhe8q7*$Du970BXW89Xyq92M4GSkNS-6uVN~Y4r7iG>{OyW=R?@DmRoi9GS^QtbP zFy2DB`|uZTv8|ow|Jcz6?C=10U$*_l2oWiacRwyoLafS!EO%Lv8N-*U8V+2<_~eEA zgPG-klSM19k%(%;3YM|>F||hE4>7GMA(GaOvZBrE{$t|Hvg(C2^PEsi4+)w#P4jE2XDi2SBm1?6NiSkOp-IT<|r}L9)4tLI_KJ*GKhv16IV}An+Jyx z=Mk`vCXkt-qg|ah5=GD;g5gZQugsv!#)$@ zkE=6=6W9u9VWiGjr|MgyF<&XcKX&S3oN{c{jt-*1HHaQgY({yjZiWW97rha^TxZy< z2%-5X;0EBP>(Y9|x*603*Pz-eMF5*#4M;F`QjTBH>rrO$r3iz5 z?_nHysyjnizhZQMXo1gz7b{p`yZ8Q78^ zFJ3&CzM9fzAqb6ac}@00d*zjW`)TBzL=s$M`X*0{z8$pkd2@#4CGyKEhzqQR!7*Lo@mhw`yNEE6~+nF3p;Qp;x#-C)N5qQD)z#rmZ#)g*~Nk z)#HPdF_V$0wlJ4f3HFy&fTB#7Iq|HwGdd#P3k=p3dcpfCfn$O)C7;y;;J4Za_;+DEH%|8nKwnWcD zBgHX)JrDRqtn(hC+?fV5QVpv1^3=t2!q~AVwMBXohuW@6p`!h>>C58%sth4+Baw|u zh&>N1`t(FHKv(P+@nT$Mvcl){&d%Y5dx|&jkUxjpUO3ii1*^l$zCE*>59`AvAja%`Bfry-`?(Oo?5wY|b4YM0lC?*o7_G$QC~QwKslQTWac z#;%`sWIt8-mVa1|2KH=u!^ukn-3xyQcm4@|+Ra&~nNBi0F81BZT$XgH@$2h2wk2W% znpo1OZuQ1N>bX52II+lsnQ`WVUxmZ?4fR_f0243_m`mbc3`?iy*HBJI)p2 z`GQ{`uS;@;e1COn-vgE2D!>EheLBCF-+ok-x5X8Cu>4H}98dH^O(VlqQwE>jlLcs> zNG`aSgDNHnH8zWw?h!tye^aN|%>@k;h`Z_H6*py3hHO^6PE1-GSbkhG%wg;+vVo&dc)3~9&` zPtZtJyCqCdrFUIEt%Gs_?J``ycD16pKm^bZn>4xq3i>9{b`Ri6yH|K>kfC; zI5l&P)4NHPR)*R0DUcyB4!|2cir(Y1&Bsn3X8v4D(#QW8Dtv@D)CCO zadQC85Zy=Rkrhm9&csynbm>B_nwMTFah9ETdNcLU@J{haekA|9*DA2pY&A|FS*L!*O+>@Q$00FeL+2lg2NWLITxH5 z0l;yj=vQWI@q~jVn~+5MG!mV@Y`gE958tV#UcO#56hn>b69 zM;lq+P@MW=cIvIXkQmKS$*7l|}AW%6zETA2b`qD*cL z(=k4-4=t6FzQo#uMXVwF{4HvE%%tGbiOlO)Q3Y6D<5W$ z9pm>%TBUI99MC`N9S$crpOCr4sWJHP)$Zg#NXa~j?WeVo03P3}_w%##A@F|Bjo-nNxJZX%lbcyQtG8sO zWKHes>38e-!hu1$6VvY+W-z?<942r=i&i<88UGWdQHuMQjWC-rs$7xE<_-PNgC z_aIqBfG^4puRkogKc%I-rLIVF=M8jCh?C4!M|Q=_kO&3gwwjv$ay{FUDs?k7xr%jD zHreor1+#e1_;6|2wGPtz$``x}nzWQFj8V&Wm8Tu#oaqM<$BLh+Xis=Tt+bzEpC}w) z_c&qJ6u&eWHDb<>p;%F_>|`0p6kXYpw0B_3sIT@!=fWHH`M{FYdkF}*CxT|`v%pvx z#F#^4tdS0|O9M1#db%MF(5Opy;i( zL(Pc2aM4*f_Bme@o{xMrsO=)&>YKQw+)P-`FwEHR4vjU>#9~X7ElQ#sRMjR^Cd)wl zg^67Bgn9CK=WP%Ar>T4J!}DcLDe z=ehSmTp##KyQ78cmArL=IjOD6+n@jHCbOatm)#4l$t5YV?q-J86T&;>lEyK&9(XLh zr{kPuX+P8LN%rd%8&&Ia)iKX_%=j`Mr*)c)cO1`-B$XBvoT3yQCDKA>8F0KL$GpHL zPe?6dkE&T+VX=uJOjXyrq$BQ`a8H@wN1%0nw4qBI$2zBx)ID^6;Ux+? zu{?X$_1hoz9d^jkDJpT-N6+HDNo%^MQ2~yqsSBJj4@5;|1@w+BE04#@Jo4I63<~?O?ok%g%vQakTJKpMsk&oeVES1>cnaF7ZkFpqN6lx` zzD+YhR%wq2DP0fJCNC}CXK`g{AA6*}!O}%#0!Tdho4ooh&a5&{xtcFmjO4%Kj$f(1 zTk||{u|*?tAT{{<)?PmD_$JVA;dw;UF+x~|!q-EE*Oy?gFIlB*^``@ob2VL?rogtP z0M34@?2$;}n;^OAV2?o|zHg`+@Adk+&@Syd!rS zWvW$e5w{onua4sp+jHuJ&olMz#V53Z5y-FkcJDz>Wk%_J>COk5<0ya*aZLZl9LH}A zJhJ`Q-n9K+c8=0`FWE^x^xn4Fa7PDUc;v2+us(dSaoIUR4D#QQh91R!${|j{)=Zy1 zG;hqgdhSklM-VKL6HNC3&B(p1B)2Nshe7)F=-HBe=8o%OhK1MN*Gq6dBuPvqDRVJ{ z;zVNY?wSB%W0s^OMR_HL(Ws)va7eWGF*MWx<1wG7hZ}o=B62D?i|&0b14_7UG287YDr%?aYMMpeCkY1i`b+H!J9sqrvKc#Y6c8At@QiLSwj)@ifz~Z|c$lOMA@?cPqFRmZ%_>bz2X4(B=`^3;MDjsEeAO=? zSoD&+L>A|fGt7+6kF2@LqhL06sD%|~YsIe=EcWqy{e_61N_D(*CacnMvyXMjP87HI z4PT6!$fzxx{}=>jeqzkkoN+!r9e|@lZUN4pn(T28v`k=_vIhTn^i9O3qTqd)-%!QQ zYB6*6B@&b(!#X4C~59SLZuorNU_wWZA36{>O%iX)VS5NNZh49C_ppI>?)wwml}_0MLzOXT>lmo#&Ew6d?mu8~~I_^4VGBQtCAke;RQa5DL` z1PFDPsKb3CS$v;RhlQ1J@AHa1VRuuxp}NOIvrC>4$$A0Ix0VpAc0lfG%8{mR{TRQ( zbXM#1Tci3H*Wt>cVuMta^6^z`=^B@j+YhJqq9?>zZPxyg2U(wvod=uwJs{8gtpyab zXHQX<0FOGW6+dw&%c_qMUOI^+Rnb?&HB7Fee|33p4#8i>%_ev(aTm7N1f#6lV%28O zQ`tQh$VDjy8x(Lh#$rg1Kco$Bw%gULq+lc4$&HFGvLMO30QBSDvZ#*~hEHVZ`5=Kw z3y^9D512@P%d~s{x!lrHeL4!TzL`9(ITC97`Cwnn8PSdxPG@0_v{No|kfu3DbtF}K zuoP+88j4dP+Bn7hlGwU$BJy+LN6g&d3HJWMAd1P9xCXG-_P)raipYg5R{KQO$j;I9 z1y1cw#13K|&kfsRZ@qQC<>j=|OC?*v1|VrY$s=2!{}e33aQcZghqc@YsHKq^)kpkg z>B;CWNX+K=u|y#N)O>n5YuyvPl5cO6B^scmG?J zC8ix)E1PlhNaw8FpD+b|D$z`Id^4)rJe78MNiBga?Z- z0$L&MRTieSB1_E#KaN*H#Ns1}?zOA%Ybr{G+Sn3moXTVZj=L`nt?D&-MjOMz-Yq&@ z$P3h23d_F8Dcf*?txX7}p>nM*s+65t z1il8bHHsBynUK|aEXSjzY6sz1nZ%|%XeWTcGLRyRl@q4YAR)JovbdTTY&7u>@}28A zgV^Npp?}I!?3K7IXu9ml-Lw;w@9m zBYTeU+Seh8uJ-w?4e_6byq0f7>O3xm(hO}Y=fgU5^vW|>0yQ^0+?}LT55ei$i zzlU-iRbd8TRX9Ept%h%ariV=%u%F@@FA>U*XdAalcH%>#5_a&w)g`uW%3}m?vP- zc5}DkuF6ruKDwEYj+2YTSQ9=rkp19U5P@(zRm(nLod(sG9{~nw1BUoS2OFDXa{xfw zZ~UaZLFUZxfQ*9?_X?*~`d;nn-BbaefLJ`DT13KF6?T5Mnt;v5d>H}s)aAIzJcs#B z|CuXPJKww}hWBKsUfks#Kh$)ptp?5U1b@ttXFRbe_BZ&_R9XC6CA4WhWhMUE9Y2H4 z{w#CBCR<)Fd1M;mx*m?Z=L-^1kv1WKtqG(BjMiR4M^5yN4rlFM6oGUS2Wf~7Z@e*- ze84Vr`Bmi!(a1y}-m^HHMpbAiKPVEv|(7=|}D#Ihfk+-S5Hlkfch02z&$(zS3vrYz2g*ic{xBy~*gIp(eG}^gMc7 zPu2Eivnp@BH3SOgx!aJXttx*()!=2)%Bf$Gs^4cCs@)=(PJNxhH5lVY&qSZYaa?A^LhZW`B9(N?fx<^gCb(VE%3QpA*_Pohgp6vCB36iVaq zc1TI%L2Le?kuv?6Dq`H+W>AqnjyEzUBK948|DB|)U0_4DzWF#7L{agwo%y$hC>->r z4|_g_6ZC!n2=GF4RqVh6$$reQ(bG0K)i9(oC1t6kY)R@DNxicxGxejwL2sB<>l#w4 zE$QkyFI^(kZ#eE5srv*JDRIqRp2Totc8I%{jWhC$GrPWVc&gE1(8#?k!xDEQ)Tu~e zdU@aD8enALmN@%1FmWUz;4p}41)@c>Fg}1vv~q>xD}KC#sF|L&FU);^Ye|Q;1#^ps z)WmmdQI2;%?S%6i86-GD88>r|(nJackvJ#50vG6fm$1GWf*f6>oBiDKG0Kkwb17KPnS%7CKb zB7$V58cTd8x*NXg=uEX8Man_cDu;)4+P}BuCvYH6P|`x-#CMOp;%u$e z&BZNHgXz-KlbLp;j)si^~BI{!yNLWs5fK+!##G;yVWq|<>7TlosfaWN-;C@oag~V`3rZM_HN`kpF`u1p# ztNTl4`j*Lf>>3NIoiu{ZrM9&E5H~ozq-Qz@Lkbp-xdm>FbHQ2KCc8WD7kt?=R*kG# z!rQ178&ZoU(~U<;lsg@n216Ze3rB2FwqjbZ=u|J?nN%<4J9(Bl(90xevE|7ejUYm9 zg@E_xX}u2d%O1mpA2XzjRwWinvSeg)gHABeMH(2!A^g@~4l%8e0WWAkBvv60Cr>TR zQB1%EQ zUoZeUdqjh+1gFo6h~C~z#A57mf5ibmq$y_uVtA_kWv8X)CzfVEooDaY!#P?5$Y zGPKXbE<75nc%D-|w4OrP#;87oL@2^4+sxKah;a-5&z_&SUf~-z(1}bP=tM^GYtR3a z!x4zjSa^)KWG6jxfUI#{<26g$iAI;o_+B{LXY@WfWEdEl6%#8s3@b`?&Tm#aSK!~| z^%DdrXnijW`d!ajWuKApw&{L+WCPpFialo&^dZ9jC7A%BO`2ZF&YUDe;Yu|zFuv`2 z)BE*7Lkay)M7uohJ)446X``0x0%PzPTWY92`1Oq4a2D_7V0wypPnXFR)WM0IlFgg@ zqz#hv2xJEQL8eu}O;e(w4rSA?5|eZHbS6jENytJBq59?bOf>Wrl8ySZH36H(6fGR#vHM6q zn}!7!I@4$*+LFXs{x?|=q2*QtYT%Lw3+5(8uc0j8o3}TrG(zSV#>4wo6~)u|R+Yx# z?0$AspZDjv{dfv417~C17Oy%Fal{%+B6H(NX`$Bl>II-L3N3 zZc+sKZbqewU*&_Xt;9k=%4*aVYBvE1n&JZS7Uqjd%n8nOQmzh^x#vWK{;In~=QO)g zT-n3OU(1@3QfL|$g1d2xeBb@O15Rl01+hmpup2De7p%Yrd$E7(In!*R+;IJZh}v!svi z;7N~pq8KZDXXap0qd_D=Y^B)rz4S0^SF=&v6YYTAV$ad43#x!+n~-6< zK{8*vWoAdW(gGGt&URD}@g6tMoY(+Lw=vvxhfIIK9AjvNF_(W}1Rxn(mp;tJfDV<0 zbJN0t(@Xb8UeO{&T{$$uDrs7)j$}=?WsuDl+T2N5Y<4TMHGOMcocPr$%~(yvtKv(n z`U96d!D0cb9>Dx2zz$m&lAhazs%UeR^K*gb>d8CPs+?qlpfA;t{InXa)^2ryC(FU(Zc6Xbnnh`lg`K&g^JeS>}^c0MJKUCfV+~ zV(EN0Z5ztoN;hqcj!8V+VRbSltJ<~|y`U+9#wv|~H zNE!j9uXa=dec@JQSgJ6N6@Il&tzCBJv9#ldR`Lm*<)YwH4tdlAlG0Fl8Nfa(J~c%DQ2AA-}x8D=p(l#n1+hgx;N;1Aq?lq@{Lt9FKu89CjnnHD1G_@p;%Lp`+b@ttb33!E_Xt;QUD9~nRQl&xAro9-{+&6^ljK2f-d>&qy&d#0xwH z@slNv@ULKp!Cf*JHuS@#4c?F->WjPc)yiuSargAIEg>muRxzY?Hzdq@G5CS)U1*Et zE2SLh=@DI1J(guiy2Igq(?(xI9WL%g^f@{5Hmr|!Qz4`vn|LjrtO=b~I6~5EU5Fxy z;-#<)6w#w=DkpSthAu+E;OL?!?6C9Mwt*o(@68(Jhvs-eX4V z=d=>HI|`3J%H5X|gSrC8KH^IL?h5=3ID6svwHH@(wRbSG`Zsor^q4`3PCn#-(YX?< z_q8+T)51$E0xyKR{L!LN(G=+9K6$3#PDT^IAe|Igkx=!4#rqKWoXiZdh`&ocjp=Ok zemJe6*{it~>;sr(B0fSmp(S#*y5I0)OOz~Oe6Im+($S}e3tyx7Y6pA8vKCBmSEQDa zLfkm*;uMbTLpcR0)tF_v-lbK%`5>POyI2E(!)2=Rj0p;WKi=|UNt6HsQv0xR3QIK9 zsew(AFyzH!7Azxum{%VC^`cqhGdGbABGQ4cYdNBPTx+XpJ=NUEDeP^e^w^AOE1pQI zP{Us-sk!v$gj}@684E!uWjzvpoF|%v-6hwnitN1sCSg@(>RDCVgU8Ile_-xX`hL6u zzI4*Q)AVu(-ef8{#~P9STQ5t|qIMRoh&S?7Oq+cL6vxG?{NUr@k(~7^%w)P6nPbDa~4Jw}*p-|cT4p1?)!c0FoB(^DNJ+FDg+LoP6=RgB7Or673WD5MG&C!4< zerd6q$ODkBvFoy*%cpHGKSt z3uDC6Sc=xvv@kDzRD)aIO`x}BaWLycA%(w-D`Pd+uL*rL|etagQ;U&xt_9?7#}=}5HI)cU-0 z%pMA`>Xb7s)|Y)4HKSZOu;{lg=KjeIyXb0{@EM`FTDkLRH`!W%z*lQJ74P%Ka76)H zblrSIzf+dMWbO`g;=(b@{pS)zUcO&GrIFe%&?YeX4r8B2bBArB%-5ZrQ+vonr%AYy z1+u0*K{UVUmV>h5vD!F;6}a%KdMZQLs04oGkpiaC)zI( zT2U9qta5o|6Y+It1)sE8>u&0)W~l$NX@ZQ8UZfB=`($EW6?FT%{EoRhOrb9)z@3r8y?Z99FNLDE;7V=Q zotj&igu*Rh^VQn3MQKBq!T{yTwGhn1YL6k*?j?{_ek5xe8#i#GG4S-a_Re2lssG!} z`Y-d0BcOdB@!m?4y&hMN68}#0-IIlm_xO)d#}ugX{q^OZe{-@LeJyv`cY&ze4t2~! zKb{qX-j;kt{?gC(vW%}X4pm@1F?~LH{^Q8d@X$dy@5ff~p!J3zmA>H`A)y+6RB_h* zZfIO+bd=*LiymRw{asW%xxaVl33_xtdVrrqIPn zc@y8oMJvNtgcO~4i0`f)GCFkWY8EF?4duLVjHTdb6oYLnO9}Q-pe{CKQJL)hV8)JI z$mVA0Dq&7Z1TbYdSC(WbJ+IBjXngZTu&I+vHF|>Zo$757{8lL;8Zr-Exkf?3jzN5k z_d9I>{>^J?!l)< zNd$7E9FVrta}3qy3L7Ys$^fRWNuu^hs^{*eXvazd&+Q*?lTfc>2+EdP(o0P_Z05HX zVKsfFAQ{t^CRu~Dw(CuJ>tvx*p$5@flA>QRl455b&{*U?xU8`)nF2T$uu_(l8VNtq z?pBiRQIckGzk8W&SFSB=g6eG`ZC;6v9w`?eF*S}3E@N`2ropeHP)E}o?qJkyVEI;K$!)bWY zt9>4WmDVJh7U~m$|K`T#hF!v|znj^=M;69uXrFys#51XT;DbMr4H)>7UQ1e2(cuQf z4kr~Tt1tpBB2GaJ(|j~lHgW40EgMMVqR6eJoJig1SBg|2=$~4I3P0eP$q%_`sS&4~ z26=&a&tLjQbch1`cVXa-2fTl1y8}->|Nqu?uVrNTov!=VKh)g89wUPTgAzkSKZ57_ zr=B^mcldE3K04t4{;RaG53&9yovq;@aR#VHx+R1^^*kr-vEEd!uea68Z<{R%_DD6fn&T4 zu;fDj07L-(_fLSJGdkeh&c&7A(ZLj`7iwnkAcqUexU;WjUkqeg1m1-IUZTIZA(4dtr2Gr`e{BIejlCgS<33MB=1!8?a74!F%=Uo7N`F@k} ze+1C_eU4Y_$mvdjci zwEtCIphA2PBzBhng5=M#e4r%)RW5rVD|_`PvY$7BK`}w~d>%0O9sY#*LUAq=^OjMF^PY5m<7!=s5jyRfosCQAo#hL`h5vN-M}6Q z0Li}){5?wi8)GVHNkF|U9*8V5ej)nhb^TLw1KqiPK(@{P1^L&P=`ZNt?_+}&0(8Uh zfyyZFPgMV7ECt;Jdw|`|{}b$w4&x77VxR>8wUs|GQ5FBf1UlvasqX$qfk5rI4>Wfr zztH>y`=daAef**C12yJ7;LDf&3;h3X+5@dGPy@vS(RSs3CWimbTp=g \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >&- +APP_HOME="`pwd -P`" +cd "$SAVED" >&- + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" From cb0458f17e55e713b10fe5611890887d0c8b910e Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Sat, 3 Oct 2015 22:19:38 +0200 Subject: [PATCH 102/293] Update Location APIs --- extern/SafeParcel | 2 +- .../location/ActivityRecognitionResult.aidl | 3 + .../android/gms/location/GestureRequest.aidl | 3 + .../gms/location/ILocationCallback.aidl | 11 ++++ .../gms/location/LocationAvailability.aidl | 3 + .../android/gms/location/LocationResult.aidl | 3 + .../gms/location/LocationSettingsRequest.aidl | 3 + .../IGoogleLocationManagerService.aidl | 39 +++++++++--- .../location/internal/ISettingsCallback.aidl | 5 ++ .../internal/LocationRequestUpdateData.aidl | 3 + .../location/ActivityRecognitionResult.java | 23 +++++++ .../android/gms/location/GestureRequest.java | 23 +++++++ .../gms/location/LocationAvailability.java | 24 +++++++ .../android/gms/location/LocationRequest.java | 12 +++- .../android/gms/location/LocationResult.java | 45 ++++++++++++++ .../gms/location/LocationSettingsRequest.java | 23 +++++++ .../gms/location/internal/ClientIdentity.java | 5 +- .../internal/LocationRequestInternal.java | 47 ++++++++++++-- .../internal/LocationRequestUpdateData.java | 62 +++++++++++++++++++ 19 files changed, 322 insertions(+), 17 deletions(-) create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/location/ActivityRecognitionResult.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/location/GestureRequest.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/location/ILocationCallback.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/location/LocationAvailability.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/location/LocationResult.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/location/LocationSettingsRequest.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/location/internal/ISettingsCallback.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/location/internal/LocationRequestUpdateData.aidl create mode 100644 play-services-api/src/main/java/com/google/android/gms/location/ActivityRecognitionResult.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/location/GestureRequest.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/location/LocationAvailability.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/location/LocationResult.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/location/LocationSettingsRequest.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/location/internal/LocationRequestUpdateData.java diff --git a/extern/SafeParcel b/extern/SafeParcel index cbe7b4b9..89dd3272 160000 --- a/extern/SafeParcel +++ b/extern/SafeParcel @@ -1 +1 @@ -Subproject commit cbe7b4b90452670c422f8303ec2a19aac7179d32 +Subproject commit 89dd3272d40271120913e0ba71b0fd348387f1d6 diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/ActivityRecognitionResult.aidl b/play-services-api/src/main/aidl/com/google/android/gms/location/ActivityRecognitionResult.aidl new file mode 100644 index 00000000..52b4c775 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/location/ActivityRecognitionResult.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.location; + +parcelable ActivityRecognitionResult; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/GestureRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/location/GestureRequest.aidl new file mode 100644 index 00000000..9fffa77a --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/location/GestureRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.location; + +parcelable GestureRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/ILocationCallback.aidl b/play-services-api/src/main/aidl/com/google/android/gms/location/ILocationCallback.aidl new file mode 100644 index 00000000..bbccd355 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/location/ILocationCallback.aidl @@ -0,0 +1,11 @@ +package com.google.android.gms.location; + +import android.location.Location; + +import com.google.android.gms.location.LocationAvailability; +import com.google.android.gms.location.LocationResult; + +interface ILocationCallback { + void onLocationResult(in LocationResult result) = 0; + void onLocationAvailability(in LocationAvailability availability) = 1; +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/LocationAvailability.aidl b/play-services-api/src/main/aidl/com/google/android/gms/location/LocationAvailability.aidl new file mode 100644 index 00000000..8037232b --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/location/LocationAvailability.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.location; + +parcelable LocationAvailability; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/LocationResult.aidl b/play-services-api/src/main/aidl/com/google/android/gms/location/LocationResult.aidl new file mode 100644 index 00000000..d79917b7 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/location/LocationResult.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.location; + +parcelable LocationResult; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/LocationSettingsRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/location/LocationSettingsRequest.aidl new file mode 100644 index 00000000..2552ed66 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/location/LocationSettingsRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.location; + +parcelable LocationSettingsRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/internal/IGoogleLocationManagerService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/location/internal/IGoogleLocationManagerService.aidl index e2fb3acc..be26aeac 100644 --- a/play-services-api/src/main/aidl/com/google/android/gms/location/internal/IGoogleLocationManagerService.aidl +++ b/play-services-api/src/main/aidl/com/google/android/gms/location/internal/IGoogleLocationManagerService.aidl @@ -4,9 +4,12 @@ import android.app.PendingIntent; import android.location.Location; import android.os.Bundle; +import com.google.android.gms.common.api.Status; import com.google.android.gms.location.places.AutocompleteFilter; import com.google.android.gms.location.places.internal.IPlacesCallbacks; +import com.google.android.gms.location.internal.ISettingsCallback; import com.google.android.gms.location.internal.LocationRequestInternal; +import com.google.android.gms.location.internal.LocationRequestUpdateData; import com.google.android.gms.location.places.NearbyAlertRequest; import com.google.android.gms.location.places.PlaceFilter; import com.google.android.gms.location.places.PlaceRequest; @@ -14,9 +17,13 @@ import com.google.android.gms.location.places.PlaceReport; import com.google.android.gms.location.places.internal.PlacesParams; import com.google.android.gms.location.places.UserAddedPlace; import com.google.android.gms.location.places.UserDataType; +import com.google.android.gms.location.ActivityRecognitionResult; import com.google.android.gms.location.Geofence; import com.google.android.gms.location.GeofencingRequest; +import com.google.android.gms.location.GestureRequest; +import com.google.android.gms.location.LocationAvailability; import com.google.android.gms.location.LocationRequest; +import com.google.android.gms.location.LocationSettingsRequest; import com.google.android.gms.location.LocationStatus; import com.google.android.gms.location.internal.IGeofencerCallbacks; import com.google.android.gms.location.ILocationListener; @@ -25,40 +32,54 @@ import com.google.android.gms.maps.model.LatLngBounds; interface IGoogleLocationManagerService { void addGeofencesList(in List geofences, in PendingIntent pendingIntent, IGeofencerCallbacks callbacks, String packageName) = 0; + void addGeofences(in GeofencingRequest geofencingRequest, in PendingIntent pendingIntent, IGeofencerCallbacks callbacks) = 56; void removeGeofencesByIntent(in PendingIntent pendingIntent, IGeofencerCallbacks callbacks, String packageName) = 1; void removeGeofencesById(in String[] geofenceRequestIds, IGeofencerCallbacks callbacks, String packageName) = 2; - void iglms4(IGeofencerCallbacks callbacks, String packageName) = 3; + void removeAllGeofences(IGeofencerCallbacks callbacks, String packageName) = 3; + void requestActivityUpdates(long detectionIntervalMillis, boolean alwaysTrue, in PendingIntent callbackIntent) = 4; void removeActivityUpdates(in PendingIntent callbackIntent) = 5; + ActivityRecognitionResult getLastActivity(String packageName) = 63; + Status iglms65(in PendingIntent pendingIntent) = 64; + Status iglms66(in PendingIntent pendingIntent) = 65; + + Status requestGestureUpdates(in GestureRequest request, in PendingIntent pendingIntent) = 59; + Status iglms61(in PendingIntent pendingIntent) = 60; + Location getLastLocation() = 6; void requestLocationUpdatesWithListener(in LocationRequest request, ILocationListener listener) = 7; + void requestLocationUpdatesWithPackage(in LocationRequest request, ILocationListener listener, String packageName) = 19; void requestLocationUpdatesWithIntent(in LocationRequest request, in PendingIntent callbackIntent) = 8; + void requestLocationUpdatesInternalWithListener(in LocationRequestInternal request, ILocationListener listener) = 51; + void requestLocationUpdatesInternalWithIntent(in LocationRequestInternal request, in PendingIntent callbackIntent) = 52; void removeLocationUpdatesWithListener(ILocationListener listener) = 9; void removeLocationUpdatesWithIntent(in PendingIntent callbackIntent) = 10; + void updateLocationRequest(in LocationRequestUpdateData locationRequestUpdateData) = 58; + void setMockMode(boolean mockMode) = 11; void setMockLocation(in Location mockLocation) = 12; + + Location getLastLocationWithPackage(String packageName) = 20; + void iglms26(in Location var1, int var2) = 25; + LocationAvailability iglms34(String var1) = 33; + + IBinder iglms51() = 50; + void iglms63(in LocationSettingsRequest settingsRequest, ISettingsCallback callback, String packageName) = 62; + void iglms14(in LatLngBounds var1, int var2, in PlaceFilter var3, in PlacesParams var4, IPlacesCallbacks var5) = 13; void iglms15(String var1, in PlacesParams var2, IPlacesCallbacks var3) = 14; void iglms16(in LatLng var1, in PlaceFilter var2, in PlacesParams var3, IPlacesCallbacks var4) = 15; void iglms17(in PlaceFilter var1, in PlacesParams var2, IPlacesCallbacks var3) = 16; void iglms18(in PlaceRequest var1, in PlacesParams var2, in PendingIntent var3) = 17; void iglms19(in PlacesParams var1, in PendingIntent var2) = 18; - void requestLocationUpdatesWithPackage(in LocationRequest request, ILocationListener listener, String packageName) = 19; - Location getLastLocationWithPackage(String packageName) = 20; void iglms25(in PlaceReport var1, in PlacesParams var2) = 24; - void iglms26(in Location var1, int var2) = 25; - LocationStatus iglms34(String var1) = 33; void iglms42(String var1, in PlacesParams var2, IPlacesCallbacks var3) = 41; void iglms46(in UserAddedPlace var1, in PlacesParams var2, IPlacesCallbacks var3) = 45; void iglms47(in LatLngBounds var1, int var2, String var3, in PlaceFilter var4, in PlacesParams var5, IPlacesCallbacks var6) = 46; void iglms48(in NearbyAlertRequest var1, in PlacesParams var2, in PendingIntent var3) = 47; void iglms49(in PlacesParams var1, in PendingIntent var2) = 48; void iglms50(in UserDataType var1, in LatLngBounds var2, in List var3, in PlacesParams var4, IPlacesCallbacks var5) = 49; - IBinder iglms51() = 50; - void requestLocationUpdatesInternalWithListener(in LocationRequestInternal request, ILocationListener listener) = 51; - void requestLocationUpdatesInternalWithIntent(in LocationRequestInternal request, in PendingIntent callbackIntent) = 52; IBinder iglms54() = 53; void iglms55(String var1, in LatLngBounds var2, in AutocompleteFilter var3, in PlacesParams var4, IPlacesCallbacks var5) = 54; - void addGeofences(in GeofencingRequest geofencingRequest, in PendingIntent pendingIntent, IGeofencerCallbacks callbacks) = 56; void iglms58(in List var1, in PlacesParams var2, IPlacesCallbacks var3) = 57; } diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/internal/ISettingsCallback.aidl b/play-services-api/src/main/aidl/com/google/android/gms/location/internal/ISettingsCallback.aidl new file mode 100644 index 00000000..f1ec017e --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/location/internal/ISettingsCallback.aidl @@ -0,0 +1,5 @@ +package com.google.android.gms.location.internal; + +interface ISettingsCallback { + // TODO +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/internal/LocationRequestUpdateData.aidl b/play-services-api/src/main/aidl/com/google/android/gms/location/internal/LocationRequestUpdateData.aidl new file mode 100644 index 00000000..812f2ca5 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/location/internal/LocationRequestUpdateData.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.location.internal; + +parcelable LocationRequestUpdateData; diff --git a/play-services-api/src/main/java/com/google/android/gms/location/ActivityRecognitionResult.java b/play-services-api/src/main/java/com/google/android/gms/location/ActivityRecognitionResult.java new file mode 100644 index 00000000..497cfdb8 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/location/ActivityRecognitionResult.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.location; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class ActivityRecognitionResult extends AutoSafeParcelable { + public static final Creator CREATOR = new AutoCreator(ActivityRecognitionResult.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/location/GestureRequest.java b/play-services-api/src/main/java/com/google/android/gms/location/GestureRequest.java new file mode 100644 index 00000000..78bc5004 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/location/GestureRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.location; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class GestureRequest extends AutoSafeParcelable { + public static final Creator CREATOR = new AutoCreator(GestureRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/location/LocationAvailability.java b/play-services-api/src/main/java/com/google/android/gms/location/LocationAvailability.java new file mode 100644 index 00000000..2cba0cf6 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/location/LocationAvailability.java @@ -0,0 +1,24 @@ +/* + * Copyright 2013-2015 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.location; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class LocationAvailability extends AutoSafeParcelable { + + public static final Creator CREATOR = new AutoCreator(LocationAvailability.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/location/LocationRequest.java b/play-services-api/src/main/java/com/google/android/gms/location/LocationRequest.java index 41660fac..27907f2f 100644 --- a/play-services-api/src/main/java/com/google/android/gms/location/LocationRequest.java +++ b/play-services-api/src/main/java/com/google/android/gms/location/LocationRequest.java @@ -423,8 +423,16 @@ public class LocationRequest extends AutoSafeParcelable { @Override public String toString() { - // TODO - return super.toString(); + return "LocationRequest{" + + "priority=" + priority + + ", interval=" + interval + + ", fastestInterval=" + fastestInterval + + ", explicitFastestInterval=" + explicitFastestInterval + + ", expirationTime=" + expirationTime + + ", numUpdates=" + numUpdates + + ", smallestDesplacement=" + smallestDesplacement + + ", maxWaitTime=" + maxWaitTime + + '}'; } public static final Creator CREATOR = new AutoCreator(LocationRequest.class); diff --git a/play-services-api/src/main/java/com/google/android/gms/location/LocationResult.java b/play-services-api/src/main/java/com/google/android/gms/location/LocationResult.java new file mode 100644 index 00000000..9bfcf71c --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/location/LocationResult.java @@ -0,0 +1,45 @@ +/* + * Copyright 2013-2015 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.location; + +import android.location.Location; + +import org.microg.gms.common.PublicApi; +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +import java.util.List; + +@PublicApi +public class LocationResult extends AutoSafeParcelable { + + @SafeParceled(1000) + private int versionCode = 2; + + @SafeParceled(value = 1, subClass = Location.class) + public final List locations; + + private LocationResult(List locations) { + this.locations = locations; + } + + public static LocationResult create(List locations) { + return new LocationResult(locations); + } + + public static final Creator CREATOR = new AutoCreator(LocationResult.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/location/LocationSettingsRequest.java b/play-services-api/src/main/java/com/google/android/gms/location/LocationSettingsRequest.java new file mode 100644 index 00000000..cd52b8fa --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/location/LocationSettingsRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.location; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class LocationSettingsRequest extends AutoSafeParcelable { + public static final Creator CREATOR = new AutoCreator(LocationSettingsRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/location/internal/ClientIdentity.java b/play-services-api/src/main/java/com/google/android/gms/location/internal/ClientIdentity.java index 7c707529..8b9758a8 100644 --- a/play-services-api/src/main/java/com/google/android/gms/location/internal/ClientIdentity.java +++ b/play-services-api/src/main/java/com/google/android/gms/location/internal/ClientIdentity.java @@ -16,5 +16,8 @@ package com.google.android.gms.location.internal; -public class ClientIdentity { +import org.microg.safeparcel.AutoSafeParcelable; + +public class ClientIdentity extends AutoSafeParcelable { + public static final Creator CREATOR = new AutoCreator(ClientIdentity.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/location/internal/LocationRequestInternal.java b/play-services-api/src/main/java/com/google/android/gms/location/internal/LocationRequestInternal.java index c7eb2e15..1c9fe3d6 100644 --- a/play-services-api/src/main/java/com/google/android/gms/location/internal/LocationRequestInternal.java +++ b/play-services-api/src/main/java/com/google/android/gms/location/internal/LocationRequestInternal.java @@ -16,12 +16,51 @@ package com.google.android.gms.location.internal; -import org.microg.safeparcel.AutoSafeParcelable; +import com.google.android.gms.location.LocationRequest; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +import java.util.List; -/** - * TODO: usage - */ public class LocationRequestInternal extends AutoSafeParcelable { + @SafeParceled(1000) + private int versionCode = 1; + + @SafeParceled(1) + public LocationRequest request; + + @SafeParceled(2) + public boolean requestNlpDebugInfo; + + @SafeParceled(3) + public boolean restorePendingIntentListeners; + + @SafeParceled(4) + public boolean triggerUpdate; + + @SafeParceled(value = 5, subClass = ClientIdentity.class) + public List clients; + + @SafeParceled(6) + public String tag; + + @SafeParceled(7) + public boolean hideFromAppOps; + + @Override + public String toString() { + return "LocationRequestInternal{" + + "request=" + request + + ", requestNlpDebugInfo=" + requestNlpDebugInfo + + ", restorePendingIntentListeners=" + restorePendingIntentListeners + + ", triggerUpdate=" + triggerUpdate + + ", clients=" + clients + + ", tag='" + tag + '\'' + + ", hideFromAppOps=" + hideFromAppOps + + '}'; + } + public static final Creator CREATOR = new AutoCreator(LocationRequestInternal.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/location/internal/LocationRequestUpdateData.java b/play-services-api/src/main/java/com/google/android/gms/location/internal/LocationRequestUpdateData.java new file mode 100644 index 00000000..748f2f13 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/location/internal/LocationRequestUpdateData.java @@ -0,0 +1,62 @@ +/* + * Copyright 2013-2015 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.location.internal; + +import android.app.PendingIntent; + +import com.google.android.gms.location.ILocationCallback; +import com.google.android.gms.location.ILocationListener; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class LocationRequestUpdateData extends AutoSafeParcelable { + + public static final int REQUEST_UPDATES = 1; + public static final int REMOVE_UPDATES = 2; + + @SafeParceled(1000) + private int versionCode; + + @SafeParceled(1) + public int opCode; + + @SafeParceled(2) + public LocationRequestInternal request; + + @SafeParceled(3) + public ILocationListener listener; + + @SafeParceled(4) + public PendingIntent pendingIntent; + + @SafeParceled(5) + public ILocationCallback callback; + + @Override + public String toString() { + return "LocationRequestUpdateData{" + + "opCode=" + opCode + + ", request=" + request + + ", listener=" + listener + + ", pendingIntent=" + pendingIntent + + ", callback=" + callback + + '}'; + } + + public static final Creator CREATOR = new AutoCreator(LocationRequestUpdateData.class); +} From 5b281f81673d60b7ad0bdc88206372eddec5b329 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Sat, 3 Oct 2015 22:46:14 +0200 Subject: [PATCH 103/293] Update sublib --- extern/GmsApi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extern/GmsApi b/extern/GmsApi index bb403701..cb0458f1 160000 --- a/extern/GmsApi +++ b/extern/GmsApi @@ -1 +1 @@ -Subproject commit bb4037017c447d8129abf7c5cbaa73e527da5631 +Subproject commit cb0458f17e55e713b10fe5611890887d0c8b910e From 6f5bf2335138fda80460d906d1f2ec3d6ddfaec5 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Sun, 4 Oct 2015 04:40:58 +0200 Subject: [PATCH 104/293] Enhance Location API --- .../gms/location/LocationSettingsResult.aidl | 3 + .../IGoogleLocationManagerService.aidl | 4 +- .../location/internal/ISettingsCallback.aidl | 5 - .../location/internal/ISettingsCallbacks.aidl | 7 ++ .../gms/location/LocationSettingsRequest.java | 19 ++++ .../gms/location/LocationSettingsResult.java | 60 ++++++++++++ .../gms/location/LocationSettingsStates.java | 92 +++++++++++++++++++ 7 files changed, 183 insertions(+), 7 deletions(-) create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/location/LocationSettingsResult.aidl delete mode 100644 play-services-api/src/main/aidl/com/google/android/gms/location/internal/ISettingsCallback.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/location/internal/ISettingsCallbacks.aidl create mode 100644 play-services-api/src/main/java/com/google/android/gms/location/LocationSettingsResult.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/location/LocationSettingsStates.java diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/LocationSettingsResult.aidl b/play-services-api/src/main/aidl/com/google/android/gms/location/LocationSettingsResult.aidl new file mode 100644 index 00000000..54dad656 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/location/LocationSettingsResult.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.location; + +parcelable LocationSettingsResult; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/internal/IGoogleLocationManagerService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/location/internal/IGoogleLocationManagerService.aidl index be26aeac..40937c80 100644 --- a/play-services-api/src/main/aidl/com/google/android/gms/location/internal/IGoogleLocationManagerService.aidl +++ b/play-services-api/src/main/aidl/com/google/android/gms/location/internal/IGoogleLocationManagerService.aidl @@ -7,7 +7,7 @@ import android.os.Bundle; import com.google.android.gms.common.api.Status; import com.google.android.gms.location.places.AutocompleteFilter; import com.google.android.gms.location.places.internal.IPlacesCallbacks; -import com.google.android.gms.location.internal.ISettingsCallback; +import com.google.android.gms.location.internal.ISettingsCallbacks; import com.google.android.gms.location.internal.LocationRequestInternal; import com.google.android.gms.location.internal.LocationRequestUpdateData; import com.google.android.gms.location.places.NearbyAlertRequest; @@ -64,7 +64,7 @@ interface IGoogleLocationManagerService { LocationAvailability iglms34(String var1) = 33; IBinder iglms51() = 50; - void iglms63(in LocationSettingsRequest settingsRequest, ISettingsCallback callback, String packageName) = 62; + void requestLocationSettingsDialog(in LocationSettingsRequest settingsRequest, ISettingsCallbacks callback, String packageName) = 62; void iglms14(in LatLngBounds var1, int var2, in PlaceFilter var3, in PlacesParams var4, IPlacesCallbacks var5) = 13; void iglms15(String var1, in PlacesParams var2, IPlacesCallbacks var3) = 14; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/internal/ISettingsCallback.aidl b/play-services-api/src/main/aidl/com/google/android/gms/location/internal/ISettingsCallback.aidl deleted file mode 100644 index f1ec017e..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/location/internal/ISettingsCallback.aidl +++ /dev/null @@ -1,5 +0,0 @@ -package com.google.android.gms.location.internal; - -interface ISettingsCallback { - // TODO -} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/internal/ISettingsCallbacks.aidl b/play-services-api/src/main/aidl/com/google/android/gms/location/internal/ISettingsCallbacks.aidl new file mode 100644 index 00000000..f710d11f --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/location/internal/ISettingsCallbacks.aidl @@ -0,0 +1,7 @@ +package com.google.android.gms.location.internal; + +import com.google.android.gms.location.LocationSettingsResult; + +interface ISettingsCallbacks { + void onLocationSettingsResult(in LocationSettingsResult result); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/location/LocationSettingsRequest.java b/play-services-api/src/main/java/com/google/android/gms/location/LocationSettingsRequest.java index cd52b8fa..3d5aa5a9 100644 --- a/play-services-api/src/main/java/com/google/android/gms/location/LocationSettingsRequest.java +++ b/play-services-api/src/main/java/com/google/android/gms/location/LocationSettingsRequest.java @@ -16,8 +16,27 @@ package com.google.android.gms.location; +import org.microg.gms.common.PublicApi; import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; +import java.util.List; + +@PublicApi public class LocationSettingsRequest extends AutoSafeParcelable { + @SafeParceled(1000) + private int versionCode = 2; + + @SafeParceled(value = 1, subClass = LocationRequest.class) + @PublicApi(exclude = true) + public List requests; + + @SafeParceled(2) + @PublicApi(exclude = true) + public boolean alwaysShow; + + @PublicApi(exclude = true) + public boolean needBle; + public static final Creator CREATOR = new AutoCreator(LocationSettingsRequest.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/location/LocationSettingsResult.java b/play-services-api/src/main/java/com/google/android/gms/location/LocationSettingsResult.java new file mode 100644 index 00000000..1ca160ea --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/location/LocationSettingsResult.java @@ -0,0 +1,60 @@ +/* + * Copyright 2013-2015 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.location; + +import com.google.android.gms.common.api.Result; +import com.google.android.gms.common.api.Status; + +import org.microg.gms.common.PublicApi; +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +@PublicApi +public class LocationSettingsResult extends AutoSafeParcelable implements Result { + + @SafeParceled(1000) + private int versionCode = 1; + + @SafeParceled(1) + private Status status; + + @SafeParceled(2) + private LocationSettingsStates settings; + + + public LocationSettingsStates getLocationSettingsStates() { + return settings; + } + + @Override + public Status getStatus() { + return status; + } + + @PublicApi(exclude = true) + public LocationSettingsResult(LocationSettingsStates settings, Status status) { + this.settings = settings; + this.status = status; + } + + @PublicApi(exclude = true) + public LocationSettingsResult(Status status) { + this.status = status; + } + + public static final Creator CREATOR = new AutoCreator(LocationSettingsResult.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/location/LocationSettingsStates.java b/play-services-api/src/main/java/com/google/android/gms/location/LocationSettingsStates.java new file mode 100644 index 00000000..c11d815b --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/location/LocationSettingsStates.java @@ -0,0 +1,92 @@ +/* + * Copyright 2013-2015 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.location; + +import org.microg.gms.common.PublicApi; +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +@PublicApi +public class LocationSettingsStates extends AutoSafeParcelable { + + @SafeParceled(1000) + private int versionCode = 2; + + @SafeParceled(1) + private boolean gpsUsable; + + @SafeParceled(2) + private boolean networkLocationUsable; + + @SafeParceled(3) + private boolean bleUsable; + + @SafeParceled(4) + private boolean gpsPresent; + + @SafeParceled(5) + private boolean networkLocationPresent; + + @SafeParceled(6) + private boolean blePresent; + + public boolean isBlePresent() { + return blePresent; + } + + public boolean isBleUsable() { + return bleUsable; + } + + public boolean isGpsPresent() { + return gpsPresent; + } + + public boolean isGpsUsable() { + return gpsUsable; + } + + public boolean isLocationPresent() { + return isGpsPresent() || isNetworkLocationPresent(); + } + + public boolean isLocationUsable() { + return isGpsUsable() || isNetworkLocationUsable(); + } + + public boolean isNetworkLocationPresent() { + return networkLocationPresent; + } + + public boolean isNetworkLocationUsable() { + return networkLocationUsable; + } + + public LocationSettingsStates(boolean gpsUsable, boolean networkLocationUsable, boolean bleUsable, boolean gpsPresent, boolean networkLocationPresent, boolean blePresent) { + this.gpsUsable = gpsUsable; + this.networkLocationUsable = networkLocationUsable; + this.bleUsable = bleUsable; + this.gpsPresent = gpsPresent; + this.networkLocationPresent = networkLocationPresent; + this.blePresent = blePresent; + } + + @PublicApi(exclude = true) + + + public static final Creator CREATOR = new AutoCreator(LocationSettingsStates.class); +} From c43a964cb196f7a30888216dedcd812386c867be Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Tue, 6 Oct 2015 18:05:20 +0200 Subject: [PATCH 105/293] Add IAdvertisingIdService --- .../internal/IAdvertisingIdService.aidl | 8 + .../java/org/microg/gms/common/Services.java | 386 +++++++++--------- 2 files changed, 206 insertions(+), 188 deletions(-) create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/ads/identifier/internal/IAdvertisingIdService.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/ads/identifier/internal/IAdvertisingIdService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/ads/identifier/internal/IAdvertisingIdService.aidl new file mode 100644 index 00000000..5f4f5c1f --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/ads/identifier/internal/IAdvertisingIdService.aidl @@ -0,0 +1,8 @@ +package com.google.android.gms.ads.identifier.internal; + +interface IAdvertisingIdService { + String getAdvertisingId() = 0; + boolean isAdTrackingLimited(boolean defaultHint) = 1; + String generateAdvertisingId(String packageName) = 2; + void setAdTrackingLimited(String packageName, boolean limited) = 3; +} diff --git a/play-services-api/src/main/java/org/microg/gms/common/Services.java b/play-services-api/src/main/java/org/microg/gms/common/Services.java index 7173d02c..56a5c93e 100644 --- a/play-services-api/src/main/java/org/microg/gms/common/Services.java +++ b/play-services-api/src/main/java/org/microg/gms/common/Services.java @@ -19,325 +19,335 @@ package org.microg.gms.common; import java.lang.reflect.Field; public final class Services { - public static final class GAMES { - public static final int SERVICE_ID = 1; - public static final String ACTION = "com.google.android.gms.games.service.START"; + + private Services() { } - public static final class PLUS { - public static final int SERVICE_ID = 2; - public static final String ACTION = "com.google.android.gms.plus.service.START"; - public static final String ACTION_INTERNAL = "com.google.android.gms.plus.service.internal.START"; + public interface GAMES { + int SERVICE_ID = 1; + String ACTION = "com.google.android.gms.games.service.START"; } - public static final class PANORAMA { - public static final int SERVICE_ID = 3; - public static final String ACTION = "com.google.android.gms.panorama.service.START"; + public interface PLUS { + int SERVICE_ID = 2; + String ACTION = "com.google.android.gms.plus.service.START"; + String ACTION_INTERNAL = "com.google.android.gms.plus.service.internal.START"; } - public static final class WALLET { - public static final int SERVICE_ID = 4; - public static final String ACTION = "com.google.android.gms.wallet.service.BIND"; + public interface PANORAMA { + int SERVICE_ID = 3; + String ACTION = "com.google.android.gms.panorama.service.START"; } - public static final class PEOPLE { - public static final int SERVICE_ID = 5; - public static final String ACTION = "com.google.android.gms.people.service.START"; + public interface WALLET { + int SERVICE_ID = 4; + String ACTION = "com.google.android.gms.wallet.service.BIND"; } - public static final class LOCATION { - public static final int SERVICE_ID = 6; + public interface PEOPLE { + int SERVICE_ID = 5; + String ACTION = "com.google.android.gms.people.service.START"; } - public static final class APPSTATE { - public static final int SERVICE_ID = 7; - public static final String ACTION = "com.google.android.gms.appstate.service.START"; + public interface LOCATION { + int SERVICE_ID = 6; } - public static final class ADREQUEST { - public static final int SERVICE_ID = 8; - public static final String ACTION = "com.google.android.gms.ads.service.START"; + public interface APPSTATE { + int SERVICE_ID = 7; + String ACTION = "com.google.android.gms.appstate.service.START"; } - public static final class ACCOUNT { - public static final int SERVICE_ID = 9; - public static final String ACTION = "com.google.android.gms.accounts.ACCOUNT_SERVICE"; + public interface ADREQUEST { + int SERVICE_ID = 8; + String ACTION = "com.google.android.gms.ads.service.START"; } - public static final class CAST { - public static final int SERVICE_ID = 10; - public static final String ACTION = "com.google.android.gms.cast.service.BIND_CAST_DEVICE_CONTROLLER_SERVICE"; + public interface ACCOUNT { + int SERVICE_ID = 9; + String ACTION = "com.google.android.gms.accounts.ACCOUNT_SERVICE"; } - public static final class DRIVE { - public static final int SERVICE_ID = 11; - public static final String ACTION = "com.google.android.gms.drive.ApiService.START"; + public interface CAST { + int SERVICE_ID = 10; + String ACTION = "com.google.android.gms.cast.service.BIND_CAST_DEVICE_CONTROLLER_SERVICE"; } - public static final class ADDRESS { - public static final int SERVICE_ID = 12; - public static final String ACTION = "com.google.android.gms.identity.service.BIND"; + public interface DRIVE { + int SERVICE_ID = 11; + String ACTION = "com.google.android.gms.drive.ApiService.START"; } - public static final class CAR { - public static final int SERVICE_ID = 13; - public static final String ACTION = "com.google.android.gms.car.service.START"; + public interface ADDRESS { + int SERVICE_ID = 12; + String ACTION = "com.google.android.gms.identity.service.BIND"; } - public static final class WEARABLE { - public static final int SERVICE_ID = 14; - public static final String ACTION = "com.google.android.gms.wearable.BIND"; + public interface CAR { + int SERVICE_ID = 13; + String ACTION = "com.google.android.gms.car.service.START"; } - public static final class AUTH { - public static final int SERVICE_ID = 16; - public static final String ACTION = "com.google.android.gms.auth.service.START"; + public interface WEARABLE { + int SERVICE_ID = 14; + String ACTION = "com.google.android.gms.wearable.BIND"; } - public static final class FITNESS { - public static final int SERVICE_ID = 17; - public static final String ACTION = "com.google.android.gms.fitness.GoogleFitnessService.START"; + public interface AUTH { + int SERVICE_ID = 16; + String ACTION = "com.google.android.gms.auth.service.START"; } - public static final class REMINDERS { - public static final int SERVICE_ID = 18; - public static final String ACTION = "com.google.android.gms.reminders.service.START"; + public interface FITNESS { + int SERVICE_ID = 17; + String ACTION = "com.google.android.gms.fitness.GoogleFitnessService.START"; } - public static final class LIGHTWEIGHT_INDEX { - public static final int SERVICE_ID = 19; - public static final String ACTION = "com.google.android.gms.icing.LIGHTWEIGHT_INDEX_SERVICE"; + public interface REMINDERS { + int SERVICE_ID = 18; + String ACTION = "com.google.android.gms.reminders.service.START"; } - public static final class DEVICE_CONNECTION { - public static final int SERVICE_ID = 20; - public static final String ACTION = "com.google.android.gms.deviceconnection.service.START"; + public interface LIGHTWEIGHT_INDEX { + int SERVICE_ID = 19; + String ACTION = "com.google.android.gms.icing.LIGHTWEIGHT_INDEX_SERVICE"; } - public static final class INDEX { - public static final int SERVICE_ID = 21; - public static final String ACTION = "com.google.android.gms.icing.INDEX_SERVICE"; + public interface DEVICE_CONNECTION { + int SERVICE_ID = 20; + String ACTION = "com.google.android.gms.deviceconnection.service.START"; } - public static final class LOCATION_REPORTING { - public static final int SERVICE_ID = 22; - public static final String ACTION = "com.google.android.gms.location.reporting.service.START"; + public interface INDEX { + int SERVICE_ID = 21; + String ACTION = "com.google.android.gms.icing.INDEX_SERVICE"; } - public static final class LOCATION_MANAGER { - public static final int SERVICE_ID = 23; - public static final String ACTION = "com.google.android.location.internal.GoogleLocationManagerService.START"; + public interface LOCATION_REPORTING { + int SERVICE_ID = 22; + String ACTION = "com.google.android.gms.location.reporting.service.START"; + String ACTION_LEGACY = "com.google.android.location.reporting.service.START"; } - public static final class PLAY_LOG { - public static final int SERVICE_ID = 24; - public static final String ACTION = "com.google.android.gms.playlog.service.START"; + public interface LOCATION_MANAGER { + int SERVICE_ID = 23; + String ACTION_LEGACY = "com.google.android.location.internal.GoogleLocationManagerService.START"; } - public static final class DROIDGUARD { - public static final int SERVICE_ID = 25; - public static final String ACTION = "com.google.android.gms.droidguard.service.START"; + public interface PLAY_LOG { + int SERVICE_ID = 24; + String ACTION = "com.google.android.gms.playlog.service.START"; } - public static final class LOCKBOX { - public static final int SERVICE_ID = 26; - public static final String ACTION = "com.google.android.gms.lockbox.service.START"; + public interface DROIDGUARD { + int SERVICE_ID = 25; + String ACTION = "com.google.android.gms.droidguard.service.START"; } - public static final class CAST_MIRRORING { - public static final int SERVICE_ID = 27; - public static final String ACTION = "com.google.android.gms.cast_mirroring.service.START"; + public interface LOCKBOX { + int SERVICE_ID = 26; + String ACTION = "com.google.android.gms.lockbox.service.START"; } - public static final class NETWORK_QUALITY { - public static final int SERVICE_ID = 28; - public static final String ACTION = "com.google.android.gms.mdm.services.START"; + public interface CAST_MIRRORING { + int SERVICE_ID = 27; + String ACTION = "com.google.android.gms.cast_mirroring.service.START"; } - public static final class FEEDBACK { - public static final int SERVICE_ID = 29; - public static final String ACTION = "com.google.android.gms.feedback.internal.IFeedbackService"; + public interface NETWORK_QUALITY { + int SERVICE_ID = 28; + String ACTION = "com.google.android.gms.mdm.services.START"; } - public static final class SEARCH_ADMINISTRATION { - public static final int SERVICE_ID = 30; + public interface FEEDBACK { + int SERVICE_ID = 29; + String ACTION = "com.google.android.gms.feedback.internal.IFeedbackService"; } - public static final class PHOTO_AUTO_BACKUP { - public static final int SERVICE_ID = 31; - public static final String ACTION = "com.google.android.gms.photos.autobackup.service.START"; + public interface SEARCH_ADMINISTRATION { + int SERVICE_ID = 30; } - public static final class SEARCH_QUERIES { - public static final int SERVICE_ID = 32; + public interface PHOTO_AUTO_BACKUP { + int SERVICE_ID = 31; + String ACTION = "com.google.android.gms.photos.autobackup.service.START"; } - public static final class SEARCH_GLOBAL { - public static final int SERVICE_ID = 33; + public interface SEARCH_QUERIES { + int SERVICE_ID = 32; } - public static final class UDC { - public static final int SERVICE_ID = 35; - public static final String ACTION = "com.google.android.gms.udc.service.START"; + public interface SEARCH_GLOBAL { + int SERVICE_ID = 33; } - public static final class SEARCH_CORPORA { - public static final int SERVICE_ID = 36; + public interface UDC { + int SERVICE_ID = 35; + String ACTION = "com.google.android.gms.udc.service.START"; } - public static final class DEVICE_MANAGER { - public static final int SERVICE_ID = 37; - public static final String ACTION = "com.google.android.gms.mdm.services.DeviceManagerApiService.START"; + public interface SEARCH_CORPORA { + int SERVICE_ID = 36; } - public static final class PSEUDONYMOUS_ID { - public static final int SERVICE_ID = 38; - public static final String ACTION = "com.google.android.gms.pseudonymous.service.START"; + public interface DEVICE_MANAGER { + int SERVICE_ID = 37; + String ACTION = "com.google.android.gms.mdm.services.DeviceManagerApiService.START"; } - public static final class COMMON { - public static final int SERVICE_ID = 39; - public static final String ACTION = "com.google.android.gms.common.service.START"; + public interface PSEUDONYMOUS_ID { + int SERVICE_ID = 38; + String ACTION = "com.google.android.gms.pseudonymous.service.START"; } - public static final class CLEARCUT_LOGGER { - public static final int SERVICE_ID = 40; - public static final String ACTION = "com.google.android.gms.clearcut.service.START"; + public interface COMMON { + int SERVICE_ID = 39; + String ACTION = "com.google.android.gms.common.service.START"; } - public static final class USAGE_REPORTING { - public static final int SERVICE_ID = 41; - public static final String ACTION = "com.google.android.gms.usagereporting.service.START"; + public interface CLEARCUT_LOGGER { + int SERVICE_ID = 40; + String ACTION = "com.google.android.gms.clearcut.service.START"; } - public static final class KIDS { - public static final int SERVICE_ID = 42; - public static final String ACTION = "com.google.android.gms.kids.service.START"; + public interface USAGE_REPORTING { + int SERVICE_ID = 41; + String ACTION = "com.google.android.gms.usagereporting.service.START"; } - public static final class DOWNLOAD { - public static final int SERVICE_ID = 43; - public static final String ACTION = "com.google.android.gms.common.download.START"; + public interface KIDS { + int SERVICE_ID = 42; + String ACTION = "com.google.android.gms.kids.service.START"; } - public static final class SIGN_IN { - public static final int SERVICE_ID = 44; - public static final String ACTION = "com.google.android.gms.signin.service.START"; + public interface DOWNLOAD { + int SERVICE_ID = 43; + String ACTION = "com.google.android.gms.common.download.START"; } - public static final class SAFETY_NET_CLIENT { - public static final int SERVICE_ID = 45; - public static final String ACTION = "com.google.android.gms.safetynet.service.START"; + public interface SIGN_IN { + int SERVICE_ID = 44; + String ACTION = "com.google.android.gms.signin.service.START"; } - public static final class GSERVICES { - public static final int SERVICE_ID = 46; - public static final String ACTION = "com.google.android.gms.ads.gservice.START"; + public interface SAFETY_NET_CLIENT { + int SERVICE_ID = 45; + String ACTION = "com.google.android.gms.safetynet.service.START"; } - public static final class CONTEXT_MANAGER { - public static final int SERVICE_ID = 47; - public static final String ACTION = "com.google.android.contextmanager.service.ContextManagerService.START"; + public interface GSERVICES { + int SERVICE_ID = 46; + String ACTION = "com.google.android.gms.ads.gservice.START"; } - public static final class AUDIO_MODEM { - public static final int SERVICE_ID = 48; - public static final String ACTION = "com.google.android.gms.audiomodem.service.AudioModemService.START"; + public interface CONTEXT_MANAGER { + int SERVICE_ID = 47; + String ACTION = "com.google.android.contextmanager.service.ContextManagerService.START"; } - public static final class NEARBY_SHARING { - public static final int SERVICE_ID = 49; - public static final String ACTION = "com.google.android.gms.nearby.sharing.service.NearbySharingService.START"; + public interface AUDIO_MODEM { + int SERVICE_ID = 48; + String ACTION = "com.google.android.gms.audiomodem.service.AudioModemService.START"; } - public static final class LIGHTWEIGHT_NETWORK_QUALITY { - public static final int SERVICE_ID = 51; - public static final String ACTION = "com.google.android.gms.herrevad.services.LightweightNetworkQualityAndroidService.START"; + public interface NEARBY_SHARING { + int SERVICE_ID = 49; + String ACTION = "com.google.android.gms.nearby.sharing.service.NearbySharingService.START"; } - public static final class PHENOTYPE { - public static final int SERVICE_ID = 51; - public static final String ACTION = "com.google.android.gms.phenotype.service.START"; + public interface LIGHTWEIGHT_NETWORK_QUALITY { + int SERVICE_ID = 51; + String ACTION = "com.google.android.gms.herrevad.services.LightweightNetworkQualityAndroidService.START"; } - public static final class VOICE_UNLOCK { - public static final int SERVICE_ID = 52; - public static final String ACTION = "com.google.android.gms.speech.service.START"; + public interface PHENOTYPE { + int SERVICE_ID = 51; + String ACTION = "com.google.android.gms.phenotype.service.START"; } - public static final class NEARBY_CONNECTIONS { - public static final int SERVICE_ID = 54; - public static final String ACTION = "com.google.android.gms.nearby.connection.service.START"; + public interface VOICE_UNLOCK { + int SERVICE_ID = 52; + String ACTION = "com.google.android.gms.speech.service.START"; } - public static final class FITNESS_SENSORS { - public static final int SERVICE_ID = 55; - public static final String ACTION = "com.google.android.gms.fitness.SensorsApi"; + public interface NEARBY_CONNECTIONS { + int SERVICE_ID = 54; + String ACTION = "com.google.android.gms.nearby.connection.service.START"; } - public static final class FITNESS_RECORDING { - public static final int SERVICE_ID = 56; - public static final String ACTION = "com.google.android.gms.fitness.RecordingApi"; + public interface FITNESS_SENSORS { + int SERVICE_ID = 55; + String ACTION = "com.google.android.gms.fitness.SensorsApi"; } - public static final class FITNESS_HISTORY { - public static final int SERVICE_ID = 57; - public static final String ACTION = "com.google.android.gms.fitness.HistoryApi"; + public interface FITNESS_RECORDING { + int SERVICE_ID = 56; + String ACTION = "com.google.android.gms.fitness.RecordingApi"; } - public static final class FITNESS_SESSIONS { - public static final int SERVICE_ID = 58; - public static final String ACTION = "com.google.android.gms.fitness.SessionsApi"; + public interface FITNESS_HISTORY { + int SERVICE_ID = 57; + String ACTION = "com.google.android.gms.fitness.HistoryApi"; + } + + public interface FITNESS_SESSIONS { + int SERVICE_ID = 58; + String ACTION = "com.google.android.gms.fitness.SessionsApi"; } /** * BLE = Bluetooth Low Energy */ - public static final class FITNESS_BLE { - public static final int SERVICE_ID = 59; - public static final String ACTION = "com.google.android.gms.fitness.BleApi"; + public interface FITNESS_BLE { + int SERVICE_ID = 59; + String ACTION = "com.google.android.gms.fitness.BleApi"; } - public static final class FITNESS_CONFIG { - public static final int SERVICE_ID = 60; - public static final String ACTION = "com.google.android.gms.fitness.ConfigApi"; + public interface FITNESS_CONFIG { + int SERVICE_ID = 60; + String ACTION = "com.google.android.gms.fitness.ConfigApi"; } - public static final class FITNESS_INTERNAL { - public static final int SERVICE_ID = 61; - public static final String ACTION = "com.google.android.gms.fitness.InternalApi"; + public interface FITNESS_INTERNAL { + int SERVICE_ID = 61; + String ACTION = "com.google.android.gms.fitness.InternalApi"; } - public static final class NEARBY_MESSAGES { - public static final int SERVICE_ID = 62; - public static final String ACTION = "com.google.android.gms.nearby.messages.service.NearbyMessagesService.START"; + public interface NEARBY_MESSAGES { + int SERVICE_ID = 62; + String ACTION = "com.google.android.gms.nearby.messages.service.NearbyMessagesService.START"; } - public static final class HELP { - public static final int SERVICE_ID = 63; - public static final String ACTION = "com.google.android.gms.googlehelp.service.GoogleHelpService.START"; + public interface HELP { + int SERVICE_ID = 63; + String ACTION = "com.google.android.gms.googlehelp.service.GoogleHelpService.START"; } - public static final class CONFIG { - public static final int SERVICE_ID = 64; - public static final String ACTION = "com.google.android.gms.config.START"; + public interface CONFIG { + int SERVICE_ID = 64; + String ACTION = "com.google.android.gms.config.START"; } - public static final class GEODATA { - public static final int SERVICE_ID = 65; + public interface GEODATA { + int SERVICE_ID = 65; } - public static final class SEARCH_IME { - public static final int SERVICE_ID = 66; + public interface SEARCH_IME { + int SERVICE_ID = 66; } - public static final class PLACE_DETECTION { - public static final int SERVICE_ID = 67; + public interface PLACE_DETECTION { + int SERVICE_ID = 67; } - public static final class CREDENTIALS { - public static final int SERVICE_ID = 68; - public static final String ACTION = "com.google.android.gms.auth.api.credentials.service.START"; + public interface CREDENTIALS { + int SERVICE_ID = 68; + String ACTION = "com.google.android.gms.auth.api.credentials.service.START"; + } + + public interface ADVERTISING_ID { + // Has no service id + String ACTION = "com.google.android.gms.ads.identifier.service.START"; } public static String nameFromServiceId(int serviceId) { From 594fb004b7ceac5cf5d9f69bdc0809f3ca106fd7 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Thu, 8 Oct 2015 01:41:19 +0200 Subject: [PATCH 106/293] Small typo --- .../google/android/gms/location/LocationSettingsStates.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/play-services-api/src/main/java/com/google/android/gms/location/LocationSettingsStates.java b/play-services-api/src/main/java/com/google/android/gms/location/LocationSettingsStates.java index c11d815b..5d9305d3 100644 --- a/play-services-api/src/main/java/com/google/android/gms/location/LocationSettingsStates.java +++ b/play-services-api/src/main/java/com/google/android/gms/location/LocationSettingsStates.java @@ -85,8 +85,5 @@ public class LocationSettingsStates extends AutoSafeParcelable { this.blePresent = blePresent; } - @PublicApi(exclude = true) - - public static final Creator CREATOR = new AutoCreator(LocationSettingsStates.class); } From 90426cf2e1bfe199267377e826c1d2f060866bc6 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Fri, 9 Oct 2015 20:50:49 +0200 Subject: [PATCH 107/293] Add BinderWrapper --- .../gms/common/internal/BinderWrapper.java | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 play-services-api/src/main/java/com/google/android/gms/common/internal/BinderWrapper.java diff --git a/play-services-api/src/main/java/com/google/android/gms/common/internal/BinderWrapper.java b/play-services-api/src/main/java/com/google/android/gms/common/internal/BinderWrapper.java new file mode 100644 index 00000000..ed595f68 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/common/internal/BinderWrapper.java @@ -0,0 +1,51 @@ +/* + * Copyright 2013-2015 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.common.internal; + +import android.os.IBinder; +import android.os.Parcel; +import android.os.Parcelable; + +public class BinderWrapper implements Parcelable { + public IBinder binder; + + public BinderWrapper(IBinder binder) { + this.binder = binder; + } + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + dest.writeStrongBinder(binder); + } + + public static final Creator CREATOR = new Creator() { + @Override + public BinderWrapper createFromParcel(Parcel source) { + return new BinderWrapper(source.readStrongBinder()); + } + + @Override + public BinderWrapper[] newArray(int size) { + return new BinderWrapper[size]; + } + }; +} From d3e37f725226526438f1436119fecb61d3e2d339 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Thu, 15 Oct 2015 03:18:33 +0200 Subject: [PATCH 108/293] Add empty ClearcutLogger API --- .../gms/clearcut/LogEventParcelable.aidl | 3 +++ .../internal/IClearcutLoggerCallbacks.aidl | 7 ++++++ .../internal/IClearcutLoggerService.aidl | 8 ++++++ .../gms/clearcut/LogEventParcelable.java | 25 +++++++++++++++++++ 4 files changed, 43 insertions(+) create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/clearcut/LogEventParcelable.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/clearcut/internal/IClearcutLoggerCallbacks.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/clearcut/internal/IClearcutLoggerService.aidl create mode 100644 play-services-api/src/main/java/com/google/android/gms/clearcut/LogEventParcelable.java diff --git a/play-services-api/src/main/aidl/com/google/android/gms/clearcut/LogEventParcelable.aidl b/play-services-api/src/main/aidl/com/google/android/gms/clearcut/LogEventParcelable.aidl new file mode 100644 index 00000000..25041d4d --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/clearcut/LogEventParcelable.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.clearcut; + +parcelable LogEventParcelable; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/clearcut/internal/IClearcutLoggerCallbacks.aidl b/play-services-api/src/main/aidl/com/google/android/gms/clearcut/internal/IClearcutLoggerCallbacks.aidl new file mode 100644 index 00000000..58e796ef --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/clearcut/internal/IClearcutLoggerCallbacks.aidl @@ -0,0 +1,7 @@ +package com.google.android.gms.clearcut.internal; + +import com.google.android.gms.common.api.Status; + +interface IClearcutLoggerCallbacks { + void onStatus(in Status status) = 0; +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/clearcut/internal/IClearcutLoggerService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/clearcut/internal/IClearcutLoggerService.aidl new file mode 100644 index 00000000..b2f1b2fd --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/clearcut/internal/IClearcutLoggerService.aidl @@ -0,0 +1,8 @@ +package com.google.android.gms.clearcut.internal; + +import com.google.android.gms.clearcut.internal.IClearcutLoggerCallbacks; +import com.google.android.gms.clearcut.LogEventParcelable; + +interface IClearcutLoggerService { + void log(IClearcutLoggerCallbacks callbacks, in LogEventParcelable event) = 0; +} diff --git a/play-services-api/src/main/java/com/google/android/gms/clearcut/LogEventParcelable.java b/play-services-api/src/main/java/com/google/android/gms/clearcut/LogEventParcelable.java new file mode 100644 index 00000000..4b041a6f --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/clearcut/LogEventParcelable.java @@ -0,0 +1,25 @@ +/* + * Copyright 2013-2015 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.clearcut; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class LogEventParcelable extends AutoSafeParcelable { + // TODO + + public static final Creator CREATOR = new AutoCreator(LogEventParcelable.class); +} From d2b942d87f5b5d0547e7e5f279bcc734d69cdef4 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Fri, 16 Oct 2015 22:43:45 +0200 Subject: [PATCH 109/293] Add Drive API interfaces (does not include parcelable class implementations) --- .../internal/AddEventListenerRequest.aidl | 3 + .../drive/internal/AddPermissionRequest.aidl | 3 + .../internal/AuthorizeAccessRequest.aidl | 3 + .../internal/CancelPendingActionsRequest.aidl | 3 + .../ChangeResourceParentsRequest.aidl | 3 + .../drive/internal/ChangeSequenceNumber.aidl | 3 + .../gms/drive/internal/ChangesResponse.aidl | 3 + .../CheckResourceIdsExistRequest.aidl | 3 + ...CloseContentsAndUpdateMetadataRequest.aidl | 3 + .../drive/internal/CloseContentsRequest.aidl | 3 + .../gms/drive/internal/ContentsResponse.aidl | 3 + .../internal/ControlProgressRequest.aidl | 3 + .../drive/internal/CreateContentsRequest.aidl | 3 + .../CreateFileIntentSenderRequest.aidl | 3 + .../gms/drive/internal/CreateFileRequest.aidl | 3 + .../drive/internal/CreateFolderRequest.aidl | 3 + .../drive/internal/DeleteResourceRequest.aidl | 3 + .../DeviceUsagePreferenceResponse.aidl | 3 + .../gms/drive/internal/DisconnectRequest.aidl | 3 + .../internal/DownloadProgressResponse.aidl | 3 + .../gms/drive/internal/DriveIdResponse.aidl | 3 + .../internal/DrivePreferencesResponse.aidl | 3 + .../drive/internal/DriveServiceResponse.aidl | 3 + .../gms/drive/internal/EventResponse.aidl | 3 + .../drive/internal/FetchThumbnailRequest.aidl | 3 + .../internal/FetchThumbnailResponse.aidl | 3 + .../gms/drive/internal/GetChangesRequest.aidl | 3 + .../GetDriveIdFromUniqueIdRequest.aidl | 3 + .../drive/internal/GetMetadataRequest.aidl | 3 + .../drive/internal/GetPermissionsRequest.aidl | 3 + .../internal/GetPermissionsResponse.aidl | 3 + .../gms/drive/internal/IDriveService.aidl | 95 +++++++++++++++++++ .../internal/IDriveServiceCallbacks.aidl | 48 ++++++++++ .../gms/drive/internal/IEventCallback.aidl | 7 ++ .../gms/drive/internal/IRealtimeService.aidl | 5 + .../drive/internal/ListEntriesResponse.aidl | 3 + .../drive/internal/ListParentsRequest.aidl | 3 + .../drive/internal/ListParentsResponse.aidl | 3 + .../drive/internal/LoadRealtimeRequest.aidl | 3 + .../drive/internal/LoadRealtimeResponse.aidl | 3 + .../gms/drive/internal/MetadataResponse.aidl | 3 + .../drive/internal/OpenContentsRequest.aidl | 3 + .../internal/OpenFileIntentSenderRequest.aidl | 3 + .../internal/RealtimeDocumentSyncRequest.aidl | 3 + .../internal/RemoveEventListenerRequest.aidl | 3 + .../internal/RemovePermissionRequest.aidl | 3 + .../drive/internal/ResourceIdSetResponse.aidl | 3 + .../internal/SetDrivePreferencesRequest.aidl | 3 + .../SetFileUploadPreferencesRequest.aidl | 3 + .../internal/SetResourceParentsRequest.aidl | 3 + .../drive/internal/StartStreamSession.aidl | 3 + .../drive/internal/StreamContentsRequest.aidl | 3 + .../drive/internal/StringListResponse.aidl | 3 + .../gms/drive/internal/SyncMoreResponse.aidl | 3 + .../drive/internal/TrashResourceRequest.aidl | 3 + .../internal/UnsubscribeResourceRequest.aidl | 3 + .../internal/UntrashResourceRequest.aidl | 3 + .../drive/internal/UpdateMetadataRequest.aidl | 3 + .../internal/UpdatePermissionRequest.aidl | 3 + .../internal/AddEventListenerRequest.java | 23 +++++ .../drive/internal/AddPermissionRequest.java | 23 +++++ .../internal/AuthorizeAccessRequest.java | 23 +++++ .../internal/CancelPendingActionsRequest.java | 23 +++++ .../ChangeResourceParentsRequest.java | 23 +++++ .../drive/internal/ChangeSequenceNumber.java | 23 +++++ .../gms/drive/internal/ChangesResponse.java | 23 +++++ .../CheckResourceIdsExistRequest.java | 23 +++++ ...CloseContentsAndUpdateMetadataRequest.java | 23 +++++ .../drive/internal/CloseContentsRequest.java | 23 +++++ .../gms/drive/internal/ContentsResponse.java | 23 +++++ .../internal/ControlProgressRequest.java | 23 +++++ .../drive/internal/CreateContentsRequest.java | 23 +++++ .../CreateFileIntentSenderRequest.java | 23 +++++ .../gms/drive/internal/CreateFileRequest.java | 23 +++++ .../drive/internal/CreateFolderRequest.java | 23 +++++ .../drive/internal/DeleteResourceRequest.java | 23 +++++ .../DeviceUsagePreferenceResponse.java | 23 +++++ .../gms/drive/internal/DisconnectRequest.java | 23 +++++ .../internal/DownloadProgressResponse.java | 23 +++++ .../gms/drive/internal/DriveIdResponse.java | 23 +++++ .../internal/DrivePreferencesResponse.java | 23 +++++ .../drive/internal/DriveServiceResponse.java | 23 +++++ .../gms/drive/internal/EventResponse.java | 23 +++++ .../drive/internal/FetchThumbnailRequest.java | 23 +++++ .../internal/FetchThumbnailResponse.java | 23 +++++ .../gms/drive/internal/GetChangesRequest.java | 23 +++++ .../GetDriveIdFromUniqueIdRequest.java | 23 +++++ .../drive/internal/GetMetadataRequest.java | 23 +++++ .../drive/internal/GetPermissionsRequest.java | 23 +++++ .../internal/GetPermissionsResponse.java | 23 +++++ .../drive/internal/ListEntriesResponse.java | 23 +++++ .../drive/internal/ListParentsRequest.java | 23 +++++ .../drive/internal/ListParentsResponse.java | 23 +++++ .../drive/internal/LoadRealtimeRequest.java | 23 +++++ .../drive/internal/LoadRealtimeResponse.java | 23 +++++ .../gms/drive/internal/MetadataResponse.java | 23 +++++ .../drive/internal/OpenContentsRequest.java | 23 +++++ .../internal/OpenFileIntentSenderRequest.java | 23 +++++ .../internal/RealtimeDocumentSyncRequest.java | 23 +++++ .../internal/RemoveEventListenerRequest.java | 23 +++++ .../internal/RemovePermissionRequest.java | 23 +++++ .../drive/internal/ResourceIdSetResponse.java | 23 +++++ .../internal/SetDrivePreferencesRequest.java | 23 +++++ .../SetFileUploadPreferencesRequest.java | 23 +++++ .../internal/SetResourceParentsRequest.java | 23 +++++ .../drive/internal/StartStreamSession.java | 23 +++++ .../drive/internal/StreamContentsRequest.java | 23 +++++ .../drive/internal/StringListResponse.java | 23 +++++ .../gms/drive/internal/SyncMoreResponse.java | 23 +++++ .../drive/internal/TrashResourceRequest.java | 23 +++++ .../internal/UnsubscribeResourceRequest.java | 23 +++++ .../internal/UntrashResourceRequest.java | 23 +++++ .../drive/internal/UpdateMetadataRequest.java | 23 +++++ .../internal/UpdatePermissionRequest.java | 23 +++++ 114 files changed, 1585 insertions(+) create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/drive/internal/AddEventListenerRequest.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/drive/internal/AddPermissionRequest.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/drive/internal/AuthorizeAccessRequest.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/drive/internal/CancelPendingActionsRequest.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ChangeResourceParentsRequest.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ChangeSequenceNumber.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ChangesResponse.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/drive/internal/CheckResourceIdsExistRequest.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/drive/internal/CloseContentsAndUpdateMetadataRequest.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/drive/internal/CloseContentsRequest.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ContentsResponse.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ControlProgressRequest.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/drive/internal/CreateContentsRequest.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/drive/internal/CreateFileIntentSenderRequest.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/drive/internal/CreateFileRequest.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/drive/internal/CreateFolderRequest.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/drive/internal/DeleteResourceRequest.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/drive/internal/DeviceUsagePreferenceResponse.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/drive/internal/DisconnectRequest.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/drive/internal/DownloadProgressResponse.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/drive/internal/DriveIdResponse.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/drive/internal/DrivePreferencesResponse.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/drive/internal/DriveServiceResponse.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/drive/internal/EventResponse.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/drive/internal/FetchThumbnailRequest.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/drive/internal/FetchThumbnailResponse.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/drive/internal/GetChangesRequest.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/drive/internal/GetDriveIdFromUniqueIdRequest.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/drive/internal/GetMetadataRequest.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/drive/internal/GetPermissionsRequest.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/drive/internal/GetPermissionsResponse.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/drive/internal/IDriveService.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/drive/internal/IDriveServiceCallbacks.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/drive/internal/IEventCallback.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/drive/internal/IRealtimeService.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ListEntriesResponse.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ListParentsRequest.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ListParentsResponse.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/drive/internal/LoadRealtimeRequest.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/drive/internal/LoadRealtimeResponse.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/drive/internal/MetadataResponse.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/drive/internal/OpenContentsRequest.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/drive/internal/OpenFileIntentSenderRequest.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/drive/internal/RealtimeDocumentSyncRequest.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/drive/internal/RemoveEventListenerRequest.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/drive/internal/RemovePermissionRequest.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ResourceIdSetResponse.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/drive/internal/SetDrivePreferencesRequest.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/drive/internal/SetFileUploadPreferencesRequest.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/drive/internal/SetResourceParentsRequest.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/drive/internal/StartStreamSession.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/drive/internal/StreamContentsRequest.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/drive/internal/StringListResponse.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/drive/internal/SyncMoreResponse.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/drive/internal/TrashResourceRequest.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/drive/internal/UnsubscribeResourceRequest.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/drive/internal/UntrashResourceRequest.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/drive/internal/UpdateMetadataRequest.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/drive/internal/UpdatePermissionRequest.aidl create mode 100644 play-services-api/src/main/java/com/google/android/gms/drive/internal/AddEventListenerRequest.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/drive/internal/AddPermissionRequest.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/drive/internal/AuthorizeAccessRequest.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/drive/internal/CancelPendingActionsRequest.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/drive/internal/ChangeResourceParentsRequest.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/drive/internal/ChangeSequenceNumber.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/drive/internal/ChangesResponse.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/drive/internal/CheckResourceIdsExistRequest.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/drive/internal/CloseContentsAndUpdateMetadataRequest.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/drive/internal/CloseContentsRequest.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/drive/internal/ContentsResponse.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/drive/internal/ControlProgressRequest.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/drive/internal/CreateContentsRequest.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/drive/internal/CreateFileIntentSenderRequest.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/drive/internal/CreateFileRequest.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/drive/internal/CreateFolderRequest.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/drive/internal/DeleteResourceRequest.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/drive/internal/DeviceUsagePreferenceResponse.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/drive/internal/DisconnectRequest.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/drive/internal/DownloadProgressResponse.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/drive/internal/DriveIdResponse.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/drive/internal/DrivePreferencesResponse.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/drive/internal/DriveServiceResponse.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/drive/internal/EventResponse.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/drive/internal/FetchThumbnailRequest.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/drive/internal/FetchThumbnailResponse.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/drive/internal/GetChangesRequest.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/drive/internal/GetDriveIdFromUniqueIdRequest.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/drive/internal/GetMetadataRequest.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/drive/internal/GetPermissionsRequest.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/drive/internal/GetPermissionsResponse.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/drive/internal/ListEntriesResponse.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/drive/internal/ListParentsRequest.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/drive/internal/ListParentsResponse.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/drive/internal/LoadRealtimeRequest.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/drive/internal/LoadRealtimeResponse.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/drive/internal/MetadataResponse.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/drive/internal/OpenContentsRequest.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/drive/internal/OpenFileIntentSenderRequest.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/drive/internal/RealtimeDocumentSyncRequest.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/drive/internal/RemoveEventListenerRequest.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/drive/internal/RemovePermissionRequest.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/drive/internal/ResourceIdSetResponse.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/drive/internal/SetDrivePreferencesRequest.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/drive/internal/SetFileUploadPreferencesRequest.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/drive/internal/SetResourceParentsRequest.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/drive/internal/StartStreamSession.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/drive/internal/StreamContentsRequest.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/drive/internal/StringListResponse.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/drive/internal/SyncMoreResponse.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/drive/internal/TrashResourceRequest.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/drive/internal/UnsubscribeResourceRequest.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/drive/internal/UntrashResourceRequest.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/drive/internal/UpdateMetadataRequest.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/drive/internal/UpdatePermissionRequest.java diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/AddEventListenerRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/AddEventListenerRequest.aidl new file mode 100644 index 00000000..843b1e0a --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/AddEventListenerRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable AddEventListenerRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/AddPermissionRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/AddPermissionRequest.aidl new file mode 100644 index 00000000..ba0f503d --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/AddPermissionRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable AddPermissionRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/AuthorizeAccessRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/AuthorizeAccessRequest.aidl new file mode 100644 index 00000000..70c19305 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/AuthorizeAccessRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable AuthorizeAccessRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/CancelPendingActionsRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/CancelPendingActionsRequest.aidl new file mode 100644 index 00000000..30696de0 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/CancelPendingActionsRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable CancelPendingActionsRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ChangeResourceParentsRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ChangeResourceParentsRequest.aidl new file mode 100644 index 00000000..dfd43f74 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ChangeResourceParentsRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable ChangeResourceParentsRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ChangeSequenceNumber.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ChangeSequenceNumber.aidl new file mode 100644 index 00000000..05f32cb3 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ChangeSequenceNumber.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable ChangeSequenceNumber; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ChangesResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ChangesResponse.aidl new file mode 100644 index 00000000..b4107a0e --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ChangesResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable ChangesResponse; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/CheckResourceIdsExistRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/CheckResourceIdsExistRequest.aidl new file mode 100644 index 00000000..eb7001c0 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/CheckResourceIdsExistRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable CheckResourceIdsExistRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/CloseContentsAndUpdateMetadataRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/CloseContentsAndUpdateMetadataRequest.aidl new file mode 100644 index 00000000..b513f449 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/CloseContentsAndUpdateMetadataRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable CloseContentsAndUpdateMetadataRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/CloseContentsRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/CloseContentsRequest.aidl new file mode 100644 index 00000000..43536051 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/CloseContentsRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable CloseContentsRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ContentsResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ContentsResponse.aidl new file mode 100644 index 00000000..bf226dc0 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ContentsResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable ContentsResponse; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ControlProgressRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ControlProgressRequest.aidl new file mode 100644 index 00000000..7e330658 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ControlProgressRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable ControlProgressRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/CreateContentsRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/CreateContentsRequest.aidl new file mode 100644 index 00000000..7c7452f7 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/CreateContentsRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable CreateContentsRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/CreateFileIntentSenderRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/CreateFileIntentSenderRequest.aidl new file mode 100644 index 00000000..300d82c6 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/CreateFileIntentSenderRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable CreateFileIntentSenderRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/CreateFileRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/CreateFileRequest.aidl new file mode 100644 index 00000000..be852bc5 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/CreateFileRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable CreateFileRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/CreateFolderRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/CreateFolderRequest.aidl new file mode 100644 index 00000000..a1b7c8f2 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/CreateFolderRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable CreateFolderRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/DeleteResourceRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/DeleteResourceRequest.aidl new file mode 100644 index 00000000..c8bbef83 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/DeleteResourceRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable DeleteResourceRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/DeviceUsagePreferenceResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/DeviceUsagePreferenceResponse.aidl new file mode 100644 index 00000000..1b85028b --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/DeviceUsagePreferenceResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable DeviceUsagePreferenceResponse; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/DisconnectRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/DisconnectRequest.aidl new file mode 100644 index 00000000..22cf3ad1 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/DisconnectRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable DisconnectRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/DownloadProgressResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/DownloadProgressResponse.aidl new file mode 100644 index 00000000..d3ead69d --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/DownloadProgressResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable DownloadProgressResponse; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/DriveIdResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/DriveIdResponse.aidl new file mode 100644 index 00000000..4655cb3f --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/DriveIdResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable DriveIdResponse; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/DrivePreferencesResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/DrivePreferencesResponse.aidl new file mode 100644 index 00000000..e14152f2 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/DrivePreferencesResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable DrivePreferencesResponse; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/DriveServiceResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/DriveServiceResponse.aidl new file mode 100644 index 00000000..424c2cac --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/DriveServiceResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable DriveServiceResponse; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/EventResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/EventResponse.aidl new file mode 100644 index 00000000..0f748bb9 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/EventResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable EventResponse; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/FetchThumbnailRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/FetchThumbnailRequest.aidl new file mode 100644 index 00000000..06b38bd8 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/FetchThumbnailRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable FetchThumbnailRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/FetchThumbnailResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/FetchThumbnailResponse.aidl new file mode 100644 index 00000000..022ffda3 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/FetchThumbnailResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable FetchThumbnailResponse; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/GetChangesRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/GetChangesRequest.aidl new file mode 100644 index 00000000..8992b053 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/GetChangesRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable GetChangesRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/GetDriveIdFromUniqueIdRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/GetDriveIdFromUniqueIdRequest.aidl new file mode 100644 index 00000000..821aefb5 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/GetDriveIdFromUniqueIdRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable GetDriveIdFromUniqueIdRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/GetMetadataRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/GetMetadataRequest.aidl new file mode 100644 index 00000000..9d1a31b9 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/GetMetadataRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable GetMetadataRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/GetPermissionsRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/GetPermissionsRequest.aidl new file mode 100644 index 00000000..ae706840 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/GetPermissionsRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable GetPermissionsRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/GetPermissionsResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/GetPermissionsResponse.aidl new file mode 100644 index 00000000..845d8325 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/GetPermissionsResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable GetPermissionsResponse; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/IDriveService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/IDriveService.aidl new file mode 100644 index 00000000..a1e2e085 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/IDriveService.aidl @@ -0,0 +1,95 @@ +package com.google.android.gms.drive.internal; + +import com.google.android.gms.drive.internal.DriveServiceResponse; +import com.google.android.gms.drive.internal.IDriveServiceCallbacks; +import com.google.android.gms.drive.internal.IEventCallback; + +import com.google.android.gms.drive.internal.AddEventListenerRequest; +import com.google.android.gms.drive.internal.AddPermissionRequest; +import com.google.android.gms.drive.internal.AuthorizeAccessRequest; +import com.google.android.gms.drive.internal.CancelPendingActionsRequest; +import com.google.android.gms.drive.internal.ChangeResourceParentsRequest; +import com.google.android.gms.drive.internal.CheckResourceIdsExistRequest; +import com.google.android.gms.drive.internal.CloseContentsAndUpdateMetadataRequest; +import com.google.android.gms.drive.internal.CloseContentsRequest; +import com.google.android.gms.drive.internal.ControlProgressRequest; +import com.google.android.gms.drive.internal.CreateContentsRequest; +import com.google.android.gms.drive.internal.CreateFileRequest; +import com.google.android.gms.drive.internal.CreateFileIntentSenderRequest; +import com.google.android.gms.drive.internal.CreateFolderRequest; +import com.google.android.gms.drive.internal.DeleteResourceRequest; +import com.google.android.gms.drive.internal.DisconnectRequest; +import com.google.android.gms.drive.internal.FetchThumbnailRequest; +import com.google.android.gms.drive.internal.GetChangesRequest; +import com.google.android.gms.drive.internal.GetDriveIdFromUniqueIdRequest; +import com.google.android.gms.drive.internal.GetMetadataRequest; +import com.google.android.gms.drive.internal.GetPermissionsRequest; +import com.google.android.gms.drive.internal.ListParentsRequest; +import com.google.android.gms.drive.internal.LoadRealtimeRequest; +import com.google.android.gms.drive.internal.OpenContentsRequest; +import com.google.android.gms.drive.internal.OpenFileIntentSenderRequest; +import com.google.android.gms.drive.internal.RealtimeDocumentSyncRequest; +import com.google.android.gms.drive.internal.RemoveEventListenerRequest; +import com.google.android.gms.drive.internal.RemovePermissionRequest; +import com.google.android.gms.drive.internal.SetDrivePreferencesRequest; +import com.google.android.gms.drive.internal.SetFileUploadPreferencesRequest; +import com.google.android.gms.drive.internal.SetResourceParentsRequest; +import com.google.android.gms.drive.internal.StreamContentsRequest; +import com.google.android.gms.drive.internal.TrashResourceRequest; +import com.google.android.gms.drive.internal.UnsubscribeResourceRequest; +import com.google.android.gms.drive.internal.UntrashResourceRequest; +import com.google.android.gms.drive.internal.UpdateMetadataRequest; +import com.google.android.gms.drive.internal.UpdatePermissionRequest; + +interface IDriveService { + void getMetadata(in GetMetadataRequest request, IDriveServiceCallbacks callbacks) = 0; + + void updateMetadata(in UpdateMetadataRequest request, IDriveServiceCallbacks callbacks) = 2; + void createContents(in CreateContentsRequest request, IDriveServiceCallbacks callbacks) = 3; + void createFile(in CreateFileRequest request, IDriveServiceCallbacks callbacks) = 4; + void createFolder(in CreateFolderRequest request, IDriveServiceCallbacks callbacks) = 5; + DriveServiceResponse openContents(in OpenContentsRequest request, IDriveServiceCallbacks callbacks) = 6; + void closeContents(in CloseContentsRequest request, IDriveServiceCallbacks callbacks) = 7; + void requestSync(IDriveServiceCallbacks callbacks) = 8; + IntentSender openFileIntentSender(in OpenFileIntentSenderRequest request) = 9; + IntentSender createFileIntentSender(in CreateFileIntentSenderRequest request) = 10; + void authorizeAccess(in AuthorizeAccessRequest request, IDriveServiceCallbacks callbacks) = 11; + void listParents(in ListParentsRequest request, IDriveServiceCallbacks callbacks) = 12; + void addEventListener(in AddEventListenerRequest request, IEventCallback callback, String unused, IDriveServiceCallbacks callbacks) = 13; + void removeEventListener(in RemoveEventListenerRequest request, IEventCallback callback, String unused, IDriveServiceCallbacks callbacks) = 14; + void disconnect(in DisconnectRequest request) = 15; + void trashResource(in TrashResourceRequest request, IDriveServiceCallbacks callbacks) = 16; + void closeContentsAndUpdateMetadata(in CloseContentsAndUpdateMetadataRequest request, IDriveServiceCallbacks callbacks) = 17; + + void deleteResource(in DeleteResourceRequest request, IDriveServiceCallbacks callbacks) = 23; + + void loadRealtime(in LoadRealtimeRequest request, IDriveServiceCallbacks callbacks) = 26; + void setResourceParents(in SetResourceParentsRequest request, IDriveServiceCallbacks callbacks) = 27; + void getDriveIdFromUniqueId(in GetDriveIdFromUniqueIdRequest request, IDriveServiceCallbacks callbacks) = 28; + void checkResourceIdsExist(in CheckResourceIdsExistRequest request, IDriveServiceCallbacks callbacks) = 29; + void completePendingAction(IDriveServiceCallbacks callbacks) = 30; + void getDrivePreferences(IDriveServiceCallbacks callbacks) = 31; + void setDrivePreferences(in SetDrivePreferencesRequest request, IDriveServiceCallbacks callbacks) = 32; + void realtimeDocumentSync(in RealtimeDocumentSyncRequest request, IDriveServiceCallbacks callbacks) = 33; + void getDeviceUsagePreferences(IDriveServiceCallbacks callbacks) = 34; + void setFileUploadPreferences(in SetFileUploadPreferencesRequest request, IDriveServiceCallbacks callbacks) = 35; + void cancelPendingActions(in CancelPendingActionsRequest request, IDriveServiceCallbacks callbacks) = 36; + void untrashResource(in UntrashResourceRequest request, IDriveServiceCallbacks callbacks) = 37; + + void isAutoBackupEnabled(IDriveServiceCallbacks callbacks) = 40; + void fetchThumbnail(in FetchThumbnailRequest request, IDriveServiceCallbacks callbacks) = 41; + + void getChanges(in GetChangesRequest request, IDriveServiceCallbacks callbacks) = 43; + + void unsubscribeResource(in UnsubscribeResourceRequest request, IDriveServiceCallbacks callbacks) = 45; + void getPermissions(in GetPermissionsRequest request, IDriveServiceCallbacks callbacks) = 46; + void addPermission(in AddPermissionRequest request, IDriveServiceCallbacks callbacks) = 47; + void updatePermission(in UpdatePermissionRequest request, IDriveServiceCallbacks callbacks) = 48; + void removePermission(in RemovePermissionRequest request, IDriveServiceCallbacks callbacks) = 49; + + void removeQueryResultListener(IEventCallback callback, IDriveServiceCallbacks callbacks) = 51; + void controlProgress(in ControlProgressRequest request, IDriveServiceCallbacks callbacks) = 52; + + void changeResourceParents(in ChangeResourceParentsRequest request, IDriveServiceCallbacks callbacks) = 54; + DriveServiceResponse streamContents(in StreamContentsRequest request, IDriveServiceCallbacks callbacks) = 55; +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/IDriveServiceCallbacks.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/IDriveServiceCallbacks.aidl new file mode 100644 index 00000000..6fa1b204 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/IDriveServiceCallbacks.aidl @@ -0,0 +1,48 @@ +package com.google.android.gms.drive.internal; + +import com.google.android.gms.drive.internal.IRealtimeService; + +import com.google.android.gms.drive.internal.DownloadProgressResponse; +import com.google.android.gms.drive.internal.ListEntriesResponse; +import com.google.android.gms.drive.internal.DriveIdResponse; +import com.google.android.gms.drive.internal.MetadataResponse; +import com.google.android.gms.drive.internal.ContentsResponse; +import com.google.android.gms.drive.internal.ListParentsResponse; +import com.google.android.gms.drive.internal.SyncMoreResponse; +import com.google.android.gms.drive.internal.LoadRealtimeResponse; +import com.google.android.gms.drive.internal.ResourceIdSetResponse; +import com.google.android.gms.drive.internal.DrivePreferencesResponse; +import com.google.android.gms.drive.internal.DeviceUsagePreferenceResponse; +import com.google.android.gms.drive.internal.FetchThumbnailResponse; +import com.google.android.gms.drive.internal.ChangeSequenceNumber; +import com.google.android.gms.drive.internal.ChangesResponse; +import com.google.android.gms.drive.internal.GetPermissionsResponse; +import com.google.android.gms.drive.internal.StringListResponse; +import com.google.android.gms.drive.internal.StartStreamSession; + +import com.google.android.gms.common.api.Status; + +interface IDriveServiceCallbacks { + void onDownloadProgress(in DownloadProgressResponse response) = 0; + void onListEntries(in ListEntriesResponse response) = 1; + void onDriveId(in DriveIdResponse response) = 2; + void onMetadata(in MetadataResponse response) = 3; + void onContents(in ContentsResponse response) = 4; + void onStatus(in Status status) = 5; + void onSuccess() = 6; + void onListParents(in ListParentsResponse response) = 7; + void onSyncMore(in SyncMoreResponse response) = 8; + + void onLoadRealtime(in LoadRealtimeResponse response, IRealtimeService realtimeService) = 10; + void onResourceIdSet(in ResourceIdSetResponse response) = 11; + void onDrivePreferences(in DrivePreferencesResponse response) = 12; + void onDeviceUsagePreference(in DeviceUsagePreferenceResponse response) = 13; + void onBooleanAnswer(boolean bool) = 14; + void onFetchThumbnail(in FetchThumbnailResponse response) = 15; + void onChangeSequenceNumber(in ChangeSequenceNumber csn) = 16; + void onChanges(in ChangesResponse response) = 17; + + void onGetPermissions(in GetPermissionsResponse response) = 19; + void onStringList(in StringListResponse response) = 20; + void onStartStreamSession(in StartStreamSession response) = 21; +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/IEventCallback.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/IEventCallback.aidl new file mode 100644 index 00000000..e50999f1 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/IEventCallback.aidl @@ -0,0 +1,7 @@ +package com.google.android.gms.drive.internal; + +import com.google.android.gms.drive.internal.EventResponse; + +interface IEventCallback { + void onEventResponse(in EventResponse response) = 0; +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/IRealtimeService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/IRealtimeService.aidl new file mode 100644 index 00000000..14d7cf86 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/IRealtimeService.aidl @@ -0,0 +1,5 @@ +package com.google.android.gms.drive.internal; + +interface IRealtimeService { + // TODO +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ListEntriesResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ListEntriesResponse.aidl new file mode 100644 index 00000000..9a3c5ac9 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ListEntriesResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable ListEntriesResponse; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ListParentsRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ListParentsRequest.aidl new file mode 100644 index 00000000..b2271a98 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ListParentsRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable ListParentsRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ListParentsResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ListParentsResponse.aidl new file mode 100644 index 00000000..04ebc591 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ListParentsResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable ListParentsResponse; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/LoadRealtimeRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/LoadRealtimeRequest.aidl new file mode 100644 index 00000000..b3b80b5d --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/LoadRealtimeRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable LoadRealtimeRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/LoadRealtimeResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/LoadRealtimeResponse.aidl new file mode 100644 index 00000000..3ebc2672 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/LoadRealtimeResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable LoadRealtimeResponse; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/MetadataResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/MetadataResponse.aidl new file mode 100644 index 00000000..4bfd6f88 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/MetadataResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable MetadataResponse; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/OpenContentsRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/OpenContentsRequest.aidl new file mode 100644 index 00000000..4fc8534f --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/OpenContentsRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable OpenContentsRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/OpenFileIntentSenderRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/OpenFileIntentSenderRequest.aidl new file mode 100644 index 00000000..836ba532 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/OpenFileIntentSenderRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable OpenFileIntentSenderRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/RealtimeDocumentSyncRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/RealtimeDocumentSyncRequest.aidl new file mode 100644 index 00000000..c922b2da --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/RealtimeDocumentSyncRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable RealtimeDocumentSyncRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/RemoveEventListenerRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/RemoveEventListenerRequest.aidl new file mode 100644 index 00000000..e613b2e2 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/RemoveEventListenerRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable RemoveEventListenerRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/RemovePermissionRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/RemovePermissionRequest.aidl new file mode 100644 index 00000000..5d2838c7 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/RemovePermissionRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable RemovePermissionRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ResourceIdSetResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ResourceIdSetResponse.aidl new file mode 100644 index 00000000..64cd51fe --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ResourceIdSetResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable ResourceIdSetResponse; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/SetDrivePreferencesRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/SetDrivePreferencesRequest.aidl new file mode 100644 index 00000000..76702969 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/SetDrivePreferencesRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable SetDrivePreferencesRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/SetFileUploadPreferencesRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/SetFileUploadPreferencesRequest.aidl new file mode 100644 index 00000000..0ceffc62 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/SetFileUploadPreferencesRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable SetFileUploadPreferencesRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/SetResourceParentsRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/SetResourceParentsRequest.aidl new file mode 100644 index 00000000..43b9c116 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/SetResourceParentsRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable SetResourceParentsRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/StartStreamSession.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/StartStreamSession.aidl new file mode 100644 index 00000000..538c61e4 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/StartStreamSession.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable StartStreamSession; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/StreamContentsRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/StreamContentsRequest.aidl new file mode 100644 index 00000000..2f20b495 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/StreamContentsRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable StreamContentsRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/StringListResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/StringListResponse.aidl new file mode 100644 index 00000000..9099c4b6 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/StringListResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable StringListResponse; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/SyncMoreResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/SyncMoreResponse.aidl new file mode 100644 index 00000000..ed495944 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/SyncMoreResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable SyncMoreResponse; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/TrashResourceRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/TrashResourceRequest.aidl new file mode 100644 index 00000000..42480778 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/TrashResourceRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable TrashResourceRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/UnsubscribeResourceRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/UnsubscribeResourceRequest.aidl new file mode 100644 index 00000000..a7fe04bc --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/UnsubscribeResourceRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable UnsubscribeResourceRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/UntrashResourceRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/UntrashResourceRequest.aidl new file mode 100644 index 00000000..74fe7d32 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/UntrashResourceRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable UntrashResourceRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/UpdateMetadataRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/UpdateMetadataRequest.aidl new file mode 100644 index 00000000..98f7d547 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/UpdateMetadataRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable UpdateMetadataRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/UpdatePermissionRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/UpdatePermissionRequest.aidl new file mode 100644 index 00000000..a866defd --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/UpdatePermissionRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable UpdatePermissionRequest; diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/AddEventListenerRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/AddEventListenerRequest.java new file mode 100644 index 00000000..62bed341 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/AddEventListenerRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class AddEventListenerRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(AddEventListenerRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/AddPermissionRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/AddPermissionRequest.java new file mode 100644 index 00000000..91f4dc3e --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/AddPermissionRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class AddPermissionRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(AddPermissionRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/AuthorizeAccessRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/AuthorizeAccessRequest.java new file mode 100644 index 00000000..3a6dfef0 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/AuthorizeAccessRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class AuthorizeAccessRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(AuthorizeAccessRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/CancelPendingActionsRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/CancelPendingActionsRequest.java new file mode 100644 index 00000000..a60d434c --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/CancelPendingActionsRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class CancelPendingActionsRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(CancelPendingActionsRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/ChangeResourceParentsRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/ChangeResourceParentsRequest.java new file mode 100644 index 00000000..99de29f5 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/ChangeResourceParentsRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class ChangeResourceParentsRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(ChangeResourceParentsRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/ChangeSequenceNumber.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/ChangeSequenceNumber.java new file mode 100644 index 00000000..e4ec5399 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/ChangeSequenceNumber.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class ChangeSequenceNumber extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(ChangeSequenceNumber.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/ChangesResponse.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/ChangesResponse.java new file mode 100644 index 00000000..43fb6a56 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/ChangesResponse.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class ChangesResponse extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(ChangesResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/CheckResourceIdsExistRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/CheckResourceIdsExistRequest.java new file mode 100644 index 00000000..bb8ca1ad --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/CheckResourceIdsExistRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class CheckResourceIdsExistRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(CheckResourceIdsExistRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/CloseContentsAndUpdateMetadataRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/CloseContentsAndUpdateMetadataRequest.java new file mode 100644 index 00000000..20828d03 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/CloseContentsAndUpdateMetadataRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class CloseContentsAndUpdateMetadataRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(CloseContentsAndUpdateMetadataRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/CloseContentsRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/CloseContentsRequest.java new file mode 100644 index 00000000..1bca0dd2 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/CloseContentsRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class CloseContentsRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(CloseContentsRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/ContentsResponse.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/ContentsResponse.java new file mode 100644 index 00000000..105d262b --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/ContentsResponse.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class ContentsResponse extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(ContentsResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/ControlProgressRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/ControlProgressRequest.java new file mode 100644 index 00000000..e9eabf09 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/ControlProgressRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class ControlProgressRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(ControlProgressRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/CreateContentsRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/CreateContentsRequest.java new file mode 100644 index 00000000..026610c5 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/CreateContentsRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class CreateContentsRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(CreateContentsRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/CreateFileIntentSenderRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/CreateFileIntentSenderRequest.java new file mode 100644 index 00000000..4520ce6b --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/CreateFileIntentSenderRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class CreateFileIntentSenderRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(CreateFileIntentSenderRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/CreateFileRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/CreateFileRequest.java new file mode 100644 index 00000000..c557df08 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/CreateFileRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class CreateFileRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(CreateFileRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/CreateFolderRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/CreateFolderRequest.java new file mode 100644 index 00000000..7f35ff4e --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/CreateFolderRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class CreateFolderRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(CreateFolderRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/DeleteResourceRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/DeleteResourceRequest.java new file mode 100644 index 00000000..c8e55638 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/DeleteResourceRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class DeleteResourceRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(DeleteResourceRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/DeviceUsagePreferenceResponse.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/DeviceUsagePreferenceResponse.java new file mode 100644 index 00000000..49fd3c50 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/DeviceUsagePreferenceResponse.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class DeviceUsagePreferenceResponse extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(DeviceUsagePreferenceResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/DisconnectRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/DisconnectRequest.java new file mode 100644 index 00000000..6cd1d560 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/DisconnectRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class DisconnectRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(DisconnectRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/DownloadProgressResponse.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/DownloadProgressResponse.java new file mode 100644 index 00000000..1d1c6e24 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/DownloadProgressResponse.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class DownloadProgressResponse extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(DownloadProgressResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/DriveIdResponse.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/DriveIdResponse.java new file mode 100644 index 00000000..abd3a7bd --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/DriveIdResponse.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class DriveIdResponse extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(DriveIdResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/DrivePreferencesResponse.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/DrivePreferencesResponse.java new file mode 100644 index 00000000..1710ba33 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/DrivePreferencesResponse.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class DrivePreferencesResponse extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(DrivePreferencesResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/DriveServiceResponse.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/DriveServiceResponse.java new file mode 100644 index 00000000..d00412f0 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/DriveServiceResponse.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class DriveServiceResponse extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(DriveServiceResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/EventResponse.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/EventResponse.java new file mode 100644 index 00000000..5c68df89 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/EventResponse.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class EventResponse extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(EventResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/FetchThumbnailRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/FetchThumbnailRequest.java new file mode 100644 index 00000000..81b8f181 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/FetchThumbnailRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class FetchThumbnailRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(FetchThumbnailRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/FetchThumbnailResponse.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/FetchThumbnailResponse.java new file mode 100644 index 00000000..9a4d00a6 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/FetchThumbnailResponse.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class FetchThumbnailResponse extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(FetchThumbnailResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/GetChangesRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/GetChangesRequest.java new file mode 100644 index 00000000..4f692149 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/GetChangesRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class GetChangesRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(GetChangesRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/GetDriveIdFromUniqueIdRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/GetDriveIdFromUniqueIdRequest.java new file mode 100644 index 00000000..c2ddb451 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/GetDriveIdFromUniqueIdRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class GetDriveIdFromUniqueIdRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(GetDriveIdFromUniqueIdRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/GetMetadataRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/GetMetadataRequest.java new file mode 100644 index 00000000..e3e7f52a --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/GetMetadataRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class GetMetadataRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(GetMetadataRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/GetPermissionsRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/GetPermissionsRequest.java new file mode 100644 index 00000000..cda94d3b --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/GetPermissionsRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class GetPermissionsRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(GetPermissionsRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/GetPermissionsResponse.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/GetPermissionsResponse.java new file mode 100644 index 00000000..b2b97863 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/GetPermissionsResponse.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class GetPermissionsResponse extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(GetPermissionsResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/ListEntriesResponse.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/ListEntriesResponse.java new file mode 100644 index 00000000..2d8c2c5b --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/ListEntriesResponse.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class ListEntriesResponse extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(ListEntriesResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/ListParentsRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/ListParentsRequest.java new file mode 100644 index 00000000..30b54929 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/ListParentsRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class ListParentsRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(ListParentsRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/ListParentsResponse.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/ListParentsResponse.java new file mode 100644 index 00000000..dfec2b1d --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/ListParentsResponse.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class ListParentsResponse extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(ListParentsResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/LoadRealtimeRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/LoadRealtimeRequest.java new file mode 100644 index 00000000..3c56ebb6 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/LoadRealtimeRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class LoadRealtimeRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(LoadRealtimeRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/LoadRealtimeResponse.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/LoadRealtimeResponse.java new file mode 100644 index 00000000..ff138d00 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/LoadRealtimeResponse.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class LoadRealtimeResponse extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(LoadRealtimeResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/MetadataResponse.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/MetadataResponse.java new file mode 100644 index 00000000..613fd377 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/MetadataResponse.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class MetadataResponse extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(MetadataResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/OpenContentsRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/OpenContentsRequest.java new file mode 100644 index 00000000..6466a18b --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/OpenContentsRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class OpenContentsRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(OpenContentsRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/OpenFileIntentSenderRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/OpenFileIntentSenderRequest.java new file mode 100644 index 00000000..ae3afff0 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/OpenFileIntentSenderRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class OpenFileIntentSenderRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(OpenFileIntentSenderRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/RealtimeDocumentSyncRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/RealtimeDocumentSyncRequest.java new file mode 100644 index 00000000..17dcf724 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/RealtimeDocumentSyncRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class RealtimeDocumentSyncRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(RealtimeDocumentSyncRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/RemoveEventListenerRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/RemoveEventListenerRequest.java new file mode 100644 index 00000000..bee30f46 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/RemoveEventListenerRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class RemoveEventListenerRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(RemoveEventListenerRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/RemovePermissionRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/RemovePermissionRequest.java new file mode 100644 index 00000000..51aa124d --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/RemovePermissionRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class RemovePermissionRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(RemovePermissionRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/ResourceIdSetResponse.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/ResourceIdSetResponse.java new file mode 100644 index 00000000..e6b91a23 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/ResourceIdSetResponse.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class ResourceIdSetResponse extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(ResourceIdSetResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/SetDrivePreferencesRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/SetDrivePreferencesRequest.java new file mode 100644 index 00000000..fe429ccc --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/SetDrivePreferencesRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class SetDrivePreferencesRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(SetDrivePreferencesRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/SetFileUploadPreferencesRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/SetFileUploadPreferencesRequest.java new file mode 100644 index 00000000..2e9944d8 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/SetFileUploadPreferencesRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class SetFileUploadPreferencesRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(SetFileUploadPreferencesRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/SetResourceParentsRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/SetResourceParentsRequest.java new file mode 100644 index 00000000..c4b1d609 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/SetResourceParentsRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class SetResourceParentsRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(SetResourceParentsRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/StartStreamSession.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/StartStreamSession.java new file mode 100644 index 00000000..7ef2cbeb --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/StartStreamSession.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class StartStreamSession extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(StartStreamSession.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/StreamContentsRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/StreamContentsRequest.java new file mode 100644 index 00000000..63de9d8c --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/StreamContentsRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class StreamContentsRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(StreamContentsRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/StringListResponse.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/StringListResponse.java new file mode 100644 index 00000000..cfedbb4f --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/StringListResponse.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class StringListResponse extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(StringListResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/SyncMoreResponse.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/SyncMoreResponse.java new file mode 100644 index 00000000..060c1fbd --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/SyncMoreResponse.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class SyncMoreResponse extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(SyncMoreResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/TrashResourceRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/TrashResourceRequest.java new file mode 100644 index 00000000..359ee5f7 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/TrashResourceRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class TrashResourceRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(TrashResourceRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/UnsubscribeResourceRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/UnsubscribeResourceRequest.java new file mode 100644 index 00000000..c1001796 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/UnsubscribeResourceRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class UnsubscribeResourceRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(UnsubscribeResourceRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/UntrashResourceRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/UntrashResourceRequest.java new file mode 100644 index 00000000..6fb7588b --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/UntrashResourceRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class UntrashResourceRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(UntrashResourceRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/UpdateMetadataRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/UpdateMetadataRequest.java new file mode 100644 index 00000000..b48cfafd --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/UpdateMetadataRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class UpdateMetadataRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(UpdateMetadataRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/UpdatePermissionRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/UpdatePermissionRequest.java new file mode 100644 index 00000000..72ff12df --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/UpdatePermissionRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class UpdatePermissionRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(UpdatePermissionRequest.class); +} From 5990c8cc6eca8136f5f5661cabe354a8437d341c Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Tue, 20 Oct 2015 19:01:28 +0200 Subject: [PATCH 110/293] Update sublib --- extern/GmsApi | 2 +- .../org/microg/gms/location/GoogleLocationManagerClient.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/extern/GmsApi b/extern/GmsApi index cb0458f1..d2b942d8 160000 --- a/extern/GmsApi +++ b/extern/GmsApi @@ -1 +1 @@ -Subproject commit cb0458f17e55e713b10fe5611890887d0c8b910e +Subproject commit d2b942d87f5b5d0547e7e5f279bcc734d69cdef4 diff --git a/play-services-location/src/main/java/org/microg/gms/location/GoogleLocationManagerClient.java b/play-services-location/src/main/java/org/microg/gms/location/GoogleLocationManagerClient.java index aab38b0d..b012cf97 100644 --- a/play-services-location/src/main/java/org/microg/gms/location/GoogleLocationManagerClient.java +++ b/play-services-location/src/main/java/org/microg/gms/location/GoogleLocationManagerClient.java @@ -37,7 +37,7 @@ public abstract class GoogleLocationManagerClient extends GmsClient Date: Fri, 23 Oct 2015 01:38:46 +0200 Subject: [PATCH 111/293] Update sublib --- extern/SafeParcel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extern/SafeParcel b/extern/SafeParcel index 89dd3272..273f2e1f 160000 --- a/extern/SafeParcel +++ b/extern/SafeParcel @@ -1 +1 @@ -Subproject commit 89dd3272d40271120913e0ba71b0fd348387f1d6 +Subproject commit 273f2e1f2bf972688831e6d6837bb6b607767966 From d6fc8e737e016906442185170d7264ac61310079 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20W=C3=B6rner?= Date: Fri, 13 Nov 2015 10:54:27 +0100 Subject: [PATCH 112/293] updated buildtools --- play-services-api/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/play-services-api/build.gradle b/play-services-api/build.gradle index b5fa30b8..d7c9bc7b 100644 --- a/play-services-api/build.gradle +++ b/play-services-api/build.gradle @@ -32,7 +32,7 @@ version = '1.0-SNAPSHOT' android { compileSdkVersion 23 - buildToolsVersion "23.0.1" + buildToolsVersion "23.0.2" compileOptions { sourceCompatibility JavaVersion.VERSION_1_6 } From f0ec7e606f3e6e3a219eb87266c4dae1828b5083 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Tue, 17 Nov 2015 17:16:22 +0100 Subject: [PATCH 113/293] Extend Wearable APIs --- .../ICameraUpdateFactoryDelegate.aidl | 4 +- .../internal/AmsEntityUpdateParcelable.aidl | 3 ++ .../internal/AncsNotificationParcelable.aidl | 3 ++ .../wearable/internal/IWearableListener.aidl | 5 +- .../wearable/internal/IWearableService.aidl | 1 + .../android/gms/wearable/MessageEvent.java | 42 ++++++++++++++++ .../wearable/internal/AddListenerRequest.java | 6 ++- .../internal/AmsEntityUpdateParcelable.java | 23 +++++++++ .../internal/AncsNotificationParcelable.java | 23 +++++++++ .../internal/GetConnectedNodesResponse.java | 2 +- .../internal/MessageEventParcelable.java | 49 ++++++++++++++++++- .../gms/wearable/internal/NodeParcelable.java | 5 ++ 12 files changed, 159 insertions(+), 7 deletions(-) create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/AmsEntityUpdateParcelable.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/AncsNotificationParcelable.aidl create mode 100644 play-services-api/src/main/java/com/google/android/gms/wearable/MessageEvent.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/wearable/internal/AmsEntityUpdateParcelable.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/wearable/internal/AncsNotificationParcelable.java diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/ICameraUpdateFactoryDelegate.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/ICameraUpdateFactoryDelegate.aidl index fc1665b7..c7b28d86 100644 --- a/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/ICameraUpdateFactoryDelegate.aidl +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/ICameraUpdateFactoryDelegate.aidl @@ -15,6 +15,6 @@ interface ICameraUpdateFactoryDelegate { IObjectWrapper newCameraPosition(in CameraPosition cameraPosition); IObjectWrapper newLatLng(in LatLng latLng); IObjectWrapper newLatLngZoom(in LatLng latLng, float zoom); - IObjectWrapper newLatLngBounds(in LatLngBounds bounds, int i); - IObjectWrapper newLatLngBoundsWithSize(in LatLngBounds bounds, int i1, int i2, int i3); + IObjectWrapper newLatLngBounds(in LatLngBounds bounds, int padding); + IObjectWrapper newLatLngBoundsWithSize(in LatLngBounds bounds, int width, int height, int size); } diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/AmsEntityUpdateParcelable.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/AmsEntityUpdateParcelable.aidl new file mode 100644 index 00000000..79d95d43 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/AmsEntityUpdateParcelable.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.wearable.internal; + +parcelable AmsEntityUpdateParcelable; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/AncsNotificationParcelable.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/AncsNotificationParcelable.aidl new file mode 100644 index 00000000..8bdf1f78 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/AncsNotificationParcelable.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.wearable.internal; + +parcelable AncsNotificationParcelable; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableListener.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableListener.aidl index 491f5d2f..521f1166 100644 --- a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableListener.aidl +++ b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableListener.aidl @@ -1,6 +1,8 @@ package com.google.android.gms.wearable.internal; import com.google.android.gms.common.data.DataHolder; +import com.google.android.gms.wearable.internal.AmsEntityUpdateParcelable; +import com.google.android.gms.wearable.internal.AncsNotificationParcelable; import com.google.android.gms.wearable.internal.CapabilityInfoParcelable; import com.google.android.gms.wearable.internal.ChannelEventParcelable; import com.google.android.gms.wearable.internal.MessageEventParcelable; @@ -12,7 +14,8 @@ interface IWearableListener { void onPeerConnected(in NodeParcelable node) = 2; void onPeerDisconnected(in NodeParcelable node) = 3; void onConnectedNodes(in List nodes) = 4; - + void onNotificationReceived(in AncsNotificationParcelable notification) = 5; void onChannelEvent(in ChannelEventParcelable channelEvent) = 6; void onConnectedCapabilityChanged(in CapabilityInfoParcelable capabilityInfo) = 7; + void onEntityUpdate(in AmsEntityUpdateParcelable update) = 8; } diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableService.aidl index e341a186..99f3514a 100644 --- a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableService.aidl +++ b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableService.aidl @@ -18,6 +18,7 @@ interface IWearableService { void removeListener(IWearableCallbacks callbacks, in RemoveListenerRequest request) = 16; void putConfig(IWearableCallbacks callbacks, in ConnectionConfiguration config) = 19; void getConfigs(IWearableCallbacks callbacks) = 21; + void enableConnection(IWearableCallbacks callbacks, String name) = 22; void disableConnection(IWearableCallbacks callbacks, String name) = 23; void getDataItemsByUri(IWearableCallbacks callbacks, in Uri uri, int i) = 39; void deleteDataItems(IWearableCallbacks callbacks, in Uri uri) = 40; diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/MessageEvent.java b/play-services-api/src/main/java/com/google/android/gms/wearable/MessageEvent.java new file mode 100644 index 00000000..5c772334 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/MessageEvent.java @@ -0,0 +1,42 @@ +/* + * Copyright 2013-2015 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; + +import org.microg.gms.common.PublicApi; + +@PublicApi +public interface MessageEvent { + /** + * @return the data passed by the message. + */ + byte[] getData(); + + /** + * @return the path the message is being delivered to + */ + String getPath(); + + /** + * @return the request id of the message, generated by the sender + */ + int getRequestId(); + + /** + * @return the node ID of the sender. + */ + String getSourceNodeId(); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/AddListenerRequest.java b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/AddListenerRequest.java index 173c2be7..c4190fe8 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/AddListenerRequest.java +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/AddListenerRequest.java @@ -28,15 +28,19 @@ public class AddListenerRequest extends AutoSafeParcelable { public final IWearableListener listener; @SafeParceled(3) public final IntentFilter[] intentFilters; + @SafeParceled(4) + public final String channelTokenString; private AddListenerRequest() { listener = null; intentFilters = null; + channelTokenString = null; } - public AddListenerRequest(IWearableListener listener, IntentFilter[] intentFilters) { + public AddListenerRequest(IWearableListener listener, IntentFilter[] intentFilters, String channelTokenString) { this.listener = listener; this.intentFilters = intentFilters; + this.channelTokenString = channelTokenString; } public static final Creator CREATOR = new AutoCreator(AddListenerRequest.class); diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/AmsEntityUpdateParcelable.java b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/AmsEntityUpdateParcelable.java new file mode 100644 index 00000000..e43a38bf --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/AmsEntityUpdateParcelable.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class AmsEntityUpdateParcelable extends AutoSafeParcelable { + public static final Creator CREATOR = new AutoCreator(AmsEntityUpdateParcelable.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/AncsNotificationParcelable.java b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/AncsNotificationParcelable.java new file mode 100644 index 00000000..05f7c7f7 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/AncsNotificationParcelable.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class AncsNotificationParcelable extends AutoSafeParcelable { + public static final Creator CREATOR = new AutoCreator(AncsNotificationParcelable.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetConnectedNodesResponse.java b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetConnectedNodesResponse.java index ae25d65d..80e3d323 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetConnectedNodesResponse.java +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetConnectedNodesResponse.java @@ -26,7 +26,7 @@ public class GetConnectedNodesResponse extends AutoSafeParcelable { private int versionCode = 1; @SafeParceled(2) public final int statusCode; - @SafeParceled(3) + @SafeParceled(value = 3, subClass = NodeParcelable.class) public final List nodes; private GetConnectedNodesResponse() { diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/MessageEventParcelable.java b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/MessageEventParcelable.java index ef4ffc48..7fc9b69a 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/MessageEventParcelable.java +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/MessageEventParcelable.java @@ -16,8 +16,53 @@ package com.google.android.gms.wearable.internal; -import org.microg.safeparcel.AutoSafeParcelable; +import com.google.android.gms.wearable.MessageEvent; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class MessageEventParcelable extends AutoSafeParcelable implements MessageEvent { + + @SafeParceled(1) + private int versionCode = 1; + @SafeParceled(2) + public int requestId; + @SafeParceled(3) + public String path; + @SafeParceled(4) + public byte[] data; + @SafeParceled(5) + public String sourceNodeId; + + @Override + public byte[] getData() { + return data; + } + + @Override + public String getPath() { + return path; + } + + @Override + public int getRequestId() { + return requestId; + } + + @Override + public String getSourceNodeId() { + return sourceNodeId; + } + + @Override + public String toString() { + return "MessageEventParcelable{" + + "requestId=" + requestId + + ", path='" + path + '\'' + + ", dataSize=" + (data != null ? data.length : -1) + + ", sourceNodeId='" + sourceNodeId + '\'' + + '}'; + } -public class MessageEventParcelable extends AutoSafeParcelable { public static final Creator CREATOR = new AutoCreator(MessageEventParcelable.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/NodeParcelable.java b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/NodeParcelable.java index d1728692..ebaa5cdb 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/NodeParcelable.java +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/NodeParcelable.java @@ -41,6 +41,11 @@ public class NodeParcelable extends AutoSafeParcelable implements Node { this.displayName = displayName; } + public NodeParcelable(Node node) { + this.id = node.getId(); + this.displayName = node.getDisplayName(); + } + @Override public boolean equals(Object o) { if (this == o) return true; From 493d207ab64b99a53dab88ef699277ad89af3ed4 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Tue, 17 Nov 2015 17:22:32 +0100 Subject: [PATCH 114/293] Move MessageEvent to play-services-api --- extern/GmsApi | 2 +- .../android/gms/wearable/MessageEvent.java | 42 ------------------- 2 files changed, 1 insertion(+), 43 deletions(-) delete mode 100644 play-services-wearable/src/main/java/com/google/android/gms/wearable/MessageEvent.java diff --git a/extern/GmsApi b/extern/GmsApi index d2b942d8..f0ec7e60 160000 --- a/extern/GmsApi +++ b/extern/GmsApi @@ -1 +1 @@ -Subproject commit d2b942d87f5b5d0547e7e5f279bcc734d69cdef4 +Subproject commit f0ec7e606f3e6e3a219eb87266c4dae1828b5083 diff --git a/play-services-wearable/src/main/java/com/google/android/gms/wearable/MessageEvent.java b/play-services-wearable/src/main/java/com/google/android/gms/wearable/MessageEvent.java deleted file mode 100644 index 5c772334..00000000 --- a/play-services-wearable/src/main/java/com/google/android/gms/wearable/MessageEvent.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2013-2015 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; - -import org.microg.gms.common.PublicApi; - -@PublicApi -public interface MessageEvent { - /** - * @return the data passed by the message. - */ - byte[] getData(); - - /** - * @return the path the message is being delivered to - */ - String getPath(); - - /** - * @return the request id of the message, generated by the sender - */ - int getRequestId(); - - /** - * @return the node ID of the sender. - */ - String getSourceNodeId(); -} From a55281ec5d48681e071b85290fc020ea56af482c Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Wed, 2 Dec 2015 23:49:32 -0800 Subject: [PATCH 115/293] Update Auth API --- .../google/android/gms/auth/TokenData.java | 64 +++++++++++++++++++ .../java/org/microg/gms/common/Constants.java | 3 +- 2 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 play-services-api/src/main/java/com/google/android/gms/auth/TokenData.java diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/TokenData.java b/play-services-api/src/main/java/com/google/android/gms/auth/TokenData.java new file mode 100644 index 00000000..e805db34 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/auth/TokenData.java @@ -0,0 +1,64 @@ +/* + * Copyright 2013-2015 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.auth; + +import com.google.android.gms.common.api.Scope; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +import java.util.List; + +public class TokenData extends AutoSafeParcelable { + @SafeParceled(1) + private int versionCode = 1; + + @SafeParceled(2) + public final String token; + + @SafeParceled(3) + public final Long expiry; + + @SafeParceled(5) + public final boolean isOAuth; + + @SafeParceled(value = 6, subClass = Scope.class) + public final List scopes; + + public TokenData() { + token = null; + expiry = null; + isOAuth = false; + scopes = null; + } + + public TokenData(String token, Long expiry, boolean isOAuth, List scopes) { + this.token = token; + this.expiry = expiry; + this.isOAuth = isOAuth; + this.scopes = scopes; + } + + public TokenData(String token, Long expiry) { + this.token = token; + this.expiry = expiry; + this.isOAuth = false; + this.scopes = null; + } + + public static final Creator CREATOR = new AutoCreator(TokenData.class); +} diff --git a/play-services-api/src/main/java/org/microg/gms/common/Constants.java b/play-services-api/src/main/java/org/microg/gms/common/Constants.java index 6e1bd63e..6f0589bc 100644 --- a/play-services-api/src/main/java/org/microg/gms/common/Constants.java +++ b/play-services-api/src/main/java/org/microg/gms/common/Constants.java @@ -21,11 +21,12 @@ public class Constants { * This is the highest version that was looked at during development. * Does not necessarily mean anything. */ - public static final int MAX_REFERENCE_VERSION = 8115000; + public static final int MAX_REFERENCE_VERSION = 8489000; public static final String KEY_MOCK_LOCATION = "mockLocation"; public static final String DEFAULT_ACCOUNT = "<>"; public static final String GMS_PACKAGE_NAME = "com.google.android.gms"; public static final String GMS_PACKAGE_SIGNATURE_SHA1 = "38918a453d07199354f8b19af05ec6562ced5788"; + public static final String SCOPE_GET_ACCOUNT_ID = "^^_account_id_^^"; /** * No base map tiles. From 609e53a7d363183de4494600d4141b7c7cf5a692 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Thu, 3 Dec 2015 18:36:36 -0800 Subject: [PATCH 116/293] Add another set of Maps API --- .../gms/maps/internal/IOnCameraChangeListener.aidl | 3 +++ .../android/gms/maps/internal/IOnMarkerDragListener.aidl | 5 +++++ .../com/google/android/gms/maps/GoogleMapOptions.java | 8 ++++---- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnCameraChangeListener.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnCameraChangeListener.aidl index 41010aa0..8abd2929 100644 --- a/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnCameraChangeListener.aidl +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnCameraChangeListener.aidl @@ -1,4 +1,7 @@ package com.google.android.gms.maps.internal; +import com.google.android.gms.maps.model.CameraPosition; + interface IOnCameraChangeListener { + void onCameraChange(in CameraPosition update); } diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnMarkerDragListener.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnMarkerDragListener.aidl index 42cec6ca..b4601a7a 100644 --- a/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnMarkerDragListener.aidl +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnMarkerDragListener.aidl @@ -1,4 +1,9 @@ package com.google.android.gms.maps.internal; +import com.google.android.gms.maps.model.internal.IMarkerDelegate; + interface IOnMarkerDragListener { + void onMarkerDragStart(IMarkerDelegate marker) = 0; + void onMarkerDrag(IMarkerDelegate marker) = 1; + void onMarkerDragEnd(IMarkerDelegate marker) = 2; } diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/GoogleMapOptions.java b/play-services-api/src/main/java/com/google/android/gms/maps/GoogleMapOptions.java index 7e24955c..a5534cb2 100644 --- a/play-services-api/src/main/java/com/google/android/gms/maps/GoogleMapOptions.java +++ b/play-services-api/src/main/java/com/google/android/gms/maps/GoogleMapOptions.java @@ -36,13 +36,13 @@ public final class GoogleMapOptions extends AutoSafeParcelable { @SafeParceled(7) private boolean compassEnabled; @SafeParceled(8) - private boolean scrollGesturesEnabled; + private boolean scrollGesturesEnabled = true; @SafeParceled(9) - private boolean zoomGesturesEnabled; + private boolean zoomGesturesEnabled = true; @SafeParceled(10) - private boolean tiltGesturesEnabled; + private boolean tiltGesturesEnabled = true; @SafeParceled(11) - private boolean rotateGesturesEnabled; + private boolean rotateGesturesEnabled = true; public GoogleMapOptions() { } From fbe903fbcbcc27af3579c9b7b35c40b105224a01 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Thu, 3 Dec 2015 19:17:35 -0800 Subject: [PATCH 117/293] Add IOnMyLocationChangeListener API --- .../android/gms/maps/internal/IOnMyLocationChangeListener.aidl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnMyLocationChangeListener.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnMyLocationChangeListener.aidl index db71cd63..35a6b6c2 100644 --- a/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnMyLocationChangeListener.aidl +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnMyLocationChangeListener.aidl @@ -1,4 +1,7 @@ package com.google.android.gms.maps.internal; +import com.google.android.gms.dynamic.IObjectWrapper; + interface IOnMyLocationChangeListener { + void onMyLocationChanged(IObjectWrapper location); } From 8d39059ce60908519a4642562c848d9da063e710 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Fri, 25 Dec 2015 03:46:36 +0100 Subject: [PATCH 118/293] Extend People API model --- .../internal/ParcelableLoadImageOptions.java | 36 +++++++++++++++++++ .../gms/people/model/AccountMetadata.java | 12 +++++++ .../gms/people/model/AvatarReference.java | 34 ++++++++++++++++++ 3 files changed, 82 insertions(+) create mode 100644 play-services-api/src/main/java/com/google/android/gms/people/internal/ParcelableLoadImageOptions.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/people/model/AvatarReference.java diff --git a/play-services-api/src/main/java/com/google/android/gms/people/internal/ParcelableLoadImageOptions.java b/play-services-api/src/main/java/com/google/android/gms/people/internal/ParcelableLoadImageOptions.java new file mode 100644 index 00000000..cf7365f8 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/people/internal/ParcelableLoadImageOptions.java @@ -0,0 +1,36 @@ +/* + * Copyright 2013-2015 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.people.internal; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class ParcelableLoadImageOptions extends AutoSafeParcelable { + @SafeParceled(1000) + private int versionCode = 1; + + @SafeParceled(1) + public int imageSize; + + @SafeParceled(2) + public int avatarOptions; + + @SafeParceled(3) + public boolean useLargePictureForCp2Images; + + public static final Creator CREATOR = new AutoCreator(ParcelableLoadImageOptions.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/people/model/AccountMetadata.java b/play-services-api/src/main/java/com/google/android/gms/people/model/AccountMetadata.java index f14fcc56..0525d300 100644 --- a/play-services-api/src/main/java/com/google/android/gms/people/model/AccountMetadata.java +++ b/play-services-api/src/main/java/com/google/android/gms/people/model/AccountMetadata.java @@ -24,5 +24,17 @@ public class AccountMetadata extends AutoSafeParcelable { @SafeParceled(1) private int versionCode = 2; + @SafeParceled(2) + public boolean hasGooglePlus = true; + + @SafeParceled(3) + public boolean hasFeature2 = true; + + @SafeParceled(4) + public boolean hasFeature3 = true; + + @SafeParceled(5) + public boolean hasFeature4 = true; + public static Creator CREATOR = new AutoCreator(AccountMetadata.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/people/model/AvatarReference.java b/play-services-api/src/main/java/com/google/android/gms/people/model/AvatarReference.java new file mode 100644 index 00000000..03599139 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/people/model/AvatarReference.java @@ -0,0 +1,34 @@ +/* + * Copyright 2013-2015 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.people.model; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class AvatarReference extends AutoSafeParcelable { + + @SafeParceled(1000) + private int versionCode; + + @SafeParceled(1) + public int source; + + @SafeParceled(2) + public String location; + + public static final Creator CREATOR = new AutoCreator(AvatarReference.class); +} From f34d87bcc2bb44de1a8efd29b40c311dbea67049 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Wed, 20 Jan 2016 15:08:34 +0100 Subject: [PATCH 119/293] Initial commit --- .gitignore | 4 + Android.mk | 7 + gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 49896 bytes gradle/wrapper/gradle-wrapper.properties | 6 + gradlew | 164 +++++++++ microg-ui-tools/build.gradle | 52 +++ microg-ui-tools/src/main/AndroidManifest.xml | 24 ++ .../v4/preference/PreferenceFragment.java | 313 ++++++++++++++++++ .../selfcheck/AbstractSelfCheckActivity.java | 65 ++++ .../tools/selfcheck/SelfCheckGroup.java | 33 ++ .../src/main/res/layout/self_check.xml | 37 +++ .../src/main/res/layout/self_check_entry.xml | 46 +++ .../src/main/res/layout/toolbar.xml | 24 ++ .../src/main/res/values/colors.xml | 21 ++ .../src/main/res/values/themes.xml | 26 ++ settings.gradle | 1 + 16 files changed, 823 insertions(+) create mode 100644 .gitignore create mode 100644 Android.mk create mode 100644 gradle/wrapper/gradle-wrapper.jar create mode 100755 gradle/wrapper/gradle-wrapper.properties create mode 100755 gradlew create mode 100644 microg-ui-tools/build.gradle create mode 100644 microg-ui-tools/src/main/AndroidManifest.xml create mode 100644 microg-ui-tools/src/main/java/android/support/v4/preference/PreferenceFragment.java create mode 100644 microg-ui-tools/src/main/java/org/microg/tools/selfcheck/AbstractSelfCheckActivity.java create mode 100644 microg-ui-tools/src/main/java/org/microg/tools/selfcheck/SelfCheckGroup.java create mode 100644 microg-ui-tools/src/main/res/layout/self_check.xml create mode 100644 microg-ui-tools/src/main/res/layout/self_check_entry.xml create mode 100644 microg-ui-tools/src/main/res/layout/toolbar.xml create mode 100644 microg-ui-tools/src/main/res/values/colors.xml create mode 100644 microg-ui-tools/src/main/res/values/themes.xml create mode 100644 settings.gradle diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..31ed2bf6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +build/ +.gradle/ +local.properties +*.iml diff --git a/Android.mk b/Android.mk new file mode 100644 index 00000000..8b660b6b --- /dev/null +++ b/Android.mk @@ -0,0 +1,7 @@ +LOCAL_PATH := $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_MODULE := MicroGUiTools +LOCAL_SRC_FILES := $(call all-java-files-under, microg-ui-tools/src/main/java) + +include $(BUILD_STATIC_JAVA_LIBRARY) diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000000000000000000000000000000000..8c0fb64a8698b08ecc4158d828ca593c4928e9dd GIT binary patch literal 49896 zcmagFb986H(k`5d^NVfUwr$(C?M#x1ZQHiZiEVpg+jrjgoQrerx!>1o_ul)D>ebz~ zs=Mmxr&>W81QY-S1PKWQ%N-;H^tS;2*XwVA`dej1RRn1z<;3VgfE4~kaG`A%QSPsR z#ovnZe+tS9%1MfeDyz`RirvdjPRK~p(#^q2(^5@O&NM19EHdvN-A&StN>0g6QA^VN z0Gx%Gq#PD$QMRFzmK+utjS^Y1F0e8&u&^=w5K<;4Rz|i3A=o|IKLY+g`iK6vfr9?+ z-`>gmU&i?FGSL5&F?TXFu`&Js6h;15QFkXp2M1H9|Eq~bpov-GU(uz%mH0n55wUl- zv#~ccAz`F5wlQ>e_KlJS3@{)B?^v*EQM=IxLa&76^y51a((wq|2-`qON>+4dLc{Oo z51}}o^Zen(oAjxDK7b++9_Yg`67p$bPo3~BCpGM7uAWmvIhWc5Gi+gQZ|Pwa-Gll@<1xmcPy z|NZmu6m)g5Ftu~BG&Xdxclw7Cij{xbBMBn-LMII#Slp`AElb&2^Hw+w>(3crLH!;I zN+Vk$D+wP1#^!MDCiad@vM>H#6+`Ct#~6VHL4lzmy;lSdk>`z6)=>Wh15Q2)dQtGqvn0vJU@+(B5{MUc*qs4!T+V=q=wy)<6$~ z!G>e_4dN@lGeF_$q9`Ju6Ncb*x?O7=l{anm7Eahuj_6lA{*#Gv*TaJclevPVbbVYu z(NY?5q+xxbO6%g1xF0r@Ix8fJ~u)VRUp`S%&rN$&e!Od`~s+64J z5*)*WSi*i{k%JjMSIN#X;jC{HG$-^iX+5f5BGOIHWAl*%15Z#!xntpk($-EGKCzKa zT7{siZ9;4TICsWQ$pu&wKZQTCvpI$Xvzwxoi+XkkpeE&&kFb!B?h2hi%^YlXt|-@5 zHJ~%AN!g_^tmn1?HSm^|gCE#!GRtK2(L{9pL#hp0xh zME}|DB>(5)`iE7CM)&_+S}-Bslc#@B5W4_+k4Cp$l>iVyg$KP>CN?SVGZ(&02>iZK zB<^HP$g$Lq*L$BWd?2(F?-MUbNWTJVQdW7$#8a|k_30#vHAD1Z{c#p;bETk0VnU5A zBgLe2HFJ3032$G<`m*OB!KM$*sdM20jm)It5OSru@tXpK5LT>#8)N!*skNu1$TpIw zufjjdp#lyH5bZ%|Iuo|iu9vG1HrIVWLH>278xo>aVBkPN3V$~!=KnlXQ4eDqS7%E% zQ!z^$Q$b^6Q)g#cLpwur(|<0gWHo6A6jc;n`t(V9T;LzTAU{IAu*uEQ%Ort1k+Kn+f_N`9|bxYC+~Z1 zCC1UCWv*Orx$_@ydv9mIe(liLfOr7mhbV@tKw{6)q^1DH1nmvZ0cj215R<~&I<4S| zgnr;9Cdjqpz#o8i0CQjtl`}{c*P)aSdH|abxGdrR)-3z+02-eX(k*B)Uqv6~^nh** z zGh0A%o~bd$iYvP!egRY{hObDIvy_vXAOkeTgl5o!33m!l4VLm@<-FwT0+k|yl~vUh z@RFcL4=b(QQQmwQ;>FS_e96dyIU`jmR%&&Amxcb8^&?wvpK{_V_IbmqHh);$hBa~S z;^ph!k~noKv{`Ix7Hi&;Hq%y3wpqUsYO%HhI3Oe~HPmjnSTEasoU;Q_UfYbzd?Vv@ zD6ztDG|W|%xq)xqSx%bU1f>fF#;p9g=Hnjph>Pp$ZHaHS@-DkHw#H&vb1gARf4A*zm3Z75QQ6l( z=-MPMjish$J$0I49EEg^Ykw8IqSY`XkCP&TC?!7zmO`ILgJ9R{56s-ZY$f> zU9GwXt`(^0LGOD9@WoNFK0owGKDC1)QACY_r#@IuE2<`tep4B#I^(PRQ_-Fw(5nws zpkX=rVeVXzR;+%UzoNa;jjx<&@ABmU5X926KsQsz40o*{@47S2 z)p9z@lt=9?A2~!G*QqJWYT5z^CTeckRwhSWiC3h8PQ0M9R}_#QC+lz>`?kgy2DZio zz&2Ozo=yTXVf-?&E;_t`qY{Oy>?+7+I= zWl!tZM_YCLmGXY1nKbIHc;*Mag{Nzx-#yA{ zTATrWj;Nn;NWm6_1#0zy9SQiQV=38f(`DRgD|RxwggL(!^`}lcDTuL4RtLB2F5)lt z=mNMJN|1gcui=?#{NfL{r^nQY+_|N|6Gp5L^vRgt5&tZjSRIk{_*y<3^NrX6PTkze zD|*8!08ZVN)-72TA4Wo3B=+Rg1sc>SX9*X>a!rR~ntLVYeWF5MrLl zA&1L8oli@9ERY|geFokJq^O$2hEpVpIW8G>PPH0;=|7|#AQChL2Hz)4XtpAk zNrN2@Ju^8y&42HCvGddK3)r8FM?oM!3oeQ??bjoYjl$2^3|T7~s}_^835Q(&b>~3} z2kybqM_%CIKk1KSOuXDo@Y=OG2o!SL{Eb4H0-QCc+BwE8x6{rq9j$6EQUYK5a7JL! z`#NqLkDC^u0$R1Wh@%&;yj?39HRipTeiy6#+?5OF%pWyN{0+dVIf*7@T&}{v%_aC8 zCCD1xJ+^*uRsDT%lLxEUuiFqSnBZu`0yIFSv*ajhO^DNoi35o1**16bg1JB z{jl8@msjlAn3`qW{1^SIklxN^q#w|#gqFgkAZ4xtaoJN*u z{YUf|`W)RJfq)@6F&LfUxoMQz%@3SuEJHU;-YXb7a$%W=2RWu5;j44cMjC0oYy|1! zed@H>VQ!7=f~DVYkWT0nfQfAp*<@FZh{^;wmhr|K(D)i?fq9r2FEIatP=^0(s{f8GBn<8T zVz_@sKhbLE&d91L-?o`13zv6PNeK}O5dv>f{-`!ms#4U+JtPV=fgQ5;iNPl9Hf&9( zsJSm5iXIqN7|;I5M08MjUJ{J2@M3 zYN9ft?xIjx&{$K_>S%;Wfwf9N>#|ArVF^shFb9vS)v9Gm00m_%^wcLxe;gIx$7^xR zz$-JDB|>2tnGG@Rrt@R>O40AreXSU|kB3Bm)NILHlrcQ&jak^+~b`)2;otjI(n8A_X~kvp4N$+4|{8IIIv zw*(i}tt+)Kife9&xo-TyoPffGYe;D0a%!Uk(Nd^m?SvaF-gdAz4~-DTm3|Qzf%Pfd zC&tA;D2b4F@d23KV)Csxg6fyOD2>pLy#n+rU&KaQU*txfUj&D3aryVj!Lnz*;xHvl zzo}=X>kl0mBeSRXoZ^SeF94hlCU*cg+b}8p#>JZvWj8gh#66A0ODJ`AX>rubFqbBw z-WR3Z5`33S;7D5J8nq%Z^JqvZj^l)wZUX#7^q&*R+XVPln{wtnJ~;_WQzO{BIFV55 zLRuAKXu+A|7*2L*<_P${>0VdVjlC|n^@lRi}r?wnzQQm z3&h~C3!4C`w<92{?Dpea@5nLP2RJrxvCCBh%Tjobl2FupWZfayq_U$Q@L%$uEB6#X zrm_1TZA8FEtkd`tg)a_jaqnv3BC_O*AUq-*RNLOT)$>2D!r>FZdH&$x5G_FiAPaw4 zgK*7>(qd6R?+M3s@h>Z|H%7eGPxJWn_U$w`fb(Mp+_IK2Kj37YT#Xe5e6KS-_~mW} z`NXEovDJh7n!#q4b+=ne<7uB7Y2(TAR<3@PS&o3P$h#cZ-xF$~JiH6_gsv9v(#ehK zhSB_#AI%lF#+!MB5DMUN+Zhf}=t~{B|Fn{rGM?dOaSvX!D{oGXfS*%~g`W84JJAy4 zMdS?9Bb$vx?`91$J`pD-MGCTHNxU+SxLg&QY+*b_pk0R=A`F}jw$pN*BNM8`6Y=cm zgRh#vab$N$0=XjH6vMyTHQg*+1~gwOO9yhnzZx#e!1H#|Mr<`jJGetsM;$TnciSPJ z5I-R0)$)0r8ABy-2y&`2$33xx#%1mp+@1Vr|q_e=#t7YjjWXH#3F|Fu<G#+-tE2K7 zOJkYxNa74@UT_K4CyJ%mR9Yfa$l=z}lB(6)tZ1Ksp2bv$^OUn3Oed@=Q0M}imYTwX zQoO^_H7SKzf_#kPgKcs%r4BFUyAK9MzfYReHCd=l)YJEgPKq-^z3C%4lq%{&8c{2CGQ3jo!iD|wSEhZ# zjJoH87Rt{4*M_1GdBnBU3trC*hn@KCFABd=Zu`hK;@!TW`hp~;4Aac@24m|GI)Ula z4y%}ClnEu;AL4XVQ6^*!()W#P>BYC@K5mw7c4X|Hk^(mS9ZtfMsVLoPIiwI?w_X0- z#vyiV5q9(xq~fS`_FiUZw->8Awktga>2SrWyvZ|h@LVFtnY#T z%OX30{yiSov4!43kFd(8)cPRMyrN z={af_ONd;m=`^wc7lL|b7V!;zmCI}&8qz=?-6t=uOV;X>G{8pAwf9UJ`Hm=ubIbgR zs6bw3pFeQHL`1P1m5fP~fL*s?rX_|8%tB`Phrij^Nkj{o0oCo*g|ELexQU+2gt66=7}w5A+Qr}mHXC%)(ODT# zK#XTuzqOmMsO~*wgoYjDcy)P7G`5x7mYVB?DOXV^D3nN89P#?cp?A~c%c$#;+|10O z8z(C>mwk#A*LDlpv2~JXY_y_OLZ*Mt)>@gqKf-Ym+cZ{8d%+!1xNm3_xMygTp-!A5 zUTpYFd=!lz&4IFq)Ni7kxLYWhd0o2)ngenV-QP@VCu;147_Lo9f~=+=Nw$6=xyZzp zn7zAe41Sac>O60(dgwPd5a^umFVSH;<7vN>o;}YlMYhBZFZ}-sz`P^3oAI>SCZy&zUtwKSewH;CYysPQN7H>&m215&e2J? zY}>5N-LhaDeRF~C0cB>M z7@y&xh9q??*EIKnh*;1)n-WuSl6HkrI?OUiS^lx$Sr2C-jUm6zhd{nd(>#O8k9*kF zPom7-%w1NjFpj7WP=^!>Vx^6SG^r`r+M&s7V(uh~!T7aE;_ubqNSy)<5(Vi)-^Mp9 zEH@8Vs-+FEeJK%M0z3FzqjkXz$n~BzrtjQv`LagAMo>=?dO8-(af?k@UpL5J#;18~ zHCnWuB(m6G6a2gDq2s`^^5km@A3Rqg-oHZ68v5NqVc zHX_Iw!OOMhzS=gfR7k;K1gkEwuFs|MYTeNhc0js>Wo#^=wX4T<`p zR2$8p6%A9ZTac;OvA4u#Oe3(OUep%&QgqpR8-&{0gjRE()!Ikc?ClygFmGa(7Z^9X zWzmV0$<8Uh)#qaH1`2YCV4Zu6@~*c*bhtHXw~1I6q4I>{92Eq+ZS@_nSQU43bZyidk@hd$j-_iL=^^2CwPcaXnBP;s;b zA4C!k+~rg4U)}=bZ2q*)c4BZ#a&o!uJo*6hK3JRBhOOUQ6fQI;dU#3v>_#yi62&Sp z-%9JJxwIfQ`@w(_qH0J0z~(lbh`P zHoyp2?Oppx^WXwD<~20v!lYm~n53G1w*Ej z9^B*j@lrd>XGW43ff)F;5k|HnGGRu=wmZG9c~#%vDWQHlOIA9(;&TBr#yza{(?k0> zcGF&nOI}JhuPl`kLViBEd)~p2nY9QLdX42u9C~EUWsl-@CE;05y@^V1^wM$ z&zemD1oZd$Z))kEw9)_Mf+X#nT?}n({(+aXHK2S@j$MDsdrw-iLb?#r{?Vud?I5+I zVQ8U?LXsQ}8-)JBGaoawyOsTTK_f8~gFFJ&lhDLs8@Rw$ey-wr&eqSEU^~1jtHmz6 z!D2g4Yh?3VE*W8=*r&G`?u?M~AdO;uTRPfE(@=Gkg z7gh=EGu!6VJJ?S_>|5ZwY?dGFBp3B9m4J1=7u=HcGjsCW+y6`W?OWxfH?S#X8&Zk& zvz6tWcnaS1@~3FTH}q_*$)AjYA_j;yl0H0{I(CW7Rq|;5Q2>Ngd(tmJDp+~qHe_8y zPU_fiCrn!SJ3x&>o6;WDnjUVEt`2fhc9+uLI>99(l$(>Tzwpbh>O775OA5i`jaBdp zXnCwUgomyF3K$0tXzgQhSAc!6nhyRh_$fP}Rd$|*Y7?ah(JrN=I7+)+Hp4BLJJ2P~ zFD!)H^uR2*m7GQZpLUVS#R3^?2wCd}(gcFcz!u5KN9ldNJdh@%onf06z9m~T0n;dqg6@?>G@S|rPO*Kj>{su+R|7bH>osA&uD4eqxtr**k($ii`uO? z7-&VkiL4Rp3S&e+T}2Z#;NtWHZco(v8O3QMvN0g7l8GV|U2>x-DbamkZo5)bjaSFR zr~Y9(EvF9{o*@|nBPj+e5o$_K`%TH1hD=|its}|qS^o6EQu_gOuDUH=Dtzik;P7G$ zq%_T<>9O}bGIB?;IQ*H`BJ5NWF6+XLv@G7aZwcy(&BoepG~u`aIcG>y+;J7+L=wTZ zB=%n@O}=+mjBO%1lMo6C0@1*+mhBqqY((%QMUBhyeC~r*5WVqzisOXFncr*5Lr0q6 zyPU&NOV}Vt2jl>&yig4I6j93?D>Ft=keRh=Y;3*^Z-I26nkZ#Jj5OJ89_?@#9lNjp z#gfAO6i937)~I|98P%xAWxwmk(F&@lTMx63*FZ~2b{NHU+}EV8+kMAB0bM*Zn#&7ubt98!PT^ZcMOfwMgkYz6+;?CKbvV zQ}Z@s_3JcMPhF&y1?}9uZFIBiPR3g7lf=+XEr9Bl%zRfGcaKb*ZQq5b35ZkR@=JEw zP#iqgh2^#@VA-h)>r`7R-$1_ddGr&oWWV$rx;pkG0Yohp9p@In_p)hKvMo@qIv zcN2t{23&^Nj=Y&gX;*vJ;kjM zHE2`jtjVRRn;=WqVAY&m$z=IoKa{>DgJ;To@OPqNbh=#jiS$WE+O4TZIOv?niWs47 zQfRBG&WGmU~>2O{}h17wXGEnigSIhCkg%N~|e?hG8a- zG!Wv&NMu5z!*80>;c^G9h3n#e>SBt5JpCm0o-03o2u=@v^n+#6Q^r#96J5Q=Dd=>s z(n0{v%yj)=j_Je2`DoyT#yykulwTB+@ejCB{dA7VUnG>4`oE?GFV4sx$5;%9&}yxfz<-wWk|IlA|g&! zN_Emw#w*2GT=f95(%Y1#Viop;Yro3SqUrW~2`Fl?Ten{jAt==a>hx$0$zXN`^7>V_ zG*o7iqeZV)txtHUU2#SDTyU#@paP;_yxp!SAG##cB= zr@LoQg4f~Uy5QM++W`WlbNrDa*U;54`3$T;^YVNSHX4?%z|`B~i7W+kl0wBB`8|(l zAyI6dXL&-Sei0=f#P^m`z=JJ`=W;PPX18HF;5AaB%Zlze`#pz;t#7Bzq0;k8IyvdK=R zBW+4GhjOv+oNq^~#!5(+pDz)Ku{u60bVjyym8Or8L;iqR|qTcxEKTRm^Y%QjFYU=ab+^a|!{!hYc+= z%Qc02=prKpzD+jiiOwzyb(dELO|-iyWzizeLugO!<1(j|3cbR!8Ty1$C|l@cWoi?v zLe<5+(Z-eH++=fX**O-I8^ceYZgiA!!dH+7zfoP-Q+@$>;ab&~cLFg!uOUX7h0r== z`@*QP9tnV1cu1!9pHc43C!{3?-GUBJEzI(&#~vY9MEUcRNR*61)mo!RG>_Yb^rNN7 zR9^bI45V?3Lq`^^BMD!GONuO4NH#v9OP3@s%6*Ha3#S*;f z6JEi)qW#Iq#5BtIXT9Gby|H?NJG}DN#Li82kZ_Rt1=T0Z@U6OAdyf}4OD|Sk^2%-1 zzgvqZ@b6~kL!^sZLO$r{s!3fQ5bHW}8r$uTVS*iw1u8^9{YlPp_^Xm5IN zF|@)ZOReX zB*#tEbWEX~@f)ST|s$oUKS@drycE1tYtdJ9b*(uFTxNZ{n3BI*kF7wXgT6+@PI@vwH7iQS{1T!Nauk>fm8gOLe`->Pi~ z8)3=UL_$OLl2n7QZlHt846nkYFu4V};3LpYA%5VaF#a2#d2g0&ZO~3WA%1XlerVpg zCAlM;(9OqH@`(>Tha{*@R%twB!}1ng4V=^+R`Q{#fkRk)C|suozf-uCXrkIH2SC^C z6wlxR`yS;-U#uu#`OnD%U<41%C4mp>LYLPIbgVO~WsT1if)Y)T*8nUB`2*(B;U_ha1NWv2`GqrZ z3MWWpT3tZ!*N@d*!j3=@K4>X*gX4A^@QPAz24?7u90AXaLiFq=Z$|5p$Ok2|YCX_Z zFgNPiY2r_Bg2BQE!0z=_N*G?%0cNITmAru*!Mws=F+F&Qw!&1?DBN{vSy%IvGRV@1 zS->PARgL^XS!-aZj zi@`~LhWfD!H-L0kNv=Jil9zR0>jZLqu)cLq?$yXVyk%EteKcWbe^qh#spHJPa#?92 za(N(Kw0se^$7nQUQZBet;C_Dj5(2_?TdrXFYwmebq}YGQbN5Ex7M zGSCX~Ey;5AqAzEDNr%p^!cuG?&wIeY&Bm5guVg>8F=!nT%7QZTGR(uGM&IZuMw0V_ zhPiIFWm?H?aw*(v6#uVT@NEzi2h5I$cZ-n0~m$tmwdMTjG*of^Y%1 zW?Y%o*-_iMqEJhXo^!Qo?tGFUn1Mb|urN4_;a)9bila2}5rBS#hZ5wV+t1xbyF1TW zj+~cdjbcMgY$zTOq6;ODaxzNA@PZIXX(-=cT8DBd;9ihfqqtbDr9#gXGtK24BPxjZ z9+Xp>W1(s)->-}VX~BoQv$I|-CBdO`gULrvNL>;@*HvTdh@wyNf}~IB5mFnTitX2i z;>W>tlQyc2)T4Mq+f!(i3#KuK-I8Kj3Wm(UYx?KWWt8DEPR_Jdb9CE~Fjc7Rkh#gh zowNv()KRO@##-C+ig0l!^*ol!Bj%d32_N*~d!|&>{t!k3lc?6VrdlCCb1?qyoR42m zv;4KdwCgvMT*{?tJKa(T?cl|b;k4P>c&O@~g71K5@}ys$)?}WSxD;<5%4wEz7h=+q ztLumn6>leWdDk#*@{=v9p)MsvuJMyf_VEs;pJh?i3z7_W@Q|3p$a}P@MQ-NpMtDUBgH!h4Ia#L&POr4Qw0Tqdw^}gCmQAB z8Dgkzn?V!_@04(cx0~-pqJOpeP1_}@Ml3pCb45EJoghLows9ET13J8kt0;m$6-jO( z4F|p+JFD1NT%4bpn4?&)d+~<360$z5on`eS6{H`S>t`VS$>(D`#mC*XK6zULj1Da# zpV$gw$2Ui{07NiYJQQNK;rOepRxA>soNK~B2;>z;{Ovx`k}(dlOHHuNHfeR}7tmIp zcM}q4*Fq8vSNJYi@4-;}`@bC?nrUy`3jR%HXhs79qWI5;hyTpH5%n-NcKu&j(aGwT z1~{geeq?Jd>>HL+?2`0K8dB2pvTS=LO~tb~vx_<=iN8^rW!y@~lBTAaxHmvVQJSeJ z!cb9ffMdP1lgI=>QJN{XpM4{reRrdIt|v|0-8!p}M*Qw^uV1@Ho-YsNd0!a(os$F* zT0tGHA#0%u0j*%S>kL*73@~7|iP;;!JbWSTA@`#VHv_l_%Z7CgX@>dhg_ zgn0|U)SY~U-E5{QiT@(uPp#1jaz!(_3^Cbz2 z4ZgWWz=PdGCiGznk{^4TBfx_;ZjAHQ>dB4YI}zfEnTbf60lR%=@VWt0yc=fd38Ig* z)Q38#e9^+tA7K}IDG5Z~>JE?J+n%0_-|i2{E*$jb4h?|_^$HRHjVkiyX6@Y+)0C2a zA+eegpT1dUpqQFIwx;!ayQcWQBQTj1n5&h<%Lggt@&tE19Rm~Rijtqw6nmYip_xg0 zO_IYpU304embcWP+**H|Z5~%R*mqq+y{KbTVqugkb)JFSgjVljsR{-c>u+{?moCCl zTL)?85;LXk0HIDC3v*|bB-r_z%zvL6Dp__L*A~Z*o?$rm>cYux&)W=6#+Cb}TF&Kd zdCgz3(ZrNA>-V>$C{a^Y^2F!l_%3lFe$s(IOfLBLEJ4Mcd!y&Ah9r)7q?oc z5L(+S8{AhZ)@3bw0*8(}Xw{94Vmz6FrK&VFrJN;xB96QmqYEibFz|yHgUluA-=+yS}I-+#_Pk zN67-#8W(R^e7f!;i0tXbJgMmJZH%yEwn*-}5ew13D<_FYWnt?{Mv1+MI~u;FN~?~m z{hUnlD1|RkN}c1HQ6l@^WYbHAXPJ^m0te1woe;LDJ}XEJqh1tPf=sD0%b+OuR1aCoP>I>GBn4C24Zu$D)qg=gq;D??5 zUSj%;-Hvk_ffj-+SI{ZCp`gZcNu=L@_N}kCcs?TyMr-37fhy$?a<7lt1`fZw<%$8@B6(Wgo!#!z9z{ab|x`+&;kP!(gfdY}A-GP&4Cbh-S< z1(kmgnMyB2z3ipEj5;4<{(=&<7a>A_Jl`ujUKYV@%k(oD=cD7W@8~5O=R*zdjM_y; zXwme~0wo0aDa~9rDnjF=B}Bbj|DHRQjN|?@(F^=bVFdr!#mwr|c0843k>%~5J|7|v zSY=T)iPU6rEAwrM(xTZwPio%D4y9Z4kL0bMLKvu4yd)0ZJA3<;>a2q~rEfcREn}~1 zCJ~3c?Afvx?3^@+!lnf(kB6YwfsJ*u^y7kZA?VmM%nBmaMspWu?WXq4)jQsq`9EbT zlF2zJ)wXuAF*2u|yd5hNrG>~|i}R&ZyeetTQ!?Hz6xGZZb3W6|vR>Hq=}*m=V=Lsp zUOMxh;ZfP4za~C{Ppn^%rhitvpnu^G{Z#o-r?TdEgSbtK_+~_iD49xM;$}X*mJF02|WBL{SDqK9}p4N!G$3m=x#@T+4QcapM{4j|Q zwO!(hldpuSW#by!zHEP@tzIC|KdD z%BJzQ7Ho1(HemWm`Z8m_D#*`PZ-(R%sZmPrS$aHS#WPjH3EDitxN|DY+ zYC|3S?PQ3NNYau$Qk8f>{w}~xCX;;CE=7;Kp4^xXR8#&^L+y-jep7oO^wnQ840tg1 zuN17QKsfdqZPlB8OzwF+)q#IsmenEmIbRAJHJ$JjxzawKpk8^sBm3iy=*kB%LppNb zhSdk`^n?01FKQ;=iU+McN7Mk0^`KE>mMe1CQ2a_R26_}^$bogFm=2vqJake7x)KN( zYz;gRPL+r4*KD>1U+DU+1jh{mT8#P#(z9^(aDljpeN{mRmx{AZX&hXKXNuxj3x*RrpjvOaZ#`1EqK!$+8=0yv8}=;>f=E?5tGbRUd4%?QL zy$kq6mZeF%k6E1&8nwAYMd!-lRkhQTob$7s`*XqcHs;l~mHV}fx&0I&i!CHaPVSM{ zHdRh7a>hP)t@YTrWm9y zl-ENWSVzlKVvTdWK>)enmGCEw(WYS=FtY{srdE{Z(3~4svwd)ct;`6Y{^qiW+9E@A ztzd?lj5F#k`=E1U-n*1JJc0{x{0q!_tkD<_S6bGsW)^RxGu%Rj^Mvw|R0WP1SqvAI zs(MiAd@Y5x!UKu376&|quQNxir;{Iz(+}3k-GNb29HaQh?K30u=6sXpIc?j0hF{VY zM$Do*>pN)eRljAOgpx7fMfSrnZ7>fi@@>Jh;qxj1#-Vj}JC3E^GCbC(r55_AG>6cq z4ru34FtVuBt)bkX4>ZFWjToyu)VA>IE6hXc+^(3ruUaKRqHnx3z)(GXetm;^0D95s zQ&drwfjhM4*|q=;i5Io0eDf?I{p}qo@7i7abHX5qLu~VDwYf4bmV~-^M_U?DL(+cG z{AyE^a|*73Ft)o5k-p)+GLXj#q01VlJ9#ZJkf|+c%6qfRgVp&6NsU3~F?!uh}HJm73xq>v$h zYoW3wJE6n9P|;{8U<^%UE2wjR4x^G_Nc$J(i)!>;g4`CCh2z^Dth#ah#<`#axDR?F z4>~hnN2%B2ZUuU6j>m1Qjj~5jQSdA&Q#7hOky#=Ue)}7LPJ!8nbZO_0Sw{G>>M7&E zb1dy|0Zi$(ubk`4^XkVI%4WIpe?Bh!D~IjvZs14yHw=aQ8-`N-=P*?Kzi&eRGZ_6Z zT>eis`!Dy3eT3=vt#Lbc+;}i5XJf7zM3QneL{t?w=U<1rk7+z2Cu^|~=~54tAeSYF zsXHsU;nM0dpK>+71yo(NFLV-^Lf7%U?Q$*q{^j04Gl71ya2)^j`nmJ$cmI9eFMjp+ z#)jKmi4lZc<;l>!={@jTm%?!5jS;6;c*Ml55~r6Y?22B^K3bPhKQ(ICc&z%w<4W1= zjTTtz_}IA$%kCqU)h#$!Yq>>2mVG}qYL}!avmCWYV}x4!YEeq)pgTp| zR;+skHuc7YXRLrcbYXt>?@pa{l^2pL>RrZ!22zMmi1ZR?nkaWF*`@XFK4jGh&Em3vn(l z3~^Q9&tM^eV=f^lccCUc9v02z%^n5VV6s$~k0uq5B#Ipd6`M1Kptg^v<2jiNdlAWQ z_MmtNEaeYIHaiuaFQdG&df7miiB5lZkSbg&kxY*Eh|KTW`Tk~VwKC~+-GoYE+pvwc{+nIEizq6!xP>7ZQ(S2%48l$Y98L zvs7s<&0ArXqOb*GdLH0>Yq-f!{I~e~Z@FUIPm?jzqFZvz9VeZLYNGO}>Vh<=!Er7W zS!X6RF^et7)IM1pq57z*^hP5w7HKSDd8jHX!*gkKrGc-GssrNu5H%7-cNE{h$!aEQK3g*qy;= z)}pxO8;}nLVYm_24@iEs8)R7i;Th0n4->&$8m6(LKCRd(yn7KY%QHu_f=*#e`H^U( z{u!`9JaRD?Z?23fEXrjx>A@+a!y-_oaDB)o@2s{2%A97-ctFfrN0cXQ@6aGH`X~Nr z144?qk;MzDU-cgQOLfT3-ZR#hKmYtKG*iGf4ZJ`|`9!^SkBDUUSJCba)>mM!)k~(z zdjUqB`)~!UObMHB1b$UItM$<0kwlqHH;c z=)+~bkOcIT7vI0Iy(wD)vsg9|oi##%Rgrq`Ek;pN)}lbpz`iv{F4K*{ZZ?Zjixxxr zY|SPl2NsXH+5pimj+MvbZ_+HrfvdC13|9Zs)Y=nW$z<0mhl}%irBSm5T3ZrN#2AhY z_ZrTmS(L`U#y}VZ@~QL9wUS6AnU*7LWS02Xyz`b>%rTml#Wb0yr>@c(Ym*40g;P{V zjV1XSHdU>oY!&Jh7MzhzUV8(9E+yl5UJYga>=0Ldjwtc`5!1>LxaB-kVW;IlSPs+0 zUBx=m8OKVp<`frNvMK>WMO(iKY%PuvqD+PK*vP6f?_o!O)MCW5Ic zv(%f5PLHyOJ2h@Yn_to@54Yq;fdoy40&sbe3A$4uUXHsHP_~K}h#)p&TyOx(~JE?y(IBAQKl}~VQjVC-c6oZwmESL;`Xth?2)-b6ImNcJi z;w|`Q*k?`L(+Dp}t(FocvzWB(%~9$EAB6_J6CrA}hMj-Vy*6iA$FdV}!lvk%6}M)4 zTf<)EbXr9^hveAav1yA?>O0aNEpv0&rju{(Gt|dP=AP%)uQm~OE7@+wEhILrRLt&E zoEsF^nz>4yK1|EOU*kM+9317S;+bb7?TJM2UUpc!%sDp}7!<`i=W!ot8*C&fpj>mk#qt~GCeqcy)?W6sl>eUnR%yCBR&Ow-rc|q;lhnI+f-%`6Xf)% zIYZru;27%vA{Qi2=J`PQC<28;tFx(V^sgXf>)8WNxxQwT14M9I6- z+V0@tiCiDkv`7r-06sJS8@s|Lf>mV+8h}SPT4ZGPSMaFK7_SMXH$3KN7b2V?iV-jA zh1!Z>2tv^HVbHnNUAf-wQW#zMV(h8=3x2Swd|-%AczEIWLcm~EAu7rc3s%56b;7ME zj}$pe#fc^314Mb9i)xH^_#({)tTD4hsoz!7XcHUh9*G|}?k=D?9LBkTm2?fgaIG(%%$DL#}a-_990rQBU+M;jrf zCcvgM`+oyZmsUqc?lly9axZfO)02l$TMS#I+jHYY`Uk!gtDv|@GBQ||uaG^n*QR3Q z@tV?D;R;KmkxSDQh<2DkDC1?m?jTvf2i^T;+}aYhzL?ymNZmdns2e)}2V>tDCRw{= zTV3q3ZQDkdZQHi3?y{@8Y@1!SZQHi(y7|qSx$~Vl=iX<2`@y3eSYpsBV zI`Q-6;)B=p(ZbX55C*pu1C&yqS|@Pytis3$VDux0kxKK}2tO&GC;cH~759o?W2V)2 z)`;U(nCHBE!-maQz%z#zoRNpJR+GmJ!3N^@cA>0EGg?OtgM_h|j1X=!4N%!`g~%hdI3%yz&wq4rYChPIGnSg{H%i>96! z-(@qsCOfnz7ozXoUXzfzDmr>gg$5Z1DK$z#;wn9nnfJhy6T5-oi9fT^_CY%VrL?l} zGvnrMZP_P|XC$*}{V}b^|Hc38YaZQESOWqA1|tiXKtIxxiQ%Zthz?_wfx@<8I{XUW z+LH%eO9RxR_)8gia6-1>ZjZB2(=`?uuX|MkX082Dz*=ep%hMwK$TVTyr2*|gDy&QOWu zorR#*(SDS{S|DzOU$<-I#JTKxj#@0(__e&GRz4NuZZLUS8}$w+$QBgWMMaKge*2-) zrm62RUyB?YSUCWTiP_j-thgG>#(ZEN+~bMuqT~i3;Ri`l${s0OCvCM>sqtIX?Cy`8 zm)MRz-s^YOw>9`aR#J^tJz6$S-et%elmR2iuSqMd(gr6a#gA_+=N(I6%Cc+-mg$?_1>PlK zbgD2`hLZ?z4S~uhJf=rraLBL?H#c$cXyqt{u^?#2vX2sFb z^EU-9jmp{IZ~^ii@+7ogf!n_QawvItcLiC}w^$~vgEi(mX79UwDdBg`IlF42E5lWE zbSibqoIx*0>WWMT{Z_NadHkSg8{YW4*mZ@6!>VP>ey}2PuGwo%>W7FwVv7R!OD32n zW6ArEJX8g_aIxkbBl^YeTy5mhl1kFGI#n>%3hI>b(^`1uh}2+>kKJh0NUC|1&(l)D zh3Barl&yHRG+Le2#~u>KoY-#GSF>v)>xsEp%zgpq4;V6upzm3>V&yk^AD}uIF{vIn zRN-^d4(Sk6ioqcK@EObsAi#Z-u&Hh#kZdv1rjm4u=$2QF<6$mgJ4BE0yefFI zT7HWn?f668n!;x>!CrbdA~lDfjX?)315k1fMR~lG)|X_o()w|NX&iYUTKxI2TLl|r z{&TWcBxP>*;|XSZ1GkL&lSg?XL9rR4Ub&4&03kf};+6$F)%2rsI%9W_i_P|P%Z^b@ zDHH2LV*jB@Izq0~E4F^j04+C|SFiV8{!bth%bz(KfCg42^ zGz5P7xor$)I4VX}Cf6|DqZ$-hG7(}91tg#AknfMLFozF1-R~KS3&5I0GNb`P1+hIB z?OPmW8md3RB6v#N{4S5jm@$WTT{Sg{rVEs*)vA^CQLx?XrMKM@*gcB3mk@j#l0(~2 z9I=(Xh8)bcR(@8=&9sl1C?1}w(z+FA2`Z^NXw1t(!rpYH3(gf7&m=mm3+-sls8vRq z#E(Os4ZNSDdxRo&`NiRpo)Ai|7^GziBL6s@;1DZqlN@P_rfv4Ce1={V2BI~@(;N`A zMqjHDayBZ);7{j>)-eo~ZwBHz0eMGRu`43F`@I0g!%s~ANs>Vum~RicKT1sUXnL=gOG zDR`d=#>s?m+Af1fiaxYxSx{c5@u%@gvoHf#s6g>u57#@#a2~fNvb%uTYPfBoT_$~a^w96(}#d;-wELAoaiZCbM zxY4fKlS6-l1!b1!yra|`LOQoJB))=CxUAYqFcTDThhA?d}6FD$gYlk**!# zD=!KW>>tg1EtmSejwz{usaTPgyQm~o+NDg`MvNo)*2eWX*qAQ)4_I?Pl__?+UL>zU zvoT(dQ)pe9z1y}qa^fi-NawtuXXM>*o6Al~8~$6e>l*vX)3pB_2NFKR#2f&zqbDp7 z5aGX%gMYRH3R1Q3LS91k6-#2tzadzwbwGd{Z~z+fBD5iJ6bz4o1Rj#7cBL|x8k%jO z{cW0%iYUcCODdCIB(++gAsK(^OkY5tbWY;)>IeTp{{d~Y#hpaDa-5r#&Ha?+G{tn~ zb(#A1=WG1~q1*ReXb4CcR7gFcFK*I6Lr8bXLt9>9IybMR&%ZK15Pg4p_(v5Sya_70 ziuUYG@EBKKbKYLWbDZ)|jXpJJZ&bB|>%8bcJ7>l2>hXuf-h5Bm+ zHZ55e9(Sg>G@8a`P@3e2(YWbpKayoLQ}ar?bOh2hs89=v+ifONL~;q(d^X$7qfw=; zENCt`J*+G;dV_85dL3Tm5qz2K4m$dvUXh>H*6A@*)DSZ2og!!0GMoCPTbcd!h z@fRl3f;{F%##~e|?vw6>4VLOJXrgF2O{)k7={TiDIE=(Dq*Qy@oTM*zDr{&ElSiYM zp<=R4r36J69aTWU+R9Hfd$H5gWmJ?V){KU3!FGyE(^@i!wFjeZHzi@5dLM387u=ld zDuI1Y9aR$wW>s#I{2!yLDaVkbP0&*0Rw%6bi(LtieJQ4(1V!z!ec zxPd)Ro0iU%RP#L|_l?KE=8&DRHK>jyVOYvhGeH+Dg_E%lgA(HtS6e$v%D7I;JSA2x zJyAuin-tvpN9g7>R_VAk2y;z??3BAp?u`h-AVDA;hP#m+Ie`7qbROGh%_UTW#R8yfGp<`u zT0}L)#f%(XEE)^iXVkO8^cvjflS zqgCxM310)JQde*o>fUl#>ZVeKsgO|j#uKGi)nF_ur&_f+8#C0&TfHnfsLOL|l(2qn zzdv^wdTi|o>$q(G;+tkTKrC4rE)BY?U`NHrct*gVx&Fq2&`!3htkZEOfODxftr4Te zoseFuag=IL1Nmq45nu|G#!^@0vYG5IueVyabw#q#aMxI9byjs99WGL*y)AKSaV(zx z_`(}GNM*1y<}4H9wYYSFJyg9J)H?v((!TfFaWx(sU*fU823wPgN}sS|an>&UvI;9B(IW(V)zPBm!iHD} z#^w74Lpmu7Q-GzlVS%*T-z*?q9;ZE1rs0ART4jnba~>D}G#opcQ=0H)af6HcoRn+b z<2rB{evcd1C9+1D2J<8wZ*NxIgjZtv5GLmCgt?t)h#_#ke{c+R6mv6))J@*}Y25ef z&~LoA&qL-#o=tcfhjH{wqDJ;~-TG^?2bCf~s0k4Rr!xwz%Aef_LeAklxE=Yzv|3jf zgD0G~)e9wr@)BCjlY84wz?$NS8KC9I$wf(T&+79JjF#n?BTI)Oub%4wiOcqw+R`R_q<`dcuoF z%~hKeL&tDFFYqCY)LkC&5y(k7TTrD>35rIAx}tH4k!g9bwYVJ>Vdir4F$T*wC@$08 z9Vo*Q0>*RcvK##h>MGUhA9xix+?c1wc6xJhn)^9;@BE6i*Rl8VQdstnLOP1mq$2;!bfASHmiW7|=fA{k$rs^-8n{D6_ z!O0=_K}HvcZJLSOC6z-L^pl3Gg>8-rU#Sp1VHMqgXPE@9x&IHe;K3;!^SQLDP1Gk&szPtk| z!gP;D7|#y~yVQ?sOFiT*V(Z-}5w1H6Q_U5JM#iW16yZiFRP1Re z6d4#47#NzEm};1qRP9}1;S?AECZC5?6r)p;GIW%UGW3$tBN7WTlOy|7R1?%A<1!8Z zWcm5P6(|@=;*K&3_$9aiP>2C|H*~SEHl}qnF*32RcmCVYu#s!C?PGvhf1vgQ({MEQ z0-#j>--RMe{&5&$0wkE87$5Ic5_O3gm&0wuE-r3wCp?G1zA70H{;-u#8CM~=RwB~( zn~C`<6feUh$bdO1%&N3!qbu6nGRd5`MM1E_qrbKh-8UYp5Bn)+3H>W^BhAn;{BMii zQ6h=TvFrK)^wKK>Ii6gKj}shWFYof%+9iCj?ME4sR7F+EI)n8FL{{PKEFvB65==*@ ztYjjVTJCuAFf8I~yB-pN_PJtqH&j$`#<<`CruB zL=_u3WB~-;t3q)iNn0eU(mFTih<4nOAb>1#WtBpLi(I)^zeYIHtkMGXCMx+I zxn4BT0V=+JPzPeY=!gAL9H~Iu%!rH0-S@IcG%~=tB#6 z3?WE7GAfJ{>GE{?Cn3T!QE}GK9b*EdSJ02&x@t|}JrL{^wrM@w^&})o;&q816M5`} zv)GB;AU7`haa1_vGQ}a$!m-zkV(+M>q!vI0Swo18{;<>GYZw7-V-`G#FZ z;+`vsBihuCk1RFz1IPbPX8$W|nDk6yiU8Si40!zy{^nmv_P1=2H*j<^as01|W>BQS zU)H`NU*-*((5?rqp;kgu@+hDpJ;?p8CA1d65)bxtJikJal(bvzdGGk}O*hXz+<}J? zLcR+L2OeA7Hg4Ngrc@8htV!xzT1}8!;I6q4U&S$O9SdTrot<`XEF=(`1{T&NmQ>K7 zMhGtK9(g1p@`t)<)=eZjN8=Kn#0pC2gzXjXcadjHMc_pfV(@^3541)LC1fY~k2zn&2PdaW`RPEHoKW^(p_b=LxpW&kF?v&nzb z1`@60=JZj9zNXk(E6D5D}(@k4Oi@$e2^M%grhlEuRwVGjDDay$Qpj z`_X-Y_!4e-Y*GVgF==F0ow5MlTTAsnKR;h#b0TF>AyJe`6r|%==oiwd6xDy5ky6qQ z)}Rd0f)8xoNo)1jj59p;ChIv4Eo7z*{m2yXq6)lJrnziw9jn%Ez|A-2Xg4@1)ET2u zIX8`u5M4m=+-6?`S;?VDFJkEMf+=q?0D7?rRv)mH=gptBFJGuQo21rlIyP>%ymGWk z=PsJ>>q~i>EN~{zO0TklBIe(8i>xkd=+U@;C{SdQ`E03*KXmWm4v#DEJi_-F+3lrR z;0al0yXA&axWr)U%1VZ@(83WozZbaogIoGYpl!5vz@Tz5?u36m;N=*f0UY$ssXR!q zWj~U)qW9Q9Fg9UW?|XPnelikeqa9R^Gk77PgEyEqW$1j=P@L z*ndO!fwPeq_7J_H1Sx>#L$EO_;MfYj{lKuD8ZrUtgQLUUEhvaXA$)-<61v`C=qUhI zioV&KR#l50fn!-2VT`aMv|LycLOFPT{rRSRGTBMc)A`Cl%K&4KIgMf}G%Qpb2@cB* zw8obt-BI3q8Lab!O<#zeaz{P-lI2l`2@qrjD+Qy)^VKks5&SeT(I)i?&Kf59{F`Rw zuh7Q>SQNwqLO%cu2lzcJ7eR*3!g}U)9=EQ}js-q{d%h!wl6X3%H0Z2^8f&^H;yqti4z6TNWc& zDUU8YV(ZHA*34HHaj#C43PFZq7a>=PMmj4+?C4&l=Y-W1D#1VYvJ1~K%$&g-o*-heAgLXXIGRhU zufonwl1R<@Kc8dPKkb`i5P9VFT_NOiRA=#tM0WX2Zut)_ zLjAlJS1&nnrL8x8!o$G+*z|kmgv4DMjvfnvH)7s$X=-nQC3(eU!ioQwIkaXrl+58 z@v)uj$7>i`^#+Xu%21!F#AuX|6lD-uelN9ggShOX&ZIN+G#y5T0q+RL*(T(EP)(nP744-ML= z+Rs3|2`L4I;b=WHwvKX_AD56GU+z92_Q9D*P|HjPYa$yW0o|NO{>4B1Uvq!T;g_N- zAbNf%J0QBo1cL@iahigvWJ9~A4-glDJEK?>9*+GI6)I~UIWi>7ybj#%Po}yT6d6Li z^AGh(W{NJwz#a~Qs!IvGKjqYir%cY1+8(5lFgGvl(nhFHc7H2^A(P}yeOa_;%+bh` zcql{#E$kdu?yhRNS$iE@F8!9E5NISAlyeuOhRD)&xMf0gz^J927u5aK|P- z>B%*9vSHy?L_q)OD>4+P;^tz4T>d(rqGI7Qp@@@EQ-v9w-;n;7N05{)V4c7}&Y^!`kH3}Q z4RtMV6gAARY~y$hG7uSbU|4hRMn97Dv0$Le@1jDIq&DKy{D$FOjqw{NruxivljBGw zP4iM(4Nrz^^~;{QBD7TVrb6PB=B$<-e9!0QeE8lcZLdDeb?Gv$ePllO2jgy&FSbW* zSDjDUV^=`S(Oo0;k(Idvzh}aXkfO)F6AqB?wWqYJw-1wOn5!{-ghaHb^v|B^92LmQ9QZj zHA&X)fd%B$^+TQaM@FPXM$$DdW|Vl)4bM-#?Slb^qUX1`$Yh6Lhc4>9J$I4ba->f3 z9CeGO>T!W3w(){M{OJ+?9!MK68KovK#k9TSX#R?++W4A+N>W8nnk**6AB)e;rev=$ zN_+(?(YEX;vsZ{EkEGw%J#iJYgR8A}p+iW;c@V>Z1&K->wI>!x-+!0*pn|{f=XA7J zfjw88LeeJgs4YI?&dHkBL|PRX`ULOIZlnniTUgo-k`2O2RXx4FC76;K^|ZC6WOAEw zz~V0bZ29xe=!#Xk?*b{sjw+^8l0Koy+e7HjWXgmPa4sITz+$VP!YlJ$eyfi3^6gGx6jZLpbUzX;!Z6K}aoc!1CRi zB6Lhwt%-GMcUW;Yiy6Y7hX(2oksbsi;Z6k*=;y;1!taBcCNBXkhuVPTi+1N*z*}bf z`R=&hH*Ck5oWz>FR~>MO$3dbDSJ!y|wrff-H$y(5KadrA_PR|rR>jS=*9&J*ykWLr z-1Z^QOxE=!6I z%Bozo)mW7#2Hd$-`hzg=F@6*cNz^$#BbGlIf${ZV1ADc}sNl=B72g`41|F7JtZ^BT z+y}nqn3Ug`2scS_{MjykPW2~*k$i6PhvvxJCW;n!SK5B8Rpm41fCEdy=ea-4F`rN5 zF>ClKp#4?}pI7eR#6U|}t`DA!GQJB7nT$HVV*{qPjIRU1Ou3W;I^pCt54o|ZHvWaH zooFx9L%#yv)!P;^er5LCU$5@qXMhJ-*T5Ah8|}byGNU5oMp3V)yR;hWJKojJEregX z<1UPt%&~=5OuP(|B{ty);vLdoe7o^?`tkQa7zoXKAW6D@lc+FTzucotaOfJ!(Bm zHE8f8j@6||lH`y2<&hP}Q1wr(=6ze0D6NRL{7QaE1=nTAzqjIeD}Be&@#_d*dyurz z&L7xo-D9!dS`i>^GaIPArR@r=N#-ppIh!UBcb!N*?nLUO+*%C>_dCF1IH)q>5oT(t zjQo{AoDB;mWL;3&;vTt?;bvJSj>^Gq4Jrh}S}D>G)+b!>oRDWI?c_d77$kF5ms{Gx zak*>~*5AvaB-Xl)IgdZ^Cupv6HxQ0 zM(KPaDpPsPOd)e)aFw}|=tfzg@J1P8oJx2ZBY=g4>_G(Hkgld(u&~jN((eJ}5@b1} zI(P7j443AZj*I@%q!$JQ2?DZV47U!|Tt6_;tlb`mSP3 z74DE4#|1FMDqwYbT4P6#wSI%s?*wDc>)MR$4z9ZtJg04+CTUds>1JSDwI}=vpRoRR zLqx(Tvf34CvkTMOPkoH~$CG~fSZb;(2S4Q6Vpe9G83V={hwQ>acu+MCX)@0i>Vd`% z4I8Ye+7&Kcbh(*bN1etKmrpN)v|=eI+$oD=zzii6nP&w|kn2Y-f!(v<aE zKmOz#{6PZB(8zD={il`RO6D}v(@mN_66KXUAEefgg|;VmBfP?UrfB$&zaRw7oanna zkNmVGz4Vhd!vZSnp1(&_5^t;eSv6O771BloJAHi=Pnn+aa6y(e2iiE97uZ{evzQ^8 z*lN@ZYx<-hLXP^IuYLGf<01O*>nDp0fo;;Iyt`JADrxt7-jEF(vv_btyp6CT8=@5t zm`I0lW+2+_xj2CRL|40kcYysuyYeiGihGe&a)yilqP}5h+^)m8$=mzrUe`$(?BIY> zfF7-V10Gu0CkWF)wz04&hhI>es0NS7d`cnT`4y8K!wUAKv$H09fa>KeNQvwUNDT1zn}_*RHykC$CD%*h7vRCQ&Z z4&N-!L>(@8i?K$l5)13n0%VPPV`iG7Q$2{1T3JypLSvN%1kX73goBIOEmg=Uf$9e? zm}g>JFu}EQKH>|K!)m9teoCmTc`y2Ll}msZYyy0Pkqjeid66>DP_?C{KCw94lHvLW z-+X!2YSm70s833lH0o+|A%Xwsw`@8lE3ia0n_Dve;LC7@I+i~@%$lD|3fNf&R6ob6 z@iGfx^OC4s`$|vO!0jTWwVpX;X^EqJF{i324I>N=f@u+rTN+xJGGR0LsCQc;iFD=F zbZJrgOpS;04o^wP7HF5QBaJ$KJgS2V4u02ViWD=6+7rcu`uc&MOoyf%ZBU|gQZkUg z<}ax>*Fo?d*77Ia)+{(`X45{a8>Bi$u-0BWSteyp#GJnTs?&k&<0NeHA$Qb3;SAJK zl}H*~eyD-0qHI3SEcn`_7d zq@YRsFdBig+k490BZSQwW)j}~GvM7x>2ymO4zakaHZ!q6C2{fz^NvvD8+e%7?BQBH z-}%B{oROo2+|6g%#+XmyyIJrK_(uEbg%MHlBn3^!&hWi+9c0iqM69enep#5FvV_^r z?Yr(k*5FbG{==#CGI1zU0Wk{V?UGhBBfv9HP9A-AmcJmL^f4S zY3E2$WQa&n#WRQ5DOqty_Pu z-NWQGCR^Hnu^Vo2rm`-M>zzf|uMCUd1X0{wISJL2Pp=AO5 zF@(50!g|SYw3n<_VP0T~`WUjtY**6Npphr5bD%i3#*p7h8$#;XTLJAt5J-x~O1~`z z`2C~P4%XSI(JbrEmVMEwqdsa^aqXWg;A6KBn^jDxTl!}Q!^WhprL$kb(Iqq zUS`i$tIPs#hdE-zAaMGoxcG?Z;RO2L0Y|gcjV_)FFo|e)MtTl`msLTwq>po$`H6_U zhdWK97~M>idl9GE_WgobQkK_P85H_0jN?s3O)+m&68B`_;FnbZ3W*Qm++ghSs7|T4b7m~VVV%j0gl`Iw!?+-9#Lsb!j3O%fSTVuK z37V>qM81D+Atl};23`TqEAfEkQDpz$-1$e__>X2jN>xh@Sq)I6sj@< ziJ^66GSmW9c%F7eu6&_t$UaLXF4KweZecS1ZiHPWy-$e_7`jVk74OS*!z=l#(CQ^K zW-ke|g^&0o=hn+4uh-8lUh0>!VIXXnQXwKr>`94+2~<;+`k z$|}QZ>#pm2g}8k*;)`@EnM~ZQtci%_$ink9t6`HP{gn}P1==;WDAld3JX?k%^GcTU za>m|CH|UsyFhyJBwG5=`6562hkVRMQ=_ron-Vlm$4bG^GFz|Jh5mM{J1`!!hAr~8F^w> z^YhQ=c|bFn_6~9X$v(30v$5IX;#Nl-XXRPgs{g_~RS*znH^6Vhe}8>T?aMA|qfnWO zQpf(wr^PfygfM+m2u!9}F|frrZPBQ!dh(varsYo!tCV)WA(Wn^_t=WR_G7cQU`AGx zrK^B6<}9+$w;$vra)QWMKf_Tnqg93AMVZ6Qd=q6rdB{;ZhsoT zWy9QhnpEnc@Dauz4!8gq zqDanAX#$^vf-4~ZqUJtSe?SO+Hmb?)l2#}v(8}2+P{ZZuhlib0$3G0|a5?JR>QgUUP$HTE5hb`h>imq#7P+Y*-UVLm@9km|V# zoigziFt$bxgQMwqKKhd!c--&ciywIED>faY3zHLrA{V#IA)!mq!FXxf?1coGK~N(b zjwu*@2B1^(bzFVBJO`4EJ$=it!a0kbgUvPL;Er(0io{W4G7Bkqh)=g)uS|l0YfD}f zaCJwY7vR-D=P9M68`cmtmQ^!F-$lt@0S|9G7cHgT13A0xMv)HmH#Z<4{~iYo_VOD{ z5!kU+>mUOvHouw+-y?*cNlUlDwD#;6ZvAIc$YcwG&qKZFh>EtM(Eda+w)E$HcfZyB zG*$<*ae_ApE%gxWx%O^~XMnRSNLv!y`g99F(J_m)spJAc95P|_joOIoru%atbw z9PYgkcE*8x#)-W{>96KDl&74iW<#wrK)1s zxzU{`rW5af+dT6Z@_1dG<}CtDMT`EGVEXSL_5D9)Z;6UJe-TW7)M?bY%E;8G?Yc!$ zic;F5=#dba^P~7f#qvC}Nd#XEo2r_UlgfR_`B2^W0QjXU?RAi$>f&{G_Lu8Fp0qDp z?vAdm%z#3kcZmaJ@afooB=A@>8_N~O9Yzu=ZCEikM>UgU+{%>pPvmSNzGk@*jnc5~ z(Z#H4OL^gw>)gqZ!9X|3i4LAdp9vo)?F9QCR3##{BHoZ73Uk^Ha={2rc*TBijfKH- z=$cZQdc<5%*$kVo|{+bL3 zEoU&tq*YPR)^y-SISeQNQ)YZ9v>Hm4O=J)lf(y=Yu1ao&zj#5GVGxyj%V%vl9}dw< zO;@NRd4qe@Et}E@Q;SChBR2QPKll1{*5*jT*<$$5TywvC77vt=1=0xZ46>_17YzbiBoDffH(1_qFP7v2SVhZmA_7JDB50t#C39 z8V<9(E?bVWI<7d6MzcS^w!XmZ**{AO!~DZNU)pgr=yY1 zT@!AapE;yg&hmj*g{I3vd## zx+d%^O?d%%?Dba|l~X6ZOW|>FPsrjPjn-h4swysH!RNJUWofC?K(^0uHrBPrH5#W> zMn8^@USzjUucqo%+5&))Dnnw`5l1mp>roaA99Nkk4keZl2wAF7oa(!x?@8uGWzc5Q zM}g`}zf-D@B6lVFYWmmJ8a+_%z8g$C7Ww~PD9&jki08NY!b!fK288R;E?e3Z+Pk{is%HxQU`xu9+y5 zq?DWJD7kKp(B2J$t5Ij8-)?g!T9_n<&0L8F5-D0dp>9!Qnl#E{eDtkNo#lw6rMJG$ z9Gz_Z&a_6ie?;F1Y^6I$Mg9_sml@-z6t!YLr=ml<6{^U~UIbZUUa_zy>fBtR3Rpig zc1kLSJj!rEJILzL^uE1mQ}hjMCkA|ZlWVC9T-#=~ip%McP%6QscEGlYLuUxDUC=aX zCK@}@!_@~@z;70I+Hp5#Tq4h#d4r!$Np1KhXkAGlY$ap7IZ9DY})&(xoTyle8^dBXbQUhPE6ehWHrfMh&0=d<)E2+pxvWo=@`^ zIk@;-$}a4zJmK;rnaC)^a1_a_ie7OE*|hYEq1<6EG>r}!XI9+(j>oe!fVBG%7d}?U z#ja?T@`XO(;q~fe2CfFm-g8FbVD;O7y9c;J)k0>#q7z-%oMy4l+ zW>V~Y?s`NoXkBeHlXg&u*8B7)B%alfYcCriYwFQWeZ6Qre!4timF`d$=YN~_fPM5Kc8P;B-WIDrg^-j=|{Szq6(TC)oa!V7y zLmMFN1&0lM`+TC$7}on;!51{d^&M`UW ztI$U4S&}_R?G;2sI)g4)uS-t}sbnRoXVwM!&vi3GfYsU?fSI5Hn2GCOJ5IpPZ%Y#+ z=l@;;{XiY_r#^RJSr?s1) z4b@ve?p5(@YTD-<%79-%w)Iv@!Nf+6F4F1`&t~S{b4!B3fl-!~58a~Uj~d4-xRt`k zsmGHs$D~Wr&+DWK$cy07NH@_z(Ku8gdSN989efXqpreBSw$I%17RdxoE<5C^N&9sk!s2b9*#}#v@O@Hgm z2|U7Gs*@hu1JO$H(Mk)%buh~*>paY&Z|_AKf-?cz6jlT-v6 zF>l9?C6EBRpV2&c1~{1$VeSA|G7T(VqyzZr&G>vm87oBq2S%H0D+RbZm}Z`t5Hf$C zFn7X*;R_D^ z#Ug0tYczRP$s!6w<27;5Mw0QT3uNO5xY($|*-DoR1cq8H9l}_^O(=g5jLnbU5*SLx zGpjfy(NPyjL`^Oln_$uI6(aEh(iS4G=$%0;n39C(iw79RlXG>W&8;R1h;oVaODw2nw^v{~`j(1K8$ z5pHKrj2wJhMfw0Sos}kyOS48Dw_~=ka$0ZPb!9=_FhfOx9NpMxd80!a-$dKOmOGDW zi$G74Sd(-u8c!%35lL|GkyxZdlYUCML{V-Ovq{g}SXea9t`pYM^ioot&1_(85oVZ6 zUhCw#HkfCg7mRT3|>99{swr3FlA@_$RnE?714^o;vps4j4}u=PfUAd zMmV3j;Rogci^f!ms$Z;gqiy7>soQwo7clLNJ4=JAyrz;=*Yhe8q7*$Du970BXW89Xyq92M4GSkNS-6uVN~Y4r7iG>{OyW=R?@DmRoi9GS^QtbP zFy2DB`|uZTv8|ow|Jcz6?C=10U$*_l2oWiacRwyoLafS!EO%Lv8N-*U8V+2<_~eEA zgPG-klSM19k%(%;3YM|>F||hE4>7GMA(GaOvZBrE{$t|Hvg(C2^PEsi4+)w#P4jE2XDi2SBm1?6NiSkOp-IT<|r}L9)4tLI_KJ*GKhv16IV}An+Jyx z=Mk`vCXkt-qg|ah5=GD;g5gZQugsv!#)$@ zkE=6=6W9u9VWiGjr|MgyF<&XcKX&S3oN{c{jt-*1HHaQgY({yjZiWW97rha^TxZy< z2%-5X;0EBP>(Y9|x*603*Pz-eMF5*#4M;F`QjTBH>rrO$r3iz5 z?_nHysyjnizhZQMXo1gz7b{p`yZ8Q78^ zFJ3&CzM9fzAqb6ac}@00d*zjW`)TBzL=s$M`X*0{z8$pkd2@#4CGyKEhzqQR!7*Lo@mhw`yNEE6~+nF3p;Qp;x#-C)N5qQD)z#rmZ#)g*~Nk z)#HPdF_V$0wlJ4f3HFy&fTB#7Iq|HwGdd#P3k=p3dcpfCfn$O)C7;y;;J4Za_;+DEH%|8nKwnWcD zBgHX)JrDRqtn(hC+?fV5QVpv1^3=t2!q~AVwMBXohuW@6p`!h>>C58%sth4+Baw|u zh&>N1`t(FHKv(P+@nT$Mvcl){&d%Y5dx|&jkUxjpUO3ii1*^l$zCE*>59`AvAja%`Bfry-`?(Oo?5wY|b4YM0lC?*o7_G$QC~QwKslQTWac z#;%`sWIt8-mVa1|2KH=u!^ukn-3xyQcm4@|+Ra&~nNBi0F81BZT$XgH@$2h2wk2W% znpo1OZuQ1N>bX52II+lsnQ`WVUxmZ?4fR_f0243_m`mbc3`?iy*HBJI)p2 z`GQ{`uS;@;e1COn-vgE2D!>EheLBCF-+ok-x5X8Cu>4H}98dH^O(VlqQwE>jlLcs> zNG`aSgDNHnH8zWw?h!tye^aN|%>@k;h`Z_H6*py3hHO^6PE1-GSbkhG%wg;+vVo&dc)3~9&` zPtZtJyCqCdrFUIEt%Gs_?J``ycD16pKm^bZn>4xq3i>9{b`Ri6yH|K>kfC; zI5l&P)4NHPR)*R0DUcyB4!|2cir(Y1&Bsn3X8v4D(#QW8Dtv@D)CCO zadQC85Zy=Rkrhm9&csynbm>B_nwMTFah9ETdNcLU@J{haekA|9*DA2pY&A|FS*L!*O+>@Q$00FeL+2lg2NWLITxH5 z0l;yj=vQWI@q~jVn~+5MG!mV@Y`gE958tV#UcO#56hn>b69 zM;lq+P@MW=cIvIXkQmKS$*7l|}AW%6zETA2b`qD*cL z(=k4-4=t6FzQo#uMXVwF{4HvE%%tGbiOlO)Q3Y6D<5W$ z9pm>%TBUI99MC`N9S$crpOCr4sWJHP)$Zg#NXa~j?WeVo03P3}_w%##A@F|Bjo-nNxJZX%lbcyQtG8sO zWKHes>38e-!hu1$6VvY+W-z?<942r=i&i<88UGWdQHuMQjWC-rs$7xE<_-PNgC z_aIqBfG^4puRkogKc%I-rLIVF=M8jCh?C4!M|Q=_kO&3gwwjv$ay{FUDs?k7xr%jD zHreor1+#e1_;6|2wGPtz$``x}nzWQFj8V&Wm8Tu#oaqM<$BLh+Xis=Tt+bzEpC}w) z_c&qJ6u&eWHDb<>p;%F_>|`0p6kXYpw0B_3sIT@!=fWHH`M{FYdkF}*CxT|`v%pvx z#F#^4tdS0|O9M1#db%MF(5Opy;i( zL(Pc2aM4*f_Bme@o{xMrsO=)&>YKQw+)P-`FwEHR4vjU>#9~X7ElQ#sRMjR^Cd)wl zg^67Bgn9CK=WP%Ar>T4J!}DcLDe z=ehSmTp##KyQ78cmArL=IjOD6+n@jHCbOatm)#4l$t5YV?q-J86T&;>lEyK&9(XLh zr{kPuX+P8LN%rd%8&&Ia)iKX_%=j`Mr*)c)cO1`-B$XBvoT3yQCDKA>8F0KL$GpHL zPe?6dkE&T+VX=uJOjXyrq$BQ`a8H@wN1%0nw4qBI$2zBx)ID^6;Ux+? zu{?X$_1hoz9d^jkDJpT-N6+HDNo%^MQ2~yqsSBJj4@5;|1@w+BE04#@Jo4I63<~?O?ok%g%vQakTJKpMsk&oeVES1>cnaF7ZkFpqN6lx` zzD+YhR%wq2DP0fJCNC}CXK`g{AA6*}!O}%#0!Tdho4ooh&a5&{xtcFmjO4%Kj$f(1 zTk||{u|*?tAT{{<)?PmD_$JVA;dw;UF+x~|!q-EE*Oy?gFIlB*^``@ob2VL?rogtP z0M34@?2$;}n;^OAV2?o|zHg`+@Adk+&@Syd!rS zWvW$e5w{onua4sp+jHuJ&olMz#V53Z5y-FkcJDz>Wk%_J>COk5<0ya*aZLZl9LH}A zJhJ`Q-n9K+c8=0`FWE^x^xn4Fa7PDUc;v2+us(dSaoIUR4D#QQh91R!${|j{)=Zy1 zG;hqgdhSklM-VKL6HNC3&B(p1B)2Nshe7)F=-HBe=8o%OhK1MN*Gq6dBuPvqDRVJ{ z;zVNY?wSB%W0s^OMR_HL(Ws)va7eWGF*MWx<1wG7hZ}o=B62D?i|&0b14_7UG287YDr%?aYMMpeCkY1i`b+H!J9sqrvKc#Y6c8At@QiLSwj)@ifz~Z|c$lOMA@?cPqFRmZ%_>bz2X4(B=`^3;MDjsEeAO=? zSoD&+L>A|fGt7+6kF2@LqhL06sD%|~YsIe=EcWqy{e_61N_D(*CacnMvyXMjP87HI z4PT6!$fzxx{}=>jeqzkkoN+!r9e|@lZUN4pn(T28v`k=_vIhTn^i9O3qTqd)-%!QQ zYB6*6B@&b(!#X4C~59SLZuorNU_wWZA36{>O%iX)VS5NNZh49C_ppI>?)wwml}_0MLzOXT>lmo#&Ew6d?mu8~~I_^4VGBQtCAke;RQa5DL` z1PFDPsKb3CS$v;RhlQ1J@AHa1VRuuxp}NOIvrC>4$$A0Ix0VpAc0lfG%8{mR{TRQ( zbXM#1Tci3H*Wt>cVuMta^6^z`=^B@j+YhJqq9?>zZPxyg2U(wvod=uwJs{8gtpyab zXHQX<0FOGW6+dw&%c_qMUOI^+Rnb?&HB7Fee|33p4#8i>%_ev(aTm7N1f#6lV%28O zQ`tQh$VDjy8x(Lh#$rg1Kco$Bw%gULq+lc4$&HFGvLMO30QBSDvZ#*~hEHVZ`5=Kw z3y^9D512@P%d~s{x!lrHeL4!TzL`9(ITC97`Cwnn8PSdxPG@0_v{No|kfu3DbtF}K zuoP+88j4dP+Bn7hlGwU$BJy+LN6g&d3HJWMAd1P9xCXG-_P)raipYg5R{KQO$j;I9 z1y1cw#13K|&kfsRZ@qQC<>j=|OC?*v1|VrY$s=2!{}e33aQcZghqc@YsHKq^)kpkg z>B;CWNX+K=u|y#N)O>n5YuyvPl5cO6B^scmG?J zC8ix)E1PlhNaw8FpD+b|D$z`Id^4)rJe78MNiBga?Z- z0$L&MRTieSB1_E#KaN*H#Ns1}?zOA%Ybr{G+Sn3moXTVZj=L`nt?D&-MjOMz-Yq&@ z$P3h23d_F8Dcf*?txX7}p>nM*s+65t z1il8bHHsBynUK|aEXSjzY6sz1nZ%|%XeWTcGLRyRl@q4YAR)JovbdTTY&7u>@}28A zgV^Npp?}I!?3K7IXu9ml-Lw;w@9m zBYTeU+Seh8uJ-w?4e_6byq0f7>O3xm(hO}Y=fgU5^vW|>0yQ^0+?}LT55ei$i zzlU-iRbd8TRX9Ept%h%ariV=%u%F@@FA>U*XdAalcH%>#5_a&w)g`uW%3}m?vP- zc5}DkuF6ruKDwEYj+2YTSQ9=rkp19U5P@(zRm(nLod(sG9{~nw1BUoS2OFDXa{xfw zZ~UaZLFUZxfQ*9?_X?*~`d;nn-BbaefLJ`DT13KF6?T5Mnt;v5d>H}s)aAIzJcs#B z|CuXPJKww}hWBKsUfks#Kh$)ptp?5U1b@ttXFRbe_BZ&_R9XC6CA4WhWhMUE9Y2H4 z{w#CBCR<)Fd1M;mx*m?Z=L-^1kv1WKtqG(BjMiR4M^5yN4rlFM6oGUS2Wf~7Z@e*- ze84Vr`Bmi!(a1y}-m^HHMpbAiKPVEv|(7=|}D#Ihfk+-S5Hlkfch02z&$(zS3vrYz2g*ic{xBy~*gIp(eG}^gMc7 zPu2Eivnp@BH3SOgx!aJXttx*()!=2)%Bf$Gs^4cCs@)=(PJNxhH5lVY&qSZYaa?A^LhZW`B9(N?fx<^gCb(VE%3QpA*_Pohgp6vCB36iVaq zc1TI%L2Le?kuv?6Dq`H+W>AqnjyEzUBK948|DB|)U0_4DzWF#7L{agwo%y$hC>->r z4|_g_6ZC!n2=GF4RqVh6$$reQ(bG0K)i9(oC1t6kY)R@DNxicxGxejwL2sB<>l#w4 zE$QkyFI^(kZ#eE5srv*JDRIqRp2Totc8I%{jWhC$GrPWVc&gE1(8#?k!xDEQ)Tu~e zdU@aD8enALmN@%1FmWUz;4p}41)@c>Fg}1vv~q>xD}KC#sF|L&FU);^Ye|Q;1#^ps z)WmmdQI2;%?S%6i86-GD88>r|(nJackvJ#50vG6fm$1GWf*f6>oBiDKG0Kkwb17KPnS%7CKb zB7$V58cTd8x*NXg=uEX8Man_cDu;)4+P}BuCvYH6P|`x-#CMOp;%u$e z&BZNHgXz-KlbLp;j)si^~BI{!yNLWs5fK+!##G;yVWq|<>7TlosfaWN-;C@oag~V`3rZM_HN`kpF`u1p# ztNTl4`j*Lf>>3NIoiu{ZrM9&E5H~ozq-Qz@Lkbp-xdm>FbHQ2KCc8WD7kt?=R*kG# z!rQ178&ZoU(~U<;lsg@n216Ze3rB2FwqjbZ=u|J?nN%<4J9(Bl(90xevE|7ejUYm9 zg@E_xX}u2d%O1mpA2XzjRwWinvSeg)gHABeMH(2!A^g@~4l%8e0WWAkBvv60Cr>TR zQB1%EQ zUoZeUdqjh+1gFo6h~C~z#A57mf5ibmq$y_uVtA_kWv8X)CzfVEooDaY!#P?5$Y zGPKXbE<75nc%D-|w4OrP#;87oL@2^4+sxKah;a-5&z_&SUf~-z(1}bP=tM^GYtR3a z!x4zjSa^)KWG6jxfUI#{<26g$iAI;o_+B{LXY@WfWEdEl6%#8s3@b`?&Tm#aSK!~| z^%DdrXnijW`d!ajWuKApw&{L+WCPpFialo&^dZ9jC7A%BO`2ZF&YUDe;Yu|zFuv`2 z)BE*7Lkay)M7uohJ)446X``0x0%PzPTWY92`1Oq4a2D_7V0wypPnXFR)WM0IlFgg@ zqz#hv2xJEQL8eu}O;e(w4rSA?5|eZHbS6jENytJBq59?bOf>Wrl8ySZH36H(6fGR#vHM6q zn}!7!I@4$*+LFXs{x?|=q2*QtYT%Lw3+5(8uc0j8o3}TrG(zSV#>4wo6~)u|R+Yx# z?0$AspZDjv{dfv417~C17Oy%Fal{%+B6H(NX`$Bl>II-L3N3 zZc+sKZbqewU*&_Xt;9k=%4*aVYBvE1n&JZS7Uqjd%n8nOQmzh^x#vWK{;In~=QO)g zT-n3OU(1@3QfL|$g1d2xeBb@O15Rl01+hmpup2De7p%Yrd$E7(In!*R+;IJZh}v!svi z;7N~pq8KZDXXap0qd_D=Y^B)rz4S0^SF=&v6YYTAV$ad43#x!+n~-6< zK{8*vWoAdW(gGGt&URD}@g6tMoY(+Lw=vvxhfIIK9AjvNF_(W}1Rxn(mp;tJfDV<0 zbJN0t(@Xb8UeO{&T{$$uDrs7)j$}=?WsuDl+T2N5Y<4TMHGOMcocPr$%~(yvtKv(n z`U96d!D0cb9>Dx2zz$m&lAhazs%UeR^K*gb>d8CPs+?qlpfA;t{InXa)^2ryC(FU(Zc6Xbnnh`lg`K&g^JeS>}^c0MJKUCfV+~ zV(EN0Z5ztoN;hqcj!8V+VRbSltJ<~|y`U+9#wv|~H zNE!j9uXa=dec@JQSgJ6N6@Il&tzCBJv9#ldR`Lm*<)YwH4tdlAlG0Fl8Nfa(J~c%DQ2AA-}x8D=p(l#n1+hgx;N;1Aq?lq@{Lt9FKu89CjnnHD1G_@p;%Lp`+b@ttb33!E_Xt;QUD9~nRQl&xAro9-{+&6^ljK2f-d>&qy&d#0xwH z@slNv@ULKp!Cf*JHuS@#4c?F->WjPc)yiuSargAIEg>muRxzY?Hzdq@G5CS)U1*Et zE2SLh=@DI1J(guiy2Igq(?(xI9WL%g^f@{5Hmr|!Qz4`vn|LjrtO=b~I6~5EU5Fxy z;-#<)6w#w=DkpSthAu+E;OL?!?6C9Mwt*o(@68(Jhvs-eX4V z=d=>HI|`3J%H5X|gSrC8KH^IL?h5=3ID6svwHH@(wRbSG`Zsor^q4`3PCn#-(YX?< z_q8+T)51$E0xyKR{L!LN(G=+9K6$3#PDT^IAe|Igkx=!4#rqKWoXiZdh`&ocjp=Ok zemJe6*{it~>;sr(B0fSmp(S#*y5I0)OOz~Oe6Im+($S}e3tyx7Y6pA8vKCBmSEQDa zLfkm*;uMbTLpcR0)tF_v-lbK%`5>POyI2E(!)2=Rj0p;WKi=|UNt6HsQv0xR3QIK9 zsew(AFyzH!7Azxum{%VC^`cqhGdGbABGQ4cYdNBPTx+XpJ=NUEDeP^e^w^AOE1pQI zP{Us-sk!v$gj}@684E!uWjzvpoF|%v-6hwnitN1sCSg@(>RDCVgU8Ile_-xX`hL6u zzI4*Q)AVu(-ef8{#~P9STQ5t|qIMRoh&S?7Oq+cL6vxG?{NUr@k(~7^%w)P6nPbDa~4Jw}*p-|cT4p1?)!c0FoB(^DNJ+FDg+LoP6=RgB7Or673WD5MG&C!4< zerd6q$ODkBvFoy*%cpHGKSt z3uDC6Sc=xvv@kDzRD)aIO`x}BaWLycA%(w-D`Pd+uL*rL|etagQ;U&xt_9?7#}=}5HI)cU-0 z%pMA`>Xb7s)|Y)4HKSZOu;{lg=KjeIyXb0{@EM`FTDkLRH`!W%z*lQJ74P%Ka76)H zblrSIzf+dMWbO`g;=(b@{pS)zUcO&GrIFe%&?YeX4r8B2bBArB%-5ZrQ+vonr%AYy z1+u0*K{UVUmV>h5vD!F;6}a%KdMZQLs04oGkpiaC)zI( zT2U9qta5o|6Y+It1)sE8>u&0)W~l$NX@ZQ8UZfB=`($EW6?FT%{EoRhOrb9)z@3r8y?Z99FNLDE;7V=Q zotj&igu*Rh^VQn3MQKBq!T{yTwGhn1YL6k*?j?{_ek5xe8#i#GG4S-a_Re2lssG!} z`Y-d0BcOdB@!m?4y&hMN68}#0-IIlm_xO)d#}ugX{q^OZe{-@LeJyv`cY&ze4t2~! zKb{qX-j;kt{?gC(vW%}X4pm@1F?~LH{^Q8d@X$dy@5ff~p!J3zmA>H`A)y+6RB_h* zZfIO+bd=*LiymRw{asW%xxaVl33_xtdVrrqIPn zc@y8oMJvNtgcO~4i0`f)GCFkWY8EF?4duLVjHTdb6oYLnO9}Q-pe{CKQJL)hV8)JI z$mVA0Dq&7Z1TbYdSC(WbJ+IBjXngZTu&I+vHF|>Zo$757{8lL;8Zr-Exkf?3jzN5k z_d9I>{>^J?!l)< zNd$7E9FVrta}3qy3L7Ys$^fRWNuu^hs^{*eXvazd&+Q*?lTfc>2+EdP(o0P_Z05HX zVKsfFAQ{t^CRu~Dw(CuJ>tvx*p$5@flA>QRl455b&{*U?xU8`)nF2T$uu_(l8VNtq z?pBiRQIckGzk8W&SFSB=g6eG`ZC;6v9w`?eF*S}3E@N`2ropeHP)E}o?qJkyVEI;K$!)bWY zt9>4WmDVJh7U~m$|K`T#hF!v|znj^=M;69uXrFys#51XT;DbMr4H)>7UQ1e2(cuQf z4kr~Tt1tpBB2GaJ(|j~lHgW40EgMMVqR6eJoJig1SBg|2=$~4I3P0eP$q%_`sS&4~ z26=&a&tLjQbch1`cVXa-2fTl1y8}->|Nqu?uVrNTov!=VKh)g89wUPTgAzkSKZ57_ zr=B^mcldE3K04t4{;RaG53&9yovq;@aR#VHx+R1^^*kr-vEEd!uea68Z<{R%_DD6fn&T4 zu;fDj07L-(_fLSJGdkeh&c&7A(ZLj`7iwnkAcqUexU;WjUkqeg1m1-IUZTIZA(4dtr2Gr`e{BIejlCgS<33MB=1!8?a74!F%=Uo7N`F@k} ze+1C_eU4Y_$mvdjci zwEtCIphA2PBzBhng5=M#e4r%)RW5rVD|_`PvY$7BK`}w~d>%0O9sY#*LUAq=^OjMF^PY5m<7!=s5jyRfosCQAo#hL`h5vN-M}6Q z0Li}){5?wi8)GVHNkF|U9*8V5ej)nhb^TLw1KqiPK(@{P1^L&P=`ZNt?_+}&0(8Uh zfyyZFPgMV7ECt;Jdw|`|{}b$w4&x77VxR>8wUs|GQ5FBf1UlvasqX$qfk5rI4>Wfr zztH>y`=daAef**C12yJ7;LDf&3;h3X+5@dGPy@vS(RSs3CWimbTp=g \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >&- +APP_HOME="`pwd -P`" +cd "$SAVED" >&- + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/microg-ui-tools/build.gradle b/microg-ui-tools/build.gradle new file mode 100644 index 00000000..4cd39d2e --- /dev/null +++ b/microg-ui-tools/build.gradle @@ -0,0 +1,52 @@ +/* + * Copyright 2013-2016 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. + */ + +buildscript { + repositories { + jcenter() + } + dependencies { + classpath 'com.android.tools.build:gradle:1.5.0' + } +} +apply plugin: 'com.android.library' + +String getMyVersionName() { + def stdout = new ByteArrayOutputStream() + exec { + commandLine 'git', 'describe', '--tags', '--always' + standardOutput = stdout + } + return stdout.toString().trim() +} + +android { + compileSdkVersion 23 + buildToolsVersion "23.0.2" + + defaultConfig { + versionName getMyVersionName() + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_6 + } +} + +dependencies { + compile 'com.android.support:support-v4:23.1.1' + compile 'com.android.support:appcompat-v7:23.1.1' +} diff --git a/microg-ui-tools/src/main/AndroidManifest.xml b/microg-ui-tools/src/main/AndroidManifest.xml new file mode 100644 index 00000000..958a9998 --- /dev/null +++ b/microg-ui-tools/src/main/AndroidManifest.xml @@ -0,0 +1,24 @@ + + + + + + + diff --git a/microg-ui-tools/src/main/java/android/support/v4/preference/PreferenceFragment.java b/microg-ui-tools/src/main/java/android/support/v4/preference/PreferenceFragment.java new file mode 100644 index 00000000..24070962 --- /dev/null +++ b/microg-ui-tools/src/main/java/android/support/v4/preference/PreferenceFragment.java @@ -0,0 +1,313 @@ +/* + * Copyright 2013-2016 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 android.support.v4.preference; + +import android.app.Activity; +import android.content.Context; +import android.content.Intent; +import android.os.Bundle; +import android.os.Handler; +import android.os.Message; +import android.preference.Preference; +import android.preference.PreferenceManager; +import android.preference.PreferenceScreen; +import android.support.v4.app.Fragment; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ListView; + +import java.lang.reflect.Constructor; +import java.lang.reflect.Method; + +public abstract class PreferenceFragment extends Fragment { + + private static final int FIRST_REQUEST_CODE = 100; + private static final int MSG_BIND_PREFERENCES = 1; + private static final String PREFERENCES_TAG = "android:preferences"; + private boolean mHavePrefs; + private boolean mInitDone; + private ListView mList; + private PreferenceManager mPreferenceManager; + + private Handler mHandler = new Handler() { + @Override + public void handleMessage(Message msg) { + switch (msg.what) { + + case MSG_BIND_PREFERENCES: + bindPreferences(); + break; + } + } + }; + + final private Runnable mRequestFocus = new Runnable() { + public void run() { + mList.focusableViewAvailable(mList); + } + }; + + private void bindPreferences() { + PreferenceScreen localPreferenceScreen = getPreferenceScreen(); + if (localPreferenceScreen != null) { + ListView localListView = getListView(); + localPreferenceScreen.bind(localListView); + } + } + + private void ensureList() { + if (mList == null) { + View view = getView(); + if (view == null) { + throw new IllegalStateException("Content view not yet created"); + } + + View listView = view.findViewById(android.R.id.list); + if (!(listView instanceof ListView)) { + throw new RuntimeException( + "Content has view with id attribute 'android.R.id.list' that is not a ListView class"); + } + + mList = (ListView) listView; + if (mList == null) { + throw new RuntimeException( + "Your content must have a ListView whose id attribute is 'android.R.id.list'"); + } + + mHandler.post(mRequestFocus); + } + } + + private void postBindPreferences() { + if (mHandler.hasMessages(MSG_BIND_PREFERENCES)) { + mHandler.obtainMessage(MSG_BIND_PREFERENCES).sendToTarget(); + } + } + + private void requirePreferenceManager() { + if (this.mPreferenceManager == null) { + throw new RuntimeException("This should be called after super.onCreate."); + } + } + + public void addPreferencesFromIntent(Intent intent) { + requirePreferenceManager(); + PreferenceScreen screen = inflateFromIntent(intent, getPreferenceScreen()); + setPreferenceScreen(screen); + } + + public void addPreferencesFromResource(int resId) { + requirePreferenceManager(); + PreferenceScreen screen = inflateFromResource(getActivity(), resId, getPreferenceScreen()); + setPreferenceScreen(screen); + } + + public Preference findPreference(CharSequence key) { + if (mPreferenceManager == null) { + return null; + } + return mPreferenceManager.findPreference(key); + } + + public ListView getListView() { + ensureList(); + return mList; + } + + public PreferenceManager getPreferenceManager() { + return mPreferenceManager; + } + + @Override + public void onActivityCreated(Bundle savedInstanceState) { + super.onActivityCreated(savedInstanceState); + getListView().setScrollBarStyle(0); + if (mHavePrefs) { + bindPreferences(); + } + mInitDone = true; + if (savedInstanceState != null) { + Bundle localBundle = savedInstanceState.getBundle(PREFERENCES_TAG); + if (localBundle != null) { + PreferenceScreen screen = getPreferenceScreen(); + if (screen != null) { + screen.restoreHierarchyState(localBundle); + } + } + } + } + + @Override + public void onActivityResult(int requestCode, int resultCode, Intent data) { + super.onActivityResult(requestCode, resultCode, data); + dispatchActivityResult(requestCode, resultCode, data); + } + + @Override + public void onCreate(Bundle paramBundle) { + super.onCreate(paramBundle); + mPreferenceManager = createPreferenceManager(); + } + + @Override + public View onCreateView(LayoutInflater paramLayoutInflater, ViewGroup paramViewGroup, + Bundle paramBundle) { + ListView listView = new ListView(paramLayoutInflater.getContext()); + listView.setId(android.R.id.list); + listView.setDrawSelectorOnTop(false); + listView.setPadding(12, 6, 12, 0); + //listView.setSelector(null); + return listView; + } + + @Override + public void onDestroy() { + super.onDestroy(); + dispatchActivityDestroy(); + } + + @Override + public void onDestroyView() { + mList = null; + mHandler.removeCallbacks(mRequestFocus); + mHandler.removeMessages(MSG_BIND_PREFERENCES); + super.onDestroyView(); + } + + @Override + public void onSaveInstanceState(Bundle bundle) { + super.onSaveInstanceState(bundle); + PreferenceScreen screen = getPreferenceScreen(); + if (screen != null) { + Bundle localBundle = new Bundle(); + screen.saveHierarchyState(localBundle); + bundle.putBundle(PREFERENCES_TAG, localBundle); + } + } + + @Override + public void onStop() { + super.onStop(); + dispatchActivityStop(); + } + + /** + * Access methods with visibility private * + */ + + private PreferenceManager createPreferenceManager() { + try { + Constructor c = PreferenceManager.class + .getDeclaredConstructor(Activity.class, int.class); + c.setAccessible(true); + return c.newInstance(this.getActivity(), FIRST_REQUEST_CODE); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + private PreferenceScreen getPreferenceScreen() { + try { + Method m = PreferenceManager.class.getDeclaredMethod("getPreferenceScreen"); + m.setAccessible(true); + return (PreferenceScreen) m.invoke(mPreferenceManager); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + private void setPreferenceScreen(PreferenceScreen preferenceScreen) { + try { + Method m = PreferenceManager.class + .getDeclaredMethod("setPreferences", PreferenceScreen.class); + m.setAccessible(true); + boolean result = (Boolean) m.invoke(mPreferenceManager, preferenceScreen); + if (result && preferenceScreen != null) { + mHavePrefs = true; + if (mInitDone) { + postBindPreferences(); + } + } + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + private void dispatchActivityResult(int requestCode, int resultCode, Intent data) { + try { + Method m = PreferenceManager.class + .getDeclaredMethod("dispatchActivityResult", int.class, int.class, + Intent.class); + m.setAccessible(true); + m.invoke(mPreferenceManager, requestCode, resultCode, data); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + private void dispatchActivityDestroy() { + try { + Method m = PreferenceManager.class.getDeclaredMethod("dispatchActivityDestroy"); + m.setAccessible(true); + m.invoke(mPreferenceManager); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + private void dispatchActivityStop() { + try { + Method m = PreferenceManager.class.getDeclaredMethod("dispatchActivityStop"); + m.setAccessible(true); + m.invoke(mPreferenceManager); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + public PreferenceScreen inflateFromResource(Context context, int resId, + PreferenceScreen rootPreferences) { + PreferenceScreen preferenceScreen; + try { + Method m = PreferenceManager.class + .getDeclaredMethod("inflateFromResource", Context.class, int.class, + PreferenceScreen.class); + m.setAccessible(true); + preferenceScreen = (PreferenceScreen) m + .invoke(mPreferenceManager, context, resId, rootPreferences); + } catch (Exception e) { + throw new RuntimeException(e); + } + return preferenceScreen; + } + + public PreferenceScreen inflateFromIntent(Intent queryIntent, + PreferenceScreen rootPreferences) { + PreferenceScreen preferenceScreen; + try { + Method m = PreferenceManager.class + .getDeclaredMethod("inflateFromIntent", Intent.class, PreferenceScreen.class); + m.setAccessible(true); + preferenceScreen = (PreferenceScreen) m + .invoke(mPreferenceManager, queryIntent, rootPreferences); + } catch (Exception e) { + throw new RuntimeException(e); + } + return preferenceScreen; + } +} diff --git a/microg-ui-tools/src/main/java/org/microg/tools/selfcheck/AbstractSelfCheckActivity.java b/microg-ui-tools/src/main/java/org/microg/tools/selfcheck/AbstractSelfCheckActivity.java new file mode 100644 index 00000000..885acd36 --- /dev/null +++ b/microg-ui-tools/src/main/java/org/microg/tools/selfcheck/AbstractSelfCheckActivity.java @@ -0,0 +1,65 @@ +/* + * Copyright 2013-2016 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 org.microg.tools.selfcheck; + +import android.os.Bundle; +import android.support.v7.app.AppCompatActivity; +import android.support.v7.widget.Toolbar; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ImageView; +import android.widget.TextView; + +import org.microg.tools.ui.R; + +import java.util.ArrayList; +import java.util.List; + +public abstract class AbstractSelfCheckActivity extends AppCompatActivity implements SelfCheckGroup.ResultCollector { + + protected abstract void prepareSelfCheckList(List checks); + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.self_check); + setSupportActionBar((Toolbar) findViewById(R.id.toolbar)); + + List selfCheckGroupList = new ArrayList(); + prepareSelfCheckList(selfCheckGroupList); + + for (SelfCheckGroup group : selfCheckGroupList) { + group.doChecks(this, this); + } + } + + public void addResult(String name, SelfCheckGroup.Result result, String resolution) { + if (result == null) return; + ViewGroup root = (ViewGroup) findViewById(R.id.self_check_root); + View resultEntry = LayoutInflater.from(this).inflate(R.layout.self_check_entry, root, false); + ((TextView) resultEntry.findViewById(R.id.self_check_name)).setText(name); + if (result == SelfCheckGroup.Result.Positive) { + ((ImageView) resultEntry.findViewById(R.id.self_check_result)).setImageResource(android.R.drawable.presence_online); + } else { + ((TextView) resultEntry.findViewById(R.id.self_check_resolution)).setText(resolution); + ((ImageView) resultEntry.findViewById(R.id.self_check_result)) + .setImageResource(result == SelfCheckGroup.Result.Negative ? android.R.drawable.presence_busy : android.R.drawable.presence_invisible); + } + root.addView(resultEntry); + } +} diff --git a/microg-ui-tools/src/main/java/org/microg/tools/selfcheck/SelfCheckGroup.java b/microg-ui-tools/src/main/java/org/microg/tools/selfcheck/SelfCheckGroup.java new file mode 100644 index 00000000..cc832597 --- /dev/null +++ b/microg-ui-tools/src/main/java/org/microg/tools/selfcheck/SelfCheckGroup.java @@ -0,0 +1,33 @@ +/* + * Copyright 2013-2016 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 org.microg.tools.selfcheck; + +import android.content.Context; + +public interface SelfCheckGroup { + String getGroupName(Context context); + + void doChecks(Context context, ResultCollector collector); + + interface ResultCollector { + void addResult(String name, Result value, String resolution); + } + + enum Result { + Positive, Negative, Unknown + } +} diff --git a/microg-ui-tools/src/main/res/layout/self_check.xml b/microg-ui-tools/src/main/res/layout/self_check.xml new file mode 100644 index 00000000..b8594924 --- /dev/null +++ b/microg-ui-tools/src/main/res/layout/self_check.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/microg-ui-tools/src/main/res/layout/self_check_entry.xml b/microg-ui-tools/src/main/res/layout/self_check_entry.xml new file mode 100644 index 00000000..b371debb --- /dev/null +++ b/microg-ui-tools/src/main/res/layout/self_check_entry.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/microg-ui-tools/src/main/res/layout/toolbar.xml b/microg-ui-tools/src/main/res/layout/toolbar.xml new file mode 100644 index 00000000..67ac66ef --- /dev/null +++ b/microg-ui-tools/src/main/res/layout/toolbar.xml @@ -0,0 +1,24 @@ + + + diff --git a/microg-ui-tools/src/main/res/values/colors.xml b/microg-ui-tools/src/main/res/values/colors.xml new file mode 100644 index 00000000..a9410025 --- /dev/null +++ b/microg-ui-tools/src/main/res/values/colors.xml @@ -0,0 +1,21 @@ + + + + #ff263238 + #ff21272b + #ff009688 + diff --git a/microg-ui-tools/src/main/res/values/themes.xml b/microg-ui-tools/src/main/res/values/themes.xml new file mode 100644 index 00000000..80726729 --- /dev/null +++ b/microg-ui-tools/src/main/res/values/themes.xml @@ -0,0 +1,26 @@ + + + + + + diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 00000000..05430179 --- /dev/null +++ b/settings.gradle @@ -0,0 +1 @@ +include ':microg-ui-tools' From a223d9591290172fc58266173f9ce1c8b98cef12 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Fri, 22 Jan 2016 03:44:27 +0100 Subject: [PATCH 120/293] Split constant-pool, add some components for gcm --- extern/SafeParcel | 2 +- play-services-api/build.gradle | 18 ++- .../android/gms/iid/IMessengerCompat.aidl | 7 ++ .../android/gms/gcm/PendingCallback.java | 59 ++++++++++ .../android/gms/iid/MessengerCompat.java | 106 ++++++++++++++++++ .../org/microg/gms/auth/AuthConstants.java | 22 ++++ .../java/org/microg/gms/common/Constants.java | 28 +---- .../java/org/microg/gms/gcm/GcmConstants.java | 71 ++++++++++++ .../gms/location/LocationConstants.java | 21 ++++ .../org/microg/gms/maps/MapsConstants.java | 40 +++++++ 10 files changed, 344 insertions(+), 30 deletions(-) create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/iid/IMessengerCompat.aidl create mode 100644 play-services-api/src/main/java/com/google/android/gms/gcm/PendingCallback.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/iid/MessengerCompat.java create mode 100644 play-services-api/src/main/java/org/microg/gms/auth/AuthConstants.java create mode 100644 play-services-api/src/main/java/org/microg/gms/gcm/GcmConstants.java create mode 100644 play-services-api/src/main/java/org/microg/gms/location/LocationConstants.java create mode 100644 play-services-api/src/main/java/org/microg/gms/maps/MapsConstants.java diff --git a/extern/SafeParcel b/extern/SafeParcel index 4579b940..e7051668 160000 --- a/extern/SafeParcel +++ b/extern/SafeParcel @@ -1 +1 @@ -Subproject commit 4579b940f2aab6bc4be8607b20e0bbb70ab4002d +Subproject commit e70516688482e667a22b8d485d1131e5af11c188 diff --git a/play-services-api/build.gradle b/play-services-api/build.gradle index d7c9bc7b..28a98c26 100644 --- a/play-services-api/build.gradle +++ b/play-services-api/build.gradle @@ -19,7 +19,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:1.3.0' + classpath 'com.android.tools.build:gradle:1.5.0' classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3' } } @@ -27,12 +27,26 @@ buildscript { apply plugin: 'com.android.library' apply plugin: 'com.github.dcendents.android-maven' +String getMyVersionName() { + def stdout = new ByteArrayOutputStream() + exec { + commandLine 'git', 'describe', '--tags', '--always', '--dirty' + standardOutput = stdout + } + return stdout.toString().trim() +} + group = 'org.microg' -version = '1.0-SNAPSHOT' +version = getMyVersionName().substring(1) android { compileSdkVersion 23 buildToolsVersion "23.0.2" + + defaultConfig { + versionName getMyVersionName() + } + compileOptions { sourceCompatibility JavaVersion.VERSION_1_6 } diff --git a/play-services-api/src/main/aidl/com/google/android/gms/iid/IMessengerCompat.aidl b/play-services-api/src/main/aidl/com/google/android/gms/iid/IMessengerCompat.aidl new file mode 100644 index 00000000..3ebf38c1 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/iid/IMessengerCompat.aidl @@ -0,0 +1,7 @@ +package com.google.android.gms.iid; + +import android.os.Message; + +interface IMessengerCompat { + void send(in Message message); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/gcm/PendingCallback.java b/play-services-api/src/main/java/com/google/android/gms/gcm/PendingCallback.java new file mode 100644 index 00000000..6eed3e3d --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/gcm/PendingCallback.java @@ -0,0 +1,59 @@ +/* + * Copyright 2013-2016 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.gcm; + +import android.os.IBinder; +import android.os.Parcel; +import android.os.Parcelable; + +public class PendingCallback implements Parcelable { + private final IBinder binder; + + public PendingCallback(IBinder binder) { + this.binder = binder; + } + + private PendingCallback(Parcel in) { + this.binder = in.readStrongBinder(); + } + + public IBinder getBinder() { + return binder; + } + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + dest.writeStrongBinder(binder); + } + + public static final Creator CREATOR = new Creator() { + @Override + public PendingCallback createFromParcel(Parcel source) { + return new PendingCallback(source); + } + + @Override + public PendingCallback[] newArray(int size) { + return new PendingCallback[size]; + } + }; +} diff --git a/play-services-api/src/main/java/com/google/android/gms/iid/MessengerCompat.java b/play-services-api/src/main/java/com/google/android/gms/iid/MessengerCompat.java new file mode 100644 index 00000000..d06fc263 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/iid/MessengerCompat.java @@ -0,0 +1,106 @@ +/* + * Copyright 2013-2016 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.iid; + +import android.os.Binder; +import android.os.Handler; +import android.os.IBinder; +import android.os.Message; +import android.os.Messenger; +import android.os.Parcel; +import android.os.Parcelable; +import android.os.RemoteException; + +import static android.os.Build.VERSION.SDK_INT; +import static android.os.Build.VERSION_CODES.LOLLIPOP; + +public class MessengerCompat implements Parcelable { + private Messenger messenger; + private IMessengerCompat messengerCompat; + + public MessengerCompat(IBinder binder) { + if (SDK_INT >= LOLLIPOP) { + messenger = new Messenger(binder); + } else { + messengerCompat = IMessengerCompat.Stub.asInterface(binder); + } + } + + public MessengerCompat(Handler handler) { + if (SDK_INT >= LOLLIPOP) { + messenger = new Messenger(handler); + } else { + messengerCompat = new IMessengerCompatImpl(handler); + } + } + + @Override + public int describeContents() { + return 0; + } + + @Override + public boolean equals(Object o) { + return o instanceof MessengerCompat && ((MessengerCompat) o).getBinder().equals(getBinder()); + } + + public IBinder getBinder() { + return messenger != null ? messenger.getBinder() : messengerCompat.asBinder(); + } + + @Override + public int hashCode() { + return getBinder().hashCode(); + } + + public void send(Message message) throws RemoteException { + if (messenger != null) messenger.send(message); + else messengerCompat.send(message); + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + dest.writeStrongBinder(getBinder()); + } + + public static final Creator CREATOR = new Creator() { + @Override + public MessengerCompat createFromParcel(Parcel source) { + IBinder binder = source.readStrongBinder(); + return binder != null ? new MessengerCompat(binder) : null; + } + + @Override + public MessengerCompat[] newArray(int size) { + return new MessengerCompat[size]; + } + }; + + private static class IMessengerCompatImpl extends IMessengerCompat.Stub { + private final Handler handler; + + public IMessengerCompatImpl(Handler handler) { + this.handler = handler; + } + + @Override + public void send(Message message) throws RemoteException { + message.arg2 = Binder.getCallingUid(); + handler.dispatchMessage(message); + } + } +} diff --git a/play-services-api/src/main/java/org/microg/gms/auth/AuthConstants.java b/play-services-api/src/main/java/org/microg/gms/auth/AuthConstants.java new file mode 100644 index 00000000..70ce7126 --- /dev/null +++ b/play-services-api/src/main/java/org/microg/gms/auth/AuthConstants.java @@ -0,0 +1,22 @@ +/* + * Copyright 2013-2016 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 org.microg.gms.auth; + +public class AuthConstants { + public static final String DEFAULT_ACCOUNT = "<>"; + public static final String SCOPE_GET_ACCOUNT_ID = "^^_account_id_^^"; +} diff --git a/play-services-api/src/main/java/org/microg/gms/common/Constants.java b/play-services-api/src/main/java/org/microg/gms/common/Constants.java index 6f0589bc..d838c0b0 100644 --- a/play-services-api/src/main/java/org/microg/gms/common/Constants.java +++ b/play-services-api/src/main/java/org/microg/gms/common/Constants.java @@ -22,34 +22,8 @@ public class Constants { * Does not necessarily mean anything. */ public static final int MAX_REFERENCE_VERSION = 8489000; - public static final String KEY_MOCK_LOCATION = "mockLocation"; - public static final String DEFAULT_ACCOUNT = "<>"; public static final String GMS_PACKAGE_NAME = "com.google.android.gms"; + public static final String GSF_PACKAGE_NAME = "com.google.android.gsf"; public static final String GMS_PACKAGE_SIGNATURE_SHA1 = "38918a453d07199354f8b19af05ec6562ced5788"; - public static final String SCOPE_GET_ACCOUNT_ID = "^^_account_id_^^"; - /** - * No base map tiles. - */ - public static final int MAP_TYPE_NONE = 0; - - /** - * Basic maps. - */ - public static final int MAP_TYPE_NORMAL = 1; - - /** - * Satellite maps with no labels. - */ - public static final int MAP_TYPE_SATELLITE = 2; - - /** - * Terrain maps. - */ - public static final int MAP_TYPE_TERRAIN = 3; - - /** - * Satellite maps with a transparent layer of major streets. - */ - public static final int MAP_TYPE_HYBRID = 4; } diff --git a/play-services-api/src/main/java/org/microg/gms/gcm/GcmConstants.java b/play-services-api/src/main/java/org/microg/gms/gcm/GcmConstants.java new file mode 100644 index 00000000..d387b56c --- /dev/null +++ b/play-services-api/src/main/java/org/microg/gms/gcm/GcmConstants.java @@ -0,0 +1,71 @@ +/* + * Copyright 2013-2016 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 org.microg.gms.gcm; + +public final class GcmConstants { + public static final String ACTION_C2DM_RECEIVE = "com.google.android.c2dm.intent.RECEIVE"; + public static final String ACTION_C2DM_REGISTER = "com.google.android.c2dm.intent.REGISTER"; + public static final String ACTION_C2DM_REGISTRATION = "com.google.android.c2dm.intent.REGISTRATION"; + public static final String ACTION_C2DM_UNREGISTER = "com.google.android.c2dm.intent.UNREGISTER"; + public static final String ACTION_GCM_SEND = "com.google.android.gcm.intent.SEND"; + public static final String ACTION_NOTIFICATION_OPEN = "com.google.android.gms.gcm.NOTIFICATION_OPEN"; + public static final String ACTION_NOTIFICATION_DISMISS = "com.google.android.gms.gcm.NOTIFICATION_DISMISS"; + public static final String ACTION_SCHEDULE = "com.google.android.gms.gcm.ACTION_SCHEDULE"; + public static final String ACTION_TASK_READY = "com.google.android.gms.gcm.ACTION_TASK_READY"; + public static final String ACTION_TASK_INITIALZE = "com.google.android.gms.gcm.SERVICE_ACTION_INITIALIZE"; + public static final String ACTION_INSTANCE_ID = "com.google.android.gms.iid.InstanceID"; + + public static final String EXTRA_APP = "app"; + public static final String EXTRA_COMPONENT = "component"; + public static final String EXTRA_DELAY = "google.delay"; + public static final String EXTRA_ERROR = "error"; + public static final String EXTRA_FROM = "from"; + public static final String EXTRA_GSF_INTENT = "GSF"; + public static final String EXTRA_PENDING_INTENT = "com.google.android.gms.gcm.PENDING_INTENT"; + public static final String EXTRA_MESSENGER = "google.messenger"; + public static final String EXTRA_MESSAGE_TYPE = "message_type"; + public static final String EXTRA_MESSAGE_ID = "google.message_id"; + public static final String EXTRA_REGISTRATION_ID = "registration_id"; + public static final String EXTRA_RETRY_AFTER = "Retry-After"; + public static final String EXTRA_SCHEDULER_ACTION = "scheduler_action"; + public static final String EXTRA_SENDER = "sender"; + public static final String EXTRA_SENDER_LEGACY = "legacy.sender"; + public static final String EXTRA_SEND_TO = "google.to"; + public static final String EXTRA_SEND_FROM = "google.from"; + public static final String EXTRA_TAG = "tag"; + public static final String EXTRA_TOPIC = "gcm.topic"; + public static final String EXTRA_TTL = "google.ttl"; + public static final String EXTRA_UNREGISTERED = "unregistered"; + + public static final String MESSAGE_TYPE_GCM = "gcm"; + public static final String MESSAGE_TYPE_DELETED_MESSAGE = "deleted_message"; + public static final String MESSAGE_TYPE_SEND_ERROR = "send_error"; + public static final String MESSAGE_TYPE_SEND_EVENT = "send_event"; + + public static final String SCHEDULER_ACTION_CANCEL = "CANCEL_TASK"; + public static final String SCHEDULER_ACTION_CANCEL_ALL = "CANCEL_ALL"; + public static final String SCHEDULER_ACTION_SCHEDULE = "SCHEDULE_TASK"; + + public static final String PERMISSION_GTALK = "com.google.android.gtalkservice.permission.GTALK_SERVICE"; + public static final String PERMISSION_NETWORK_TASK = "com.google.android.gms.permission.BIND_NETWORK_TASK_SERVICE"; + public static final String PERMISSION_RECEIVE = "com.google.android.c2dm.permission.RECEIVE"; + public static final String PERMISSION_SEND = "com.google.android.c2dm.permission.SEND"; + + public static final String ERROR_SERVICE_NOT_AVAILABLE = "SERVICE_NOT_AVAILABLE"; + + public static final String INSTANCE_ID_SCOPE_GCM = "GCM"; +} diff --git a/play-services-api/src/main/java/org/microg/gms/location/LocationConstants.java b/play-services-api/src/main/java/org/microg/gms/location/LocationConstants.java new file mode 100644 index 00000000..378c5c73 --- /dev/null +++ b/play-services-api/src/main/java/org/microg/gms/location/LocationConstants.java @@ -0,0 +1,21 @@ +/* + * Copyright 2013-2016 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 org.microg.gms.location; + +public class LocationConstants { + public static final String KEY_MOCK_LOCATION = "mockLocation"; +} diff --git a/play-services-api/src/main/java/org/microg/gms/maps/MapsConstants.java b/play-services-api/src/main/java/org/microg/gms/maps/MapsConstants.java new file mode 100644 index 00000000..b54649e0 --- /dev/null +++ b/play-services-api/src/main/java/org/microg/gms/maps/MapsConstants.java @@ -0,0 +1,40 @@ +/* + * Copyright 2013-2016 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 org.microg.gms.maps; + +public class MapsConstants { + /** + * No base map tiles. + */ + public static final int MAP_TYPE_NONE = 0; + /** + * Basic maps. + */ + public static final int MAP_TYPE_NORMAL = 1; + /** + * Satellite maps with no labels. + */ + public static final int MAP_TYPE_SATELLITE = 2; + /** + * Terrain maps. + */ + public static final int MAP_TYPE_TERRAIN = 3; + /** + * Satellite maps with a transparent layer of major streets. + */ + public static final int MAP_TYPE_HYBRID = 4; +} From f0e7d6b1c806effee3f5040e5e8595e128c575e4 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Fri, 22 Jan 2016 04:33:10 +0100 Subject: [PATCH 121/293] Update selfcheck, add about fragment --- microg-ui-tools/build.gradle | 2 +- .../selfcheck/AbstractSelfCheckActivity.java | 65 --------- .../tools/ui/AbstractAboutFragment.java | 130 ++++++++++++++++++ .../tools/ui/AbstractSelfCheckFragment.java | 97 +++++++++++++ .../src/main/res/layout/about_root.xml | 67 +++++++++ .../src/main/res/layout/self_check.xml | 29 ++-- .../src/main/res/layout/self_check_entry.xml | 25 ++-- .../src/main/res/layout/self_check_group.xml | 40 ++++++ 8 files changed, 362 insertions(+), 93 deletions(-) delete mode 100644 microg-ui-tools/src/main/java/org/microg/tools/selfcheck/AbstractSelfCheckActivity.java create mode 100644 microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractAboutFragment.java create mode 100644 microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractSelfCheckFragment.java create mode 100644 microg-ui-tools/src/main/res/layout/about_root.xml create mode 100644 microg-ui-tools/src/main/res/layout/self_check_group.xml diff --git a/microg-ui-tools/build.gradle b/microg-ui-tools/build.gradle index 4cd39d2e..167a335e 100644 --- a/microg-ui-tools/build.gradle +++ b/microg-ui-tools/build.gradle @@ -27,7 +27,7 @@ apply plugin: 'com.android.library' String getMyVersionName() { def stdout = new ByteArrayOutputStream() exec { - commandLine 'git', 'describe', '--tags', '--always' + commandLine 'git', 'describe', '--tags', '--always', '--dirty' standardOutput = stdout } return stdout.toString().trim() diff --git a/microg-ui-tools/src/main/java/org/microg/tools/selfcheck/AbstractSelfCheckActivity.java b/microg-ui-tools/src/main/java/org/microg/tools/selfcheck/AbstractSelfCheckActivity.java deleted file mode 100644 index 885acd36..00000000 --- a/microg-ui-tools/src/main/java/org/microg/tools/selfcheck/AbstractSelfCheckActivity.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2013-2016 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 org.microg.tools.selfcheck; - -import android.os.Bundle; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.ImageView; -import android.widget.TextView; - -import org.microg.tools.ui.R; - -import java.util.ArrayList; -import java.util.List; - -public abstract class AbstractSelfCheckActivity extends AppCompatActivity implements SelfCheckGroup.ResultCollector { - - protected abstract void prepareSelfCheckList(List checks); - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.self_check); - setSupportActionBar((Toolbar) findViewById(R.id.toolbar)); - - List selfCheckGroupList = new ArrayList(); - prepareSelfCheckList(selfCheckGroupList); - - for (SelfCheckGroup group : selfCheckGroupList) { - group.doChecks(this, this); - } - } - - public void addResult(String name, SelfCheckGroup.Result result, String resolution) { - if (result == null) return; - ViewGroup root = (ViewGroup) findViewById(R.id.self_check_root); - View resultEntry = LayoutInflater.from(this).inflate(R.layout.self_check_entry, root, false); - ((TextView) resultEntry.findViewById(R.id.self_check_name)).setText(name); - if (result == SelfCheckGroup.Result.Positive) { - ((ImageView) resultEntry.findViewById(R.id.self_check_result)).setImageResource(android.R.drawable.presence_online); - } else { - ((TextView) resultEntry.findViewById(R.id.self_check_resolution)).setText(resolution); - ((ImageView) resultEntry.findViewById(R.id.self_check_result)) - .setImageResource(result == SelfCheckGroup.Result.Negative ? android.R.drawable.presence_busy : android.R.drawable.presence_invisible); - } - root.addView(resultEntry); - } -} diff --git a/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractAboutFragment.java b/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractAboutFragment.java new file mode 100644 index 00000000..a149dee1 --- /dev/null +++ b/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractAboutFragment.java @@ -0,0 +1,130 @@ +/* + * Copyright 2013-2016 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 org.microg.tools.ui; + +import android.content.Context; +import android.content.pm.PackageManager; +import android.graphics.drawable.Drawable; +import android.os.Bundle; +import android.support.annotation.Nullable; +import android.support.v4.*; +import android.support.v4.app.Fragment; +import android.text.TextUtils; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ArrayAdapter; +import android.widget.ImageView; +import android.widget.ListView; +import android.widget.TextView; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +public abstract class AbstractAboutFragment extends Fragment { + + protected abstract void collectLibraries(List libraries); + + protected Drawable getIcon() { + try { + PackageManager pm = getContext().getPackageManager(); + Drawable icon = pm.getPackageInfo(getContext().getPackageName(), 0).applicationInfo.loadIcon(pm); + if (icon == null) return getContext().getDrawable(android.R.drawable.ic_dialog_alert); + return icon; + } catch (PackageManager.NameNotFoundException e) { + // Never happens, self package always exists! + throw new RuntimeException(e); + } + } + + protected String getAppName() { + try { + PackageManager pm = getContext().getPackageManager(); + CharSequence label = pm.getPackageInfo(getContext().getPackageName(), 0).applicationInfo.loadLabel(pm); + if (TextUtils.isEmpty(label)) return getContext().getPackageName(); + return label.toString(); + } catch (PackageManager.NameNotFoundException e) { + // Never happens, self package always exists! + throw new RuntimeException(e); + } + } + + protected String getLibVersion(String packageName) { + try { + String versionName = (String) Class.forName(packageName + ".BuildConfig").getField("VERSION_NAME").get(null); + if (TextUtils.isEmpty(versionName)) return ""; + return versionName; + } catch (Exception e) { + return ""; + } + } + + @Nullable + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + View aboutRoot = inflater.inflate(R.layout.about_root, container, false); + ((ImageView) aboutRoot.findViewById(android.R.id.icon)).setImageDrawable(getIcon()); + ((TextView) aboutRoot.findViewById(android.R.id.title)).setText(getAppName()); + ((TextView) aboutRoot.findViewById(R.id.about_version)).setText("Version " + getLibVersion(getContext().getPackageName())); + + List libraries = new ArrayList(); + libraries.add(new Library("org.microg.tools.ui", "microG UI Tools", "Apache License 2.0, Copyright (c) microG Team")); + collectLibraries(libraries); + Collections.sort(libraries); + ((ListView) aboutRoot.findViewById(android.R.id.list)).setAdapter(new LibraryAdapter(getContext(), libraries.toArray(new Library[libraries.size()]))); + + return aboutRoot; + } + + private class LibraryAdapter extends ArrayAdapter { + + public LibraryAdapter(Context context, Library[] libraries) { + super(context, android.R.layout.simple_list_item_2, android.R.id.text1, libraries); + } + + @Override + public View getView(int position, View convertView, ViewGroup parent) { + View v = super.getView(position, convertView, parent); + ((TextView) v.findViewById(android.R.id.text1)).setText(getItem(position).name + " " + getLibVersion(getItem(position).packageName)); + ((TextView) v.findViewById(android.R.id.text2)).setText(getItem(position).copyright); + return v; + } + } + + protected static class Library implements Comparable { + private final String packageName; + private final String name; + private final String copyright; + + public Library(String packageName, String name, String copyright) { + this.packageName = packageName; + this.name = name; + this.copyright = copyright; + } + + @Override + public String toString() { + return name + ", " + copyright; + } + + @Override + public int compareTo(Library another) { + return name.toLowerCase().compareTo(another.name.toLowerCase()); + } + } +} diff --git a/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractSelfCheckFragment.java b/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractSelfCheckFragment.java new file mode 100644 index 00000000..56bf9863 --- /dev/null +++ b/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractSelfCheckFragment.java @@ -0,0 +1,97 @@ +/* + * Copyright 2013-2016 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 org.microg.tools.ui; + +import android.os.Bundle; +import android.support.annotation.Nullable; +import android.support.v4.app.Fragment; +import android.view.LayoutInflater; +import android.view.MotionEvent; +import android.view.View; +import android.view.ViewGroup; +import android.widget.CheckBox; +import android.widget.TextView; + +import org.microg.tools.selfcheck.SelfCheckGroup; + +import java.util.ArrayList; +import java.util.List; + +import static android.view.View.GONE; +import static android.view.View.INVISIBLE; +import static org.microg.tools.selfcheck.SelfCheckGroup.Result.Positive; +import static org.microg.tools.selfcheck.SelfCheckGroup.Result.Unknown; + +public abstract class AbstractSelfCheckFragment extends Fragment { + + protected abstract void prepareSelfCheckList(List checks); + + @Nullable + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + View scrollRoot = inflater.inflate(R.layout.self_check, container, false); + List selfCheckGroupList = new ArrayList(); + prepareSelfCheckList(selfCheckGroupList); + + ViewGroup root = (ViewGroup) scrollRoot.findViewById(R.id.self_check_root); + for (SelfCheckGroup group : selfCheckGroupList) { + View groupView = inflater.inflate(R.layout.self_check_group, root, false); + ((TextView) groupView.findViewById(android.R.id.title)).setText(group.getGroupName(getContext())); + final ViewGroup viewGroup = (ViewGroup) groupView.findViewById(R.id.group_content); + group.doChecks(getContext(), new GroupResultCollector(viewGroup)); + root.addView(groupView); + } + return scrollRoot; + } + + private class GroupResultCollector implements SelfCheckGroup.ResultCollector { + private final ViewGroup viewGroup; + + public GroupResultCollector(ViewGroup viewGroup) { + this.viewGroup = viewGroup; + } + + @Override + public void addResult(final String name, final SelfCheckGroup.Result result, final String resolution) { + if (result == null || getActivity() == null) return; + getActivity().runOnUiThread(new Runnable() { + @Override + public void run() { + View resultEntry = LayoutInflater.from(getContext()).inflate(R.layout.self_check_entry, viewGroup, false); + ((TextView) resultEntry.findViewById(R.id.self_check_name)).setText(name); + resultEntry.findViewById(R.id.self_check_result).setOnTouchListener(new View.OnTouchListener() { + @Override + public boolean onTouch(View v, MotionEvent event) { + return true; + } + }); + if (result == Positive) { + ((CheckBox) resultEntry.findViewById(R.id.self_check_result)).setChecked(true); + resultEntry.findViewById(R.id.self_check_resolution).setVisibility(GONE); + } else { + ((TextView) resultEntry.findViewById(R.id.self_check_resolution)).setText(resolution); + if (result == Unknown) { + resultEntry.findViewById(R.id.self_check_result).setVisibility(INVISIBLE); + } + } + viewGroup.addView(resultEntry); + } + }); + + } + } +} diff --git a/microg-ui-tools/src/main/res/layout/about_root.xml b/microg-ui-tools/src/main/res/layout/about_root.xml new file mode 100644 index 00000000..1fe0c283 --- /dev/null +++ b/microg-ui-tools/src/main/res/layout/about_root.xml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/microg-ui-tools/src/main/res/layout/self_check.xml b/microg-ui-tools/src/main/res/layout/self_check.xml index b8594924..47092f97 100644 --- a/microg-ui-tools/src/main/res/layout/self_check.xml +++ b/microg-ui-tools/src/main/res/layout/self_check.xml @@ -15,23 +15,16 @@ ~ limitations under the License. --> - + - + - - - - - - - \ No newline at end of file + + \ No newline at end of file diff --git a/microg-ui-tools/src/main/res/layout/self_check_entry.xml b/microg-ui-tools/src/main/res/layout/self_check_entry.xml index b371debb..ec5ad8d2 100644 --- a/microg-ui-tools/src/main/res/layout/self_check_entry.xml +++ b/microg-ui-tools/src/main/res/layout/self_check_entry.xml @@ -16,31 +16,38 @@ --> + android:gravity="center_vertical" + android:paddingBottom="5dp" + android:paddingEnd="?android:attr/listPreferredItemPaddingEnd" + android:paddingLeft="?attr/listPreferredItemPaddingLeft" + android:paddingRight="?attr/listPreferredItemPaddingRight" + android:paddingStart="?android:attr/listPreferredItemPaddingStart"> + android:textAppearance="?attr/textAppearanceListItem" + android:textColor="?android:textColorPrimary"/> - + android:layout_centerVertical="true" + android:focusable="false"/> + android:textAppearance="@style/TextAppearance.AppCompat.Body1" + android:textColor="?android:textColorSecondary"/> \ No newline at end of file diff --git a/microg-ui-tools/src/main/res/layout/self_check_group.xml b/microg-ui-tools/src/main/res/layout/self_check_group.xml new file mode 100644 index 00000000..62af9c7e --- /dev/null +++ b/microg-ui-tools/src/main/res/layout/self_check_group.xml @@ -0,0 +1,40 @@ + + + + + + + + + + \ No newline at end of file From b2f08accd9b8b75d9b1b3f7aecbb06d2d12c9658 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Mon, 25 Jan 2016 21:03:17 +0100 Subject: [PATCH 122/293] Various fixes, proper strings --- .../tools/ui/AbstractAboutFragment.java | 13 ++++---- .../tools/ui/AbstractSelfCheckFragment.java | 11 ++++++- .../src/main/res/values-sr/strings.xml | 23 ++++++++++++++ .../src/main/res/values/strings.xml | 30 +++++++++++++++++++ 4 files changed, 69 insertions(+), 8 deletions(-) create mode 100644 microg-ui-tools/src/main/res/values-sr/strings.xml create mode 100644 microg-ui-tools/src/main/res/values/strings.xml diff --git a/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractAboutFragment.java b/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractAboutFragment.java index a149dee1..5e9771aa 100644 --- a/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractAboutFragment.java +++ b/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractAboutFragment.java @@ -21,7 +21,6 @@ import android.content.pm.PackageManager; import android.graphics.drawable.Drawable; import android.os.Bundle; import android.support.annotation.Nullable; -import android.support.v4.*; import android.support.v4.app.Fragment; import android.text.TextUtils; import android.view.LayoutInflater; @@ -57,7 +56,7 @@ public abstract class AbstractAboutFragment extends Fragment { PackageManager pm = getContext().getPackageManager(); CharSequence label = pm.getPackageInfo(getContext().getPackageName(), 0).applicationInfo.loadLabel(pm); if (TextUtils.isEmpty(label)) return getContext().getPackageName(); - return label.toString(); + return label.toString().trim(); } catch (PackageManager.NameNotFoundException e) { // Never happens, self package always exists! throw new RuntimeException(e); @@ -68,7 +67,7 @@ public abstract class AbstractAboutFragment extends Fragment { try { String versionName = (String) Class.forName(packageName + ".BuildConfig").getField("VERSION_NAME").get(null); if (TextUtils.isEmpty(versionName)) return ""; - return versionName; + return versionName.trim(); } catch (Exception e) { return ""; } @@ -80,10 +79,10 @@ public abstract class AbstractAboutFragment extends Fragment { View aboutRoot = inflater.inflate(R.layout.about_root, container, false); ((ImageView) aboutRoot.findViewById(android.R.id.icon)).setImageDrawable(getIcon()); ((TextView) aboutRoot.findViewById(android.R.id.title)).setText(getAppName()); - ((TextView) aboutRoot.findViewById(R.id.about_version)).setText("Version " + getLibVersion(getContext().getPackageName())); + ((TextView) aboutRoot.findViewById(R.id.about_version)).setText(getString(R.string.about_version_str, getLibVersion(getContext().getPackageName()))); List libraries = new ArrayList(); - libraries.add(new Library("org.microg.tools.ui", "microG UI Tools", "Apache License 2.0, Copyright (c) microG Team")); + libraries.add(new Library(BuildConfig.APPLICATION_ID, getString(R.string.lib_name), getString(R.string.lib_license))); collectLibraries(libraries); Collections.sort(libraries); ((ListView) aboutRoot.findViewById(android.R.id.list)).setAdapter(new LibraryAdapter(getContext(), libraries.toArray(new Library[libraries.size()]))); @@ -100,8 +99,8 @@ public abstract class AbstractAboutFragment extends Fragment { @Override public View getView(int position, View convertView, ViewGroup parent) { View v = super.getView(position, convertView, parent); - ((TextView) v.findViewById(android.R.id.text1)).setText(getItem(position).name + " " + getLibVersion(getItem(position).packageName)); - ((TextView) v.findViewById(android.R.id.text2)).setText(getItem(position).copyright); + ((TextView) v.findViewById(android.R.id.text1)).setText(getString(R.string.about_name_version_str, getItem(position).name, getLibVersion(getItem(position).packageName))); + ((TextView) v.findViewById(android.R.id.text2)).setText(getItem(position).copyright != null ? getItem(position).copyright : getString(R.string.about_default_license)); return v; } } diff --git a/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractSelfCheckFragment.java b/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractSelfCheckFragment.java index 56bf9863..bb00cf3f 100644 --- a/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractSelfCheckFragment.java +++ b/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractSelfCheckFragment.java @@ -19,6 +19,7 @@ package org.microg.tools.ui; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; +import android.util.Log; import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; @@ -33,10 +34,12 @@ import java.util.List; import static android.view.View.GONE; import static android.view.View.INVISIBLE; +import static org.microg.tools.selfcheck.SelfCheckGroup.Result.Negative; import static org.microg.tools.selfcheck.SelfCheckGroup.Result.Positive; import static org.microg.tools.selfcheck.SelfCheckGroup.Result.Unknown; public abstract class AbstractSelfCheckFragment extends Fragment { + private static final String TAG = "SelfCheck"; protected abstract void prepareSelfCheckList(List checks); @@ -52,7 +55,13 @@ public abstract class AbstractSelfCheckFragment extends Fragment { View groupView = inflater.inflate(R.layout.self_check_group, root, false); ((TextView) groupView.findViewById(android.R.id.title)).setText(group.getGroupName(getContext())); final ViewGroup viewGroup = (ViewGroup) groupView.findViewById(R.id.group_content); - group.doChecks(getContext(), new GroupResultCollector(viewGroup)); + final SelfCheckGroup.ResultCollector collector = new GroupResultCollector(viewGroup); + try { + group.doChecks(getContext(), collector); + } catch (Exception e) { + Log.w(TAG, "Failed during check " + group.getGroupName(getContext()), e); + collector.addResult("Self-check failed:", Negative, "An exception occurred during self-check. Please report this issue."); + } root.addView(groupView); } return scrollRoot; diff --git a/microg-ui-tools/src/main/res/values-sr/strings.xml b/microg-ui-tools/src/main/res/values-sr/strings.xml new file mode 100644 index 00000000..78d4753a --- /dev/null +++ b/microg-ui-tools/src/main/res/values-sr/strings.xml @@ -0,0 +1,23 @@ + + + + + Поставка + + микроГ самопровера + Провера исправности подешавања система за коришћење микроГ услуга. + \ No newline at end of file diff --git a/microg-ui-tools/src/main/res/values/strings.xml b/microg-ui-tools/src/main/res/values/strings.xml new file mode 100644 index 00000000..186ef926 --- /dev/null +++ b/microg-ui-tools/src/main/res/values/strings.xml @@ -0,0 +1,30 @@ + + + + + microG UI Tools + Apache License 2.0, Copyright © microG Team + + Version %1$s + %1$s %2$s + All rights reserved. + + Setup + + Self-Check + Check if the system is correctly set up to use microG. + \ No newline at end of file From 865b41664d6afabecddbd1a5d1b7c702d0bd821f Mon Sep 17 00:00:00 2001 From: Marvin W Date: Mon, 25 Jan 2016 22:48:29 +0100 Subject: [PATCH 123/293] Update API for PlacePicker --- extern/SafeParcel | 2 +- .../android/gms/location/places/Place.java | 384 ++++++++++++++++++ .../location/places/internal/PlaceImpl.java | 145 +++++++ .../org/microg/gms/auth/AuthConstants.java | 4 + .../java/org/microg/gms/common/Constants.java | 1 - .../gms/location/LocationConstants.java | 12 + 6 files changed, 546 insertions(+), 2 deletions(-) create mode 100644 play-services-api/src/main/java/com/google/android/gms/location/places/Place.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/location/places/internal/PlaceImpl.java diff --git a/extern/SafeParcel b/extern/SafeParcel index e7051668..b062691c 160000 --- a/extern/SafeParcel +++ b/extern/SafeParcel @@ -1 +1 @@ -Subproject commit e70516688482e667a22b8d485d1131e5af11c188 +Subproject commit b062691c8a3271afa2d44531590e262a71107b0b diff --git a/play-services-api/src/main/java/com/google/android/gms/location/places/Place.java b/play-services-api/src/main/java/com/google/android/gms/location/places/Place.java new file mode 100644 index 00000000..1c48110f --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/location/places/Place.java @@ -0,0 +1,384 @@ +/* + * Copyright 2013-2016 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.location.places; + +import android.net.Uri; + +import com.google.android.gms.common.data.Freezable; +import com.google.android.gms.maps.model.LatLng; +import com.google.android.gms.maps.model.LatLngBounds; + +import java.util.List; +import java.util.Locale; + +public interface Place extends Freezable { + int TYPE_ACCOUNTING = 1; + + int TYPE_ADMINISTRATIVE_AREA_LEVEL_1 = 1001; + + int TYPE_ADMINISTRATIVE_AREA_LEVEL_2 = 1002; + + int TYPE_ADMINISTRATIVE_AREA_LEVEL_3 = 1003; + + int TYPE_AIRPORT = 2; + + int TYPE_AMUSEMENT_PARK = 3; + + int TYPE_AQUARIUM = 4; + + int TYPE_ART_GALLERY = 5; + + int TYPE_ATM = 6; + + int TYPE_BAKERY = 7; + + int TYPE_BANK = 8; + + int TYPE_BAR = 9; + + int TYPE_BEAUTY_SALON = 10; + + int TYPE_BICYCLE_STORE = 11; + + int TYPE_BOOK_STORE = 12; + + int TYPE_BOWLING_ALLEY = 13; + + int TYPE_BUS_STATION = 14; + + int TYPE_CAFE = 15; + + int TYPE_CAMPGROUND = 16; + + int TYPE_CAR_DEALER = 17; + + int TYPE_CAR_RENTAL = 18; + + int TYPE_CAR_REPAIR = 19; + + int TYPE_CAR_WASH = 20; + + int TYPE_CASINO = 21; + + int TYPE_CEMETERY = 22; + + int TYPE_CHURCH = 23; + + int TYPE_CITY_HALL = 24; + + int TYPE_CLOTHING_STORE = 25; + + int TYPE_COLLOQUIAL_AREA = 1004; + + int TYPE_CONVENIENCE_STORE = 26; + + int TYPE_COUNTRY = 1005; + + int TYPE_COURTHOUSE = 27; + + int TYPE_DENTIST = 28; + + int TYPE_DEPARTMENT_STORE = 29; + + int TYPE_DOCTOR = 30; + + int TYPE_ELECTRICIAN = 31; + + int TYPE_ELECTRONICS_STORE = 32; + + int TYPE_EMBASSY = 33; + + int TYPE_ESTABLISHMENT = 34; + + int TYPE_FINANCE = 35; + + int TYPE_FIRE_STATION = 36; + + int TYPE_FLOOR = 1006; + + int TYPE_FLORIST = 37; + + int TYPE_FOOD = 38; + + int TYPE_FUNERAL_HOME = 39; + + int TYPE_FURNITURE_STORE = 40; + + int TYPE_GAS_STATION = 41; + + int TYPE_GENERAL_CONTRACTOR = 42; + + int TYPE_GEOCODE = 1007; + + int TYPE_GROCERY_OR_SUPERMARKET = 43; + + int TYPE_GYM = 44; + + int TYPE_HAIR_CARE = 45; + + int TYPE_HARDWARE_STORE = 46; + + int TYPE_HEALTH = 47; + + int TYPE_HINDU_TEMPLE = 48; + + int TYPE_HOME_GOODS_STORE = 49; + + int TYPE_HOSPITAL = 50; + + int TYPE_INSURANCE_AGENCY = 51; + + int TYPE_INTERSECTION = 1008; + + int TYPE_JEWELRY_STORE = 52; + + int TYPE_LAUNDRY = 53; + + int TYPE_LAWYER = 54; + + int TYPE_LIBRARY = 55; + + int TYPE_LIQUOR_STORE = 56; + + int TYPE_LOCALITY = 1009; + + int TYPE_LOCAL_GOVERNMENT_OFFICE = 57; + + int TYPE_LOCKSMITH = 58; + + int TYPE_LODGING = 59; + + int TYPE_MEAL_DELIVERY = 60; + + int TYPE_MEAL_TAKEAWAY = 61; + + int TYPE_MOSQUE = 62; + + int TYPE_MOVIE_RENTAL = 63; + + int TYPE_MOVIE_THEATER = 64; + + int TYPE_MOVING_COMPANY = 65; + + int TYPE_MUSEUM = 66; + + int TYPE_NATURAL_FEATURE = 1010; + + int TYPE_NEIGHBORHOOD = 1011; + + int TYPE_NIGHT_CLUB = 67; + + int TYPE_OTHER = 0; + + int TYPE_PAINTER = 68; + + int TYPE_PARK = 69; + + int TYPE_PARKING = 70; + + int TYPE_PET_STORE = 71; + + int TYPE_PHARMACY = 72; + + int TYPE_PHYSIOTHERAPIST = 73; + + int TYPE_PLACE_OF_WORSHIP = 74; + + int TYPE_PLUMBER = 75; + + int TYPE_POINT_OF_INTEREST = 1013; + + int TYPE_POLICE = 76; + + int TYPE_POLITICAL = 1012; + + int TYPE_POSTAL_CODE = 1015; + + int TYPE_POSTAL_CODE_PREFIX = 1016; + + int TYPE_POSTAL_TOWN = 1017; + + int TYPE_POST_BOX = 1014; + + int TYPE_POST_OFFICE = 77; + + int TYPE_PREMISE = 1018; + + int TYPE_REAL_ESTATE_AGENCY = 78; + + int TYPE_RESTAURANT = 79; + + int TYPE_ROOFING_CONTRACTOR = 80; + + int TYPE_ROOM = 1019; + + int TYPE_ROUTE = 1020; + + int TYPE_RV_PARK = 81; + + int TYPE_SCHOOL = 82; + + int TYPE_SHOE_STORE = 83; + + int TYPE_SHOPPING_MALL = 84; + + int TYPE_SPA = 85; + + int TYPE_STADIUM = 86; + + int TYPE_STORAGE = 87; + + int TYPE_STORE = 88; + + int TYPE_STREET_ADDRESS = 1021; + + int TYPE_SUBLOCALITY = 1022; + + int TYPE_SUBLOCALITY_LEVEL_1 = 1023; + + int TYPE_SUBLOCALITY_LEVEL_2 = 1024; + + int TYPE_SUBLOCALITY_LEVEL_3 = 1025; + + int TYPE_SUBLOCALITY_LEVEL_4 = 1026; + + int TYPE_SUBLOCALITY_LEVEL_5 = 1027; + + int TYPE_SUBPREMISE = 1028; + + int TYPE_SUBWAY_STATION = 89; + + int TYPE_SYNAGOGUE = 90; + + int TYPE_SYNTHETIC_GEOCODE = 1029; + + int TYPE_TAXI_STAND = 91; + + int TYPE_TRAIN_STATION = 92; + + int TYPE_TRANSIT_STATION = 1030; + + int TYPE_TRAVEL_AGENCY = 93; + + int TYPE_UNIVERSITY = 94; + + int TYPE_VETERINARY_CARE = 95; + + int TYPE_ZOO = 96; + + /** + * Returns a human readable address for this Place. May return null if the address is unknown. + *

+ * The address is localized according to the locale returned by {@link com.google.android.gms.location.places.Place#getLocale()}. + */ + CharSequence getAddress(); + + /** + * Returns the attributions to be shown to the user if data from the {@link com.google.android.gms.location.places.Place} is used. + *

+ * We recommend placing this information below any place information. See + * Displaying Attributions for more details. + * + * @return The attributions in HTML format, or null if there are no attributions to display. + */ + CharSequence getAttributions(); + + /** + * Returns the unique id of this Place. + *

+ * This ID can be passed to {@link com.google.android.gms.location.places.GeoDataApi#getPlaceById(com.google.android.gms.common.api.GoogleApiClient, java.lang.String...)} to lookup the same place at a later + * time, but it is not guaranteed that such a lookup will succeed (the place may no longer exist + * in our database). It is possible that the returned Place in such a lookup will have a + * different ID (so there may be multiple ID's for one given place). + */ + String getId(); + + /** + * Returns the location of this Place. + *

+ * The location is not necessarily the center of the Place, or any particular entry or exit + * point, but some arbitrarily chosen point within the geographic extent of the Place. + */ + LatLng getLatLng(); + + /** + * Returns the locale in which the names and addresses were localized. + */ + Locale getLocale(); + + /** + * Returns the name of this Place. + *

+ * The name is localized according to the locale returned by {@link com.google.android.gms.location.places.Place#getLocale()}. + */ + CharSequence getName(); + + /** + * Returns the place's phone number in international format. Returns null if no phone number is + * known, or the place has no phone number. + *

+ * International format includes the country code, and is prefixed with the plus (+) sign. For + * example, the international phone number for Google's Mountain View, USA office is +1 + * 650-253-0000. + */ + CharSequence getPhoneNumber(); + + /** + * Returns a list of place types for this Place. + *

+ * The elements of this list are drawn from Place.TYPE_* constants, though one should + * expect there could be new place types returned that were introduced after an app was + * published. + */ + List getPlaceTypes(); + + /** + * Returns the price level for this place on a scale from 0 (cheapest) to 4. + *

+ * If no price level is known, a negative value is returned. + *

+ * The price level of the place, on a scale of 0 to 4. The exact amount indicated by a specific + * value will vary from region to region. Price levels are interpreted as follows: + */ + int getPriceLevel(); + + /** + * Returns the place's rating, from 1.0 to 5.0, based on aggregated user reviews. + *

+ * If no rating is known, a negative value is returned. + */ + float getRating(); + + /** + * Returns a viewport for displaying this Place. May return null if the size of the place is not + * known. + *

+ * This returns a viewport of a size that is suitable for displaying this Place. For example, a + * Place representing a store may have a relatively small viewport, while a Place representing a + * country may have a very large viewport. + */ + LatLngBounds getViewport(); + + /** + * Returns the URI of the website of this Place. Returns null if no website is known. + *

+ * This is the URI of the website maintained by the Place, if available. Note this is a + * third-party website not affiliated with the Places API. + */ + Uri getWebsiteUri(); + +} diff --git a/play-services-api/src/main/java/com/google/android/gms/location/places/internal/PlaceImpl.java b/play-services-api/src/main/java/com/google/android/gms/location/places/internal/PlaceImpl.java new file mode 100644 index 00000000..7bdac464 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/location/places/internal/PlaceImpl.java @@ -0,0 +1,145 @@ +/* + * Copyright 2013-2016 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.location.places.internal; + +import android.net.Uri; +import android.os.Bundle; + +import com.google.android.gms.location.places.Place; +import com.google.android.gms.maps.model.LatLng; +import com.google.android.gms.maps.model.LatLngBounds; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Locale; + +public class PlaceImpl extends AutoSafeParcelable implements Place { + @SafeParceled(1000) + private int versionCode = 2; + @SafeParceled(1) + public String id; + @SafeParceled(2) + public Bundle addressComponents; + @SafeParceled(4) + public LatLng latLng; + @SafeParceled(5) + public float levelNumber; + @SafeParceled(6) + public LatLngBounds viewport; + @SafeParceled(7) + public String timezoneId; + @SafeParceled(8) + public Uri websiteUri; + @SafeParceled(9) + public boolean isPermanentlyClosed; + @SafeParceled(10) + public float rating; + @SafeParceled(11) + public int priceLevel; + @SafeParceled(12) + public long timestampSecs; + @SafeParceled(value = 13, subClass = Integer.class) + public List typesDeprecated = new ArrayList(); + @SafeParceled(14) + public String address; + @SafeParceled(15) + public String phoneNumber; + @SafeParceled(16) + public String regularOpenHours; + @SafeParceled(value = 17, subClass = String.class) + public List attributions = new ArrayList(); + @SafeParceled(19) + public String name; + @SafeParceled(value = 20, subClass = Integer.class) + public List placeTypes = new ArrayList(); + + @Override + public CharSequence getAddress() { + return address; + } + + @Override + public CharSequence getAttributions() { + return Arrays.toString(attributions.toArray()); + } + + @Override + public String getId() { + return id; + } + + @Override + public LatLng getLatLng() { + return latLng; + } + + @Override + public Locale getLocale() { + return Locale.getDefault(); + } + + @Override + public CharSequence getName() { + return name; + } + + @Override + public CharSequence getPhoneNumber() { + return phoneNumber; + } + + @Override + public List getPlaceTypes() { + return placeTypes; + } + + @Override + public int getPriceLevel() { + return priceLevel; + } + + @Override + public float getRating() { + return rating; + } + + @Override + public LatLngBounds getViewport() { + return viewport; + } + + @Override + public Uri getWebsiteUri() { + return websiteUri; + } + + @Override + public Place freeze() { + return this; + } + + @Override + public boolean isDataValid() { + return true; + } + + public static final Creator CREATOR = new AutoSafeParcelable.AutoCreator(PlaceImpl.class); +} diff --git a/play-services-api/src/main/java/org/microg/gms/auth/AuthConstants.java b/play-services-api/src/main/java/org/microg/gms/auth/AuthConstants.java index 70ce7126..b60d781a 100644 --- a/play-services-api/src/main/java/org/microg/gms/auth/AuthConstants.java +++ b/play-services-api/src/main/java/org/microg/gms/auth/AuthConstants.java @@ -19,4 +19,8 @@ package org.microg.gms.auth; public class AuthConstants { public static final String DEFAULT_ACCOUNT = "<>"; public static final String SCOPE_GET_ACCOUNT_ID = "^^_account_id_^^"; + public static final String PROVIDER_METHOD_GET_ACCOUNTS = "get_accounts"; + public static final String PROVIDER_METHOD_CLEAR_PASSWORD = "clear_password"; + public static final String PROVIDER_EXTRA_CLEAR_PASSWORD = "clear_password"; + public static final String PROVIDER_EXTRA_ACCOUNTS = "accounts"; } diff --git a/play-services-api/src/main/java/org/microg/gms/common/Constants.java b/play-services-api/src/main/java/org/microg/gms/common/Constants.java index d838c0b0..4fb16e83 100644 --- a/play-services-api/src/main/java/org/microg/gms/common/Constants.java +++ b/play-services-api/src/main/java/org/microg/gms/common/Constants.java @@ -25,5 +25,4 @@ public class Constants { public static final String GMS_PACKAGE_NAME = "com.google.android.gms"; public static final String GSF_PACKAGE_NAME = "com.google.android.gsf"; public static final String GMS_PACKAGE_SIGNATURE_SHA1 = "38918a453d07199354f8b19af05ec6562ced5788"; - } diff --git a/play-services-api/src/main/java/org/microg/gms/location/LocationConstants.java b/play-services-api/src/main/java/org/microg/gms/location/LocationConstants.java index 378c5c73..a06eb103 100644 --- a/play-services-api/src/main/java/org/microg/gms/location/LocationConstants.java +++ b/play-services-api/src/main/java/org/microg/gms/location/LocationConstants.java @@ -18,4 +18,16 @@ package org.microg.gms.location; public class LocationConstants { public static final String KEY_MOCK_LOCATION = "mockLocation"; + + // Place picker client->service + public static final String EXTRA_PRIMARY_COLOR = "primary_color"; + public static final String EXTRA_PRIMARY_COLOR_DARK = "primary_color_dark"; + public static final String EXTRA_CLIENT_VERSION = "gmscore_client_jar_version"; + public static final String EXTRA_BOUNDS = "latlng_bounds"; + + // Place picker service->client + public static final String EXTRA_ATTRIBUTION = "third_party_attributions"; + public static final String EXTRA_FINAL_BOUNDS = "final_latlng_bounds"; + public static final String EXTRA_PLACE = "selected_place"; + public static final String EXTRA_STATUS = "status"; } From d7210d466aec8901f6bd08461134097ce34edad7 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Tue, 26 Jan 2016 23:32:17 +0100 Subject: [PATCH 124/293] Fix layout on small screens / long titles, add ability to define resolver for self-check --- .../tools/selfcheck/SelfCheckGroup.java | 7 +++ .../tools/ui/AbstractSelfCheckFragment.java | 29 +++++++-- .../src/main/res/layout/self_check_entry.xml | 63 ++++++++++--------- 3 files changed, 66 insertions(+), 33 deletions(-) diff --git a/microg-ui-tools/src/main/java/org/microg/tools/selfcheck/SelfCheckGroup.java b/microg-ui-tools/src/main/java/org/microg/tools/selfcheck/SelfCheckGroup.java index cc832597..028e6533 100644 --- a/microg-ui-tools/src/main/java/org/microg/tools/selfcheck/SelfCheckGroup.java +++ b/microg-ui-tools/src/main/java/org/microg/tools/selfcheck/SelfCheckGroup.java @@ -17,6 +17,7 @@ package org.microg.tools.selfcheck; import android.content.Context; +import android.support.v4.app.Fragment; public interface SelfCheckGroup { String getGroupName(Context context); @@ -25,6 +26,12 @@ public interface SelfCheckGroup { interface ResultCollector { void addResult(String name, Result value, String resolution); + + void addResult(String name, Result value, String resolution, CheckResolver resolver); + } + + interface CheckResolver { + void tryResolve(Fragment fragment); } enum Result { diff --git a/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractSelfCheckFragment.java b/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractSelfCheckFragment.java index bb00cf3f..1a3f25b3 100644 --- a/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractSelfCheckFragment.java +++ b/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractSelfCheckFragment.java @@ -41,16 +41,24 @@ import static org.microg.tools.selfcheck.SelfCheckGroup.Result.Unknown; public abstract class AbstractSelfCheckFragment extends Fragment { private static final String TAG = "SelfCheck"; - protected abstract void prepareSelfCheckList(List checks); + private ViewGroup root; @Nullable @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View scrollRoot = inflater.inflate(R.layout.self_check, container, false); + root = (ViewGroup) scrollRoot.findViewById(R.id.self_check_root); + reset(inflater); + return scrollRoot; + } + + protected abstract void prepareSelfCheckList(List checks); + + protected void reset(LayoutInflater inflater) { List selfCheckGroupList = new ArrayList(); prepareSelfCheckList(selfCheckGroupList); - ViewGroup root = (ViewGroup) scrollRoot.findViewById(R.id.self_check_root); + root.removeAllViews(); for (SelfCheckGroup group : selfCheckGroupList) { View groupView = inflater.inflate(R.layout.self_check_group, root, false); ((TextView) groupView.findViewById(android.R.id.title)).setText(group.getGroupName(getContext())); @@ -64,7 +72,6 @@ public abstract class AbstractSelfCheckFragment extends Fragment { } root.addView(groupView); } - return scrollRoot; } private class GroupResultCollector implements SelfCheckGroup.ResultCollector { @@ -76,6 +83,12 @@ public abstract class AbstractSelfCheckFragment extends Fragment { @Override public void addResult(final String name, final SelfCheckGroup.Result result, final String resolution) { + addResult(name, result, resolution, null); + } + + @Override + public void addResult(final String name, final SelfCheckGroup.Result result, final String resolution, + final SelfCheckGroup.CheckResolver resolver) { if (result == null || getActivity() == null) return; getActivity().runOnUiThread(new Runnable() { @Override @@ -96,11 +109,19 @@ public abstract class AbstractSelfCheckFragment extends Fragment { if (result == Unknown) { resultEntry.findViewById(R.id.self_check_result).setVisibility(INVISIBLE); } + if (resolver != null) { + resultEntry.setClickable(true); + resultEntry.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + resolver.tryResolve(AbstractSelfCheckFragment.this); + } + }); + } } viewGroup.addView(resultEntry); } }); - } } } diff --git a/microg-ui-tools/src/main/res/layout/self_check_entry.xml b/microg-ui-tools/src/main/res/layout/self_check_entry.xml index ec5ad8d2..e24a7e1c 100644 --- a/microg-ui-tools/src/main/res/layout/self_check_entry.xml +++ b/microg-ui-tools/src/main/res/layout/self_check_entry.xml @@ -15,39 +15,44 @@ ~ limitations under the License. --> - + - + android:layout_weight="1" + android:orientation="vertical"> + + + + + - - - \ No newline at end of file + android:focusable="false" + android:gravity="right|center_vertical" + android:paddingTop="5dp"/> + \ No newline at end of file From 6186c987124146d2deb14febcf5cf698829a12d8 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Wed, 27 Jan 2016 01:03:00 +0100 Subject: [PATCH 125/293] Remove broken getDrawable() call, add summary line to about --- .../tools/ui/AbstractAboutFragment.java | 20 +++++++++++++++---- .../src/main/res/layout/about_root.xml | 14 +++++++++++-- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractAboutFragment.java b/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractAboutFragment.java index 5e9771aa..42e0c4fc 100644 --- a/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractAboutFragment.java +++ b/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractAboutFragment.java @@ -22,6 +22,7 @@ import android.graphics.drawable.Drawable; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; +import android.support.v4.content.ContextCompat; import android.text.TextUtils; import android.view.LayoutInflater; import android.view.View; @@ -42,9 +43,7 @@ public abstract class AbstractAboutFragment extends Fragment { protected Drawable getIcon() { try { PackageManager pm = getContext().getPackageManager(); - Drawable icon = pm.getPackageInfo(getContext().getPackageName(), 0).applicationInfo.loadIcon(pm); - if (icon == null) return getContext().getDrawable(android.R.drawable.ic_dialog_alert); - return icon; + return pm.getPackageInfo(getContext().getPackageName(), 0).applicationInfo.loadIcon(pm); } catch (PackageManager.NameNotFoundException e) { // Never happens, self package always exists! throw new RuntimeException(e); @@ -73,13 +72,26 @@ public abstract class AbstractAboutFragment extends Fragment { } } + protected String getSelfVersion() { + return getLibVersion(getContext().getPackageName()); + } + + protected String getSummary() { + return null; + } + @Nullable @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View aboutRoot = inflater.inflate(R.layout.about_root, container, false); ((ImageView) aboutRoot.findViewById(android.R.id.icon)).setImageDrawable(getIcon()); ((TextView) aboutRoot.findViewById(android.R.id.title)).setText(getAppName()); - ((TextView) aboutRoot.findViewById(R.id.about_version)).setText(getString(R.string.about_version_str, getLibVersion(getContext().getPackageName()))); + ((TextView) aboutRoot.findViewById(R.id.about_version)).setText(getString(R.string.about_version_str, getSelfVersion())); + String summary = getSummary(); + if (summary != null) { + ((TextView) aboutRoot.findViewById(android.R.id.summary)).setText(summary); + aboutRoot.findViewById(android.R.id.summary).setVisibility(View.VISIBLE); + } List libraries = new ArrayList(); libraries.add(new Library(BuildConfig.APPLICATION_ID, getString(R.string.lib_name), getString(R.string.lib_license))); diff --git a/microg-ui-tools/src/main/res/layout/about_root.xml b/microg-ui-tools/src/main/res/layout/about_root.xml index 1fe0c283..2dceaa79 100644 --- a/microg-ui-tools/src/main/res/layout/about_root.xml +++ b/microg-ui-tools/src/main/res/layout/about_root.xml @@ -31,13 +31,23 @@ + + Date: Sat, 6 Feb 2016 20:02:05 +0100 Subject: [PATCH 126/293] Fixed some lint errors --- .../support/v4/preference/PreferenceFragment.java | 2 +- microg-ui-tools/src/main/res/values-sr/strings.xml | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/microg-ui-tools/src/main/java/android/support/v4/preference/PreferenceFragment.java b/microg-ui-tools/src/main/java/android/support/v4/preference/PreferenceFragment.java index 24070962..8cb10aa6 100644 --- a/microg-ui-tools/src/main/java/android/support/v4/preference/PreferenceFragment.java +++ b/microg-ui-tools/src/main/java/android/support/v4/preference/PreferenceFragment.java @@ -136,7 +136,7 @@ public abstract class PreferenceFragment extends Fragment { @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); - getListView().setScrollBarStyle(0); + getListView().setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY); if (mHavePrefs) { bindPreferences(); } diff --git a/microg-ui-tools/src/main/res/values-sr/strings.xml b/microg-ui-tools/src/main/res/values-sr/strings.xml index 78d4753a..f5578ae1 100644 --- a/microg-ui-tools/src/main/res/values-sr/strings.xml +++ b/microg-ui-tools/src/main/res/values-sr/strings.xml @@ -16,8 +16,15 @@ --> + microG UI Tools + Apache License 2.0, Copyright © microG Team + + Version %1$s + %1$s %2$s + All rights reserved. + Поставка микроГ самопровера Провера исправности подешавања система за коришћење микроГ услуга. - \ No newline at end of file + From 18582ce01a3ba70f1332524bba38a0b54ba6b13f Mon Sep 17 00:00:00 2001 From: Marvin W Date: Sat, 6 Feb 2016 20:46:39 +0100 Subject: [PATCH 127/293] Add missing method to IWearableService --- .../google/android/gms/wearable/internal/IWearableService.aidl | 1 + 1 file changed, 1 insertion(+) diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableService.aidl index 99f3514a..73cb02e7 100644 --- a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableService.aidl +++ b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableService.aidl @@ -17,6 +17,7 @@ interface IWearableService { void addListener(IWearableCallbacks callbacks, in AddListenerRequest request) = 15; void removeListener(IWearableCallbacks callbacks, in RemoveListenerRequest request) = 16; void putConfig(IWearableCallbacks callbacks, in ConnectionConfiguration config) = 19; + void deleteConfig(IWearableCallbacks callbacks, String name) = 20; void getConfigs(IWearableCallbacks callbacks) = 21; void enableConnection(IWearableCallbacks callbacks, String name) = 22; void disableConnection(IWearableCallbacks callbacks, String name) = 23; From 47f885d1ef6173afa6a0b754c1678e95fc8ee89b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20V=C3=A1gner?= Date: Sun, 7 Feb 2016 14:09:50 +0100 Subject: [PATCH 128/293] use disable lint check "MissingTranslation" for now rather than inserting wrong language strings. --- microg-ui-tools/build.gradle | 5 +++++ microg-ui-tools/src/main/res/values-sr/strings.xml | 7 ------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/microg-ui-tools/build.gradle b/microg-ui-tools/build.gradle index 167a335e..0b439ad9 100644 --- a/microg-ui-tools/build.gradle +++ b/microg-ui-tools/build.gradle @@ -44,9 +44,14 @@ android { compileOptions { sourceCompatibility JavaVersion.VERSION_1_6 } + lintOptions { + // TODO: Remove MissingTranslation once we have stable strings and proper translations. + disable 'MissingTranslation' + } } dependencies { compile 'com.android.support:support-v4:23.1.1' compile 'com.android.support:appcompat-v7:23.1.1' } + diff --git a/microg-ui-tools/src/main/res/values-sr/strings.xml b/microg-ui-tools/src/main/res/values-sr/strings.xml index f5578ae1..0d00f669 100644 --- a/microg-ui-tools/src/main/res/values-sr/strings.xml +++ b/microg-ui-tools/src/main/res/values-sr/strings.xml @@ -16,13 +16,6 @@ --> - microG UI Tools - Apache License 2.0, Copyright © microG Team - - Version %1$s - %1$s %2$s - All rights reserved. - Поставка микроГ самопровера From 75cafdbd4b5e6f58885017a15c3b8fc02bc46dfe Mon Sep 17 00:00:00 2001 From: Marvin W Date: Sun, 7 Feb 2016 16:39:25 +0100 Subject: [PATCH 129/293] Add Travis CI support --- .travis.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..5cf5f787 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,21 @@ +language: android +sudo: false +before_script: + - echo sdk.dir $ANDROID_HOME > local.properties +script: + - export TERM=dumb + - export JAVA_OPTS="-XX:MaxPermSize=1024m -XX:+CMSClassUnloadingEnabled -XX:+HeapDumpOnOutOfMemoryError -Xmx2048m" + - ./gradlew build +android: + components: + - platform-tools + - tools + - build-tools-23.0.2 + - android-23 + - extra-android-m2repository +before_cache: + - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock +cache: + directories: + - $HOME/.gradle/caches/ + - $HOME/.gradle/wrapper/ From 18fb8cb8a189d675f8bfbddcfac3f4396c2aba0a Mon Sep 17 00:00:00 2001 From: Marvin W Date: Mon, 8 Feb 2016 03:02:34 +0100 Subject: [PATCH 130/293] Add README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 00000000..38244329 --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ +microG UI Tools +====== +[![Build Status](https://travis-ci.org/microg/android_external_MicroGUiTools.svg?branch=master)](https://travis-ci.org/microg/android_external_MicroGUiTools) +This repository holds a library providing various UI features used in microG apps (GmsCore and UnifiedNlp). From fd8a7a6272e4d3515f0fadee407f266ddecf770b Mon Sep 17 00:00:00 2001 From: Felix Knecht Date: Thu, 11 Feb 2016 23:11:04 +0800 Subject: [PATCH 131/293] Fixed compile in CM13 --- Android.mk | 2 ++ microg-ui-tools/src/main/res/layout/about_root.xml | 10 +++++----- microg-ui-tools/src/main/res/values/strings.xml | 7 ++++++- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Android.mk b/Android.mk index 8b660b6b..6f9596ad 100644 --- a/Android.mk +++ b/Android.mk @@ -4,4 +4,6 @@ include $(CLEAR_VARS) LOCAL_MODULE := MicroGUiTools LOCAL_SRC_FILES := $(call all-java-files-under, microg-ui-tools/src/main/java) +LOCAL_STATIC_JAVA_LIBRARIES := android-support-v4 android-support-v7-appcompat + include $(BUILD_STATIC_JAVA_LIBRARY) diff --git a/microg-ui-tools/src/main/res/layout/about_root.xml b/microg-ui-tools/src/main/res/layout/about_root.xml index 2dceaa79..fbbbd8b1 100644 --- a/microg-ui-tools/src/main/res/layout/about_root.xml +++ b/microg-ui-tools/src/main/res/layout/about_root.xml @@ -34,7 +34,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center_horizontal" - android:text="microG UI Demo" + android:text="@+id/about_root_title" android:textAppearance="@style/TextAppearance.AppCompat.Headline" android:textColor="?attr/colorAccent"/> @@ -44,7 +44,7 @@ android:layout_height="wrap_content" android:gravity="center_horizontal" android:visibility="gone" - android:text="Summary" + android:text="@+id/about_root_summary" android:textAppearance="@style/TextAppearance.AppCompat.Subhead" android:textColor="?attr/colorAccent"/> @@ -53,7 +53,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" - android:text="Version v0.1.0" + android:text="@+id/about_root_version" android:textAppearance="@style/TextAppearance.AppCompat.Subhead"/> - \ No newline at end of file + diff --git a/microg-ui-tools/src/main/res/values/strings.xml b/microg-ui-tools/src/main/res/values/strings.xml index 186ef926..47baddc5 100644 --- a/microg-ui-tools/src/main/res/values/strings.xml +++ b/microg-ui-tools/src/main/res/values/strings.xml @@ -27,4 +27,9 @@ Self-Check Check if the system is correctly set up to use microG. - \ No newline at end of file + + microG UI Demo + Summary + Version v0.1.0 + Included libraries + From c6a81f4d7d978418352648cecd2545ea575a8caf Mon Sep 17 00:00:00 2001 From: Marvin W Date: Thu, 11 Feb 2016 18:13:10 +0100 Subject: [PATCH 132/293] Add references to resources and AndroidManifest.xml to Android.mk related to microg/android_packages_apps_UnifiedNlp#57 --- Android.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Android.mk b/Android.mk index 6f9596ad..b34fceba 100644 --- a/Android.mk +++ b/Android.mk @@ -3,7 +3,8 @@ include $(CLEAR_VARS) LOCAL_MODULE := MicroGUiTools LOCAL_SRC_FILES := $(call all-java-files-under, microg-ui-tools/src/main/java) - +LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/microg-ui-tools/src/main/res +LOCAL_MANIFEST_FILE := $(LOCAL_PATH)/microg-ui-tools/src/main/AndroidManifest.xml LOCAL_STATIC_JAVA_LIBRARIES := android-support-v4 android-support-v7-appcompat include $(BUILD_STATIC_JAVA_LIBRARY) From 2aec42fb759a426f4ff6d05ff7761a9527622776 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Mon, 22 Feb 2016 23:28:21 +0100 Subject: [PATCH 133/293] Add some new (incomplete) classes for Auth API --- .../AccountRecoveryGuidanceRequest.java | 46 +++++++++++++++++++ .../dataservice/AccountRemovalRequest.java | 46 +++++++++++++++++++ .../ConfirmCredentialsRequest.java | 34 ++++++++++++++ .../firstparty/dataservice/TokenRequest.java | 26 ++++++++++- .../ConfirmCredentialsWorkflowRequest.java | 43 +++++++++++++++++ .../firstparty/shared/AccountCredentials.java | 38 +++++++++++++++ .../firstparty/shared/AppDescription.java | 35 ++++++++++++++ .../firstparty/shared/CaptchaSolution.java | 29 ++++++++++++ .../org/microg/gms/auth/AuthConstants.java | 1 + 9 files changed, 297 insertions(+), 1 deletion(-) create mode 100644 play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/AccountRecoveryGuidanceRequest.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/AccountRemovalRequest.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/ConfirmCredentialsRequest.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/auth/firstparty/delegate/ConfirmCredentialsWorkflowRequest.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/auth/firstparty/shared/AccountCredentials.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/auth/firstparty/shared/AppDescription.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/auth/firstparty/shared/CaptchaSolution.java diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/AccountRecoveryGuidanceRequest.java b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/AccountRecoveryGuidanceRequest.java new file mode 100644 index 00000000..31f64611 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/AccountRecoveryGuidanceRequest.java @@ -0,0 +1,46 @@ +/* + * Copyright 2013-2016 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.auth.firstparty.dataservice; + +import android.accounts.Account; + +import org.microg.gms.auth.AuthConstants; +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class AccountRecoveryGuidanceRequest extends AutoSafeParcelable { + + @SafeParceled(1) + private int versionCode = 1; + @SafeParceled(2) + @Deprecated + public final String accountName; + @SafeParceled(3) + public final Account account; + + public AccountRecoveryGuidanceRequest(String accountName) { + this.accountName = accountName; + this.account = new Account(accountName, AuthConstants.DEFAULT_ACCOUNT_TYPE); + } + + public AccountRecoveryGuidanceRequest(Account account) { + this.accountName = account.name; + this.account = account; + } + + public static final Creator CREATOR = new AutoCreator(AccountRecoveryGuidanceRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/AccountRemovalRequest.java b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/AccountRemovalRequest.java new file mode 100644 index 00000000..ee6dd78d --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/AccountRemovalRequest.java @@ -0,0 +1,46 @@ +/* + * Copyright 2013-2016 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.auth.firstparty.dataservice; + +import android.accounts.Account; + +import org.microg.gms.auth.AuthConstants; +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class AccountRemovalRequest extends AutoSafeParcelable { + + @SafeParceled(1) + private int versionCode = 1; + @SafeParceled(2) + @Deprecated + public final String accountName; + @SafeParceled(3) + public final Account account; + + public AccountRemovalRequest(String accountName) { + this.accountName = accountName; + this.account = new Account(accountName, AuthConstants.DEFAULT_ACCOUNT_TYPE); + } + + public AccountRemovalRequest(Account account) { + this.accountName = account.name; + this.account = account; + } + + public static final Creator CREATOR = new AutoCreator(AccountRemovalRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/ConfirmCredentialsRequest.java b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/ConfirmCredentialsRequest.java new file mode 100644 index 00000000..f477fc08 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/ConfirmCredentialsRequest.java @@ -0,0 +1,34 @@ +/* + * Copyright 2013-2016 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.auth.firstparty.dataservice; + +import com.google.android.gms.auth.firstparty.shared.AccountCredentials; +import com.google.android.gms.auth.firstparty.shared.CaptchaSolution; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class ConfirmCredentialsRequest extends AutoSafeParcelable { + @SafeParceled(1) + private int versionCode = 1; + @SafeParceled(2) + public AccountCredentials accountCredentials; + @SafeParceled(3) + public CaptchaSolution captchaSolution; + + public static final Creator CREATOR = new AutoCreator(ConfirmCredentialsRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/TokenRequest.java b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/TokenRequest.java index f9325a0d..d087c3dc 100644 --- a/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/TokenRequest.java +++ b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/TokenRequest.java @@ -16,5 +16,29 @@ package com.google.android.gms.auth.firstparty.dataservice; -public class TokenRequest { +import android.accounts.Account; +import android.os.Bundle; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +// TODO +public class TokenRequest extends AutoSafeParcelable{ + + @SafeParceled(1) + private int versionCode = 4; + @SafeParceled(3) + public String accountName; + @SafeParceled(4) + public Bundle extras; + @SafeParceled(9) + public String consent; + @SafeParceled(15) + public String accountType; + + public Account getAccount() { + return new Account(accountName, accountType); + } + + public static final Creator CREATOR = new AutoCreator(TokenRequest.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/delegate/ConfirmCredentialsWorkflowRequest.java b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/delegate/ConfirmCredentialsWorkflowRequest.java new file mode 100644 index 00000000..0505c2fe --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/delegate/ConfirmCredentialsWorkflowRequest.java @@ -0,0 +1,43 @@ +/* + * Copyright 2013-2016 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.auth.firstparty.delegate; + +import android.accounts.Account; +import android.accounts.AccountAuthenticatorResponse; +import android.os.Bundle; + +import com.google.android.gms.auth.firstparty.shared.AppDescription; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class ConfirmCredentialsWorkflowRequest extends AutoSafeParcelable { + @SafeParceled(1) + private int versionCode = 3; + @SafeParceled(2) + public String accountName; + @SafeParceled(3) + public AppDescription appDescription; + @SafeParceled(4) + public Bundle extras; + @SafeParceled(5) + public Account account; + @SafeParceled(6) + public AccountAuthenticatorResponse accountAuthenticatorResponse; + + public static final Creator CREATOR = new AutoCreator(ConfirmCredentialsWorkflowRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/shared/AccountCredentials.java b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/shared/AccountCredentials.java new file mode 100644 index 00000000..ccd614c5 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/shared/AccountCredentials.java @@ -0,0 +1,38 @@ +/* + * Copyright 2013-2016 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.auth.firstparty.shared; + +import android.accounts.Account; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +// TODO +public class AccountCredentials extends AutoSafeParcelable { + @SafeParceled(1) + private int versionCode = 2; + @SafeParceled(3) + public String accountName; + @SafeParceled(9) + public String accountType; + + public Account getAccount() { + return new Account(accountName, accountType); + } + + public static final Creator CREATOR = new AutoCreator(AccountCredentials.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/shared/AppDescription.java b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/shared/AppDescription.java new file mode 100644 index 00000000..601c7174 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/shared/AppDescription.java @@ -0,0 +1,35 @@ +/* + * Copyright 2013-2016 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.auth.firstparty.shared; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class AppDescription extends AutoSafeParcelable { + @SafeParceled(1) + private int versionCode = 1; + @SafeParceled(2) + public int callingUid; + @SafeParceled(3) + public String sessiondId; + @SafeParceled(4) + public String sessiondSig; + @SafeParceled(5) + public String callingPkg; + + public static final Creator CREATOR = new AutoCreator(AppDescription.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/shared/CaptchaSolution.java b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/shared/CaptchaSolution.java new file mode 100644 index 00000000..cd9a1c0b --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/shared/CaptchaSolution.java @@ -0,0 +1,29 @@ +/* + * Copyright 2013-2016 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.auth.firstparty.shared; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +// TODO +public class CaptchaSolution extends AutoSafeParcelable { + + @SafeParceled(1) + private int versionCode = 1; + + public static final Creator CREATOR = new AutoCreator(CaptchaSolution.class); +} diff --git a/play-services-api/src/main/java/org/microg/gms/auth/AuthConstants.java b/play-services-api/src/main/java/org/microg/gms/auth/AuthConstants.java index b60d781a..e2cfc905 100644 --- a/play-services-api/src/main/java/org/microg/gms/auth/AuthConstants.java +++ b/play-services-api/src/main/java/org/microg/gms/auth/AuthConstants.java @@ -23,4 +23,5 @@ public class AuthConstants { public static final String PROVIDER_METHOD_CLEAR_PASSWORD = "clear_password"; public static final String PROVIDER_EXTRA_CLEAR_PASSWORD = "clear_password"; public static final String PROVIDER_EXTRA_ACCOUNTS = "accounts"; + public static final String DEFAULT_ACCOUNT_TYPE = "com.google"; } From c9d08fbe0e02fb7edb837552021c0751df4ddbad Mon Sep 17 00:00:00 2001 From: Marvin W Date: Sun, 28 Feb 2016 13:30:17 +0100 Subject: [PATCH 134/293] Add Actions for GeoData and PlaceDetection API --- .../src/main/java/org/microg/gms/common/Services.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/play-services-api/src/main/java/org/microg/gms/common/Services.java b/play-services-api/src/main/java/org/microg/gms/common/Services.java index 56a5c93e..e36198ac 100644 --- a/play-services-api/src/main/java/org/microg/gms/common/Services.java +++ b/play-services-api/src/main/java/org/microg/gms/common/Services.java @@ -330,6 +330,7 @@ public final class Services { public interface GEODATA { int SERVICE_ID = 65; + String ACTION = "com.google.android.gms.location.places.GeoDataApi"; } public interface SEARCH_IME { @@ -338,6 +339,7 @@ public final class Services { public interface PLACE_DETECTION { int SERVICE_ID = 67; + String ACTION = "com.google.android.gms.location.places.PlaceDetectionApi"; } public interface CREDENTIALS { From a80fbe235c4ba26735ce79547c18edfd6dfde823 Mon Sep 17 00:00:00 2001 From: Julien Bolard Date: Tue, 1 Mar 2016 13:49:19 +0100 Subject: [PATCH 135/293] Generate Gradle BuildConfig.java file during AOSP build This fix compilation problem using AOSP source tree since it does not handle (yet?) Graddle generated files. Ignore also Android Studio generated files. Signed-off-by: Julien Bolard --- .gitignore | 3 +++ Android.mk | 27 ++++++++++++++++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 31ed2bf6..7ee5ca07 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,6 @@ build/ .gradle/ local.properties *.iml +.idea/ +build.gradle +BuildConfig.java diff --git a/Android.mk b/Android.mk index b34fceba..840ad077 100644 --- a/Android.mk +++ b/Android.mk @@ -1,10 +1,35 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) +# Generate Gradle BuildConfig.mk file since AOSP does not handle that +# Remove the generated file if you want it to be regenerated with new values + +UITOOLS_BUILDCONFIG_CLASS := microg-ui-tools/src/main/java/org/microg/tools/ui/BuildConfig.java +UITOOLS_BC_PATH := $(LOCAL_PATH)/$(UITOOLS_BUILDCONFIG_CLASS) +UITOOLS_BC_APPLICATION_ID := "org.microg.tools.ui" +UITOOLS_BC_VERSION_CODE := -1 + +$(UITOOLS_BC_PATH): + echo "/**" > $(UITOOLS_BC_PATH) + echo "* Automatically generated file. DO NOT MODIFY" >> $(UITOOLS_BC_PATH) + echo "*/" >> $(UITOOLS_BC_PATH) + echo "package "$(UITOOLS_BC_APPLICATION_ID)";" >> $(UITOOLS_BC_PATH) + echo "public final class BuildConfig {" >> $(UITOOLS_BC_PATH) + echo " public static final String APPLICATION_ID = \""$(UITOOLS_BC_APPLICATION_ID)"\";" >> $(UITOOLS_BC_PATH) + echo " public static final int VERSION_CODE = "$(UITOOLS_BC_VERSION_CODE)";" >> $(UITOOLS_BC_PATH) + echo " private BuildConfig() {}" >> $(UITOOLS_BC_PATH) + echo "}" >> $(UITOOLS_BC_PATH) + LOCAL_MODULE := MicroGUiTools LOCAL_SRC_FILES := $(call all-java-files-under, microg-ui-tools/src/main/java) +LOCAL_SRC_FILES += $(UITOOLS_BUILDCONFIG_CLASS) + LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/microg-ui-tools/src/main/res -LOCAL_MANIFEST_FILE := $(LOCAL_PATH)/microg-ui-tools/src/main/AndroidManifest.xml +LOCAL_RESOURCE_DIR += frameworks/support/v7/appcompat/res +LOCAL_MANIFEST_FILE := microg-ui-tools/src/main/AndroidManifest.xml LOCAL_STATIC_JAVA_LIBRARIES := android-support-v4 android-support-v7-appcompat +LOCAL_AAPT_FLAGS := --auto-add-overlay +LOCAL_AAPT_FLAGS += --extra-packages android.support.v7.appcompat + include $(BUILD_STATIC_JAVA_LIBRARY) From c959e72839430ee32d6c9bebee1d2531b4e8e31c Mon Sep 17 00:00:00 2001 From: Marvin W Date: Thu, 3 Mar 2016 01:26:28 +0100 Subject: [PATCH 136/293] Add Map API callbacks --- .../android/gms/maps/internal/IOnMapLoadedCallback.aidl | 1 + .../android/gms/maps/internal/ISnapshotReadyCallback.aidl | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnMapLoadedCallback.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnMapLoadedCallback.aidl index 969d9652..d3fc105d 100644 --- a/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnMapLoadedCallback.aidl +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnMapLoadedCallback.aidl @@ -1,4 +1,5 @@ package com.google.android.gms.maps.internal; interface IOnMapLoadedCallback { + void onMapLoaded(); } diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/ISnapshotReadyCallback.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/ISnapshotReadyCallback.aidl index 48a39219..f907e336 100644 --- a/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/ISnapshotReadyCallback.aidl +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/ISnapshotReadyCallback.aidl @@ -1,4 +1,9 @@ package com.google.android.gms.maps.internal; +import com.google.android.gms.dynamic.IObjectWrapper; +import android.graphics.Bitmap; + interface ISnapshotReadyCallback { + void onBitmapReady(in Bitmap bitmap); + void onBitmapWrappedReady(IObjectWrapper wrapper); } From 1e8926edd95dc155d57c1306d7b13448cd895740 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Fri, 4 Mar 2016 15:54:36 +0100 Subject: [PATCH 137/293] Add permission self check --- .../tools/selfcheck/PermissionCheckGroup.java | 76 +++++++++++++++++++ .../src/main/res/layout/about_root.xml | 2 +- .../src/main/res/values-sr/strings.xml | 4 + .../src/main/res/values/strings.xml | 4 + 4 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 microg-ui-tools/src/main/java/org/microg/tools/selfcheck/PermissionCheckGroup.java diff --git a/microg-ui-tools/src/main/java/org/microg/tools/selfcheck/PermissionCheckGroup.java b/microg-ui-tools/src/main/java/org/microg/tools/selfcheck/PermissionCheckGroup.java new file mode 100644 index 00000000..266cf64d --- /dev/null +++ b/microg-ui-tools/src/main/java/org/microg/tools/selfcheck/PermissionCheckGroup.java @@ -0,0 +1,76 @@ +/* + * Copyright 2013-2016 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 org.microg.tools.selfcheck; + +import android.annotation.TargetApi; +import android.content.Context; +import android.content.pm.PackageManager; +import android.content.pm.PermissionGroupInfo; +import android.content.pm.PermissionInfo; +import android.support.v4.app.Fragment; +import android.util.Log; + +import org.microg.tools.ui.R; + +import static android.os.Build.VERSION_CODES.M; +import static org.microg.tools.selfcheck.SelfCheckGroup.Result.Negative; +import static org.microg.tools.selfcheck.SelfCheckGroup.Result.Positive; + +@TargetApi(M) +public class PermissionCheckGroup implements SelfCheckGroup { + private static final String TAG = "SelfCheckPerms"; + + private String[] permissions; + + public PermissionCheckGroup(String... permissions) { + this.permissions = permissions; + } + + @Override + public String getGroupName(Context context) { + return context.getString(R.string.self_check_cat_permissions); + } + + @Override + public void doChecks(Context context, ResultCollector collector) { + for (String permission : permissions) { + doPermissionCheck(context, collector, permission); + } + } + + private void doPermissionCheck(Context context, ResultCollector collector, final String permission) { + PackageManager pm = context.getPackageManager(); + try { + PermissionInfo info = pm.getPermissionInfo(permission, 0); + PermissionGroupInfo groupInfo = info.group != null ? pm.getPermissionGroupInfo(info.group, 0) : null; + CharSequence permLabel = info.loadLabel(pm); + CharSequence groupLabel = groupInfo != null ? groupInfo.loadLabel(pm) : permLabel; + collector.addResult(context.getString(R.string.self_check_name_permission, permLabel), + context.checkSelfPermission(permission) == PackageManager.PERMISSION_GRANTED ? Positive : Negative, + context.getString(R.string.self_check_resolution_permission, groupLabel), + new SelfCheckGroup.CheckResolver() { + + @Override + public void tryResolve(Fragment fragment) { + fragment.requestPermissions(new String[]{permission}, 0); + } + }); + } catch (PackageManager.NameNotFoundException e) { + Log.w(TAG, e); + } + } +} diff --git a/microg-ui-tools/src/main/res/layout/about_root.xml b/microg-ui-tools/src/main/res/layout/about_root.xml index fbbbd8b1..c731c4a7 100644 --- a/microg-ui-tools/src/main/res/layout/about_root.xml +++ b/microg-ui-tools/src/main/res/layout/about_root.xml @@ -65,7 +65,7 @@ android:paddingRight="?attr/listPreferredItemPaddingRight" android:paddingTop="16dip" android:textAppearance="@style/TextAppearance.AppCompat.Body2" - android:text="@+id/about_root_libraries" + android:text="@string/about_root_libraries" android:textColor="?attr/colorAccent"/> микроГ самопровера Провера исправности подешавања система за коришћење микроГ услуга. + + Дозволе одобрене + Дозволе за %1$s: + Тапните овде да одобрите дозволе за %1$s. Не одобравање дозвола може да резултира чудним понашањем апликација. diff --git a/microg-ui-tools/src/main/res/values/strings.xml b/microg-ui-tools/src/main/res/values/strings.xml index 47baddc5..010cb604 100644 --- a/microg-ui-tools/src/main/res/values/strings.xml +++ b/microg-ui-tools/src/main/res/values/strings.xml @@ -28,6 +28,10 @@ Self-Check Check if the system is correctly set up to use microG. + Permissions granted + Permission to %1$s: + Touch here to grant permission to %1$s. Not granting the permission can result in misbehaving applications. + microG UI Demo Summary Version v0.1.0 From 96540b11c64f6e5821e86014a9b32647307a89d6 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Sat, 5 Mar 2016 21:47:41 +0100 Subject: [PATCH 138/293] Add field to wearable PutDataRequest --- .../gms/wearable/internal/PutDataRequest.java | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/PutDataRequest.java b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/PutDataRequest.java index 97559a8a..53529134 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/PutDataRequest.java +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/PutDataRequest.java @@ -37,6 +37,7 @@ import java.util.Map; @PublicApi public class PutDataRequest extends AutoSafeParcelable { public static final String WEAR_URI_SCHEME = "wear"; + private static final int DEFAULT_SYNC_DEADLINE = 30 * 60 * 1000; @SafeParceled(1) private int versionCode = 1; @@ -46,6 +47,8 @@ public class PutDataRequest extends AutoSafeParcelable { private final Bundle assets; @SafeParceled(5) byte[] data; + @SafeParceled(6) + long syncDeadline = DEFAULT_SYNC_DEADLINE; private PutDataRequest() { uri = null; @@ -130,10 +133,19 @@ public class PutDataRequest extends AutoSafeParcelable { } public String toString(boolean verbose) { - return "PutDataRequest[uri=" + uri + - ", data=" + (data == null ? "null" : Base64.encodeToString(data, Base64.NO_WRAP)) + - ", numAssets=" + getAssets().size() + "]"; - // TODO: Verbose: dump all assets + StringBuilder sb = new StringBuilder(); + sb.append("PutDataRequest[uri=").append(uri) + .append(", data=").append(data == null ? "null" : Base64.encodeToString(data, Base64.NO_WRAP)) + .append(", numAssets=").append(getAssets().size()); + if (verbose) { + sb.append(",assets=["); + for (String key : getAssets().keySet()) { + sb.append(key).append('=').append(getAsset(key)).append(", "); + } + sb.delete(sb.length() - 2, sb.length()).append(']'); + } + sb.append("]"); + return sb.toString(); } public static final Creator CREATOR = new AutoCreator(PutDataRequest.class); From 249915ed3f1ba5df3eeb1906580e028d01172cb9 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Mon, 14 Mar 2016 19:09:46 +0100 Subject: [PATCH 139/293] Small updates to maps api --- .../android/gms/maps/internal/IMapFragmentDelegate.aidl | 2 ++ .../google/android/gms/maps/internal/IMapViewDelegate.aidl | 2 +- .../java/com/google/android/gms/maps/GoogleMapOptions.java | 6 ++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IMapFragmentDelegate.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IMapFragmentDelegate.aidl index ebfee0d1..988ecee2 100644 --- a/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IMapFragmentDelegate.aidl +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IMapFragmentDelegate.aidl @@ -3,6 +3,7 @@ package com.google.android.gms.maps.internal; import android.os.Bundle; import com.google.android.gms.maps.internal.IGoogleMapDelegate; +import com.google.android.gms.maps.internal.IOnMapReadyCallback; import com.google.android.gms.maps.GoogleMapOptions; import com.google.android.gms.dynamic.IObjectWrapper; @@ -18,4 +19,5 @@ interface IMapFragmentDelegate { void onLowMemory(); void onSaveInstanceState(inout Bundle outState); boolean isReady(); + void getMapAsync(IOnMapReadyCallback callback); } diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IMapViewDelegate.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IMapViewDelegate.aidl index b53e364f..80362ce0 100644 --- a/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IMapViewDelegate.aidl +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IMapViewDelegate.aidl @@ -15,5 +15,5 @@ interface IMapViewDelegate { void onLowMemory(); void onSaveInstanceState(inout Bundle outState); IObjectWrapper getView(); - void addOnMapReadyCallback(IOnMapReadyCallback callback); + void getMapAsync(IOnMapReadyCallback callback); } diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/GoogleMapOptions.java b/play-services-api/src/main/java/com/google/android/gms/maps/GoogleMapOptions.java index a5534cb2..fc6ee3fb 100644 --- a/play-services-api/src/main/java/com/google/android/gms/maps/GoogleMapOptions.java +++ b/play-services-api/src/main/java/com/google/android/gms/maps/GoogleMapOptions.java @@ -43,6 +43,12 @@ public final class GoogleMapOptions extends AutoSafeParcelable { private boolean tiltGesturesEnabled = true; @SafeParceled(11) private boolean rotateGesturesEnabled = true; + @SafeParceled(12) + private boolean liteMode = false; + @SafeParceled(14) + private boolean mapToobarEnabled = false; + @SafeParceled(15) + private boolean ambientEnabled = false; public GoogleMapOptions() { } From a3001d93f8db2a79f5f5d339b960eeedaff4f7e2 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Mon, 14 Mar 2016 19:10:22 +0100 Subject: [PATCH 140/293] Add support for Assets to DataItem --- .../wearable/internal/DataItemParcelable.java | 31 +++++++++++++++++-- .../gms/wearable/internal/PutDataRequest.java | 4 +-- 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/DataItemParcelable.java b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/DataItemParcelable.java index 1d6bef63..62040109 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/DataItemParcelable.java +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/DataItemParcelable.java @@ -19,13 +19,16 @@ package com.google.android.gms.wearable.internal; import android.net.Uri; import android.os.Bundle; +import com.google.android.gms.wearable.DataItem; +import com.google.android.gms.wearable.DataItemAsset; + import org.microg.safeparcel.AutoSafeParcelable; import org.microg.safeparcel.SafeParceled; import java.util.HashMap; import java.util.Map; -public class DataItemParcelable extends AutoSafeParcelable { +public class DataItemParcelable extends AutoSafeParcelable implements DataItem { @SafeParceled(1) private int versionCode = 1; @SafeParceled(2) @@ -50,8 +53,8 @@ public class DataItemParcelable extends AutoSafeParcelable { data = null; } - public Map getAssets() { - Map assets = new HashMap(); + public Map getAssets() { + Map assets = new HashMap(); this.assets.setClassLoader(DataItemAssetParcelable.class.getClassLoader()); for (String key : this.assets.keySet()) { assets.put(key, (DataItemAssetParcelable) this.assets.getParcelable(key)); @@ -59,9 +62,31 @@ public class DataItemParcelable extends AutoSafeParcelable { return assets; } + @Override + public byte[] getData() { + return data; + } + + @Override public Uri getUri() { return uri; } + @Override + public DataItem setData(byte[] data) { + this.data = data; + return this; + } + + @Override + public DataItem freeze() { + return this; + } + + @Override + public boolean isDataValid() { + return true; + } + public static final Creator CREATOR = new AutoCreator(DataItemParcelable.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/PutDataRequest.java b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/PutDataRequest.java index 53529134..49018144 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/PutDataRequest.java +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/PutDataRequest.java @@ -137,8 +137,8 @@ public class PutDataRequest extends AutoSafeParcelable { sb.append("PutDataRequest[uri=").append(uri) .append(", data=").append(data == null ? "null" : Base64.encodeToString(data, Base64.NO_WRAP)) .append(", numAssets=").append(getAssets().size()); - if (verbose) { - sb.append(",assets=["); + if (verbose && !getAssets().isEmpty()) { + sb.append(", assets=["); for (String key : getAssets().keySet()) { sb.append(key).append('=').append(getAsset(key)).append(", "); } From 75562ce8b6d19fccde3ca46ab853513f48832a05 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Wed, 23 Mar 2016 22:45:40 +0100 Subject: [PATCH 141/293] Move constant --- .../src/main/java/org/microg/gms/gcm/GcmConstants.java | 1 + 1 file changed, 1 insertion(+) diff --git a/play-services-api/src/main/java/org/microg/gms/gcm/GcmConstants.java b/play-services-api/src/main/java/org/microg/gms/gcm/GcmConstants.java index d387b56c..ba75ba90 100644 --- a/play-services-api/src/main/java/org/microg/gms/gcm/GcmConstants.java +++ b/play-services-api/src/main/java/org/microg/gms/gcm/GcmConstants.java @@ -32,6 +32,7 @@ public final class GcmConstants { public static final String EXTRA_APP = "app"; public static final String EXTRA_COMPONENT = "component"; public static final String EXTRA_DELAY = "google.delay"; + public static final String EXTRA_DELETE = "delete"; public static final String EXTRA_ERROR = "error"; public static final String EXTRA_FROM = "from"; public static final String EXTRA_GSF_INTENT = "GSF"; From e71bf1b2596a19541e59e3fe4db5cce194b5dd21 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Thu, 14 Apr 2016 21:33:21 +0200 Subject: [PATCH 142/293] Small fixes and Gradle update --- gradle/wrapper/gradle-wrapper.properties | 2 +- play-services-api/build.gradle | 16 +- .../common/internal/GetServiceRequest.java | 4 +- .../gms/wearable/ConnectionConfiguration.java | 16 + .../org/microg/gms/common/GmsService.java | 118 ++++++ .../java/org/microg/gms/common/Services.java | 365 ------------------ 6 files changed, 144 insertions(+), 377 deletions(-) create mode 100644 play-services-api/src/main/java/org/microg/gms/common/GmsService.java delete mode 100644 play-services-api/src/main/java/org/microg/gms/common/Services.java diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 03cfe798..aa76e3eb 100755 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.6-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-2.12-all.zip diff --git a/play-services-api/build.gradle b/play-services-api/build.gradle index 28a98c26..b1477716 100644 --- a/play-services-api/build.gradle +++ b/play-services-api/build.gradle @@ -19,25 +19,23 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:1.5.0' - classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3' + classpath 'com.android.tools.build:gradle:2.0.0' } } apply plugin: 'com.android.library' -apply plugin: 'com.github.dcendents.android-maven' String getMyVersionName() { def stdout = new ByteArrayOutputStream() - exec { - commandLine 'git', 'describe', '--tags', '--always', '--dirty' - standardOutput = stdout - } - return stdout.toString().trim() + if (rootProject.file("gradlew").exists()) + exec { commandLine 'git', 'describe', '--tags', '--always', '--dirty'; standardOutput = stdout } + else // automatic build system, don't tag dirty + exec { commandLine 'git', 'describe', '--tags', '--always'; standardOutput = stdout } + return stdout.toString().trim().substring(1) } group = 'org.microg' -version = getMyVersionName().substring(1) +version = getMyVersionName() android { compileSdkVersion 23 diff --git a/play-services-api/src/main/java/com/google/android/gms/common/internal/GetServiceRequest.java b/play-services-api/src/main/java/com/google/android/gms/common/internal/GetServiceRequest.java index 9633516d..3a4754fc 100644 --- a/play-services-api/src/main/java/com/google/android/gms/common/internal/GetServiceRequest.java +++ b/play-services-api/src/main/java/com/google/android/gms/common/internal/GetServiceRequest.java @@ -23,7 +23,7 @@ import android.os.IBinder; import com.google.android.gms.common.api.Scope; import org.microg.gms.common.Constants; -import org.microg.gms.common.Services; +import org.microg.gms.common.GmsService; import org.microg.safeparcel.AutoSafeParcelable; import org.microg.safeparcel.SafeParceled; @@ -67,7 +67,7 @@ public class GetServiceRequest extends AutoSafeParcelable { @Override public String toString() { return "GetServiceRequest{" + - "serviceId=" + Services.nameFromServiceId(serviceId) + + "serviceId=" + GmsService.nameFromServiceId(serviceId) + ", gmsVersion=" + gmsVersion + ", packageName='" + packageName + '\'' + (scopes == null || scopes.length == 0 ? "" : (", scopes=" + Arrays.toString(scopes))) + diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/ConnectionConfiguration.java b/play-services-api/src/main/java/com/google/android/gms/wearable/ConnectionConfiguration.java index eb707a9a..1b813e40 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wearable/ConnectionConfiguration.java +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/ConnectionConfiguration.java @@ -65,5 +65,21 @@ public class ConnectionConfiguration extends AutoSafeParcelable { this.nodeId = nodeId; } + @Override + public String toString() { + final StringBuilder sb = new StringBuilder("ConnectionConfiguration{"); + sb.append("name='").append(name).append('\''); + sb.append(", address='").append(address).append('\''); + sb.append(", type=").append(type); + sb.append(", role=").append(role); + sb.append(", enabled=").append(enabled); + sb.append(", connected=").append(connected); + sb.append(", peerNodeId='").append(peerNodeId).append('\''); + sb.append(", btlePriority=").append(btlePriority); + sb.append(", nodeId='").append(nodeId).append('\''); + sb.append('}'); + return sb.toString(); + } + public static final Creator CREATOR = new AutoCreator(ConnectionConfiguration.class); } diff --git a/play-services-api/src/main/java/org/microg/gms/common/GmsService.java b/play-services-api/src/main/java/org/microg/gms/common/GmsService.java new file mode 100644 index 00000000..51f6f90b --- /dev/null +++ b/play-services-api/src/main/java/org/microg/gms/common/GmsService.java @@ -0,0 +1,118 @@ +/* + * Copyright 2013-2015 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 org.microg.gms.common; + +public enum GmsService { + UNKNOWN(-2), + ANY(-1), + GAMES(1, "com.google.android.gms.games.service.START"), + PLUS(2, "com.google.android.gms.plus.service.START", "com.google.android.gms.plus.service.internal.START"), + PANORAMA(3, "com.google.android.gms.panorama.service.START"), + WALLET(4, "com.google.android.gms.wallet.service.BIND"), + PEOPLE(5, "com.google.android.gms.people.service.START"), + LOCATION(6), + APPSTATE(7, "com.google.android.gms.appstate.service.START"), + ADREQUEST(8, "com.google.android.gms.ads.service.START"), + ACCOUNT(9, "com.google.android.gms.accounts.ACCOUNT_SERVICE"), + CAST(10, "com.google.android.gms.cast.service.BIND_CAST_DEVICE_CONTROLLER_SERVICE"), + DRIVE(11, "com.google.android.gms.drive.ApiService.START"), + ADDRESS(12, "com.google.android.gms.identity.service.BIND"), + CAR(13, "com.google.android.gms.car.service.START"), + WEARABLE(14, "com.google.android.gms.wearable.BIND"), + AUTH(16, "com.google.android.gms.auth.service.START"), + FITNESS(17, "com.google.android.gms.fitness.GoogleFitnessService.START"), + REMINDERS(18, "com.google.android.gms.reminders.service.START"), + LIGHTWEIGHT_INDEX(19, "com.google.android.gms.icing.LIGHTWEIGHT_INDEX_SERVICE"), + DEVICE_CONNECTION(20, "com.google.android.gms.deviceconnection.service.START"), + INDEX(21, "com.google.android.gms.icing.INDEX_SERVICE"), + LOCATION_REPORTING(22, "com.google.android.gms.location.reporting.service.START", "com.google.android.location.reporting.service.START"), + LOCATION_MANAGER(23, "com.google.android.location.internal.GoogleLocationManagerService.START"), + PLAY_LOG(24, "com.google.android.gms.playlog.service.START"), + DROIDGUARD(25, "com.google.android.gms.droidguard.service.START"), + LOCKBOX(26, "com.google.android.gms.lockbox.service.START"), + CAST_MIRRORING(27, "com.google.android.gms.cast_mirroring.service.START"), + NETWORK_QUALITY(28, "com.google.android.gms.mdm.services.START"), + FEEDBACK(29, "com.google.android.gms.feedback.internal.IFeedbackService"), + SEARCH_ADMINISTRATION(30), + PHOTO_AUTO_BACKUP(31, "com.google.android.gms.photos.autobackup.service.START"), + SEARCH_QUERIES(32), + SEARCH_GLOBAL(33), + UDC(35, "com.google.android.gms.udc.service.START"), + SEARCH_CORPORA(36), + DEVICE_MANAGER(37, "com.google.android.gms.mdm.services.DeviceManagerApiService.START"), + PSEUDONYMOUS_ID(38, "com.google.android.gms.pseudonymous.service.START"), + COMMON(39, "com.google.android.gms.common.service.START"), + CLEARCUT_LOGGER(40, "com.google.android.gms.clearcut.service.START"), + USAGE_REPORTING(41, "com.google.android.gms.usagereporting.service.START"), + KIDS(42, "com.google.android.gms.kids.service.START"), + DOWNLOAD(43, "com.google.android.gms.common.download.START"), + SIGN_IN(44, "com.google.android.gms.signin.service.START"), + SAFETY_NET_CLIENT(45, "com.google.android.gms.safetynet.service.START"), + GSERVICES(46, "com.google.android.gms.ads.gservice.START"), + CONTEXT_MANAGER(47, "com.google.android.contextmanager.service.ContextManagerService.START"), + AUDIO_MODEM(48, "com.google.android.gms.audiomodem.service.AudioModemService.START"), + NEARBY_SHARING(49, "com.google.android.gms.nearby.sharing.service.NearbySharingService.START"), + LIGHTWEIGHT_NETWORK_QUALITY(51, "com.google.android.gms.herrevad.services.LightweightNetworkQualityAndroidService.START"), + PHENOTYPE(51, "com.google.android.gms.phenotype.service.START"), + VOICE_UNLOCK(52, "com.google.android.gms.speech.service.START"), + NEARBY_CONNECTIONS(54, "com.google.android.gms.nearby.connection.service.START"), + FITNESS_SENSORS(55, "com.google.android.gms.fitness.SensorsApi"), + FITNESS_RECORDING(56, "com.google.android.gms.fitness.RecordingApi"), + FITNESS_HISTORY(57, "com.google.android.gms.fitness.HistoryApi"), + FITNESS_SESSIONS(58, "com.google.android.gms.fitness.SessionsApi"), + FITNESS_BLE(59, "com.google.android.gms.fitness.BleApi"), + FITNESS_CONFIG(60, "com.google.android.gms.fitness.ConfigApi"), + FITNESS_INTERNAL(61, "com.google.android.gms.fitness.InternalApi"), + NEARBY_MESSAGES(62, "com.google.android.gms.nearby.messages.service.NearbyMessagesService.START"), + HELP(63, "com.google.android.gms.googlehelp.service.GoogleHelpService.START"), + CONFIG(64, "com.google.android.gms.config.START"), + GEODATA(65, "com.google.android.gms.location.places.GeoDataApi"), + SEARCH_IME(66), + PLACE_DETECTION(67, "com.google.android.gms.location.places.PlaceDetectionApi"), + CREDENTIALS(68, "com.google.android.gms.auth.api.credentials.service.START"); + + public int SERVICE_ID; + public String ACTION; + public String[] SECONDARY_ACTIONS; + + GmsService(int serviceId, String... actions) { + this.SERVICE_ID = serviceId; + this.ACTION = actions.length > 0 ? actions[0] : null; + this.SECONDARY_ACTIONS = actions; + } + + public interface ADVERTISING_ID { + // Has no service id + String ACTION = "com.google.android.gms.ads.identifier.service.START"; + } + + public static GmsService byServiceId(int serviceId) { + for (GmsService service : values()) { + if (service.SERVICE_ID == serviceId) return service; + } + return UNKNOWN; + } + + public static String nameFromServiceId(int serviceId) { + return byServiceId(serviceId).toString(serviceId); + } + + public String toString(int serviceId) { + if (this != UNKNOWN) return toString(); + return "UNKNOWN(" + serviceId + ")"; + } +} diff --git a/play-services-api/src/main/java/org/microg/gms/common/Services.java b/play-services-api/src/main/java/org/microg/gms/common/Services.java deleted file mode 100644 index e36198ac..00000000 --- a/play-services-api/src/main/java/org/microg/gms/common/Services.java +++ /dev/null @@ -1,365 +0,0 @@ -/* - * Copyright 2013-2015 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 org.microg.gms.common; - -import java.lang.reflect.Field; - -public final class Services { - - private Services() { - } - - public interface GAMES { - int SERVICE_ID = 1; - String ACTION = "com.google.android.gms.games.service.START"; - } - - public interface PLUS { - int SERVICE_ID = 2; - String ACTION = "com.google.android.gms.plus.service.START"; - String ACTION_INTERNAL = "com.google.android.gms.plus.service.internal.START"; - } - - public interface PANORAMA { - int SERVICE_ID = 3; - String ACTION = "com.google.android.gms.panorama.service.START"; - } - - public interface WALLET { - int SERVICE_ID = 4; - String ACTION = "com.google.android.gms.wallet.service.BIND"; - } - - public interface PEOPLE { - int SERVICE_ID = 5; - String ACTION = "com.google.android.gms.people.service.START"; - } - - public interface LOCATION { - int SERVICE_ID = 6; - } - - public interface APPSTATE { - int SERVICE_ID = 7; - String ACTION = "com.google.android.gms.appstate.service.START"; - } - - public interface ADREQUEST { - int SERVICE_ID = 8; - String ACTION = "com.google.android.gms.ads.service.START"; - } - - public interface ACCOUNT { - int SERVICE_ID = 9; - String ACTION = "com.google.android.gms.accounts.ACCOUNT_SERVICE"; - } - - public interface CAST { - int SERVICE_ID = 10; - String ACTION = "com.google.android.gms.cast.service.BIND_CAST_DEVICE_CONTROLLER_SERVICE"; - } - - public interface DRIVE { - int SERVICE_ID = 11; - String ACTION = "com.google.android.gms.drive.ApiService.START"; - } - - public interface ADDRESS { - int SERVICE_ID = 12; - String ACTION = "com.google.android.gms.identity.service.BIND"; - } - - public interface CAR { - int SERVICE_ID = 13; - String ACTION = "com.google.android.gms.car.service.START"; - } - - public interface WEARABLE { - int SERVICE_ID = 14; - String ACTION = "com.google.android.gms.wearable.BIND"; - } - - public interface AUTH { - int SERVICE_ID = 16; - String ACTION = "com.google.android.gms.auth.service.START"; - } - - public interface FITNESS { - int SERVICE_ID = 17; - String ACTION = "com.google.android.gms.fitness.GoogleFitnessService.START"; - } - - public interface REMINDERS { - int SERVICE_ID = 18; - String ACTION = "com.google.android.gms.reminders.service.START"; - } - - public interface LIGHTWEIGHT_INDEX { - int SERVICE_ID = 19; - String ACTION = "com.google.android.gms.icing.LIGHTWEIGHT_INDEX_SERVICE"; - } - - public interface DEVICE_CONNECTION { - int SERVICE_ID = 20; - String ACTION = "com.google.android.gms.deviceconnection.service.START"; - } - - public interface INDEX { - int SERVICE_ID = 21; - String ACTION = "com.google.android.gms.icing.INDEX_SERVICE"; - } - - public interface LOCATION_REPORTING { - int SERVICE_ID = 22; - String ACTION = "com.google.android.gms.location.reporting.service.START"; - String ACTION_LEGACY = "com.google.android.location.reporting.service.START"; - } - - public interface LOCATION_MANAGER { - int SERVICE_ID = 23; - String ACTION_LEGACY = "com.google.android.location.internal.GoogleLocationManagerService.START"; - } - - public interface PLAY_LOG { - int SERVICE_ID = 24; - String ACTION = "com.google.android.gms.playlog.service.START"; - } - - public interface DROIDGUARD { - int SERVICE_ID = 25; - String ACTION = "com.google.android.gms.droidguard.service.START"; - } - - public interface LOCKBOX { - int SERVICE_ID = 26; - String ACTION = "com.google.android.gms.lockbox.service.START"; - } - - public interface CAST_MIRRORING { - int SERVICE_ID = 27; - String ACTION = "com.google.android.gms.cast_mirroring.service.START"; - } - - public interface NETWORK_QUALITY { - int SERVICE_ID = 28; - String ACTION = "com.google.android.gms.mdm.services.START"; - } - - public interface FEEDBACK { - int SERVICE_ID = 29; - String ACTION = "com.google.android.gms.feedback.internal.IFeedbackService"; - } - - public interface SEARCH_ADMINISTRATION { - int SERVICE_ID = 30; - } - - public interface PHOTO_AUTO_BACKUP { - int SERVICE_ID = 31; - String ACTION = "com.google.android.gms.photos.autobackup.service.START"; - } - - public interface SEARCH_QUERIES { - int SERVICE_ID = 32; - } - - public interface SEARCH_GLOBAL { - int SERVICE_ID = 33; - } - - public interface UDC { - int SERVICE_ID = 35; - String ACTION = "com.google.android.gms.udc.service.START"; - } - - public interface SEARCH_CORPORA { - int SERVICE_ID = 36; - } - - public interface DEVICE_MANAGER { - int SERVICE_ID = 37; - String ACTION = "com.google.android.gms.mdm.services.DeviceManagerApiService.START"; - } - - public interface PSEUDONYMOUS_ID { - int SERVICE_ID = 38; - String ACTION = "com.google.android.gms.pseudonymous.service.START"; - } - - public interface COMMON { - int SERVICE_ID = 39; - String ACTION = "com.google.android.gms.common.service.START"; - } - - public interface CLEARCUT_LOGGER { - int SERVICE_ID = 40; - String ACTION = "com.google.android.gms.clearcut.service.START"; - } - - public interface USAGE_REPORTING { - int SERVICE_ID = 41; - String ACTION = "com.google.android.gms.usagereporting.service.START"; - } - - public interface KIDS { - int SERVICE_ID = 42; - String ACTION = "com.google.android.gms.kids.service.START"; - } - - public interface DOWNLOAD { - int SERVICE_ID = 43; - String ACTION = "com.google.android.gms.common.download.START"; - } - - public interface SIGN_IN { - int SERVICE_ID = 44; - String ACTION = "com.google.android.gms.signin.service.START"; - } - - public interface SAFETY_NET_CLIENT { - int SERVICE_ID = 45; - String ACTION = "com.google.android.gms.safetynet.service.START"; - } - - public interface GSERVICES { - int SERVICE_ID = 46; - String ACTION = "com.google.android.gms.ads.gservice.START"; - } - - public interface CONTEXT_MANAGER { - int SERVICE_ID = 47; - String ACTION = "com.google.android.contextmanager.service.ContextManagerService.START"; - } - - public interface AUDIO_MODEM { - int SERVICE_ID = 48; - String ACTION = "com.google.android.gms.audiomodem.service.AudioModemService.START"; - } - - public interface NEARBY_SHARING { - int SERVICE_ID = 49; - String ACTION = "com.google.android.gms.nearby.sharing.service.NearbySharingService.START"; - } - - public interface LIGHTWEIGHT_NETWORK_QUALITY { - int SERVICE_ID = 51; - String ACTION = "com.google.android.gms.herrevad.services.LightweightNetworkQualityAndroidService.START"; - } - - public interface PHENOTYPE { - int SERVICE_ID = 51; - String ACTION = "com.google.android.gms.phenotype.service.START"; - } - - public interface VOICE_UNLOCK { - int SERVICE_ID = 52; - String ACTION = "com.google.android.gms.speech.service.START"; - } - - public interface NEARBY_CONNECTIONS { - int SERVICE_ID = 54; - String ACTION = "com.google.android.gms.nearby.connection.service.START"; - } - - public interface FITNESS_SENSORS { - int SERVICE_ID = 55; - String ACTION = "com.google.android.gms.fitness.SensorsApi"; - } - - public interface FITNESS_RECORDING { - int SERVICE_ID = 56; - String ACTION = "com.google.android.gms.fitness.RecordingApi"; - } - - public interface FITNESS_HISTORY { - int SERVICE_ID = 57; - String ACTION = "com.google.android.gms.fitness.HistoryApi"; - } - - public interface FITNESS_SESSIONS { - int SERVICE_ID = 58; - String ACTION = "com.google.android.gms.fitness.SessionsApi"; - } - - /** - * BLE = Bluetooth Low Energy - */ - public interface FITNESS_BLE { - int SERVICE_ID = 59; - String ACTION = "com.google.android.gms.fitness.BleApi"; - } - - public interface FITNESS_CONFIG { - int SERVICE_ID = 60; - String ACTION = "com.google.android.gms.fitness.ConfigApi"; - } - - public interface FITNESS_INTERNAL { - int SERVICE_ID = 61; - String ACTION = "com.google.android.gms.fitness.InternalApi"; - } - - public interface NEARBY_MESSAGES { - int SERVICE_ID = 62; - String ACTION = "com.google.android.gms.nearby.messages.service.NearbyMessagesService.START"; - } - - public interface HELP { - int SERVICE_ID = 63; - String ACTION = "com.google.android.gms.googlehelp.service.GoogleHelpService.START"; - } - - public interface CONFIG { - int SERVICE_ID = 64; - String ACTION = "com.google.android.gms.config.START"; - } - - public interface GEODATA { - int SERVICE_ID = 65; - String ACTION = "com.google.android.gms.location.places.GeoDataApi"; - } - - public interface SEARCH_IME { - int SERVICE_ID = 66; - } - - public interface PLACE_DETECTION { - int SERVICE_ID = 67; - String ACTION = "com.google.android.gms.location.places.PlaceDetectionApi"; - } - - public interface CREDENTIALS { - int SERVICE_ID = 68; - String ACTION = "com.google.android.gms.auth.api.credentials.service.START"; - } - - public interface ADVERTISING_ID { - // Has no service id - String ACTION = "com.google.android.gms.ads.identifier.service.START"; - } - - public static String nameFromServiceId(int serviceId) { - for (Class cls : Services.class.getDeclaredClasses()) { - try { - Field serviceIdField = cls.getDeclaredField("SERVICE_ID"); - if ((Integer) serviceIdField.get(null) == serviceId) return cls.getSimpleName(); - } catch (Exception e) { - } - } - return "UNKNOWN(" + serviceId + ")"; - } -} From 6aa110657beec0b3e6c26d1030943e0b97683335 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Thu, 14 Apr 2016 21:36:52 +0200 Subject: [PATCH 143/293] Update Sublib --- extern/SafeParcel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extern/SafeParcel b/extern/SafeParcel index b062691c..5f5d9c04 160000 --- a/extern/SafeParcel +++ b/extern/SafeParcel @@ -1 +1 @@ -Subproject commit b062691c8a3271afa2d44531590e262a71107b0b +Subproject commit 5f5d9c04beb90fa8964da019cf80a7681f428a77 From e73d7fae9a613fff8f3f7b0f2f03011b751b30a4 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Thu, 14 Apr 2016 21:41:46 +0200 Subject: [PATCH 144/293] Update Gradle --- gradle/wrapper/gradle-wrapper.properties | 2 +- microg-ui-tools/build.gradle | 16 ++++++++-------- .../microg/tools/ui/AbstractAboutFragment.java | 2 ++ microg-ui-tools/src/main/res/values/strings.xml | 6 +++++- 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 03cfe798..aa76e3eb 100755 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.6-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-2.12-all.zip diff --git a/microg-ui-tools/build.gradle b/microg-ui-tools/build.gradle index 0b439ad9..bff3323e 100644 --- a/microg-ui-tools/build.gradle +++ b/microg-ui-tools/build.gradle @@ -19,18 +19,18 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:1.5.0' + classpath 'com.android.tools.build:gradle:2.0.0' } } apply plugin: 'com.android.library' String getMyVersionName() { def stdout = new ByteArrayOutputStream() - exec { - commandLine 'git', 'describe', '--tags', '--always', '--dirty' - standardOutput = stdout - } - return stdout.toString().trim() + if (rootProject.file("gradlew").exists()) + exec { commandLine 'git', 'describe', '--tags', '--always', '--dirty'; standardOutput = stdout } + else // automatic build system, don't tag dirty + exec { commandLine 'git', 'describe', '--tags', '--always'; standardOutput = stdout } + return stdout.toString().trim().substring(1) } android { @@ -51,7 +51,7 @@ android { } dependencies { - compile 'com.android.support:support-v4:23.1.1' - compile 'com.android.support:appcompat-v7:23.1.1' + compile 'com.android.support:support-v4:23.3.0' + compile 'com.android.support:appcompat-v7:23.3.0' } diff --git a/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractAboutFragment.java b/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractAboutFragment.java index 42e0c4fc..7e2a915b 100644 --- a/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractAboutFragment.java +++ b/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractAboutFragment.java @@ -95,6 +95,8 @@ public abstract class AbstractAboutFragment extends Fragment { List libraries = new ArrayList(); libraries.add(new Library(BuildConfig.APPLICATION_ID, getString(R.string.lib_name), getString(R.string.lib_license))); + libraries.add(new Library("android.support.v4", getString(R.string.about_android_support_v4), getString(R.string.about_android_support_license))); + libraries.add(new Library("android.support.v7.appcompat", getString(R.string.about_android_support_v7_appcompat), getString(R.string.about_android_support_license))); collectLibraries(libraries); Collections.sort(libraries); ((ListView) aboutRoot.findViewById(android.R.id.list)).setAdapter(new LibraryAdapter(getContext(), libraries.toArray(new Library[libraries.size()]))); diff --git a/microg-ui-tools/src/main/res/values/strings.xml b/microg-ui-tools/src/main/res/values/strings.xml index 010cb604..05af915f 100644 --- a/microg-ui-tools/src/main/res/values/strings.xml +++ b/microg-ui-tools/src/main/res/values/strings.xml @@ -17,7 +17,7 @@ microG UI Tools - Apache License 2.0, Copyright © microG Team + Apache License 2.0 by microG Team Version %1$s %1$s %2$s @@ -36,4 +36,8 @@ Summary Version v0.1.0 Included libraries + + v4 Support Library + v7 appcompat Support Library + Apache License 2.0 by The Android Open Source Project From 276288751397b63730bdb220d129eabb7ffca2d3 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Thu, 14 Apr 2016 22:06:42 +0200 Subject: [PATCH 145/293] Update Gradle, push unfinished GCM --- build.gradle | 11 +- extern/GmsApi | 2 +- gradle/wrapper/gradle-wrapper.properties | 2 +- play-services-base/build.gradle | 13 +- .../gms/common/api/GoogleApiClient.java | 4 +- play-services-cast/build.gradle | 11 +- .../src/main/AndroidManifest.xml | 2 +- play-services-gcm/build.gradle | 43 +++ .../src/main/AndroidManifest.xml | 24 ++ .../android/gms/gcm/GcmListenerService.java | 195 ++++++++++++ .../android/gms/gcm/GcmNetworkManager.java | 244 ++++++++++++++ .../com/google/android/gms/gcm/GcmPubSub.java | 120 +++++++ .../google/android/gms/gcm/GcmReceiver.java | 49 +++ .../android/gms/gcm/GcmTaskService.java | 149 +++++++++ .../android/gms/gcm/GoogleCloudMessaging.java | 301 ++++++++++++++++++ .../google/android/gms/gcm/OneoffTask.java | 221 +++++++++++++ .../google/android/gms/gcm/PeriodicTask.java | 235 ++++++++++++++ .../java/com/google/android/gms/gcm/Task.java | 271 ++++++++++++++++ .../google/android/gms/gcm/TaskParams.java | 49 +++ .../google/android/gms/iid/InstanceID.java | 166 ++++++++++ .../gms/iid/InstanceIDListenerService.java | 138 ++++++++ play-services-location/build.gradle | 11 +- .../location/FusedLocationProviderApi.java | 4 +- .../location/GoogleLocationManagerClient.java | 4 +- play-services-wearable/build.gradle | 11 +- play-services/build.gradle | 12 +- settings.gradle | 1 + 27 files changed, 2262 insertions(+), 31 deletions(-) create mode 100644 play-services-gcm/build.gradle create mode 100644 play-services-gcm/src/main/AndroidManifest.xml create mode 100644 play-services-gcm/src/main/java/com/google/android/gms/gcm/GcmListenerService.java create mode 100644 play-services-gcm/src/main/java/com/google/android/gms/gcm/GcmNetworkManager.java create mode 100644 play-services-gcm/src/main/java/com/google/android/gms/gcm/GcmPubSub.java create mode 100644 play-services-gcm/src/main/java/com/google/android/gms/gcm/GcmReceiver.java create mode 100644 play-services-gcm/src/main/java/com/google/android/gms/gcm/GcmTaskService.java create mode 100644 play-services-gcm/src/main/java/com/google/android/gms/gcm/GoogleCloudMessaging.java create mode 100644 play-services-gcm/src/main/java/com/google/android/gms/gcm/OneoffTask.java create mode 100644 play-services-gcm/src/main/java/com/google/android/gms/gcm/PeriodicTask.java create mode 100644 play-services-gcm/src/main/java/com/google/android/gms/gcm/Task.java create mode 100644 play-services-gcm/src/main/java/com/google/android/gms/gcm/TaskParams.java create mode 100644 play-services-gcm/src/main/java/com/google/android/gms/iid/InstanceID.java create mode 100644 play-services-gcm/src/main/java/com/google/android/gms/iid/InstanceIDListenerService.java diff --git a/build.gradle b/build.gradle index 49dfafa1..c6c27343 100644 --- a/build.gradle +++ b/build.gradle @@ -15,7 +15,16 @@ */ // Top-level build file where you can add configuration options common to all sub-projects/modules. +String getMyVersionName() { + def stdout = new ByteArrayOutputStream() + if (rootProject.file("gradlew").exists()) + exec { commandLine 'git', 'describe', '--tags', '--always', '--dirty'; standardOutput = stdout } + else // automatic build system, don't tag dirty + exec { commandLine 'git', 'describe', '--tags', '--always'; standardOutput = stdout } + return stdout.toString().trim().substring(1) +} + subprojects { group = 'org.microg' - version = '1.0-SNAPSHOT' + version = getMyVersionName() } diff --git a/extern/GmsApi b/extern/GmsApi index f0ec7e60..6aa11065 160000 --- a/extern/GmsApi +++ b/extern/GmsApi @@ -1 +1 @@ -Subproject commit f0ec7e606f3e6e3a219eb87266c4dae1828b5083 +Subproject commit 6aa110657beec0b3e6c26d1030943e0b97683335 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 426c09a0..90babf29 100755 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -19,4 +19,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.6-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-2.12-all.zip diff --git a/play-services-base/build.gradle b/play-services-base/build.gradle index fe05a441..52ff3bd9 100644 --- a/play-services-base/build.gradle +++ b/play-services-base/build.gradle @@ -19,23 +19,26 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:1.3.0' - classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3' + classpath 'com.android.tools.build:gradle:2.0.0' } } apply plugin: 'com.android.library' -apply plugin: 'com.github.dcendents.android-maven' android { compileSdkVersion 23 - buildToolsVersion "23.0.1" + buildToolsVersion "23.0.2" + + defaultConfig { + versionName getMyVersionName() + } + compileOptions { sourceCompatibility JavaVersion.VERSION_1_6 } } dependencies { - compile 'com.android.support:support-v4:23.0.1' + compile 'com.android.support:support-v4:23.3.0' compile project(':play-services-api') } diff --git a/play-services-base/src/main/java/com/google/android/gms/common/api/GoogleApiClient.java b/play-services-base/src/main/java/com/google/android/gms/common/api/GoogleApiClient.java index c3e44885..7140ca96 100644 --- a/play-services-base/src/main/java/com/google/android/gms/common/api/GoogleApiClient.java +++ b/play-services-base/src/main/java/com/google/android/gms/common/api/GoogleApiClient.java @@ -26,7 +26,7 @@ import android.view.View; import com.google.android.gms.common.ConnectionResult; -import org.microg.gms.common.Constants; +import org.microg.gms.auth.AuthConstants; import org.microg.gms.common.PublicApi; import org.microg.gms.common.api.GoogleApiClientImpl; @@ -422,7 +422,7 @@ public interface GoogleApiClient { * Specify that the default account should be used when connecting to services. */ public Builder useDefaultAccount() { - this.accountName = Constants.DEFAULT_ACCOUNT; + this.accountName = AuthConstants.DEFAULT_ACCOUNT; return this; } } diff --git a/play-services-cast/build.gradle b/play-services-cast/build.gradle index 2d7747bc..f900225d 100644 --- a/play-services-cast/build.gradle +++ b/play-services-cast/build.gradle @@ -19,17 +19,20 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:1.3.0' - classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3' + classpath 'com.android.tools.build:gradle:2.0.0' } } apply plugin: 'com.android.library' -apply plugin: 'com.github.dcendents.android-maven' android { compileSdkVersion 23 - buildToolsVersion "23.0.1" + buildToolsVersion "23.0.2" + + defaultConfig { + versionName getMyVersionName() + } + compileOptions { sourceCompatibility JavaVersion.VERSION_1_6 } diff --git a/play-services-cast/src/main/AndroidManifest.xml b/play-services-cast/src/main/AndroidManifest.xml index bb22a334..2031102a 100644 --- a/play-services-cast/src/main/AndroidManifest.xml +++ b/play-services-cast/src/main/AndroidManifest.xml @@ -16,7 +16,7 @@ --> + package="org.microg.gms.cast"> diff --git a/play-services-gcm/build.gradle b/play-services-gcm/build.gradle new file mode 100644 index 00000000..b3a6c833 --- /dev/null +++ b/play-services-gcm/build.gradle @@ -0,0 +1,43 @@ +/* + * Copyright 2013-2015 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. + */ + +buildscript { + repositories { + jcenter() + } + dependencies { + classpath 'com.android.tools.build:gradle:2.0.0' + } +} + +apply plugin: 'com.android.library' + +android { + compileSdkVersion 23 + buildToolsVersion "23.0.2" + + defaultConfig { + versionName getMyVersionName() + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_6 + } +} + +dependencies { + compile project(':play-services-base') +} \ No newline at end of file diff --git a/play-services-gcm/src/main/AndroidManifest.xml b/play-services-gcm/src/main/AndroidManifest.xml new file mode 100644 index 00000000..baaa3ad3 --- /dev/null +++ b/play-services-gcm/src/main/AndroidManifest.xml @@ -0,0 +1,24 @@ + + + + + + + + + diff --git a/play-services-gcm/src/main/java/com/google/android/gms/gcm/GcmListenerService.java b/play-services-gcm/src/main/java/com/google/android/gms/gcm/GcmListenerService.java new file mode 100644 index 00000000..8a14ff78 --- /dev/null +++ b/play-services-gcm/src/main/java/com/google/android/gms/gcm/GcmListenerService.java @@ -0,0 +1,195 @@ +/* + * Copyright 2013-2016 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.gcm; + +import android.app.PendingIntent; +import android.app.Service; +import android.content.Intent; +import android.os.AsyncTask; +import android.os.Bundle; +import android.os.IBinder; +import android.support.v4.os.AsyncTaskCompat; +import android.util.Log; + +import org.microg.gms.common.PublicApi; + +import static org.microg.gms.gcm.GcmConstants.ACTION_C2DM_RECEIVE; +import static org.microg.gms.gcm.GcmConstants.ACTION_NOTIFICATION_OPEN; +import static org.microg.gms.gcm.GcmConstants.EXTRA_ERROR; +import static org.microg.gms.gcm.GcmConstants.EXTRA_FROM; +import static org.microg.gms.gcm.GcmConstants.EXTRA_MESSAGE_ID; +import static org.microg.gms.gcm.GcmConstants.EXTRA_MESSAGE_TYPE; +import static org.microg.gms.gcm.GcmConstants.EXTRA_PENDING_INTENT; +import static org.microg.gms.gcm.GcmConstants.MESSAGE_TYPE_DELETED_MESSAGE; +import static org.microg.gms.gcm.GcmConstants.MESSAGE_TYPE_GCM; +import static org.microg.gms.gcm.GcmConstants.MESSAGE_TYPE_SEND_ERROR; +import static org.microg.gms.gcm.GcmConstants.MESSAGE_TYPE_SEND_EVENT; + +/** + * Base class for communicating with Google Cloud Messaging. + *

+ * It also provides functionality such as automatically displaying + * notifications when requested by app server. + *

+ * Override base class methods to handle any events required by the application. + * Methods are invoked asynchronously. + *

+ * Include the following in the manifest: + *

+ * 
+ *     
+ *         
+ *     
+ * 
+ */ +@PublicApi +public abstract class GcmListenerService extends Service { + private static final String TAG = "GcmListenerService"; + + private final Object lock = new Object(); + private int startId; + private int counter = 0; + + public final IBinder onBind(Intent intent) { + return null; + } + + /** + * Called when GCM server deletes pending messages due to exceeded + * storage limits, for example, when the device cannot be reached + * for an extended period of time. + *

+ * It is recommended to retrieve any missing messages directly from the + * app server. + */ + public void onDeletedMessages() { + // To be overwritten + } + + /** + * Called when a message is received. + * + * @param from describes message sender. + * @param data message data as String key/value pairs. + */ + public void onMessageReceived(String from, Bundle data) { + // To be overwritten + } + + /** + * Called when an upstream message has been successfully sent to the + * GCM connection server. + * + * @param msgId of the upstream message sent using + * {@link com.google.android.gms.gcm.GoogleCloudMessaging#send(java.lang.String, java.lang.String, android.os.Bundle)}. + */ + public void onMessageSent(String msgId) { + // To be overwritten + } + + /** + * Called when there was an error sending an upstream message. + * + * @param msgId of the upstream message sent using + * {@link com.google.android.gms.gcm.GoogleCloudMessaging#send(java.lang.String, java.lang.String, android.os.Bundle)}. + * @param error description of the error. + */ + public void onSendError(String msgId, String error) { + // To be overwritten + } + + public final int onStartCommand(final Intent intent, int flags, int startId) { + synchronized (lock) { + this.startId = startId; + this.counter++; + } + + if (intent != null) { + if (ACTION_NOTIFICATION_OPEN.equals(intent.getAction())) { + handlePendingNotification(intent); + finishCounter(); + GcmReceiver.completeWakefulIntent(intent); + } else if (ACTION_C2DM_RECEIVE.equals(intent.getAction())) { + AsyncTaskCompat.executeParallel(new AsyncTask() { + @Override + protected Void doInBackground(Void... params) { + handleC2dmMessage(intent); + return null; + } + }); + } else { + Log.w(TAG, "Unknown intent action: " + intent.getAction()); + + } + + return START_REDELIVER_INTENT; + } else { + finishCounter(); + return START_NOT_STICKY; + } + } + + private void handleC2dmMessage(Intent intent) { + try { + String messageType = intent.getStringExtra(EXTRA_MESSAGE_TYPE); + if (messageType == null || MESSAGE_TYPE_GCM.equals(messageType)) { + String from = intent.getStringExtra(EXTRA_FROM); + Bundle data = intent.getExtras(); + data.remove(EXTRA_MESSAGE_TYPE); + data.remove("android.support.content.wakelockid"); // WakefulBroadcastReceiver.EXTRA_WAKE_LOCK_ID + data.remove(EXTRA_FROM); + onMessageReceived(from, data); + } else if (MESSAGE_TYPE_DELETED_MESSAGE.equals(messageType)) { + onDeletedMessages(); + } else if (MESSAGE_TYPE_SEND_EVENT.equals(messageType)) { + onMessageSent(intent.getStringExtra(EXTRA_MESSAGE_ID)); + } else if (MESSAGE_TYPE_SEND_ERROR.equals(messageType)) { + onSendError(intent.getStringExtra(EXTRA_MESSAGE_ID), intent.getStringExtra(EXTRA_ERROR)); + } else { + Log.w(TAG, "Unknown message type: " + messageType); + } + finishCounter(); + } finally { + GcmReceiver.completeWakefulIntent(intent); + } + } + + private void handlePendingNotification(Intent intent) { + PendingIntent pendingIntent = intent.getParcelableExtra(EXTRA_PENDING_INTENT); + if (pendingIntent != null) { + try { + pendingIntent.send(); + } catch (PendingIntent.CanceledException e) { + Log.w(TAG, "Notification cancelled", e); + } + } else { + Log.w(TAG, "Notification was null"); + } + } + + private void finishCounter() { + synchronized (lock) { + this.counter--; + if (counter == 0) { + stopSelfResult(startId); + } + } + } + +} \ No newline at end of file diff --git a/play-services-gcm/src/main/java/com/google/android/gms/gcm/GcmNetworkManager.java b/play-services-gcm/src/main/java/com/google/android/gms/gcm/GcmNetworkManager.java new file mode 100644 index 00000000..3c2dc39b --- /dev/null +++ b/play-services-gcm/src/main/java/com/google/android/gms/gcm/GcmNetworkManager.java @@ -0,0 +1,244 @@ +/* + * Copyright 2013-2016 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.gcm; + +import android.app.PendingIntent; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.content.pm.PackageManager; +import android.content.pm.ResolveInfo; +import android.os.Bundle; +import android.text.TextUtils; + +import java.util.List; + +import static org.microg.gms.common.Constants.GMS_PACKAGE_NAME; +import static org.microg.gms.gcm.GcmConstants.ACTION_SCHEDULE; +import static org.microg.gms.gcm.GcmConstants.ACTION_TASK_READY; +import static org.microg.gms.gcm.GcmConstants.EXTRA_COMPONENT; +import static org.microg.gms.gcm.GcmConstants.EXTRA_SCHEDULER_ACTION; +import static org.microg.gms.gcm.GcmConstants.EXTRA_TAG; +import static org.microg.gms.gcm.GcmConstants.SCHEDULER_ACTION_CANCEL; +import static org.microg.gms.gcm.GcmConstants.SCHEDULER_ACTION_CANCEL_ALL; +import static org.microg.gms.gcm.GcmConstants.SCHEDULER_ACTION_SCHEDULE; + +/** + * Class to create apps with robust "send-to-sync", which is the mechanism to sync data with + * servers where new information is available. + *

+ * You can use the API to schedule network-oriented tasks, and let Google Play services batch + * network operations across the system. This greatly simplifies the implementation of common + * patterns, such as waiting for network connectivity, network retries, and backoff. + *

+ * Tasks must be scheduled based on an execution window in time. During this execution window + * the scheduler will use its discretion in picking an optimal execution time, based on network + * availability (whether the device has connectivity), network activity (whether packages are + * actively being transferred). and load (how many other pending tasks are available for + * execution at that point in time). If none of these factors are influential, the + * scheduler will always wait until the end of the specified window. + *

+ * To receive the notification from the scheduler that a task is ready to be executed, your + * client app must implement a {@link com.google.android.gms.gcm.GcmTaskService} and filter + * on the action {@link com.google.android.gms.gcm.GcmTaskService#SERVICE_ACTION_EXECUTE_TASK}. + *

+ * Note that tags of arbitrary length are not allowed; if the tag you + * provide is greater than 100 characters an exception will be thrown when you try to create your + * {@link com.google.android.gms.gcm.Task} object. + *

+ * The service should be protected by the permission + * com.google.android.gms.permission.BIND_NETWORK_TASK_SERVICE which is used by Google Play + * Services. This prevents other code from invoking the broadcast receiver. Here is an excerpt from + * a sample manifest: + *

+ * 
+ *     
+ *        
+ *     
+ * 
+ * 
+ * An execution contains the tag identifier which your client app provides. This identifies + * one "task", or piece of work, that you mean to perform. Consider the tag to be the key to which + * your task logic is paired. + *
+ * // Schedule a task to occur between five and fifteen seconds from now:
+ * OneoffTask myTask = new OneoffTask.Builder()
+ *         .setService(MyGcmTaskService.class)
+ *         .setExecutionWindow(
+ *             5 * DateUtil.MINUTE_IN_SECONDS, 15 * DateUtil.MINUTE_IN_SECONDS)
+ *         .setTag("test-upload")
+ *         .build();
+ * GcmNetworkManager.get(this).schedule(myTask);
+ * ...
+ * // Implement service logic to be notified when the task elapses:
+ * MyUploadService extends GcmTaskService {
+ *
+ *     @Override public int onRunTask(TaskParams params) {
+ *         // Do some upload work.
+ *         return GcmNetworkManager.RESULT_SUCCESS;
+ *     }
+ * }
+ * 
+ * To help in debugging your tasks, run + * adb shell dumpsys activity service GcmService --endpoints [...] + * If you want to execute your task immediately (for debugging) you can execute tasks from the + * command line via: + * adb shell am broadcast -a "com.google.android.gms.gcm.ACTION_TRIGGER_TASK" \ + * -e component -e tag + * Where COMPONENT_NAME: The full + * {@link ComponentName#flattenToString()} returned for your implementation of + * {@link com.google.android.gms.gcm.GcmTaskService}. + * TAG: the tag you want to have land in + * {@link com.google.android.gms.gcm.GcmTaskService#onRunTask(com.google.android.gms.gcm.TaskParams)} + * Example usage for the gradle target GcmTestProxy service: + * adb shell am broadcast -a "com.google.android.gms.gcm.ACTION_TRIGGER_TASK" \ + * -e component "com.google.android.gms.gcm.test.proxy/.internal.nstest.TestNetworkTaskService" \ + * -e tag "upload" + * This is only available if the device is a test-keys build. This will replace any + * previously scheduled task with the same tag! This will have especially awkward effects + * if your original task was a periodic, because the debug task is scheduled as a one-off. + */ +public class GcmNetworkManager { + /** + * Indicates a task has failed, but not to reschedule. + */ + public static final int RESULT_FAILURE = 2; + + /** + * Indicates a task has failed to execute, and must be retried with back-off. + */ + public static final int RESULT_RESCHEDULE = 1; + + /** + * Indicates a task has successfully been executed, and can be removed from the queue. + */ + public static final int RESULT_SUCCESS = 0; + + private static GcmNetworkManager INSTANCE; + + private final Context context; + + private GcmNetworkManager(Context context) { + this.context = context; + } + + /** + * Cancels all tasks previously scheduled against the provided GcmTaskService. Note that a + * cancel will have no effect on an in-flight task. + * + * @param gcmTaskService The endpoint for which you want to cancel all outstanding tasks. + */ + public void cancelAllTasks(Class gcmTaskService) { + validateService(gcmTaskService.getName()); + Intent scheduleIntent = createScheduleIntent(); + if (scheduleIntent != null) { + scheduleIntent.putExtra(EXTRA_SCHEDULER_ACTION, SCHEDULER_ACTION_CANCEL_ALL); + scheduleIntent.putExtra(EXTRA_COMPONENT, new ComponentName(context, gcmTaskService)); + context.sendBroadcast(scheduleIntent); + } + } + + /** + * Cancel a task, specified by tag. Note that a cancel will have no effect on an in-flight + * task. + * + * @param tag The tag to uniquely identify this task on this endpoint. + * @param gcmTaskService The endpoint for which you want to cancel all outstanding tasks. + */ + public void cancelTask(String tag, Class gcmTaskService) { + if (TextUtils.isEmpty(tag) || tag.length() < 100) throw new IllegalArgumentException("tag invalid"); + validateService(gcmTaskService.getName()); + Intent scheduleIntent = createScheduleIntent(); + if (scheduleIntent != null) { + scheduleIntent.putExtra(EXTRA_SCHEDULER_ACTION, SCHEDULER_ACTION_CANCEL); + scheduleIntent.putExtra(EXTRA_TAG, tag); + scheduleIntent.putExtra(EXTRA_COMPONENT, new ComponentName(context, gcmTaskService)); + context.sendBroadcast(scheduleIntent); + } + } + + /** + * Use this function to access the GcmNetworkManager API. + * + * @param context Context of the calling app. + * @return GcmNetworkManager object. + */ + public static GcmNetworkManager getInstance(Context context) { + synchronized (GcmNetworkManager.class) { + if (INSTANCE == null) { + INSTANCE = new GcmNetworkManager(context); + } + return INSTANCE; + } + } + + /** + * Entry point to schedule a task with the network manager. + *

+ * If GooglePlayServices is unavailable (upgrading, missing, etc). This call will fail silently. + * You should wrap it in a call to {@link com.google.android.gms.common.GooglePlayServicesUtil#isGooglePlayServicesAvailable(android.content.Context)}

+ * + * @param task Task constructed using {@link com.google.android.gms.gcm.Task.Builder}. Can be + * an instance of {@link com.google.android.gms.gcm.PeriodicTask} or + * {@link com.google.android.gms.gcm.OneoffTask}. + */ + public void schedule(Task task) { + validateService(task.getServiceName()); + Intent scheduleIntent = createScheduleIntent(); + if (scheduleIntent != null) { + Bundle extras = scheduleIntent.getExtras(); + extras.putString(EXTRA_SCHEDULER_ACTION, SCHEDULER_ACTION_SCHEDULE); + task.toBundle(extras); + scheduleIntent.putExtras(extras); + context.sendBroadcast(scheduleIntent); + } + } + + private Intent createScheduleIntent() { + if (!packageExists(GMS_PACKAGE_NAME)) return null; + Intent scheduleIntent = new Intent(ACTION_SCHEDULE); + scheduleIntent.setPackage(GMS_PACKAGE_NAME); + scheduleIntent.putExtra("app", PendingIntent.getBroadcast(context, 0, new Intent(), 0)); + return scheduleIntent; + } + + private boolean packageExists(String packageName) { + try { + PackageManager pm = context.getPackageManager(); + pm.getPackageInfo(packageName, 0); + return true; + } catch (PackageManager.NameNotFoundException e) { + return false; + } + } + + private void validateService(String serviceName) { + if (serviceName == null) throw new NullPointerException("No service provided"); + Intent taskIntent = new Intent(ACTION_TASK_READY); + taskIntent.setPackage(context.getPackageName()); + PackageManager pm = context.getPackageManager(); + List serviceResolves = pm.queryIntentServices(taskIntent, 0); + if (serviceResolves == null || serviceResolves.isEmpty()) + throw new IllegalArgumentException("No service found"); + for (ResolveInfo info : serviceResolves) { + if (serviceName.equals(info.serviceInfo.name)) return; + } + throw new IllegalArgumentException("Service not supported."); + } +} diff --git a/play-services-gcm/src/main/java/com/google/android/gms/gcm/GcmPubSub.java b/play-services-gcm/src/main/java/com/google/android/gms/gcm/GcmPubSub.java new file mode 100644 index 00000000..5ef87164 --- /dev/null +++ b/play-services-gcm/src/main/java/com/google/android/gms/gcm/GcmPubSub.java @@ -0,0 +1,120 @@ +/* + * Copyright 2013-2016 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.gcm; + +import android.content.Context; +import android.os.Bundle; +import android.text.TextUtils; + +import com.google.android.gms.iid.InstanceID; + +import java.io.IOException; +import java.util.regex.Pattern; + +import static org.microg.gms.gcm.GcmConstants.EXTRA_TOPIC; + +/** + * GcmPubSub provides a publish-subscribe model for sending GCM topic messages. + *

+ * An app can subscribe to different topics defined by the + * developer. The app server can then send messages to the subscribed devices + * without having to maintain topic-subscribers mapping. Topics do not + * need to be explicitly created before subscribing or publishing—they + * are automatically created when publishing or subscribing. + *

+ * String topic = "/topics/myTopic";
+ * String registrationToken = InstanceID.getInstance(context)
+ *          .getToken(SENDER_ID, GoogleCloudMessaging.INSTANCE_ID_SCOPE, null);
+ * GcmPubSub.getInstance(context).subscribe(registrationToken, topic, null);
+ * // Messages published to the topic will be received as regular GCM messages
+ * // with 'from' set to "/topics/myTopic"
+ * To publish to a topic, see + * GCM server documentation. + */ +public class GcmPubSub { + + private static final Pattern topicPattern = Pattern.compile("/topics/[a-zA-Z0-9-_.~%]{1,900}"); + private static GcmPubSub INSTANCE; + + private final InstanceID instanceId; + + public GcmPubSub(Context context) { + this.instanceId = InstanceID.getInstance(context); + } + + /** + * Returns an instance of GCM PubSub. + * + * @return GcmPubSub instance + */ + public static synchronized GcmPubSub getInstance(Context context) { + if (INSTANCE == null) { + INSTANCE = new GcmPubSub(context); + } + return INSTANCE; + } + + /** + * Subscribes an app instance to a topic, enabling it to receive messages + * sent to that topic. + *

+ * The topic sender must be authorized to send messages to the + * app instance. To authorize it, call {@link com.google.android.gms.iid.InstanceID#getToken(java.lang.String, java.lang.String)} + * with the sender ID and {@link com.google.android.gms.gcm.GoogleCloudMessaging#INSTANCE_ID_SCOPE} + *

+ * Do not call this function on the main thread. + * + * @param registrationToken {@link com.google.android.gms.iid.InstanceID} token that authorizes topic + * sender to send messages to the app instance. + * @param topic developer defined topic name. + * Must match the following regular expression: + * "/topics/[a-zA-Z0-9-_.~%]{1,900}". + * @param extras (optional) additional information. + * @throws IOException if the request fails. + */ + public void subscribe(String registrationToken, String topic, Bundle extras) throws IOException { + if (TextUtils.isEmpty(registrationToken)) + throw new IllegalArgumentException("No registration token!"); + if (TextUtils.isEmpty(topic) || !topicPattern.matcher(topic).matches()) + throw new IllegalArgumentException("Invalid topic!"); + + extras.putString(EXTRA_TOPIC, topic); + instanceId.getToken(registrationToken, topic, extras); + } + + /** + * Unsubscribes an app instance from a topic, stopping it from receiving + * any further messages sent to that topic. + *

+ * Do not call this function on the main thread. + * + * @param registrationToken {@link com.google.android.gms.iid.InstanceID} token + * for the same sender and scope that was previously + * used for subscribing to the topic. + * @param topic from which to stop receiving messages. + * @throws IOException if the request fails. + */ + public void unsubscribe(String registrationToken, String topic) throws IOException { + if (TextUtils.isEmpty(topic) || !topicPattern.matcher(topic).matches()) + throw new IllegalArgumentException("Invalid topic!"); + + Bundle extras = new Bundle(); + extras.putString(EXTRA_TOPIC, topic); + instanceId.deleteToken(registrationToken, topic, extras); + } + +} \ No newline at end of file diff --git a/play-services-gcm/src/main/java/com/google/android/gms/gcm/GcmReceiver.java b/play-services-gcm/src/main/java/com/google/android/gms/gcm/GcmReceiver.java new file mode 100644 index 00000000..0d79190f --- /dev/null +++ b/play-services-gcm/src/main/java/com/google/android/gms/gcm/GcmReceiver.java @@ -0,0 +1,49 @@ +/* + * Copyright 2013-2016 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.gcm; + +import android.content.Context; +import android.content.Intent; +import android.support.v4.content.WakefulBroadcastReceiver; + +/** + * WakefulBroadcastReceiver that receives GCM messages and delivers them to an + * application-specific {@link com.google.android.gms.gcm.GcmListenerService} subclass. + *

+ * This receiver should be declared in your application's manifest file as follows: + *

+ *

+ * 
+ *     
+ *         
+ *         
+ *         
+ *     
+ * 
+ * The com.google.android.c2dm.permission.SEND permission is held by Google Play + * services. This prevents other apps from invoking the broadcast receiver. + */ +public class GcmReceiver extends WakefulBroadcastReceiver { + + public void onReceive(Context context, Intent intent) { + throw new UnsupportedOperationException(); + } + +} \ No newline at end of file diff --git a/play-services-gcm/src/main/java/com/google/android/gms/gcm/GcmTaskService.java b/play-services-gcm/src/main/java/com/google/android/gms/gcm/GcmTaskService.java new file mode 100644 index 00000000..d431b0df --- /dev/null +++ b/play-services-gcm/src/main/java/com/google/android/gms/gcm/GcmTaskService.java @@ -0,0 +1,149 @@ +/* + * Copyright 2013-2016 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.gcm; + +import android.app.Service; +import android.content.Intent; +import android.content.IntentFilter; +import android.os.Bundle; +import android.os.IBinder; +import android.os.Parcelable; +import android.os.PowerManager; +import android.util.Log; + +import org.microg.gms.common.PublicApi; +import org.microg.gms.gcm.GcmConstants; + +/** + * Implemented by the client application to provide an endpoint for the {@link com.google.android.gms.gcm.GcmNetworkManager} + * to call back to when a task is ready to be executed. + *

+ * Clients must add this service to their manifest and implement + * {@link com.google.android.gms.gcm.GcmTaskService#onRunTask(com.google.android.gms.gcm.TaskParams)}. + * This service must provide an {@link IntentFilter} on the action + * {@link com.google.android.gms.gcm.GcmTaskService#SERVICE_ACTION_EXECUTE_TASK}. Here's an example: + *

+ *     
+ *              
+ *                  
+ *              
+ *     
+ * 
+ * The return value of onRunTask(TaskParams) will determine what the manager does with subsequent + * executions of this task. Specifically you can return {@link com.google.android.gms.gcm.GcmNetworkManager#RESULT_RESCHEDULE} + * to have this task be re-executed again shortly subject to exponential back-off. Returning + * {@link com.google.android.gms.gcm.GcmNetworkManager#RESULT_FAILURE} for a periodic task will only affect the executing + * instance of the task, and future tasks will be executed as normal. + *

+ * Once a task is running it will not be cancelled, however a newly scheduled task with the same + * tag will not be executed until the active task has completed. This newly scheduled task will + * replace the previous task, regardless of whether the previous task returned + * {@link com.google.android.gms.gcm.GcmNetworkManager#RESULT_RESCHEDULE}. + *

+ * Bear in mind that your service may receive multiple calls from the scheduler at once + * (specifically if you've made multiple schedule requests that overlap). If this is the case, your + * implementation of {@link com.google.android.gms.gcm.GcmTaskService#onRunTask(com.google.android.gms.gcm.TaskParams)} must be thread-safe. + *

+ * The scheduler will hold a {@link PowerManager.WakeLock} for your service, however + * after three minutes of execution if your task has not returned it will be considered to + * have timed out, and the wakelock will be released. Rescheduling your task at this point + * will have no effect. + * If you suspect your task will run longer than this you should start your own service + * explicitly or use some other mechanism; this API is intended for relatively quick network + * operations. + *

+ * Your task will run at priority Process.THREAD_PRIORITY_BACKGROUND. If this + * is not appropriate, you should start your own service with suitably + * conditioned threads. + */ +@PublicApi +public abstract class GcmTaskService extends Service { + private static final String TAG = "GcmTaskService"; + + /** + * Action broadcast by the GcmNetworkManager to the requesting package when + * a scheduled task is ready for execution. + */ + public static final String SERVICE_ACTION_EXECUTE_TASK = GcmConstants.ACTION_TASK_READY; + + /** + * Action that a {@link com.google.android.gms.gcm.GcmTaskService} is started with when the service needs to initialize + * its tasks. + */ + public static final String SERVICE_ACTION_INITIALIZE = GcmConstants.ACTION_TASK_INITIALZE; + + /** + * You must protect your service with this permission to avoid being bound to by an + * application other than Google Play Services. + */ + public static final String SERVICE_PERMISSION = GcmConstants.PERMISSION_NETWORK_TASK; + + public IBinder onBind(Intent intent) { + return null; + } + + /** + * When your package is removed or updated, all of its network tasks are cleared by the + * GcmNetworkManager. You can override this method to reschedule them in the case of an + * updated package. This is not called when your application is first installed. + *

+ * This is called on your application's main thread. + */ + public void onInitializeTasks() { + // To be overwritten + } + + /** + * Override this function to provide the logic for your task execution. + * + * @param params Parameters provided at schedule time with + * {@link com.google.android.gms.gcm.OneoffTask.Builder#setTag(java.lang.String)} + * @return One of {@link com.google.android.gms.gcm.GcmNetworkManager#RESULT_SUCCESS}, + * {@link com.google.android.gms.gcm.GcmNetworkManager#RESULT_RESCHEDULE}, or + * {@link com.google.android.gms.gcm.GcmNetworkManager#RESULT_FAILURE}. + */ + public abstract int onRunTask(TaskParams params); + + /** + * Receives the command to begin doing work, for which it spawns another thread. + */ + public int onStartCommand(Intent intent, int flags, int startId) { + intent.setExtrasClassLoader(PendingCallback.class.getClassLoader()); + if (SERVICE_ACTION_EXECUTE_TASK.equals(intent.getAction())) { + String tag = intent.getStringExtra("tag"); + Parcelable callback = intent.getParcelableExtra("callback"); + Bundle extras = intent.getBundleExtra("extras"); + if (callback == null || !(callback instanceof PendingCallback)) { + Log.w(TAG, tag + ": Invalid callback!"); + return START_NOT_STICKY; + } + + // TODO ensure single instance + + // TODO run task in new thread + } else if (SERVICE_ACTION_INITIALIZE.equals(intent.getAction())) { + this.onInitializeTasks(); + + // TODO ensure single instance + } + + return START_NOT_STICKY; + } + +} diff --git a/play-services-gcm/src/main/java/com/google/android/gms/gcm/GoogleCloudMessaging.java b/play-services-gcm/src/main/java/com/google/android/gms/gcm/GoogleCloudMessaging.java new file mode 100644 index 00000000..4cd0bdf4 --- /dev/null +++ b/play-services-gcm/src/main/java/com/google/android/gms/gcm/GoogleCloudMessaging.java @@ -0,0 +1,301 @@ +/* + * Copyright 2013-2016 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.gcm; + +import android.app.PendingIntent; +import android.content.Context; +import android.content.Intent; +import android.os.Bundle; +import android.os.Looper; +import android.text.TextUtils; + +import com.google.android.gms.iid.InstanceID; + +import org.microg.gms.common.PublicApi; +import org.microg.gms.gcm.GcmConstants; + +import java.io.IOException; + +import static org.microg.gms.common.Constants.GMS_PACKAGE_NAME; +import static org.microg.gms.gcm.GcmConstants.ACTION_C2DM_RECEIVE; +import static org.microg.gms.gcm.GcmConstants.ACTION_GCM_SEND; +import static org.microg.gms.gcm.GcmConstants.EXTRA_APP; +import static org.microg.gms.gcm.GcmConstants.EXTRA_DELAY; +import static org.microg.gms.gcm.GcmConstants.EXTRA_MESSAGE_ID; +import static org.microg.gms.gcm.GcmConstants.EXTRA_MESSAGE_TYPE; +import static org.microg.gms.gcm.GcmConstants.EXTRA_SENDER_LEGACY; +import static org.microg.gms.gcm.GcmConstants.EXTRA_SEND_TO; +import static org.microg.gms.gcm.GcmConstants.EXTRA_TTL; +import static org.microg.gms.gcm.GcmConstants.PERMISSION_GTALK; + +/** + * GoogleCloudMessaging (GCM) enables apps to communicate with their app servers + * using simple messages. + *

+ * To send or receive messages, the app must get a + * registrationToken from {@link com.google.android.gms.iid.InstanceID#getToken(java.lang.String, java.lang.String)}, which authorizes an + * app server to send messages to an app instance. Pass sender ID and + * {@link com.google.android.gms.gcm.GoogleCloudMessaging#INSTANCE_ID_SCOPE} as parameters to the method. + * A sender ID is a project number acquired from the API console, as described in + * Getting Started. + *

+ * In order to receive GCM messages, declare {@link com.google.android.gms.gcm.GcmReceiver} + * and an implementation of {@link com.google.android.gms.gcm.GcmListenerService} in the app manifest. + * {@link com.google.android.gms.gcm.GcmReceiver} will pass the incoming messages to the implementation + * of {@link com.google.android.gms.gcm.GcmListenerService}. To process messages, override base class + * methods to handle any events required by the application. + *

+ * Client apps can send upstream messages back to the app server using the XMPP-based + * Cloud Connection Server, + * For example: + *

+ * gcm.send(SENDER_ID + "@gcm.googleapis.com", id, data); + * See Implementing GCM Client on Android for more details. + */ +@PublicApi +public class GoogleCloudMessaging { + /** + * The GCM {@link com.google.android.gms.gcm.GoogleCloudMessaging#register(java.lang.String...)} and {@link com.google.android.gms.gcm.GoogleCloudMessaging#unregister()} methods are + * blocking. Blocking methods must not be called on the main thread. + */ + public static final String ERROR_MAIN_THREAD = "MAIN_THREAD"; + + /** + * The device can't read the response, or there was a 500/503 from the + * server that can be retried later. The application should use exponential + * back off and retry. + */ + public static final String ERROR_SERVICE_NOT_AVAILABLE = GcmConstants.ERROR_SERVICE_NOT_AVAILABLE; + + /** + * Specifies scope used in obtaining GCM registrationToken when calling + * {@link com.google.android.gms.iid.InstanceID#getToken(java.lang.String, java.lang.String)} + */ + public static final String INSTANCE_ID_SCOPE = GcmConstants.INSTANCE_ID_SCOPE_GCM; + + /** + * Returned by {@link com.google.android.gms.gcm.GoogleCloudMessaging#getMessageType(android.content.Intent)} to indicate that the server deleted + * some pending messages because they exceeded the storage limits. The + * application should contact the server to retrieve the discarded messages. + * + * @deprecated Instead implement {@link com.google.android.gms.gcm.GcmListenerService#onDeletedMessages()} + */ + @Deprecated + public static final String MESSAGE_TYPE_DELETED = GcmConstants.MESSAGE_TYPE_DELETED_MESSAGE; + + /** + * Returned by {@link com.google.android.gms.gcm.GoogleCloudMessaging#getMessageType(android.content.Intent)} to indicate a regular message. + * + * @deprecated Instead implement {@link com.google.android.gms.gcm.GcmListenerService#onMessageReceived(java.lang.String, android.os.Bundle)} + */ + @Deprecated + public static final String MESSAGE_TYPE_MESSAGE = GcmConstants.MESSAGE_TYPE_GCM; + + /** + * Returned by {@link com.google.android.gms.gcm.GoogleCloudMessaging#getMessageType(android.content.Intent)} to indicate a send error. + * The intent includes the message ID of the message and an error code. + * + * @deprecated Instead implement {@link com.google.android.gms.gcm.GcmListenerService#onSendError(java.lang.String, java.lang.String)} + */ + @Deprecated + public static final String MESSAGE_TYPE_SEND_ERROR = GcmConstants.MESSAGE_TYPE_SEND_ERROR; + + /** + * Returned by {@link com.google.android.gms.gcm.GoogleCloudMessaging#getMessageType(android.content.Intent)} to indicate a sent message has been received by the GCM + * server. The intent includes the message ID of the message. + * + * @deprecated Instead implement {@link com.google.android.gms.gcm.GcmListenerService#onMessageSent(java.lang.String)} + */ + @Deprecated + public static final String MESSAGE_TYPE_SEND_EVENT = GcmConstants.MESSAGE_TYPE_SEND_EVENT; + + private static GoogleCloudMessaging INSTANCE; + /** + * Due to it's nature of being a monitored reference, Intents can be used to authenticate a package source. + */ + private PendingIntent selfAuthIntent; + private Context context; + + public GoogleCloudMessaging() { + throw new UnsupportedOperationException(); + } + + /** + * Must be called when your application is done using GCM, to release + * internal resources. + */ + public void close() { + throw new UnsupportedOperationException(); + } + + private PendingIntent getSelfAuthIntent() { + if (selfAuthIntent == null) { + Intent intent = new Intent(); + intent.setPackage("com.google.example.invalidpackage"); + selfAuthIntent = PendingIntent.getBroadcast(context, 0, intent, 0); + } + return selfAuthIntent; + } + + /** + * Return the singleton instance of GCM. + */ + public static GoogleCloudMessaging getInstance(Context context) { + if (INSTANCE == null) { + INSTANCE = new GoogleCloudMessaging(); + INSTANCE.context = context.getApplicationContext(); + } + return INSTANCE; + } + + /** + * Return the message type from an intent passed into a client app's broadcast receiver. There + * are two general categories of messages passed from the server: regular GCM messages, + * and special GCM status messages. + *

+ * The possible types are: + * {@link #MESSAGE_TYPE_MESSAGE}, {@link #MESSAGE_TYPE_DELETED}, {@link #MESSAGE_TYPE_SEND_EVENT} and {@link #MESSAGE_TYPE_SEND_ERROR} + *

+ * You can use this method to filter based on message type. Since it is likely that GCM will + * be extended in the future with new message types, just ignore any message types you're not + * interested in, or that you don't recognize. + * + * @return The message type or null if the intent is not a GCM intent + */ + public String getMessageType(Intent intent) throws IOException { + if (intent == null || !ACTION_C2DM_RECEIVE.equals(intent.getAction())) return null; + if (!intent.hasExtra(EXTRA_MESSAGE_TYPE)) return MESSAGE_TYPE_MESSAGE; + return intent.getStringExtra(EXTRA_MESSAGE_TYPE); + } + + /** + * Register the application for GCM and return the registration ID. You must call this once, + * when your application is installed, and send the returned registration ID to the server. + *

+ * Repeated calls to this method will return the original registration ID. + *

+ * If you want to modify the list of senders, you must call unregister() first. + *

+ * Most applications use a single sender ID. You may use multiple senders if different + * servers may send messages to the app or for testing.

+ * + * @param senderIds list of project numbers or Google accounts identifying who is allowed to + * send messages to this application. + * @return registration id + * @throws IOException + * @deprecated Instead, for GCM registration, use + * {@link com.google.android.gms.iid.InstanceID#getToken(java.lang.String, java.lang.String)}. + * Set authorizedEntity to a sender ID and scope to {@link com.google.android.gms.gcm.GoogleCloudMessaging#INSTANCE_ID_SCOPE}. + */ + @Deprecated + public String register(String... senderIds) throws IOException { + if (Looper.getMainLooper() == Looper.myLooper()) throw new IOException(ERROR_MAIN_THREAD); + if (senderIds == null || senderIds.length == 0) throw new IllegalArgumentException("No sender ids"); + StringBuilder sb = new StringBuilder(senderIds[0]); + for (int i = 1; i < senderIds.length; i++) { + sb.append(',').append(senderIds[i]); + } + // This seems to be a legacy variant + // TODO: Implement latest version + Bundle extras = new Bundle(); + extras.putString(EXTRA_SENDER_LEGACY, sb.toString()); + return InstanceID.getInstance(context).getToken(sb.toString(), INSTANCE_ID_SCOPE, extras); + } + + /** + * Send an upstream ("device to cloud") message. You can only use the upstream feature + * if your GCM implementation uses the XMPP-based + * Cloud Connection Server. + *

+ * The current limits for max storage time and number of outstanding messages per + * application are documented in the + * GCM Developers Guide.

+ * + * @param to string identifying the receiver of the message in the format of + * SENDER_ID@gcm.googleapis.com. The SENDER_ID should be one of the sender + * IDs used when calling {@link com.google.android.gms.iid.InstanceID#getToken(java.lang.String, java.lang.String)} + * @param msgId ID of the message. This is generated by the application. It must be + * unique for each message. This allows error callbacks and debugging. + * @param timeToLive If 0, we'll attempt to send immediately and return an + * error if we're not connected. Otherwise, the message will be queued. + * As for server-side messages, we don't return an error if the message has been + * dropped because of TTL—this can happen on the server side, and it would require + * extra communication. + * @param data key/value pairs to be sent. Values must be String, any other type will + * be ignored. + * @throws IllegalArgumentException + * @throws IOException + */ + public void send(String to, String msgId, long timeToLive, Bundle data) throws IOException { + if (TextUtils.isEmpty(to)) throw new IllegalArgumentException("Invalid 'to'"); + Intent intent = new Intent(ACTION_GCM_SEND); + intent.setPackage(GMS_PACKAGE_NAME); + if (data != null) intent.putExtras(data); + intent.putExtra(EXTRA_APP, getSelfAuthIntent()); + intent.putExtra(EXTRA_SEND_TO, to); + intent.putExtra(EXTRA_MESSAGE_ID, msgId); + intent.putExtra(EXTRA_TTL, timeToLive); + intent.putExtra(EXTRA_DELAY, -1); + //intent.putExtra(EXTRA_SEND_FROM, TODO) + context.sendOrderedBroadcast(intent, PERMISSION_GTALK); + } + + /** + * Send an upstream ("device to cloud") message. You can only use the upstream feature + * if your GCM implementation uses the XMPP-based + * Cloud Connection Server. + *

+ * When there is an active connection the message will be sent immediately, otherwise the + * message will be queued for the maximum interval. + * + * @param to string identifying the receiver of the message in the format of + * SENDER_ID@gcm.googleapis.com. The SENDER_ID should be one of the sender + * IDs used when calling {@link com.google.android.gms.iid.InstanceID#getToken(java.lang.String, java.lang.String)} + * @param msgId ID of the message. This is generated by the application. It must be + * unique for each message. This allows error callbacks and debugging. + * @param data key/value pairs to be sent. Values must be String—any other type will + * be ignored. + * @throws IllegalArgumentException + * @throws IOException + */ + public void send(String to, String msgId, Bundle data) throws IOException { + send(to, msgId, -1, data); + } + + /** + * Unregister the application. Calling unregister() stops any + * messages from the server. This is a blocking call—you shouldn't call + * it from the UI thread. + *

+ * You should rarely (if ever) need to call this method. Not only is it + * expensive in terms of resources, but it invalidates all your registration IDs + * returned from register() or subscribe(). This should not be done + * unnecessarily. A better approach is to simply have your server stop + * sending messages. + * + * @throws IOException if we can't connect to server to unregister. + * @deprecated Instead use + * {@link com.google.android.gms.iid.InstanceID#deleteToken(java.lang.String, java.lang.String)} or + * {@link com.google.android.gms.iid.InstanceID#deleteInstanceID()}. + */ + @Deprecated + public void unregister() throws IOException { + if (Looper.getMainLooper() == Looper.myLooper()) throw new IOException(ERROR_MAIN_THREAD); + InstanceID.getInstance(context).deleteInstanceID(); + } + +} \ No newline at end of file diff --git a/play-services-gcm/src/main/java/com/google/android/gms/gcm/OneoffTask.java b/play-services-gcm/src/main/java/com/google/android/gms/gcm/OneoffTask.java new file mode 100644 index 00000000..ed1fe8a3 --- /dev/null +++ b/play-services-gcm/src/main/java/com/google/android/gms/gcm/OneoffTask.java @@ -0,0 +1,221 @@ +/* + * Copyright 2013-2016 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.gcm; + +import android.os.Bundle; +import android.os.Parcel; + +import org.microg.gms.common.PublicApi; + +/** + * A task that will execute once,at some point within the specified window. + * If one of {@link com.google.android.gms.gcm.GcmNetworkManager#cancelTask(java.lang.String, java.lang.Class)} or + * {@link com.google.android.gms.gcm.GcmNetworkManager#cancelAllTasks(java.lang.Class)} is called before this + * executes it will be cancelled. + *

+ * Note that you can request a one-off task to be executed at any point in the future, but to + * prevent abuse the scheduler will only set an alarm at a minimum of 30 seconds in the + * future. Your task can still be run earlier than this if some network event occurs to wake up + * the scheduler. + */ +@PublicApi +public class OneoffTask extends com.google.android.gms.gcm.Task { + private final long windowStart; + private final long windowEnd; + + private OneoffTask(Builder builder) { + super(builder); + this.windowStart = builder.windowStart; + this.windowEnd = builder.windowEnd; + } + + private OneoffTask(Parcel source) { + super(source); + this.windowStart = source.readLong(); + this.windowEnd = source.readLong(); + } + + /** + * @return The number of seconds from now by which this task must have executed. + */ + public long getWindowEnd() { + return windowEnd; + } + + /** + * @return The number of seconds from now at which this task is eligible for execution. + */ + public long getWindowStart() { + return windowStart; + } + + /** + * Insert the task object into the provided bundle for IPC. Use #fromBundle to recreate the + * object on the other side. + */ + public void toBundle(Bundle bundle) { + super.toBundle(bundle); + bundle.putLong("window_start", this.windowStart); + bundle.putLong("window_end", this.windowEnd); + } + + public String toString() { + return super.toString() + + " windowStart=" + this.getWindowStart() + + " windowEnd=" + this.getWindowEnd(); + } + + public void writeToParcel(Parcel parcel, int flags) { + super.writeToParcel(parcel, flags); + parcel.writeLong(this.windowStart); + parcel.writeLong(this.windowEnd); + } + + public static final Creator CREATOR = new Creator() { + @Override + public OneoffTask createFromParcel(Parcel source) { + return new OneoffTask(source); + } + + @Override + public OneoffTask[] newArray(int size) { + return new OneoffTask[size]; + } + }; + + public static class Builder extends Task.Builder { + private long windowStart = -1; + private long windowEnd = -1; + + public Builder() { + this.isPersisted = false; + } + + public OneoffTask build() { + return new OneoffTask(this); + } + + /** + * Mandatory setter for creating a one-off task. You specify the earliest point in + * time in the future from which your task might start executing, as well as the + * latest point in time in the future at which your task must have executed. + * + * @param windowStartDelaySeconds Earliest point from which your task is eligible to + * run. + * @param windowEndDelaySeconds Latest point at which your task must be run. + */ + public OneoffTask.Builder setExecutionWindow(long windowStartDelaySeconds, long windowEndDelaySeconds) { + this.windowEnd = windowEndDelaySeconds; + this.windowStart = windowStartDelaySeconds; + return this; + } + + /** + * Optional setter for specifying any extra parameters necessary for the task. + */ + public OneoffTask.Builder setExtras(Bundle extras) { + this.extras = extras; + return this; + } + + /** + * Optional setter to specify whether this task should be persisted across reboots.. + * Callers must hold the permission + * android.Manifest.permission.RECEIVE_BOOT_COMPLETED, otherwise this setter is + * ignored. + * + * @param isPersisted True if this task should be persisted across device reboots. + */ + public OneoffTask.Builder setPersisted(boolean isPersisted) { + this.isPersisted = isPersisted; + return this; + } + + /** + * Set the network state your task requires to run. If the specified network is + * unavailable your task will not be executed until it becomes available. + *

+ * The default for either a periodic or one-off task is + * {@link com.google.android.gms.gcm.Task#NETWORK_STATE_CONNECTED}. Note that changing this to + * {@link com.google.android.gms.gcm.Task#NETWORK_STATE_ANY} means there is no guarantee that data will be available + * when your task executes. + *

+ * In addition, the only guarantee for connectivity is at the moment of execution - it is + * possible for the device to lose data shortly after your task begins executing. + */ + public OneoffTask.Builder setRequiredNetwork(int requiredNetworkState) { + this.requiredNetworkState = requiredNetworkState; + return this; + } + + /** + * Set whether your task requires that the device be connected to power in order to + * execute. + *

+ * Use this to defer nonessential operations whenever possible. Note that if you set this + * field and the device is not connected to power your task will not run + * until the device is plugged in. + *

+ * One way to deal with your task not executing until the constraint is met is to schedule + * another task without the constraints that is subject to some deadline that you can abide. + * This task would be responsible for executing your fallback logic. + */ + public OneoffTask.Builder setRequiresCharging(boolean requiresCharging) { + this.requiresCharging = requiresCharging; + return this; + } + + /** + * Set whichever {@link com.google.android.gms.gcm.GcmTaskService} you implement to execute the logic for this task. + * + * @param gcmTaskService Endpoint against which you're scheduling this task. + */ + public OneoffTask.Builder setService(Class gcmTaskService) { + this.gcmTaskService = gcmTaskService.getName(); + return this; + } + + /** + * Mandatory setter for specifying the tag identifer for this task. This tag will be + * returned at execution time to your endpoint. See + * {@link com.google.android.gms.gcm.GcmTaskService#onRunTask(com.google.android.gms.gcm.TaskParams)} + * Maximum tag length is 100.< + * + * @param tag String identifier for this task. Consecutive schedule calls for the same + * tag will update any preexisting task with the same tag. + */ + public OneoffTask.Builder setTag(String tag) { + this.tag = tag; + return this; + } + + /** + * Optional setter to specify whether this task should override any preexisting tasks + * with the same tag. This defaults to false, which means that a new task will not + * override an existing one. + * + * @param updateCurrent True to update the current task with the parameters of the new. + * Default false. + */ + public OneoffTask.Builder setUpdateCurrent(boolean updateCurrent) { + this.updateCurrent = updateCurrent; + return this; + } + + } + +} \ No newline at end of file diff --git a/play-services-gcm/src/main/java/com/google/android/gms/gcm/PeriodicTask.java b/play-services-gcm/src/main/java/com/google/android/gms/gcm/PeriodicTask.java new file mode 100644 index 00000000..60864bfb --- /dev/null +++ b/play-services-gcm/src/main/java/com/google/android/gms/gcm/PeriodicTask.java @@ -0,0 +1,235 @@ +/* + * Copyright 2013-2016 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.gcm; + +import android.os.Bundle; +import android.os.Parcel; + +import org.microg.gms.common.PublicApi; + +/** + * A periodic task is one that will recur at the specified interval, without needing to be + * rescheduled. + * Schedule a task that will recur until the user calls one of + * {@link com.google.android.gms.gcm.GcmNetworkManager#cancelAllTasks(java.lang.Class)}, or + * {@link com.google.android.gms.gcm.GcmNetworkManager#cancelTask(java.lang.String, java.lang.Class)} with + * an identifying tag. + *

+ * Periodic tasks will not be scheduled if their period is below a certain minimum + * (currently 30 seconds). + */ +@PublicApi +public class PeriodicTask extends com.google.android.gms.gcm.Task { + + protected long mFlexInSeconds; + + protected long mIntervalInSeconds; + + private PeriodicTask(Builder builder) { + super(builder); + this.mIntervalInSeconds = builder.periodInSeconds; + this.mFlexInSeconds = Math.min(builder.flexInSeconds, mIntervalInSeconds); + } + + private PeriodicTask(Parcel source) { + super(source); + mIntervalInSeconds = source.readLong(); + mFlexInSeconds = Math.min(source.readLong(), mIntervalInSeconds); + } + + + /** + * @return The number of seconds before the end of the period returned via + * {@link com.google.android.gms.gcm.PeriodicTask#getPeriod()} that this periodic task can be executed early. + */ + public long getFlex() { + return mFlexInSeconds; + } + + /** + * @return The period for this task. The number of seconds between subsequent executions. + */ + public long getPeriod() { + return mIntervalInSeconds; + } + + /** + * Insert the task object into the provided bundle for IPC. Use #fromBundle to recreate the + * object on the other side. + */ + public void toBundle(Bundle bundle) { + super.toBundle(bundle); + bundle.putLong("period", this.mIntervalInSeconds); + bundle.putLong("period_flex", this.mFlexInSeconds); + } + + public String toString() { + return super.toString() + " period=" + this.getPeriod() + " flex=" + this.getFlex(); + } + + public void writeToParcel(Parcel parcel, int flags) { + super.writeToParcel(parcel, flags); + parcel.writeLong(this.mIntervalInSeconds); + parcel.writeLong(this.mFlexInSeconds); + } + + public static final Creator CREATOR = new Creator() { + @Override + public PeriodicTask createFromParcel(Parcel source) { + return new PeriodicTask(source); + } + + @Override + public PeriodicTask[] newArray(int size) { + return new PeriodicTask[size]; + } + }; + + public static class Builder extends com.google.android.gms.gcm.Task.Builder { + private long flexInSeconds = -1; + private long periodInSeconds = -1; + + public Builder() { + isPersisted = true; + } + + public PeriodicTask build() { + return new PeriodicTask(this); + } + + /** + * Optional setter for specifying any extra parameters necessary for the task. + */ + public PeriodicTask.Builder setExtras(Bundle extras) { + this.extras = extras; + return this; + } + + /** + * Optional setter for specifying how close to the end of the period set in + * {@link com.google.android.gms.gcm.PeriodicTask.Builder#setPeriod(long)} you are willing to execute. + *

+ * For example, specifying a period of 30 seconds, with a flex value of 10 seconds + * will allow the scheduler to determine the best moment between the 20th and 30th + * second at which to execute your task. + */ + public PeriodicTask.Builder setFlex(long flexInSeconds) { + this.flexInSeconds = flexInSeconds; + return this; + } + + /** + * Mandatory setter for creating a periodic task. This specifies that you would like + * this task to recur at most once every mIntervalInSeconds. + *

+ * By default you have no control over where within this period the task will execute. + * If you want to restrict the task to run within a certain timeframe from the end of + * the period, use {@link com.google.android.gms.gcm.PeriodicTask.Builder#setFlex(long)} + */ + public PeriodicTask.Builder setPeriod(long periodInSeconds) { + this.periodInSeconds = periodInSeconds; + return this; + } + + /** + * Optional setter to specify whether this task should be persisted across reboots. This + * defaults to true for periodic tasks, + *

+ * Callers must hold the permission + * android.Manifest.permission.RECEIVE_BOOT_COMPLETED, otherwise this setter is + * ignored. + * + * @param isPersisted True if this task should be persisted across device reboots. + */ + public PeriodicTask.Builder setPersisted(boolean isPersisted) { + this.isPersisted = isPersisted; + return this; + } + + /** + * Set the network state your task requires to run. If the specified network is + * unavailable your task will not be executed until it becomes available. + *

+ * The default for either a periodic or one-off task is + * {@link com.google.android.gms.gcm.Task#NETWORK_STATE_CONNECTED}. Note that changing this to + * {@link com.google.android.gms.gcm.Task#NETWORK_STATE_ANY} means there is no guarantee that data will be available + * when your task executes. + *

+ * In addition, the only guarantee for connectivity is at the moment of execution - it is + * possible for the device to lose data shortly after your task begins executing. + */ + public PeriodicTask.Builder setRequiredNetwork(int requiredNetworkState) { + this.requiredNetworkState = requiredNetworkState; + return this; + } + + /** + * Set whether your task requires that the device be connected to power in order to + * execute. + *

+ * Use this to defer nonessential operations whenever possible. Note that if you set this + * field and the device is not connected to power your task will not run + * until the device is plugged in. + *

+ * One way to deal with your task not executing until the constraint is met is to schedule + * another task without the constraints that is subject to some deadline that you can abide. + * This task would be responsible for executing your fallback logic. + */ + public PeriodicTask.Builder setRequiresCharging(boolean requiresCharging) { + this.requiresCharging = requiresCharging; + return this; + } + + /** + *

Set whichever {@link com.google.android.gms.gcm.GcmTaskService} you implement to execute the logic for this task.

+ * + * @param gcmTaskService Endpoint against which you're scheduling this task. + */ + public PeriodicTask.Builder setService(Class gcmTaskService) { + this.gcmTaskService = gcmTaskService.getName(); + return this; + } + + /** + * Mandatory setter for specifying the tag identifer for this task. This tag will be + * returned at execution time to your endpoint. See + * {@link com.google.android.gms.gcm.GcmTaskService#onRunTask(com.google.android.gms.gcm.TaskParams)} + *

+ * Maximum tag length is 100. + * + * @param tag String identifier for this task. Consecutive schedule calls for the same + * tag will update any preexisting task with the same tag. + */ + public PeriodicTask.Builder setTag(String tag) { + this.tag = tag; + return this; + } + + /** + * Optional setter to specify whether this task should override any preexisting tasks + * with the same tag. This defaults to false, which means that a new task will not + * override an existing one. + * + * @param updateCurrent True to update the current task with the parameters of the new. + * Default false. + */ + public PeriodicTask.Builder setUpdateCurrent(boolean updateCurrent) { + this.updateCurrent = updateCurrent; + return this; + } + } +} \ No newline at end of file diff --git a/play-services-gcm/src/main/java/com/google/android/gms/gcm/Task.java b/play-services-gcm/src/main/java/com/google/android/gms/gcm/Task.java new file mode 100644 index 00000000..0126ff40 --- /dev/null +++ b/play-services-gcm/src/main/java/com/google/android/gms/gcm/Task.java @@ -0,0 +1,271 @@ +/* + * Copyright 2013-2016 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.gcm; + +import android.os.Bundle; +import android.os.Parcel; +import android.os.Parcelable; + +import org.microg.gms.common.PublicApi; + +/** + * Encapsulates the parameters of a task that you will schedule on the + * {@link com.google.android.gms.gcm.GcmNetworkManager}. + *

+ * Construct instances of either {@link com.google.android.gms.gcm.PeriodicTask} or + * {@link com.google.android.gms.gcm.OneoffTask} with the desired parameters/behaviour and + * schedule them using {@link com.google.android.gms.gcm.GcmNetworkManager#schedule(com.google.android.gms.gcm.Task)}. + */ +@PublicApi +public abstract class Task implements Parcelable { + + /** + *

The maximum size allowed for extras bundle in bytes. + *

+ */ + public static final int EXTRAS_LIMIT_BYTES = 10240; + + /** + *

Specify using {@link com.google.android.gms.gcm.Task.Builder#setRequiredNetwork(int)} + * that your task will execute [...] of whether network is available. + *

+ */ + public static final int NETWORK_STATE_ANY = 2; + + /** + *

Specify using {@link com.google.android.gms.gcm.Task.Builder#setRequiredNetwork(int)} + * that your task will only execute if [...] sort of data connection is available - + * either metered or unmetered. This is the default.

+ */ + public static final int NETWORK_STATE_CONNECTED = 0; + + /** + *

Specify using {@link com.google.android.gms.gcm.Task.Builder#setRequiredNetwork(int)} + * that your task will only execute if there is an unmetered network connection available. + *

+ */ + public static final int NETWORK_STATE_UNMETERED = 1; + + protected static final long UNINITIALIZED = -1; + + private final String serviceName; + private final String tag; + private final boolean updateCurrent; + private final boolean persisted; + private final int requiredNetwork; + private final boolean requiresCharging; + private final Bundle extras; + + Task(Builder builder) { + this.serviceName = builder.gcmTaskService; + this.tag = builder.tag; + this.updateCurrent = builder.updateCurrent; + this.persisted = builder.isPersisted; + this.requiredNetwork = builder.requiredNetworkState; + this.requiresCharging = builder.requiresCharging; + this.extras = builder.extras; + } + + Task(Parcel in) { + this.serviceName = in.readString(); + this.tag = in.readString(); + this.updateCurrent = in.readInt() == 1; + this.persisted = in.readInt() == 1; + this.requiredNetwork = NETWORK_STATE_ANY; + this.requiresCharging = false; + this.extras = null; + } + + public int describeContents() { + return 0; + } + + /** + * @return The extra parameters for the task set by the client. + */ + public Bundle getExtras() { + return extras; + } + + /** + * If the specified network is unavailable, your task will not be run until + * it is. + * + * @return The network type that this task requires in order to run. See the NETWORK_TYPE_* + * flavours for an explanation of what this value can be. + */ + public int getRequiredNetwork() { + return requiredNetwork; + } + + /** + * If the device is not charging and this is set to true, your task will not be run + * until it is. + * + * @return Whether or not this task depends on the device being connected to power in order to + * execute. + */ + public boolean getRequiresCharging() { + return requiresCharging; + } + + /** + * @return The {@link com.google.android.gms.gcm.GcmTaskService} component that this task + * will execute on. + */ + public String getServiceName() { + return serviceName; + } + + /** + * @return The String identifier for this task, that is returned to + * {@link com.google.android.gms.gcm.GcmTaskService#onRunTask(com.google.android.gms.gcm.TaskParams)} + * when this task executes. + */ + public String getTag() { + return tag; + } + + /** + * @return Whether this task will be persisted across devices restarts or Google Play Services + * crashes. + */ + public boolean isPersisted() { + return persisted; + } + + /** + * @return Whether or not this task will update a pre-existing task in the scheduler queue. + */ + public boolean isUpdateCurrent() { + return updateCurrent; + } + + public void toBundle(Bundle bundle) { + bundle.putString("tag", this.tag); + bundle.putBoolean("update_current", this.updateCurrent); + bundle.putBoolean("persisted", this.persisted); + bundle.putString("service", this.serviceName); + bundle.putInt("requiredNetwork", this.requiredNetwork); + bundle.putBoolean("requiresCharging", this.requiresCharging); + bundle.putBundle("retryStrategy", null); // TODO + bundle.putBundle("extras", this.extras); + } + + public void writeToParcel(Parcel parcel, int i) { + parcel.writeString(serviceName); + parcel.writeString(tag); + parcel.writeInt(updateCurrent ? 1 : 0); + parcel.writeInt(persisted ? 1 : 0); + } + + + /** + *

Builder object to construct these tasks before sending them to the network manager. Use + * either {@link com.google.android.gms.gcm.PeriodicTask.Builder} or + * {@link com.google.android.gms.gcm.Task.Builder}

+ */ + public abstract static class Builder { + protected Bundle extras; + protected String gcmTaskService; + protected boolean isPersisted; + protected int requiredNetworkState; + protected boolean requiresCharging; + protected String tag; + protected boolean updateCurrent; + + public Builder() { + throw new UnsupportedOperationException(); + } + + public abstract Task build(); + + /** + * Optional setter for specifying any extra parameters necessary for the task. + */ + public abstract Task.Builder setExtras(Bundle extras); + + /** + * Optional setter to specify whether this task should be persisted across reboots. This + * defaults to true for periodic tasks, and is not supported for one-off tasks. + *

+ * Callers must hold the permission + * android.Manifest.permission.RECEIVE_BOOT_COMPLETED, otherwise this setter is + * ignored. + * + * @param isPersisted True if this task should be persisted across device reboots. + */ + public abstract Task.Builder setPersisted(boolean isPersisted); + + /** + * Set the network state your task requires to run. If the specified network is + * unavailable your task will not be executed until it becomes available. + *

+ * The default for either a periodic or one-off task is + * {@link com.google.android.gms.gcm.Task#NETWORK_STATE_CONNECTED}. Note that changing this to + * {@link com.google.android.gms.gcm.Task#NETWORK_STATE_ANY} means there is no guarantee that data will be available + * when your task executes. + *

+ * In addition, the only guarantee for connectivity is at the moment of execution - it is + * possible for the device to lose data shortly after your task begins executing. + */ + public abstract Task.Builder setRequiredNetwork(int requiredNetworkState); + + /** + * Set whether your task requires that the device be connected to power in order to + * execute. + *

+ * Use this to defer nonessential operations whenever possible. Note that if you set this + * field and the device is not connected to power your task will not run + * until the device is plugged in. + *

+ * One way to deal with your task not executing until the constraint is met is to schedule + * another task without the constraints that is subject to some deadline that you can abide. + * This task would be responsible for executing your fallback logic. + */ + public abstract Task.Builder setRequiresCharging(boolean requiresCharging); + + /** + * Set whichever {@link com.google.android.gms.gcm.GcmTaskService} you implement to execute the logic for this task. + * + * @param gcmTaskService Endpoint against which you're scheduling this task. + */ + public abstract Task.Builder setService(Class gcmTaskService); + + /** + * Mandatory setter for specifying the tag identifer for this task. This tag will be + * returned at execution time to your endpoint. See + * {@link com.google.android.gms.gcm.GcmTaskService#onRunTask(com.google.android.gms.gcm.TaskParams)} + *

+ * Maximum tag length is 100. + * + * @param tag String identifier for this task. Consecutive schedule calls for the same tag + * will update any preexisting task with the same tag. + */ + public abstract Task.Builder setTag(String tag); + + /** + * Optional setter to specify whether this task should override any preexisting tasks with + * the same tag. This defaults to false, which means that a new task will not override an + * existing one. + * + * @param updateCurrent True to update the current task with the parameters of the new. + * Default false. + */ + public abstract Task.Builder setUpdateCurrent(boolean updateCurrent); + } +} \ No newline at end of file diff --git a/play-services-gcm/src/main/java/com/google/android/gms/gcm/TaskParams.java b/play-services-gcm/src/main/java/com/google/android/gms/gcm/TaskParams.java new file mode 100644 index 00000000..b3b0a99f --- /dev/null +++ b/play-services-gcm/src/main/java/com/google/android/gms/gcm/TaskParams.java @@ -0,0 +1,49 @@ +/* + * Copyright 2013-2016 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.gcm; + +import android.os.Bundle; + +import org.microg.gms.common.PublicApi; + +/** + * Container of parameters handed off to the client app in + * {@link com.google.android.gms.gcm.GcmTaskService#onRunTask(com.google.android.gms.gcm.TaskParams)}. + */ +@PublicApi +public class TaskParams { + private final String tag; + private final Bundle extras; + + public TaskParams(String tag) { + this(tag, null); + } + + public TaskParams(String tag, Bundle extras) { + this.tag = tag; + this.extras = extras; + } + + public Bundle getExtras() { + return extras; + } + + public String getTag() { + return tag; + } + +} diff --git a/play-services-gcm/src/main/java/com/google/android/gms/iid/InstanceID.java b/play-services-gcm/src/main/java/com/google/android/gms/iid/InstanceID.java new file mode 100644 index 00000000..c4f0cb34 --- /dev/null +++ b/play-services-gcm/src/main/java/com/google/android/gms/iid/InstanceID.java @@ -0,0 +1,166 @@ +/* + * Copyright 2013-2016 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.iid; + +import android.content.Context; +import android.os.Bundle; +import android.os.Looper; + +import org.microg.gms.common.PublicApi; +import org.microg.gms.gcm.GcmConstants; + +import java.io.IOException; + +/** + * Instance ID provides a unique identifier for each app instance and a mechanism + * to authenticate and authorize actions (for example, sending a GCM message). + *

+ * Instance ID is stable but may become invalid, if: + * [...] + * If Instance ID has become invalid, the app can call {@link com.google.android.gms.iid.InstanceID#getId()} + * to request a new Instance ID. + * To prove ownership of Instance ID and to allow servers to access data or + * services associated with the app, call {@link com.google.android.gms.iid.InstanceID#getToken(java.lang.String, java.lang.String)}. + */ +public class InstanceID { + /** + * Error returned when failed requests are retried too often. Use + * exponential backoff when retrying requests + */ + public static final String ERROR_BACKOFF = "RETRY_LATER"; + + /** + * Blocking methods must not be called on the main thread. + */ + public static final String ERROR_MAIN_THREAD = "MAIN_THREAD"; + + /** + * Tokens can't be generated. Only devices with Google Play are supported. + */ + public static final String ERROR_MISSING_INSTANCEID_SERVICE = "MISSING_INSTANCEID_SERVICE"; + + /** + * The device cannot read the response, or there was a server error. + * Application should retry the request later using exponential backoff + * and retry (on each subsequent failure increase delay before retrying). + */ + public static final String ERROR_SERVICE_NOT_AVAILABLE = GcmConstants.ERROR_SERVICE_NOT_AVAILABLE; + + /** + * Timeout waiting for a response. + */ + public static final String ERROR_TIMEOUT = "TIMEOUT"; + + /** + * Resets Instance ID and revokes all tokens. + * + * @throws IOException + */ + public void deleteInstanceID() throws IOException { + throw new UnsupportedOperationException(); + } + + /** + * Revokes access to a scope (action) for an entity previously + * authorized by {@link com.google.android.gms.iid.InstanceID#getToken(java.lang.String, java.lang.String)}. + *

+ * Do not call this function on the main thread. + * + * @param authorizedEntity Entity that must no longer have access. + * @param scope Action that entity is no longer authorized to perform. + * @throws IOException if the request fails. + */ + public void deleteToken(String authorizedEntity, String scope) throws IOException { + deleteToken(authorizedEntity, scope, new Bundle()); + } + + @PublicApi(exclude = true) + public void deleteToken(String authorizedEntity, String scope, Bundle extras) throws IOException { + throw new UnsupportedOperationException(); + } + + /** + * Returns time when instance ID was created. + * + * @return Time when instance ID was created (milliseconds since Epoch). + */ + public long getCreationTime() { + throw new UnsupportedOperationException(); + } + + /** + * Returns a stable identifier that uniquely identifies the app instance. + * + * @return The identifier for the application instance. + */ + public String getId() { + throw new UnsupportedOperationException(); + } + + /** + * Returns an instance of this class. + * + * @return InstanceID instance. + */ + public static InstanceID getInstance(Context context) { + throw new UnsupportedOperationException(); + } + + /** + * Returns a token that authorizes an Entity (example: cloud service) to perform + * an action on behalf of the application identified by Instance ID. + *

+ * This is similar to an OAuth2 token except, it applies to the + * application instance instead of a user. + *

+ * Do not call this function on the main thread. + * + * @param authorizedEntity Entity authorized by the token. + * @param scope Action authorized for authorizedEntity. + * @param extras additional parameters specific to each token scope. + * Bundle keys starting with 'GCM.' and 'GOOGLE.' are + * reserved. + * @return a token that can identify and authorize the instance of the + * application on the device. + * @throws IOException if the request fails. + */ + public String getToken(String authorizedEntity, String scope, Bundle extras) throws IOException { + if (Looper.getMainLooper() == Looper.myLooper()) throw new IOException(ERROR_MAIN_THREAD); + + throw new UnsupportedOperationException(); + } + + /** + * Returns a token that authorizes an Entity (example: cloud service) to perform + * an action on behalf of the application identified by Instance ID. + *

+ * This is similar to an OAuth2 token except, it applies to the + * application instance instead of a user. + *

+ * Do not call this function on the main thread. + * + * @param authorizedEntity Entity authorized by the token. + * @param scope Action authorized for authorizedEntity. + * @return a token that can identify and authorize the instance of the + * application on the device. + * @throws IOException if the request fails. + */ + public String getToken(String authorizedEntity, String scope) throws IOException { + return getToken(authorizedEntity, scope, null); + } + +} \ No newline at end of file diff --git a/play-services-gcm/src/main/java/com/google/android/gms/iid/InstanceIDListenerService.java b/play-services-gcm/src/main/java/com/google/android/gms/iid/InstanceIDListenerService.java new file mode 100644 index 00000000..cd9a80ff --- /dev/null +++ b/play-services-gcm/src/main/java/com/google/android/gms/iid/InstanceIDListenerService.java @@ -0,0 +1,138 @@ +/* + * Copyright 2013-2016 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.iid; + +import android.app.Service; +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; +import android.content.IntentFilter; +import android.os.Handler; +import android.os.IBinder; +import android.os.Looper; +import android.os.Message; + +import com.google.android.gms.gcm.GcmReceiver; + +import static org.microg.gms.gcm.GcmConstants.ACTION_C2DM_REGISTRATION; +import static org.microg.gms.gcm.GcmConstants.ACTION_INSTANCE_ID; +import static org.microg.gms.gcm.GcmConstants.EXTRA_FROM; +import static org.microg.gms.gcm.GcmConstants.EXTRA_GSF_INTENT; + +/** + * Base class to handle Instance ID service notifications on token + * refresh. + *

+ * Any app using Instance ID or GCM must include a class extending + * InstanceIDListenerService and implement {@link com.google.android.gms.iid.InstanceIDListenerService#onTokenRefresh()}. + *

+ * Include the following in the manifest: + *

+ * 
+ *     
+ *         
+ *     
+ * 
+ * Do not export this service. Instead, keep it private to prevent other apps + * accessing your service. + */ +public class InstanceIDListenerService extends Service { + + private BroadcastReceiver registrationReceiver = new BroadcastReceiver() { + @Override + public void onReceive(Context context, Intent intent) { + handleIntent(intent); + stop(); + } + }; + private MessengerCompat messengerCompat = new MessengerCompat(new Handler(Looper.getMainLooper()) { + @Override + public void handleMessage(Message msg) { + handleIntent((Intent) msg.obj); + } + }); + + private int counter = 0; + private int startId = -1; + + private void handleIntent(Intent intent) { + // TODO + } + + public IBinder onBind(Intent intent) { + if (intent != null && ACTION_INSTANCE_ID.equals(intent.getAction())) { + return messengerCompat.getBinder(); + } + return null; + } + + public void onCreate() { + IntentFilter filter = new IntentFilter(ACTION_C2DM_REGISTRATION); + filter.addCategory(getPackageName()); + registerReceiver(registrationReceiver, filter); + } + + public void onDestroy() { + unregisterReceiver(registrationReceiver); + } + + public int onStartCommand(Intent intent, int flags, int startId) { + synchronized (this) { + this.counter++; + if (startId > this.startId) this.startId = startId; + } + try { + if (intent != null) { + if (ACTION_INSTANCE_ID.equals(intent.getAction()) && intent.hasExtra(EXTRA_GSF_INTENT)) { + startService((Intent) intent.getParcelableExtra(EXTRA_GSF_INTENT)); + return START_STICKY; + } + + handleIntent(intent); + + if (intent.hasExtra(EXTRA_FROM)) GcmReceiver.completeWakefulIntent(intent); + } + } finally { + stop(); + } + return START_NOT_STICKY; + } + + /** + * Called when the system determines that the tokens need to be refreshed. The application + * should call getToken() and send the tokens to all application servers. + *

+ * This will not be called very frequently, it is needed for key rotation and to handle special + * cases. + *

+ * The system will throttle the refresh event across all devices to avoid overloading + * application servers with token updates. + */ + public void onTokenRefresh() { + // To be overwritten + } + + private void stop() { + synchronized (this) { + counter--; + if (counter <= 0) { + stopSelf(startId); + } + } + } + +} \ No newline at end of file diff --git a/play-services-location/build.gradle b/play-services-location/build.gradle index be40ce7f..b3a6c833 100644 --- a/play-services-location/build.gradle +++ b/play-services-location/build.gradle @@ -19,17 +19,20 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:1.3.0' - classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3' + classpath 'com.android.tools.build:gradle:2.0.0' } } apply plugin: 'com.android.library' -apply plugin: 'com.github.dcendents.android-maven' android { compileSdkVersion 23 - buildToolsVersion "23.0.1" + buildToolsVersion "23.0.2" + + defaultConfig { + versionName getMyVersionName() + } + compileOptions { sourceCompatibility JavaVersion.VERSION_1_6 } diff --git a/play-services-location/src/main/java/com/google/android/gms/location/FusedLocationProviderApi.java b/play-services-location/src/main/java/com/google/android/gms/location/FusedLocationProviderApi.java index 572a6ae1..14a92352 100644 --- a/play-services-location/src/main/java/com/google/android/gms/location/FusedLocationProviderApi.java +++ b/play-services-location/src/main/java/com/google/android/gms/location/FusedLocationProviderApi.java @@ -23,11 +23,11 @@ import android.os.Looper; import com.google.android.gms.common.api.GoogleApiClient; import com.google.android.gms.common.api.PendingResult; -import org.microg.gms.common.Constants; +import org.microg.gms.location.LocationConstants; public interface FusedLocationProviderApi { String KEY_LOCATION_CHANGED = "com.google.android.location.LOCATION"; - String KEY_MOCK_LOCATION = Constants.KEY_MOCK_LOCATION; + String KEY_MOCK_LOCATION = LocationConstants.KEY_MOCK_LOCATION; Location getLastLocation(GoogleApiClient client); diff --git a/play-services-location/src/main/java/org/microg/gms/location/GoogleLocationManagerClient.java b/play-services-location/src/main/java/org/microg/gms/location/GoogleLocationManagerClient.java index b012cf97..55713f02 100644 --- a/play-services-location/src/main/java/org/microg/gms/location/GoogleLocationManagerClient.java +++ b/play-services-location/src/main/java/org/microg/gms/location/GoogleLocationManagerClient.java @@ -27,7 +27,7 @@ import com.google.android.gms.location.internal.IGoogleLocationManagerService; import org.microg.gms.common.Constants; import org.microg.gms.common.GmsClient; -import org.microg.gms.common.Services; +import org.microg.gms.common.GmsService; public abstract class GoogleLocationManagerClient extends GmsClient { public GoogleLocationManagerClient(Context context, GoogleApiClient.ConnectionCallbacks @@ -37,7 +37,7 @@ public abstract class GoogleLocationManagerClient extends GmsClient Date: Thu, 14 Apr 2016 22:12:15 +0200 Subject: [PATCH 146/293] Update Travis CI support --- .travis.yml | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1b3be818..1f8c07c6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,17 +1,25 @@ language: android +sudo: false git: submodules: false before_install: - git submodule update --init --recursive -script: - - export JAVA_OPTS="-XX:MaxPermSize=1024m -XX:+CMSClassUnloadingEnabled -XX:+HeapDumpOnOutOfMemoryError -Xmx2048m" - - export TERM=dumb +before_script: - echo sdk.dir $ANDROID_HOME > local.properties - - ./gradlew assembleDebug -x lint +script: + - export TERM=dumb + - export JAVA_OPTS="-XX:MaxPermSize=1024m -XX:+CMSClassUnloadingEnabled -XX:+HeapDumpOnOutOfMemoryError -Xmx2048m" + - ./gradlew build android: components: - - extra-android-m2repository - - build-tools-23.0.1 + - platform-tools + - tools + - build-tools-23.0.2 - android-23 - - + - extra-android-m2repository +before_cache: + - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock +cache: + directories: + - $HOME/.gradle/caches/ + - $HOME/.gradle/wrapper/ From d6d32cc2038d1e6bc3a4baebf0e9e720c165454f Mon Sep 17 00:00:00 2001 From: Marvin W Date: Thu, 14 Apr 2016 22:21:41 +0200 Subject: [PATCH 147/293] Fix/Suppress Lint errors --- .../microg/gms/common/api/ResultCallbackHandler.java | 2 +- .../gms/location/NativeLocationClientImpl.java | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/play-services-base/src/main/java/org/microg/gms/common/api/ResultCallbackHandler.java b/play-services-base/src/main/java/org/microg/gms/common/api/ResultCallbackHandler.java index 071a6d74..61242930 100644 --- a/play-services-base/src/main/java/org/microg/gms/common/api/ResultCallbackHandler.java +++ b/play-services-base/src/main/java/org/microg/gms/common/api/ResultCallbackHandler.java @@ -25,7 +25,7 @@ import com.google.android.gms.common.api.Result; import com.google.android.gms.common.api.ResultCallback; class ResultCallbackHandler extends Handler { - private static final String TAG = "GmsResultCallbackHandler"; + private static final String TAG = "GmsResultCbackHandler"; public static final int CALLBACK_ON_COMPLETE = 1; public static final int CALLBACK_ON_TIMEOUT = 2; diff --git a/play-services-location/src/main/java/org/microg/gms/location/NativeLocationClientImpl.java b/play-services-location/src/main/java/org/microg/gms/location/NativeLocationClientImpl.java index 500e5e05..7555b806 100644 --- a/play-services-location/src/main/java/org/microg/gms/location/NativeLocationClientImpl.java +++ b/play-services-location/src/main/java/org/microg/gms/location/NativeLocationClientImpl.java @@ -34,6 +34,7 @@ import com.google.android.gms.location.LocationRequest; import java.util.HashMap; import java.util.Map; +@SuppressWarnings("MissingPermission") public class NativeLocationClientImpl { private final static String TAG = "GmsToNativeLocClient"; private final static Criteria DEFAULT_CRITERIA = new Criteria(); @@ -72,8 +73,7 @@ public class NativeLocationClientImpl { public Location getLastLocation() { Log.d(TAG, "getLastLocation()"); - return locationManager.getLastKnownLocation( - locationManager.getBestProvider(DEFAULT_CRITERIA, true)); + return locationManager.getLastKnownLocation(locationManager.getBestProvider(DEFAULT_CRITERIA, true)); } public void requestLocationUpdates(LocationRequest request, LocationListener listener) { @@ -88,9 +88,8 @@ public class NativeLocationClientImpl { i.putExtras(bundle); pendingCount.put(pendingIntent, request.getNumUpdates()); nativePendingMap.put(pendingIntent, PendingIntent.getActivity(context, 0, i, 0)); - locationManager.requestLocationUpdates(request.getInterval(), - request.getSmallestDesplacement(), makeNativeCriteria(request), - nativePendingMap.get(pendingIntent)); + locationManager.requestLocationUpdates(request.getInterval(), request.getSmallestDesplacement(), + makeNativeCriteria(request), nativePendingMap.get(pendingIntent)); } public void requestLocationUpdates(LocationRequest request, LocationListener listener, Looper @@ -133,8 +132,7 @@ public class NativeLocationClientImpl { @Override public void onReceive(Context context, Intent intent) { if (intent.hasExtra(LocationManager.KEY_LOCATION_CHANGED)) { - PendingIntent pendingIntent = intent.getExtras().getParcelable - (EXTRA_PENDING_INTENT); + PendingIntent pendingIntent = intent.getExtras().getParcelable(EXTRA_PENDING_INTENT); try { intent.putExtra(FusedLocationProviderApi.KEY_LOCATION_CHANGED, intent.getParcelableExtra(LocationManager.KEY_LOCATION_CHANGED)); From 5e58a66a1eab3c9f01de60bfd937a09225ef5648 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Mon, 18 Apr 2016 10:27:11 +0200 Subject: [PATCH 148/293] Add collapse_key extra --- .../src/main/java/org/microg/gms/gcm/GcmConstants.java | 1 + 1 file changed, 1 insertion(+) diff --git a/play-services-api/src/main/java/org/microg/gms/gcm/GcmConstants.java b/play-services-api/src/main/java/org/microg/gms/gcm/GcmConstants.java index ba75ba90..1258bd4b 100644 --- a/play-services-api/src/main/java/org/microg/gms/gcm/GcmConstants.java +++ b/play-services-api/src/main/java/org/microg/gms/gcm/GcmConstants.java @@ -31,6 +31,7 @@ public final class GcmConstants { public static final String EXTRA_APP = "app"; public static final String EXTRA_COMPONENT = "component"; + public static final String EXTRA_COLLAPSE_KEY = "collapse_key"; public static final String EXTRA_DELAY = "google.delay"; public static final String EXTRA_DELETE = "delete"; public static final String EXTRA_ERROR = "error"; From 9daa4db4f3bfe2508d36a170520b60c68df5fbe1 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Thu, 12 May 2016 01:44:48 +0200 Subject: [PATCH 149/293] GCM: Add more constants --- .../src/main/java/org/microg/gms/gcm/GcmConstants.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/play-services-api/src/main/java/org/microg/gms/gcm/GcmConstants.java b/play-services-api/src/main/java/org/microg/gms/gcm/GcmConstants.java index 1258bd4b..f035c1ba 100644 --- a/play-services-api/src/main/java/org/microg/gms/gcm/GcmConstants.java +++ b/play-services-api/src/main/java/org/microg/gms/gcm/GcmConstants.java @@ -37,17 +37,22 @@ public final class GcmConstants { public static final String EXTRA_ERROR = "error"; public static final String EXTRA_FROM = "from"; public static final String EXTRA_GSF_INTENT = "GSF"; - public static final String EXTRA_PENDING_INTENT = "com.google.android.gms.gcm.PENDING_INTENT"; public static final String EXTRA_MESSENGER = "google.messenger"; public static final String EXTRA_MESSAGE_TYPE = "message_type"; public static final String EXTRA_MESSAGE_ID = "google.message_id"; + public static final String EXTRA_PENDING_INTENT = "com.google.android.gms.gcm.PENDING_INTENT"; + public static final String EXTRA_RAWDATA = "rawData"; + public static final String EXTRA_RAWDATA_BASE64 = "gcm.rawData64"; public static final String EXTRA_REGISTRATION_ID = "registration_id"; public static final String EXTRA_RETRY_AFTER = "Retry-After"; public static final String EXTRA_SCHEDULER_ACTION = "scheduler_action"; + public static final String EXTRA_SCOPE = "scope"; public static final String EXTRA_SENDER = "sender"; public static final String EXTRA_SENDER_LEGACY = "legacy.sender"; public static final String EXTRA_SEND_TO = "google.to"; public static final String EXTRA_SEND_FROM = "google.from"; + public static final String EXTRA_SUBSCIPTION = "subscription"; + public static final String EXTRA_SUBTYPE = "subtype"; public static final String EXTRA_TAG = "tag"; public static final String EXTRA_TOPIC = "gcm.topic"; public static final String EXTRA_TTL = "google.ttl"; @@ -70,4 +75,7 @@ public final class GcmConstants { public static final String ERROR_SERVICE_NOT_AVAILABLE = "SERVICE_NOT_AVAILABLE"; public static final String INSTANCE_ID_SCOPE_GCM = "GCM"; + + public static final String GCMID_INSTANCE_ID = "google.com/iid"; + public static final String GCMID_REFRESH = "gcm.googleapis.com/refresh"; } From 8003a0ac898cb5ba658c255cfbb09885014bcf39 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Thu, 2 Jun 2016 22:58:37 +0200 Subject: [PATCH 150/293] Update build tools and support lib --- microg-ui-tools/build.gradle | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/microg-ui-tools/build.gradle b/microg-ui-tools/build.gradle index bff3323e..bd68afb5 100644 --- a/microg-ui-tools/build.gradle +++ b/microg-ui-tools/build.gradle @@ -19,7 +19,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:2.0.0' + classpath 'com.android.tools.build:gradle:2.1.0' } } apply plugin: 'com.android.library' @@ -51,7 +51,7 @@ android { } dependencies { - compile 'com.android.support:support-v4:23.3.0' - compile 'com.android.support:appcompat-v7:23.3.0' + compile 'com.android.support:support-v4:23.4.0' + compile 'com.android.support:appcompat-v7:23.4.0' } From 5f2083f2279f698368cc2f6d6002d9249c43fe04 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Thu, 2 Jun 2016 23:10:06 +0200 Subject: [PATCH 151/293] Start adding reminders API --- .../android/gms/reminders/AccountState.aidl | 3 ++ .../CreateReminderOptionsInternal.aidl | 3 ++ .../gms/reminders/LoadRemindersOptions.aidl | 3 ++ .../gms/reminders/ReindexDueDatesOptions.aidl | 3 ++ .../reminders/UpdateRecurrenceOptions.aidl | 3 ++ .../internal/IRemindersCallbacks.aidl | 17 +++++++++ .../internal/IRemindersListener.aidl | 5 +++ .../reminders/internal/IRemindersService.aidl | 37 +++++++++++++++++++ .../model/CustomizedSnoozePresetEntity.aidl | 3 ++ .../gms/reminders/model/TaskEntity.aidl | 3 ++ .../gms/reminders/model/TaskIdEntity.aidl | 3 ++ .../android/gms/reminders/AccountState.java | 23 ++++++++++++ .../CreateReminderOptionsInternal.java | 23 ++++++++++++ .../gms/reminders/LoadRemindersOptions.java | 23 ++++++++++++ .../gms/reminders/ReindexDueDatesOptions.java | 23 ++++++++++++ .../reminders/UpdateRecurrenceOptions.java | 23 ++++++++++++ .../model/CustomizedSnoozePresetEntity.java | 23 ++++++++++++ .../gms/reminders/model/TaskEntity.java | 23 ++++++++++++ .../gms/reminders/model/TaskIdEntity.java | 23 ++++++++++++ .../java/org/microg/gms/common/Constants.java | 2 +- 20 files changed, 268 insertions(+), 1 deletion(-) create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/reminders/AccountState.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/reminders/CreateReminderOptionsInternal.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/reminders/LoadRemindersOptions.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/reminders/ReindexDueDatesOptions.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/reminders/UpdateRecurrenceOptions.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/reminders/internal/IRemindersCallbacks.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/reminders/internal/IRemindersListener.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/reminders/internal/IRemindersService.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/reminders/model/CustomizedSnoozePresetEntity.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/reminders/model/TaskEntity.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/reminders/model/TaskIdEntity.aidl create mode 100644 play-services-api/src/main/java/com/google/android/gms/reminders/AccountState.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/reminders/CreateReminderOptionsInternal.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/reminders/LoadRemindersOptions.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/reminders/ReindexDueDatesOptions.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/reminders/UpdateRecurrenceOptions.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/reminders/model/CustomizedSnoozePresetEntity.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/reminders/model/TaskEntity.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/reminders/model/TaskIdEntity.java diff --git a/play-services-api/src/main/aidl/com/google/android/gms/reminders/AccountState.aidl b/play-services-api/src/main/aidl/com/google/android/gms/reminders/AccountState.aidl new file mode 100644 index 00000000..24ae0ffd --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/reminders/AccountState.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.reminders; + +parcelable AccountState; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/reminders/CreateReminderOptionsInternal.aidl b/play-services-api/src/main/aidl/com/google/android/gms/reminders/CreateReminderOptionsInternal.aidl new file mode 100644 index 00000000..142ddedf --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/reminders/CreateReminderOptionsInternal.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.reminders; + +parcelable CreateReminderOptionsInternal; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/reminders/LoadRemindersOptions.aidl b/play-services-api/src/main/aidl/com/google/android/gms/reminders/LoadRemindersOptions.aidl new file mode 100644 index 00000000..ff418443 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/reminders/LoadRemindersOptions.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.reminders; + +parcelable LoadRemindersOptions; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/reminders/ReindexDueDatesOptions.aidl b/play-services-api/src/main/aidl/com/google/android/gms/reminders/ReindexDueDatesOptions.aidl new file mode 100644 index 00000000..55ac1beb --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/reminders/ReindexDueDatesOptions.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.reminders; + +parcelable ReindexDueDatesOptions; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/reminders/UpdateRecurrenceOptions.aidl b/play-services-api/src/main/aidl/com/google/android/gms/reminders/UpdateRecurrenceOptions.aidl new file mode 100644 index 00000000..79f91dec --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/reminders/UpdateRecurrenceOptions.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.reminders; + +parcelable UpdateRecurrenceOptions; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/reminders/internal/IRemindersCallbacks.aidl b/play-services-api/src/main/aidl/com/google/android/gms/reminders/internal/IRemindersCallbacks.aidl new file mode 100644 index 00000000..5e5506ee --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/reminders/internal/IRemindersCallbacks.aidl @@ -0,0 +1,17 @@ +package com.google.android.gms.reminders.internal; + +import com.google.android.gms.common.api.Status; +import com.google.android.gms.common.data.DataHolder; + +import com.google.android.gms.reminders.AccountState; + +interface IRemindersCallbacks { + void onDataHolder(in DataHolder data, in Status status) = 0; + void onStatus(in Status status) = 1; + void onNoStatus() = 2; + void onDataHolderNoStatus(in DataHolder data, in Status status) = 3; + void onBool(boolean b, in Status status) = 4; + void onString(in String s, in Status status) = 5; + void onAccountState(in AccountState accountState, in Status status) = 6; + void onAsyncDataHolder(in DataHolder data) = 7; +} \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/reminders/internal/IRemindersListener.aidl b/play-services-api/src/main/aidl/com/google/android/gms/reminders/internal/IRemindersListener.aidl new file mode 100644 index 00000000..2added91 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/reminders/internal/IRemindersListener.aidl @@ -0,0 +1,5 @@ +package com.google.android.gms.reminders.internal; + +interface IRemindersListener { + +} \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/reminders/internal/IRemindersService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/reminders/internal/IRemindersService.aidl new file mode 100644 index 00000000..f9986484 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/reminders/internal/IRemindersService.aidl @@ -0,0 +1,37 @@ +package com.google.android.gms.reminders.internal; + +import com.google.android.gms.reminders.internal.IRemindersCallbacks; + +import com.google.android.gms.reminders.AccountState; +import com.google.android.gms.reminders.CreateReminderOptionsInternal; +import com.google.android.gms.reminders.LoadRemindersOptions; +import com.google.android.gms.reminders.ReindexDueDatesOptions; +import com.google.android.gms.reminders.UpdateRecurrenceOptions; +import com.google.android.gms.reminders.model.CustomizedSnoozePresetEntity; +import com.google.android.gms.reminders.model.TaskEntity; +import com.google.android.gms.reminders.model.TaskIdEntity; + +interface IRemindersService { + void loadReminders(IRemindersCallbacks callbacks, in LoadRemindersOptions options) = 0; + void addListener(IRemindersCallbacks callbacks) = 1; + void createReminder(IRemindersCallbacks callbacks, in TaskEntity task) = 2; + void updateReminder(IRemindersCallbacks callbacks, in TaskEntity task) = 3; + void deleteReminder(IRemindersCallbacks callbacks, in TaskIdEntity taskId) = 4; + void bumpReminder(IRemindersCallbacks callbacks, in TaskIdEntity taskId) = 5; + void hasUpcomingReminders(IRemindersCallbacks callbacks) = 6; + void createRecurrence(IRemindersCallbacks callbacks, in TaskEntity task) = 7; + void updateRecurrence(IRemindersCallbacks callbacks, String s1, in TaskEntity task, in UpdateRecurrenceOptions options) = 8; + void deleteRecurrence(IRemindersCallbacks callbacks, String s1, in UpdateRecurrenceOptions options) = 9; + void changeRecurrence(IRemindersCallbacks callbacks, String s1, in TaskEntity task, in UpdateRecurrenceOptions options) = 10; + void makeTaskRecurring(IRemindersCallbacks callbacks, in TaskEntity task) = 11; + void makeRecurrenceSingleInstance(IRemindersCallbacks callbacks, String s1, in TaskEntity task, in UpdateRecurrenceOptions options) = 12; + void clearListeners() = 13; + void batchUpdateReminders(IRemindersCallbacks callbacks, in List tasks) = 14; + void createReminderWithOptions(IRemindersCallbacks callbacks, in TaskEntity task, in CreateReminderOptionsInternal options) = 15; + void getCustomizedSnoozePreset(IRemindersCallbacks callbacks) = 16; + void setCustomizedSnoozePreset(IRemindersCallbacks callbacks, in CustomizedSnoozePresetEntity preset) = 17; + void setAccountState(IRemindersCallbacks callbacks, in AccountState accountState) = 18; + void getAccountState(IRemindersCallbacks callbacks) = 19; + void checkReindexDueDatesNeeded(IRemindersCallbacks callbacks, in ReindexDueDatesOptions options) = 20; + void reindexDueDates(IRemindersCallbacks callbacks, in ReindexDueDatesOptions options) = 21; +} \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/reminders/model/CustomizedSnoozePresetEntity.aidl b/play-services-api/src/main/aidl/com/google/android/gms/reminders/model/CustomizedSnoozePresetEntity.aidl new file mode 100644 index 00000000..bbb90836 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/reminders/model/CustomizedSnoozePresetEntity.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.reminders.model; + +parcelable CustomizedSnoozePresetEntity; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/reminders/model/TaskEntity.aidl b/play-services-api/src/main/aidl/com/google/android/gms/reminders/model/TaskEntity.aidl new file mode 100644 index 00000000..9a3883c2 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/reminders/model/TaskEntity.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.reminders.model; + +parcelable TaskEntity; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/reminders/model/TaskIdEntity.aidl b/play-services-api/src/main/aidl/com/google/android/gms/reminders/model/TaskIdEntity.aidl new file mode 100644 index 00000000..a4c41481 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/reminders/model/TaskIdEntity.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.reminders.model; + +parcelable TaskIdEntity; \ No newline at end of file diff --git a/play-services-api/src/main/java/com/google/android/gms/reminders/AccountState.java b/play-services-api/src/main/java/com/google/android/gms/reminders/AccountState.java new file mode 100644 index 00000000..ee6ae6fb --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/reminders/AccountState.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2016 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.reminders; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class AccountState extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(AccountState.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/reminders/CreateReminderOptionsInternal.java b/play-services-api/src/main/java/com/google/android/gms/reminders/CreateReminderOptionsInternal.java new file mode 100644 index 00000000..c4e9c62f --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/reminders/CreateReminderOptionsInternal.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2016 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.reminders; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class CreateReminderOptionsInternal extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(CreateReminderOptionsInternal.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/reminders/LoadRemindersOptions.java b/play-services-api/src/main/java/com/google/android/gms/reminders/LoadRemindersOptions.java new file mode 100644 index 00000000..cf546d01 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/reminders/LoadRemindersOptions.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2016 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.reminders; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class LoadRemindersOptions extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(LoadRemindersOptions.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/reminders/ReindexDueDatesOptions.java b/play-services-api/src/main/java/com/google/android/gms/reminders/ReindexDueDatesOptions.java new file mode 100644 index 00000000..c24a11ac --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/reminders/ReindexDueDatesOptions.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2016 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.reminders; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class ReindexDueDatesOptions extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(ReindexDueDatesOptions.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/reminders/UpdateRecurrenceOptions.java b/play-services-api/src/main/java/com/google/android/gms/reminders/UpdateRecurrenceOptions.java new file mode 100644 index 00000000..121aa221 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/reminders/UpdateRecurrenceOptions.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2016 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.reminders; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class UpdateRecurrenceOptions extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(UpdateRecurrenceOptions.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/reminders/model/CustomizedSnoozePresetEntity.java b/play-services-api/src/main/java/com/google/android/gms/reminders/model/CustomizedSnoozePresetEntity.java new file mode 100644 index 00000000..084ca131 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/reminders/model/CustomizedSnoozePresetEntity.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2016 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.reminders.model; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class CustomizedSnoozePresetEntity extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(CustomizedSnoozePresetEntity.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/reminders/model/TaskEntity.java b/play-services-api/src/main/java/com/google/android/gms/reminders/model/TaskEntity.java new file mode 100644 index 00000000..f4d4019d --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/reminders/model/TaskEntity.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2016 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.reminders.model; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class TaskEntity extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(TaskEntity.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/reminders/model/TaskIdEntity.java b/play-services-api/src/main/java/com/google/android/gms/reminders/model/TaskIdEntity.java new file mode 100644 index 00000000..b8154ad7 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/reminders/model/TaskIdEntity.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2016 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.reminders.model; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class TaskIdEntity extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(TaskIdEntity.class); +} diff --git a/play-services-api/src/main/java/org/microg/gms/common/Constants.java b/play-services-api/src/main/java/org/microg/gms/common/Constants.java index 4fb16e83..1766e45b 100644 --- a/play-services-api/src/main/java/org/microg/gms/common/Constants.java +++ b/play-services-api/src/main/java/org/microg/gms/common/Constants.java @@ -21,7 +21,7 @@ public class Constants { * This is the highest version that was looked at during development. * Does not necessarily mean anything. */ - public static final int MAX_REFERENCE_VERSION = 8489000; + public static final int MAX_REFERENCE_VERSION = 9083000; public static final String GMS_PACKAGE_NAME = "com.google.android.gms"; public static final String GSF_PACKAGE_NAME = "com.google.android.gsf"; public static final String GMS_PACKAGE_SIGNATURE_SHA1 = "38918a453d07199354f8b19af05ec6562ced5788"; From 9c6993eca6574cd85f48d673f705d6812b5b55aa Mon Sep 17 00:00:00 2001 From: Marvin W Date: Thu, 2 Jun 2016 23:10:21 +0200 Subject: [PATCH 152/293] Update build tools --- play-services-api/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/play-services-api/build.gradle b/play-services-api/build.gradle index b1477716..9312ef21 100644 --- a/play-services-api/build.gradle +++ b/play-services-api/build.gradle @@ -19,7 +19,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:2.0.0' + classpath 'com.android.tools.build:gradle:2.1.0' } } From a5afc23373ab1890f5df2ecebce96e9db74c0829 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Thu, 2 Jun 2016 23:10:49 +0200 Subject: [PATCH 153/293] Update sublib --- extern/SafeParcel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extern/SafeParcel b/extern/SafeParcel index 5f5d9c04..6d20e7a0 160000 --- a/extern/SafeParcel +++ b/extern/SafeParcel @@ -1 +1 @@ -Subproject commit 5f5d9c04beb90fa8964da019cf80a7681f428a77 +Subproject commit 6d20e7a08bb1e36edb9a4dea29d7096374ac797f From 3532954c3e232b5ca0ca83c4db83fd0acb42845a Mon Sep 17 00:00:00 2001 From: Marvin W Date: Sat, 2 Jul 2016 14:21:28 +0200 Subject: [PATCH 154/293] Update build tools and add LICENSE --- .travis.yml | 2 +- LICENSE | 177 +++++++++++++++++++++++++++++++++++ microg-ui-tools/build.gradle | 4 +- 3 files changed, 180 insertions(+), 3 deletions(-) create mode 100644 LICENSE diff --git a/.travis.yml b/.travis.yml index 5cf5f787..846cd7b8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ android: components: - platform-tools - tools - - build-tools-23.0.2 + - build-tools-23.0.3 - android-23 - extra-android-m2repository before_cache: diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..f433b1a5 --- /dev/null +++ b/LICENSE @@ -0,0 +1,177 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS diff --git a/microg-ui-tools/build.gradle b/microg-ui-tools/build.gradle index bd68afb5..ea1ec07b 100644 --- a/microg-ui-tools/build.gradle +++ b/microg-ui-tools/build.gradle @@ -19,7 +19,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:2.1.0' + classpath 'com.android.tools.build:gradle:2.1.2' } } apply plugin: 'com.android.library' @@ -35,7 +35,7 @@ String getMyVersionName() { android { compileSdkVersion 23 - buildToolsVersion "23.0.2" + buildToolsVersion "23.0.3" defaultConfig { versionName getMyVersionName() From 74f959ae922da5bbff1a96eef3dd4eb71699b629 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Fri, 8 Jul 2016 19:09:03 +0200 Subject: [PATCH 155/293] Update build tools, sublib, version code and add LICENSE --- .travis.yml | 2 +- LICENSE | 177 ++++++++++++++++++ extern/SafeParcel | 2 +- play-services-api/build.gradle | 4 +- .../java/org/microg/gms/common/Constants.java | 2 +- 5 files changed, 182 insertions(+), 5 deletions(-) create mode 100644 LICENSE diff --git a/.travis.yml b/.travis.yml index 5b09d886..a1c9090d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,7 @@ script: android: components: - tools - - build-tools-23.0.2 + - build-tools-23.0.3 - android-23 - extra-android-m2repository diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..f433b1a5 --- /dev/null +++ b/LICENSE @@ -0,0 +1,177 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS diff --git a/extern/SafeParcel b/extern/SafeParcel index 6d20e7a0..6e2e63bd 160000 --- a/extern/SafeParcel +++ b/extern/SafeParcel @@ -1 +1 @@ -Subproject commit 6d20e7a08bb1e36edb9a4dea29d7096374ac797f +Subproject commit 6e2e63bdf0016b094b41f66b15accb4915cf7561 diff --git a/play-services-api/build.gradle b/play-services-api/build.gradle index 9312ef21..b0b8ad9d 100644 --- a/play-services-api/build.gradle +++ b/play-services-api/build.gradle @@ -19,7 +19,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:2.1.0' + classpath 'com.android.tools.build:gradle:2.1.2' } } @@ -39,7 +39,7 @@ version = getMyVersionName() android { compileSdkVersion 23 - buildToolsVersion "23.0.2" + buildToolsVersion "23.0.3" defaultConfig { versionName getMyVersionName() diff --git a/play-services-api/src/main/java/org/microg/gms/common/Constants.java b/play-services-api/src/main/java/org/microg/gms/common/Constants.java index 1766e45b..049a2c62 100644 --- a/play-services-api/src/main/java/org/microg/gms/common/Constants.java +++ b/play-services-api/src/main/java/org/microg/gms/common/Constants.java @@ -21,7 +21,7 @@ public class Constants { * This is the highest version that was looked at during development. * Does not necessarily mean anything. */ - public static final int MAX_REFERENCE_VERSION = 9083000; + public static final int MAX_REFERENCE_VERSION = 9256000; public static final String GMS_PACKAGE_NAME = "com.google.android.gms"; public static final String GSF_PACKAGE_NAME = "com.google.android.gsf"; public static final String GMS_PACKAGE_SIGNATURE_SHA1 = "38918a453d07199354f8b19af05ec6562ced5788"; From cfd7c4e70e8b70a2decc303f1f6b291606211c17 Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Thu, 7 Jul 2016 18:50:14 +0200 Subject: [PATCH 156/293] Add FusedLocationProvider stuff required for newer Google client libs --- .../internal/FusedLocationProviderResult.aidl | 3 ++ .../IFusedLocationProviderCallback.aidl | 7 ++++ .../internal/FusedLocationProviderResult.java | 40 +++++++++++++++++++ .../internal/LocationRequestUpdateData.java | 5 +++ 4 files changed, 55 insertions(+) create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/location/internal/FusedLocationProviderResult.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/location/internal/IFusedLocationProviderCallback.aidl create mode 100644 play-services-api/src/main/java/com/google/android/gms/location/internal/FusedLocationProviderResult.java diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/internal/FusedLocationProviderResult.aidl b/play-services-api/src/main/aidl/com/google/android/gms/location/internal/FusedLocationProviderResult.aidl new file mode 100644 index 00000000..37a17787 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/location/internal/FusedLocationProviderResult.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.location.internal; + +parcelable FusedLocationProviderResult; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/internal/IFusedLocationProviderCallback.aidl b/play-services-api/src/main/aidl/com/google/android/gms/location/internal/IFusedLocationProviderCallback.aidl new file mode 100644 index 00000000..c0560fe5 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/location/internal/IFusedLocationProviderCallback.aidl @@ -0,0 +1,7 @@ +package com.google.android.gms.location.internal; + +import com.google.android.gms.location.internal.FusedLocationProviderResult; + +interface IFusedLocationProviderCallback { + void onFusedLocationProviderResult(in FusedLocationProviderResult result) = 0; +} diff --git a/play-services-api/src/main/java/com/google/android/gms/location/internal/FusedLocationProviderResult.java b/play-services-api/src/main/java/com/google/android/gms/location/internal/FusedLocationProviderResult.java new file mode 100644 index 00000000..2e085fbe --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/location/internal/FusedLocationProviderResult.java @@ -0,0 +1,40 @@ +/* + * Copyright 2013-2015 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.location.internal; + +import com.google.android.gms.common.api.Status; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class FusedLocationProviderResult extends AutoSafeParcelable { + public static final FusedLocationProviderResult SUCCESS = FusedLocationProviderResult.create(Status.SUCCESS); + + @SafeParceled(1000) + private int versionCode = 1; + + @SafeParceled(1) + public Status status; + + public static FusedLocationProviderResult create(Status status) { + FusedLocationProviderResult result = new FusedLocationProviderResult(); + result.status = status; + return result; + } + + public static final Creator CREATOR = new AutoCreator(FusedLocationProviderResult.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/location/internal/LocationRequestUpdateData.java b/play-services-api/src/main/java/com/google/android/gms/location/internal/LocationRequestUpdateData.java index 748f2f13..9960db4c 100644 --- a/play-services-api/src/main/java/com/google/android/gms/location/internal/LocationRequestUpdateData.java +++ b/play-services-api/src/main/java/com/google/android/gms/location/internal/LocationRequestUpdateData.java @@ -20,6 +20,7 @@ import android.app.PendingIntent; import com.google.android.gms.location.ILocationCallback; import com.google.android.gms.location.ILocationListener; +import com.google.android.gms.location.internal.IFusedLocationProviderCallback; import org.microg.safeparcel.AutoSafeParcelable; import org.microg.safeparcel.SafeParceled; @@ -47,6 +48,9 @@ public class LocationRequestUpdateData extends AutoSafeParcelable { @SafeParceled(5) public ILocationCallback callback; + @SafeParceled(6) + public IFusedLocationProviderCallback fusedLocationProviderCallback; + @Override public String toString() { return "LocationRequestUpdateData{" + @@ -55,6 +59,7 @@ public class LocationRequestUpdateData extends AutoSafeParcelable { ", listener=" + listener + ", pendingIntent=" + pendingIntent + ", callback=" + callback + + ", fusedLocationProviderCallback=" + fusedLocationProviderCallback + '}'; } From 4991c5c05b98e426614de5d3f23a5e39d6384aa7 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Sun, 31 Jul 2016 12:01:48 +0200 Subject: [PATCH 157/293] Implement DataHolder compatible with old public API --- .../android/gms/common/data/DataHolder.java | 455 ++++++++++++++++-- 1 file changed, 426 insertions(+), 29 deletions(-) diff --git a/play-services-api/src/main/java/com/google/android/gms/common/data/DataHolder.java b/play-services-api/src/main/java/com/google/android/gms/common/data/DataHolder.java index bd1efdcb..51a4a602 100644 --- a/play-services-api/src/main/java/com/google/android/gms/common/data/DataHolder.java +++ b/play-services-api/src/main/java/com/google/android/gms/common/data/DataHolder.java @@ -17,39 +17,57 @@ package com.google.android.gms.common.data; import android.annotation.SuppressLint; +import android.content.ContentValues; import android.database.AbstractWindowedCursor; +import android.database.CharArrayBuffer; import android.database.Cursor; import android.database.CursorWindow; +import android.net.Uri; import android.os.Build; import android.os.Bundle; +import android.os.Parcel; +import org.microg.gms.common.PublicApi; import org.microg.safeparcel.AutoSafeParcelable; import org.microg.safeparcel.SafeParceled; +import java.io.Closeable; import java.util.ArrayList; import java.util.Arrays; +import java.util.HashMap; import java.util.List; +import java.util.Map; /** * Class for accessing collections of data, organized into columns. This provides the backing * support for DataBuffer. Much like a cursor, the holder supports the notion of a current * position, and has methods for extracting various types of data from named columns. */ -public class DataHolder extends AutoSafeParcelable { +@PublicApi(until = "1") +public class DataHolder extends AutoSafeParcelable implements Closeable { @SafeParceled(1000) private int versionCode = 1; @SafeParceled(1) - public final String[] columns; + private final String[] columns; @SafeParceled(2) - public final CursorWindow[] windows; + private final CursorWindow[] windows; @SafeParceled(3) - public final int statusCode; + private final int statusCode; @SafeParceled(4) - public final Bundle metadata; + private final Bundle metadata; + + private boolean closed = false; + private Map columnIndizes; + + protected static final int FIELD_TYPE_NULL = 0; + protected static final int FIELD_TYPE_INTEGER = 1; + protected static final int FIELD_TYPE_FLOAT = 2; + protected static final int FIELD_TYPE_STRING = 3; + protected static final int FIELD_TYPE_BLOB = 4; private DataHolder() { columns = null; @@ -58,18 +76,81 @@ public class DataHolder extends AutoSafeParcelable { metadata = null; } + /** + * Creates a data holder with the specified data. + * + * @param columns The column names corresponding to the data in the given windows. + * @param windows The {@link CursorWindow} instances holding the data. + * @param statusCode The status code of this {@link DataHolder}. + * @param metadata The metadata associated with this {@link DataHolder} (may be null). + */ public DataHolder(String[] columns, CursorWindow[] windows, int statusCode, Bundle metadata) { this.columns = columns; this.windows = windows; this.statusCode = statusCode; this.metadata = metadata; + validateContents(); } - protected static final int FIELD_TYPE_BLOB = 4; - protected static final int FIELD_TYPE_FLOAT = 2; - protected static final int FIELD_TYPE_INTEGER = 1; - protected static final int FIELD_TYPE_NULL = 0; - protected static final int FIELD_TYPE_STRING = 3; + /** + * Creates a data holder wrapping the provided cursor, with provided status code and metadata. + * + * @param cursor The cursor containing the data. + * @param statusCode The status code of this {@link DataHolder}. + * @param metadata The metadata associated with this {@link DataHolder} (may be null). + */ + public DataHolder(AbstractWindowedCursor cursor, int statusCode, Bundle metadata) { + this(cursor.getColumnNames(), createCursorWindows(cursor), statusCode, metadata); + } + + /** + * Creates a data holder wrapping the provided cursor, with provided status code and metadata. + * + * @param cursor The cursor containing the data. + * @param statusCode The status code of this {@link DataHolder}. + * @param metadata The metadata associated with this {@link DataHolder} (may be null). + */ + public DataHolder(Cursor cursor, int statusCode, Bundle metadata) { + this(cursor.getColumnNames(), createCursorWindows(cursor), statusCode, metadata); + } + + /** + * Get a {@link DataHolder.Builder} to create a new {@link DataHolder} manually. + * + * @param columns The array of column names that the object supports. + * @param uniqueColumn The non-null column name that must contain unique values. New rows added to the builder with the same value in this column will replace any older rows. + * @return {@link DataHolder.Builder} object to work with. + */ + public static Builder builder(String[] columns, String uniqueColumn) { + return new Builder(columns, uniqueColumn); + } + + /** + * Get a {@link DataHolder.Builder} to create a new {@link DataHolder} manually. + * + * @param columns The array of column names that the object supports. + * @return {@link DataHolder.Builder} object to work with. + */ + public static Builder builder(String[] columns) { + return builder(columns, null); + } + + /** + * @param statusCode The status code of this {@link DataHolder}. + * @param metadata The metadata associated with this {@link DataHolder} (may be null). + * @return An empty {@link DataHolder} object with the given status and metadata. + */ + public static DataHolder empty(int statusCode, Bundle metadata) { + return new DataHolder(new String[0], new CursorWindow[0], statusCode, metadata); + } + + /** + * @param statusCode The status code of this {@link DataHolder}. + * @return An empty {@link DataHolder} object with the given status and null metadata. + */ + public static DataHolder empty(int statusCode) { + return empty(statusCode, null); + } @SuppressWarnings("deprecation") @SuppressLint("NewApi") @@ -98,46 +179,166 @@ public class DataHolder extends AutoSafeParcelable { throw new RuntimeException("Unsupported cursor on this platform!"); } - public static DataHolder fromCursor(Cursor cursor, int statusCode, Bundle metadata) { + /** + * Closes the data holder, releasing all of its resources and making it completely invalid. + */ + @Override + public void close() { + synchronized (this) { + if (!closed) { + closed = true; + for (CursorWindow window : windows) { + window.close(); + } + } + } + } + + /** + * Copies the String content in the given column at the provided position into a {@link CharArrayBuffer}. + * This will throw an {@link IllegalArgumentException} if the column does not exist, the + * position is invalid, or the data holder has been closed. + * + * @param column The column to retrieve. + * @param row The row to retrieve the data from. + * @param windowIndex Index of the cursor window to extract the data from. + * @param dataOut The {@link CharArrayBuffer} to copy into. + */ + public void copyToBuffer(String column, int row, int windowIndex, CharArrayBuffer dataOut) { + throw new RuntimeException("Not yet available"); + } + + @SuppressWarnings("deprecation") + private static CursorWindow[] createCursorWindows(Builder builder) { + if (builder.columns.length == 0) return new CursorWindow[0]; List windows = new ArrayList(); - CursorWindow cursorWindow = null; - int row = 0; + try { + CursorWindow current = null; + for (int rowIndex = 0; rowIndex < builder.rows.size(); rowIndex++) { + Map row = builder.rows.get(rowIndex); + if (current == null || !current.allocRow()) { + current = new CursorWindow(false); + current.setStartPosition(rowIndex); + current.setNumColumns(builder.columns.length); + windows.add(current); + if (!current.allocRow()) { + windows.remove(current); + return windows.toArray(new CursorWindow[windows.size()]); + } + } + for (int columnIndex = 0; columnIndex < builder.columns.length; columnIndex++) { + Object val = row.get(builder.columns[columnIndex]); + if (val == null) { + current.putNull(rowIndex, columnIndex); + } else if (val instanceof String) { + current.putString((String) val, rowIndex, columnIndex); + } else if (val instanceof Long) { + current.putLong((Long) val, rowIndex, columnIndex); + } else if (val instanceof Integer) { + current.putLong((Integer) val, rowIndex, columnIndex); + } else if (val instanceof Boolean) { + if ((Boolean) val) + current.putLong(1, rowIndex, columnIndex); + } else if (val instanceof byte[]) { + current.putBlob((byte[]) val, rowIndex, columnIndex); + } else if (val instanceof Double) { + current.putDouble((Double) val, rowIndex, columnIndex); + } else if (val instanceof Float) { + current.putDouble((Float) val, rowIndex, columnIndex); + } else { + throw new IllegalArgumentException("Unsupported object for column " + columnIndex + ": " + val); + } + } + } + } catch (RuntimeException e) { + for (CursorWindow window : windows) { + window.close(); + } + throw e; + } + return windows.toArray(new CursorWindow[windows.size()]); + } + + private static CursorWindow[] createCursorWindows(Cursor cursor) { + if (cursor.getColumnCount() == 0) return new CursorWindow[0]; + List windows = new ArrayList(); + CursorWindow current = null; + int rowIndex = 0; while (cursor.moveToNext()) { - if (cursorWindow == null || !cursorWindow.allocRow()) { - cursorWindow = new CursorWindow(false); - cursorWindow.setNumColumns(cursor.getColumnCount()); - windows.add(cursorWindow); - if (!cursorWindow.allocRow()) - throw new RuntimeException("Impossible to store Cursor in CursorWindows"); - row = 0; + if (current == null || !current.allocRow()) { + current = new CursorWindow(false); + current.setStartPosition(rowIndex); + current.setNumColumns(cursor.getColumnCount()); + windows.add(current); + if (!current.allocRow()) { + windows.remove(current); + return windows.toArray(new CursorWindow[windows.size()]); + } } for (int i = 0; i < cursor.getColumnCount(); i++) { switch (getCursorType(cursor, i)) { case FIELD_TYPE_NULL: - cursorWindow.putNull(row, i); + current.putNull(rowIndex, i); break; case FIELD_TYPE_BLOB: - cursorWindow.putBlob(cursor.getBlob(i), row, i); + current.putBlob(cursor.getBlob(i), rowIndex, i); break; case FIELD_TYPE_FLOAT: - cursorWindow.putDouble(cursor.getDouble(i), row, i); + current.putDouble(cursor.getDouble(i), rowIndex, i); break; case FIELD_TYPE_INTEGER: - cursorWindow.putLong(cursor.getLong(i), row, i); + current.putLong(cursor.getLong(i), rowIndex, i); break; case FIELD_TYPE_STRING: - cursorWindow.putString(cursor.getString(i), row, i); + current.putString(cursor.getString(i), rowIndex, i); break; } } - row++; + rowIndex++; } - DataHolder dataHolder = new DataHolder(cursor.getColumnNames(), windows.toArray(new CursorWindow[windows.size()]), statusCode, metadata); cursor.close(); - return dataHolder; + return windows.toArray(new CursorWindow[windows.size()]); } + @PublicApi(exclude = true) + @Deprecated + public static DataHolder fromCursor(Cursor cursor, int statusCode, Bundle metadata) { + return new DataHolder(cursor, statusCode, metadata); + } + /** + * Retrieves the boolean value for a given column at the provided position. + * This will throw an {@link IllegalArgumentException} if the column does not exist, the + * position is invalid, or the data holder has been closed. + * + * @param column The column to retrieve. + * @param row The row to retrieve the data from. + * @param windowIndex Index of the cursor window to extract the data from. + * @return The boolean value in that column. + */ + public boolean getBoolean(String column, int row, int windowIndex) { + return windows[windowIndex].getLong(row, columnIndizes.get(column)) == 1; + } + + /** + * Retrieves the byte array value for a given column at the provided position. + * This will throw an {@link IllegalArgumentException} if the column does not exist, the + * position is invalid, or the data holder has been closed. + * + * @param column The column to retrieve. + * @param row The row to retrieve the data from. + * @param windowIndex Index of the cursor window to extract the data from. + * @return The byte array value in that column. + */ + public byte[] getByteArray(String column, int row, int windowIndex) { + return windows[windowIndex].getBlob(row, columnIndizes.get(column)); + } + + /** + * Gets the number of rows in the data holder. + * + * @return the number of rows in the data holder. + */ public int getCount() { int c = 0; if (windows != null) { @@ -148,6 +349,88 @@ public class DataHolder extends AutoSafeParcelable { return c; } + /** + * Retrieves the integer value for a given column at the provided position. + * This will throw an {@link IllegalArgumentException} if the column does not exist, the + * position is invalid, or the data holder has been closed. + * + * @param column The column to retrieve. + * @param row The row to retrieve the data from. + * @param windowIndex Index of the cursor window to extract the data from. + * @return The integer value in that column. + */ + public int getInteger(String column, int row, int windowIndex) { + return windows[windowIndex].getInt(row, columnIndizes.get(column)); + } + + /** + * Retrieves the long value for a given column at the provided position. + * This will throw an {@link IllegalArgumentException} if the column does not exist, the + * position is invalid, or the data holder has been closed. + * + * @param column The column to retrieve. + * @param row The row to retrieve the data from. + * @param windowIndex Index of the cursor window to extract the data from. + * @return The long value in that column. + */ + public long getLong(String column, int row, int windowIndex) { + return windows[windowIndex].getLong(row, columnIndizes.get(column)); + } + + public int getStatusCode() { + return statusCode; + } + + /** + * Retrieves the string value for a given column at the provided position. + * This will throw an {@link IllegalArgumentException} if the column does not exist, the + * position is invalid, or the data holder has been closed. + * + * @param column The column to retrieve. + * @param row The row to retrieve the data from. + * @param windowIndex Index of the cursor window to extract the data from. + * @return The string value in that column. + */ + public String getString(String column, int row, int windowIndex) { + return windows[windowIndex].getString(row, columnIndizes.get(column)); + } + + /** + * Returns whether the given column at the provided position contains null. + * This will throw an {@link IllegalArgumentException} if the column does not exist, the + * position is invalid, or the data holder has been closed. + * + * @param column The column to retrieve. + * @param row The row to retrieve the data from. + * @param windowIndex Index of the cursor window to extract the data from. + * @return Whether the column value is null at this position. + */ + public boolean isNull(String column, int row, int windowIndex) { + return windows[windowIndex].isNull(row, columnIndizes.get(column)); + } + + public boolean isClosed() { + synchronized (this) { + return closed; + } + } + + /** + * Retrieves the column data at the provided position as a URI if possible, checking for null values. + * This will throw an {@link IllegalArgumentException} if the column does not exist, the + * position is invalid, or the data holder has been closed. + * + * @param column The column to retrieve. + * @param row The row to retrieve the data from. + * @param windowIndex Index of the cursor window to extract the data from. + * @return The column data as a URI, or null if not present. + */ + public Uri parseUri(String column, int row, int windowIndex) { + String string = getString(column, row, windowIndex); + if (string != null) return Uri.parse(string); + return null; + } + @Override public String toString() { return "DataHolder{" + @@ -158,5 +441,119 @@ public class DataHolder extends AutoSafeParcelable { '}'; } - public static final Creator CREATOR = new AutoCreator(DataHolder.class); + public void validateContents() { + columnIndizes = new HashMap(); + for (int i = 0; i < columns.length; i++) { + columnIndizes.put(columns[i], i); + } + } + + /** + * Helper class to build {@link DataHolder} instances containing arbitrary data. + *

+ * Note that the constructor is private; use DataHolder.builder() to create instances of this class. + */ + public static class Builder { + private final String[] columns; + private final ArrayList> rows; + private final String uniqueColumn; + private final Map uniqueIndizes; + + private Builder(String[] columns, String uniqueColumn) { + this.columns = columns; + this.rows = new ArrayList>(); + this.uniqueColumn = uniqueColumn; + this.uniqueIndizes = new HashMap(); + } + + /** + * Instantiate an {@link DataHolder} from this {@link DataHolder.Builder} with the given status code and metadata. + * + * @param statusCode The status code of this {@link DataHolder}. + * @param metadata The metadata associated with this {@link DataHolder} (may be null). + * @return {@link DataHolder} representation of this object. + */ + public DataHolder build(int statusCode, Bundle metadata) { + return new DataHolder(columns, createCursorWindows(this), statusCode, metadata); + } + + /** + * Instantiate an {@link DataHolder} from this {@link DataHolder.Builder} with the given status code and null metadata. + * + * @param statusCode The status code of this {@link DataHolder}. + * @return {@link DataHolder} representation of this object. + */ + public DataHolder build(int statusCode) { + return build(statusCode, null); + } + + /** + * @return The number of rows that the resulting DataHolder will contain. + */ + public int getCount() { + return rows.size(); + } + + /** + * Sort the rows in this builder based on the standard data type comparisons for the value in the provided column. + * Calling this multiple times with the same column will not change the sort order of the builder. + * Note that any data which is added after this call will not be sorted. + * + * @param sortColumn The column to sort the rows in this builder by. + * @return {@link DataHolder.Builder} to continue construction. + */ + public Builder sort(String sortColumn) { + throw new RuntimeException("Not yet implemented"); + } + + /** + * Add a new row of data to the {@link DataHolder} this {@link DataHolder.Builder} will create. Note that the data must contain an entry for all columns + *

+ * Currently the only supported value types that are supported are String, Long, and Boolean (Integer is also accepted and will be stored as a Long). + * + * @param values {@link ContentValues} containing row data. + * @return {@link DataHolder.Builder} to continue construction. + */ + public Builder withRow(ContentValues values) { + HashMap row = new HashMap(); + for (Map.Entry entry : values.valueSet()) { + row.put(entry.getKey(), entry.getValue()); + } + return withRow(row); + } + + /** + * Add a new row of data to the {@link DataHolder} this {@link DataHolder.Builder} will create. Note that the data must contain an entry for all columns + *

+ * Currently the only supported value types that are supported are String, Long, and Boolean (Integer is also accepted and will be stored as a Long). + * + * @param row Map containing row data. + * @return {@link DataHolder.Builder} to continue construction. + */ + public Builder withRow(HashMap row) { + if (uniqueColumn != null) { + Object val = row.get(uniqueColumn); + if (val != null) { + Integer old = uniqueIndizes.get(val); + if (old != null) { + rows.set(old, row); + return this; + } else { + uniqueIndizes.put(val, rows.size()); + } + } + } + rows.add(row); + return this; + } + } + + public static final Creator CREATOR = new AutoCreator(DataHolder.class) { + @Override + public DataHolder createFromParcel(Parcel parcel) { + DataHolder res = super.createFromParcel(parcel); + res.validateContents(); + return res; + } + }; } From d3efde305bd8a18b8024e640e549e8773c120ecb Mon Sep 17 00:00:00 2001 From: Marvin W Date: Sun, 31 Jul 2016 12:02:50 +0200 Subject: [PATCH 158/293] Add method to send rpc messages for wearables --- .../google/android/gms/wearable/internal/IWearableService.aidl | 1 + 1 file changed, 1 insertion(+) diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableService.aidl index 73cb02e7..854ab06d 100644 --- a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableService.aidl +++ b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableService.aidl @@ -12,6 +12,7 @@ interface IWearableService { void putData(IWearableCallbacks callbacks, in PutDataRequest request) = 5; void getDataItem(IWearableCallbacks callbacks, in Uri uri) = 6; void getDataItems(IWearableCallbacks callbacks) = 7; + void sendMessage(IWearableCallbacks callbacks, String targetNodeId, String path, in byte[] data) = 11; void getLocalNode(IWearableCallbacks callbacks) = 13; void getConnectedNodes(IWearableCallbacks callbacks) = 14; void addListener(IWearableCallbacks callbacks, in AddListenerRequest request) = 15; From 707b9de6cd6629c3fa2d697628a6d84b99345dc3 Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Sun, 31 Jul 2016 08:51:05 +0200 Subject: [PATCH 159/293] Add initial support for LocationAvailability --- .../IGoogleLocationManagerService.aidl | 2 +- .../gms/location/LocationAvailability.java | 27 +++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/internal/IGoogleLocationManagerService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/location/internal/IGoogleLocationManagerService.aidl index 40937c80..123a0952 100644 --- a/play-services-api/src/main/aidl/com/google/android/gms/location/internal/IGoogleLocationManagerService.aidl +++ b/play-services-api/src/main/aidl/com/google/android/gms/location/internal/IGoogleLocationManagerService.aidl @@ -61,7 +61,7 @@ interface IGoogleLocationManagerService { Location getLastLocationWithPackage(String packageName) = 20; void iglms26(in Location var1, int var2) = 25; - LocationAvailability iglms34(String var1) = 33; + LocationAvailability getLocationAvailabilityWithPackage(String packageName) = 33; IBinder iglms51() = 50; void requestLocationSettingsDialog(in LocationSettingsRequest settingsRequest, ISettingsCallbacks callback, String packageName) = 62; diff --git a/play-services-api/src/main/java/com/google/android/gms/location/LocationAvailability.java b/play-services-api/src/main/java/com/google/android/gms/location/LocationAvailability.java index 2cba0cf6..3ee22ef9 100644 --- a/play-services-api/src/main/java/com/google/android/gms/location/LocationAvailability.java +++ b/play-services-api/src/main/java/com/google/android/gms/location/LocationAvailability.java @@ -17,8 +17,35 @@ package com.google.android.gms.location; import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; public class LocationAvailability extends AutoSafeParcelable { + @SafeParceled(1000) + private int versionCode = 1; + + @SafeParceled(1) + private int cellStatus; + + @SafeParceled(2) + private int wifiStatus; + + @SafeParceled(3) + private long elapsedRealtimeNs; + + @SafeParceled(4) + private int locationStatus; + + private LocationAvailability(int cellStatus, int wifiStatus, int elapsedRealtimeNs, int locationStatus) { + this.cellStatus = cellStatus; + this.wifiStatus = wifiStatus; + this.elapsedRealtimeNs = elapsedRealtimeNs; + this.locationStatus = this.locationStatus; + } + + public static LocationAvailability create() { // TODO + return new LocationAvailability(0, 0, 0, 0); + } + public static final Creator CREATOR = new AutoCreator(LocationAvailability.class); } From cf2927f275c53099781dbf965acb7c7f8ed36e97 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Sun, 31 Jul 2016 13:00:23 +0200 Subject: [PATCH 160/293] complete implementation of LocationAvailability --- .../gms/location/LocationAvailability.java | 110 ++++++++++++++++-- 1 file changed, 98 insertions(+), 12 deletions(-) diff --git a/play-services-api/src/main/java/com/google/android/gms/location/LocationAvailability.java b/play-services-api/src/main/java/com/google/android/gms/location/LocationAvailability.java index 3ee22ef9..f2f70201 100644 --- a/play-services-api/src/main/java/com/google/android/gms/location/LocationAvailability.java +++ b/play-services-api/src/main/java/com/google/android/gms/location/LocationAvailability.java @@ -16,35 +16,121 @@ package com.google.android.gms.location; +import android.content.Intent; + +import org.microg.gms.common.PublicApi; import org.microg.safeparcel.AutoSafeParcelable; import org.microg.safeparcel.SafeParceled; +import java.util.Arrays; + +/** + * Status on the availability of location data. + *

+ * Delivered from {@link LocationCallback} registered via {@link FusedLocationProviderApi#requestLocationUpdates(com.google.android.gms.common.api.GoogleApiClient, LocationRequest, LocationCallback, android.os.Looper) + * or from a PendingIntent registered via {@link FusedLocationProviderApi#requestLocationUpdates(com.google.android.gms.common.api.GoogleApiClient, LocationRequest, android.app.PendingIntent)}. + * It is also available on demand via {@link FusedLocationProviderApi#getLocationAvailability(com.google.android.gms.common.api.GoogleApiClient)}. + */ +@PublicApi public class LocationAvailability extends AutoSafeParcelable { + private static final String EXTRA_KEY = "com.google.android.gms.location.EXTRA_LOCATION_AVAILABILITY"; + + @PublicApi(exclude = true) + public static final int STATUS_SUCCESSFUL = 0; + @PublicApi(exclude = true) + public static final int STATUS_UNKNOWN = 1; + @PublicApi(exclude = true) + public static final int STATUS_TIMED_OUT_ON_SCAN = 2; + @PublicApi(exclude = true) + public static final int STATUS_NO_INFO_IN_DATABASE = 3; + @PublicApi(exclude = true) + public static final int STATUS_INVALID_SCAN = 4; + @PublicApi(exclude = true) + public static final int STATUS_UNABLE_TO_QUERY_DATABASE = 5; + @PublicApi(exclude = true) + public static final int STATUS_SCANS_DISABLED_IN_SETTINGS = 6; + @PublicApi(exclude = true) + public static final int STATUS_LOCATION_DISABLED_IN_SETTINGS = 7; + @PublicApi(exclude = true) + public static final int STATUS_IN_PROGRESS = 8; @SafeParceled(1000) - private int versionCode = 1; + private int versionCode = 2; @SafeParceled(1) - private int cellStatus; + @PublicApi(exclude = true) + public int cellStatus; @SafeParceled(2) - private int wifiStatus; + @PublicApi(exclude = true) + public int wifiStatus; @SafeParceled(3) - private long elapsedRealtimeNs; + @PublicApi(exclude = true) + public long elapsedRealtimeNs; @SafeParceled(4) - private int locationStatus; + @PublicApi(exclude = true) + public int locationStatus; - private LocationAvailability(int cellStatus, int wifiStatus, int elapsedRealtimeNs, int locationStatus) { - this.cellStatus = cellStatus; - this.wifiStatus = wifiStatus; - this.elapsedRealtimeNs = elapsedRealtimeNs; - this.locationStatus = this.locationStatus; + @PublicApi(exclude = true) + public LocationAvailability() { } - public static LocationAvailability create() { // TODO - return new LocationAvailability(0, 0, 0, 0); + @Override + public boolean equals(Object o) { + if (o instanceof LocationAvailability) { + LocationAvailability other = (LocationAvailability) o; + return other.cellStatus == cellStatus && other.wifiStatus == wifiStatus && other.elapsedRealtimeNs == elapsedRealtimeNs && other.locationStatus == locationStatus; + } + return false; + } + + /** + * Extracts the {@link LocationAvailability} from an Intent. + *

+ * This is a utility function which extracts the {@link LocationAvailability} from the extras + * of an Intent that was sent in response to a location request. + * + * @return a {@link LocationAvailability}, or null if the Intent doesn't contain this data. + */ + public static LocationAvailability extractLocationAvailability(Intent intent) { + if (!hasLocationAvailability(intent)) { + return null; + } + return intent.getParcelableExtra(EXTRA_KEY); + } + + /** + * Returns true if an Intent contains a {@link LocationAvailability}. + *

+ * This is a utility function that can be called from inside an intent receiver to make sure the + * received intent contains location availability data. + * + * @return true if the intent contains a {@link LocationAvailability}, false otherwise. + */ + public static boolean hasLocationAvailability(Intent intent) { + return intent != null && intent.hasExtra(EXTRA_KEY); + } + + @Override + public int hashCode() { + return Arrays.hashCode(new Object[]{locationStatus, cellStatus, wifiStatus, elapsedRealtimeNs}); + } + + /** + * Returns true if the device location is known and reasonably up to date within the hints + * requested by the active {@link LocationRequest}s. Failure to determine location may result + * from a number of causes including disabled location settings or an inability to retrieve + * sensor data in the device's environment. + */ + public boolean isLocationAvailable() { + return locationStatus < 1000; + } + + @Override + public String toString() { + return "LocationAvailability[isLocationAvailable: " + isLocationAvailable() + "]"; } public static final Creator CREATOR = new AutoCreator(LocationAvailability.class); From 417ec2585f085c5a599e45aa9ee3b3df6239c628 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Thu, 4 Aug 2016 08:49:27 +0200 Subject: [PATCH 161/293] Update wearable APIs --- .../google/android/gms/wearable/Asset.aidl | 3 + .../internal/GetCloudSyncSettingResponse.aidl | 3 + .../internal/IChannelStreamCallbacks.aidl | 4 + .../wearable/internal/IWearableCallbacks.aidl | 5 +- .../wearable/internal/IWearableService.aidl | 82 +++++++++++++++---- .../com/google/android/gms/wearable/Node.java | 5 ++ .../internal/GetCloudSyncSettingResponse.java | 38 +++++++++ .../internal/GetFdForAssetResponse.java | 20 +++++ .../gms/wearable/internal/NodeParcelable.java | 37 ++++++--- .../internal/SendMessageResponse.java | 11 +++ 10 files changed, 182 insertions(+), 26 deletions(-) create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/wearable/Asset.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/GetCloudSyncSettingResponse.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/IChannelStreamCallbacks.aidl create mode 100644 play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetCloudSyncSettingResponse.java diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/Asset.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/Asset.aidl new file mode 100644 index 00000000..9cb94923 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/wearable/Asset.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.wearable; + +parcelable Asset; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/GetCloudSyncSettingResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/GetCloudSyncSettingResponse.aidl new file mode 100644 index 00000000..3ac2cc1c --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/GetCloudSyncSettingResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.wearable.internal; + +parcelable GetCloudSyncSettingResponse; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/IChannelStreamCallbacks.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/IChannelStreamCallbacks.aidl new file mode 100644 index 00000000..1f08e373 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/IChannelStreamCallbacks.aidl @@ -0,0 +1,4 @@ +package com.google.android.gms.wearable.internal; + +interface IChannelStreamCallbacks { +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableCallbacks.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableCallbacks.aidl index 6af80335..a41f6e5b 100644 --- a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableCallbacks.aidl +++ b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableCallbacks.aidl @@ -3,6 +3,7 @@ package com.google.android.gms.wearable.internal; import com.google.android.gms.common.api.Status; import com.google.android.gms.common.data.DataHolder; import com.google.android.gms.wearable.internal.DeleteDataItemsResponse; +import com.google.android.gms.wearable.internal.GetCloudSyncSettingResponse; import com.google.android.gms.wearable.internal.GetConfigResponse; import com.google.android.gms.wearable.internal.GetConfigsResponse; import com.google.android.gms.wearable.internal.GetConnectedNodesResponse; @@ -17,7 +18,7 @@ interface IWearableCallbacks { void onGetConfigResponse(in GetConfigResponse response) = 1; void onPutDataResponse(in PutDataResponse response) = 2; void onGetDataItemResponse(in GetDataItemResponse response) = 3; - void onDataHolder(in DataHolder dataHolder) = 4; + void onDataItemChanged(in DataHolder dataHolder) = 4; void onDeleteDataItemsResponse(in DeleteDataItemsResponse response) = 5; void onSendMessageResponse(in SendMessageResponse response) = 6; void onGetFdForAssetResponse(in GetFdForAssetResponse response) = 7; @@ -26,4 +27,6 @@ interface IWearableCallbacks { void onStatus(in Status status) = 10; void onStorageInfoResponse(in StorageInfoResponse response) = 11; void onGetConfigsResponse(in GetConfigsResponse response) = 12; + + void onGetCloudSyncSettingResponse(in GetCloudSyncSettingResponse response) = 28; } diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableService.aidl index 854ab06d..4b0acb5f 100644 --- a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableService.aidl +++ b/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableService.aidl @@ -1,28 +1,82 @@ package com.google.android.gms.wearable.internal; -import com.google.android.gms.wearable.internal.AddListenerRequest; +import com.google.android.gms.wearable.Asset; import com.google.android.gms.wearable.ConnectionConfiguration; +import com.google.android.gms.wearable.internal.AddListenerRequest; +import com.google.android.gms.wearable.internal.AncsNotificationParcelable; import com.google.android.gms.wearable.internal.PutDataRequest; import com.google.android.gms.wearable.internal.RemoveListenerRequest; +import com.google.android.gms.wearable.internal.IChannelStreamCallbacks; import com.google.android.gms.wearable.internal.IWearableCallbacks; import com.google.android.gms.wearable.internal.IWearableService; interface IWearableService { - void getConfig(IWearableCallbacks callbacks) = 2; - void putData(IWearableCallbacks callbacks, in PutDataRequest request) = 5; - void getDataItem(IWearableCallbacks callbacks, in Uri uri) = 6; - void getDataItems(IWearableCallbacks callbacks) = 7; - void sendMessage(IWearableCallbacks callbacks, String targetNodeId, String path, in byte[] data) = 11; - void getLocalNode(IWearableCallbacks callbacks) = 13; - void getConnectedNodes(IWearableCallbacks callbacks) = 14; - void addListener(IWearableCallbacks callbacks, in AddListenerRequest request) = 15; - void removeListener(IWearableCallbacks callbacks, in RemoveListenerRequest request) = 16; + // Configs void putConfig(IWearableCallbacks callbacks, in ConnectionConfiguration config) = 19; void deleteConfig(IWearableCallbacks callbacks, String name) = 20; void getConfigs(IWearableCallbacks callbacks) = 21; - void enableConnection(IWearableCallbacks callbacks, String name) = 22; - void disableConnection(IWearableCallbacks callbacks, String name) = 23; - void getDataItemsByUri(IWearableCallbacks callbacks, in Uri uri, int i) = 39; - void deleteDataItems(IWearableCallbacks callbacks, in Uri uri) = 40; + void enableConfig(IWearableCallbacks callbacks, String name) = 22; + void disableConfig(IWearableCallbacks callbacks, String name) = 23; + + // DataItems + void putData(IWearableCallbacks callbacks, in PutDataRequest request) = 5; + void getDataItem(IWearableCallbacks callbacks, in Uri uri) = 6; + void getDataItems(IWearableCallbacks callbacks) = 7; + void getDataItemsByUri(IWearableCallbacks callbacks, in Uri uri) = 8; + void getDataItemsByUriWithFilter(IWearableCallbacks callbacks, in Uri uri, int typeFilter) = 39; + void deleteDataItems(IWearableCallbacks callbacks, in Uri uri) = 10; + void deleteDataItemsWithFilter(IWearableCallbacks callbacks, in Uri uri, int typeFilter) = 40; + + void sendMessage(IWearableCallbacks callbacks, String targetNodeId, String path, in byte[] data) = 11; + void getFdForAsset(IWearableCallbacks callbacks, in Asset asset) = 12; + + void getLocalNode(IWearableCallbacks callbacks) = 13; + void getConnectedNodes(IWearableCallbacks callbacks) = 14; + + // Capabilties + void getConnectedCapability(IWearableCallbacks callbacks, String s1, int i) = 41; + void getConnectedCapaibilties(IWearableCallbacks callbacks, int i) = 42; + void addLocalCapability(IWearableCallbacks callbacks, String cap) = 45; + void removeLocalCapability(IWearableCallbacks callbacks, String cap) = 46; + + void addListener(IWearableCallbacks callbacks, in AddListenerRequest request) = 15; + void removeListener(IWearableCallbacks callbacks, in RemoveListenerRequest request) = 16; + + void getStrorageInformation(IWearableCallbacks callbacks) = 17; + void clearStorage(IWearableCallbacks callbacks) = 18; + + void endCall(IWearableCallbacks callbacks) = 24; + void acceptRingingCall(IWearableCallbacks callbacks) = 25; + void silenceRinger(IWearableCallbacks callbacks) = 29; + + // Apple Notification Center Service + void injectAncsNotificationForTesting(IWearableCallbacks callbacks, in AncsNotificationParcelable notification) = 26; + void doAncsPositiveAction(IWearableCallbacks callbacks, int i) = 27; + void doAncsNegativeAction(IWearableCallbacks callbacks, int i) = 28; + + // Channels + void openChannel(IWearableCallbacks callbacks, String s1, String s2) = 30; + void closeChannel(IWearableCallbacks callbacks, String s) = 31; + void closeChannelWithError(IWearableCallbacks callbacks, String s, int errorCode) = 32; + void getChannelInputStream(IWearableCallbacks callbacks, IChannelStreamCallbacks channelCallbacks, String s) = 33; + void getChannelOutputStream(IWearableCallbacks callbacks, IChannelStreamCallbacks channelCallbacks, String s) = 34; + void writeChannelInputToFd(IWearableCallbacks callbacks, String s, in ParcelFileDescriptor fd) = 37; + void readChannelOutputFromFd(IWearableCallbacks callbacks, String s, in ParcelFileDescriptor fd, long l1, long l2) = 38; + + void syncWifiCredentials(IWearableCallbacks callbacks) = 36; + + // Cloud Sync void optInCloudSync(IWearableCallbacks callbacks, boolean enable) = 47; + void getCloudSyncOptInDone(IWearableCallbacks callbacks) = 48; // deprecated + void setCloudSyncSetting(IWearableCallbacks callbacks, boolean enable) = 49; + void getCloudSyncSetting(IWearableCallbacks callbacks) = 50; + void getCloudSyncOptInStatus(IWearableCallbacks callbacks) = 51; + + void sendRemoteCommand(IWearableCallbacks callbacks, byte b) = 52; + + // deprecated Connection + void putConnection(IWearableCallbacks callbacks, in ConnectionConfiguration config) = 1; + void getConnection(IWearableCallbacks callbacks) = 2; + void enableConnection(IWearableCallbacks callbacks) = 3; + void disableConnection(IWearableCallbacks callbacks) = 4; } diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/Node.java b/play-services-api/src/main/java/com/google/android/gms/wearable/Node.java index 00ed1a47..7300184a 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wearable/Node.java +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/Node.java @@ -33,4 +33,9 @@ public interface Node { * Returns an opaque string that represents a node in the Android Wear network. */ String getId(); + + /** + * Indicates that this node can be considered geographically nearby the local node. + */ + boolean isNearby(); } diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetCloudSyncSettingResponse.java b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetCloudSyncSettingResponse.java new file mode 100644 index 00000000..fc0ae42c --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetCloudSyncSettingResponse.java @@ -0,0 +1,38 @@ +/* + * Copyright 2013-2016 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.internal; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class GetCloudSyncSettingResponse extends AutoSafeParcelable { + @SafeParceled(1) + private int versionCode = 1; + @SafeParceled(2) + public int statusCode; + @SafeParceled(3) + public boolean cloudSyncEnabled; + + private GetCloudSyncSettingResponse() {} + + public GetCloudSyncSettingResponse(int statusCode, boolean cloudSyncEnabled) { + this.statusCode = statusCode; + this.cloudSyncEnabled = cloudSyncEnabled; + } + + public static final Creator CREATOR = new AutoCreator(GetCloudSyncSettingResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetFdForAssetResponse.java b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetFdForAssetResponse.java index 4b75d203..a0930b6a 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetFdForAssetResponse.java +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetFdForAssetResponse.java @@ -16,8 +16,28 @@ package com.google.android.gms.wearable.internal; +import android.os.ParcelFileDescriptor; + import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; public class GetFdForAssetResponse extends AutoSafeParcelable { + @SafeParceled(1) + private int versionCode = 1; + + @SafeParceled(2) + public int statusCode; + + @SafeParceled(3) + public ParcelFileDescriptor pfd; + + private GetFdForAssetResponse() { + } + + public GetFdForAssetResponse(int statusCode, ParcelFileDescriptor pfd) { + this.statusCode = statusCode; + this.pfd = pfd; + } + public static final Creator CREATOR = new AutoCreator(GetFdForAssetResponse.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/NodeParcelable.java b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/NodeParcelable.java index ebaa5cdb..aae4d786 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/NodeParcelable.java +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/NodeParcelable.java @@ -28,22 +28,33 @@ public class NodeParcelable extends AutoSafeParcelable implements Node { @SafeParceled(1) private int versionCode = 1; @SafeParceled(2) - private final String id; + private final String nodeId; @SafeParceled(3) private final String displayName; + @SafeParceled(4) + private final int hops; + @SafeParceled(5) + private final boolean isNearby; private NodeParcelable() { - id = displayName = null; + nodeId = displayName = null; + hops = 0; + isNearby = false; } - public NodeParcelable(String id, String displayName) { - this.id = id; + public NodeParcelable(String nodeId, String displayName, int hops, boolean isNearby) { + this.nodeId = nodeId; this.displayName = displayName; + this.hops = hops; + this.isNearby = isNearby; + } + + public NodeParcelable(String nodeId, String displayName) { + this(nodeId, displayName, 0, false); } public NodeParcelable(Node node) { - this.id = node.getId(); - this.displayName = node.getDisplayName(); + this(node.getId(), node.getDisplayName(), 0, node.isNearby()); } @Override @@ -53,7 +64,7 @@ public class NodeParcelable extends AutoSafeParcelable implements Node { NodeParcelable that = (NodeParcelable) o; - if (!id.equals(that.id)) return false; + if (!nodeId.equals(that.nodeId)) return false; if (!displayName.equals(that.displayName)) return false; return true; @@ -66,18 +77,22 @@ public class NodeParcelable extends AutoSafeParcelable implements Node { @Override public String getId() { - return id; + return nodeId; + } + + @Override + public boolean isNearby() { + return isNearby; } @Override public int hashCode() { - int result = 37 * 17 + id.hashCode(); - return 37 * result + displayName.hashCode(); + return nodeId.hashCode(); } @Override public String toString() { - return "NodeParcelable{" + id + "," + displayName + "}"; + return "NodeParcelable{" + displayName + ", id=" + displayName + ", hops=" + hops + ", isNearby=" + isNearby + "}"; } public static final Creator CREATOR = new AutoCreator(NodeParcelable.class); diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/SendMessageResponse.java b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/SendMessageResponse.java index f54fd04f..d3a0b7fb 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/SendMessageResponse.java +++ b/play-services-api/src/main/java/com/google/android/gms/wearable/internal/SendMessageResponse.java @@ -17,7 +17,18 @@ package com.google.android.gms.wearable.internal; import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; public class SendMessageResponse extends AutoSafeParcelable { + + @SafeParceled(1) + private int versionCode = 1; + + @SafeParceled(2) + public int statusCode; + + @SafeParceled(3) + public int resultId = -1; + public static final Creator CREATOR = new AutoCreator(SendMessageResponse.class); } From 3d8fee7fabcd9e7c5c46f3f1f44da6cf4db89a70 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Thu, 4 Aug 2016 21:45:00 +0200 Subject: [PATCH 162/293] First split of Api classes --- play-services-api/build.gradle | 5 +- .../android/gms/gcm/PendingCallback.java | 59 ------------------ play-services-cast-api/build.gradle | 55 +++++++++++++++++ .../src/main/AndroidManifest.xml | 24 ++++++++ .../android/gms/cast/ApplicationMetadata.java | 0 .../google/android/gms/cast/CastDevice.java | 0 .../gms/cast/CastMediaControlIntent.java | 0 .../android/gms/cast/CastStatusCodes.java | 0 .../android/gms/cast/LaunchOptions.java | 0 play-services-common-api/build.gradle | 60 +++++++++++++++++++ .../src/main/AndroidManifest.xml | 24 ++++++++ .../google/android/gms/common/api/Status.aidl | 0 .../android/gms/common/data/DataHolder.aidl | 0 .../common/internal/GetServiceRequest.aidl | 0 .../gms/common/internal/ICancelToken.aidl | 0 .../gms/common/internal/IGmsCallbacks.aidl | 0 .../common/internal/IGmsServiceBroker.aidl | 0 .../common/internal/ISignInButtonCreator.aidl | 0 .../internal/ValidateAccountRequest.aidl | 0 .../common/server/FavaDiagnosticsEntity.aidl | 0 .../android/gms/dynamic/IObjectWrapper.aidl | 0 .../com/google/android/gms/common/Scopes.java | 0 .../android/gms/common/api/AccountInfo.java | 0 .../gms/common/api/CommonStatusCodes.java | 0 .../google/android/gms/common/api/Result.java | 0 .../google/android/gms/common/api/Scope.java | 0 .../google/android/gms/common/api/Status.java | 0 .../android/gms/common/data/DataHolder.java | 0 .../android/gms/common/data/Freezable.java | 0 .../android/gms/common/images/WebImage.java | 0 .../gms/common/internal/BinderWrapper.java | 0 .../common/internal/GetServiceRequest.java | 0 .../internal/ValidateAccountRequest.java | 0 .../common/server/FavaDiagnosticsEntity.java | 0 .../android/gms/dynamic/ObjectWrapper.java | 0 .../org/microg/gms/auth/AuthConstants.java | 0 .../java/org/microg/gms/common/Constants.java | 0 .../org/microg/gms/common/GmsService.java | 0 .../java/org/microg/gms/common/PublicApi.java | 0 play-services-location-api/build.gradle | 55 +++++++++++++++++ .../src/main/AndroidManifest.xml | 24 ++++++++ .../location/ActivityRecognitionResult.aidl | 0 .../google/android/gms/location/Geofence.aidl | 0 .../gms/location/GeofencingRequest.aidl | 0 .../android/gms/location/GestureRequest.aidl | 0 .../gms/location/ILocationCallback.aidl | 0 .../gms/location/ILocationListener.aidl | 0 .../gms/location/LocationAvailability.aidl | 0 .../android/gms/location/LocationRequest.aidl | 0 .../android/gms/location/LocationResult.aidl | 0 .../gms/location/LocationSettingsRequest.aidl | 0 .../gms/location/LocationSettingsResult.aidl | 0 .../android/gms/location/LocationStatus.aidl | 0 .../internal/FusedLocationProviderResult.aidl | 0 .../IFusedLocationProviderCallback.aidl | 0 .../internal/IGeofencerCallbacks.aidl | 0 .../IGoogleLocationManagerService.aidl | 0 .../location/internal/ISettingsCallbacks.aidl | 0 .../internal/LocationRequestInternal.aidl | 0 .../internal/LocationRequestUpdateData.aidl | 0 .../location/places/AutocompleteFilter.aidl | 0 .../location/places/NearbyAlertRequest.aidl | 0 .../gms/location/places/PlaceFilter.aidl | 0 .../gms/location/places/PlaceReport.aidl | 0 .../gms/location/places/PlaceRequest.aidl | 0 .../gms/location/places/UserAddedPlace.aidl | 0 .../gms/location/places/UserDataType.aidl | 0 .../places/internal/IPlacesCallbacks.aidl | 0 .../places/internal/PlacesParams.aidl | 0 .../location/reporting/ReportingState.aidl | 0 .../gms/location/reporting/UploadRequest.aidl | 0 .../reporting/UploadRequestResult.aidl | 0 .../reporting/internal/IReportingService.aidl | 0 .../google/android/gms/maps/model/LatLng.aidl | 0 .../android/gms/maps/model/LatLngBounds.aidl | 0 .../location/ActivityRecognitionResult.java | 0 .../google/android/gms/location/Geofence.java | 0 .../gms/location/GeofencingRequest.java | 0 .../android/gms/location/GestureRequest.java | 0 .../gms/location/LocationAvailability.java | 0 .../android/gms/location/LocationRequest.java | 0 .../android/gms/location/LocationResult.java | 0 .../gms/location/LocationSettingsRequest.java | 0 .../gms/location/LocationSettingsResult.java | 0 .../gms/location/LocationSettingsStates.java | 0 .../android/gms/location/LocationStatus.java | 0 .../gms/location/internal/ClientIdentity.java | 0 .../internal/FusedLocationProviderResult.java | 0 .../internal/LocationRequestInternal.java | 0 .../internal/LocationRequestUpdateData.java | 0 .../location/places/AutocompleteFilter.java | 0 .../location/places/NearbyAlertRequest.java | 0 .../android/gms/location/places/Place.java | 0 .../gms/location/places/PlaceFilter.java | 0 .../gms/location/places/PlaceReport.java | 0 .../gms/location/places/PlaceRequest.java | 0 .../gms/location/places/UserAddedPlace.java | 0 .../gms/location/places/UserDataType.java | 0 .../location/places/internal/PlaceImpl.java | 0 .../places/internal/PlacesParams.java | 0 .../location/reporting/ReportingState.java | 0 .../gms/location/reporting/UploadRequest.java | 0 .../reporting/UploadRequestResult.java | 0 .../google/android/gms/maps/model/LatLng.java | 0 .../android/gms/maps/model/LatLngBounds.java | 0 .../gms/location/LocationConstants.java | 0 play-services-wearable-api/build.gradle | 55 +++++++++++++++++ .../src/main/AndroidManifest.xml | 24 ++++++++ .../google/android/gms/wearable/Asset.aidl | 0 .../gms/wearable/ConnectionConfiguration.aidl | 0 .../wearable/internal/AddListenerRequest.aidl | 0 .../internal/AmsEntityUpdateParcelable.aidl | 0 .../internal/AncsNotificationParcelable.aidl | 0 .../internal/CapabilityInfoParcelable.aidl | 0 .../internal/ChannelEventParcelable.aidl | 0 .../internal/DeleteDataItemsResponse.aidl | 0 .../internal/GetCloudSyncSettingResponse.aidl | 0 .../wearable/internal/GetConfigResponse.aidl | 0 .../wearable/internal/GetConfigsResponse.aidl | 0 .../internal/GetConnectedNodesResponse.aidl | 0 .../internal/GetDataItemResponse.aidl | 0 .../internal/GetFdForAssetResponse.aidl | 0 .../internal/GetLocalNodeResponse.aidl | 0 .../internal/IChannelStreamCallbacks.aidl | 0 .../wearable/internal/IWearableCallbacks.aidl | 0 .../wearable/internal/IWearableListener.aidl | 0 .../wearable/internal/IWearableService.aidl | 0 .../internal/MessageEventParcelable.aidl | 0 .../gms/wearable/internal/NodeParcelable.aidl | 0 .../gms/wearable/internal/PutDataRequest.aidl | 0 .../wearable/internal/PutDataResponse.aidl | 0 .../internal/RemoveListenerRequest.aidl | 0 .../internal/SendMessageResponse.aidl | 0 .../internal/StorageInfoResponse.aidl | 0 .../google/android/gms/wearable/Asset.java | 0 .../gms/wearable/ConnectionConfiguration.java | 0 .../google/android/gms/wearable/DataItem.java | 0 .../android/gms/wearable/DataItemAsset.java | 0 .../android/gms/wearable/MessageEvent.java | 0 .../com/google/android/gms/wearable/Node.java | 0 .../gms/wearable/WearableStatusCodes.java | 0 .../wearable/internal/AddListenerRequest.java | 0 .../internal/AmsEntityUpdateParcelable.java | 0 .../internal/AncsNotificationParcelable.java | 0 .../internal/CapabilityInfoParcelable.java | 0 .../internal/ChannelEventParcelable.java | 0 .../internal/DataItemAssetParcelable.java | 0 .../wearable/internal/DataItemParcelable.java | 0 .../internal/DeleteDataItemsResponse.java | 0 .../internal/GetCloudSyncSettingResponse.java | 0 .../wearable/internal/GetConfigResponse.java | 0 .../wearable/internal/GetConfigsResponse.java | 0 .../internal/GetConnectedNodesResponse.java | 0 .../internal/GetDataItemResponse.java | 0 .../internal/GetFdForAssetResponse.java | 0 .../internal/GetLocalNodeResponse.java | 0 .../internal/MessageEventParcelable.java | 0 .../gms/wearable/internal/NodeParcelable.java | 0 .../gms/wearable/internal/PutDataRequest.java | 0 .../wearable/internal/PutDataResponse.java | 0 .../internal/RemoveListenerRequest.java | 0 .../internal/SendMessageResponse.java | 0 .../internal/StorageInfoResponse.java | 0 settings.gradle | 4 ++ 164 files changed, 329 insertions(+), 60 deletions(-) delete mode 100644 play-services-api/src/main/java/com/google/android/gms/gcm/PendingCallback.java create mode 100644 play-services-cast-api/build.gradle create mode 100644 play-services-cast-api/src/main/AndroidManifest.xml rename {play-services-api => play-services-cast-api}/src/main/java/com/google/android/gms/cast/ApplicationMetadata.java (100%) rename {play-services-api => play-services-cast-api}/src/main/java/com/google/android/gms/cast/CastDevice.java (100%) rename {play-services-api => play-services-cast-api}/src/main/java/com/google/android/gms/cast/CastMediaControlIntent.java (100%) rename {play-services-api => play-services-cast-api}/src/main/java/com/google/android/gms/cast/CastStatusCodes.java (100%) rename {play-services-api => play-services-cast-api}/src/main/java/com/google/android/gms/cast/LaunchOptions.java (100%) create mode 100644 play-services-common-api/build.gradle create mode 100644 play-services-common-api/src/main/AndroidManifest.xml rename {play-services-api => play-services-common-api}/src/main/aidl/com/google/android/gms/common/api/Status.aidl (100%) rename {play-services-api => play-services-common-api}/src/main/aidl/com/google/android/gms/common/data/DataHolder.aidl (100%) rename {play-services-api => play-services-common-api}/src/main/aidl/com/google/android/gms/common/internal/GetServiceRequest.aidl (100%) rename {play-services-api => play-services-common-api}/src/main/aidl/com/google/android/gms/common/internal/ICancelToken.aidl (100%) rename {play-services-api => play-services-common-api}/src/main/aidl/com/google/android/gms/common/internal/IGmsCallbacks.aidl (100%) rename {play-services-api => play-services-common-api}/src/main/aidl/com/google/android/gms/common/internal/IGmsServiceBroker.aidl (100%) rename {play-services-api => play-services-common-api}/src/main/aidl/com/google/android/gms/common/internal/ISignInButtonCreator.aidl (100%) rename {play-services-api => play-services-common-api}/src/main/aidl/com/google/android/gms/common/internal/ValidateAccountRequest.aidl (100%) rename {play-services-api => play-services-common-api}/src/main/aidl/com/google/android/gms/common/server/FavaDiagnosticsEntity.aidl (100%) rename {play-services-api => play-services-common-api}/src/main/aidl/com/google/android/gms/dynamic/IObjectWrapper.aidl (100%) rename {play-services-api => play-services-common-api}/src/main/java/com/google/android/gms/common/Scopes.java (100%) rename {play-services-api => play-services-common-api}/src/main/java/com/google/android/gms/common/api/AccountInfo.java (100%) rename {play-services-api => play-services-common-api}/src/main/java/com/google/android/gms/common/api/CommonStatusCodes.java (100%) rename {play-services-api => play-services-common-api}/src/main/java/com/google/android/gms/common/api/Result.java (100%) rename {play-services-api => play-services-common-api}/src/main/java/com/google/android/gms/common/api/Scope.java (100%) rename {play-services-api => play-services-common-api}/src/main/java/com/google/android/gms/common/api/Status.java (100%) rename {play-services-api => play-services-common-api}/src/main/java/com/google/android/gms/common/data/DataHolder.java (100%) rename {play-services-api => play-services-common-api}/src/main/java/com/google/android/gms/common/data/Freezable.java (100%) rename {play-services-api => play-services-common-api}/src/main/java/com/google/android/gms/common/images/WebImage.java (100%) rename {play-services-api => play-services-common-api}/src/main/java/com/google/android/gms/common/internal/BinderWrapper.java (100%) rename {play-services-api => play-services-common-api}/src/main/java/com/google/android/gms/common/internal/GetServiceRequest.java (100%) rename {play-services-api => play-services-common-api}/src/main/java/com/google/android/gms/common/internal/ValidateAccountRequest.java (100%) rename {play-services-api => play-services-common-api}/src/main/java/com/google/android/gms/common/server/FavaDiagnosticsEntity.java (100%) rename {play-services-api => play-services-common-api}/src/main/java/com/google/android/gms/dynamic/ObjectWrapper.java (100%) rename {play-services-api => play-services-common-api}/src/main/java/org/microg/gms/auth/AuthConstants.java (100%) rename {play-services-api => play-services-common-api}/src/main/java/org/microg/gms/common/Constants.java (100%) rename {play-services-api => play-services-common-api}/src/main/java/org/microg/gms/common/GmsService.java (100%) rename {play-services-api => play-services-common-api}/src/main/java/org/microg/gms/common/PublicApi.java (100%) create mode 100644 play-services-location-api/build.gradle create mode 100644 play-services-location-api/src/main/AndroidManifest.xml rename {play-services-api => play-services-location-api}/src/main/aidl/com/google/android/gms/location/ActivityRecognitionResult.aidl (100%) rename {play-services-api => play-services-location-api}/src/main/aidl/com/google/android/gms/location/Geofence.aidl (100%) rename {play-services-api => play-services-location-api}/src/main/aidl/com/google/android/gms/location/GeofencingRequest.aidl (100%) rename {play-services-api => play-services-location-api}/src/main/aidl/com/google/android/gms/location/GestureRequest.aidl (100%) rename {play-services-api => play-services-location-api}/src/main/aidl/com/google/android/gms/location/ILocationCallback.aidl (100%) rename {play-services-api => play-services-location-api}/src/main/aidl/com/google/android/gms/location/ILocationListener.aidl (100%) rename {play-services-api => play-services-location-api}/src/main/aidl/com/google/android/gms/location/LocationAvailability.aidl (100%) rename {play-services-api => play-services-location-api}/src/main/aidl/com/google/android/gms/location/LocationRequest.aidl (100%) rename {play-services-api => play-services-location-api}/src/main/aidl/com/google/android/gms/location/LocationResult.aidl (100%) rename {play-services-api => play-services-location-api}/src/main/aidl/com/google/android/gms/location/LocationSettingsRequest.aidl (100%) rename {play-services-api => play-services-location-api}/src/main/aidl/com/google/android/gms/location/LocationSettingsResult.aidl (100%) rename {play-services-api => play-services-location-api}/src/main/aidl/com/google/android/gms/location/LocationStatus.aidl (100%) rename {play-services-api => play-services-location-api}/src/main/aidl/com/google/android/gms/location/internal/FusedLocationProviderResult.aidl (100%) rename {play-services-api => play-services-location-api}/src/main/aidl/com/google/android/gms/location/internal/IFusedLocationProviderCallback.aidl (100%) rename {play-services-api => play-services-location-api}/src/main/aidl/com/google/android/gms/location/internal/IGeofencerCallbacks.aidl (100%) rename {play-services-api => play-services-location-api}/src/main/aidl/com/google/android/gms/location/internal/IGoogleLocationManagerService.aidl (100%) rename {play-services-api => play-services-location-api}/src/main/aidl/com/google/android/gms/location/internal/ISettingsCallbacks.aidl (100%) rename {play-services-api => play-services-location-api}/src/main/aidl/com/google/android/gms/location/internal/LocationRequestInternal.aidl (100%) rename {play-services-api => play-services-location-api}/src/main/aidl/com/google/android/gms/location/internal/LocationRequestUpdateData.aidl (100%) rename {play-services-api => play-services-location-api}/src/main/aidl/com/google/android/gms/location/places/AutocompleteFilter.aidl (100%) rename {play-services-api => play-services-location-api}/src/main/aidl/com/google/android/gms/location/places/NearbyAlertRequest.aidl (100%) rename {play-services-api => play-services-location-api}/src/main/aidl/com/google/android/gms/location/places/PlaceFilter.aidl (100%) rename {play-services-api => play-services-location-api}/src/main/aidl/com/google/android/gms/location/places/PlaceReport.aidl (100%) rename {play-services-api => play-services-location-api}/src/main/aidl/com/google/android/gms/location/places/PlaceRequest.aidl (100%) rename {play-services-api => play-services-location-api}/src/main/aidl/com/google/android/gms/location/places/UserAddedPlace.aidl (100%) rename {play-services-api => play-services-location-api}/src/main/aidl/com/google/android/gms/location/places/UserDataType.aidl (100%) rename {play-services-api => play-services-location-api}/src/main/aidl/com/google/android/gms/location/places/internal/IPlacesCallbacks.aidl (100%) rename {play-services-api => play-services-location-api}/src/main/aidl/com/google/android/gms/location/places/internal/PlacesParams.aidl (100%) rename {play-services-api => play-services-location-api}/src/main/aidl/com/google/android/gms/location/reporting/ReportingState.aidl (100%) rename {play-services-api => play-services-location-api}/src/main/aidl/com/google/android/gms/location/reporting/UploadRequest.aidl (100%) rename {play-services-api => play-services-location-api}/src/main/aidl/com/google/android/gms/location/reporting/UploadRequestResult.aidl (100%) rename {play-services-api => play-services-location-api}/src/main/aidl/com/google/android/gms/location/reporting/internal/IReportingService.aidl (100%) rename {play-services-api => play-services-location-api}/src/main/aidl/com/google/android/gms/maps/model/LatLng.aidl (100%) rename {play-services-api => play-services-location-api}/src/main/aidl/com/google/android/gms/maps/model/LatLngBounds.aidl (100%) rename {play-services-api => play-services-location-api}/src/main/java/com/google/android/gms/location/ActivityRecognitionResult.java (100%) rename {play-services-api => play-services-location-api}/src/main/java/com/google/android/gms/location/Geofence.java (100%) rename {play-services-api => play-services-location-api}/src/main/java/com/google/android/gms/location/GeofencingRequest.java (100%) rename {play-services-api => play-services-location-api}/src/main/java/com/google/android/gms/location/GestureRequest.java (100%) rename {play-services-api => play-services-location-api}/src/main/java/com/google/android/gms/location/LocationAvailability.java (100%) rename {play-services-api => play-services-location-api}/src/main/java/com/google/android/gms/location/LocationRequest.java (100%) rename {play-services-api => play-services-location-api}/src/main/java/com/google/android/gms/location/LocationResult.java (100%) rename {play-services-api => play-services-location-api}/src/main/java/com/google/android/gms/location/LocationSettingsRequest.java (100%) rename {play-services-api => play-services-location-api}/src/main/java/com/google/android/gms/location/LocationSettingsResult.java (100%) rename {play-services-api => play-services-location-api}/src/main/java/com/google/android/gms/location/LocationSettingsStates.java (100%) rename {play-services-api => play-services-location-api}/src/main/java/com/google/android/gms/location/LocationStatus.java (100%) rename {play-services-api => play-services-location-api}/src/main/java/com/google/android/gms/location/internal/ClientIdentity.java (100%) rename {play-services-api => play-services-location-api}/src/main/java/com/google/android/gms/location/internal/FusedLocationProviderResult.java (100%) rename {play-services-api => play-services-location-api}/src/main/java/com/google/android/gms/location/internal/LocationRequestInternal.java (100%) rename {play-services-api => play-services-location-api}/src/main/java/com/google/android/gms/location/internal/LocationRequestUpdateData.java (100%) rename {play-services-api => play-services-location-api}/src/main/java/com/google/android/gms/location/places/AutocompleteFilter.java (100%) rename {play-services-api => play-services-location-api}/src/main/java/com/google/android/gms/location/places/NearbyAlertRequest.java (100%) rename {play-services-api => play-services-location-api}/src/main/java/com/google/android/gms/location/places/Place.java (100%) rename {play-services-api => play-services-location-api}/src/main/java/com/google/android/gms/location/places/PlaceFilter.java (100%) rename {play-services-api => play-services-location-api}/src/main/java/com/google/android/gms/location/places/PlaceReport.java (100%) rename {play-services-api => play-services-location-api}/src/main/java/com/google/android/gms/location/places/PlaceRequest.java (100%) rename {play-services-api => play-services-location-api}/src/main/java/com/google/android/gms/location/places/UserAddedPlace.java (100%) rename {play-services-api => play-services-location-api}/src/main/java/com/google/android/gms/location/places/UserDataType.java (100%) rename {play-services-api => play-services-location-api}/src/main/java/com/google/android/gms/location/places/internal/PlaceImpl.java (100%) rename {play-services-api => play-services-location-api}/src/main/java/com/google/android/gms/location/places/internal/PlacesParams.java (100%) rename {play-services-api => play-services-location-api}/src/main/java/com/google/android/gms/location/reporting/ReportingState.java (100%) rename {play-services-api => play-services-location-api}/src/main/java/com/google/android/gms/location/reporting/UploadRequest.java (100%) rename {play-services-api => play-services-location-api}/src/main/java/com/google/android/gms/location/reporting/UploadRequestResult.java (100%) rename {play-services-api => play-services-location-api}/src/main/java/com/google/android/gms/maps/model/LatLng.java (100%) rename {play-services-api => play-services-location-api}/src/main/java/com/google/android/gms/maps/model/LatLngBounds.java (100%) rename {play-services-api => play-services-location-api}/src/main/java/org/microg/gms/location/LocationConstants.java (100%) create mode 100644 play-services-wearable-api/build.gradle create mode 100644 play-services-wearable-api/src/main/AndroidManifest.xml rename {play-services-api => play-services-wearable-api}/src/main/aidl/com/google/android/gms/wearable/Asset.aidl (100%) rename {play-services-api => play-services-wearable-api}/src/main/aidl/com/google/android/gms/wearable/ConnectionConfiguration.aidl (100%) rename {play-services-api => play-services-wearable-api}/src/main/aidl/com/google/android/gms/wearable/internal/AddListenerRequest.aidl (100%) rename {play-services-api => play-services-wearable-api}/src/main/aidl/com/google/android/gms/wearable/internal/AmsEntityUpdateParcelable.aidl (100%) rename {play-services-api => play-services-wearable-api}/src/main/aidl/com/google/android/gms/wearable/internal/AncsNotificationParcelable.aidl (100%) rename {play-services-api => play-services-wearable-api}/src/main/aidl/com/google/android/gms/wearable/internal/CapabilityInfoParcelable.aidl (100%) rename {play-services-api => play-services-wearable-api}/src/main/aidl/com/google/android/gms/wearable/internal/ChannelEventParcelable.aidl (100%) rename {play-services-api => play-services-wearable-api}/src/main/aidl/com/google/android/gms/wearable/internal/DeleteDataItemsResponse.aidl (100%) rename {play-services-api => play-services-wearable-api}/src/main/aidl/com/google/android/gms/wearable/internal/GetCloudSyncSettingResponse.aidl (100%) rename {play-services-api => play-services-wearable-api}/src/main/aidl/com/google/android/gms/wearable/internal/GetConfigResponse.aidl (100%) rename {play-services-api => play-services-wearable-api}/src/main/aidl/com/google/android/gms/wearable/internal/GetConfigsResponse.aidl (100%) rename {play-services-api => play-services-wearable-api}/src/main/aidl/com/google/android/gms/wearable/internal/GetConnectedNodesResponse.aidl (100%) rename {play-services-api => play-services-wearable-api}/src/main/aidl/com/google/android/gms/wearable/internal/GetDataItemResponse.aidl (100%) rename {play-services-api => play-services-wearable-api}/src/main/aidl/com/google/android/gms/wearable/internal/GetFdForAssetResponse.aidl (100%) rename {play-services-api => play-services-wearable-api}/src/main/aidl/com/google/android/gms/wearable/internal/GetLocalNodeResponse.aidl (100%) rename {play-services-api => play-services-wearable-api}/src/main/aidl/com/google/android/gms/wearable/internal/IChannelStreamCallbacks.aidl (100%) rename {play-services-api => play-services-wearable-api}/src/main/aidl/com/google/android/gms/wearable/internal/IWearableCallbacks.aidl (100%) rename {play-services-api => play-services-wearable-api}/src/main/aidl/com/google/android/gms/wearable/internal/IWearableListener.aidl (100%) rename {play-services-api => play-services-wearable-api}/src/main/aidl/com/google/android/gms/wearable/internal/IWearableService.aidl (100%) rename {play-services-api => play-services-wearable-api}/src/main/aidl/com/google/android/gms/wearable/internal/MessageEventParcelable.aidl (100%) rename {play-services-api => play-services-wearable-api}/src/main/aidl/com/google/android/gms/wearable/internal/NodeParcelable.aidl (100%) rename {play-services-api => play-services-wearable-api}/src/main/aidl/com/google/android/gms/wearable/internal/PutDataRequest.aidl (100%) rename {play-services-api => play-services-wearable-api}/src/main/aidl/com/google/android/gms/wearable/internal/PutDataResponse.aidl (100%) rename {play-services-api => play-services-wearable-api}/src/main/aidl/com/google/android/gms/wearable/internal/RemoveListenerRequest.aidl (100%) rename {play-services-api => play-services-wearable-api}/src/main/aidl/com/google/android/gms/wearable/internal/SendMessageResponse.aidl (100%) rename {play-services-api => play-services-wearable-api}/src/main/aidl/com/google/android/gms/wearable/internal/StorageInfoResponse.aidl (100%) rename {play-services-api => play-services-wearable-api}/src/main/java/com/google/android/gms/wearable/Asset.java (100%) rename {play-services-api => play-services-wearable-api}/src/main/java/com/google/android/gms/wearable/ConnectionConfiguration.java (100%) rename {play-services-api => play-services-wearable-api}/src/main/java/com/google/android/gms/wearable/DataItem.java (100%) rename {play-services-api => play-services-wearable-api}/src/main/java/com/google/android/gms/wearable/DataItemAsset.java (100%) rename {play-services-api => play-services-wearable-api}/src/main/java/com/google/android/gms/wearable/MessageEvent.java (100%) rename {play-services-api => play-services-wearable-api}/src/main/java/com/google/android/gms/wearable/Node.java (100%) rename {play-services-api => play-services-wearable-api}/src/main/java/com/google/android/gms/wearable/WearableStatusCodes.java (100%) rename {play-services-api => play-services-wearable-api}/src/main/java/com/google/android/gms/wearable/internal/AddListenerRequest.java (100%) rename {play-services-api => play-services-wearable-api}/src/main/java/com/google/android/gms/wearable/internal/AmsEntityUpdateParcelable.java (100%) rename {play-services-api => play-services-wearable-api}/src/main/java/com/google/android/gms/wearable/internal/AncsNotificationParcelable.java (100%) rename {play-services-api => play-services-wearable-api}/src/main/java/com/google/android/gms/wearable/internal/CapabilityInfoParcelable.java (100%) rename {play-services-api => play-services-wearable-api}/src/main/java/com/google/android/gms/wearable/internal/ChannelEventParcelable.java (100%) rename {play-services-api => play-services-wearable-api}/src/main/java/com/google/android/gms/wearable/internal/DataItemAssetParcelable.java (100%) rename {play-services-api => play-services-wearable-api}/src/main/java/com/google/android/gms/wearable/internal/DataItemParcelable.java (100%) rename {play-services-api => play-services-wearable-api}/src/main/java/com/google/android/gms/wearable/internal/DeleteDataItemsResponse.java (100%) rename {play-services-api => play-services-wearable-api}/src/main/java/com/google/android/gms/wearable/internal/GetCloudSyncSettingResponse.java (100%) rename {play-services-api => play-services-wearable-api}/src/main/java/com/google/android/gms/wearable/internal/GetConfigResponse.java (100%) rename {play-services-api => play-services-wearable-api}/src/main/java/com/google/android/gms/wearable/internal/GetConfigsResponse.java (100%) rename {play-services-api => play-services-wearable-api}/src/main/java/com/google/android/gms/wearable/internal/GetConnectedNodesResponse.java (100%) rename {play-services-api => play-services-wearable-api}/src/main/java/com/google/android/gms/wearable/internal/GetDataItemResponse.java (100%) rename {play-services-api => play-services-wearable-api}/src/main/java/com/google/android/gms/wearable/internal/GetFdForAssetResponse.java (100%) rename {play-services-api => play-services-wearable-api}/src/main/java/com/google/android/gms/wearable/internal/GetLocalNodeResponse.java (100%) rename {play-services-api => play-services-wearable-api}/src/main/java/com/google/android/gms/wearable/internal/MessageEventParcelable.java (100%) rename {play-services-api => play-services-wearable-api}/src/main/java/com/google/android/gms/wearable/internal/NodeParcelable.java (100%) rename {play-services-api => play-services-wearable-api}/src/main/java/com/google/android/gms/wearable/internal/PutDataRequest.java (100%) rename {play-services-api => play-services-wearable-api}/src/main/java/com/google/android/gms/wearable/internal/PutDataResponse.java (100%) rename {play-services-api => play-services-wearable-api}/src/main/java/com/google/android/gms/wearable/internal/RemoveListenerRequest.java (100%) rename {play-services-api => play-services-wearable-api}/src/main/java/com/google/android/gms/wearable/internal/SendMessageResponse.java (100%) rename {play-services-api => play-services-wearable-api}/src/main/java/com/google/android/gms/wearable/internal/StorageInfoResponse.java (100%) diff --git a/play-services-api/build.gradle b/play-services-api/build.gradle index b0b8ad9d..5b5dd33e 100644 --- a/play-services-api/build.gradle +++ b/play-services-api/build.gradle @@ -51,5 +51,8 @@ android { } dependencies { - compile project(':safe-parcel') + compile project(':play-services-cast-api') + compile project(':play-services-common-api') + compile project(':play-services-location-api') + compile project(':play-services-wearable-api') } diff --git a/play-services-api/src/main/java/com/google/android/gms/gcm/PendingCallback.java b/play-services-api/src/main/java/com/google/android/gms/gcm/PendingCallback.java deleted file mode 100644 index 6eed3e3d..00000000 --- a/play-services-api/src/main/java/com/google/android/gms/gcm/PendingCallback.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2013-2016 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.gcm; - -import android.os.IBinder; -import android.os.Parcel; -import android.os.Parcelable; - -public class PendingCallback implements Parcelable { - private final IBinder binder; - - public PendingCallback(IBinder binder) { - this.binder = binder; - } - - private PendingCallback(Parcel in) { - this.binder = in.readStrongBinder(); - } - - public IBinder getBinder() { - return binder; - } - - @Override - public int describeContents() { - return 0; - } - - @Override - public void writeToParcel(Parcel dest, int flags) { - dest.writeStrongBinder(binder); - } - - public static final Creator CREATOR = new Creator() { - @Override - public PendingCallback createFromParcel(Parcel source) { - return new PendingCallback(source); - } - - @Override - public PendingCallback[] newArray(int size) { - return new PendingCallback[size]; - } - }; -} diff --git a/play-services-cast-api/build.gradle b/play-services-cast-api/build.gradle new file mode 100644 index 00000000..47f513a0 --- /dev/null +++ b/play-services-cast-api/build.gradle @@ -0,0 +1,55 @@ +/* + * Copyright 2013-2015 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. + */ + +buildscript { + repositories { + jcenter() + } + dependencies { + classpath 'com.android.tools.build:gradle:2.1.2' + } +} + +apply plugin: 'com.android.library' + +String getMyVersionName() { + def stdout = new ByteArrayOutputStream() + if (rootProject.file("gradlew").exists()) + exec { commandLine 'git', 'describe', '--tags', '--always', '--dirty'; standardOutput = stdout } + else // automatic build system, don't tag dirty + exec { commandLine 'git', 'describe', '--tags', '--always'; standardOutput = stdout } + return stdout.toString().trim().substring(1) +} + +group = 'org.microg' +version = getMyVersionName() + +android { + compileSdkVersion 23 + buildToolsVersion "23.0.3" + + defaultConfig { + versionName getMyVersionName() + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_6 + } +} + +dependencies { + compile project(':play-services-common-api') +} diff --git a/play-services-cast-api/src/main/AndroidManifest.xml b/play-services-cast-api/src/main/AndroidManifest.xml new file mode 100644 index 00000000..1aca1c4a --- /dev/null +++ b/play-services-cast-api/src/main/AndroidManifest.xml @@ -0,0 +1,24 @@ + + + + + + + + + diff --git a/play-services-api/src/main/java/com/google/android/gms/cast/ApplicationMetadata.java b/play-services-cast-api/src/main/java/com/google/android/gms/cast/ApplicationMetadata.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/cast/ApplicationMetadata.java rename to play-services-cast-api/src/main/java/com/google/android/gms/cast/ApplicationMetadata.java diff --git a/play-services-api/src/main/java/com/google/android/gms/cast/CastDevice.java b/play-services-cast-api/src/main/java/com/google/android/gms/cast/CastDevice.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/cast/CastDevice.java rename to play-services-cast-api/src/main/java/com/google/android/gms/cast/CastDevice.java diff --git a/play-services-api/src/main/java/com/google/android/gms/cast/CastMediaControlIntent.java b/play-services-cast-api/src/main/java/com/google/android/gms/cast/CastMediaControlIntent.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/cast/CastMediaControlIntent.java rename to play-services-cast-api/src/main/java/com/google/android/gms/cast/CastMediaControlIntent.java diff --git a/play-services-api/src/main/java/com/google/android/gms/cast/CastStatusCodes.java b/play-services-cast-api/src/main/java/com/google/android/gms/cast/CastStatusCodes.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/cast/CastStatusCodes.java rename to play-services-cast-api/src/main/java/com/google/android/gms/cast/CastStatusCodes.java diff --git a/play-services-api/src/main/java/com/google/android/gms/cast/LaunchOptions.java b/play-services-cast-api/src/main/java/com/google/android/gms/cast/LaunchOptions.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/cast/LaunchOptions.java rename to play-services-cast-api/src/main/java/com/google/android/gms/cast/LaunchOptions.java diff --git a/play-services-common-api/build.gradle b/play-services-common-api/build.gradle new file mode 100644 index 00000000..f43af0a4 --- /dev/null +++ b/play-services-common-api/build.gradle @@ -0,0 +1,60 @@ +/* + * Copyright 2013-2015 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. + */ + +buildscript { + repositories { + jcenter() + } + dependencies { + classpath 'com.android.tools.build:gradle:2.1.2' + } +} + +apply plugin: 'com.android.library' + +String getMyVersionName() { + def stdout = new ByteArrayOutputStream() + if (rootProject.file("gradlew").exists()) + exec { + commandLine 'git', 'describe', '--tags', '--always', '--dirty'; standardOutput = stdout + } + else // automatic build system, don't tag dirty + exec { commandLine 'git', 'describe', '--tags', '--always'; standardOutput = stdout } + return stdout.toString().trim().substring(1) +} + +group = 'org.microg' +version = getMyVersionName() + +android { + compileSdkVersion 23 + buildToolsVersion "23.0.3" + + aidlPackageWhiteList "com/google/android/gms/common/internal/ICancelToken.aidl" + aidlPackageWhiteList "com/google/android/gms/dynamic/IObjectWrapper.aidl" + + defaultConfig { + versionName getMyVersionName() + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_6 + } +} + +dependencies { + compile project(':safe-parcel') +} diff --git a/play-services-common-api/src/main/AndroidManifest.xml b/play-services-common-api/src/main/AndroidManifest.xml new file mode 100644 index 00000000..03679b28 --- /dev/null +++ b/play-services-common-api/src/main/AndroidManifest.xml @@ -0,0 +1,24 @@ + + + + + + + + + diff --git a/play-services-api/src/main/aidl/com/google/android/gms/common/api/Status.aidl b/play-services-common-api/src/main/aidl/com/google/android/gms/common/api/Status.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/common/api/Status.aidl rename to play-services-common-api/src/main/aidl/com/google/android/gms/common/api/Status.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/common/data/DataHolder.aidl b/play-services-common-api/src/main/aidl/com/google/android/gms/common/data/DataHolder.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/common/data/DataHolder.aidl rename to play-services-common-api/src/main/aidl/com/google/android/gms/common/data/DataHolder.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/common/internal/GetServiceRequest.aidl b/play-services-common-api/src/main/aidl/com/google/android/gms/common/internal/GetServiceRequest.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/common/internal/GetServiceRequest.aidl rename to play-services-common-api/src/main/aidl/com/google/android/gms/common/internal/GetServiceRequest.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/common/internal/ICancelToken.aidl b/play-services-common-api/src/main/aidl/com/google/android/gms/common/internal/ICancelToken.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/common/internal/ICancelToken.aidl rename to play-services-common-api/src/main/aidl/com/google/android/gms/common/internal/ICancelToken.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/common/internal/IGmsCallbacks.aidl b/play-services-common-api/src/main/aidl/com/google/android/gms/common/internal/IGmsCallbacks.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/common/internal/IGmsCallbacks.aidl rename to play-services-common-api/src/main/aidl/com/google/android/gms/common/internal/IGmsCallbacks.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/common/internal/IGmsServiceBroker.aidl b/play-services-common-api/src/main/aidl/com/google/android/gms/common/internal/IGmsServiceBroker.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/common/internal/IGmsServiceBroker.aidl rename to play-services-common-api/src/main/aidl/com/google/android/gms/common/internal/IGmsServiceBroker.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/common/internal/ISignInButtonCreator.aidl b/play-services-common-api/src/main/aidl/com/google/android/gms/common/internal/ISignInButtonCreator.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/common/internal/ISignInButtonCreator.aidl rename to play-services-common-api/src/main/aidl/com/google/android/gms/common/internal/ISignInButtonCreator.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/common/internal/ValidateAccountRequest.aidl b/play-services-common-api/src/main/aidl/com/google/android/gms/common/internal/ValidateAccountRequest.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/common/internal/ValidateAccountRequest.aidl rename to play-services-common-api/src/main/aidl/com/google/android/gms/common/internal/ValidateAccountRequest.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/common/server/FavaDiagnosticsEntity.aidl b/play-services-common-api/src/main/aidl/com/google/android/gms/common/server/FavaDiagnosticsEntity.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/common/server/FavaDiagnosticsEntity.aidl rename to play-services-common-api/src/main/aidl/com/google/android/gms/common/server/FavaDiagnosticsEntity.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/dynamic/IObjectWrapper.aidl b/play-services-common-api/src/main/aidl/com/google/android/gms/dynamic/IObjectWrapper.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/dynamic/IObjectWrapper.aidl rename to play-services-common-api/src/main/aidl/com/google/android/gms/dynamic/IObjectWrapper.aidl diff --git a/play-services-api/src/main/java/com/google/android/gms/common/Scopes.java b/play-services-common-api/src/main/java/com/google/android/gms/common/Scopes.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/common/Scopes.java rename to play-services-common-api/src/main/java/com/google/android/gms/common/Scopes.java diff --git a/play-services-api/src/main/java/com/google/android/gms/common/api/AccountInfo.java b/play-services-common-api/src/main/java/com/google/android/gms/common/api/AccountInfo.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/common/api/AccountInfo.java rename to play-services-common-api/src/main/java/com/google/android/gms/common/api/AccountInfo.java diff --git a/play-services-api/src/main/java/com/google/android/gms/common/api/CommonStatusCodes.java b/play-services-common-api/src/main/java/com/google/android/gms/common/api/CommonStatusCodes.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/common/api/CommonStatusCodes.java rename to play-services-common-api/src/main/java/com/google/android/gms/common/api/CommonStatusCodes.java diff --git a/play-services-api/src/main/java/com/google/android/gms/common/api/Result.java b/play-services-common-api/src/main/java/com/google/android/gms/common/api/Result.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/common/api/Result.java rename to play-services-common-api/src/main/java/com/google/android/gms/common/api/Result.java diff --git a/play-services-api/src/main/java/com/google/android/gms/common/api/Scope.java b/play-services-common-api/src/main/java/com/google/android/gms/common/api/Scope.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/common/api/Scope.java rename to play-services-common-api/src/main/java/com/google/android/gms/common/api/Scope.java diff --git a/play-services-api/src/main/java/com/google/android/gms/common/api/Status.java b/play-services-common-api/src/main/java/com/google/android/gms/common/api/Status.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/common/api/Status.java rename to play-services-common-api/src/main/java/com/google/android/gms/common/api/Status.java diff --git a/play-services-api/src/main/java/com/google/android/gms/common/data/DataHolder.java b/play-services-common-api/src/main/java/com/google/android/gms/common/data/DataHolder.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/common/data/DataHolder.java rename to play-services-common-api/src/main/java/com/google/android/gms/common/data/DataHolder.java diff --git a/play-services-api/src/main/java/com/google/android/gms/common/data/Freezable.java b/play-services-common-api/src/main/java/com/google/android/gms/common/data/Freezable.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/common/data/Freezable.java rename to play-services-common-api/src/main/java/com/google/android/gms/common/data/Freezable.java diff --git a/play-services-api/src/main/java/com/google/android/gms/common/images/WebImage.java b/play-services-common-api/src/main/java/com/google/android/gms/common/images/WebImage.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/common/images/WebImage.java rename to play-services-common-api/src/main/java/com/google/android/gms/common/images/WebImage.java diff --git a/play-services-api/src/main/java/com/google/android/gms/common/internal/BinderWrapper.java b/play-services-common-api/src/main/java/com/google/android/gms/common/internal/BinderWrapper.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/common/internal/BinderWrapper.java rename to play-services-common-api/src/main/java/com/google/android/gms/common/internal/BinderWrapper.java diff --git a/play-services-api/src/main/java/com/google/android/gms/common/internal/GetServiceRequest.java b/play-services-common-api/src/main/java/com/google/android/gms/common/internal/GetServiceRequest.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/common/internal/GetServiceRequest.java rename to play-services-common-api/src/main/java/com/google/android/gms/common/internal/GetServiceRequest.java diff --git a/play-services-api/src/main/java/com/google/android/gms/common/internal/ValidateAccountRequest.java b/play-services-common-api/src/main/java/com/google/android/gms/common/internal/ValidateAccountRequest.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/common/internal/ValidateAccountRequest.java rename to play-services-common-api/src/main/java/com/google/android/gms/common/internal/ValidateAccountRequest.java diff --git a/play-services-api/src/main/java/com/google/android/gms/common/server/FavaDiagnosticsEntity.java b/play-services-common-api/src/main/java/com/google/android/gms/common/server/FavaDiagnosticsEntity.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/common/server/FavaDiagnosticsEntity.java rename to play-services-common-api/src/main/java/com/google/android/gms/common/server/FavaDiagnosticsEntity.java diff --git a/play-services-api/src/main/java/com/google/android/gms/dynamic/ObjectWrapper.java b/play-services-common-api/src/main/java/com/google/android/gms/dynamic/ObjectWrapper.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/dynamic/ObjectWrapper.java rename to play-services-common-api/src/main/java/com/google/android/gms/dynamic/ObjectWrapper.java diff --git a/play-services-api/src/main/java/org/microg/gms/auth/AuthConstants.java b/play-services-common-api/src/main/java/org/microg/gms/auth/AuthConstants.java similarity index 100% rename from play-services-api/src/main/java/org/microg/gms/auth/AuthConstants.java rename to play-services-common-api/src/main/java/org/microg/gms/auth/AuthConstants.java diff --git a/play-services-api/src/main/java/org/microg/gms/common/Constants.java b/play-services-common-api/src/main/java/org/microg/gms/common/Constants.java similarity index 100% rename from play-services-api/src/main/java/org/microg/gms/common/Constants.java rename to play-services-common-api/src/main/java/org/microg/gms/common/Constants.java diff --git a/play-services-api/src/main/java/org/microg/gms/common/GmsService.java b/play-services-common-api/src/main/java/org/microg/gms/common/GmsService.java similarity index 100% rename from play-services-api/src/main/java/org/microg/gms/common/GmsService.java rename to play-services-common-api/src/main/java/org/microg/gms/common/GmsService.java diff --git a/play-services-api/src/main/java/org/microg/gms/common/PublicApi.java b/play-services-common-api/src/main/java/org/microg/gms/common/PublicApi.java similarity index 100% rename from play-services-api/src/main/java/org/microg/gms/common/PublicApi.java rename to play-services-common-api/src/main/java/org/microg/gms/common/PublicApi.java diff --git a/play-services-location-api/build.gradle b/play-services-location-api/build.gradle new file mode 100644 index 00000000..47f513a0 --- /dev/null +++ b/play-services-location-api/build.gradle @@ -0,0 +1,55 @@ +/* + * Copyright 2013-2015 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. + */ + +buildscript { + repositories { + jcenter() + } + dependencies { + classpath 'com.android.tools.build:gradle:2.1.2' + } +} + +apply plugin: 'com.android.library' + +String getMyVersionName() { + def stdout = new ByteArrayOutputStream() + if (rootProject.file("gradlew").exists()) + exec { commandLine 'git', 'describe', '--tags', '--always', '--dirty'; standardOutput = stdout } + else // automatic build system, don't tag dirty + exec { commandLine 'git', 'describe', '--tags', '--always'; standardOutput = stdout } + return stdout.toString().trim().substring(1) +} + +group = 'org.microg' +version = getMyVersionName() + +android { + compileSdkVersion 23 + buildToolsVersion "23.0.3" + + defaultConfig { + versionName getMyVersionName() + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_6 + } +} + +dependencies { + compile project(':play-services-common-api') +} diff --git a/play-services-location-api/src/main/AndroidManifest.xml b/play-services-location-api/src/main/AndroidManifest.xml new file mode 100644 index 00000000..2439e26f --- /dev/null +++ b/play-services-location-api/src/main/AndroidManifest.xml @@ -0,0 +1,24 @@ + + + + + + + + + diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/ActivityRecognitionResult.aidl b/play-services-location-api/src/main/aidl/com/google/android/gms/location/ActivityRecognitionResult.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/location/ActivityRecognitionResult.aidl rename to play-services-location-api/src/main/aidl/com/google/android/gms/location/ActivityRecognitionResult.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/Geofence.aidl b/play-services-location-api/src/main/aidl/com/google/android/gms/location/Geofence.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/location/Geofence.aidl rename to play-services-location-api/src/main/aidl/com/google/android/gms/location/Geofence.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/GeofencingRequest.aidl b/play-services-location-api/src/main/aidl/com/google/android/gms/location/GeofencingRequest.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/location/GeofencingRequest.aidl rename to play-services-location-api/src/main/aidl/com/google/android/gms/location/GeofencingRequest.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/GestureRequest.aidl b/play-services-location-api/src/main/aidl/com/google/android/gms/location/GestureRequest.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/location/GestureRequest.aidl rename to play-services-location-api/src/main/aidl/com/google/android/gms/location/GestureRequest.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/ILocationCallback.aidl b/play-services-location-api/src/main/aidl/com/google/android/gms/location/ILocationCallback.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/location/ILocationCallback.aidl rename to play-services-location-api/src/main/aidl/com/google/android/gms/location/ILocationCallback.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/ILocationListener.aidl b/play-services-location-api/src/main/aidl/com/google/android/gms/location/ILocationListener.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/location/ILocationListener.aidl rename to play-services-location-api/src/main/aidl/com/google/android/gms/location/ILocationListener.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/LocationAvailability.aidl b/play-services-location-api/src/main/aidl/com/google/android/gms/location/LocationAvailability.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/location/LocationAvailability.aidl rename to play-services-location-api/src/main/aidl/com/google/android/gms/location/LocationAvailability.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/LocationRequest.aidl b/play-services-location-api/src/main/aidl/com/google/android/gms/location/LocationRequest.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/location/LocationRequest.aidl rename to play-services-location-api/src/main/aidl/com/google/android/gms/location/LocationRequest.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/LocationResult.aidl b/play-services-location-api/src/main/aidl/com/google/android/gms/location/LocationResult.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/location/LocationResult.aidl rename to play-services-location-api/src/main/aidl/com/google/android/gms/location/LocationResult.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/LocationSettingsRequest.aidl b/play-services-location-api/src/main/aidl/com/google/android/gms/location/LocationSettingsRequest.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/location/LocationSettingsRequest.aidl rename to play-services-location-api/src/main/aidl/com/google/android/gms/location/LocationSettingsRequest.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/LocationSettingsResult.aidl b/play-services-location-api/src/main/aidl/com/google/android/gms/location/LocationSettingsResult.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/location/LocationSettingsResult.aidl rename to play-services-location-api/src/main/aidl/com/google/android/gms/location/LocationSettingsResult.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/LocationStatus.aidl b/play-services-location-api/src/main/aidl/com/google/android/gms/location/LocationStatus.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/location/LocationStatus.aidl rename to play-services-location-api/src/main/aidl/com/google/android/gms/location/LocationStatus.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/internal/FusedLocationProviderResult.aidl b/play-services-location-api/src/main/aidl/com/google/android/gms/location/internal/FusedLocationProviderResult.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/location/internal/FusedLocationProviderResult.aidl rename to play-services-location-api/src/main/aidl/com/google/android/gms/location/internal/FusedLocationProviderResult.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/internal/IFusedLocationProviderCallback.aidl b/play-services-location-api/src/main/aidl/com/google/android/gms/location/internal/IFusedLocationProviderCallback.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/location/internal/IFusedLocationProviderCallback.aidl rename to play-services-location-api/src/main/aidl/com/google/android/gms/location/internal/IFusedLocationProviderCallback.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/internal/IGeofencerCallbacks.aidl b/play-services-location-api/src/main/aidl/com/google/android/gms/location/internal/IGeofencerCallbacks.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/location/internal/IGeofencerCallbacks.aidl rename to play-services-location-api/src/main/aidl/com/google/android/gms/location/internal/IGeofencerCallbacks.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/internal/IGoogleLocationManagerService.aidl b/play-services-location-api/src/main/aidl/com/google/android/gms/location/internal/IGoogleLocationManagerService.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/location/internal/IGoogleLocationManagerService.aidl rename to play-services-location-api/src/main/aidl/com/google/android/gms/location/internal/IGoogleLocationManagerService.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/internal/ISettingsCallbacks.aidl b/play-services-location-api/src/main/aidl/com/google/android/gms/location/internal/ISettingsCallbacks.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/location/internal/ISettingsCallbacks.aidl rename to play-services-location-api/src/main/aidl/com/google/android/gms/location/internal/ISettingsCallbacks.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/internal/LocationRequestInternal.aidl b/play-services-location-api/src/main/aidl/com/google/android/gms/location/internal/LocationRequestInternal.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/location/internal/LocationRequestInternal.aidl rename to play-services-location-api/src/main/aidl/com/google/android/gms/location/internal/LocationRequestInternal.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/internal/LocationRequestUpdateData.aidl b/play-services-location-api/src/main/aidl/com/google/android/gms/location/internal/LocationRequestUpdateData.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/location/internal/LocationRequestUpdateData.aidl rename to play-services-location-api/src/main/aidl/com/google/android/gms/location/internal/LocationRequestUpdateData.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/places/AutocompleteFilter.aidl b/play-services-location-api/src/main/aidl/com/google/android/gms/location/places/AutocompleteFilter.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/location/places/AutocompleteFilter.aidl rename to play-services-location-api/src/main/aidl/com/google/android/gms/location/places/AutocompleteFilter.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/places/NearbyAlertRequest.aidl b/play-services-location-api/src/main/aidl/com/google/android/gms/location/places/NearbyAlertRequest.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/location/places/NearbyAlertRequest.aidl rename to play-services-location-api/src/main/aidl/com/google/android/gms/location/places/NearbyAlertRequest.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/places/PlaceFilter.aidl b/play-services-location-api/src/main/aidl/com/google/android/gms/location/places/PlaceFilter.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/location/places/PlaceFilter.aidl rename to play-services-location-api/src/main/aidl/com/google/android/gms/location/places/PlaceFilter.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/places/PlaceReport.aidl b/play-services-location-api/src/main/aidl/com/google/android/gms/location/places/PlaceReport.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/location/places/PlaceReport.aidl rename to play-services-location-api/src/main/aidl/com/google/android/gms/location/places/PlaceReport.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/places/PlaceRequest.aidl b/play-services-location-api/src/main/aidl/com/google/android/gms/location/places/PlaceRequest.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/location/places/PlaceRequest.aidl rename to play-services-location-api/src/main/aidl/com/google/android/gms/location/places/PlaceRequest.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/places/UserAddedPlace.aidl b/play-services-location-api/src/main/aidl/com/google/android/gms/location/places/UserAddedPlace.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/location/places/UserAddedPlace.aidl rename to play-services-location-api/src/main/aidl/com/google/android/gms/location/places/UserAddedPlace.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/places/UserDataType.aidl b/play-services-location-api/src/main/aidl/com/google/android/gms/location/places/UserDataType.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/location/places/UserDataType.aidl rename to play-services-location-api/src/main/aidl/com/google/android/gms/location/places/UserDataType.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/places/internal/IPlacesCallbacks.aidl b/play-services-location-api/src/main/aidl/com/google/android/gms/location/places/internal/IPlacesCallbacks.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/location/places/internal/IPlacesCallbacks.aidl rename to play-services-location-api/src/main/aidl/com/google/android/gms/location/places/internal/IPlacesCallbacks.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/places/internal/PlacesParams.aidl b/play-services-location-api/src/main/aidl/com/google/android/gms/location/places/internal/PlacesParams.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/location/places/internal/PlacesParams.aidl rename to play-services-location-api/src/main/aidl/com/google/android/gms/location/places/internal/PlacesParams.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/reporting/ReportingState.aidl b/play-services-location-api/src/main/aidl/com/google/android/gms/location/reporting/ReportingState.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/location/reporting/ReportingState.aidl rename to play-services-location-api/src/main/aidl/com/google/android/gms/location/reporting/ReportingState.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/reporting/UploadRequest.aidl b/play-services-location-api/src/main/aidl/com/google/android/gms/location/reporting/UploadRequest.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/location/reporting/UploadRequest.aidl rename to play-services-location-api/src/main/aidl/com/google/android/gms/location/reporting/UploadRequest.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/reporting/UploadRequestResult.aidl b/play-services-location-api/src/main/aidl/com/google/android/gms/location/reporting/UploadRequestResult.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/location/reporting/UploadRequestResult.aidl rename to play-services-location-api/src/main/aidl/com/google/android/gms/location/reporting/UploadRequestResult.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/reporting/internal/IReportingService.aidl b/play-services-location-api/src/main/aidl/com/google/android/gms/location/reporting/internal/IReportingService.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/location/reporting/internal/IReportingService.aidl rename to play-services-location-api/src/main/aidl/com/google/android/gms/location/reporting/internal/IReportingService.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/model/LatLng.aidl b/play-services-location-api/src/main/aidl/com/google/android/gms/maps/model/LatLng.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/maps/model/LatLng.aidl rename to play-services-location-api/src/main/aidl/com/google/android/gms/maps/model/LatLng.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/model/LatLngBounds.aidl b/play-services-location-api/src/main/aidl/com/google/android/gms/maps/model/LatLngBounds.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/maps/model/LatLngBounds.aidl rename to play-services-location-api/src/main/aidl/com/google/android/gms/maps/model/LatLngBounds.aidl diff --git a/play-services-api/src/main/java/com/google/android/gms/location/ActivityRecognitionResult.java b/play-services-location-api/src/main/java/com/google/android/gms/location/ActivityRecognitionResult.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/location/ActivityRecognitionResult.java rename to play-services-location-api/src/main/java/com/google/android/gms/location/ActivityRecognitionResult.java diff --git a/play-services-api/src/main/java/com/google/android/gms/location/Geofence.java b/play-services-location-api/src/main/java/com/google/android/gms/location/Geofence.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/location/Geofence.java rename to play-services-location-api/src/main/java/com/google/android/gms/location/Geofence.java diff --git a/play-services-api/src/main/java/com/google/android/gms/location/GeofencingRequest.java b/play-services-location-api/src/main/java/com/google/android/gms/location/GeofencingRequest.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/location/GeofencingRequest.java rename to play-services-location-api/src/main/java/com/google/android/gms/location/GeofencingRequest.java diff --git a/play-services-api/src/main/java/com/google/android/gms/location/GestureRequest.java b/play-services-location-api/src/main/java/com/google/android/gms/location/GestureRequest.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/location/GestureRequest.java rename to play-services-location-api/src/main/java/com/google/android/gms/location/GestureRequest.java diff --git a/play-services-api/src/main/java/com/google/android/gms/location/LocationAvailability.java b/play-services-location-api/src/main/java/com/google/android/gms/location/LocationAvailability.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/location/LocationAvailability.java rename to play-services-location-api/src/main/java/com/google/android/gms/location/LocationAvailability.java diff --git a/play-services-api/src/main/java/com/google/android/gms/location/LocationRequest.java b/play-services-location-api/src/main/java/com/google/android/gms/location/LocationRequest.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/location/LocationRequest.java rename to play-services-location-api/src/main/java/com/google/android/gms/location/LocationRequest.java diff --git a/play-services-api/src/main/java/com/google/android/gms/location/LocationResult.java b/play-services-location-api/src/main/java/com/google/android/gms/location/LocationResult.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/location/LocationResult.java rename to play-services-location-api/src/main/java/com/google/android/gms/location/LocationResult.java diff --git a/play-services-api/src/main/java/com/google/android/gms/location/LocationSettingsRequest.java b/play-services-location-api/src/main/java/com/google/android/gms/location/LocationSettingsRequest.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/location/LocationSettingsRequest.java rename to play-services-location-api/src/main/java/com/google/android/gms/location/LocationSettingsRequest.java diff --git a/play-services-api/src/main/java/com/google/android/gms/location/LocationSettingsResult.java b/play-services-location-api/src/main/java/com/google/android/gms/location/LocationSettingsResult.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/location/LocationSettingsResult.java rename to play-services-location-api/src/main/java/com/google/android/gms/location/LocationSettingsResult.java diff --git a/play-services-api/src/main/java/com/google/android/gms/location/LocationSettingsStates.java b/play-services-location-api/src/main/java/com/google/android/gms/location/LocationSettingsStates.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/location/LocationSettingsStates.java rename to play-services-location-api/src/main/java/com/google/android/gms/location/LocationSettingsStates.java diff --git a/play-services-api/src/main/java/com/google/android/gms/location/LocationStatus.java b/play-services-location-api/src/main/java/com/google/android/gms/location/LocationStatus.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/location/LocationStatus.java rename to play-services-location-api/src/main/java/com/google/android/gms/location/LocationStatus.java diff --git a/play-services-api/src/main/java/com/google/android/gms/location/internal/ClientIdentity.java b/play-services-location-api/src/main/java/com/google/android/gms/location/internal/ClientIdentity.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/location/internal/ClientIdentity.java rename to play-services-location-api/src/main/java/com/google/android/gms/location/internal/ClientIdentity.java diff --git a/play-services-api/src/main/java/com/google/android/gms/location/internal/FusedLocationProviderResult.java b/play-services-location-api/src/main/java/com/google/android/gms/location/internal/FusedLocationProviderResult.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/location/internal/FusedLocationProviderResult.java rename to play-services-location-api/src/main/java/com/google/android/gms/location/internal/FusedLocationProviderResult.java diff --git a/play-services-api/src/main/java/com/google/android/gms/location/internal/LocationRequestInternal.java b/play-services-location-api/src/main/java/com/google/android/gms/location/internal/LocationRequestInternal.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/location/internal/LocationRequestInternal.java rename to play-services-location-api/src/main/java/com/google/android/gms/location/internal/LocationRequestInternal.java diff --git a/play-services-api/src/main/java/com/google/android/gms/location/internal/LocationRequestUpdateData.java b/play-services-location-api/src/main/java/com/google/android/gms/location/internal/LocationRequestUpdateData.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/location/internal/LocationRequestUpdateData.java rename to play-services-location-api/src/main/java/com/google/android/gms/location/internal/LocationRequestUpdateData.java diff --git a/play-services-api/src/main/java/com/google/android/gms/location/places/AutocompleteFilter.java b/play-services-location-api/src/main/java/com/google/android/gms/location/places/AutocompleteFilter.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/location/places/AutocompleteFilter.java rename to play-services-location-api/src/main/java/com/google/android/gms/location/places/AutocompleteFilter.java diff --git a/play-services-api/src/main/java/com/google/android/gms/location/places/NearbyAlertRequest.java b/play-services-location-api/src/main/java/com/google/android/gms/location/places/NearbyAlertRequest.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/location/places/NearbyAlertRequest.java rename to play-services-location-api/src/main/java/com/google/android/gms/location/places/NearbyAlertRequest.java diff --git a/play-services-api/src/main/java/com/google/android/gms/location/places/Place.java b/play-services-location-api/src/main/java/com/google/android/gms/location/places/Place.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/location/places/Place.java rename to play-services-location-api/src/main/java/com/google/android/gms/location/places/Place.java diff --git a/play-services-api/src/main/java/com/google/android/gms/location/places/PlaceFilter.java b/play-services-location-api/src/main/java/com/google/android/gms/location/places/PlaceFilter.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/location/places/PlaceFilter.java rename to play-services-location-api/src/main/java/com/google/android/gms/location/places/PlaceFilter.java diff --git a/play-services-api/src/main/java/com/google/android/gms/location/places/PlaceReport.java b/play-services-location-api/src/main/java/com/google/android/gms/location/places/PlaceReport.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/location/places/PlaceReport.java rename to play-services-location-api/src/main/java/com/google/android/gms/location/places/PlaceReport.java diff --git a/play-services-api/src/main/java/com/google/android/gms/location/places/PlaceRequest.java b/play-services-location-api/src/main/java/com/google/android/gms/location/places/PlaceRequest.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/location/places/PlaceRequest.java rename to play-services-location-api/src/main/java/com/google/android/gms/location/places/PlaceRequest.java diff --git a/play-services-api/src/main/java/com/google/android/gms/location/places/UserAddedPlace.java b/play-services-location-api/src/main/java/com/google/android/gms/location/places/UserAddedPlace.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/location/places/UserAddedPlace.java rename to play-services-location-api/src/main/java/com/google/android/gms/location/places/UserAddedPlace.java diff --git a/play-services-api/src/main/java/com/google/android/gms/location/places/UserDataType.java b/play-services-location-api/src/main/java/com/google/android/gms/location/places/UserDataType.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/location/places/UserDataType.java rename to play-services-location-api/src/main/java/com/google/android/gms/location/places/UserDataType.java diff --git a/play-services-api/src/main/java/com/google/android/gms/location/places/internal/PlaceImpl.java b/play-services-location-api/src/main/java/com/google/android/gms/location/places/internal/PlaceImpl.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/location/places/internal/PlaceImpl.java rename to play-services-location-api/src/main/java/com/google/android/gms/location/places/internal/PlaceImpl.java diff --git a/play-services-api/src/main/java/com/google/android/gms/location/places/internal/PlacesParams.java b/play-services-location-api/src/main/java/com/google/android/gms/location/places/internal/PlacesParams.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/location/places/internal/PlacesParams.java rename to play-services-location-api/src/main/java/com/google/android/gms/location/places/internal/PlacesParams.java diff --git a/play-services-api/src/main/java/com/google/android/gms/location/reporting/ReportingState.java b/play-services-location-api/src/main/java/com/google/android/gms/location/reporting/ReportingState.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/location/reporting/ReportingState.java rename to play-services-location-api/src/main/java/com/google/android/gms/location/reporting/ReportingState.java diff --git a/play-services-api/src/main/java/com/google/android/gms/location/reporting/UploadRequest.java b/play-services-location-api/src/main/java/com/google/android/gms/location/reporting/UploadRequest.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/location/reporting/UploadRequest.java rename to play-services-location-api/src/main/java/com/google/android/gms/location/reporting/UploadRequest.java diff --git a/play-services-api/src/main/java/com/google/android/gms/location/reporting/UploadRequestResult.java b/play-services-location-api/src/main/java/com/google/android/gms/location/reporting/UploadRequestResult.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/location/reporting/UploadRequestResult.java rename to play-services-location-api/src/main/java/com/google/android/gms/location/reporting/UploadRequestResult.java diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/model/LatLng.java b/play-services-location-api/src/main/java/com/google/android/gms/maps/model/LatLng.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/maps/model/LatLng.java rename to play-services-location-api/src/main/java/com/google/android/gms/maps/model/LatLng.java diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/model/LatLngBounds.java b/play-services-location-api/src/main/java/com/google/android/gms/maps/model/LatLngBounds.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/maps/model/LatLngBounds.java rename to play-services-location-api/src/main/java/com/google/android/gms/maps/model/LatLngBounds.java diff --git a/play-services-api/src/main/java/org/microg/gms/location/LocationConstants.java b/play-services-location-api/src/main/java/org/microg/gms/location/LocationConstants.java similarity index 100% rename from play-services-api/src/main/java/org/microg/gms/location/LocationConstants.java rename to play-services-location-api/src/main/java/org/microg/gms/location/LocationConstants.java diff --git a/play-services-wearable-api/build.gradle b/play-services-wearable-api/build.gradle new file mode 100644 index 00000000..47f513a0 --- /dev/null +++ b/play-services-wearable-api/build.gradle @@ -0,0 +1,55 @@ +/* + * Copyright 2013-2015 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. + */ + +buildscript { + repositories { + jcenter() + } + dependencies { + classpath 'com.android.tools.build:gradle:2.1.2' + } +} + +apply plugin: 'com.android.library' + +String getMyVersionName() { + def stdout = new ByteArrayOutputStream() + if (rootProject.file("gradlew").exists()) + exec { commandLine 'git', 'describe', '--tags', '--always', '--dirty'; standardOutput = stdout } + else // automatic build system, don't tag dirty + exec { commandLine 'git', 'describe', '--tags', '--always'; standardOutput = stdout } + return stdout.toString().trim().substring(1) +} + +group = 'org.microg' +version = getMyVersionName() + +android { + compileSdkVersion 23 + buildToolsVersion "23.0.3" + + defaultConfig { + versionName getMyVersionName() + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_6 + } +} + +dependencies { + compile project(':play-services-common-api') +} diff --git a/play-services-wearable-api/src/main/AndroidManifest.xml b/play-services-wearable-api/src/main/AndroidManifest.xml new file mode 100644 index 00000000..9ab8979d --- /dev/null +++ b/play-services-wearable-api/src/main/AndroidManifest.xml @@ -0,0 +1,24 @@ + + + + + + + + + diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/Asset.aidl b/play-services-wearable-api/src/main/aidl/com/google/android/gms/wearable/Asset.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/wearable/Asset.aidl rename to play-services-wearable-api/src/main/aidl/com/google/android/gms/wearable/Asset.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/ConnectionConfiguration.aidl b/play-services-wearable-api/src/main/aidl/com/google/android/gms/wearable/ConnectionConfiguration.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/wearable/ConnectionConfiguration.aidl rename to play-services-wearable-api/src/main/aidl/com/google/android/gms/wearable/ConnectionConfiguration.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/AddListenerRequest.aidl b/play-services-wearable-api/src/main/aidl/com/google/android/gms/wearable/internal/AddListenerRequest.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/AddListenerRequest.aidl rename to play-services-wearable-api/src/main/aidl/com/google/android/gms/wearable/internal/AddListenerRequest.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/AmsEntityUpdateParcelable.aidl b/play-services-wearable-api/src/main/aidl/com/google/android/gms/wearable/internal/AmsEntityUpdateParcelable.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/AmsEntityUpdateParcelable.aidl rename to play-services-wearable-api/src/main/aidl/com/google/android/gms/wearable/internal/AmsEntityUpdateParcelable.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/AncsNotificationParcelable.aidl b/play-services-wearable-api/src/main/aidl/com/google/android/gms/wearable/internal/AncsNotificationParcelable.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/AncsNotificationParcelable.aidl rename to play-services-wearable-api/src/main/aidl/com/google/android/gms/wearable/internal/AncsNotificationParcelable.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/CapabilityInfoParcelable.aidl b/play-services-wearable-api/src/main/aidl/com/google/android/gms/wearable/internal/CapabilityInfoParcelable.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/CapabilityInfoParcelable.aidl rename to play-services-wearable-api/src/main/aidl/com/google/android/gms/wearable/internal/CapabilityInfoParcelable.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/ChannelEventParcelable.aidl b/play-services-wearable-api/src/main/aidl/com/google/android/gms/wearable/internal/ChannelEventParcelable.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/ChannelEventParcelable.aidl rename to play-services-wearable-api/src/main/aidl/com/google/android/gms/wearable/internal/ChannelEventParcelable.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/DeleteDataItemsResponse.aidl b/play-services-wearable-api/src/main/aidl/com/google/android/gms/wearable/internal/DeleteDataItemsResponse.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/DeleteDataItemsResponse.aidl rename to play-services-wearable-api/src/main/aidl/com/google/android/gms/wearable/internal/DeleteDataItemsResponse.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/GetCloudSyncSettingResponse.aidl b/play-services-wearable-api/src/main/aidl/com/google/android/gms/wearable/internal/GetCloudSyncSettingResponse.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/GetCloudSyncSettingResponse.aidl rename to play-services-wearable-api/src/main/aidl/com/google/android/gms/wearable/internal/GetCloudSyncSettingResponse.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/GetConfigResponse.aidl b/play-services-wearable-api/src/main/aidl/com/google/android/gms/wearable/internal/GetConfigResponse.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/GetConfigResponse.aidl rename to play-services-wearable-api/src/main/aidl/com/google/android/gms/wearable/internal/GetConfigResponse.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/GetConfigsResponse.aidl b/play-services-wearable-api/src/main/aidl/com/google/android/gms/wearable/internal/GetConfigsResponse.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/GetConfigsResponse.aidl rename to play-services-wearable-api/src/main/aidl/com/google/android/gms/wearable/internal/GetConfigsResponse.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/GetConnectedNodesResponse.aidl b/play-services-wearable-api/src/main/aidl/com/google/android/gms/wearable/internal/GetConnectedNodesResponse.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/GetConnectedNodesResponse.aidl rename to play-services-wearable-api/src/main/aidl/com/google/android/gms/wearable/internal/GetConnectedNodesResponse.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/GetDataItemResponse.aidl b/play-services-wearable-api/src/main/aidl/com/google/android/gms/wearable/internal/GetDataItemResponse.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/GetDataItemResponse.aidl rename to play-services-wearable-api/src/main/aidl/com/google/android/gms/wearable/internal/GetDataItemResponse.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/GetFdForAssetResponse.aidl b/play-services-wearable-api/src/main/aidl/com/google/android/gms/wearable/internal/GetFdForAssetResponse.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/GetFdForAssetResponse.aidl rename to play-services-wearable-api/src/main/aidl/com/google/android/gms/wearable/internal/GetFdForAssetResponse.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/GetLocalNodeResponse.aidl b/play-services-wearable-api/src/main/aidl/com/google/android/gms/wearable/internal/GetLocalNodeResponse.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/GetLocalNodeResponse.aidl rename to play-services-wearable-api/src/main/aidl/com/google/android/gms/wearable/internal/GetLocalNodeResponse.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/IChannelStreamCallbacks.aidl b/play-services-wearable-api/src/main/aidl/com/google/android/gms/wearable/internal/IChannelStreamCallbacks.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/IChannelStreamCallbacks.aidl rename to play-services-wearable-api/src/main/aidl/com/google/android/gms/wearable/internal/IChannelStreamCallbacks.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableCallbacks.aidl b/play-services-wearable-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableCallbacks.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableCallbacks.aidl rename to play-services-wearable-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableCallbacks.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableListener.aidl b/play-services-wearable-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableListener.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableListener.aidl rename to play-services-wearable-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableListener.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableService.aidl b/play-services-wearable-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableService.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableService.aidl rename to play-services-wearable-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableService.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/MessageEventParcelable.aidl b/play-services-wearable-api/src/main/aidl/com/google/android/gms/wearable/internal/MessageEventParcelable.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/MessageEventParcelable.aidl rename to play-services-wearable-api/src/main/aidl/com/google/android/gms/wearable/internal/MessageEventParcelable.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/NodeParcelable.aidl b/play-services-wearable-api/src/main/aidl/com/google/android/gms/wearable/internal/NodeParcelable.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/NodeParcelable.aidl rename to play-services-wearable-api/src/main/aidl/com/google/android/gms/wearable/internal/NodeParcelable.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/PutDataRequest.aidl b/play-services-wearable-api/src/main/aidl/com/google/android/gms/wearable/internal/PutDataRequest.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/PutDataRequest.aidl rename to play-services-wearable-api/src/main/aidl/com/google/android/gms/wearable/internal/PutDataRequest.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/PutDataResponse.aidl b/play-services-wearable-api/src/main/aidl/com/google/android/gms/wearable/internal/PutDataResponse.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/PutDataResponse.aidl rename to play-services-wearable-api/src/main/aidl/com/google/android/gms/wearable/internal/PutDataResponse.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/RemoveListenerRequest.aidl b/play-services-wearable-api/src/main/aidl/com/google/android/gms/wearable/internal/RemoveListenerRequest.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/RemoveListenerRequest.aidl rename to play-services-wearable-api/src/main/aidl/com/google/android/gms/wearable/internal/RemoveListenerRequest.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/SendMessageResponse.aidl b/play-services-wearable-api/src/main/aidl/com/google/android/gms/wearable/internal/SendMessageResponse.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/SendMessageResponse.aidl rename to play-services-wearable-api/src/main/aidl/com/google/android/gms/wearable/internal/SendMessageResponse.aidl diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/StorageInfoResponse.aidl b/play-services-wearable-api/src/main/aidl/com/google/android/gms/wearable/internal/StorageInfoResponse.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/wearable/internal/StorageInfoResponse.aidl rename to play-services-wearable-api/src/main/aidl/com/google/android/gms/wearable/internal/StorageInfoResponse.aidl diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/Asset.java b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/Asset.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/wearable/Asset.java rename to play-services-wearable-api/src/main/java/com/google/android/gms/wearable/Asset.java diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/ConnectionConfiguration.java b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/ConnectionConfiguration.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/wearable/ConnectionConfiguration.java rename to play-services-wearable-api/src/main/java/com/google/android/gms/wearable/ConnectionConfiguration.java diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/DataItem.java b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/DataItem.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/wearable/DataItem.java rename to play-services-wearable-api/src/main/java/com/google/android/gms/wearable/DataItem.java diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/DataItemAsset.java b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/DataItemAsset.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/wearable/DataItemAsset.java rename to play-services-wearable-api/src/main/java/com/google/android/gms/wearable/DataItemAsset.java diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/MessageEvent.java b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/MessageEvent.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/wearable/MessageEvent.java rename to play-services-wearable-api/src/main/java/com/google/android/gms/wearable/MessageEvent.java diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/Node.java b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/Node.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/wearable/Node.java rename to play-services-wearable-api/src/main/java/com/google/android/gms/wearable/Node.java diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/WearableStatusCodes.java b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/WearableStatusCodes.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/wearable/WearableStatusCodes.java rename to play-services-wearable-api/src/main/java/com/google/android/gms/wearable/WearableStatusCodes.java diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/AddListenerRequest.java b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/AddListenerRequest.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/wearable/internal/AddListenerRequest.java rename to play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/AddListenerRequest.java diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/AmsEntityUpdateParcelable.java b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/AmsEntityUpdateParcelable.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/wearable/internal/AmsEntityUpdateParcelable.java rename to play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/AmsEntityUpdateParcelable.java diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/AncsNotificationParcelable.java b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/AncsNotificationParcelable.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/wearable/internal/AncsNotificationParcelable.java rename to play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/AncsNotificationParcelable.java diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/CapabilityInfoParcelable.java b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/CapabilityInfoParcelable.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/wearable/internal/CapabilityInfoParcelable.java rename to play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/CapabilityInfoParcelable.java diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/ChannelEventParcelable.java b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/ChannelEventParcelable.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/wearable/internal/ChannelEventParcelable.java rename to play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/ChannelEventParcelable.java diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/DataItemAssetParcelable.java b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/DataItemAssetParcelable.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/wearable/internal/DataItemAssetParcelable.java rename to play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/DataItemAssetParcelable.java diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/DataItemParcelable.java b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/DataItemParcelable.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/wearable/internal/DataItemParcelable.java rename to play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/DataItemParcelable.java diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/DeleteDataItemsResponse.java b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/DeleteDataItemsResponse.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/wearable/internal/DeleteDataItemsResponse.java rename to play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/DeleteDataItemsResponse.java diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetCloudSyncSettingResponse.java b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/GetCloudSyncSettingResponse.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetCloudSyncSettingResponse.java rename to play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/GetCloudSyncSettingResponse.java diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetConfigResponse.java b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/GetConfigResponse.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetConfigResponse.java rename to play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/GetConfigResponse.java diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetConfigsResponse.java b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/GetConfigsResponse.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetConfigsResponse.java rename to play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/GetConfigsResponse.java diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetConnectedNodesResponse.java b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/GetConnectedNodesResponse.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetConnectedNodesResponse.java rename to play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/GetConnectedNodesResponse.java diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetDataItemResponse.java b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/GetDataItemResponse.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetDataItemResponse.java rename to play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/GetDataItemResponse.java diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetFdForAssetResponse.java b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/GetFdForAssetResponse.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetFdForAssetResponse.java rename to play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/GetFdForAssetResponse.java diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetLocalNodeResponse.java b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/GetLocalNodeResponse.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/wearable/internal/GetLocalNodeResponse.java rename to play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/GetLocalNodeResponse.java diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/MessageEventParcelable.java b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/MessageEventParcelable.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/wearable/internal/MessageEventParcelable.java rename to play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/MessageEventParcelable.java diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/NodeParcelable.java b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/NodeParcelable.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/wearable/internal/NodeParcelable.java rename to play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/NodeParcelable.java diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/PutDataRequest.java b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/PutDataRequest.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/wearable/internal/PutDataRequest.java rename to play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/PutDataRequest.java diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/PutDataResponse.java b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/PutDataResponse.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/wearable/internal/PutDataResponse.java rename to play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/PutDataResponse.java diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/RemoveListenerRequest.java b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/RemoveListenerRequest.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/wearable/internal/RemoveListenerRequest.java rename to play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/RemoveListenerRequest.java diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/SendMessageResponse.java b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/SendMessageResponse.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/wearable/internal/SendMessageResponse.java rename to play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/SendMessageResponse.java diff --git a/play-services-api/src/main/java/com/google/android/gms/wearable/internal/StorageInfoResponse.java b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/StorageInfoResponse.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/wearable/internal/StorageInfoResponse.java rename to play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/StorageInfoResponse.java diff --git a/settings.gradle b/settings.gradle index 22f70d94..7a2ffd82 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,2 +1,6 @@ include ':play-services-api' +include ':play-services-cast-api' +include ':play-services-common-api' +include ':play-services-location-api' +include ':play-services-wearable-api' include ':safe-parcel' From 4eaec4e534ba4c161e3245eb8d693c6ba9112490 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Fri, 5 Aug 2016 16:13:51 +0200 Subject: [PATCH 163/293] Fix typo #4 --- .../google/android/gms/wearable/internal/IWearableService.aidl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/play-services-wearable-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableService.aidl b/play-services-wearable-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableService.aidl index 4b0acb5f..c449ee36 100644 --- a/play-services-wearable-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableService.aidl +++ b/play-services-wearable-api/src/main/aidl/com/google/android/gms/wearable/internal/IWearableService.aidl @@ -42,7 +42,7 @@ interface IWearableService { void addListener(IWearableCallbacks callbacks, in AddListenerRequest request) = 15; void removeListener(IWearableCallbacks callbacks, in RemoveListenerRequest request) = 16; - void getStrorageInformation(IWearableCallbacks callbacks) = 17; + void getStorageInformation(IWearableCallbacks callbacks) = 17; void clearStorage(IWearableCallbacks callbacks) = 18; void endCall(IWearableCallbacks callbacks) = 24; From 59558720d9120a6d15d5db793ab376b009572427 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Sat, 6 Aug 2016 16:16:12 +0200 Subject: [PATCH 164/293] Extract play-services-iid-api --- play-services-api/build.gradle | 1 + .../java/org/microg/gms/gcm/GcmConstants.java | 0 play-services-iid-api/build.gradle | 55 +++++++++++++++++++ .../src/main/AndroidManifest.xml | 24 ++++++++ .../android/gms/iid/IMessengerCompat.aidl | 0 .../android/gms/iid/MessengerCompat.java | 0 settings.gradle | 1 + 7 files changed, 81 insertions(+) rename {play-services-api => play-services-common-api}/src/main/java/org/microg/gms/gcm/GcmConstants.java (100%) create mode 100644 play-services-iid-api/build.gradle create mode 100644 play-services-iid-api/src/main/AndroidManifest.xml rename {play-services-api => play-services-iid-api}/src/main/aidl/com/google/android/gms/iid/IMessengerCompat.aidl (100%) rename {play-services-api => play-services-iid-api}/src/main/java/com/google/android/gms/iid/MessengerCompat.java (100%) diff --git a/play-services-api/build.gradle b/play-services-api/build.gradle index 5b5dd33e..9b97d190 100644 --- a/play-services-api/build.gradle +++ b/play-services-api/build.gradle @@ -53,6 +53,7 @@ android { dependencies { compile project(':play-services-cast-api') compile project(':play-services-common-api') + compile project(':play-services-iid-api') compile project(':play-services-location-api') compile project(':play-services-wearable-api') } diff --git a/play-services-api/src/main/java/org/microg/gms/gcm/GcmConstants.java b/play-services-common-api/src/main/java/org/microg/gms/gcm/GcmConstants.java similarity index 100% rename from play-services-api/src/main/java/org/microg/gms/gcm/GcmConstants.java rename to play-services-common-api/src/main/java/org/microg/gms/gcm/GcmConstants.java diff --git a/play-services-iid-api/build.gradle b/play-services-iid-api/build.gradle new file mode 100644 index 00000000..47f513a0 --- /dev/null +++ b/play-services-iid-api/build.gradle @@ -0,0 +1,55 @@ +/* + * Copyright 2013-2015 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. + */ + +buildscript { + repositories { + jcenter() + } + dependencies { + classpath 'com.android.tools.build:gradle:2.1.2' + } +} + +apply plugin: 'com.android.library' + +String getMyVersionName() { + def stdout = new ByteArrayOutputStream() + if (rootProject.file("gradlew").exists()) + exec { commandLine 'git', 'describe', '--tags', '--always', '--dirty'; standardOutput = stdout } + else // automatic build system, don't tag dirty + exec { commandLine 'git', 'describe', '--tags', '--always'; standardOutput = stdout } + return stdout.toString().trim().substring(1) +} + +group = 'org.microg' +version = getMyVersionName() + +android { + compileSdkVersion 23 + buildToolsVersion "23.0.3" + + defaultConfig { + versionName getMyVersionName() + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_6 + } +} + +dependencies { + compile project(':play-services-common-api') +} diff --git a/play-services-iid-api/src/main/AndroidManifest.xml b/play-services-iid-api/src/main/AndroidManifest.xml new file mode 100644 index 00000000..fa9ea1be --- /dev/null +++ b/play-services-iid-api/src/main/AndroidManifest.xml @@ -0,0 +1,24 @@ + + + + + + + + + diff --git a/play-services-api/src/main/aidl/com/google/android/gms/iid/IMessengerCompat.aidl b/play-services-iid-api/src/main/aidl/com/google/android/gms/iid/IMessengerCompat.aidl similarity index 100% rename from play-services-api/src/main/aidl/com/google/android/gms/iid/IMessengerCompat.aidl rename to play-services-iid-api/src/main/aidl/com/google/android/gms/iid/IMessengerCompat.aidl diff --git a/play-services-api/src/main/java/com/google/android/gms/iid/MessengerCompat.java b/play-services-iid-api/src/main/java/com/google/android/gms/iid/MessengerCompat.java similarity index 100% rename from play-services-api/src/main/java/com/google/android/gms/iid/MessengerCompat.java rename to play-services-iid-api/src/main/java/com/google/android/gms/iid/MessengerCompat.java diff --git a/settings.gradle b/settings.gradle index 7a2ffd82..b13b2661 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,6 +1,7 @@ include ':play-services-api' include ':play-services-cast-api' include ':play-services-common-api' +include ':play-services-iid-api' include ':play-services-location-api' include ':play-services-wearable-api' include ':safe-parcel' From be6af2eeb76ba4bcc1700285f2ba87f217ab6ac2 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Sun, 7 Aug 2016 14:32:40 +0200 Subject: [PATCH 165/293] Add more instance id specific constants for gcm --- .../main/java/org/microg/gms/gcm/GcmConstants.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/play-services-common-api/src/main/java/org/microg/gms/gcm/GcmConstants.java b/play-services-common-api/src/main/java/org/microg/gms/gcm/GcmConstants.java index f035c1ba..317c74ad 100644 --- a/play-services-common-api/src/main/java/org/microg/gms/gcm/GcmConstants.java +++ b/play-services-common-api/src/main/java/org/microg/gms/gcm/GcmConstants.java @@ -30,6 +30,10 @@ public final class GcmConstants { public static final String ACTION_INSTANCE_ID = "com.google.android.gms.iid.InstanceID"; public static final String EXTRA_APP = "app"; + public static final String EXTRA_APP_ID = "appid"; + public static final String EXTRA_APP_VERSION_CODE = "app_ver"; + public static final String EXTRA_APP_VERSION_NAME = "app_ver_name"; + public static final String EXTRA_CLIENT_VERSION = "cliv"; public static final String EXTRA_COMPONENT = "component"; public static final String EXTRA_COLLAPSE_KEY = "collapse_key"; public static final String EXTRA_DELAY = "google.delay"; @@ -37,10 +41,15 @@ public final class GcmConstants { public static final String EXTRA_ERROR = "error"; public static final String EXTRA_FROM = "from"; public static final String EXTRA_GSF_INTENT = "GSF"; + public static final String EXTRA_GMS_VERSION = "gmsv"; + public static final String EXTRA_IS_MESSENGER2 = "messenger2"; + public static final String EXTRA_KID = "kid"; public static final String EXTRA_MESSENGER = "google.messenger"; public static final String EXTRA_MESSAGE_TYPE = "message_type"; public static final String EXTRA_MESSAGE_ID = "google.message_id"; + public static final String EXTRA_OS_VERSION = "osv"; public static final String EXTRA_PENDING_INTENT = "com.google.android.gms.gcm.PENDING_INTENT"; + public static final String EXTRA_PUBLIC_KEY = "pub2"; public static final String EXTRA_RAWDATA = "rawData"; public static final String EXTRA_RAWDATA_BASE64 = "gcm.rawData64"; public static final String EXTRA_REGISTRATION_ID = "registration_id"; @@ -51,8 +60,10 @@ public final class GcmConstants { public static final String EXTRA_SENDER_LEGACY = "legacy.sender"; public static final String EXTRA_SEND_TO = "google.to"; public static final String EXTRA_SEND_FROM = "google.from"; + public static final String EXTRA_SIGNATURE = "sig"; public static final String EXTRA_SUBSCIPTION = "subscription"; public static final String EXTRA_SUBTYPE = "subtype"; + public static final String EXTRA_USE_GSF = "useGsf"; public static final String EXTRA_TAG = "tag"; public static final String EXTRA_TOPIC = "gcm.topic"; public static final String EXTRA_TTL = "google.ttl"; From 3bb89224dc28fddce7049e3e693c320e79514318 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Sun, 7 Aug 2016 18:13:17 +0200 Subject: [PATCH 166/293] Big restructure and add GCM and IID client --- LICENSE | 177 ++++++++ build.gradle | 9 - extern/GmsApi | 2 +- play-services-base/build.gradle | 18 +- .../src/main/AndroidManifest.xml | 17 +- .../android/gms/common/ConnectionResult.java | 113 ++++- .../gms/common/GoogleApiAvailability.java | 290 ++++++++++++ .../gms/common/GooglePlayServicesUtil.java | 161 ++++++- .../android/gms/gcm/GoogleCloudMessaging.java | 115 ----- play-services-cast-api | 1 + play-services-cast/build.gradle | 14 +- play-services-common-api | 1 + play-services-gcm/build.gradle | 16 +- .../src/main/AndroidManifest.xml | 7 + .../com/google/android/gms/gcm/GcmPubSub.java | 5 +- .../google/android/gms/gcm/GcmReceiver.java | 80 +++- .../android/gms/gcm/GoogleCloudMessaging.java | 101 +++-- .../android/gms/gcm/PendingCallback.java | 59 +++ .../org/microg/gms/gcm/CloudMessagingRpc.java | 165 +++++++ play-services-iid-api | 1 + play-services-iid/build.gradle | 53 +++ .../src/main/AndroidManifest.xml | 28 ++ .../google/android/gms/iid/InstanceID.java | 123 ++++- .../gms/iid/InstanceIDListenerService.java | 6 +- .../org/microg/gms/iid/InstanceIdRpc.java | 423 ++++++++++++++++++ .../org/microg/gms/iid/InstanceIdStore.java | 111 +++++ play-services-location-api | 1 + play-services-location/build.gradle | 14 +- play-services-tasks/build.gradle | 52 +++ .../src/main/AndroidManifest.xml | 24 + .../android/gms/tasks/Continuation.java | 68 +++ .../android/gms/tasks/OnCompleteListener.java | 34 ++ .../android/gms/tasks/OnFailureListener.java | 35 ++ .../android/gms/tasks/OnSuccessListener.java | 34 ++ .../gms/tasks/RuntimeExecutionException.java | 33 ++ .../com/google/android/gms/tasks/Task.java | 224 ++++++++++ .../gms/tasks/TaskCompletionSource.java | 52 +++ .../com/google/android/gms/tasks/Tasks.java | 116 +++++ play-services-wearable-api | 1 + play-services-wearable/build.gradle | 14 +- .../android/gms/wearable/DataEventBuffer.java | 2 +- .../android/gms/wearable/DataItemBuffer.java | 2 +- play-services/build.gradle | 11 +- settings.gradle | 7 + 44 files changed, 2604 insertions(+), 216 deletions(-) create mode 100644 LICENSE create mode 100644 play-services-base/src/main/java/com/google/android/gms/common/GoogleApiAvailability.java delete mode 100644 play-services-base/src/main/java/com/google/android/gms/gcm/GoogleCloudMessaging.java create mode 120000 play-services-cast-api create mode 120000 play-services-common-api create mode 100644 play-services-gcm/src/main/java/com/google/android/gms/gcm/PendingCallback.java create mode 100644 play-services-gcm/src/main/java/org/microg/gms/gcm/CloudMessagingRpc.java create mode 120000 play-services-iid-api create mode 100644 play-services-iid/build.gradle create mode 100644 play-services-iid/src/main/AndroidManifest.xml rename {play-services-gcm => play-services-iid}/src/main/java/com/google/android/gms/iid/InstanceID.java (56%) rename {play-services-gcm => play-services-iid}/src/main/java/com/google/android/gms/iid/InstanceIDListenerService.java (95%) create mode 100644 play-services-iid/src/main/java/org/microg/gms/iid/InstanceIdRpc.java create mode 100644 play-services-iid/src/main/java/org/microg/gms/iid/InstanceIdStore.java create mode 120000 play-services-location-api create mode 100644 play-services-tasks/build.gradle create mode 100644 play-services-tasks/src/main/AndroidManifest.xml create mode 100644 play-services-tasks/src/main/java/com/google/android/gms/tasks/Continuation.java create mode 100644 play-services-tasks/src/main/java/com/google/android/gms/tasks/OnCompleteListener.java create mode 100644 play-services-tasks/src/main/java/com/google/android/gms/tasks/OnFailureListener.java create mode 100644 play-services-tasks/src/main/java/com/google/android/gms/tasks/OnSuccessListener.java create mode 100644 play-services-tasks/src/main/java/com/google/android/gms/tasks/RuntimeExecutionException.java create mode 100644 play-services-tasks/src/main/java/com/google/android/gms/tasks/Task.java create mode 100644 play-services-tasks/src/main/java/com/google/android/gms/tasks/TaskCompletionSource.java create mode 100644 play-services-tasks/src/main/java/com/google/android/gms/tasks/Tasks.java create mode 120000 play-services-wearable-api diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..f433b1a5 --- /dev/null +++ b/LICENSE @@ -0,0 +1,177 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS diff --git a/build.gradle b/build.gradle index c6c27343..504fe91d 100644 --- a/build.gradle +++ b/build.gradle @@ -15,16 +15,7 @@ */ // Top-level build file where you can add configuration options common to all sub-projects/modules. -String getMyVersionName() { - def stdout = new ByteArrayOutputStream() - if (rootProject.file("gradlew").exists()) - exec { commandLine 'git', 'describe', '--tags', '--always', '--dirty'; standardOutput = stdout } - else // automatic build system, don't tag dirty - exec { commandLine 'git', 'describe', '--tags', '--always'; standardOutput = stdout } - return stdout.toString().trim().substring(1) -} subprojects { group = 'org.microg' - version = getMyVersionName() } diff --git a/extern/GmsApi b/extern/GmsApi index 6aa11065..be6af2ee 160000 --- a/extern/GmsApi +++ b/extern/GmsApi @@ -1 +1 @@ -Subproject commit 6aa110657beec0b3e6c26d1030943e0b97683335 +Subproject commit be6af2eeb76ba4bcc1700285f2ba87f217ab6ac2 diff --git a/play-services-base/build.gradle b/play-services-base/build.gradle index 52ff3bd9..bfb54b6f 100644 --- a/play-services-base/build.gradle +++ b/play-services-base/build.gradle @@ -19,15 +19,24 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:2.0.0' + classpath 'com.android.tools.build:gradle:2.1.2' } } apply plugin: 'com.android.library' +String getMyVersionName() { + def stdout = new ByteArrayOutputStream() + if (rootProject.file("gradlew").exists()) + exec { commandLine 'git', 'describe', '--tags', '--always', '--dirty'; standardOutput = stdout } + else // automatic build system, don't tag dirty + exec { commandLine 'git', 'describe', '--tags', '--always'; standardOutput = stdout } + return stdout.toString().trim().substring(1) +} + android { compileSdkVersion 23 - buildToolsVersion "23.0.2" + buildToolsVersion "23.0.3" defaultConfig { versionName getMyVersionName() @@ -39,6 +48,7 @@ android { } dependencies { - compile 'com.android.support:support-v4:23.3.0' - compile project(':play-services-api') + compile 'com.android.support:support-v4:23.4.0' + compile project(':play-services-common-api') + compile project(':play-services-tasks') } diff --git a/play-services-base/src/main/AndroidManifest.xml b/play-services-base/src/main/AndroidManifest.xml index 8b7acc02..2aa07523 100644 --- a/play-services-base/src/main/AndroidManifest.xml +++ b/play-services-base/src/main/AndroidManifest.xml @@ -15,10 +15,19 @@ ~ limitations under the License. --> - + - + - + + + + + diff --git a/play-services-base/src/main/java/com/google/android/gms/common/ConnectionResult.java b/play-services-base/src/main/java/com/google/android/gms/common/ConnectionResult.java index dbd87044..f6f75c1a 100644 --- a/play-services-base/src/main/java/com/google/android/gms/common/ConnectionResult.java +++ b/play-services-base/src/main/java/com/google/android/gms/common/ConnectionResult.java @@ -20,9 +20,12 @@ import android.app.Activity; import android.app.PendingIntent; import android.content.Intent; import android.content.IntentSender; +import android.text.TextUtils; import com.google.android.gms.common.api.GoogleApiClient; +import java.util.Arrays; + /** * Contains all possible error codes for when a client fails to connect to Google Play services. * These error codes are used by {@link GoogleApiClient.OnConnectionFailedListener}. @@ -128,8 +131,18 @@ public class ConnectionResult { @Deprecated public static final int DRIVE_EXTERNAL_STORAGE_REQUIRED = 1500; - private final PendingIntent pendingIntent; private final int statusCode; + private final PendingIntent pendingIntent; + private final String message; + + /** + * Creates a connection result. + * + * @param statusCode The status code. + */ + public ConnectionResult(int statusCode) { + this(statusCode, null); + } /** * Creates a connection result. @@ -138,8 +151,89 @@ public class ConnectionResult { * @param pendingIntent A pending intent that will resolve the issue when started, or null. */ public ConnectionResult(int statusCode, PendingIntent pendingIntent) { + this(statusCode, pendingIntent, getStatusString(statusCode)); + } + + /** + * Creates a connection result. + * + * @param statusCode The status code. + * @param pendingIntent A pending intent that will resolve the issue when started, or null. + * @param message An additional error message for the connection result, or null. + */ + public ConnectionResult(int statusCode, PendingIntent pendingIntent, String message) { this.statusCode = statusCode; this.pendingIntent = pendingIntent; + this.message = message; + } + + static String getStatusString(int statusCode) { + switch (statusCode) { + case -1: + return "UNKNOWN"; + case 0: + return "SUCCESS"; + case 1: + return "SERVICE_MISSING"; + case 2: + return "SERVICE_VERSION_UPDATE_REQUIRED"; + case 3: + return "SERVICE_DISABLED"; + case 4: + return "SIGN_IN_REQUIRED"; + case 5: + return "INVALID_ACCOUNT"; + case 6: + return "RESOLUTION_REQUIRED"; + case 7: + return "NETWORK_ERROR"; + case 8: + return "INTERNAL_ERROR"; + case 9: + return "SERVICE_INVALID"; + case 10: + return "DEVELOPER_ERROR"; + case 11: + return "LICENSE_CHECK_FAILED"; + case 13: + return "CANCELED"; + case 14: + return "TIMEOUT"; + case 15: + return "INTERRUPTED"; + case 16: + return "API_UNAVAILABLE"; + case 17: + return "SIGN_IN_FAILED"; + case 18: + return "SERVICE_UPDATING"; + case 19: + return "SERVICE_MISSING_PERMISSION"; + case 20: + return "RESTRICTED_PROFILE"; + case 21: + return "API_VERSION_UPDATE_REQUIRED"; + case 42: + return "UPDATE_ANDROID_WEAR"; + case 99: + return "UNFINISHED"; + case 1500: + return "DRIVE_EXTERNAL_STORAGE_REQUIRED"; + default: + return "UNKNOWN_ERROR_CODE(" + statusCode + ")"; + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } else if (!(o instanceof ConnectionResult)) { + return false; + } else { + ConnectionResult r = (ConnectionResult)o; + return statusCode == r.statusCode && pendingIntent == null ? r.pendingIntent == null : pendingIntent.equals(r.pendingIntent) && TextUtils.equals(message, r.message); + } } /** @@ -151,6 +245,15 @@ public class ConnectionResult { return statusCode; } + /** + * Returns an error message for connection result. + * + * @return the message + */ + public String getErrorMessage() { + return message; + } + /** * A pending intent to resolve the connection failure. This intent can be started with * {@link Activity#startIntentSenderForResult(IntentSender, int, Intent, int, int, int)} to @@ -162,6 +265,11 @@ public class ConnectionResult { return pendingIntent; } + @Override + public int hashCode() { + return Arrays.hashCode(new Object[]{statusCode, pendingIntent, message}); + } + /** * Returns {@code true} if calling {@link #startResolutionForResult(Activity, int)} will start * any intents requiring user interaction. @@ -196,8 +304,7 @@ public class ConnectionResult { public void startResolutionForResult(Activity activity, int requestCode) throws IntentSender.SendIntentException { if (hasResolution()) { - activity.startIntentSenderForResult(pendingIntent.getIntentSender(), requestCode, null, - 0, 0, 0); + activity.startIntentSenderForResult(pendingIntent.getIntentSender(), requestCode, null, 0, 0, 0); } } } 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 new file mode 100644 index 00000000..b7129e18 --- /dev/null +++ b/play-services-base/src/main/java/com/google/android/gms/common/GoogleApiAvailability.java @@ -0,0 +1,290 @@ +/* + * Copyright 2013-2016 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.common; + +import android.app.Activity; +import android.app.Dialog; +import android.app.PendingIntent; +import android.content.Context; +import android.content.DialogInterface; +import android.os.Bundle; +import android.support.v4.app.FragmentActivity; +import android.util.Log; + +import com.google.android.gms.common.api.GoogleApiClient.OnConnectionFailedListener; +import com.google.android.gms.tasks.Task; +import com.google.android.gms.tasks.Tasks; + +import org.microg.gms.common.Constants; +import org.microg.gms.common.PublicApi; + +import static com.google.android.gms.common.ConnectionResult.INTERNAL_ERROR; +import static com.google.android.gms.common.ConnectionResult.INVALID_ACCOUNT; +import static com.google.android.gms.common.ConnectionResult.NETWORK_ERROR; +import static com.google.android.gms.common.ConnectionResult.RESOLUTION_REQUIRED; +import static com.google.android.gms.common.ConnectionResult.SERVICE_DISABLED; +import static com.google.android.gms.common.ConnectionResult.SERVICE_INVALID; +import static com.google.android.gms.common.ConnectionResult.SERVICE_MISSING; +import static com.google.android.gms.common.ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED; +import static com.google.android.gms.common.ConnectionResult.SIGN_IN_REQUIRED; +import static com.google.android.gms.common.ConnectionResult.SUCCESS; + +@PublicApi +public class GoogleApiAvailability { + private static final String TAG = "GmsApiAvailability"; + + /** + * Package name for Google Play services. + */ + public static final String GOOGLE_PLAY_SERVICES_PACKAGE = Constants.GMS_PACKAGE_NAME; + + /** + * Google Play services client library version (declared in library's AndroidManifest.xml android:versionCode). + */ + public static final int GOOGLE_PLAY_SERVICES_VERSION_CODE = Constants.MAX_REFERENCE_VERSION; + + private static GoogleApiAvailability instance; + + private GoogleApiAvailability() { + } + + /** + * Returns the singleton instance of GoogleApiAvailability. + */ + public static GoogleApiAvailability getInstance() { + if (instance == null) { + synchronized (GoogleApiAvailability.class) { + if (instance == null) { + instance = new GoogleApiAvailability(); + } + } + } + return instance; + } + + + /** + * Returns a dialog to address the provided errorCode. The returned dialog displays a localized + * message about the error and upon user confirmation (by tapping on dialog) will direct them + * to the Play Store if Google Play services is out of date or missing, or to system settings + * if Google Play services is disabled on the device. + * + * @param activity parent activity for creating the dialog, also used for identifying language to display dialog in. + * @param errorCode error code returned by {@link #isGooglePlayServicesAvailable(Context)} call. + * If errorCode is {@link ConnectionResult#SUCCESS} then null is returned. + * @param requestCode The requestCode given when calling startActivityForResult. + */ + public Dialog getErrorDialog(Activity activity, int errorCode, int requestCode) { + return getErrorDialog(activity, errorCode, requestCode, null); + } + + /** + * Returns a dialog to address the provided errorCode. The returned dialog displays a localized + * message about the error and upon user confirmation (by tapping on dialog) will direct them + * to the Play Store if Google Play services is out of date or missing, or to system settings + * if Google Play services is disabled on the device. + * + * @param activity parent activity for creating the dialog, also used for identifying language to display dialog in. + * @param errorCode error code returned by {@link #isGooglePlayServicesAvailable(Context)} call. + * If errorCode is {@link ConnectionResult#SUCCESS} then null is returned. + * @param requestCode The requestCode given when calling startActivityForResult. + * @param cancelListener The {@link DialogInterface.OnCancelListener} to invoke if the dialog is canceled. + */ + public Dialog getErrorDialog(Activity activity, int errorCode, int requestCode, DialogInterface.OnCancelListener cancelListener) { + // TODO + return null; + } + + /** + * Returns a PendingIntent to address the provided connection failure. + *

+ * If {@link ConnectionResult#hasResolution()} is true, then {@link ConnectionResult#getResolution()} + * will be returned. Otherwise, the returned PendingIntent will direct the user to either the + * Play Store if Google Play services is out of date or missing, or system settings if Google + * Play services is disabled on the device. + * + * @param context parent context for creating the PendingIntent. + * @param result the connection failure. If successful or the error is not resolvable by the user, null is returned. + */ + public PendingIntent getErrorResolutionPendingIntent(Context context, ConnectionResult result) { + if (result.hasResolution()) { + return result.getResolution(); + } + return getErrorResolutionPendingIntent(context, result.getErrorCode(), 0); + } + + /** + * Returns a PendingIntent to address the provided errorCode. It will direct the user to either + * the Play Store if Google Play services is out of date or missing, or system settings if + * Google Play services is disabled on the device. + * + * @param context parent context for creating the PendingIntent. + * @param errorCode error code returned by {@link #isGooglePlayServicesAvailable(Context)} call. + * If errorCode is {@link ConnectionResult#SUCCESS} then null is returned. + * @param requestCode The requestCode given when calling startActivityForResult. + */ + public PendingIntent getErrorResolutionPendingIntent(Context context, int errorCode, int requestCode) { + // TODO + return null; + } + + /** + * Returns a human-readable string of the error code returned from {@link #isGooglePlayServicesAvailable(Context)}. + */ + public final String getErrorString(int errorCode) { + return ConnectionResult.getStatusString(errorCode); + } + + /** + * 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. + * + * @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) { + Log.d(TAG, "As we can't know right now if the later desired feature is available, " + + "we just pretend it to be."); + return SUCCESS; + } + + /** + * Determines whether an error can be resolved via user action. If true, proceed by calling + * {@link #getErrorDialog(Activity, int, int)} and showing the dialog. + * + * @param errorCode error code returned by {@link #isGooglePlayServicesAvailable(Context)}, or + * returned to your application via {@link OnConnectionFailedListener#onConnectionFailed(ConnectionResult)} + * @return true if the error is resolvable with {@link #getErrorDialog(Activity, int, int)} + */ + public final boolean isUserResolvableError(int errorCode) { + switch (errorCode) { + case SERVICE_MISSING: + case SERVICE_VERSION_UPDATE_REQUIRED: + case SERVICE_DISABLED: + case SERVICE_INVALID: + return true; + case SIGN_IN_REQUIRED: + case INVALID_ACCOUNT: + case RESOLUTION_REQUIRED: + case NETWORK_ERROR: + case INTERNAL_ERROR: + default: + return false; + } + } + + /** + * Attempts to make Google Play services available on this device. If Play Services is already + * available, the returned {@link Task} may complete immediately. + *

+ * If it is necessary to display UI in order to complete this request (e.g. sending the user + * to the Google Play store) the passed {@link Activity} will be used to display this UI. + *

+ * It is recommended to call this method from {@link Activity#onCreate(Bundle)}. + * If the passed {@link Activity} completes before the returned {@link Task} completes, the + * Task will fail with a {@link java.util.concurrent.CancellationException}. + *

+ * This method must be called from the main thread. + * + * @return A {@link Task}. If this Task completes without throwing an exception, Play Services + * is available on this device. + */ + public Task makeGooglePlayServicesAvailable(Activity activity) { + int status = isGooglePlayServicesAvailable(activity); + if (status == SUCCESS) { + return Tasks.forResult(null); + } + // TODO + return Tasks.forResult(null); + } + + /** + * Displays a DialogFragment for an error code returned by {@link #isGooglePlayServicesAvailable(Context)}. + * + * @param activity parent activity for creating the dialog, also used for identifying language to display dialog in. + * @param errorCode error code returned by {@link #isGooglePlayServicesAvailable(Context)} call. + * If errorCode is {@link ConnectionResult#SUCCESS} then null is returned. + * @param requestCode The requestCode given when calling startActivityForResult. + * @return true if the dialog is shown, false otherwise + * @throws RuntimeException if API level is below 11 and activity is not a {@link FragmentActivity}. + * @see ErrorDialogFragment + * @see SupportErrorDialogFragmet + */ + public boolean showErrorDialogFragment(Activity activity, int errorCode, int requestCode) { + return showErrorDialogFragment(activity, errorCode, requestCode, null); + } + + /** + * Displays a DialogFragment for an error code returned by {@link #isGooglePlayServicesAvailable(Context)}. + * + * @param activity parent activity for creating the dialog, also used for identifying language to display dialog in. + * @param errorCode error code returned by {@link #isGooglePlayServicesAvailable(Context)} call. + * If errorCode is {@link ConnectionResult#SUCCESS} then null is returned. + * @param requestCode The requestCode given when calling startActivityForResult. + * @param cancelListener The {@link DialogInterface.OnCancelListener} to invoke if the dialog is canceled. + * @return true if the dialog is shown, false otherwise + * @throws RuntimeException if API level is below 11 and activity is not a {@link FragmentActivity}. + * @see ErrorDialogFragment + * @see SupportErrorDialogFragmet + */ + public boolean showErrorDialogFragment(Activity activity, int errorCode, int requestCode, DialogInterface.OnCancelListener cancelListener) { + Dialog dialog = getErrorDialog(activity, errorCode, requestCode, cancelListener); + if (dialog == null) { + return false; + } else { + // TODO + return false; + } + } + + /** + * Displays a notification for an error code returned from + * {@link #isGooglePlayServicesAvailable(Context)}, if it is resolvable by the user. + *

+ * This method is similar to {@link #getErrorDialog(int, android.app.Activity, int)}, but is + * provided for background tasks that cannot or should not display dialogs. + * + * @param errorCode error code returned by {@link #isGooglePlayServicesAvailable(Context)} call. + * If errorCode is {@link ConnectionResult#SUCCESS} then null is returned. + * @param context used for identifying language to display dialog in as well as accessing the + * {@link android.app.NotificationManager}. + */ + public void showErrorNotification(Context context, int errorCode) { + if (errorCode == RESOLUTION_REQUIRED) { + Log.e(TAG, "showErrorNotification(context, errorCode) is called for RESOLUTION_REQUIRED when showErrorNotification(context, result) should be called"); + } + + if (isUserResolvableError(errorCode)) { + GooglePlayServicesUtil.showErrorNotification(errorCode, context); + } + } + + /** + * Displays a notification for a connection failure, if it is resolvable by the user. + * + * @param context The calling context used to display the notification. + * @param result The connection failure. If successful or the error is not resolvable by the + * user, no notification is shown. + */ + public void showErrorNotification(Context context, ConnectionResult result) { + PendingIntent pendingIntent = getErrorResolutionPendingIntent(context, result); + if (pendingIntent != null) { + // TODO + } + } +} diff --git a/play-services-base/src/main/java/com/google/android/gms/common/GooglePlayServicesUtil.java b/play-services-base/src/main/java/com/google/android/gms/common/GooglePlayServicesUtil.java index faaa6adc..dd67e42f 100644 --- a/play-services-base/src/main/java/com/google/android/gms/common/GooglePlayServicesUtil.java +++ b/play-services-base/src/main/java/com/google/android/gms/common/GooglePlayServicesUtil.java @@ -23,6 +23,7 @@ import android.app.PendingIntent; import android.content.Context; import android.content.DialogInterface; import android.content.pm.PackageManager; +import android.content.res.Resources; import android.util.Log; import org.microg.gms.common.Constants; @@ -35,69 +36,199 @@ import org.microg.gms.common.PublicApi; *

* TODO: methods :) */ +@PublicApi public class GooglePlayServicesUtil { private static final String TAG = "GooglePlayServicesUtil"; public static final String GMS_ERROR_DIALOG = "GooglePlayServicesErrorDialog"; + + /** + * Package name for Google Play services. + */ + @Deprecated public static final String GOOGLE_PLAY_SERVICES_PACKAGE = Constants.GMS_PACKAGE_NAME; + + /** + * Google Play services client library version (declared in library's AndroidManifest.xml android:versionCode). + */ + @Deprecated public static final int GOOGLE_PLAY_SERVICES_VERSION_CODE = Constants.MAX_REFERENCE_VERSION; + + /** + * Package name for Google Play Store. + */ public static final String GOOGLE_PLAY_STORE_PACKAGE = "com.android.vending"; + /** + * Returns a dialog to address the provided errorCode. The returned dialog displays a localized + * message about the error and upon user confirmation (by tapping on dialog) will direct them + * to the Play Store if Google Play services is out of date or missing, or to system settings + * if Google Play services is disabled on the device. + * + * @param errorCode error code returned by {@link #isGooglePlayServicesAvailable(Context)} call. + * If errorCode is {@link ConnectionResult#SUCCESS} then null is returned. + * @param activity parent activity for creating the dialog, also used for identifying + * language to display dialog in. + * @param requestCode The requestCode given when calling startActivityForResult. + */ + @Deprecated public static Dialog getErrorDialog(int errorCode, Activity activity, int requestCode) { - return null; // TODO + return getErrorDialog(errorCode, activity, requestCode, null); } - public static Dialog getErrorDialog(int errorCode, Activity activity, int requestCode, - DialogInterface.OnCancelListener cancelListener) { - return null; // TODO + /** + * Returns a dialog to address the provided errorCode. The returned dialog displays a localized + * message about the error and upon user confirmation (by tapping on dialog) will direct them + * to the Play Store if Google Play services is out of date or missing, or to system settings + * if Google Play services is disabled on the device. + * + * @param errorCode error code returned by {@link #isGooglePlayServicesAvailable(Context)} call. + * If errorCode is {@link ConnectionResult#SUCCESS} then null is returned. + * @param activity parent activity for creating the dialog, also used for identifying + * language to display dialog in. + * @param requestCode The requestCode given when calling startActivityForResult. + * @param cancelListener The {@link DialogInterface.OnCancelListener} to invoke if the dialog + * is canceled. + */ + @Deprecated + public static Dialog getErrorDialog(int errorCode, Activity activity, int requestCode, DialogInterface.OnCancelListener cancelListener) { + return GoogleApiAvailability.getInstance().getErrorDialog(activity, errorCode, requestCode, cancelListener); } + /** + * Returns a PendingIntent to address the provided errorCode. It will direct them to one of the + * following places to either the Play Store if Google Play services is out of date or missing, + * or system settings if Google Play services is disabled on the device. + * + * @param errorCode error code returned by {@link #isGooglePlayServicesAvailable(Context)} call. + * If errorCode is {@link ConnectionResult#SUCCESS} then null is returned. + * @param activity parent context for creating the PendingIntent. + * @param requestCode The requestCode given when calling startActivityForResult. + */ + @Deprecated public static PendingIntent getErrorPendingIntent(int errorCode, Activity activity, - int requestCode) { + int requestCode) { return null; // TODO } + /** + * Returns a human-readable string of the error code returned from {@link #isGooglePlayServicesAvailable(Context)}. + */ + @Deprecated public static String getErrorString(int errorCode) { return null; // TODO } + /** + * Returns the open source software license information for the Google Play services + * application, or null if Google Play services is not available on this device. + */ + @Deprecated public static String getOpenSourceSoftwareLicenseInfo(Context context) { return null; // TODO } + /** + * This gets the Context object of the Buddy APK. This loads the Buddy APK code from the Buddy + * APK into memory. This returned context can be used to create classes and obtain resources + * defined in the Buddy APK. + * + * @return The Context object of the Buddy APK or null if the Buddy APK is not installed on the device. + */ public static Context getRemoteContext(Context context) { return null; // TODO } + /** + * This gets the Resources object of the Buddy APK. + * + * @return The Resources object of the Buddy APK or null if the Buddy APK is not installed on the device. + */ + public static Resources getRemoteResources(Context context) { + return null; // TODO + } + + /** + * 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. + * + * @return status code indicating whether there was an error. Can be one of following in + * {@link ConnectionResult}: SUCCESS, SERVICE_MISSING, SERVICE_VERSION_UPDATE_REQUIRED, + * SERVICE_DISABLED, SERVICE_INVALID + */ + @Deprecated public static int isGooglePlayServicesAvailable(Context context) { Log.d(TAG, "As we can't know right now if the later desired feature is available, " + "we just pretend it to be."); return ConnectionResult.SUCCESS; } + @Deprecated public static boolean isGoogleSignedUid(PackageManager packageManager, int uid) { return false; // TODO } + /** + * Determines whether an error is user-recoverable. If true, proceed by calling + * {@link #getErrorDialog(int, Activity, int)} and showing the dialog. + * + * @param errorCode error code returned by {@link #isGooglePlayServicesAvailable(Context)}, or + * returned to your application via {@link com.google.android.gms.common.api.GoogleApiClient.OnConnectionFailedListener#onConnectionFailed(ConnectionResult)} + * @return true if the error is recoverable with {@link #getErrorDialog(int, Activity, int)} + */ + @Deprecated public static boolean isUserRecoverableError(int errorCode) { return false; // TODO } - public static boolean showErrorDialogFragment(int errorCode, Activity activity, - int requestCode) { + /** + * Display a DialogFragment for an error code returned by {@link #isGooglePlayServicesAvailable(Context)}. + * + * @param errorCode error code returned by {@link #isGooglePlayServicesAvailable(Context)} call. + * If errorCode is {@link ConnectionResult#SUCCESS} then null is returned. + * @param activity parent activity for creating the dialog, also used for identifying + * language to display dialog in. + * @param requestCode The requestCode given when calling startActivityForResult. + * @return true if the dialog is shown, false otherwise + * @throws RuntimeException if API level is below 11 and activity is not a {@link android.support.v4.app.FragmentActivity}. + */ + @Deprecated + public static boolean showErrorDialogFragment(int errorCode, Activity activity, int requestCode) { + return showErrorDialogFragment(errorCode, activity, requestCode, null); + } + + @Deprecated + public static boolean showErrorDialogFragment(int errorCode, Activity activity, Fragment fragment, int requestCode, DialogInterface.OnCancelListener cancelListener) { return false; // TODO } - public static boolean showErrorDialogFragment(int errorCode, Activity activity, - Fragment fragment, int requestCode, DialogInterface.OnCancelListener cancelListener) { - return false; // TODO - } - - public static boolean showErrorDialogFragment(int errorCode, Activity activity, int requestCode, - DialogInterface.OnCancelListener cancelListener) { - return false; // TODO + /** + * @param errorCode error code returned by {@link #isGooglePlayServicesAvailable(Context)} call. + * If errorCode is {@link ConnectionResult#SUCCESS} then null is returned. + * @param activity parent activity for creating the dialog, also used for identifying + * language to display dialog in. + * @param requestCode The requestCode given when calling startActivityForResult. + * @param cancelListener The {@link DialogInterface.OnCancelListener} to invoke if the dialog + * is canceled. + * @return true if the dialog is shown, false otherwise. + * @throws RuntimeException if API level is below 11 and activity is not a {@link android.support.v4.app.FragmentActivity}. + */ + @Deprecated + public static boolean showErrorDialogFragment(int errorCode, Activity activity, int requestCode, DialogInterface.OnCancelListener cancelListener) { + return showErrorDialogFragment(errorCode, activity, null, requestCode, cancelListener); } + /** + * Displays a notification relevant to the provided error code. This method is similar to + * {@link #getErrorDialog(int, android.app.Activity, int)}, but is provided for background + * tasks that cannot or shouldn't display dialogs. + * + * @param errorCode error code returned by {@link #isGooglePlayServicesAvailable(Context)} call. + * If errorCode is {@link ConnectionResult#SUCCESS} then null is returned. + * @param context used for identifying language to display dialog in as well as accessing the + * {@link android.app.NotificationManager}. + */ + @Deprecated public static void showErrorNotification(int errorCode, Context context) { // TODO } diff --git a/play-services-base/src/main/java/com/google/android/gms/gcm/GoogleCloudMessaging.java b/play-services-base/src/main/java/com/google/android/gms/gcm/GoogleCloudMessaging.java deleted file mode 100644 index b867ae7a..00000000 --- a/play-services-base/src/main/java/com/google/android/gms/gcm/GoogleCloudMessaging.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright 2013-2015 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.gcm; - -import android.content.Context; -import android.content.Intent; -import android.os.Bundle; - -import java.io.IOException; - -public class GoogleCloudMessaging { - - /** - * The GCM {@link #register(String...)} and {@link #unregister()} methods are blocking. You - * should not run them in the main thread or in broadcast receivers. - */ - public static final String ERROR_MAIN_THREAD = "MAIN_THREAD"; - - /** - * The device can't read the response, or there was a 500/503 from the server that can be - * retried later. The application should use exponential back off and retry. - */ - public static final String ERROR_SERVICE_NOT_AVAILABLE = "SERVICE_NOT_AVAILABLE"; - - /** - * Returned by {@link #getMessageType(Intent)} to indicate that the server deleted some - * pending messages because they were collapsible. - */ - public static final String MESSAGE_TYPE_DELETED = "deleted_messages"; - - /** - * Returned by {@link #getMessageType(Intent)} to indicate a regular message. - */ - public static final String MESSAGE_TYPE_MESSAGE = "gcm"; - - /** - * Returned by {@link #getMessageType(Intent)} to indicate a send error. The intent includes - * the message ID of the message and an error code. - */ - public static final String MESSAGE_TYPE_SEND_ERROR = "send_error"; - - /** - * Return the singleton instance of GCM. - */ - public static synchronized GoogleCloudMessaging getInstance(Context context) { - return null; - } - - /** - * Must be called when your application is done using GCM, to release internal resources. - */ - public void close() { - - } - - /** - * Return the message type from an intent passed into a client app's broadcast receiver. - * There are two general categories of messages passed from the server: regular GCM messages, - * and special GCM status messages. The possible types are: - *

    - *
  • {@link #MESSAGE_TYPE_MESSAGE}—regular message from your server.
  • - *
  • {@link #MESSAGE_TYPE_DELETED}—special status message indicating that some messages have been collapsed by GCM.
  • - *
  • {@link #MESSAGE_TYPE_SEND_ERROR}—special status message indicating that there were errors sending one of the messages.
  • - *
- * You can use this method to filter based on message type. Since it is likely that GCM will - * be extended in the future with new message types, just ignore any message types you're not - * interested in, or that you don't recognize. - * - * @param intent - * @return - */ - public String getMessageType(Intent intent) { - return null; - } - - public String register(String... senderIds) { - return null; - } - - public void send(String to, String msgId, long timeToLive, Bundle data) { - - } - - public void send(String to, String msgId, Bundle data) { - - } - - /** - * Unregister the application. Calling unregister() stops any messages from the server. - * This is a blocking call—you shouldn't call it from the UI thread. - * You should rarely (if ever) need to call this method. Not only is it expensive in terms of - * resources, but it invalidates your registration ID, which you should never change - * unnecessarily. A better approach is to simply have your server stop sending messages. - * Only use unregister if you want to change your sender ID. - * - * @throws IOException if we can't connect to server to unregister. - */ - public void unregister() throws IOException { - - } -} diff --git a/play-services-cast-api b/play-services-cast-api new file mode 120000 index 00000000..36406dfb --- /dev/null +++ b/play-services-cast-api @@ -0,0 +1 @@ +extern/GmsApi/play-services-cast-api/ \ No newline at end of file diff --git a/play-services-cast/build.gradle b/play-services-cast/build.gradle index f900225d..a407e8b6 100644 --- a/play-services-cast/build.gradle +++ b/play-services-cast/build.gradle @@ -19,15 +19,24 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:2.0.0' + classpath 'com.android.tools.build:gradle:2.1.2' } } apply plugin: 'com.android.library' +String getMyVersionName() { + def stdout = new ByteArrayOutputStream() + if (rootProject.file("gradlew").exists()) + exec { commandLine 'git', 'describe', '--tags', '--always', '--dirty'; standardOutput = stdout } + else // automatic build system, don't tag dirty + exec { commandLine 'git', 'describe', '--tags', '--always'; standardOutput = stdout } + return stdout.toString().trim().substring(1) +} + android { compileSdkVersion 23 - buildToolsVersion "23.0.2" + buildToolsVersion "23.0.3" defaultConfig { versionName getMyVersionName() @@ -40,4 +49,5 @@ android { dependencies { compile project(':play-services-base') + compile project(':play-services-cast-api') } diff --git a/play-services-common-api b/play-services-common-api new file mode 120000 index 00000000..c85558d0 --- /dev/null +++ b/play-services-common-api @@ -0,0 +1 @@ +extern/GmsApi/play-services-common-api/ \ No newline at end of file diff --git a/play-services-gcm/build.gradle b/play-services-gcm/build.gradle index b3a6c833..c9b0c102 100644 --- a/play-services-gcm/build.gradle +++ b/play-services-gcm/build.gradle @@ -19,15 +19,24 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:2.0.0' + classpath 'com.android.tools.build:gradle:2.1.2' } } apply plugin: 'com.android.library' +String getMyVersionName() { + def stdout = new ByteArrayOutputStream() + if (rootProject.file("gradlew").exists()) + exec { commandLine 'git', 'describe', '--tags', '--always', '--dirty'; standardOutput = stdout } + else // automatic build system, don't tag dirty + exec { commandLine 'git', 'describe', '--tags', '--always'; standardOutput = stdout } + return stdout.toString().trim().substring(1) +} + android { compileSdkVersion 23 - buildToolsVersion "23.0.2" + buildToolsVersion "23.0.3" defaultConfig { versionName getMyVersionName() @@ -39,5 +48,6 @@ android { } dependencies { - compile project(':play-services-base') + compile project(':play-services-iid') + // compile project(':play-services-measurement') } \ No newline at end of file diff --git a/play-services-gcm/src/main/AndroidManifest.xml b/play-services-gcm/src/main/AndroidManifest.xml index baaa3ad3..16f7b82f 100644 --- a/play-services-gcm/src/main/AndroidManifest.xml +++ b/play-services-gcm/src/main/AndroidManifest.xml @@ -20,5 +20,12 @@ + + + + + + + diff --git a/play-services-gcm/src/main/java/com/google/android/gms/gcm/GcmPubSub.java b/play-services-gcm/src/main/java/com/google/android/gms/gcm/GcmPubSub.java index 5ef87164..134aa710 100644 --- a/play-services-gcm/src/main/java/com/google/android/gms/gcm/GcmPubSub.java +++ b/play-services-gcm/src/main/java/com/google/android/gms/gcm/GcmPubSub.java @@ -90,8 +90,9 @@ public class GcmPubSub { if (TextUtils.isEmpty(registrationToken)) throw new IllegalArgumentException("No registration token!"); if (TextUtils.isEmpty(topic) || !topicPattern.matcher(topic).matches()) - throw new IllegalArgumentException("Invalid topic!"); + throw new IllegalArgumentException("Invalid topic: " + topic); + if (extras == null) extras = new Bundle(); extras.putString(EXTRA_TOPIC, topic); instanceId.getToken(registrationToken, topic, extras); } @@ -110,7 +111,7 @@ public class GcmPubSub { */ public void unsubscribe(String registrationToken, String topic) throws IOException { if (TextUtils.isEmpty(topic) || !topicPattern.matcher(topic).matches()) - throw new IllegalArgumentException("Invalid topic!"); + throw new IllegalArgumentException("Invalid topic: " + topic); Bundle extras = new Bundle(); extras.putString(EXTRA_TOPIC, topic); diff --git a/play-services-gcm/src/main/java/com/google/android/gms/gcm/GcmReceiver.java b/play-services-gcm/src/main/java/com/google/android/gms/gcm/GcmReceiver.java index 0d79190f..a00d6a0f 100644 --- a/play-services-gcm/src/main/java/com/google/android/gms/gcm/GcmReceiver.java +++ b/play-services-gcm/src/main/java/com/google/android/gms/gcm/GcmReceiver.java @@ -16,9 +16,25 @@ package com.google.android.gms.gcm; +import android.Manifest; +import android.content.ComponentName; import android.content.Context; import android.content.Intent; +import android.content.pm.PackageManager; +import android.content.pm.ResolveInfo; +import android.content.pm.ServiceInfo; +import android.os.Build; import android.support.v4.content.WakefulBroadcastReceiver; +import android.util.Base64; +import android.util.Log; + +import static org.microg.gms.gcm.GcmConstants.ACTION_C2DM_REGISTRATION; +import static org.microg.gms.gcm.GcmConstants.ACTION_INSTANCE_ID; +import static org.microg.gms.gcm.GcmConstants.EXTRA_FROM; +import static org.microg.gms.gcm.GcmConstants.EXTRA_RAWDATA; +import static org.microg.gms.gcm.GcmConstants.EXTRA_RAWDATA_BASE64; +import static org.microg.gms.gcm.GcmConstants.GCMID_INSTANCE_ID; +import static org.microg.gms.gcm.GcmConstants.GCMID_REFRESH; /** * WakefulBroadcastReceiver that receives GCM messages and delivers them to an @@ -41,9 +57,71 @@ import android.support.v4.content.WakefulBroadcastReceiver; * services. This prevents other apps from invoking the broadcast receiver. */ public class GcmReceiver extends WakefulBroadcastReceiver { + private static final String TAG = "GcmReceiver"; public void onReceive(Context context, Intent intent) { - throw new UnsupportedOperationException(); + sanitizeIntent(context, intent); + enforceIntentClassName(context, intent); + sendIntent(context, intent); + if (getResultCode() == 0) setResultCodeIfOrdered(-1); } + private void sanitizeIntent(Context context, Intent intent) { + intent.setComponent(null); + intent.setPackage(context.getPackageName()); + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) { + intent.removeCategory(context.getPackageName()); + } + String from = intent.getStringExtra(EXTRA_FROM); + if (ACTION_C2DM_REGISTRATION.equals(intent.getAction()) || GCMID_INSTANCE_ID.equals(from) || GCMID_REFRESH.equals(from)) { + intent.setAction(ACTION_INSTANCE_ID); + } + String base64encoded = intent.getStringExtra(EXTRA_RAWDATA_BASE64); + if (base64encoded != null) { + intent.putExtra(EXTRA_RAWDATA, Base64.decode(base64encoded, Base64.DEFAULT)); + intent.removeExtra(EXTRA_RAWDATA_BASE64); + } + } + + private void enforceIntentClassName(Context context, Intent intent) { + ResolveInfo resolveInfo = context.getPackageManager().resolveService(intent, 0); + if (resolveInfo == null || resolveInfo.serviceInfo == null) { + Log.e(TAG, "Failed to resolve target intent service, skipping classname enforcement"); + return; + } + ServiceInfo serviceInfo = resolveInfo.serviceInfo; + if (!context.getPackageName().equals(serviceInfo.packageName) || serviceInfo.name == null) { + Log.e(TAG, "Error resolving target intent service, skipping classname enforcement. Resolved service was: " + serviceInfo.packageName + "/" + serviceInfo.name); + return; + } + intent.setClassName(context, serviceInfo.name.startsWith(".") ? (context.getPackageName() + serviceInfo.name) : serviceInfo.name); + } + + private void sendIntent(Context context, Intent intent) { + setResultCodeIfOrdered(500); + try { + ComponentName startedComponent; + if (context.checkCallingOrSelfPermission(Manifest.permission.WAKE_LOCK) == PackageManager.PERMISSION_GRANTED) { + startedComponent = startWakefulService(context, intent); + } else { + Log.d(TAG, "Missing wake lock permission, service start may be delayed"); + startedComponent = context.startService(intent); + } + if (startedComponent == null) { + Log.e(TAG, "Error while delivering the message: ServiceIntent not found."); + setResultCodeIfOrdered(404); + } else { + setResultCodeIfOrdered(-1); + } + } catch (SecurityException e) { + Log.e(TAG, "Error while delivering the message to the serviceIntent", e); + setResultCodeIfOrdered(401); + } + } + + private void setResultCodeIfOrdered(int code) { + if (isOrderedBroadcast()) { + setResultCode(code); + } + } } \ No newline at end of file diff --git a/play-services-gcm/src/main/java/com/google/android/gms/gcm/GoogleCloudMessaging.java b/play-services-gcm/src/main/java/com/google/android/gms/gcm/GoogleCloudMessaging.java index 4cd0bdf4..18b06ad6 100644 --- a/play-services-gcm/src/main/java/com/google/android/gms/gcm/GoogleCloudMessaging.java +++ b/play-services-gcm/src/main/java/com/google/android/gms/gcm/GoogleCloudMessaging.java @@ -16,7 +16,6 @@ package com.google.android.gms.gcm; -import android.app.PendingIntent; import android.content.Context; import android.content.Intent; import android.os.Bundle; @@ -26,21 +25,23 @@ import android.text.TextUtils; import com.google.android.gms.iid.InstanceID; import org.microg.gms.common.PublicApi; +import org.microg.gms.gcm.CloudMessagingRpc; import org.microg.gms.gcm.GcmConstants; import java.io.IOException; import static org.microg.gms.common.Constants.GMS_PACKAGE_NAME; import static org.microg.gms.gcm.GcmConstants.ACTION_C2DM_RECEIVE; -import static org.microg.gms.gcm.GcmConstants.ACTION_GCM_SEND; -import static org.microg.gms.gcm.GcmConstants.EXTRA_APP; import static org.microg.gms.gcm.GcmConstants.EXTRA_DELAY; +import static org.microg.gms.gcm.GcmConstants.EXTRA_ERROR; import static org.microg.gms.gcm.GcmConstants.EXTRA_MESSAGE_ID; import static org.microg.gms.gcm.GcmConstants.EXTRA_MESSAGE_TYPE; +import static org.microg.gms.gcm.GcmConstants.EXTRA_REGISTRATION_ID; +import static org.microg.gms.gcm.GcmConstants.EXTRA_SENDER; import static org.microg.gms.gcm.GcmConstants.EXTRA_SENDER_LEGACY; +import static org.microg.gms.gcm.GcmConstants.EXTRA_SEND_FROM; import static org.microg.gms.gcm.GcmConstants.EXTRA_SEND_TO; import static org.microg.gms.gcm.GcmConstants.EXTRA_TTL; -import static org.microg.gms.gcm.GcmConstants.PERMISSION_GTALK; /** * GoogleCloudMessaging (GCM) enables apps to communicate with their app servers @@ -123,43 +124,33 @@ public class GoogleCloudMessaging { @Deprecated public static final String MESSAGE_TYPE_SEND_EVENT = GcmConstants.MESSAGE_TYPE_SEND_EVENT; - private static GoogleCloudMessaging INSTANCE; - /** - * Due to it's nature of being a monitored reference, Intents can be used to authenticate a package source. - */ - private PendingIntent selfAuthIntent; + private static GoogleCloudMessaging instance; + + private CloudMessagingRpc rpc; private Context context; public GoogleCloudMessaging() { - throw new UnsupportedOperationException(); } /** * Must be called when your application is done using GCM, to release * internal resources. */ - public void close() { - throw new UnsupportedOperationException(); - } - - private PendingIntent getSelfAuthIntent() { - if (selfAuthIntent == null) { - Intent intent = new Intent(); - intent.setPackage("com.google.example.invalidpackage"); - selfAuthIntent = PendingIntent.getBroadcast(context, 0, intent, 0); - } - return selfAuthIntent; + public synchronized void close() { + instance = null; + rpc.close(); } /** * Return the singleton instance of GCM. */ public static GoogleCloudMessaging getInstance(Context context) { - if (INSTANCE == null) { - INSTANCE = new GoogleCloudMessaging(); - INSTANCE.context = context.getApplicationContext(); + if (instance == null) { + instance = new GoogleCloudMessaging(); + instance.context = context.getApplicationContext(); + instance.rpc = new CloudMessagingRpc(instance.context); } - return INSTANCE; + return instance; } /** @@ -204,16 +195,23 @@ public class GoogleCloudMessaging { @Deprecated public String register(String... senderIds) throws IOException { if (Looper.getMainLooper() == Looper.myLooper()) throw new IOException(ERROR_MAIN_THREAD); + if (senderIds == null || senderIds.length == 0) throw new IllegalArgumentException("No sender ids"); StringBuilder sb = new StringBuilder(senderIds[0]); for (int i = 1; i < senderIds.length; i++) { sb.append(',').append(senderIds[i]); } - // This seems to be a legacy variant - // TODO: Implement latest version - Bundle extras = new Bundle(); - extras.putString(EXTRA_SENDER_LEGACY, sb.toString()); - return InstanceID.getInstance(context).getToken(sb.toString(), INSTANCE_ID_SCOPE, extras); + String sender = sb.toString(); + + if (isLegacyFallback()) { + Bundle extras = new Bundle(); + extras.putString(EXTRA_SENDER_LEGACY, sender); + return InstanceID.getInstance(context).getToken(sb.toString(), INSTANCE_ID_SCOPE, extras); + } else { + Bundle extras = new Bundle(); + extras.putString(EXTRA_SENDER, sender); + return rpc.handleRegisterMessageResult(rpc.sendRegisterMessageBlocking(extras)); + } } /** @@ -242,16 +240,27 @@ public class GoogleCloudMessaging { */ public void send(String to, String msgId, long timeToLive, Bundle data) throws IOException { if (TextUtils.isEmpty(to)) throw new IllegalArgumentException("Invalid 'to'"); - Intent intent = new Intent(ACTION_GCM_SEND); - intent.setPackage(GMS_PACKAGE_NAME); - if (data != null) intent.putExtras(data); - intent.putExtra(EXTRA_APP, getSelfAuthIntent()); - intent.putExtra(EXTRA_SEND_TO, to); - intent.putExtra(EXTRA_MESSAGE_ID, msgId); - intent.putExtra(EXTRA_TTL, timeToLive); - intent.putExtra(EXTRA_DELAY, -1); - //intent.putExtra(EXTRA_SEND_FROM, TODO) - context.sendOrderedBroadcast(intent, PERMISSION_GTALK); + + if (isLegacyFallback()) { + Bundle extras = new Bundle(); + for (String key : data.keySet()) { + Object o = extras.get(key); + if (o instanceof String) { + extras.putString("gcm." + key, (String) o); + } + } + extras.putString(EXTRA_SEND_TO, to); + extras.putString(EXTRA_MESSAGE_ID, msgId); + InstanceID.getInstance(context).requestToken("GCM", "upstream", extras); + } else { + Bundle extras = data != null ? new Bundle(data) : new Bundle(); + extras.putString(EXTRA_SEND_TO, to); + extras.putString(EXTRA_SEND_FROM, getFrom(to)); + extras.putString(EXTRA_MESSAGE_ID, msgId); + extras.putLong(EXTRA_TTL, timeToLive); + extras.putInt(EXTRA_DELAY, -1); + rpc.sendGcmMessage(extras); + } } /** @@ -298,4 +307,16 @@ public class GoogleCloudMessaging { InstanceID.getInstance(context).deleteInstanceID(); } + private boolean isLegacyFallback() { + String gcmPackageName = CloudMessagingRpc.getGcmPackageName(context); + return gcmPackageName != null && gcmPackageName.endsWith(".gsf"); + } + + private String getFrom(String to) { + int i = to.indexOf('@'); + if (i > 0) { + to = to.substring(0, i); + } + return InstanceID.getInstance(context).getStore().get("", to, INSTANCE_ID_SCOPE); + } } \ No newline at end of file diff --git a/play-services-gcm/src/main/java/com/google/android/gms/gcm/PendingCallback.java b/play-services-gcm/src/main/java/com/google/android/gms/gcm/PendingCallback.java new file mode 100644 index 00000000..6eed3e3d --- /dev/null +++ b/play-services-gcm/src/main/java/com/google/android/gms/gcm/PendingCallback.java @@ -0,0 +1,59 @@ +/* + * Copyright 2013-2016 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.gcm; + +import android.os.IBinder; +import android.os.Parcel; +import android.os.Parcelable; + +public class PendingCallback implements Parcelable { + private final IBinder binder; + + public PendingCallback(IBinder binder) { + this.binder = binder; + } + + private PendingCallback(Parcel in) { + this.binder = in.readStrongBinder(); + } + + public IBinder getBinder() { + return binder; + } + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + dest.writeStrongBinder(binder); + } + + public static final Creator CREATOR = new Creator() { + @Override + public PendingCallback createFromParcel(Parcel source) { + return new PendingCallback(source); + } + + @Override + public PendingCallback[] newArray(int size) { + return new PendingCallback[size]; + } + }; +} diff --git a/play-services-gcm/src/main/java/org/microg/gms/gcm/CloudMessagingRpc.java b/play-services-gcm/src/main/java/org/microg/gms/gcm/CloudMessagingRpc.java new file mode 100644 index 00000000..0c833fe9 --- /dev/null +++ b/play-services-gcm/src/main/java/org/microg/gms/gcm/CloudMessagingRpc.java @@ -0,0 +1,165 @@ +/* + * Copyright 2013-2016 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 org.microg.gms.gcm; + +import android.app.PendingIntent; +import android.content.Context; +import android.content.Intent; +import android.content.pm.ApplicationInfo; +import android.content.pm.PackageManager; +import android.content.pm.ResolveInfo; +import android.os.Bundle; +import android.os.Handler; +import android.os.Looper; +import android.os.Message; +import android.os.Messenger; +import android.util.Log; + +import com.google.android.gms.iid.InstanceID; + +import java.io.IOException; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicInteger; + +import static android.content.pm.PackageManager.PERMISSION_GRANTED; +import static com.google.android.gms.gcm.GoogleCloudMessaging.ERROR_SERVICE_NOT_AVAILABLE; +import static org.microg.gms.common.Constants.GMS_PACKAGE_NAME; +import static org.microg.gms.common.Constants.GSF_PACKAGE_NAME; +import static org.microg.gms.gcm.GcmConstants.ACTION_C2DM_REGISTER; +import static org.microg.gms.gcm.GcmConstants.ACTION_C2DM_REGISTRATION; +import static org.microg.gms.gcm.GcmConstants.ACTION_GCM_SEND; +import static org.microg.gms.gcm.GcmConstants.EXTRA_APP; +import static org.microg.gms.gcm.GcmConstants.EXTRA_ERROR; +import static org.microg.gms.gcm.GcmConstants.EXTRA_MESSAGE_ID; +import static org.microg.gms.gcm.GcmConstants.EXTRA_MESSENGER; +import static org.microg.gms.gcm.GcmConstants.EXTRA_REGISTRATION_ID; +import static org.microg.gms.gcm.GcmConstants.EXTRA_UNREGISTERED; +import static org.microg.gms.gcm.GcmConstants.PERMISSION_GTALK; +import static org.microg.gms.gcm.GcmConstants.PERMISSION_RECEIVE; + +public class CloudMessagingRpc { + private static final AtomicInteger messageIdCounter = new AtomicInteger(1); + private static String gcmPackageName; + + private final BlockingQueue messengerResponseQueue = new LinkedBlockingQueue(); + private final Messenger messenger = new Messenger(new Handler(Looper.getMainLooper()) { + @Override + public void handleMessage(Message msg) { + if (msg == null || !(msg.obj instanceof Intent)) { + // Invalid message -> drop + return; + } + Intent intent = (Intent) msg.obj; + if (ACTION_C2DM_REGISTRATION.equals(intent.getAction())) { + messengerResponseQueue.add(intent); + } + } + }); + + /** + * Due to it's nature of being a monitored reference, Intents can be used to authenticate a package source. + */ + private PendingIntent selfAuthIntent; + private Context context; + + public CloudMessagingRpc(Context context) { + this.context = context; + } + + public static String getGcmPackageName(Context context) { + if (gcmPackageName != null) { + return gcmPackageName; + } + PackageManager packageManager = context.getPackageManager(); + for (ResolveInfo resolveInfo : packageManager.queryIntentServices(new Intent(ACTION_C2DM_REGISTER), 0)) { + if (packageManager.checkPermission(PERMISSION_RECEIVE, resolveInfo.serviceInfo.packageName) == PERMISSION_GRANTED) { + return gcmPackageName = resolveInfo.serviceInfo.packageName; + } + } + try { + ApplicationInfo appInfo = packageManager.getApplicationInfo(GMS_PACKAGE_NAME, 0); + return gcmPackageName = appInfo.packageName; + } catch (PackageManager.NameNotFoundException ignored) { + } + try { + ApplicationInfo appInfo = packageManager.getApplicationInfo(GSF_PACKAGE_NAME, 0); + return gcmPackageName = appInfo.packageName; + } catch (PackageManager.NameNotFoundException ex3) { + return null; + } + } + + public void close() { + // Cancel the authentication + if (selfAuthIntent != null) { + selfAuthIntent.cancel(); + selfAuthIntent = null; + } + } + + private PendingIntent getSelfAuthIntent() { + if (selfAuthIntent == null) { + Intent intent = new Intent(); + intent.setPackage("com.google.example.invalidpackage"); + selfAuthIntent = PendingIntent.getBroadcast(context, 0, intent, 0); + } + return selfAuthIntent; + } + + public Intent sendRegisterMessageBlocking(Bundle extras) throws IOException { + sendRegisterMessage(extras); + Intent resultIntent; + try { + resultIntent = messengerResponseQueue.poll(30, TimeUnit.SECONDS); + } catch (InterruptedException e) { + throw new IOException(e.getMessage()); + } + if (resultIntent == null) { + throw new IOException(ERROR_SERVICE_NOT_AVAILABLE); + } + return resultIntent; + } + + private void sendRegisterMessage(Bundle extras) { + Intent intent = new Intent(ACTION_C2DM_REGISTER); + intent.setPackage(getGcmPackageName(context)); + extras.putString(EXTRA_MESSAGE_ID, "google.rpc" + messageIdCounter.getAndIncrement()); + intent.putExtras(extras); + intent.putExtra(EXTRA_MESSENGER, messenger); + intent.putExtra(EXTRA_APP, getSelfAuthIntent()); + context.startService(intent); + } + + public void sendGcmMessage(Bundle extras) { + Intent intent = new Intent(ACTION_GCM_SEND); + intent.setPackage(GMS_PACKAGE_NAME); + intent.putExtras(extras); + intent.putExtra(EXTRA_APP, getSelfAuthIntent()); + context.sendOrderedBroadcast(intent, PERMISSION_GTALK); + } + + public String handleRegisterMessageResult(Intent resultIntent) throws IOException { + if (resultIntent == null) throw new IOException(InstanceID.ERROR_SERVICE_NOT_AVAILABLE); + String result = resultIntent.getStringExtra(EXTRA_REGISTRATION_ID); + if (result == null) result = resultIntent.getStringExtra(EXTRA_UNREGISTERED); + if (result != null) return result; + result = resultIntent.getStringExtra(EXTRA_ERROR); + throw new IOException(result != null ? result : InstanceID.ERROR_SERVICE_NOT_AVAILABLE); + } +} diff --git a/play-services-iid-api b/play-services-iid-api new file mode 120000 index 00000000..304442a6 --- /dev/null +++ b/play-services-iid-api @@ -0,0 +1 @@ +extern/GmsApi/play-services-iid-api \ No newline at end of file diff --git a/play-services-iid/build.gradle b/play-services-iid/build.gradle new file mode 100644 index 00000000..d3d6661c --- /dev/null +++ b/play-services-iid/build.gradle @@ -0,0 +1,53 @@ +/* + * Copyright 2013-2015 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. + */ + +buildscript { + repositories { + jcenter() + } + dependencies { + classpath 'com.android.tools.build:gradle:2.1.2' + } +} + +apply plugin: 'com.android.library' + +String getMyVersionName() { + def stdout = new ByteArrayOutputStream() + if (rootProject.file("gradlew").exists()) + exec { commandLine 'git', 'describe', '--tags', '--always', '--dirty'; standardOutput = stdout } + else // automatic build system, don't tag dirty + exec { commandLine 'git', 'describe', '--tags', '--always'; standardOutput = stdout } + return stdout.toString().trim().substring(1) +} + +android { + compileSdkVersion 23 + buildToolsVersion "23.0.3" + + defaultConfig { + versionName getMyVersionName() + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_6 + } +} + +dependencies { + compile project(':play-services-base') + compile project(':play-services-iid-api') +} diff --git a/play-services-iid/src/main/AndroidManifest.xml b/play-services-iid/src/main/AndroidManifest.xml new file mode 100644 index 00000000..1f5f60cd --- /dev/null +++ b/play-services-iid/src/main/AndroidManifest.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + diff --git a/play-services-gcm/src/main/java/com/google/android/gms/iid/InstanceID.java b/play-services-iid/src/main/java/com/google/android/gms/iid/InstanceID.java similarity index 56% rename from play-services-gcm/src/main/java/com/google/android/gms/iid/InstanceID.java rename to play-services-iid/src/main/java/com/google/android/gms/iid/InstanceID.java index c4f0cb34..1202e201 100644 --- a/play-services-gcm/src/main/java/com/google/android/gms/iid/InstanceID.java +++ b/play-services-iid/src/main/java/com/google/android/gms/iid/InstanceID.java @@ -19,23 +19,46 @@ package com.google.android.gms.iid; import android.content.Context; import android.os.Bundle; import android.os.Looper; +import android.text.TextUtils; +import android.util.Base64; +import android.util.Log; import org.microg.gms.common.PublicApi; import org.microg.gms.gcm.GcmConstants; +import org.microg.gms.iid.InstanceIdRpc; +import org.microg.gms.iid.InstanceIdStore; import java.io.IOException; +import java.security.KeyPair; +import java.security.KeyPairGenerator; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.HashMap; +import java.util.Map; + +import static org.microg.gms.gcm.GcmConstants.EXTRA_DELETE; +import static org.microg.gms.gcm.GcmConstants.EXTRA_SCOPE; +import static org.microg.gms.gcm.GcmConstants.EXTRA_SENDER; +import static org.microg.gms.gcm.GcmConstants.EXTRA_SUBSCIPTION; +import static org.microg.gms.gcm.GcmConstants.EXTRA_SUBTYPE; /** * Instance ID provides a unique identifier for each app instance and a mechanism * to authenticate and authorize actions (for example, sending a GCM message). *

* Instance ID is stable but may become invalid, if: - * [...] + *

    + *
  • App deletes Instance ID
  • + *
  • Device is factory reset
  • + *
  • User uninstalls the app
  • + *
  • User clears app data
  • + *
* If Instance ID has become invalid, the app can call {@link com.google.android.gms.iid.InstanceID#getId()} * to request a new Instance ID. * To prove ownership of Instance ID and to allow servers to access data or * services associated with the app, call {@link com.google.android.gms.iid.InstanceID#getToken(java.lang.String, java.lang.String)}. */ +@PublicApi public class InstanceID { /** * Error returned when failed requests are retried too often. Use @@ -65,13 +88,31 @@ public class InstanceID { */ public static final String ERROR_TIMEOUT = "TIMEOUT"; + private static final int RSA_KEY_SIZE = 2048; + private static final String TAG = "InstanceID"; + + private static InstanceIdStore storeInstance; + private static InstanceIdRpc rpc; + private static Map instances = new HashMap(); + + private final String subtype; + private KeyPair keyPair; + private long creationTime; + + private InstanceID(String subtype) { + this.subtype = subtype == null ? "" : subtype; + } + /** * Resets Instance ID and revokes all tokens. * * @throws IOException */ public void deleteInstanceID() throws IOException { - throw new UnsupportedOperationException(); + deleteToken("*", "*"); + creationTime = 0; + storeInstance.delete(subtype + "|"); + keyPair = null; } /** @@ -85,12 +126,25 @@ public class InstanceID { * @throws IOException if the request fails. */ public void deleteToken(String authorizedEntity, String scope) throws IOException { - deleteToken(authorizedEntity, scope, new Bundle()); + deleteToken(authorizedEntity, scope, null); } @PublicApi(exclude = true) public void deleteToken(String authorizedEntity, String scope, Bundle extras) throws IOException { - throw new UnsupportedOperationException(); + if (Looper.getMainLooper() == Looper.myLooper()) throw new IOException(ERROR_MAIN_THREAD); + + storeInstance.delete(subtype, authorizedEntity, scope); + + if (extras == null) extras = new Bundle(); + extras.putString(EXTRA_SENDER, authorizedEntity); + extras.putString(EXTRA_SUBSCIPTION, authorizedEntity); + extras.putString(EXTRA_DELETE, "1"); + extras.putString("X-" + EXTRA_DELETE, "1"); + extras.putString(EXTRA_SUBTYPE, TextUtils.isEmpty(subtype) ? authorizedEntity : subtype); + extras.putString("X-" + EXTRA_SUBTYPE, TextUtils.isEmpty(subtype) ? authorizedEntity : subtype); + if (scope != null) extras.putString(EXTRA_SCOPE, scope); + + rpc.handleRegisterMessageResult(rpc.sendRegisterMessageBlocking(extras, getKeyPair())); } /** @@ -99,7 +153,13 @@ public class InstanceID { * @return Time when instance ID was created (milliseconds since Epoch). */ public long getCreationTime() { - throw new UnsupportedOperationException(); + if (creationTime == 0) { + String s = storeInstance.get(subtype, "cre"); + if (s != null) { + creationTime = Long.parseLong(s); + } + } + return creationTime; } /** @@ -108,7 +168,7 @@ public class InstanceID { * @return The identifier for the application instance. */ public String getId() { - throw new UnsupportedOperationException(); + return sha1KeyPair(getKeyPair()); } /** @@ -117,7 +177,17 @@ public class InstanceID { * @return InstanceID instance. */ public static InstanceID getInstance(Context context) { - throw new UnsupportedOperationException(); + String subtype = ""; + if (storeInstance == null) { + storeInstance = new InstanceIdStore(context.getApplicationContext()); + rpc = new InstanceIdRpc(context.getApplicationContext()); + } + InstanceID instance = instances.get(subtype); + if (instance == null) { + instance = new InstanceID(subtype); + instances.put(subtype, instance); + } + return instance; } /** @@ -163,4 +233,43 @@ public class InstanceID { return getToken(authorizedEntity, scope, null); } + @PublicApi(exclude = true) + public InstanceIdStore getStore() { + return storeInstance; + } + + @PublicApi(exclude = true) + public String requestToken(String authorizedEntity, String scope, Bundle extras) { + throw new UnsupportedOperationException(); + } + + private synchronized KeyPair getKeyPair() { + if (keyPair == null) { + keyPair = storeInstance.getKeyPair(subtype); + if (keyPair == null) { + try { + KeyPairGenerator rsaGenerator = KeyPairGenerator.getInstance("RSA"); + rsaGenerator.initialize(RSA_KEY_SIZE); + keyPair = rsaGenerator.generateKeyPair(); + creationTime = System.currentTimeMillis(); + storeInstance.put(subtype, keyPair, creationTime); + } catch (NoSuchAlgorithmException e) { + Log.w(TAG, e); + } + } + } + return keyPair; + } + + @PublicApi(exclude = true) + public static String sha1KeyPair(KeyPair keyPair) { + try { + byte[] digest = MessageDigest.getInstance("SHA1").digest(keyPair.getPublic().getEncoded()); + digest[0] = (byte) (112 + (0xF & digest[0]) & 0xFF); + return Base64.encodeToString(digest, 0, 8, Base64.URL_SAFE | Base64.NO_WRAP | Base64.NO_PADDING); + } catch (NoSuchAlgorithmException e) { + Log.w(TAG, e); + return null; + } + } } \ No newline at end of file diff --git a/play-services-gcm/src/main/java/com/google/android/gms/iid/InstanceIDListenerService.java b/play-services-iid/src/main/java/com/google/android/gms/iid/InstanceIDListenerService.java similarity index 95% rename from play-services-gcm/src/main/java/com/google/android/gms/iid/InstanceIDListenerService.java rename to play-services-iid/src/main/java/com/google/android/gms/iid/InstanceIDListenerService.java index cd9a80ff..350972f2 100644 --- a/play-services-gcm/src/main/java/com/google/android/gms/iid/InstanceIDListenerService.java +++ b/play-services-iid/src/main/java/com/google/android/gms/iid/InstanceIDListenerService.java @@ -25,8 +25,7 @@ import android.os.Handler; import android.os.IBinder; import android.os.Looper; import android.os.Message; - -import com.google.android.gms.gcm.GcmReceiver; +import android.support.v4.content.WakefulBroadcastReceiver; import static org.microg.gms.gcm.GcmConstants.ACTION_C2DM_REGISTRATION; import static org.microg.gms.gcm.GcmConstants.ACTION_INSTANCE_ID; @@ -104,7 +103,8 @@ public class InstanceIDListenerService extends Service { handleIntent(intent); - if (intent.hasExtra(EXTRA_FROM)) GcmReceiver.completeWakefulIntent(intent); + if (intent.hasExtra(EXTRA_FROM)) + WakefulBroadcastReceiver.completeWakefulIntent(intent); } } finally { stop(); diff --git a/play-services-iid/src/main/java/org/microg/gms/iid/InstanceIdRpc.java b/play-services-iid/src/main/java/org/microg/gms/iid/InstanceIdRpc.java new file mode 100644 index 00000000..aa8caba6 --- /dev/null +++ b/play-services-iid/src/main/java/org/microg/gms/iid/InstanceIdRpc.java @@ -0,0 +1,423 @@ +/* + * Copyright 2013-2016 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 org.microg.gms.iid; + +import android.app.PendingIntent; +import android.content.Context; +import android.content.Intent; +import android.content.pm.ApplicationInfo; +import android.content.pm.PackageManager; +import android.content.pm.ResolveInfo; +import android.os.Build; +import android.os.Bundle; +import android.os.ConditionVariable; +import android.os.Handler; +import android.os.Looper; +import android.os.Message; +import android.os.Messenger; +import android.os.Parcelable; +import android.os.RemoteException; +import android.os.SystemClock; +import android.text.TextUtils; +import android.util.Base64; +import android.util.Log; + +import com.google.android.gms.iid.InstanceID; +import com.google.android.gms.iid.MessengerCompat; + +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.security.GeneralSecurityException; +import java.security.KeyPair; +import java.security.PrivateKey; +import java.security.Signature; +import java.security.interfaces.RSAPrivateKey; +import java.util.HashMap; +import java.util.Map; +import java.util.Random; + +import static android.content.pm.PackageManager.PERMISSION_GRANTED; +import static com.google.android.gms.iid.InstanceID.ERROR_BACKOFF; +import static com.google.android.gms.iid.InstanceID.ERROR_MISSING_INSTANCEID_SERVICE; +import static com.google.android.gms.iid.InstanceID.ERROR_SERVICE_NOT_AVAILABLE; +import static com.google.android.gms.iid.InstanceID.ERROR_TIMEOUT; +import static org.microg.gms.common.Constants.GMS_PACKAGE_NAME; +import static org.microg.gms.common.Constants.GSF_PACKAGE_NAME; +import static org.microg.gms.common.Constants.MAX_REFERENCE_VERSION; +import static org.microg.gms.gcm.GcmConstants.ACTION_C2DM_REGISTER; +import static org.microg.gms.gcm.GcmConstants.ACTION_C2DM_REGISTRATION; +import static org.microg.gms.gcm.GcmConstants.ACTION_INSTANCE_ID; +import static org.microg.gms.gcm.GcmConstants.EXTRA_APP; +import static org.microg.gms.gcm.GcmConstants.EXTRA_APP_ID; +import static org.microg.gms.gcm.GcmConstants.EXTRA_APP_VERSION_CODE; +import static org.microg.gms.gcm.GcmConstants.EXTRA_APP_VERSION_NAME; +import static org.microg.gms.gcm.GcmConstants.EXTRA_CLIENT_VERSION; +import static org.microg.gms.gcm.GcmConstants.EXTRA_ERROR; +import static org.microg.gms.gcm.GcmConstants.EXTRA_GMS_VERSION; +import static org.microg.gms.gcm.GcmConstants.EXTRA_GSF_INTENT; +import static org.microg.gms.gcm.GcmConstants.EXTRA_IS_MESSENGER2; +import static org.microg.gms.gcm.GcmConstants.EXTRA_KID; +import static org.microg.gms.gcm.GcmConstants.EXTRA_MESSENGER; +import static org.microg.gms.gcm.GcmConstants.EXTRA_OS_VERSION; +import static org.microg.gms.gcm.GcmConstants.EXTRA_PUBLIC_KEY; +import static org.microg.gms.gcm.GcmConstants.EXTRA_REGISTRATION_ID; +import static org.microg.gms.gcm.GcmConstants.EXTRA_SIGNATURE; +import static org.microg.gms.gcm.GcmConstants.EXTRA_UNREGISTERED; +import static org.microg.gms.gcm.GcmConstants.EXTRA_USE_GSF; +import static org.microg.gms.gcm.GcmConstants.PERMISSION_RECEIVE; + +public class InstanceIdRpc { + private static final String TAG = "InstanceID/Rpc"; + + private static final int BLOCKING_WAIT_TIME = 30000; + + private static String iidPackageName; + private static int lastRequestId; + private static int retryCount; + private static Map blockingResponses = new HashMap(); + + private long nextAttempt; + private int interval; + private Context context; + private PendingIntent selfAuthToken; + private Messenger messenger; + private Messenger myMessenger; + private MessengerCompat messengerCompat; + + public InstanceIdRpc(Context context) { + this.context = context; + } + + public static String getIidPackageName(Context context) { + if (iidPackageName != null) { + return iidPackageName; + } + PackageManager packageManager = context.getPackageManager(); + for (ResolveInfo resolveInfo : packageManager.queryIntentServices(new Intent(ACTION_C2DM_REGISTER), 0)) { + if (packageManager.checkPermission(PERMISSION_RECEIVE, resolveInfo.serviceInfo.packageName) == PERMISSION_GRANTED) { + return iidPackageName = resolveInfo.serviceInfo.packageName; + } + } + try { + ApplicationInfo appInfo = packageManager.getApplicationInfo(GMS_PACKAGE_NAME, 0); + return iidPackageName = appInfo.packageName; + } catch (PackageManager.NameNotFoundException ignored) { + } + try { + ApplicationInfo appInfo = packageManager.getApplicationInfo(GSF_PACKAGE_NAME, 0); + return iidPackageName = appInfo.packageName; + } catch (PackageManager.NameNotFoundException ex3) { + Log.w(TAG, "Both Google Play Services and legacy GSF package are missing"); + return null; + } + } + + private static int getGmsVersionCode(final Context context) { + final PackageManager packageManager = context.getPackageManager(); + try { + return packageManager.getPackageInfo(getIidPackageName(context), 0).versionCode; + } catch (PackageManager.NameNotFoundException ex) { + return -1; + } + } + + private static int getSelfVersionCode(final Context context) { + try { + return context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionCode; + } catch (PackageManager.NameNotFoundException neverHappens) { + return 0; + } + } + + private static String getSelfVersionName(final Context context) { + try { + return context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionName; + } catch (PackageManager.NameNotFoundException neverHappens) { + return null; + } + } + + void initialize() { + if (myMessenger != null) return; + getIidPackageName(context); + myMessenger = new Messenger(new Handler(Looper.getMainLooper()) { + @Override + public void handleMessage(Message msg) { + if (msg == null) { + return; + } + if (msg.obj instanceof Intent) { + Intent intent = (Intent) msg.obj; + intent.setExtrasClassLoader(MessengerCompat.class.getClassLoader()); + if (intent.hasExtra(EXTRA_MESSENGER)) { + Parcelable messengerCandidate = intent.getParcelableExtra(EXTRA_MESSENGER); + if (messengerCandidate instanceof MessengerCompat) { + messengerCompat = (MessengerCompat) messengerCandidate; + } else if (messengerCandidate instanceof Messenger) { + messenger = (Messenger) messengerCandidate; + } + } + handleResponseInternal(intent); + } else { + Log.w(TAG, "Dropping invalid message"); + } + } + }); + } + + public void handleResponseInternal(Intent resultIntent) { + if (resultIntent == null) return; + if (!ACTION_C2DM_REGISTRATION.equals(resultIntent.getAction()) && !ACTION_INSTANCE_ID.equals(resultIntent.getAction())) + return; + String result = resultIntent.getStringExtra(EXTRA_REGISTRATION_ID); + if (result == null) result = resultIntent.getStringExtra(EXTRA_UNREGISTERED); + if (result == null) { + handleError(resultIntent); + return; + } + retryCount = 0; + nextAttempt = 0; + interval = 0; + + String requestId = null; + if (result.startsWith("|")) { + // parse structured response + String[] split = result.split("\\|"); + if (!"ID".equals(split[1])) { + Log.w(TAG, "Unexpected structured response " + result); + } + requestId = split[2]; + if (split.length > 4) { + if ("SYNC".equals(split[3])) { + // TODO: sync + } else if("RST".equals(split[3])) { + // TODO: rst + resultIntent.removeExtra(EXTRA_REGISTRATION_ID); + return; + } + } + result = split[split.length-1]; + if (result.startsWith(":")) + result = result.substring(1); + resultIntent.putExtra(EXTRA_REGISTRATION_ID, result); + } + setResponse(requestId, resultIntent); + } + + private void handleError(Intent resultIntent) { + String error = resultIntent.getStringExtra("error"); + if (error == null) return; + String requestId = null; + if (error.startsWith("|")) { + // parse structured error message + String[] split = error.split("\\|"); + if (!"ID".equals(split[1])) { + Log.w(TAG, "Unexpected structured response " + error); + } + if (split.length > 2) { + requestId = split[2]; + error = split[3]; + if (error.startsWith(":")) + error = error.substring(1); + } else { + error = "UNKNOWN"; + } + resultIntent.putExtra("error", error); + } + setResponse(requestId, resultIntent); + long retryAfter = resultIntent.getLongExtra("Retry-After", 0); + if (retryAfter > 0) { + interval = (int) (retryAfter * 1000); + nextAttempt = SystemClock.elapsedRealtime() + interval; + Log.d(TAG, "Server requested retry delay: " + interval); + } else if (ERROR_SERVICE_NOT_AVAILABLE.equals(error) || "AUTHENTICATION_FAILED".equals(error) + && GSF_PACKAGE_NAME.equals(getIidPackageName(context))) { + retryCount++; + if (retryCount < 3) return; + if (retryCount == 3) interval = 1000 + new Random().nextInt(1000); + interval = interval * 2; + nextAttempt = SystemClock.elapsedRealtime() + interval; + Log.d(TAG, "Setting retry delay to " + interval); + } + } + + private synchronized PendingIntent getSelfAuthToken() { + if (selfAuthToken == null) { + Intent intent = new Intent(); + intent.setPackage("com.google.example.invalidpackage"); + selfAuthToken = PendingIntent.getBroadcast(context, 0, intent, 0); + } + return selfAuthToken; + } + + private static synchronized String getRequestId() { + return Integer.toString(lastRequestId++); + } + + private void sendRegisterMessage(Bundle data, KeyPair keyPair, String requestId) throws IOException { + long elapsedRealtime = SystemClock.elapsedRealtime(); + if (nextAttempt != 0 && elapsedRealtime <= nextAttempt) { + Log.w(TAG, "Had to wait for " + interval + ", that's still " + (nextAttempt - elapsedRealtime)); + throw new IOException(ERROR_BACKOFF); + } + initialize(); + if (iidPackageName == null) { + throw new IOException(ERROR_MISSING_INSTANCEID_SERVICE); + } + Intent intent = new Intent(ACTION_C2DM_REGISTER); + intent.setPackage(iidPackageName); + data.putString(EXTRA_GMS_VERSION, Integer.toString(getGmsVersionCode(context))); + data.putString(EXTRA_OS_VERSION, Integer.toString(Build.VERSION.SDK_INT)); + data.putString(EXTRA_APP_VERSION_CODE, Integer.toString(getSelfVersionCode(context))); + data.putString(EXTRA_APP_VERSION_NAME, getSelfVersionName(context)); + data.putString(EXTRA_CLIENT_VERSION, "iid-" + MAX_REFERENCE_VERSION); + data.putString(EXTRA_APP_ID, InstanceID.sha1KeyPair(keyPair)); + String pub = base64encode(keyPair.getPublic().getEncoded()); + data.putString(EXTRA_PUBLIC_KEY, pub); + data.putString(EXTRA_SIGNATURE, sign(keyPair, context.getPackageName(), pub)); + intent.putExtras(data); + intent.putExtra(EXTRA_APP, getSelfAuthToken()); + sendRequest(intent, requestId); + } + + private static String sign(KeyPair keyPair, String... payload) { + byte[] bytes; + try { + bytes = TextUtils.join("\n", payload).getBytes("UTF-8"); + } catch (UnsupportedEncodingException e) { + Log.e(TAG, "Unable to encode", e); + return null; + } + PrivateKey privateKey = keyPair.getPrivate(); + try { + Signature signature = Signature.getInstance(privateKey instanceof RSAPrivateKey ? "SHA256withRSA" : "SHA256withECDSA"); + signature.initSign(privateKey); + signature.update(bytes); + return base64encode(signature.sign()); + } catch (GeneralSecurityException e) { + Log.e(TAG, "Unable to sign", e); + return null; + } + } + + private static String base64encode(byte[] bytes) { + return Base64.encodeToString(bytes, Base64.URL_SAFE + Base64.NO_PADDING + Base64.NO_WRAP); + } + + private void sendRequest(Intent intent, String requestId) { + intent.putExtra(EXTRA_KID, "|ID|" + requestId + "|"); + intent.putExtra("X-" + EXTRA_KID, "|ID|" + requestId + "|"); + Log.d(TAG, "Sending " + intent.getExtras()); + if (messenger != null) { + intent.putExtra(EXTRA_MESSENGER, myMessenger); + Message msg = Message.obtain(); + msg.obj = intent; + try { + messenger.send(msg); + return; + } catch (RemoteException e) { + Log.d(TAG, "Messenger failed, falling back to service"); + } + } + + boolean useGsf = iidPackageName.endsWith(".gsf"); + if (intent.hasExtra(EXTRA_USE_GSF)) + useGsf = "1".equals(intent.getStringExtra(EXTRA_USE_GSF)); + + if (useGsf) { + Intent holder = new Intent(ACTION_INSTANCE_ID); + holder.setPackage(context.getPackageName()); + holder.putExtra(EXTRA_GSF_INTENT, intent); + context.startService(holder); + } else { + intent.putExtra(EXTRA_MESSENGER, myMessenger); + intent.putExtra(EXTRA_IS_MESSENGER2, "1"); + if (messengerCompat != null) { + Message msg = Message.obtain(); + msg.obj = intent; + try { + messengerCompat.send(msg); + return; + } catch (RemoteException e) { + Log.d(TAG, "Messenger failed, falling back to service"); + } + } + context.startService(intent); + } + } + + public Intent sendRegisterMessageBlocking(Bundle data, KeyPair keyPair) throws IOException { + Intent intent = sendRegisterMessageBlockingInternal(data, keyPair); + if (intent != null && intent.hasExtra(EXTRA_MESSENGER)) { + // Now with a messenger + intent = sendRegisterMessageBlockingInternal(data, keyPair); + } + return intent; + } + + private Intent sendRegisterMessageBlockingInternal(Bundle data, KeyPair keyPair) throws IOException { + ConditionVariable cv = new ConditionVariable(); + String requestId = getRequestId(); + synchronized (InstanceIdRpc.class) { + blockingResponses.put(requestId, cv); + } + + sendRegisterMessage(data, keyPair, requestId); + + cv.block(BLOCKING_WAIT_TIME); + synchronized (InstanceIdRpc.class) { + Object res = blockingResponses.remove(requestId); + if (res instanceof Intent) { + return (Intent) res; + } else if (res instanceof String) { + throw new IOException((String) res); + } + Log.w(TAG, "No response " + res); + throw new IOException(ERROR_TIMEOUT); + } + } + + public String handleRegisterMessageResult(Intent resultIntent) throws IOException { + if (resultIntent == null) throw new IOException(ERROR_SERVICE_NOT_AVAILABLE); + String result = resultIntent.getStringExtra(EXTRA_REGISTRATION_ID); + if (result == null) result = resultIntent.getStringExtra(EXTRA_UNREGISTERED); + if (result != null) return result; + result = resultIntent.getStringExtra(EXTRA_ERROR); + throw new IOException(result != null ? result : ERROR_SERVICE_NOT_AVAILABLE); + } + + private void setResponse(String requestId, Object response) { + if (requestId == null) { + for (String r : blockingResponses.keySet()) { + setResponse(r, response); + } + } + Object old = blockingResponses.get(requestId); + blockingResponses.put(requestId, response); + if (old instanceof ConditionVariable) { + ((ConditionVariable) old).open(); + } else if (old instanceof Messenger) { + Message msg = Message.obtain(); + msg.obj = response; + try { + ((Messenger) old).send(msg); + } catch (RemoteException e) { + Log.w(TAG, "Failed to send response", e); + } + } + } +} diff --git a/play-services-iid/src/main/java/org/microg/gms/iid/InstanceIdStore.java b/play-services-iid/src/main/java/org/microg/gms/iid/InstanceIdStore.java new file mode 100644 index 00000000..c597b6c8 --- /dev/null +++ b/play-services-iid/src/main/java/org/microg/gms/iid/InstanceIdStore.java @@ -0,0 +1,111 @@ +/* + * Copyright 2013-2016 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 org.microg.gms.iid; + +import android.content.Context; +import android.content.SharedPreferences; +import android.util.Base64; +import android.util.Log; + +import java.security.KeyFactory; +import java.security.KeyPair; +import java.security.spec.PKCS8EncodedKeySpec; +import java.security.spec.X509EncodedKeySpec; + +public class InstanceIdStore { + private static final String TAG = "InstanceID/Store"; + private static final String PREF_NAME = "com.google.android.gms.appid"; + + private Context context; + private SharedPreferences sharedPreferences; + + public InstanceIdStore(Context context) { + this.context = context; + this.sharedPreferences = context.getSharedPreferences(PREF_NAME, Context.MODE_PRIVATE); + } + + public synchronized String get(String key) { + return sharedPreferences.getString(key, null); + } + + public String get(String subtype, String key) { + return get(subtype + "|S|" + key); + } + + public String get(String subtype, String authorizedEntity, String scope) { + return get(subtype + "|T|" + authorizedEntity + "|" + scope); + } + + public KeyPair getKeyPair(String subtype) { + String pub = get(subtype, "|P|"); + String priv = get(subtype, "|K|"); + if (pub == null || priv == null) { + return null; + } + try { + byte[] pubKey = Base64.decode(pub, Base64.URL_SAFE); + byte[] privKey = Base64.decode(priv, Base64.URL_SAFE); + KeyFactory rsaFactory = KeyFactory.getInstance("RSA"); + return new KeyPair(rsaFactory.generatePublic(new X509EncodedKeySpec(pubKey)), rsaFactory.generatePrivate(new PKCS8EncodedKeySpec(privKey))); + } catch (Exception e) { + Log.w(TAG, "Invalid key stored " + e); + return null; + } + } + + public synchronized void put(String key, String value) { + SharedPreferences.Editor editor = sharedPreferences.edit(); + editor.putString(key, value); + editor.apply(); + } + + public void put(String subtype, String key, String value) { + put(subtype + "|S|" + key, value); + } + + public void put(String subtype, String authorizedEntity, String scope, String value) { + put(subtype + "|T|" + authorizedEntity + "|" + scope, value); + } + + public synchronized void put(String subtype, KeyPair keyPair, long timestamp) { + put(subtype, "|P|", Base64.encodeToString(keyPair.getPublic().getEncoded(), Base64.URL_SAFE | Base64.NO_WRAP | Base64.NO_PADDING)); + put(subtype, "|K|", Base64.encodeToString(keyPair.getPrivate().getEncoded(), Base64.URL_SAFE | Base64.NO_WRAP | Base64.NO_PADDING)); + put(subtype, "cre", Long.toString(timestamp)); + } + + public synchronized void delete() { + SharedPreferences.Editor editor = sharedPreferences.edit(); + editor.clear(); + editor.apply(); + } + + public synchronized void delete(String prefix) { + SharedPreferences.Editor editor = sharedPreferences.edit(); + for (String key : sharedPreferences.getAll().keySet()) { + if (key.startsWith(prefix)) { + editor.remove(key); + } + } + editor.apply(); + } + + public synchronized void delete(String subtype, String authorizedEntity, String scope) { + SharedPreferences.Editor editor = sharedPreferences.edit(); + editor.remove(subtype + "|T|" + authorizedEntity + "|" + scope); + editor.apply(); + } +} diff --git a/play-services-location-api b/play-services-location-api new file mode 120000 index 00000000..990e4285 --- /dev/null +++ b/play-services-location-api @@ -0,0 +1 @@ +extern/GmsApi/play-services-location-api/ \ No newline at end of file diff --git a/play-services-location/build.gradle b/play-services-location/build.gradle index b3a6c833..4a211cf9 100644 --- a/play-services-location/build.gradle +++ b/play-services-location/build.gradle @@ -19,15 +19,24 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:2.0.0' + classpath 'com.android.tools.build:gradle:2.1.2' } } apply plugin: 'com.android.library' +String getMyVersionName() { + def stdout = new ByteArrayOutputStream() + if (rootProject.file("gradlew").exists()) + exec { commandLine 'git', 'describe', '--tags', '--always', '--dirty'; standardOutput = stdout } + else // automatic build system, don't tag dirty + exec { commandLine 'git', 'describe', '--tags', '--always'; standardOutput = stdout } + return stdout.toString().trim().substring(1) +} + android { compileSdkVersion 23 - buildToolsVersion "23.0.2" + buildToolsVersion "23.0.3" defaultConfig { versionName getMyVersionName() @@ -40,4 +49,5 @@ android { dependencies { compile project(':play-services-base') + compile project(':play-services-location-api') } \ No newline at end of file diff --git a/play-services-tasks/build.gradle b/play-services-tasks/build.gradle new file mode 100644 index 00000000..cc390af7 --- /dev/null +++ b/play-services-tasks/build.gradle @@ -0,0 +1,52 @@ +/* + * Copyright 2013-2015 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. + */ + +buildscript { + repositories { + jcenter() + } + dependencies { + classpath 'com.android.tools.build:gradle:2.1.2' + } +} + +apply plugin: 'com.android.library' + +String getMyVersionName() { + def stdout = new ByteArrayOutputStream() + if (rootProject.file("gradlew").exists()) + exec { commandLine 'git', 'describe', '--tags', '--always', '--dirty'; standardOutput = stdout } + else // automatic build system, don't tag dirty + exec { commandLine 'git', 'describe', '--tags', '--always'; standardOutput = stdout } + return stdout.toString().trim().substring(1) +} + +android { + compileSdkVersion 23 + buildToolsVersion "23.0.3" + + defaultConfig { + versionName getMyVersionName() + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_6 + } +} + +dependencies { + compile project(':play-services-common-api') +} diff --git a/play-services-tasks/src/main/AndroidManifest.xml b/play-services-tasks/src/main/AndroidManifest.xml new file mode 100644 index 00000000..351619a2 --- /dev/null +++ b/play-services-tasks/src/main/AndroidManifest.xml @@ -0,0 +1,24 @@ + + + + + + + + + diff --git a/play-services-tasks/src/main/java/com/google/android/gms/tasks/Continuation.java b/play-services-tasks/src/main/java/com/google/android/gms/tasks/Continuation.java new file mode 100644 index 00000000..5630929f --- /dev/null +++ b/play-services-tasks/src/main/java/com/google/android/gms/tasks/Continuation.java @@ -0,0 +1,68 @@ +/* + * Copyright 2013-2016 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.tasks; + +import org.microg.gms.common.PublicApi; + +/** + * A function that is called to continue execution after completion of a {@link Task}. + * + * @see Task#continueWith(Continuation) + * @see Task#continueWithTask(Continuation) + */ +@PublicApi +public interface Continuation { + /** + * Returns the result of applying this Continuation to {@code task}. + *

+ * To propagate failure from the completed Task call {@link Task#getResult()} and allow the + * {@link RuntimeExecutionException} to propagate. The RuntimeExecutionException will be + * unwrapped such that the Task returned by {@link Task#continueWith(Continuation)} or + * {@link Task#continueWithTask(Continuation)} fails with the original exception. + *

+ * To suppress specific failures call {@link Task#getResult(Class)} and catch the exception + * types of interest: + *

task.continueWith(new Continuation() {
+     *     @Override
+     *     public String then(Task task) {
+     *         try {
+     *             return task.getResult(IOException.class);
+     *         } catch (FileNotFoundException e) {
+     *             return "Not found";
+     *         } catch (IOException e) {
+     *             return "Read failed";
+     *         }
+     *     }
+     * }
+ *

+ * To suppress all failures guard any calls to {@link Task#getResult()} with {@link Task#isSuccessful()}: + *

task.continueWith(new Continuation() {
+     *     @Override
+     *     public String then(Task task) {
+     *         if (task.isSuccessful()) {
+     *             return task.getResult();
+     *         } else {
+     *             return DEFAULT_VALUE;
+     *         }
+     *     }
+     * }
+ * + * @param task the completed Task. Never null + * @throws Exception if the result couldn't be produced + */ + TContinuationResult then(Task task); +} diff --git a/play-services-tasks/src/main/java/com/google/android/gms/tasks/OnCompleteListener.java b/play-services-tasks/src/main/java/com/google/android/gms/tasks/OnCompleteListener.java new file mode 100644 index 00000000..7c6c870f --- /dev/null +++ b/play-services-tasks/src/main/java/com/google/android/gms/tasks/OnCompleteListener.java @@ -0,0 +1,34 @@ +/* + * Copyright 2013-2016 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.tasks; + +import org.microg.gms.common.PublicApi; + +/** + * Listener called when a {@link Task} completes. + * + * @see Task#addOnCompleteListener(OnCompleteListener) + */ +@PublicApi +public interface OnCompleteListener { + /** + * Called when the Task completes. + * + * @param task the completed Task. Never null + */ + void onComplete(Task task); +} diff --git a/play-services-tasks/src/main/java/com/google/android/gms/tasks/OnFailureListener.java b/play-services-tasks/src/main/java/com/google/android/gms/tasks/OnFailureListener.java new file mode 100644 index 00000000..13cc7334 --- /dev/null +++ b/play-services-tasks/src/main/java/com/google/android/gms/tasks/OnFailureListener.java @@ -0,0 +1,35 @@ +/* + * Copyright 2013-2016 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.tasks; + +import org.microg.gms.common.PublicApi; + +/** + * Listener called when a {@link Task} fails with an exception. + * + * @see Task#addOnFailureListener(OnFailureListener) + */ +@PublicApi +public interface OnFailureListener { + + /** + * Called when the Task fails with an exception. + * + * @param e the exception that caused the Task to fail. Never null + */ + void onFailure(Exception e); +} diff --git a/play-services-tasks/src/main/java/com/google/android/gms/tasks/OnSuccessListener.java b/play-services-tasks/src/main/java/com/google/android/gms/tasks/OnSuccessListener.java new file mode 100644 index 00000000..37407ec9 --- /dev/null +++ b/play-services-tasks/src/main/java/com/google/android/gms/tasks/OnSuccessListener.java @@ -0,0 +1,34 @@ +/* + * Copyright 2013-2016 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.tasks; + +import org.microg.gms.common.PublicApi; + +/** + * Listener called when a {@link Task} completes successfully. + * + * @see Task#addOnSuccessListener(OnSuccessListener) + */ +@PublicApi +public interface OnSuccessListener { + /** + * Called when the {@link Task} completes successfully. + * + * @param result the result of the Task + */ + void onSuccess(TResult result); +} diff --git a/play-services-tasks/src/main/java/com/google/android/gms/tasks/RuntimeExecutionException.java b/play-services-tasks/src/main/java/com/google/android/gms/tasks/RuntimeExecutionException.java new file mode 100644 index 00000000..10c0337d --- /dev/null +++ b/play-services-tasks/src/main/java/com/google/android/gms/tasks/RuntimeExecutionException.java @@ -0,0 +1,33 @@ +/* + * Copyright 2013-2016 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.tasks; + +import org.microg.gms.common.PublicApi; + +import java.util.concurrent.ExecutionException; + +/** + * Runtime version of {@link ExecutionException}. + * + * @see Task#getResult(Class) + */ +@PublicApi +public class RuntimeExecutionException extends RuntimeException { + public RuntimeExecutionException(Throwable cause) { + super(cause); + } +} diff --git a/play-services-tasks/src/main/java/com/google/android/gms/tasks/Task.java b/play-services-tasks/src/main/java/com/google/android/gms/tasks/Task.java new file mode 100644 index 00000000..4f9ce4dd --- /dev/null +++ b/play-services-tasks/src/main/java/com/google/android/gms/tasks/Task.java @@ -0,0 +1,224 @@ +/* + * Copyright 2013-2016 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.tasks; + +import android.app.Activity; + +import org.microg.gms.common.PublicApi; + +import java.util.concurrent.Executor; + +/** + * Represents an asynchronous operation. + */ +@PublicApi +public abstract class Task { + + public Task() { + } + + /** + * Adds a listener that is called when the Task completes. + *

+ * The listener will be called on main application thread. If the Task is already complete, a + * call to the listener will be immediately scheduled. If multiple listeners are added, they + * will be called in the order in which they were added. + * + * @return this Task + */ + public Task addOnCompleteListener(OnCompleteListener listener) { + throw new UnsupportedOperationException("addOnCompleteListener is not implemented"); + } + + /** + * Adds an Activity-scoped listener that is called when the Task completes. + *

+ * The listener will be called on main application thread. If the Task is already complete, a + * call to the listener will be immediately scheduled. If multiple listeners are added, they + * will be called in the order in which they were added. + *

+ * The listener will be automatically removed during {@link Activity#onStop()}. + * + * @return this Task + */ + public Task addOnCompleteListener(Activity activity, OnCompleteListener listener) { + throw new UnsupportedOperationException("addOnCompleteListener is not implemented"); + } + + /** + * Adds a listener that is called when the Task completes. + *

+ * If the Task is already complete, a call to the listener will be immediately scheduled. If + * multiple listeners are added, they will be called in the order in which they were added. + * + * @param executor the executor to use to call the listener + * @return this Task + */ + public Task addOnCompleteListener(Executor executor, OnCompleteListener listener) { + throw new UnsupportedOperationException("addOnCompleteListener is not implemented"); + } + + /** + * Adds an Activity-scoped listener that is called if the Task fails. + *

+ * The listener will be called on main application thread. If the Task has already failed, a + * call to the listener will be immediately scheduled. If multiple listeners are added, they + * will be called in the order in which they were added. + *

+ * The listener will be automatically removed during {@link Activity#onStop()}. + * + * @return this Task + */ + public abstract Task addOnFailureListener(Activity activity, OnFailureListener listener); + + /** + * Adds an Activity-scoped listener that is called if the Task fails. + *

+ * The listener will be called on main application thread. If the Task has already failed, a + * call to the listener will be immediately scheduled. If multiple listeners are added, they + * will be called in the order in which they were added. + * + * @return this Task + */ + public abstract Task addOnFailureListener(OnFailureListener listener); + + /** + * Adds a listener that is called if the Task fails. + *

+ * If the Task has already failed, a call to the listener will be immediately scheduled. If + * multiple listeners are added, they will be called in the order in which they were added. + * + * @param executor the executor to use to call the listener + * @return this Task + */ + public abstract Task addOnFailureListener(Executor executor, OnFailureListener listener); + + + /** + * Adds a listener that is called if the Task completes successfully. + *

+ * If multiple listeners are added, they will be called in the order in which they were added. If + * the Task has already completed successfully, a call to the listener will be immediately scheduled. + * + * @param executor the executor to use to call the listener + * @return this Task + */ + public abstract Task addOnSuccessListener(Executor executor, OnSuccessListener listener); + + /** + * Adds a listener that is called if the Task completes successfully. + *

+ * The listener will be called on the main application thread. If the Task has already + * completed successfully, a call to the listener will be immediately scheduled. If multiple + * listeners are added, they will be called in the order in which they were added. + * + * @return this Task + */ + public abstract Task addOnSuccessListener(OnSuccessListener listener); + + /** + * Adds an Activity-scoped listener that is called if the Task completes successfully. + *

+ * The listener will be called on the main application thread. If the Task has already + * completed successfully, a call to the listener will be immediately scheduled. If multiple + * listeners are added, they will be called in the order in which they were added. + *

+ * The listener will be automatically removed during {@link Activity#onStop()}. + * + * @return this Task + */ + public abstract Task addOnSuccessListener(Activity activity, OnSuccessListener listener); + + + /** + * Returns a new Task that will be completed with the result of applying the specified + * Continuation to this Task. + *

+ * The Continuation will be called on the main application thread. + * + * @see Continuation#then(Task) + */ + public Task continueWith(Continuation continuation) { + throw new UnsupportedOperationException("continueWith is not implemented"); + } + + /** + * Returns a new Task that will be completed with the result of applying the specified Continuation to this Task. + * + * @param executor the executor to use to call the Continuation + * @see Continuation#then(Task) + */ + public Task continueWith(Executor executor, Continuation continuation) { + throw new UnsupportedOperationException("continueWith is not implemented"); + } + + /** + * Returns a new Task that will be completed with the result of applying the specified + * Continuation to this Task. + *

+ * The Continuation will be called on the main application thread. + * + * @see Continuation#then(Task) + */ + public Task continueWithTask(Continuation> continuation) { + throw new UnsupportedOperationException("continueWithTask is not implemented"); + } + + /** + * Returns a new Task that will be completed with the result of applying the specified Continuation to this Task. + * + * @param executor the executor to use to call the Continuation + * @see Continuation#then(Task) + */ + public Task continueWithTask(Executor executor, Continuation> var2) { + throw new UnsupportedOperationException("continueWithTask is not implemented"); + } + + /** + * Returns the exception that caused the Task to fail. Returns {@code null} if the Task is not + * yet complete, or completed successfully. + */ + public abstract Exception getException(); + + /** + * Gets the result of the Task, if it has already completed. + * + * @throws IllegalStateException if the Task is not yet complete + * @throws RuntimeExecutionException if the Task failed with an exception + */ + public abstract TResult getResult(); + + /** + * Gets the result of the Task, if it has already completed. + * + * @throws IllegalStateException if the Task is not yet complete + * @throws X if the Task failed with an exception of type X + * @throws RuntimeExecutionException if the Task failed with an exception that was not of type X + */ + public abstract TResult getResult(Class exceptionType) throws X; + + /** + * Returns {@code true} if the Task is complete; {@code false} otherwise. + */ + public abstract boolean isComplete(); + + /** + * Returns {@code true} if the Task has completed successfully; {@code false} otherwise. + */ + public abstract boolean isSuccessful(); + +} diff --git a/play-services-tasks/src/main/java/com/google/android/gms/tasks/TaskCompletionSource.java b/play-services-tasks/src/main/java/com/google/android/gms/tasks/TaskCompletionSource.java new file mode 100644 index 00000000..1371e224 --- /dev/null +++ b/play-services-tasks/src/main/java/com/google/android/gms/tasks/TaskCompletionSource.java @@ -0,0 +1,52 @@ +/* + * Copyright 2013-2016 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.tasks; + +import org.microg.gms.common.PublicApi; + +/** + * Provides the ability to create an incomplete {@link Task} and later complete it by either + * calling {@link #setResult(TResult)} or {@link #setException(Exception)}. + */ +@PublicApi +public class TaskCompletionSource { + public TaskCompletionSource() { + } + + /** + * Returns the Task. + */ + public Task getTask() { + return null; + } + + /** + * Completes the Task with the specified exception. + * @throws IllegalStateException if the Task is already complete + */ + public void setException(Exception e) { + + } + + /** + * Completes the Task with the specified result. + * @throws IllegalStateException if the Task is already complete + */ + public void setResult(TResult result) { + + } +} diff --git a/play-services-tasks/src/main/java/com/google/android/gms/tasks/Tasks.java b/play-services-tasks/src/main/java/com/google/android/gms/tasks/Tasks.java new file mode 100644 index 00000000..c02ed055 --- /dev/null +++ b/play-services-tasks/src/main/java/com/google/android/gms/tasks/Tasks.java @@ -0,0 +1,116 @@ +/* + * Copyright 2013-2016 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.tasks; + +import org.microg.gms.common.PublicApi; + +import java.util.Arrays; +import java.util.Collection; +import java.util.concurrent.Callable; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.Executor; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; + +/** + * {@link Task} utility methods. + */ +@PublicApi +public final class Tasks { + + /** + * Blocks until the specified Task is complete. + * + * @return the Task's result + * @throws ExecutionException if the Task fails + * @throws InterruptedException if an interrupt occurs while waiting for the Task to complete + * @throws TimeoutException if the specified timeout is reached before the Task completes + */ + public static TResult await(Task task, long timeout, TimeUnit unit) { + // TODO + return null; + } + + /** + * Blocks until the specified Task is complete. + * + * @return the Task's result + * @throws ExecutionException if the Task fails + * @throws InterruptedException if an interrupt occurs while waiting for the Task to complete + */ + public static TResult await(Task task) { + // TODO + return null; + } + + /** + * Returns a Task that will be completed with the result of the specified Callable. + *

+ * The Callable will be called on the main application thread. + */ + public static Task call(Callable callable) { + // TODO + return null; + } + + /** + * Returns a Task that will be completed with the result of the specified Callable. + * + * @param executor the Executor to use to call the Callable + */ + public static Task call(Executor executor, Callable callable) { + // TODO + return null; + } + + /** + * Returns a completed Task with the specified exception. + */ + public static Task forException(Exception e) { + // TODO + return null; + } + + /** + * Returns a completed Task with the specified result. + */ + public static Task forResult(TResult result) { + // TODO + return null; + } + + /** + * Returns a Task that completes successfully when all of the specified Tasks complete + * successfully. Does not accept nulls. + * + * @throws NullPointerException if any of the provided Tasks are null + */ + public static Task whenAll(Collection> tasks) { + // TODO + return null; + } + + /** + * Returns a Task that completes successfully when all of the specified Tasks complete + * successfully. Does not accept nulls. + * + * @throws NullPointerException if any of the provided Tasks are null + */ + public static Task whenAll(Task... tasks) { + return whenAll(Arrays.asList(tasks)); + } +} diff --git a/play-services-wearable-api b/play-services-wearable-api new file mode 120000 index 00000000..b8f16ab8 --- /dev/null +++ b/play-services-wearable-api @@ -0,0 +1 @@ +extern/GmsApi/play-services-wearable-api/ \ No newline at end of file diff --git a/play-services-wearable/build.gradle b/play-services-wearable/build.gradle index f900225d..94ece58f 100644 --- a/play-services-wearable/build.gradle +++ b/play-services-wearable/build.gradle @@ -19,15 +19,24 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:2.0.0' + classpath 'com.android.tools.build:gradle:2.1.2' } } apply plugin: 'com.android.library' +String getMyVersionName() { + def stdout = new ByteArrayOutputStream() + if (rootProject.file("gradlew").exists()) + exec { commandLine 'git', 'describe', '--tags', '--always', '--dirty'; standardOutput = stdout } + else // automatic build system, don't tag dirty + exec { commandLine 'git', 'describe', '--tags', '--always'; standardOutput = stdout } + return stdout.toString().trim().substring(1) +} + android { compileSdkVersion 23 - buildToolsVersion "23.0.2" + buildToolsVersion "23.0.3" defaultConfig { versionName getMyVersionName() @@ -40,4 +49,5 @@ android { dependencies { compile project(':play-services-base') + compile project(':play-services-wearable-api') } diff --git a/play-services-wearable/src/main/java/com/google/android/gms/wearable/DataEventBuffer.java b/play-services-wearable/src/main/java/com/google/android/gms/wearable/DataEventBuffer.java index b5cc0952..cdeb6bc3 100644 --- a/play-services-wearable/src/main/java/com/google/android/gms/wearable/DataEventBuffer.java +++ b/play-services-wearable/src/main/java/com/google/android/gms/wearable/DataEventBuffer.java @@ -33,7 +33,7 @@ public class DataEventBuffer extends DataBuffer implements Result { @PublicApi(exclude = true) public DataEventBuffer(DataHolder dataHolder) { super(dataHolder); - status = new Status(dataHolder.statusCode); + status = new Status(dataHolder.getStatusCode()); } @Override diff --git a/play-services-wearable/src/main/java/com/google/android/gms/wearable/DataItemBuffer.java b/play-services-wearable/src/main/java/com/google/android/gms/wearable/DataItemBuffer.java index 56b71acf..9859f56d 100644 --- a/play-services-wearable/src/main/java/com/google/android/gms/wearable/DataItemBuffer.java +++ b/play-services-wearable/src/main/java/com/google/android/gms/wearable/DataItemBuffer.java @@ -30,7 +30,7 @@ public class DataItemBuffer extends DataBuffer implements Result { @PublicApi(exclude = true) public DataItemBuffer(DataHolder dataHolder) { super(dataHolder); - status = new Status(dataHolder.statusCode); + status = new Status(dataHolder.getStatusCode()); } @Override diff --git a/play-services/build.gradle b/play-services/build.gradle index f8844af4..48cde72e 100644 --- a/play-services/build.gradle +++ b/play-services/build.gradle @@ -19,12 +19,21 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:2.0.0' + classpath 'com.android.tools.build:gradle:2.1.0' } } apply plugin: 'com.android.library' +String getMyVersionName() { + def stdout = new ByteArrayOutputStream() + if (rootProject.file("gradlew").exists()) + exec { commandLine 'git', 'describe', '--tags', '--always', '--dirty'; standardOutput = stdout } + else // automatic build system, don't tag dirty + exec { commandLine 'git', 'describe', '--tags', '--always'; standardOutput = stdout } + return stdout.toString().trim().substring(1) +} + android { compileSdkVersion 23 buildToolsVersion "23.0.2" diff --git a/settings.gradle b/settings.gradle index 2b54450b..870c2121 100644 --- a/settings.gradle +++ b/settings.gradle @@ -16,12 +16,19 @@ include ':safe-parcel' +include ':play-services-cast-api' +include ':play-services-common-api' +include ':play-services-iid-api' +include ':play-services-location-api' +include ':play-services-wearable-api' include ':play-services-api' include ':play-services-base' include ':play-services-cast' include ':play-services-gcm' +include ':play-services-iid' include ':play-services-location' +include ':play-services-tasks' include ':play-services-wearable' include ':play-services' From 25d0e3be421b61f661a1d6ee540bbf7f512caa45 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Sun, 7 Aug 2016 18:19:36 +0200 Subject: [PATCH 167/293] Fix travis --- .travis.yml | 2 +- play-services/build.gradle | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1f8c07c6..8f34e4b8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,7 @@ android: components: - platform-tools - tools - - build-tools-23.0.2 + - build-tools-23.0.3 - android-23 - extra-android-m2repository before_cache: diff --git a/play-services/build.gradle b/play-services/build.gradle index 48cde72e..9c4a6711 100644 --- a/play-services/build.gradle +++ b/play-services/build.gradle @@ -19,7 +19,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:2.1.0' + classpath 'com.android.tools.build:gradle:2.1.2' } } @@ -36,7 +36,7 @@ String getMyVersionName() { android { compileSdkVersion 23 - buildToolsVersion "23.0.2" + buildToolsVersion "23.0.3" defaultConfig { versionName getMyVersionName() From 252718585f32befa17b1d85b82871fa0bff11fc4 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Sun, 7 Aug 2016 20:37:16 +0200 Subject: [PATCH 168/293] Rename common-api to basement, Move ChannelApi to Api classes --- play-services-api/build.gradle | 2 +- .../build.gradle | 1 + .../src/main/AndroidManifest.xml | 0 .../google/android/gms/common/api/Status.aidl | 0 .../android/gms/common/data/DataHolder.aidl | 0 .../common/internal/GetServiceRequest.aidl | 0 .../gms/common/internal/ICancelToken.aidl | 0 .../gms/common/internal/IGmsCallbacks.aidl | 0 .../common/internal/IGmsServiceBroker.aidl | 0 .../common/internal/ISignInButtonCreator.aidl | 0 .../internal/ValidateAccountRequest.aidl | 0 .../common/server/FavaDiagnosticsEntity.aidl | 0 .../android/gms/dynamic/IObjectWrapper.aidl | 0 .../android/gms/common/ConnectionResult.java | 310 +++++++++++ .../com/google/android/gms/common/Scopes.java | 0 .../android/gms/common/api/AccountInfo.java | 0 .../google/android/gms/common/api/Api.java | 84 +++ .../gms/common/api/CommonStatusCodes.java | 0 .../gms/common/api/GoogleApiClient.java | 494 ++++++++++++++++++ .../android/gms/common/api/PendingResult.java | 59 +++ .../android/gms/common/api/Releasable.java | 24 + .../google/android/gms/common/api/Result.java | 0 .../gms/common/api/ResultCallback.java | 33 ++ .../google/android/gms/common/api/Scope.java | 0 .../google/android/gms/common/api/Status.java | 0 .../android/gms/common/data/DataHolder.java | 0 .../android/gms/common/data/Freezable.java | 0 .../android/gms/common/images/WebImage.java | 0 .../gms/common/internal/BinderWrapper.java | 0 .../common/internal/GetServiceRequest.java | 0 .../internal/ValidateAccountRequest.java | 0 .../common/server/FavaDiagnosticsEntity.java | 0 .../android/gms/dynamic/ObjectWrapper.java | 0 .../org/microg/gms/auth/AuthConstants.java | 0 .../java/org/microg/gms/common/Constants.java | 0 .../org/microg/gms/common/GmsService.java | 0 .../java/org/microg/gms/common/PublicApi.java | 0 .../org/microg/gms/common/api/ApiBuilder.java | 30 ++ .../microg/gms/common/api/ApiConnection.java | 27 + .../gms/common/api/GoogleApiClientImpl.java | 223 ++++++++ .../java/org/microg/gms/gcm/GcmConstants.java | 0 play-services-cast-api/build.gradle | 2 +- play-services-iid-api/build.gradle | 2 +- play-services-location-api/build.gradle | 2 +- play-services-wearable-api/build.gradle | 2 +- .../google/android/gms/wearable/Channel.java | 94 ++++ .../android/gms/wearable/ChannelApi.java | 185 +++++++ .../wearable/internal/AmsEntityUpdate.java | 20 + .../internal/AmsEntityUpdateParcelable.java | 2 +- .../wearable/internal/AncsNotification.java | 20 + .../internal/AncsNotificationParcelable.java | 2 +- .../internal/ChannelEventParcelable.java | 15 + settings.gradle | 2 +- 53 files changed, 1627 insertions(+), 8 deletions(-) rename {play-services-common-api => play-services-basement}/build.gradle (97%) rename {play-services-common-api => play-services-basement}/src/main/AndroidManifest.xml (100%) rename {play-services-common-api => play-services-basement}/src/main/aidl/com/google/android/gms/common/api/Status.aidl (100%) rename {play-services-common-api => play-services-basement}/src/main/aidl/com/google/android/gms/common/data/DataHolder.aidl (100%) rename {play-services-common-api => play-services-basement}/src/main/aidl/com/google/android/gms/common/internal/GetServiceRequest.aidl (100%) rename {play-services-common-api => play-services-basement}/src/main/aidl/com/google/android/gms/common/internal/ICancelToken.aidl (100%) rename {play-services-common-api => play-services-basement}/src/main/aidl/com/google/android/gms/common/internal/IGmsCallbacks.aidl (100%) rename {play-services-common-api => play-services-basement}/src/main/aidl/com/google/android/gms/common/internal/IGmsServiceBroker.aidl (100%) rename {play-services-common-api => play-services-basement}/src/main/aidl/com/google/android/gms/common/internal/ISignInButtonCreator.aidl (100%) rename {play-services-common-api => play-services-basement}/src/main/aidl/com/google/android/gms/common/internal/ValidateAccountRequest.aidl (100%) rename {play-services-common-api => play-services-basement}/src/main/aidl/com/google/android/gms/common/server/FavaDiagnosticsEntity.aidl (100%) rename {play-services-common-api => play-services-basement}/src/main/aidl/com/google/android/gms/dynamic/IObjectWrapper.aidl (100%) create mode 100644 play-services-basement/src/main/java/com/google/android/gms/common/ConnectionResult.java rename {play-services-common-api => play-services-basement}/src/main/java/com/google/android/gms/common/Scopes.java (100%) rename {play-services-common-api => play-services-basement}/src/main/java/com/google/android/gms/common/api/AccountInfo.java (100%) create mode 100644 play-services-basement/src/main/java/com/google/android/gms/common/api/Api.java rename {play-services-common-api => play-services-basement}/src/main/java/com/google/android/gms/common/api/CommonStatusCodes.java (100%) create mode 100644 play-services-basement/src/main/java/com/google/android/gms/common/api/GoogleApiClient.java create mode 100644 play-services-basement/src/main/java/com/google/android/gms/common/api/PendingResult.java create mode 100644 play-services-basement/src/main/java/com/google/android/gms/common/api/Releasable.java rename {play-services-common-api => play-services-basement}/src/main/java/com/google/android/gms/common/api/Result.java (100%) create mode 100644 play-services-basement/src/main/java/com/google/android/gms/common/api/ResultCallback.java rename {play-services-common-api => play-services-basement}/src/main/java/com/google/android/gms/common/api/Scope.java (100%) rename {play-services-common-api => play-services-basement}/src/main/java/com/google/android/gms/common/api/Status.java (100%) rename {play-services-common-api => play-services-basement}/src/main/java/com/google/android/gms/common/data/DataHolder.java (100%) rename {play-services-common-api => play-services-basement}/src/main/java/com/google/android/gms/common/data/Freezable.java (100%) rename {play-services-common-api => play-services-basement}/src/main/java/com/google/android/gms/common/images/WebImage.java (100%) rename {play-services-common-api => play-services-basement}/src/main/java/com/google/android/gms/common/internal/BinderWrapper.java (100%) rename {play-services-common-api => play-services-basement}/src/main/java/com/google/android/gms/common/internal/GetServiceRequest.java (100%) rename {play-services-common-api => play-services-basement}/src/main/java/com/google/android/gms/common/internal/ValidateAccountRequest.java (100%) rename {play-services-common-api => play-services-basement}/src/main/java/com/google/android/gms/common/server/FavaDiagnosticsEntity.java (100%) rename {play-services-common-api => play-services-basement}/src/main/java/com/google/android/gms/dynamic/ObjectWrapper.java (100%) rename {play-services-common-api => play-services-basement}/src/main/java/org/microg/gms/auth/AuthConstants.java (100%) rename {play-services-common-api => play-services-basement}/src/main/java/org/microg/gms/common/Constants.java (100%) rename {play-services-common-api => play-services-basement}/src/main/java/org/microg/gms/common/GmsService.java (100%) rename {play-services-common-api => play-services-basement}/src/main/java/org/microg/gms/common/PublicApi.java (100%) create mode 100644 play-services-basement/src/main/java/org/microg/gms/common/api/ApiBuilder.java create mode 100644 play-services-basement/src/main/java/org/microg/gms/common/api/ApiConnection.java create mode 100644 play-services-basement/src/main/java/org/microg/gms/common/api/GoogleApiClientImpl.java rename {play-services-common-api => play-services-basement}/src/main/java/org/microg/gms/gcm/GcmConstants.java (100%) create mode 100644 play-services-wearable-api/src/main/java/com/google/android/gms/wearable/Channel.java create mode 100644 play-services-wearable-api/src/main/java/com/google/android/gms/wearable/ChannelApi.java create mode 100644 play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/AmsEntityUpdate.java create mode 100644 play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/AncsNotification.java diff --git a/play-services-api/build.gradle b/play-services-api/build.gradle index 9b97d190..3e899acf 100644 --- a/play-services-api/build.gradle +++ b/play-services-api/build.gradle @@ -51,8 +51,8 @@ android { } dependencies { + compile project(':play-services-basement') compile project(':play-services-cast-api') - compile project(':play-services-common-api') compile project(':play-services-iid-api') compile project(':play-services-location-api') compile project(':play-services-wearable-api') diff --git a/play-services-common-api/build.gradle b/play-services-basement/build.gradle similarity index 97% rename from play-services-common-api/build.gradle rename to play-services-basement/build.gradle index f43af0a4..796ea36c 100644 --- a/play-services-common-api/build.gradle +++ b/play-services-basement/build.gradle @@ -56,5 +56,6 @@ android { } dependencies { + compile 'com.android.support:support-v4:23.4.0' compile project(':safe-parcel') } diff --git a/play-services-common-api/src/main/AndroidManifest.xml b/play-services-basement/src/main/AndroidManifest.xml similarity index 100% rename from play-services-common-api/src/main/AndroidManifest.xml rename to play-services-basement/src/main/AndroidManifest.xml diff --git a/play-services-common-api/src/main/aidl/com/google/android/gms/common/api/Status.aidl b/play-services-basement/src/main/aidl/com/google/android/gms/common/api/Status.aidl similarity index 100% rename from play-services-common-api/src/main/aidl/com/google/android/gms/common/api/Status.aidl rename to play-services-basement/src/main/aidl/com/google/android/gms/common/api/Status.aidl diff --git a/play-services-common-api/src/main/aidl/com/google/android/gms/common/data/DataHolder.aidl b/play-services-basement/src/main/aidl/com/google/android/gms/common/data/DataHolder.aidl similarity index 100% rename from play-services-common-api/src/main/aidl/com/google/android/gms/common/data/DataHolder.aidl rename to play-services-basement/src/main/aidl/com/google/android/gms/common/data/DataHolder.aidl diff --git a/play-services-common-api/src/main/aidl/com/google/android/gms/common/internal/GetServiceRequest.aidl b/play-services-basement/src/main/aidl/com/google/android/gms/common/internal/GetServiceRequest.aidl similarity index 100% rename from play-services-common-api/src/main/aidl/com/google/android/gms/common/internal/GetServiceRequest.aidl rename to play-services-basement/src/main/aidl/com/google/android/gms/common/internal/GetServiceRequest.aidl diff --git a/play-services-common-api/src/main/aidl/com/google/android/gms/common/internal/ICancelToken.aidl b/play-services-basement/src/main/aidl/com/google/android/gms/common/internal/ICancelToken.aidl similarity index 100% rename from play-services-common-api/src/main/aidl/com/google/android/gms/common/internal/ICancelToken.aidl rename to play-services-basement/src/main/aidl/com/google/android/gms/common/internal/ICancelToken.aidl diff --git a/play-services-common-api/src/main/aidl/com/google/android/gms/common/internal/IGmsCallbacks.aidl b/play-services-basement/src/main/aidl/com/google/android/gms/common/internal/IGmsCallbacks.aidl similarity index 100% rename from play-services-common-api/src/main/aidl/com/google/android/gms/common/internal/IGmsCallbacks.aidl rename to play-services-basement/src/main/aidl/com/google/android/gms/common/internal/IGmsCallbacks.aidl diff --git a/play-services-common-api/src/main/aidl/com/google/android/gms/common/internal/IGmsServiceBroker.aidl b/play-services-basement/src/main/aidl/com/google/android/gms/common/internal/IGmsServiceBroker.aidl similarity index 100% rename from play-services-common-api/src/main/aidl/com/google/android/gms/common/internal/IGmsServiceBroker.aidl rename to play-services-basement/src/main/aidl/com/google/android/gms/common/internal/IGmsServiceBroker.aidl diff --git a/play-services-common-api/src/main/aidl/com/google/android/gms/common/internal/ISignInButtonCreator.aidl b/play-services-basement/src/main/aidl/com/google/android/gms/common/internal/ISignInButtonCreator.aidl similarity index 100% rename from play-services-common-api/src/main/aidl/com/google/android/gms/common/internal/ISignInButtonCreator.aidl rename to play-services-basement/src/main/aidl/com/google/android/gms/common/internal/ISignInButtonCreator.aidl diff --git a/play-services-common-api/src/main/aidl/com/google/android/gms/common/internal/ValidateAccountRequest.aidl b/play-services-basement/src/main/aidl/com/google/android/gms/common/internal/ValidateAccountRequest.aidl similarity index 100% rename from play-services-common-api/src/main/aidl/com/google/android/gms/common/internal/ValidateAccountRequest.aidl rename to play-services-basement/src/main/aidl/com/google/android/gms/common/internal/ValidateAccountRequest.aidl diff --git a/play-services-common-api/src/main/aidl/com/google/android/gms/common/server/FavaDiagnosticsEntity.aidl b/play-services-basement/src/main/aidl/com/google/android/gms/common/server/FavaDiagnosticsEntity.aidl similarity index 100% rename from play-services-common-api/src/main/aidl/com/google/android/gms/common/server/FavaDiagnosticsEntity.aidl rename to play-services-basement/src/main/aidl/com/google/android/gms/common/server/FavaDiagnosticsEntity.aidl diff --git a/play-services-common-api/src/main/aidl/com/google/android/gms/dynamic/IObjectWrapper.aidl b/play-services-basement/src/main/aidl/com/google/android/gms/dynamic/IObjectWrapper.aidl similarity index 100% rename from play-services-common-api/src/main/aidl/com/google/android/gms/dynamic/IObjectWrapper.aidl rename to play-services-basement/src/main/aidl/com/google/android/gms/dynamic/IObjectWrapper.aidl diff --git a/play-services-basement/src/main/java/com/google/android/gms/common/ConnectionResult.java b/play-services-basement/src/main/java/com/google/android/gms/common/ConnectionResult.java new file mode 100644 index 00000000..f6f75c1a --- /dev/null +++ b/play-services-basement/src/main/java/com/google/android/gms/common/ConnectionResult.java @@ -0,0 +1,310 @@ +/* + * Copyright 2013-2015 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.common; + +import android.app.Activity; +import android.app.PendingIntent; +import android.content.Intent; +import android.content.IntentSender; +import android.text.TextUtils; + +import com.google.android.gms.common.api.GoogleApiClient; + +import java.util.Arrays; + +/** + * Contains all possible error codes for when a client fails to connect to Google Play services. + * These error codes are used by {@link GoogleApiClient.OnConnectionFailedListener}. + */ +public class ConnectionResult { + /** + * The connection was successful. + */ + public static final int SUCCESS = 0; + /** + * Google Play services is missing on this device. The calling activity should pass this error + * code to {@link GooglePlayServicesUtil#getErrorDialog(int, Activity, int)} to get a localized + * error dialog that will resolve the error when shown. + */ + public static final int SERVICE_MISSING = 1; + /** + * The installed version of Google Play services is out of date. The calling activity should + * pass this error code to {@link GooglePlayServicesUtil#getErrorDialog(int, Activity, int)} to + * get a localized error dialog that will resolve the error when shown. + */ + public static final int SERVICE_VERSION_UPDATE_REQUIRED = 2; + /** + * The installed version of Google Play services has been disabled on this device. The calling + * activity should pass this error code to + * {@link GooglePlayServicesUtil#getErrorDialog(int, Activity, int)} to get a localized error + * dialog that will resolve the error when shown. + */ + public static final int SERVICE_DISABLED = 3; + /** + * The client attempted to connect to the service but the user is not signed in. The client may + * choose to continue without using the API or it may call + * {@link #startResolutionForResult(Activity, int)} to prompt the user to sign in. After the + * sign in activity returns with {@link Activity#RESULT_OK} further attempts to connect should + * succeed. + */ + public static final int SIGN_IN_REQUIRED = 4; + /** + * The client attempted to connect to the service with an invalid account name specified. + */ + public static final int INVALID_ACCOUNT = 5; + /** + * Completing the connection requires some form of resolution. A resolution will be available + * to be started with {@link #startResolutionForResult(Activity, int)}. If the result returned + * is {@link Activity#RESULT_OK}, then further attempts to connect should either complete or + * continue on to the next issue that needs to be resolved. + */ + public static final int RESOLUTION_REQUIRED = 6; + /** + * A network error occurred. Retrying should resolve the problem. + */ + public static final int NETWORK_ERROR = 7; + /** + * An internal error occurred. Retrying should resolve the problem. + */ + public static final int INTERNAL_ERROR = 8; + /** + * The version of the Google Play services installed on this device is not authentic. + */ + public static final int SERVICE_INVALID = 9; + /** + * The application is misconfigured. This error is not recoverable and will be treated as + * fatal. The developer should look at the logs after this to determine more actionable + * information. + */ + public static final int DEVELOPER_ERROR = 10; + /** + * The application is not licensed to the user. This error is not recoverable and will be + * treated as fatal. + */ + public static final int LICENSE_CHECK_FAILED = 11; + /** + * The client canceled the connection by calling {@link GoogleApiClient#disconnect()}. + * Only returned by {@link GoogleApiClient#blockingConnect()}. + */ + public static final int CANCELED = 13; + /** + * The timeout was exceeded while waiting for the connection to complete. Only returned by + * {@link GoogleApiClient#blockingConnect()}. + */ + public static final int TIMEOUT = 14; + /** + * An interrupt occurred while waiting for the connection complete. Only returned by + * {@link GoogleApiClient#blockingConnect()}. + */ + public static final int INTERRUPTED = 15; + /** + * One of the API components you attempted to connect to is not available. The API will not + * work on this device, and updating Google Play services will not likely solve the problem. + * Using the API on the device should be avoided. + */ + public static final int API_UNAVAILABLE = 16; + + /** + * The Drive API requires external storage (such as an SD card), but no external storage is + * mounted. This error is recoverable if the user installs external storage (if none is + * present) and ensures that it is mounted (which may involve disabling USB storage mode, + * formatting the storage, or other initialization as required by the device). + *

+ * This error should never be returned on a device with emulated external storage. On devices + * with emulated external storage, the emulated "external storage" is always present regardless + * of whether the device also has removable storage. + */ + @Deprecated + public static final int DRIVE_EXTERNAL_STORAGE_REQUIRED = 1500; + + private final int statusCode; + private final PendingIntent pendingIntent; + private final String message; + + /** + * Creates a connection result. + * + * @param statusCode The status code. + */ + public ConnectionResult(int statusCode) { + this(statusCode, null); + } + + /** + * Creates a connection result. + * + * @param statusCode The status code. + * @param pendingIntent A pending intent that will resolve the issue when started, or null. + */ + public ConnectionResult(int statusCode, PendingIntent pendingIntent) { + this(statusCode, pendingIntent, getStatusString(statusCode)); + } + + /** + * Creates a connection result. + * + * @param statusCode The status code. + * @param pendingIntent A pending intent that will resolve the issue when started, or null. + * @param message An additional error message for the connection result, or null. + */ + public ConnectionResult(int statusCode, PendingIntent pendingIntent, String message) { + this.statusCode = statusCode; + this.pendingIntent = pendingIntent; + this.message = message; + } + + static String getStatusString(int statusCode) { + switch (statusCode) { + case -1: + return "UNKNOWN"; + case 0: + return "SUCCESS"; + case 1: + return "SERVICE_MISSING"; + case 2: + return "SERVICE_VERSION_UPDATE_REQUIRED"; + case 3: + return "SERVICE_DISABLED"; + case 4: + return "SIGN_IN_REQUIRED"; + case 5: + return "INVALID_ACCOUNT"; + case 6: + return "RESOLUTION_REQUIRED"; + case 7: + return "NETWORK_ERROR"; + case 8: + return "INTERNAL_ERROR"; + case 9: + return "SERVICE_INVALID"; + case 10: + return "DEVELOPER_ERROR"; + case 11: + return "LICENSE_CHECK_FAILED"; + case 13: + return "CANCELED"; + case 14: + return "TIMEOUT"; + case 15: + return "INTERRUPTED"; + case 16: + return "API_UNAVAILABLE"; + case 17: + return "SIGN_IN_FAILED"; + case 18: + return "SERVICE_UPDATING"; + case 19: + return "SERVICE_MISSING_PERMISSION"; + case 20: + return "RESTRICTED_PROFILE"; + case 21: + return "API_VERSION_UPDATE_REQUIRED"; + case 42: + return "UPDATE_ANDROID_WEAR"; + case 99: + return "UNFINISHED"; + case 1500: + return "DRIVE_EXTERNAL_STORAGE_REQUIRED"; + default: + return "UNKNOWN_ERROR_CODE(" + statusCode + ")"; + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } else if (!(o instanceof ConnectionResult)) { + return false; + } else { + ConnectionResult r = (ConnectionResult)o; + return statusCode == r.statusCode && pendingIntent == null ? r.pendingIntent == null : pendingIntent.equals(r.pendingIntent) && TextUtils.equals(message, r.message); + } + } + + /** + * Indicates the type of error that interrupted connection. + * + * @return the error code, or {@link #SUCCESS} if no error occurred. + */ + public int getErrorCode() { + return statusCode; + } + + /** + * Returns an error message for connection result. + * + * @return the message + */ + public String getErrorMessage() { + return message; + } + + /** + * A pending intent to resolve the connection failure. This intent can be started with + * {@link Activity#startIntentSenderForResult(IntentSender, int, Intent, int, int, int)} to + * present UI to solve the issue. + * + * @return The pending intent to resolve the connection failure. + */ + public PendingIntent getResolution() { + return pendingIntent; + } + + @Override + public int hashCode() { + return Arrays.hashCode(new Object[]{statusCode, pendingIntent, message}); + } + + /** + * Returns {@code true} if calling {@link #startResolutionForResult(Activity, int)} will start + * any intents requiring user interaction. + * + * @return {@code true} if there is a resolution that can be started. + */ + public boolean hasResolution() { + return statusCode != 0 && pendingIntent != null; + } + + /** + * Returns {@code true} if the connection was successful. + * + * @return {@code true} if the connection was successful, {@code false} if there was an error. + */ + public boolean isSuccess() { + return statusCode == 0; + } + + /** + * Resolves an error by starting any intents requiring user interaction. See + * {@link #SIGN_IN_REQUIRED}, and {@link #RESOLUTION_REQUIRED}. + * + * @param activity An Activity context to use to resolve the issue. The activity's + * {@link Activity#onActivityResult} method will be invoked after the user + * is done. If the resultCode is {@link Activity#RESULT_OK}, the application + * should try to connect again. + * @param requestCode The request code to pass to {@link Activity#onActivityResult}. + * @throws IntentSender.SendIntentException If the resolution intent has been canceled or is no + * longer able to execute the request. + */ + public void startResolutionForResult(Activity activity, int requestCode) throws + IntentSender.SendIntentException { + if (hasResolution()) { + activity.startIntentSenderForResult(pendingIntent.getIntentSender(), requestCode, null, 0, 0, 0); + } + } +} diff --git a/play-services-common-api/src/main/java/com/google/android/gms/common/Scopes.java b/play-services-basement/src/main/java/com/google/android/gms/common/Scopes.java similarity index 100% rename from play-services-common-api/src/main/java/com/google/android/gms/common/Scopes.java rename to play-services-basement/src/main/java/com/google/android/gms/common/Scopes.java diff --git a/play-services-common-api/src/main/java/com/google/android/gms/common/api/AccountInfo.java b/play-services-basement/src/main/java/com/google/android/gms/common/api/AccountInfo.java similarity index 100% rename from play-services-common-api/src/main/java/com/google/android/gms/common/api/AccountInfo.java rename to play-services-basement/src/main/java/com/google/android/gms/common/api/AccountInfo.java diff --git a/play-services-basement/src/main/java/com/google/android/gms/common/api/Api.java b/play-services-basement/src/main/java/com/google/android/gms/common/api/Api.java new file mode 100644 index 00000000..1b0f03f2 --- /dev/null +++ b/play-services-basement/src/main/java/com/google/android/gms/common/api/Api.java @@ -0,0 +1,84 @@ +/* + * Copyright 2013-2015 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.common.api; + +import org.microg.gms.common.PublicApi; +import org.microg.gms.common.api.ApiBuilder; + +/** + * Describes a section of the Google Play Services API that should be made available. Instances of + * this should be passed into {@link GoogleApiClient.Builder#addApi(Api)} to enable the appropriate + * parts of Google Play Services. + *

+ * Google APIs are partitioned into sections which allow your application to configure only the + * services it requires. Each Google API provides an API object which can be passed to + * {@link GoogleApiClient.Builder#addApi(Api)} in order to configure and enable that functionality + * in your {@link GoogleApiClient} instance. + *

+ * See {@link GoogleApiClient.Builder} for usage examples. + */ +@PublicApi +public final class Api { + + private final ApiBuilder builder; + + @PublicApi(exclude = true) + public Api(ApiBuilder builder) { + this.builder = builder; + } + + @PublicApi(exclude = true) + public ApiBuilder getBuilder() { + return builder; + } + + /** + * Base interface for API options. These are used to configure specific parameters for + * individual API surfaces. The default implementation has no parameters. + */ + @PublicApi + public interface ApiOptions { + /** + * Base interface for {@link ApiOptions} in {@link Api}s that have options. + */ + @PublicApi + interface HasOptions extends ApiOptions { + } + + /** + * Base interface for {@link ApiOptions} that are not required, don't exist. + */ + @PublicApi + interface NotRequiredOptions extends ApiOptions { + } + + /** + * {@link ApiOptions} implementation for {@link Api}s that do not take any options. + */ + @PublicApi + final class NoOptions implements NotRequiredOptions { + } + + /** + * Base interface for {@link ApiOptions} that are optional. + */ + @PublicApi + interface Optional extends HasOptions, NotRequiredOptions { + } + } + +} diff --git a/play-services-common-api/src/main/java/com/google/android/gms/common/api/CommonStatusCodes.java b/play-services-basement/src/main/java/com/google/android/gms/common/api/CommonStatusCodes.java similarity index 100% rename from play-services-common-api/src/main/java/com/google/android/gms/common/api/CommonStatusCodes.java rename to play-services-basement/src/main/java/com/google/android/gms/common/api/CommonStatusCodes.java diff --git a/play-services-basement/src/main/java/com/google/android/gms/common/api/GoogleApiClient.java b/play-services-basement/src/main/java/com/google/android/gms/common/api/GoogleApiClient.java new file mode 100644 index 00000000..87b05d6b --- /dev/null +++ b/play-services-basement/src/main/java/com/google/android/gms/common/api/GoogleApiClient.java @@ -0,0 +1,494 @@ +/* + * Copyright 2013-2015 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.common.api; + +import android.app.Activity; +import android.content.Context; +import android.os.Bundle; +import android.os.Handler; +import android.os.Looper; +import android.support.v4.app.FragmentActivity; +import android.view.View; + +import com.google.android.gms.common.ConnectionResult; + +import org.microg.gms.auth.AuthConstants; +import org.microg.gms.common.PublicApi; +import org.microg.gms.common.api.GoogleApiClientImpl; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.TimeUnit; + +/** + * The main entry point for Google Play services integration. + *

+ * GoogleApiClient is used with a variety of static methods. Some of these methods require that + * GoogleApiClient be connected, some will queue up calls before GoogleApiClient is connected; + * check the specific API documentation to determine whether you need to be connected. + *

+ * Before any operation is executed, the GoogleApiClient must be connected using the + * {@link #connect()} method. The client is not considered connected until the + * {@link ConnectionCallbacks#onConnected(Bundle)} callback has been called. + *

+ * When your app is done using this client, call {@link #disconnect()}, even if the async result + * from {@link #connect()} has not yet been delivered. + *

+ * You should instantiate a client object in your Activity's {@link Activity#onCreate(Bundle)} + * method and then call {@link #connect()} in {@link Activity#onStart()} and {@link #disconnect()} + * in {@link Activity#onStop()}, regardless of the state. + */ +@PublicApi +public interface GoogleApiClient { + /** + * Connects the client to Google Play services. Blocks until the connection either succeeds or + * fails. This is not allowed on the UI thread. + * + * @return the result of the connection + */ + ConnectionResult blockingConnect(); + + /** + * Connects the client to Google Play services. Blocks until the connection is set or failed or + * has timed out. This is not allowed on the UI thread. + * + * @param timeout the maximum time to wait + * @param unit the time unit of the {@code timeout} argument + * @return the result of the connection + */ + ConnectionResult blockingConnect(long timeout, TimeUnit unit); + + /** + * Clears the account selected by the user and reconnects the client asking the user to pick an + * account again if {@link Builder#useDefaultAccount()} was set. + * + * @return the pending result is fired once the default account has been cleared, but before + * the client is reconnected - for that {@link ConnectionCallbacks} can be used. + */ + PendingResult clearDefaultAccountAndReconnect(); + + /** + * Connects the client to Google Play services. This method returns immediately, and connects + * to the service in the background. If the connection is successful, + * {@link ConnectionCallbacks#onConnected(Bundle)} is called and enqueued items are executed. + * On a failure, {@link OnConnectionFailedListener#onConnectionFailed(ConnectionResult)} is + * called. + */ + void connect(); + + /** + * Closes the connection to Google Play services. No calls can be made using this client after + * calling this method. Any method calls that haven't executed yet will be canceled. That is + * {@link ResultCallback#onResult(Result)} won't be called, if connection to the service hasn't + * been established yet all calls already made will be canceled. + * + * @see #connect() + */ + void disconnect(); + + /** + * Checks if the client is currently connected to the service, so that requests to other + * methods will succeed. Applications should guard client actions caused by the user with a + * call to this method. + * + * @return {@code true} if the client is connected to the service. + */ + boolean isConnected(); + + /** + * Checks if the client is attempting to connect to the service. + * + * @return {@code true} if the client is attempting to connect to the service. + */ + boolean isConnecting(); + + /** + * Returns {@code true} if the specified listener is currently registered to receive connection + * events. + * + * @param listener The listener to check for. + * @return {@code true} if the specified listener is currently registered to receive connection + * events. + * @see #registerConnectionCallbacks(ConnectionCallbacks) + * @see #unregisterConnectionCallbacks(ConnectionCallbacks) + */ + boolean isConnectionCallbacksRegistered(ConnectionCallbacks listener); + + /** + * Returns {@code true} if the specified listener is currently registered to receive connection + * failed events. + * + * @param listener The listener to check for. + * @return {@code true} if the specified listener is currently registered to receive connection + * failed events. + * @see #registerConnectionFailedListener(OnConnectionFailedListener) + * @see #unregisterConnectionFailedListener(OnConnectionFailedListener) + */ + public boolean isConnectionFailedListenerRegistered(OnConnectionFailedListener listener); + + /** + * Closes the current connection to Google Play services and creates a new connection. + *

+ * This method closes the current connection then returns immediately and reconnects to the + * service in the background. + *

+ * After calling this method, your application will receive + * {@link ConnectionCallbacks#onConnected(Bundle)} if the connection is successful, or + * {@link OnConnectionFailedListener#onConnectionFailed(ConnectionResult)} if the connection + * failed. + * + * @see #connect() + * @see #disconnect() + */ + void reconnect(); + + /** + * Registers a listener to receive connection events from this {@link GoogleApiClient}. If the + * service is already connected, the listener's {@link ConnectionCallbacks#onConnected(Bundle)} + * method will be called immediately. Applications should balance calls to this method with + * calls to {@link #unregisterConnectionCallbacks(ConnectionCallbacks)} to avoid leaking + * resources. + *

+ * If the specified listener is already registered to receive connection events, this method + * will not add a duplicate entry for the same listener, but will still call the listener's + * {@link ConnectionCallbacks#onConnected(Bundle)} method if currently connected. + *

+ * Note that the order of messages received here may not be stable, so clients should not rely + * on the order that multiple listeners receive events in. + * + * @param listener the listener where the results of the asynchronous {@link #connect()} call + * are delivered. + */ + void registerConnectionCallbacks(ConnectionCallbacks listener); + + /** + * Registers a listener to receive connection failed events from this {@link GoogleApiClient}. + * Unlike {@link #registerConnectionCallbacks(ConnectionCallbacks)}, if the service is not + * already connected, the listener's + * {@link OnConnectionFailedListener#onConnectionFailed(ConnectionResult)} method will not be + * called immediately. Applications should balance calls to this method with calls to + * {@link #unregisterConnectionFailedListener(OnConnectionFailedListener)} to avoid leaking + * resources. + *

+ * If the specified listener is already registered to receive connection failed events, this + * method will not add a duplicate entry for the same listener. + *

+ * Note that the order of messages received here may not be stable, so clients should not rely + * on the order that multiple listeners receive events in. + * + * @param listener the listener where the results of the asynchronous {@link #connect()} call + * are delivered. + */ + public void registerConnectionFailedListener(OnConnectionFailedListener listener); + + /** + * Disconnects the client and stops automatic lifecycle management. Use this before creating a + * new client (which might be necessary when switching accounts, changing the set of used APIs + * etc.). + *

+ * This method must be called from the main thread. + * + * @param lifecycleActivity the activity managing the client's lifecycle. + * @throws IllegalStateException if called from outside of the main thread. + * @see Builder#enableAutoManage(FragmentActivity, int, OnConnectionFailedListener) + */ + void stopAutoManager(FragmentActivity lifecycleActivity) throws IllegalStateException; + + /** + * Removes a connection listener from this {@link GoogleApiClient}. Note that removing a + * listener does not generate any callbacks. + *

+ * If the specified listener is not currently registered to receive connection events, this + * method will have no effect. + * + * @param listener the listener to unregister. + */ + void unregisterConnectionCallbacks(ConnectionCallbacks listener); + + /** + * Removes a connection failed listener from the {@link GoogleApiClient}. Note that removing a + * listener does not generate any callbacks. + *

+ * If the specified listener is not currently registered to receive connection failed events, + * this method will have no effect. + * + * @param listener the listener to unregister. + */ + void unregisterConnectionFailedListener(OnConnectionFailedListener listener); + + /** + * Builder to configure a {@link GoogleApiClient}. + */ + @PublicApi + class Builder { + private final Context context; + private final Map apis = new HashMap(); + private final Set connectionCallbacks = new HashSet(); + private final Set connectionFailedListeners = new HashSet(); + private final Set scopes = new HashSet(); + private String accountName; + private int clientId = -1; + private FragmentActivity fragmentActivity; + private Looper looper; + private int gravityForPopups; + private OnConnectionFailedListener unresolvedConnectionFailedListener; + private View viewForPopups; + + /** + * Builder to help construct the {@link GoogleApiClient} object. + * + * @param context The context to use for the connection. + */ + public Builder(Context context) { + this.context = context; + this.looper = context.getMainLooper(); + } + + /** + * Builder to help construct the {@link GoogleApiClient} object. + * + * @param context The context to use for the connection. + * @param connectedListener The listener where the results of the asynchronous + * {@link #connect()} call are delivered. + * @param connectionFailedListener The listener which will be notified if the connection + * attempt fails. + */ + public Builder(Context context, ConnectionCallbacks connectedListener, + OnConnectionFailedListener connectionFailedListener) { + this(context); + addConnectionCallbacks(connectedListener); + addOnConnectionFailedListener(connectionFailedListener); + } + + /** + * Specify which Apis are requested by your app. See {@link Api} for more information. + * + * @param api The Api requested by your app. + * @param options Any additional parameters required for the specific AP + * @see Api + */ + public Builder addApi(Api api, O options) { + apis.put(api, options); + return this; + } + + /** + * Specify which Apis are requested by your app. See {@link Api} for more information. + * + * @param api The Api requested by your app. + * @see Api + */ + public Builder addApi(Api api) { + apis.put(api, null); + return this; + } + + /** + * Registers a listener to receive connection events from this {@link GoogleApiClient}. + * Applications should balance calls to this method with calls to + * {@link #unregisterConnectionCallbacks(ConnectionCallbacks)} to avoid + * leaking resources. + *

+ * If the specified listener is already registered to receive connection events, this + * method will not add a duplicate entry for the same listener. + *

+ * Note that the order of messages received here may not be stable, so clients should not + * rely on the order that multiple listeners receive events in. + * + * @param listener the listener where the results of the asynchronous {@link #connect()} + * call are delivered. + */ + public Builder addConnectionCallbacks(ConnectionCallbacks listener) { + connectionCallbacks.add(listener); + return this; + } + + /** + * Adds a listener to register to receive connection failed events from this + * {@link GoogleApiClient}. Applications should balance calls to this method with calls to + * {@link #unregisterConnectionFailedListener(OnConnectionFailedListener)} to avoid + * leaking resources. + *

+ * If the specified listener is already registered to receive connection failed events, + * this method will not add a duplicate entry for the same listener. + *

+ * Note that the order of messages received here may not be stable, so clients should not + * rely on the order that multiple listeners receive events in. + * + * @param listener the listener where the results of the asynchronous {@link #connect()} + * call are delivered. + */ + public Builder addOnConnectionFailedListener(OnConnectionFailedListener listener) { + connectionFailedListeners.add(listener); + return this; + } + + /** + * Specify the OAuth 2.0 scopes requested by your app. See + * {@link com.google.android.gms.common.Scopes} for more information. + * + * @param scope The OAuth 2.0 scopes requested by your app. + * @see com.google.android.gms.common.Scopes + */ + public Builder addScope(Scope scope) { + scopes.add(scope.getScopeUri()); + return this; + } + + /** + * Builds a new {@link GoogleApiClient} object for communicating with the Google APIs. + * + * @return The {@link GoogleApiClient} object. + */ + public GoogleApiClient build() { + return new GoogleApiClientImpl(context, looper, getAccountInfo(), apis, + connectionCallbacks, connectionFailedListeners, clientId); + } + + private AccountInfo getAccountInfo() { + return null; + } + + public Builder enableAutoManage(FragmentActivity fragmentActivity, int cliendId, + OnConnectionFailedListener unresolvedConnectionFailedListener) + throws NullPointerException, IllegalArgumentException, IllegalStateException { + this.fragmentActivity = fragmentActivity; + this.clientId = cliendId; + this.unresolvedConnectionFailedListener = unresolvedConnectionFailedListener; + return this; + } + + /** + * Specify an account name on the device that should be used. If this is never called, the + * client will use the current default account for Google Play services for this + * application. + * + * @param accountName The account name on the device that should be used by + * {@link GoogleApiClient}. + */ + public Builder setAccountName(String accountName) { + this.accountName = accountName; + return this; + } + + /** + * Specifies the part of the screen at which games service popups (for example, + * "welcome back" or "achievement unlocked" popups) will be displayed using gravity. + * + * @param gravityForPopups The gravity which controls the placement of games service popups. + */ + public Builder setGravityForPopups(int gravityForPopups) { + this.gravityForPopups = gravityForPopups; + return this; + } + + /** + * Sets a {@link Handler} to indicate which thread to use when invoking callbacks. Will not + * be used directly to handle callbacks. If this is not called then the application's main + * thread will be used. + */ + public Builder setHandler(Handler handler) { + this.looper = handler.getLooper(); + return this; + } + + /** + * Sets the {@link View} to use as a content view for popups. + * + * @param viewForPopups The view to use as a content view for popups. View cannot be null. + */ + public Builder setViewForPopups(View viewForPopups) { + this.viewForPopups = viewForPopups; + return this; + } + + /** + * Specify that the default account should be used when connecting to services. + */ + public Builder useDefaultAccount() { + this.accountName = AuthConstants.DEFAULT_ACCOUNT; + return this; + } + } + + /** + * Provides callbacks that are called when the client is connected or disconnected from the + * service. Most applications implement {@link #onConnected(Bundle)} to start making requests. + */ + @PublicApi + interface ConnectionCallbacks { + /** + * A suspension cause informing that the service has been killed. + */ + int CAUSE_SERVICE_DISCONNECTED = 1; + /** + * A suspension cause informing you that a peer device connection was lost. + */ + int CAUSE_NETWORK_LOST = 2; + + /** + * After calling {@link #connect()}, this method will be invoked asynchronously when the + * connect request has successfully completed. After this callback, the application can + * make requests on other methods provided by the client and expect that no user + * intervention is required to call methods that use account and scopes provided to the + * client constructor. + *

+ * Note that the contents of the {@code connectionHint} Bundle are defined by the specific + * services. Please see the documentation of the specific implementation of + * {@link GoogleApiClient} you are using for more information. + * + * @param connectionHint Bundle of data provided to clients by Google Play services. May + * be null if no content is provided by the service. + */ + void onConnected(Bundle connectionHint); + + /** + * Called when the client is temporarily in a disconnected state. This can happen if there + * is a problem with the remote service (e.g. a crash or resource problem causes it to be + * killed by the system). When called, all requests have been canceled and no outstanding + * listeners will be executed. GoogleApiClient will automatically attempt to restore the + * connection. Applications should disable UI components that require the service, and wait + * for a call to {@link #onConnected(Bundle)} to re-enable them. + * + * @param cause The reason for the disconnection. Defined by constants {@code CAUSE_*}. + */ + void onConnectionSuspended(int cause); + } + + /** + * Provides callbacks for scenarios that result in a failed attempt to connect the client to + * the service. See {@link ConnectionResult} for a list of error codes and suggestions for + * resolution. + */ + @PublicApi + interface OnConnectionFailedListener { + /** + * Called when there was an error connecting the client to the service. + * + * @param result A {@link ConnectionResult} that can be used for resolving the error, and + * deciding what sort of error occurred. To resolve the error, the resolution + * must be started from an activity with a non-negative {@code requestCode} + * passed to {@link ConnectionResult#startResolutionForResult(Activity, int)}. + * Applications should implement {@link Activity#onActivityResult} in their + * Activity to call {@link #connect()} again if the user has resolved the + * issue (resultCode is {@link Activity#RESULT_OK}). + */ + void onConnectionFailed(ConnectionResult result); + } +} diff --git a/play-services-basement/src/main/java/com/google/android/gms/common/api/PendingResult.java b/play-services-basement/src/main/java/com/google/android/gms/common/api/PendingResult.java new file mode 100644 index 00000000..28943f18 --- /dev/null +++ b/play-services-basement/src/main/java/com/google/android/gms/common/api/PendingResult.java @@ -0,0 +1,59 @@ +/* + * Copyright 2013-2015 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.common.api; + +import java.util.concurrent.TimeUnit; + +/** + * Represents a pending result from calling an API method in Google Play services. The final result + * object from a PendingResult is of type R, which can be retrieved in one of two ways. + *

+ *

    + *
  • via blocking calls to {@link #await()}, or {@link #await(long, TimeUnit)}, or
  • + *
  • via a callback by passing in an object implementing interface {@link ResultCallback} to + * {@link #setResultCallback(ResultCallback)}.
  • + *
+ * After the result has been retrieved using {@link #await()} or delivered to the result callback, + * it is an error to attempt to retrieve the result again. It is the responsibility of the caller + * or callback receiver to release any resources associated with the returned result. Some result + * types may implement {@link Releasable}, in which case {@link Releasable#release()} should be + * used to free the associated resources. + *

+ * TODO: Docs + */ +public interface PendingResult { + /** + * Blocks until the task is completed. This is not allowed on the UI thread. The returned + * result object can have an additional failure mode of INTERRUPTED. + */ + public R await(); + + /** + * Blocks until the task is completed or has timed out waiting for the result. This is not + * allowed on the UI thread. The returned result object can have an additional failure mode + * of either INTERRUPTED or TIMEOUT. + */ + public R await(long time, TimeUnit unit); + + public void cancel(); + + public boolean isCanceled(); + + public void setResultCallback(ResultCallback callback, long time, TimeUnit unit); + + public void setResultCallback(ResultCallback callback); +} diff --git a/play-services-basement/src/main/java/com/google/android/gms/common/api/Releasable.java b/play-services-basement/src/main/java/com/google/android/gms/common/api/Releasable.java new file mode 100644 index 00000000..4ea1c727 --- /dev/null +++ b/play-services-basement/src/main/java/com/google/android/gms/common/api/Releasable.java @@ -0,0 +1,24 @@ +/* + * Copyright 2013-2016 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.common.api; + +/** + * Represents a resource, or a holder of resources, which may be released once they are no longer needed. + */ +public interface Releasable { + void release(); +} diff --git a/play-services-common-api/src/main/java/com/google/android/gms/common/api/Result.java b/play-services-basement/src/main/java/com/google/android/gms/common/api/Result.java similarity index 100% rename from play-services-common-api/src/main/java/com/google/android/gms/common/api/Result.java rename to play-services-basement/src/main/java/com/google/android/gms/common/api/Result.java diff --git a/play-services-basement/src/main/java/com/google/android/gms/common/api/ResultCallback.java b/play-services-basement/src/main/java/com/google/android/gms/common/api/ResultCallback.java new file mode 100644 index 00000000..4695dbcb --- /dev/null +++ b/play-services-basement/src/main/java/com/google/android/gms/common/api/ResultCallback.java @@ -0,0 +1,33 @@ +/* + * Copyright 2013-2015 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.common.api; + +/** + * An interface for receiving a {@link Result} from a {@link PendingResult} as an asynchronous + * callback. + */ +public interface ResultCallback { + /** + * Called when the {@link Result} is ready. It is the responsibility of each callback to + * release any resources associated with the result. Some result types may implement + * {@link Releasable}, in which case {@link Releasable#release()} should be used to free the + * associated resources. + * + * @param result The result from the API call. May not be null. + */ + public void onResult(R result); +} diff --git a/play-services-common-api/src/main/java/com/google/android/gms/common/api/Scope.java b/play-services-basement/src/main/java/com/google/android/gms/common/api/Scope.java similarity index 100% rename from play-services-common-api/src/main/java/com/google/android/gms/common/api/Scope.java rename to play-services-basement/src/main/java/com/google/android/gms/common/api/Scope.java diff --git a/play-services-common-api/src/main/java/com/google/android/gms/common/api/Status.java b/play-services-basement/src/main/java/com/google/android/gms/common/api/Status.java similarity index 100% rename from play-services-common-api/src/main/java/com/google/android/gms/common/api/Status.java rename to play-services-basement/src/main/java/com/google/android/gms/common/api/Status.java diff --git a/play-services-common-api/src/main/java/com/google/android/gms/common/data/DataHolder.java b/play-services-basement/src/main/java/com/google/android/gms/common/data/DataHolder.java similarity index 100% rename from play-services-common-api/src/main/java/com/google/android/gms/common/data/DataHolder.java rename to play-services-basement/src/main/java/com/google/android/gms/common/data/DataHolder.java diff --git a/play-services-common-api/src/main/java/com/google/android/gms/common/data/Freezable.java b/play-services-basement/src/main/java/com/google/android/gms/common/data/Freezable.java similarity index 100% rename from play-services-common-api/src/main/java/com/google/android/gms/common/data/Freezable.java rename to play-services-basement/src/main/java/com/google/android/gms/common/data/Freezable.java diff --git a/play-services-common-api/src/main/java/com/google/android/gms/common/images/WebImage.java b/play-services-basement/src/main/java/com/google/android/gms/common/images/WebImage.java similarity index 100% rename from play-services-common-api/src/main/java/com/google/android/gms/common/images/WebImage.java rename to play-services-basement/src/main/java/com/google/android/gms/common/images/WebImage.java diff --git a/play-services-common-api/src/main/java/com/google/android/gms/common/internal/BinderWrapper.java b/play-services-basement/src/main/java/com/google/android/gms/common/internal/BinderWrapper.java similarity index 100% rename from play-services-common-api/src/main/java/com/google/android/gms/common/internal/BinderWrapper.java rename to play-services-basement/src/main/java/com/google/android/gms/common/internal/BinderWrapper.java diff --git a/play-services-common-api/src/main/java/com/google/android/gms/common/internal/GetServiceRequest.java b/play-services-basement/src/main/java/com/google/android/gms/common/internal/GetServiceRequest.java similarity index 100% rename from play-services-common-api/src/main/java/com/google/android/gms/common/internal/GetServiceRequest.java rename to play-services-basement/src/main/java/com/google/android/gms/common/internal/GetServiceRequest.java diff --git a/play-services-common-api/src/main/java/com/google/android/gms/common/internal/ValidateAccountRequest.java b/play-services-basement/src/main/java/com/google/android/gms/common/internal/ValidateAccountRequest.java similarity index 100% rename from play-services-common-api/src/main/java/com/google/android/gms/common/internal/ValidateAccountRequest.java rename to play-services-basement/src/main/java/com/google/android/gms/common/internal/ValidateAccountRequest.java diff --git a/play-services-common-api/src/main/java/com/google/android/gms/common/server/FavaDiagnosticsEntity.java b/play-services-basement/src/main/java/com/google/android/gms/common/server/FavaDiagnosticsEntity.java similarity index 100% rename from play-services-common-api/src/main/java/com/google/android/gms/common/server/FavaDiagnosticsEntity.java rename to play-services-basement/src/main/java/com/google/android/gms/common/server/FavaDiagnosticsEntity.java diff --git a/play-services-common-api/src/main/java/com/google/android/gms/dynamic/ObjectWrapper.java b/play-services-basement/src/main/java/com/google/android/gms/dynamic/ObjectWrapper.java similarity index 100% rename from play-services-common-api/src/main/java/com/google/android/gms/dynamic/ObjectWrapper.java rename to play-services-basement/src/main/java/com/google/android/gms/dynamic/ObjectWrapper.java diff --git a/play-services-common-api/src/main/java/org/microg/gms/auth/AuthConstants.java b/play-services-basement/src/main/java/org/microg/gms/auth/AuthConstants.java similarity index 100% rename from play-services-common-api/src/main/java/org/microg/gms/auth/AuthConstants.java rename to play-services-basement/src/main/java/org/microg/gms/auth/AuthConstants.java diff --git a/play-services-common-api/src/main/java/org/microg/gms/common/Constants.java b/play-services-basement/src/main/java/org/microg/gms/common/Constants.java similarity index 100% rename from play-services-common-api/src/main/java/org/microg/gms/common/Constants.java rename to play-services-basement/src/main/java/org/microg/gms/common/Constants.java diff --git a/play-services-common-api/src/main/java/org/microg/gms/common/GmsService.java b/play-services-basement/src/main/java/org/microg/gms/common/GmsService.java similarity index 100% rename from play-services-common-api/src/main/java/org/microg/gms/common/GmsService.java rename to play-services-basement/src/main/java/org/microg/gms/common/GmsService.java diff --git a/play-services-common-api/src/main/java/org/microg/gms/common/PublicApi.java b/play-services-basement/src/main/java/org/microg/gms/common/PublicApi.java similarity index 100% rename from play-services-common-api/src/main/java/org/microg/gms/common/PublicApi.java rename to play-services-basement/src/main/java/org/microg/gms/common/PublicApi.java diff --git a/play-services-basement/src/main/java/org/microg/gms/common/api/ApiBuilder.java b/play-services-basement/src/main/java/org/microg/gms/common/api/ApiBuilder.java new file mode 100644 index 00000000..6c12551e --- /dev/null +++ b/play-services-basement/src/main/java/org/microg/gms/common/api/ApiBuilder.java @@ -0,0 +1,30 @@ +/* + * Copyright 2013-2016 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 org.microg.gms.common.api; + +import android.content.Context; +import android.os.Looper; + +import com.google.android.gms.common.api.AccountInfo; +import com.google.android.gms.common.api.Api; +import com.google.android.gms.common.api.GoogleApiClient; + +public interface ApiBuilder { + ApiConnection build(Context context, Looper looper, O options, AccountInfo accountInfo, + GoogleApiClient.ConnectionCallbacks callbacks, + GoogleApiClient.OnConnectionFailedListener connectionFailedListener); +} diff --git a/play-services-basement/src/main/java/org/microg/gms/common/api/ApiConnection.java b/play-services-basement/src/main/java/org/microg/gms/common/api/ApiConnection.java new file mode 100644 index 00000000..019ea5d8 --- /dev/null +++ b/play-services-basement/src/main/java/org/microg/gms/common/api/ApiConnection.java @@ -0,0 +1,27 @@ +/* + * Copyright 2013-2015 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 org.microg.gms.common.api; + +public interface ApiConnection { + void connect(); + + void disconnect(); + + boolean isConnected(); + + boolean isConnecting(); +} diff --git a/play-services-basement/src/main/java/org/microg/gms/common/api/GoogleApiClientImpl.java b/play-services-basement/src/main/java/org/microg/gms/common/api/GoogleApiClientImpl.java new file mode 100644 index 00000000..5993b403 --- /dev/null +++ b/play-services-basement/src/main/java/org/microg/gms/common/api/GoogleApiClientImpl.java @@ -0,0 +1,223 @@ +/* + * Copyright 2013-2016 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 org.microg.gms.common.api; + +import android.content.Context; +import android.os.Bundle; +import android.os.Looper; +import android.os.Message; +import android.support.v4.app.FragmentActivity; +import android.util.Log; + +import com.google.android.gms.common.ConnectionResult; +import com.google.android.gms.common.api.AccountInfo; +import com.google.android.gms.common.api.Api; +import com.google.android.gms.common.api.GoogleApiClient; +import com.google.android.gms.common.api.PendingResult; +import com.google.android.gms.common.api.Status; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.TimeUnit; + +public class GoogleApiClientImpl implements GoogleApiClient { + private static final String TAG = "GmsApiClientImpl"; + + private final Context context; + private final Looper looper; + private final AccountInfo accountInfo; + private final Map apis = new HashMap(); + private final Map apiConnections = new HashMap(); + private final Handler handler; + private final Set connectionCallbacks = new HashSet(); + private final Set connectionFailedListeners = new HashSet(); + private final int clientId; + private final ConnectionCallbacks baseConnectionCallbacks = new ConnectionCallbacks() { + @Override + public void onConnected(Bundle connectionHint) { + Log.d(TAG, "ConnectionCallbacks : onConnected()"); + for (ConnectionCallbacks callback : connectionCallbacks) { + callback.onConnected(connectionHint); + } + } + + @Override + public void onConnectionSuspended(int cause) { + Log.d(TAG, "ConnectionCallbacks : onConnectionSuspended()"); + for (ConnectionCallbacks callback : connectionCallbacks) { + callback.onConnectionSuspended(cause); + } + } + }; + private final OnConnectionFailedListener baseConnectionFailedListener = new + OnConnectionFailedListener() { + @Override + public void onConnectionFailed(ConnectionResult result) { + Log.d(TAG, "OnConnectionFailedListener : onConnectionFailed()"); + for (OnConnectionFailedListener listener : connectionFailedListeners) { + listener.onConnectionFailed(result); + } + } + }; + + public GoogleApiClientImpl(Context context, Looper looper, AccountInfo accountInfo, + Map apis, + Set connectionCallbacks, + Set connectionFailedListeners, int clientId) { + this.context = context; + this.looper = looper; + this.handler = new Handler(looper); + this.accountInfo = accountInfo; + this.apis.putAll(apis); + this.connectionCallbacks.addAll(connectionCallbacks); + this.connectionFailedListeners.addAll(connectionFailedListeners); + this.clientId = clientId; + + for (Api api : apis.keySet()) { + apiConnections.put(api, api.getBuilder().build(context, looper, + apis.get(api), accountInfo, baseConnectionCallbacks, + baseConnectionFailedListener)); + } + } + + public Looper getLooper() { + return looper; + } + + public ApiConnection getApiConnection(Api api) { + return apiConnections.get(api); + } + + @Override + public ConnectionResult blockingConnect() { + return null; + } + + @Override + public ConnectionResult blockingConnect(long timeout, TimeUnit unit) { + return null; + } + + @Override + public PendingResult clearDefaultAccountAndReconnect() { + return null; + } + + @Override + public synchronized void connect() { + Log.d(TAG, "connect()"); + if (isConnected() || isConnecting()) { + Log.d(TAG, "Already connected/connecting, nothing to do"); + return; + } + for (ApiConnection connection : apiConnections.values()) { + if (!connection.isConnected()) { + connection.connect(); + } + } + } + + @Override + public synchronized void disconnect() { + Log.d(TAG, "disconnect()"); + for (ApiConnection connection : apiConnections.values()) { + if (connection.isConnected()) { + connection.disconnect(); + } + } + } + + @Override + public synchronized boolean isConnected() { + for (ApiConnection connection : apiConnections.values()) { + if (!connection.isConnected()) return false; + } + return true; + } + + @Override + public synchronized boolean isConnecting() { + for (ApiConnection connection : apiConnections.values()) { + if (connection.isConnecting()) return true; + } + return false; + } + + @Override + public boolean isConnectionCallbacksRegistered(ConnectionCallbacks listener) { + return connectionCallbacks.contains(listener); + } + + @Override + public boolean isConnectionFailedListenerRegistered( + OnConnectionFailedListener listener) { + return connectionFailedListeners.contains(listener); + } + + @Override + public synchronized void reconnect() { + Log.d(TAG, "reconnect()"); + disconnect(); + connect(); + } + + @Override + public void registerConnectionCallbacks(ConnectionCallbacks listener) { + connectionCallbacks.add(listener); + } + + @Override + public void registerConnectionFailedListener(OnConnectionFailedListener listener) { + connectionFailedListeners.add(listener); + } + + @Override + public void stopAutoManager(FragmentActivity lifecycleActivity) throws IllegalStateException { + + } + + @Override + public void unregisterConnectionCallbacks(ConnectionCallbacks listener) { + connectionCallbacks.remove(listener); + } + + @Override + public void unregisterConnectionFailedListener(OnConnectionFailedListener listener) { + connectionFailedListeners.remove(listener); + } + + private class Handler extends android.os.Handler { + private Handler(Looper looper) { + super(looper); + } + + @Override + public void handleMessage(Message msg) { + if (msg.what == 0 && msg.obj instanceof Runnable) { + ((Runnable) msg.obj).run(); + } else { + super.handleMessage(msg); + } + } + + public void sendRunnable(Runnable runnable) { + sendMessage(obtainMessage(1, runnable)); + } + } +} diff --git a/play-services-common-api/src/main/java/org/microg/gms/gcm/GcmConstants.java b/play-services-basement/src/main/java/org/microg/gms/gcm/GcmConstants.java similarity index 100% rename from play-services-common-api/src/main/java/org/microg/gms/gcm/GcmConstants.java rename to play-services-basement/src/main/java/org/microg/gms/gcm/GcmConstants.java diff --git a/play-services-cast-api/build.gradle b/play-services-cast-api/build.gradle index 47f513a0..3ce1445d 100644 --- a/play-services-cast-api/build.gradle +++ b/play-services-cast-api/build.gradle @@ -51,5 +51,5 @@ android { } dependencies { - compile project(':play-services-common-api') + compile project(':play-services-basement') } diff --git a/play-services-iid-api/build.gradle b/play-services-iid-api/build.gradle index 47f513a0..3ce1445d 100644 --- a/play-services-iid-api/build.gradle +++ b/play-services-iid-api/build.gradle @@ -51,5 +51,5 @@ android { } dependencies { - compile project(':play-services-common-api') + compile project(':play-services-basement') } diff --git a/play-services-location-api/build.gradle b/play-services-location-api/build.gradle index 47f513a0..3ce1445d 100644 --- a/play-services-location-api/build.gradle +++ b/play-services-location-api/build.gradle @@ -51,5 +51,5 @@ android { } dependencies { - compile project(':play-services-common-api') + compile project(':play-services-basement') } diff --git a/play-services-wearable-api/build.gradle b/play-services-wearable-api/build.gradle index 47f513a0..3ce1445d 100644 --- a/play-services-wearable-api/build.gradle +++ b/play-services-wearable-api/build.gradle @@ -51,5 +51,5 @@ android { } dependencies { - compile project(':play-services-common-api') + compile project(':play-services-basement') } diff --git a/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/Channel.java b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/Channel.java new file mode 100644 index 00000000..7c74ca5f --- /dev/null +++ b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/Channel.java @@ -0,0 +1,94 @@ +/* + * Copyright 2013-2016 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; + +import android.net.Uri; +import android.os.Parcelable; + +import com.google.android.gms.common.api.GoogleApiClient; +import com.google.android.gms.common.api.PendingResult; +import com.google.android.gms.common.api.Releasable; +import com.google.android.gms.common.api.Result; +import com.google.android.gms.common.api.Status; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; + +/** + * A channel created through {@link ChannelApi#openChannel(GoogleApiClient, String, String)}. + *

+ * The implementation of this interface is parcelable and immutable, and implements reasonable {@link #equals(Object)} + * and {@link #hashCode()} methods, so can be used in collections. + */ +public interface Channel extends Parcelable { + + PendingResult addListener(GoogleApiClient client, ChannelApi.ChannelListener listener); + + PendingResult close(GoogleApiClient client, int errorCode); + + PendingResult close(GoogleApiClient client); + + PendingResult getInputStream(GoogleApiClient client); + + PendingResult getOutputStream(GoogleApiClient client); + + String getPath(); + + PendingResult receiveFile(GoogleApiClient client, Uri uri, boolean append); + + PendingResult removeListener(GoogleApiClient client, ChannelApi.ChannelListener listener); + + PendingResult sendFile(GoogleApiClient client, Uri uri); + + PendingResult sendFile(GoogleApiClient client, Uri uri, long startOffset, long length); + + interface GetInputStreamResult extends Releasable, Result { + /** + * Returns an input stream which can read data from the remote node. The stream should be + * closed when no longer needed. This method will only return {@code null} if this result's + * {@linkplain #getStatus() status} was not {@linkplain Status#isSuccess() success}. + *

+ * The returned stream will throw {@link IOException} on read if any connection errors + * occur. This exception might be a {@link ChannelIOException}. + *

+ * Since data for this stream comes over the network, reads may block for a long time. + *

+ * Multiple calls to this method will return the same instance. + */ + InputStream getInputStream(); + } + + interface GetOutputStreamResult extends Releasable, Result { + /** + * Returns an output stream which can send data to a remote node. The stream should be + * closed when no longer needed. This method will only return {@code null} if this result's + * {@linkplain #getStatus() status} was not {@linkplain Status#isSuccess() success}. + *

+ * The returned stream will throw {@link IOException} on read if any connection errors + * occur. This exception might be a {@link ChannelIOException}. + *

+ * Since data for this stream comes over the network, reads may block for a long time. + *

+ * Data written to this stream is buffered. If you wish to send the current data without + * waiting for the buffer to fill up, {@linkplain OutputStream#flush() flush} the stream. + *

+ * Multiple calls to this method will return the same instance. + */ + OutputStream getOutputStream(); + } +} diff --git a/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/ChannelApi.java b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/ChannelApi.java new file mode 100644 index 00000000..66d6ae71 --- /dev/null +++ b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/ChannelApi.java @@ -0,0 +1,185 @@ +/* + * Copyright 2013-2016 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; + +import com.google.android.gms.common.api.GoogleApiClient; +import com.google.android.gms.common.api.GoogleApiClient.Builder; +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.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +/** + * Client interface for Wearable Channel API. Allows apps on a wearable device to send and receive + * data from other wearable nodes. + *

+ * Channels are bidirectional. Each side, both the initiator and the receiver may both read and + * write to the channel by using {@link Channel#getOutputStream(GoogleApiClient)} and {@link Channel#getInputStream(GoogleApiClient)}. + * Once a channel is established, the API for the initiator and receiver are identical. + *

+ * Channels are only available when the wearable nodes are connected. When the remote node + * disconnects, all existing channels will be closed. Any listeners (added through {@link #addListener(GoogleApiClient, ChannelListener)} + * and any installed {@link WearableListenerService}) will be notified of the channel closing. + */ +public interface ChannelApi { + /** + * Channel action for use in listener filters. + * + * @see WearableListenerService + */ + String ACTION_CHANNEL_EVENT = "com.google.android.gms.wearable.CHANNEL_EVENT"; + + /** + * Registers a listener to be notified of channel events. Calls to this method should be + * balanced with calls to {@link #removeListener(GoogleApiClient, ChannelListener)} to avoid + * leaking resources. + *

+ * Listener events will be called on the main thread, or the handler specified on {@code client} + * when it was built (using {@link Builder#setHandler(Handler)}). + *

+ * Callers wishing to be notified of events in the background should use {@link WearableListenerService}. + * + * @param client a connected client + * @param listener a listener which will be notified of changes to any channel + */ + PendingResult addListener(GoogleApiClient client, ChannelListener listener); + + /** + * Opens a channel to exchange data with a remote node. + *

+ * Channel which are no longer needed should be closed using {@link Channel#close(GoogleApiClient)}. + *

+ * This call involves a network round trip, so may be long running. {@code client} must remain + * connected during that time, or the request will be cancelled (like any other Play Services + * API calls). + * + * @param client a connected client + * @param nodeId the node ID of a wearable node, as returned from {@link NodeApi#getConnectedNodes(GoogleApiClient)} + * @param path an app-specific identifier for the channel + */ + PendingResult openChannel(GoogleApiClient client, String nodeId, String path); + + /** + * Removes a listener which was previously added through {@link #addListener(GoogleApiClient, ChannelListener)}. + * + * @param client a connected client + * @param listener a listener which was added using {@link #addListener(GoogleApiClient, ChannelListener)} + */ + PendingResult removeListener(GoogleApiClient client, ChannelListener listener); + + /** + * A listener which will be notified on changes to channels. + */ + interface ChannelListener { + /** + * Value passed to {@link #onChannelClosed(Channel, int, int)}, {@link #onInputClosed(Channel, int, int)} + * and {@link #onOutputClosed(Channel, int, int)} when the closing is due to a remote node + * being disconnected. + */ + int CLOSE_REASON_DISCONNECTED = 1; + + /** + * Value passed to {@link #onChannelClosed(Channel, int, int)}, {@link #onInputClosed(Channel, int, int)} + * and {@link #onOutputClosed(Channel, int, int)} when the stream is closed due to the + * local node calling {@link Channel#close(GoogleApiClient)} or {@link Channel#close(GoogleApiClient, int)}. + */ + int CLOSE_REASON_LOCAL_CLOSE = 3; + + /** + * Value passed to {@link #onInputClosed(Channel, int, int)} or {@link #onOutputClosed(Channel, int, int)} + * (but not {@link #onChannelClosed(Channel, int, int)}), when the stream was closed under + * normal conditions, e.g the whole file was read, or the OutputStream on the remote node + * was closed normally. + */ + int CLOSE_REASON_NORMAL = 0; + + /** + * Value passed to {@link #onChannelClosed(Channel, int, int)}, {@link #onInputClosed(Channel, int, int)} + * and {@link #onOutputClosed(Channel, int, int)} when the stream is closed due to the + * remote node calling {@link Channel#close(GoogleApiClient)} or {@link Channel#close(GoogleApiClient, int)}. + */ + int CLOSE_REASON_REMOTE_CLOSE = 2; + + /** + * Called when a channel is closed. This can happen through an explicit call to {@link Channel#close(GoogleApiClient)} + * or {@link #close(GoogleApiClient, int)} on either side of the connection, or due to + * disconnecting from the remote node. + * + * @param closeReason the reason for the channel closing. One of {@link #CLOSE_REASON_DISCONNECTED}, + * {@link #CLOSE_REASON_REMOTE_CLOSE}, or {@link #CLOSE_REASON_LOCAL_CLOSE}. + * @param appSpecificErrorCode the error code specified on {@link Channel#close(GoogleApiClient, int)}, + * or 0 if closeReason is {@link #CLOSE_REASON_DISCONNECTED}. + */ + void onChannelClosed(Channel channel, int closeReason, int appSpecificErrorCode); + + /** + * Called when a new channel is opened by a remote node. + */ + void onChannelOpened(Channel channel); + + /** + * Called when the input side of a channel is closed. + * + * @param closeReason the reason for the channel closing. One of {@link #CLOSE_REASON_DISCONNECTED}, + * {@link #CLOSE_REASON_REMOTE_CLOSE}, {@link #CLOSE_REASON_LOCAL_CLOSE} + * or {@link #CLOSE_REASON_NORMAL}. + * @param appSpecificErrorCode the error code specified on {@link Channel#close(GoogleApiClient, int)}, + * or 0 if closeReason is {@link #CLOSE_REASON_DISCONNECTED} or + * {@link #CLOSE_REASON_NORMAL}. + */ + void onInputClosed(Channel channel, @CloseReason int closeReason, int appSpecificErrorCode); + + /** + * Called when the output side of a channel is closed. + * + * @param closeReason the reason for the channel closing. One of {@link #CLOSE_REASON_DISCONNECTED}, + * {@link #CLOSE_REASON_REMOTE_CLOSE}, {@link #CLOSE_REASON_LOCAL_CLOSE} + * or {@link #CLOSE_REASON_NORMAL}. + * @param appSpecificErrorCode the error code specified on {@link Channel#close(GoogleApiClient, int)}, + * or 0 if closeReason is {@link #CLOSE_REASON_DISCONNECTED} or + * {@link #CLOSE_REASON_NORMAL}. + */ + void onOutputClosed(Channel channel, @CloseReason int closeReason, int appSpecificErrorCode); + } + + /** + * An annotation for values passed to {@link ChannelListener#onChannelClosed(Channel, int, int)}, + * and other methods on the {@link ChannelListener} interface. Annotated method parameters will + * always take one of the following values: + *

    + *
  • {@link ChannelListener#CLOSE_REASON_DISCONNECTED}
  • + *
  • {@link ChannelListener#CLOSE_REASON_NORMAL}
  • + *
  • {@link ChannelListener#CLOSE_REASON_LOCAL_CLOSE}
  • + *
  • {@link ChannelListener#CLOSE_REASON_REMOTE_CLOSE}
  • + *
+ */ + @Retention(RetentionPolicy.SOURCE) + @interface CloseReason { + } + + /** + * Result of {@link #openChannel(GoogleApiClient, String, String)}. + */ + interface OpenChannelResult extends Result { + /** + * Returns the newly created channel, or {@code null}, if the connection couldn't be opened. + */ + Channel getChannel(); + } +} diff --git a/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/AmsEntityUpdate.java b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/AmsEntityUpdate.java new file mode 100644 index 00000000..1e156633 --- /dev/null +++ b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/AmsEntityUpdate.java @@ -0,0 +1,20 @@ +/* + * Copyright 2013-2016 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.internal; + +public interface AmsEntityUpdate { +} diff --git a/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/AmsEntityUpdateParcelable.java b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/AmsEntityUpdateParcelable.java index e43a38bf..8533e19b 100644 --- a/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/AmsEntityUpdateParcelable.java +++ b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/AmsEntityUpdateParcelable.java @@ -18,6 +18,6 @@ package com.google.android.gms.wearable.internal; import org.microg.safeparcel.AutoSafeParcelable; -public class AmsEntityUpdateParcelable extends AutoSafeParcelable { +public class AmsEntityUpdateParcelable extends AutoSafeParcelable implements AmsEntityUpdate { public static final Creator CREATOR = new AutoCreator(AmsEntityUpdateParcelable.class); } diff --git a/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/AncsNotification.java b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/AncsNotification.java new file mode 100644 index 00000000..f96a605f --- /dev/null +++ b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/AncsNotification.java @@ -0,0 +1,20 @@ +/* + * Copyright 2013-2016 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.internal; + +public interface AncsNotification { +} diff --git a/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/AncsNotificationParcelable.java b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/AncsNotificationParcelable.java index 05f7c7f7..81cdb875 100644 --- a/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/AncsNotificationParcelable.java +++ b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/AncsNotificationParcelable.java @@ -18,6 +18,6 @@ package com.google.android.gms.wearable.internal; import org.microg.safeparcel.AutoSafeParcelable; -public class AncsNotificationParcelable extends AutoSafeParcelable { +public class AncsNotificationParcelable extends AutoSafeParcelable implements AncsNotification { public static final Creator CREATOR = new AutoCreator(AncsNotificationParcelable.class); } diff --git a/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/ChannelEventParcelable.java b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/ChannelEventParcelable.java index b562032b..93c0be72 100644 --- a/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/ChannelEventParcelable.java +++ b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/ChannelEventParcelable.java @@ -16,8 +16,23 @@ package com.google.android.gms.wearable.internal; +import com.google.android.gms.wearable.Channel; + import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; public class ChannelEventParcelable extends AutoSafeParcelable { + + @SafeParceled(1) + private int versionCode; + @SafeParceled(2) + public Channel channel; // TODO: ChannelImpl needed! + @SafeParceled(3) + public int eventType; + @SafeParceled(4) + public int closeReason; + @SafeParceled(5) + public int appSpecificErrorCode; + public static final Creator CREATOR = new AutoCreator(ChannelEventParcelable.class); } diff --git a/settings.gradle b/settings.gradle index b13b2661..99da0fb4 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,6 +1,6 @@ +include ':play-services-basement' include ':play-services-api' include ':play-services-cast-api' -include ':play-services-common-api' include ':play-services-iid-api' include ':play-services-location-api' include ':play-services-wearable-api' From 289a346315ec6be8ffead7adfc26ebf7dda91435 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Sun, 14 Aug 2016 10:26:04 +0200 Subject: [PATCH 169/293] Update version code --- play-services-basement/src/main/AndroidManifest.xml | 2 +- .../src/main/java/org/microg/gms/common/Constants.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/play-services-basement/src/main/AndroidManifest.xml b/play-services-basement/src/main/AndroidManifest.xml index 03679b28..3ea99c6e 100644 --- a/play-services-basement/src/main/AndroidManifest.xml +++ b/play-services-basement/src/main/AndroidManifest.xml @@ -16,7 +16,7 @@ --> + package="org.microg.gms.basement"> diff --git a/play-services-basement/src/main/java/org/microg/gms/common/Constants.java b/play-services-basement/src/main/java/org/microg/gms/common/Constants.java index 049a2c62..bf74f5b9 100644 --- a/play-services-basement/src/main/java/org/microg/gms/common/Constants.java +++ b/play-services-basement/src/main/java/org/microg/gms/common/Constants.java @@ -21,7 +21,7 @@ public class Constants { * This is the highest version that was looked at during development. * Does not necessarily mean anything. */ - public static final int MAX_REFERENCE_VERSION = 9256000; + public static final int MAX_REFERENCE_VERSION = 9452000; public static final String GMS_PACKAGE_NAME = "com.google.android.gms"; public static final String GSF_PACKAGE_NAME = "com.google.android.gsf"; public static final String GMS_PACKAGE_SIGNATURE_SHA1 = "38918a453d07199354f8b19af05ec6562ced5788"; From b9cb95d39bdb4bbac6dd0d2b0405e4d5a23717c2 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Sun, 14 Aug 2016 10:26:24 +0200 Subject: [PATCH 170/293] Move certain wearable classes --- .../{internal => }/AmsEntityUpdate.java | 2 +- .../{internal => }/AncsNotification.java | 2 +- .../android/gms/wearable/CapabilityInfo.java | 34 +++++ .../android/gms/wearable/MessageApi.java | 88 +++++++++++++ .../internal/AmsEntityUpdateParcelable.java | 2 + .../internal/AncsNotificationParcelable.java | 2 + .../internal/CapabilityInfoParcelable.java | 71 ++++++++++- .../internal/ChannelEventParcelable.java | 6 +- .../gms/wearable/internal/ChannelImpl.java | 120 ++++++++++++++++++ .../internal/SendMessageResponse.java | 17 ++- 10 files changed, 334 insertions(+), 10 deletions(-) rename play-services-wearable-api/src/main/java/com/google/android/gms/wearable/{internal => }/AmsEntityUpdate.java (92%) rename play-services-wearable-api/src/main/java/com/google/android/gms/wearable/{internal => }/AncsNotification.java (92%) create mode 100644 play-services-wearable-api/src/main/java/com/google/android/gms/wearable/CapabilityInfo.java create mode 100644 play-services-wearable-api/src/main/java/com/google/android/gms/wearable/MessageApi.java create mode 100644 play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/ChannelImpl.java diff --git a/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/AmsEntityUpdate.java b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/AmsEntityUpdate.java similarity index 92% rename from play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/AmsEntityUpdate.java rename to play-services-wearable-api/src/main/java/com/google/android/gms/wearable/AmsEntityUpdate.java index 1e156633..92f3c07c 100644 --- a/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/AmsEntityUpdate.java +++ b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/AmsEntityUpdate.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.google.android.gms.wearable.internal; +package com.google.android.gms.wearable; public interface AmsEntityUpdate { } diff --git a/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/AncsNotification.java b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/AncsNotification.java similarity index 92% rename from play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/AncsNotification.java rename to play-services-wearable-api/src/main/java/com/google/android/gms/wearable/AncsNotification.java index f96a605f..20685d5f 100644 --- a/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/AncsNotification.java +++ b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/AncsNotification.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.google.android.gms.wearable.internal; +package com.google.android.gms.wearable; public interface AncsNotification { } diff --git a/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/CapabilityInfo.java b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/CapabilityInfo.java new file mode 100644 index 00000000..cc9fd8d9 --- /dev/null +++ b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/CapabilityInfo.java @@ -0,0 +1,34 @@ +/* + * Copyright 2013-2016 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; + +import java.util.Set; + +/** + * Information about a Capability on the network and where it is available. + */ +public interface CapabilityInfo { + /** + * Returns the name of the capability. + */ + String getName(); + + /** + * Returns the set of nodes for the capability. Disconnected nodes may or may not be included in the set. + */ + Set getNodes(); +} diff --git a/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/MessageApi.java b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/MessageApi.java new file mode 100644 index 00000000..e2016f73 --- /dev/null +++ b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/MessageApi.java @@ -0,0 +1,88 @@ +/* + * Copyright 2013-2015 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; + +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; + +@PublicApi +public interface MessageApi { + + /** + * A value returned by {@link SendMessageResult#getRequestId()} when + * {@link #sendMessage(GoogleApiClient, String, String, byte[])} fails. + */ + int UNKNOWN_REQUEST_ID = -1; + + /** + * Registers a listener to be notified of received messages. Calls to this method should + * balanced with {@link #removeListener(GoogleApiClient, MessageListener)} to avoid leaking + * resources. + *

+ * Callers wishing to be notified of events in the background should use {@link WearableListenerService}. + */ + PendingResult addListener(GoogleApiClient client, MessageListener listener); + + /** + * Removes a message listener which was previously added through + * {@link #addListener(GoogleApiClient, MessageListener)}. + */ + PendingResult removeListener(GoogleApiClient client, MessageListener listener); + + /** + * Sends {@code byte[]} data to the specified node. + * + * @param nodeId identifier for a particular node on the Android Wear network. Valid targets + * may be obtained through {@link NodeApi#getConnectedNodes(GoogleApiClient)} + * or from the host in {@link DataItem#getUri()}. + * @param path identifier used to specify a particular endpoint at the receiving node + * @param data small array of information to pass to the target node. Generally not larger + * than 100k + */ + PendingResult sendMessage(GoogleApiClient client, String nodeId, + String path, byte[] data); + + /** + * Used with {@link MessageApi#addListener(GoogleApiClient, MessageListener)} to receive + * message events. + *

+ * Callers wishing to be notified of events in the background should use + * {@link WearableListenerService}. + */ + interface MessageListener { + /** + * Notification that a message has been received. + */ + void onMessageReceived(MessageEvent messageEvent); + } + + /** + * Contains the request id assigned to the message. On failure, the id will be + * {@link MessageApi#UNKNOWN_REQUEST_ID} and the status will be unsuccessful. + */ + interface SendMessageResult extends Result { + /** + * @return an ID used to identify the sent message. If {@link #getStatus()} is not + * successful, this value will be {@link MessageApi#UNKNOWN_REQUEST_ID}. + */ + int getRequestId(); + } +} diff --git a/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/AmsEntityUpdateParcelable.java b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/AmsEntityUpdateParcelable.java index 8533e19b..6c96ec9d 100644 --- a/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/AmsEntityUpdateParcelable.java +++ b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/AmsEntityUpdateParcelable.java @@ -16,6 +16,8 @@ package com.google.android.gms.wearable.internal; +import com.google.android.gms.wearable.AmsEntityUpdate; + import org.microg.safeparcel.AutoSafeParcelable; public class AmsEntityUpdateParcelable extends AutoSafeParcelable implements AmsEntityUpdate { diff --git a/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/AncsNotificationParcelable.java b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/AncsNotificationParcelable.java index 81cdb875..a7d3cd0d 100644 --- a/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/AncsNotificationParcelable.java +++ b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/AncsNotificationParcelable.java @@ -16,6 +16,8 @@ package com.google.android.gms.wearable.internal; +import com.google.android.gms.wearable.AncsNotification; + import org.microg.safeparcel.AutoSafeParcelable; public class AncsNotificationParcelable extends AutoSafeParcelable implements AncsNotification { diff --git a/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/CapabilityInfoParcelable.java b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/CapabilityInfoParcelable.java index cdc5d6c4..49b94e7f 100644 --- a/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/CapabilityInfoParcelable.java +++ b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/CapabilityInfoParcelable.java @@ -16,8 +16,75 @@ package com.google.android.gms.wearable.internal; -import org.microg.safeparcel.AutoSafeParcelable; +import com.google.android.gms.wearable.CapabilityInfo; +import com.google.android.gms.wearable.Node; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +public class CapabilityInfoParcelable extends AutoSafeParcelable implements CapabilityInfo { + @SafeParceled(1) + private int versionCode = 1; + + @SafeParceled(2) + private String name; + + @SafeParceled(value = 3, subClass = NodeParcelable.class) + private List nodeParcelables; + + private Set nodes; + private Object lock = new Object(); + + private CapabilityInfoParcelable() { + } + + public CapabilityInfoParcelable(String name, List nodeParcelables) { + this.name = name; + this.nodeParcelables = nodeParcelables; + } + + @Override + public String getName() { + return name; + } + + @Override + public synchronized Set getNodes() { + if (nodes == null) { + nodes = new HashSet(nodeParcelables); + } + return nodes; + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + if (other == null || getClass() != other.getClass()) return false; + + CapabilityInfoParcelable that = (CapabilityInfoParcelable) other; + + if (versionCode != that.versionCode) return false; + if (name != null ? !name.equals(that.name) : that.name != null) return false; + return nodeParcelables != null ? nodeParcelables.equals(that.nodeParcelables) : that.nodeParcelables == null; + } + + @Override + public int hashCode() { + int result = versionCode; + result = 31 * result + (name != null ? name.hashCode() : 0); + result = 31 * result + (nodeParcelables != null ? nodeParcelables.hashCode() : 0); + return result; + } + + @Override + public String toString() { + return "CapabilityInfo{" + name + ", " + nodeParcelables + "}"; + } -public class CapabilityInfoParcelable extends AutoSafeParcelable { public static final Creator CREATOR = new AutoCreator(CapabilityInfoParcelable.class); + } diff --git a/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/ChannelEventParcelable.java b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/ChannelEventParcelable.java index 93c0be72..7336c2be 100644 --- a/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/ChannelEventParcelable.java +++ b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/ChannelEventParcelable.java @@ -16,17 +16,15 @@ package com.google.android.gms.wearable.internal; -import com.google.android.gms.wearable.Channel; - import org.microg.safeparcel.AutoSafeParcelable; import org.microg.safeparcel.SafeParceled; public class ChannelEventParcelable extends AutoSafeParcelable { @SafeParceled(1) - private int versionCode; + private int versionCode = 1; @SafeParceled(2) - public Channel channel; // TODO: ChannelImpl needed! + public ChannelImpl channel; @SafeParceled(3) public int eventType; @SafeParceled(4) diff --git a/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/ChannelImpl.java b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/ChannelImpl.java new file mode 100644 index 00000000..18ab6ebc --- /dev/null +++ b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/ChannelImpl.java @@ -0,0 +1,120 @@ +/* + * Copyright 2013-2016 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.internal; + +import android.net.Uri; +import android.util.Log; + +import com.google.android.gms.common.api.GoogleApiClient; +import com.google.android.gms.common.api.PendingResult; +import com.google.android.gms.common.api.Status; +import com.google.android.gms.wearable.Channel; +import com.google.android.gms.wearable.ChannelApi; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class ChannelImpl extends AutoSafeParcelable implements Channel { + private static final String TAG = "GmsWearChannelImpl"; + + @SafeParceled(1) + private int versionCode = 1; + @SafeParceled(2) + private String token; + @SafeParceled(3) + private String nodeId; + @SafeParceled(4) + private String path; + + private ChannelImpl() { + } + + public ChannelImpl(String token, String nodeId, String path) { + this.token = token; + this.nodeId = nodeId; + this.path = path; + } + + @Override + public PendingResult addListener(GoogleApiClient client, ChannelApi.ChannelListener listener) { + Log.d(TAG, "unimplemented Method: addListener"); + return null; + } + + @Override + public PendingResult close(GoogleApiClient client, int errorCode) { + Log.d(TAG, "unimplemented Method: close"); + return null; + } + + @Override + public PendingResult close(GoogleApiClient client) { + Log.d(TAG, "unimplemented Method: close"); + return null; + } + + @Override + public PendingResult getInputStream(GoogleApiClient client) { + Log.d(TAG, "unimplemented Method: getInputStream"); + return null; + } + + @Override + public PendingResult getOutputStream(GoogleApiClient client) { + Log.d(TAG, "unimplemented Method: getOutputStream"); + return null; + } + + public String getNodeId() { + return nodeId; + } + + @Override + public String getPath() { + return path; + } + + public String getToken() { + return token; + } + + @Override + public PendingResult receiveFile(GoogleApiClient client, Uri uri, boolean append) { + Log.d(TAG, "unimplemented Method: receiveFile"); + return null; + } + + @Override + public PendingResult removeListener(GoogleApiClient client, ChannelApi.ChannelListener listener) { + Log.d(TAG, "unimplemented Method: removeListener"); + return null; + } + + @Override + public PendingResult sendFile(GoogleApiClient client, Uri uri) { + Log.d(TAG, "unimplemented Method: sendFile"); + return null; + } + + @Override + public PendingResult sendFile(GoogleApiClient client, Uri uri, long startOffset, long length) { + Log.d(TAG, "unimplemented Method: sendFile"); + return null; + } + + public static final Creator CREATOR = new AutoCreator(ChannelImpl.class); +} diff --git a/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/SendMessageResponse.java b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/SendMessageResponse.java index d3a0b7fb..3d8364a6 100644 --- a/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/SendMessageResponse.java +++ b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/SendMessageResponse.java @@ -16,10 +16,13 @@ package com.google.android.gms.wearable.internal; +import com.google.android.gms.common.api.Status; +import com.google.android.gms.wearable.MessageApi; + import org.microg.safeparcel.AutoSafeParcelable; import org.microg.safeparcel.SafeParceled; -public class SendMessageResponse extends AutoSafeParcelable { +public class SendMessageResponse extends AutoSafeParcelable implements MessageApi.SendMessageResult { @SafeParceled(1) private int versionCode = 1; @@ -28,7 +31,17 @@ public class SendMessageResponse extends AutoSafeParcelable { public int statusCode; @SafeParceled(3) - public int resultId = -1; + public int requestId = -1; + + @Override + public int getRequestId() { + return requestId; + } + + @Override + public Status getStatus() { + return new Status(statusCode); + } public static final Creator CREATOR = new AutoCreator(SendMessageResponse.class); } From 29d8b8fbb5a3c906652fa045630fbcf4d21229e6 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Sun, 14 Aug 2016 10:29:03 +0200 Subject: [PATCH 171/293] Update lib for API changes, add support for wearable listening and sending messages --- build.gradle | 3 + extern/GmsApi | 2 +- play-services-base/build.gradle | 3 +- .../src/main/AndroidManifest.xml | 2 +- .../android/gms/common/ConnectionResult.java | 310 --------- .../gms/common/GooglePlayServicesClient.java | 4 +- .../google/android/gms/common/api/Api.java | 84 --- .../gms/common/api/GoogleApiClient.java | 494 ------------- .../android/gms/common/api/PendingResult.java | 59 -- .../android/gms/common/api/Releasable.java | 25 - .../gms/common/api/ResultCallback.java | 33 - .../java/org/microg/gms/common/GmsClient.java | 33 +- .../org/microg/gms/common/GmsConnector.java | 29 +- .../org/microg/gms/common/api/ApiBuilder.java | 30 - .../microg/gms/common/api/ApiConnection.java | 27 - .../gms/common/api/GoogleApiClientImpl.java | 223 ------ play-services-basement | 1 + .../src/main/AndroidManifest.xml | 8 +- play-services-common-api | 1 - .../FusedLocationProviderApiImpl.java | 30 +- .../location/GoogleLocationManagerClient.java | 7 +- play-services-tasks/build.gradle | 2 +- play-services-wearable/build.gradle | 7 + .../android/gms/wearable/CapabilityApi.java | 193 +++++ .../gms/wearable/ChannelIOException.java | 54 ++ .../google/android/gms/wearable/DataMap.java | 114 ++- .../android/gms/wearable/MessageApi.java | 88 --- .../google/android/gms/wearable/Wearable.java | 8 + .../gms/wearable/WearableListenerService.java | 216 +++++- .../gms/wearable/BaseWearableCallbacks.java | 117 ++++ .../org/microg/gms/wearable/DataApiImpl.java | 18 +- .../microg/gms/wearable/MessageApiImpl.java | 26 +- .../org/microg/gms/wearable/NodeApiImpl.java | 8 +- .../gms/wearable/WearableApiBuilder.java | 4 +- .../gms/wearable/WearableClientImpl.java | 53 ++ .../wearable/databundle/DataBundleUtil.java | 658 ++++++++++++++++++ .../gms/wearable/databundle/DataBundle.java | 64 ++ .../wearable/databundle/DataBundleEntry.java | 80 +++ .../databundle/DataBundleTypedValue.java | 80 +++ .../wearable/databundle/DataBundleValue.java | 259 +++++++ .../src/main/protos-repo/databundle.proto | 33 + settings.gradle | 2 +- 42 files changed, 2033 insertions(+), 1459 deletions(-) delete mode 100644 play-services-base/src/main/java/com/google/android/gms/common/ConnectionResult.java delete mode 100644 play-services-base/src/main/java/com/google/android/gms/common/api/Api.java delete mode 100644 play-services-base/src/main/java/com/google/android/gms/common/api/GoogleApiClient.java delete mode 100644 play-services-base/src/main/java/com/google/android/gms/common/api/PendingResult.java delete mode 100644 play-services-base/src/main/java/com/google/android/gms/common/api/Releasable.java delete mode 100644 play-services-base/src/main/java/com/google/android/gms/common/api/ResultCallback.java delete mode 100644 play-services-base/src/main/java/org/microg/gms/common/api/ApiBuilder.java delete mode 100644 play-services-base/src/main/java/org/microg/gms/common/api/ApiConnection.java delete mode 100644 play-services-base/src/main/java/org/microg/gms/common/api/GoogleApiClientImpl.java create mode 120000 play-services-basement delete mode 120000 play-services-common-api create mode 100644 play-services-wearable/src/main/java/com/google/android/gms/wearable/CapabilityApi.java create mode 100644 play-services-wearable/src/main/java/com/google/android/gms/wearable/ChannelIOException.java delete mode 100644 play-services-wearable/src/main/java/com/google/android/gms/wearable/MessageApi.java create mode 100644 play-services-wearable/src/main/java/org/microg/gms/wearable/BaseWearableCallbacks.java create mode 100644 play-services-wearable/src/main/java/org/microg/gms/wearable/WearableClientImpl.java create mode 100644 play-services-wearable/src/main/java/org/microg/gms/wearable/databundle/DataBundleUtil.java create mode 100644 play-services-wearable/src/main/protos-java/org/microg/gms/wearable/databundle/DataBundle.java create mode 100644 play-services-wearable/src/main/protos-java/org/microg/gms/wearable/databundle/DataBundleEntry.java create mode 100644 play-services-wearable/src/main/protos-java/org/microg/gms/wearable/databundle/DataBundleTypedValue.java create mode 100644 play-services-wearable/src/main/protos-java/org/microg/gms/wearable/databundle/DataBundleValue.java create mode 100644 play-services-wearable/src/main/protos-repo/databundle.proto diff --git a/build.gradle b/build.gradle index 504fe91d..7fbd598a 100644 --- a/build.gradle +++ b/build.gradle @@ -18,4 +18,7 @@ subprojects { group = 'org.microg' + repositories { + jcenter() + } } diff --git a/extern/GmsApi b/extern/GmsApi index be6af2ee..b9cb95d3 160000 --- a/extern/GmsApi +++ b/extern/GmsApi @@ -1 +1 @@ -Subproject commit be6af2eeb76ba4bcc1700285f2ba87f217ab6ac2 +Subproject commit b9cb95d39bdb4bbac6dd0d2b0405e4d5a23717c2 diff --git a/play-services-base/build.gradle b/play-services-base/build.gradle index bfb54b6f..a2d4f921 100644 --- a/play-services-base/build.gradle +++ b/play-services-base/build.gradle @@ -48,7 +48,6 @@ android { } dependencies { - compile 'com.android.support:support-v4:23.4.0' - compile project(':play-services-common-api') + compile project(':play-services-basement') compile project(':play-services-tasks') } diff --git a/play-services-base/src/main/AndroidManifest.xml b/play-services-base/src/main/AndroidManifest.xml index 2aa07523..bb6c2140 100644 --- a/play-services-base/src/main/AndroidManifest.xml +++ b/play-services-base/src/main/AndroidManifest.xml @@ -15,7 +15,7 @@ ~ limitations under the License. --> - diff --git a/play-services-base/src/main/java/com/google/android/gms/common/ConnectionResult.java b/play-services-base/src/main/java/com/google/android/gms/common/ConnectionResult.java deleted file mode 100644 index f6f75c1a..00000000 --- a/play-services-base/src/main/java/com/google/android/gms/common/ConnectionResult.java +++ /dev/null @@ -1,310 +0,0 @@ -/* - * Copyright 2013-2015 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.common; - -import android.app.Activity; -import android.app.PendingIntent; -import android.content.Intent; -import android.content.IntentSender; -import android.text.TextUtils; - -import com.google.android.gms.common.api.GoogleApiClient; - -import java.util.Arrays; - -/** - * Contains all possible error codes for when a client fails to connect to Google Play services. - * These error codes are used by {@link GoogleApiClient.OnConnectionFailedListener}. - */ -public class ConnectionResult { - /** - * The connection was successful. - */ - public static final int SUCCESS = 0; - /** - * Google Play services is missing on this device. The calling activity should pass this error - * code to {@link GooglePlayServicesUtil#getErrorDialog(int, Activity, int)} to get a localized - * error dialog that will resolve the error when shown. - */ - public static final int SERVICE_MISSING = 1; - /** - * The installed version of Google Play services is out of date. The calling activity should - * pass this error code to {@link GooglePlayServicesUtil#getErrorDialog(int, Activity, int)} to - * get a localized error dialog that will resolve the error when shown. - */ - public static final int SERVICE_VERSION_UPDATE_REQUIRED = 2; - /** - * The installed version of Google Play services has been disabled on this device. The calling - * activity should pass this error code to - * {@link GooglePlayServicesUtil#getErrorDialog(int, Activity, int)} to get a localized error - * dialog that will resolve the error when shown. - */ - public static final int SERVICE_DISABLED = 3; - /** - * The client attempted to connect to the service but the user is not signed in. The client may - * choose to continue without using the API or it may call - * {@link #startResolutionForResult(Activity, int)} to prompt the user to sign in. After the - * sign in activity returns with {@link Activity#RESULT_OK} further attempts to connect should - * succeed. - */ - public static final int SIGN_IN_REQUIRED = 4; - /** - * The client attempted to connect to the service with an invalid account name specified. - */ - public static final int INVALID_ACCOUNT = 5; - /** - * Completing the connection requires some form of resolution. A resolution will be available - * to be started with {@link #startResolutionForResult(Activity, int)}. If the result returned - * is {@link Activity#RESULT_OK}, then further attempts to connect should either complete or - * continue on to the next issue that needs to be resolved. - */ - public static final int RESOLUTION_REQUIRED = 6; - /** - * A network error occurred. Retrying should resolve the problem. - */ - public static final int NETWORK_ERROR = 7; - /** - * An internal error occurred. Retrying should resolve the problem. - */ - public static final int INTERNAL_ERROR = 8; - /** - * The version of the Google Play services installed on this device is not authentic. - */ - public static final int SERVICE_INVALID = 9; - /** - * The application is misconfigured. This error is not recoverable and will be treated as - * fatal. The developer should look at the logs after this to determine more actionable - * information. - */ - public static final int DEVELOPER_ERROR = 10; - /** - * The application is not licensed to the user. This error is not recoverable and will be - * treated as fatal. - */ - public static final int LICENSE_CHECK_FAILED = 11; - /** - * The client canceled the connection by calling {@link GoogleApiClient#disconnect()}. - * Only returned by {@link GoogleApiClient#blockingConnect()}. - */ - public static final int CANCELED = 13; - /** - * The timeout was exceeded while waiting for the connection to complete. Only returned by - * {@link GoogleApiClient#blockingConnect()}. - */ - public static final int TIMEOUT = 14; - /** - * An interrupt occurred while waiting for the connection complete. Only returned by - * {@link GoogleApiClient#blockingConnect()}. - */ - public static final int INTERRUPTED = 15; - /** - * One of the API components you attempted to connect to is not available. The API will not - * work on this device, and updating Google Play services will not likely solve the problem. - * Using the API on the device should be avoided. - */ - public static final int API_UNAVAILABLE = 16; - - /** - * The Drive API requires external storage (such as an SD card), but no external storage is - * mounted. This error is recoverable if the user installs external storage (if none is - * present) and ensures that it is mounted (which may involve disabling USB storage mode, - * formatting the storage, or other initialization as required by the device). - *

- * This error should never be returned on a device with emulated external storage. On devices - * with emulated external storage, the emulated "external storage" is always present regardless - * of whether the device also has removable storage. - */ - @Deprecated - public static final int DRIVE_EXTERNAL_STORAGE_REQUIRED = 1500; - - private final int statusCode; - private final PendingIntent pendingIntent; - private final String message; - - /** - * Creates a connection result. - * - * @param statusCode The status code. - */ - public ConnectionResult(int statusCode) { - this(statusCode, null); - } - - /** - * Creates a connection result. - * - * @param statusCode The status code. - * @param pendingIntent A pending intent that will resolve the issue when started, or null. - */ - public ConnectionResult(int statusCode, PendingIntent pendingIntent) { - this(statusCode, pendingIntent, getStatusString(statusCode)); - } - - /** - * Creates a connection result. - * - * @param statusCode The status code. - * @param pendingIntent A pending intent that will resolve the issue when started, or null. - * @param message An additional error message for the connection result, or null. - */ - public ConnectionResult(int statusCode, PendingIntent pendingIntent, String message) { - this.statusCode = statusCode; - this.pendingIntent = pendingIntent; - this.message = message; - } - - static String getStatusString(int statusCode) { - switch (statusCode) { - case -1: - return "UNKNOWN"; - case 0: - return "SUCCESS"; - case 1: - return "SERVICE_MISSING"; - case 2: - return "SERVICE_VERSION_UPDATE_REQUIRED"; - case 3: - return "SERVICE_DISABLED"; - case 4: - return "SIGN_IN_REQUIRED"; - case 5: - return "INVALID_ACCOUNT"; - case 6: - return "RESOLUTION_REQUIRED"; - case 7: - return "NETWORK_ERROR"; - case 8: - return "INTERNAL_ERROR"; - case 9: - return "SERVICE_INVALID"; - case 10: - return "DEVELOPER_ERROR"; - case 11: - return "LICENSE_CHECK_FAILED"; - case 13: - return "CANCELED"; - case 14: - return "TIMEOUT"; - case 15: - return "INTERRUPTED"; - case 16: - return "API_UNAVAILABLE"; - case 17: - return "SIGN_IN_FAILED"; - case 18: - return "SERVICE_UPDATING"; - case 19: - return "SERVICE_MISSING_PERMISSION"; - case 20: - return "RESTRICTED_PROFILE"; - case 21: - return "API_VERSION_UPDATE_REQUIRED"; - case 42: - return "UPDATE_ANDROID_WEAR"; - case 99: - return "UNFINISHED"; - case 1500: - return "DRIVE_EXTERNAL_STORAGE_REQUIRED"; - default: - return "UNKNOWN_ERROR_CODE(" + statusCode + ")"; - } - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } else if (!(o instanceof ConnectionResult)) { - return false; - } else { - ConnectionResult r = (ConnectionResult)o; - return statusCode == r.statusCode && pendingIntent == null ? r.pendingIntent == null : pendingIntent.equals(r.pendingIntent) && TextUtils.equals(message, r.message); - } - } - - /** - * Indicates the type of error that interrupted connection. - * - * @return the error code, or {@link #SUCCESS} if no error occurred. - */ - public int getErrorCode() { - return statusCode; - } - - /** - * Returns an error message for connection result. - * - * @return the message - */ - public String getErrorMessage() { - return message; - } - - /** - * A pending intent to resolve the connection failure. This intent can be started with - * {@link Activity#startIntentSenderForResult(IntentSender, int, Intent, int, int, int)} to - * present UI to solve the issue. - * - * @return The pending intent to resolve the connection failure. - */ - public PendingIntent getResolution() { - return pendingIntent; - } - - @Override - public int hashCode() { - return Arrays.hashCode(new Object[]{statusCode, pendingIntent, message}); - } - - /** - * Returns {@code true} if calling {@link #startResolutionForResult(Activity, int)} will start - * any intents requiring user interaction. - * - * @return {@code true} if there is a resolution that can be started. - */ - public boolean hasResolution() { - return statusCode != 0 && pendingIntent != null; - } - - /** - * Returns {@code true} if the connection was successful. - * - * @return {@code true} if the connection was successful, {@code false} if there was an error. - */ - public boolean isSuccess() { - return statusCode == 0; - } - - /** - * Resolves an error by starting any intents requiring user interaction. See - * {@link #SIGN_IN_REQUIRED}, and {@link #RESOLUTION_REQUIRED}. - * - * @param activity An Activity context to use to resolve the issue. The activity's - * {@link Activity#onActivityResult} method will be invoked after the user - * is done. If the resultCode is {@link Activity#RESULT_OK}, the application - * should try to connect again. - * @param requestCode The request code to pass to {@link Activity#onActivityResult}. - * @throws IntentSender.SendIntentException If the resolution intent has been canceled or is no - * longer able to execute the request. - */ - public void startResolutionForResult(Activity activity, int requestCode) throws - IntentSender.SendIntentException { - if (hasResolution()) { - activity.startIntentSenderForResult(pendingIntent.getIntentSender(), requestCode, null, 0, 0, 0); - } - } -} diff --git a/play-services-base/src/main/java/com/google/android/gms/common/GooglePlayServicesClient.java b/play-services-base/src/main/java/com/google/android/gms/common/GooglePlayServicesClient.java index b9cece5c..a330a257 100644 --- a/play-services-base/src/main/java/com/google/android/gms/common/GooglePlayServicesClient.java +++ b/play-services-base/src/main/java/com/google/android/gms/common/GooglePlayServicesClient.java @@ -41,13 +41,13 @@ public interface GooglePlayServicesClient { void unregisterConnectionFailedListener(OnConnectionFailedListener listener); @Deprecated - public interface OnConnectionFailedListener { + interface OnConnectionFailedListener { void onConnectionFailed(ConnectionResult result); } @Deprecated - public interface ConnectionCallbacks { + interface ConnectionCallbacks { void onConnected(Bundle connectionHint); diff --git a/play-services-base/src/main/java/com/google/android/gms/common/api/Api.java b/play-services-base/src/main/java/com/google/android/gms/common/api/Api.java deleted file mode 100644 index 1b0f03f2..00000000 --- a/play-services-base/src/main/java/com/google/android/gms/common/api/Api.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright 2013-2015 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.common.api; - -import org.microg.gms.common.PublicApi; -import org.microg.gms.common.api.ApiBuilder; - -/** - * Describes a section of the Google Play Services API that should be made available. Instances of - * this should be passed into {@link GoogleApiClient.Builder#addApi(Api)} to enable the appropriate - * parts of Google Play Services. - *

- * Google APIs are partitioned into sections which allow your application to configure only the - * services it requires. Each Google API provides an API object which can be passed to - * {@link GoogleApiClient.Builder#addApi(Api)} in order to configure and enable that functionality - * in your {@link GoogleApiClient} instance. - *

- * See {@link GoogleApiClient.Builder} for usage examples. - */ -@PublicApi -public final class Api { - - private final ApiBuilder builder; - - @PublicApi(exclude = true) - public Api(ApiBuilder builder) { - this.builder = builder; - } - - @PublicApi(exclude = true) - public ApiBuilder getBuilder() { - return builder; - } - - /** - * Base interface for API options. These are used to configure specific parameters for - * individual API surfaces. The default implementation has no parameters. - */ - @PublicApi - public interface ApiOptions { - /** - * Base interface for {@link ApiOptions} in {@link Api}s that have options. - */ - @PublicApi - interface HasOptions extends ApiOptions { - } - - /** - * Base interface for {@link ApiOptions} that are not required, don't exist. - */ - @PublicApi - interface NotRequiredOptions extends ApiOptions { - } - - /** - * {@link ApiOptions} implementation for {@link Api}s that do not take any options. - */ - @PublicApi - final class NoOptions implements NotRequiredOptions { - } - - /** - * Base interface for {@link ApiOptions} that are optional. - */ - @PublicApi - interface Optional extends HasOptions, NotRequiredOptions { - } - } - -} diff --git a/play-services-base/src/main/java/com/google/android/gms/common/api/GoogleApiClient.java b/play-services-base/src/main/java/com/google/android/gms/common/api/GoogleApiClient.java deleted file mode 100644 index 7140ca96..00000000 --- a/play-services-base/src/main/java/com/google/android/gms/common/api/GoogleApiClient.java +++ /dev/null @@ -1,494 +0,0 @@ -/* - * Copyright 2013-2015 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.common.api; - -import android.app.Activity; -import android.content.Context; -import android.os.Bundle; -import android.os.Handler; -import android.os.Looper; -import android.support.v4.app.FragmentActivity; -import android.view.View; - -import com.google.android.gms.common.ConnectionResult; - -import org.microg.gms.auth.AuthConstants; -import org.microg.gms.common.PublicApi; -import org.microg.gms.common.api.GoogleApiClientImpl; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.TimeUnit; - -/** - * The main entry point for Google Play services integration. - *

- * GoogleApiClient is used with a variety of static methods. Some of these methods require that - * GoogleApiClient be connected, some will queue up calls before GoogleApiClient is connected; - * check the specific API documentation to determine whether you need to be connected. - *

- * Before any operation is executed, the GoogleApiClient must be connected using the - * {@link #connect()} method. The client is not considered connected until the - * {@link ConnectionCallbacks#onConnected(Bundle)} callback has been called. - *

- * When your app is done using this client, call {@link #disconnect()}, even if the async result - * from {@link #connect()} has not yet been delivered. - *

- * You should instantiate a client object in your Activity's {@link Activity#onCreate(Bundle)} - * method and then call {@link #connect()} in {@link Activity#onStart()} and {@link #disconnect()} - * in {@link Activity#onStop()}, regardless of the state. - */ -@PublicApi -public interface GoogleApiClient { - /** - * Connects the client to Google Play services. Blocks until the connection either succeeds or - * fails. This is not allowed on the UI thread. - * - * @return the result of the connection - */ - public ConnectionResult blockingConnect(); - - /** - * Connects the client to Google Play services. Blocks until the connection is set or failed or - * has timed out. This is not allowed on the UI thread. - * - * @param timeout the maximum time to wait - * @param unit the time unit of the {@code timeout} argument - * @return the result of the connection - */ - public ConnectionResult blockingConnect(long timeout, TimeUnit unit); - - /** - * Clears the account selected by the user and reconnects the client asking the user to pick an - * account again if {@link Builder#useDefaultAccount()} was set. - * - * @return the pending result is fired once the default account has been cleared, but before - * the client is reconnected - for that {@link ConnectionCallbacks} can be used. - */ - public PendingResult clearDefaultAccountAndReconnect(); - - /** - * Connects the client to Google Play services. This method returns immediately, and connects - * to the service in the background. If the connection is successful, - * {@link ConnectionCallbacks#onConnected(Bundle)} is called and enqueued items are executed. - * On a failure, {@link OnConnectionFailedListener#onConnectionFailed(ConnectionResult)} is - * called. - */ - public void connect(); - - /** - * Closes the connection to Google Play services. No calls can be made using this client after - * calling this method. Any method calls that haven't executed yet will be canceled. That is - * {@link ResultCallback#onResult(Result)} won't be called, if connection to the service hasn't - * been established yet all calls already made will be canceled. - * - * @see #connect() - */ - public void disconnect(); - - /** - * Checks if the client is currently connected to the service, so that requests to other - * methods will succeed. Applications should guard client actions caused by the user with a - * call to this method. - * - * @return {@code true} if the client is connected to the service. - */ - public boolean isConnected(); - - /** - * Checks if the client is attempting to connect to the service. - * - * @return {@code true} if the client is attempting to connect to the service. - */ - public boolean isConnecting(); - - /** - * Returns {@code true} if the specified listener is currently registered to receive connection - * events. - * - * @param listener The listener to check for. - * @return {@code true} if the specified listener is currently registered to receive connection - * events. - * @see #registerConnectionCallbacks(ConnectionCallbacks) - * @see #unregisterConnectionCallbacks(ConnectionCallbacks) - */ - public boolean isConnectionCallbacksRegistered(ConnectionCallbacks listener); - - /** - * Returns {@code true} if the specified listener is currently registered to receive connection - * failed events. - * - * @param listener The listener to check for. - * @return {@code true} if the specified listener is currently registered to receive connection - * failed events. - * @see #registerConnectionFailedListener(OnConnectionFailedListener) - * @see #unregisterConnectionFailedListener(OnConnectionFailedListener) - */ - public boolean isConnectionFailedListenerRegistered(OnConnectionFailedListener listener); - - /** - * Closes the current connection to Google Play services and creates a new connection. - *

- * This method closes the current connection then returns immediately and reconnects to the - * service in the background. - *

- * After calling this method, your application will receive - * {@link ConnectionCallbacks#onConnected(Bundle)} if the connection is successful, or - * {@link OnConnectionFailedListener#onConnectionFailed(ConnectionResult)} if the connection - * failed. - * - * @see #connect() - * @see #disconnect() - */ - public void reconnect(); - - /** - * Registers a listener to receive connection events from this {@link GoogleApiClient}. If the - * service is already connected, the listener's {@link ConnectionCallbacks#onConnected(Bundle)} - * method will be called immediately. Applications should balance calls to this method with - * calls to {@link #unregisterConnectionCallbacks(ConnectionCallbacks)} to avoid leaking - * resources. - *

- * If the specified listener is already registered to receive connection events, this method - * will not add a duplicate entry for the same listener, but will still call the listener's - * {@link ConnectionCallbacks#onConnected(Bundle)} method if currently connected. - *

- * Note that the order of messages received here may not be stable, so clients should not rely - * on the order that multiple listeners receive events in. - * - * @param listener the listener where the results of the asynchronous {@link #connect()} call - * are delivered. - */ - public void registerConnectionCallbacks(ConnectionCallbacks listener); - - /** - * Registers a listener to receive connection failed events from this {@link GoogleApiClient}. - * Unlike {@link #registerConnectionCallbacks(ConnectionCallbacks)}, if the service is not - * already connected, the listener's - * {@link OnConnectionFailedListener#onConnectionFailed(ConnectionResult)} method will not be - * called immediately. Applications should balance calls to this method with calls to - * {@link #unregisterConnectionFailedListener(OnConnectionFailedListener)} to avoid leaking - * resources. - *

- * If the specified listener is already registered to receive connection failed events, this - * method will not add a duplicate entry for the same listener. - *

- * Note that the order of messages received here may not be stable, so clients should not rely - * on the order that multiple listeners receive events in. - * - * @param listener the listener where the results of the asynchronous {@link #connect()} call - * are delivered. - */ - public void registerConnectionFailedListener(OnConnectionFailedListener listener); - - /** - * Disconnects the client and stops automatic lifecycle management. Use this before creating a - * new client (which might be necessary when switching accounts, changing the set of used APIs - * etc.). - *

- * This method must be called from the main thread. - * - * @param lifecycleActivity the activity managing the client's lifecycle. - * @throws IllegalStateException if called from outside of the main thread. - * @see Builder#enableAutoManage(FragmentActivity, int, OnConnectionFailedListener) - */ - public void stopAutoManager(FragmentActivity lifecycleActivity) throws IllegalStateException; - - /** - * Removes a connection listener from this {@link GoogleApiClient}. Note that removing a - * listener does not generate any callbacks. - *

- * If the specified listener is not currently registered to receive connection events, this - * method will have no effect. - * - * @param listener the listener to unregister. - */ - public void unregisterConnectionCallbacks(ConnectionCallbacks listener); - - /** - * Removes a connection failed listener from the {@link GoogleApiClient}. Note that removing a - * listener does not generate any callbacks. - *

- * If the specified listener is not currently registered to receive connection failed events, - * this method will have no effect. - * - * @param listener the listener to unregister. - */ - public void unregisterConnectionFailedListener(OnConnectionFailedListener listener); - - /** - * Builder to configure a {@link GoogleApiClient}. - */ - @PublicApi - public class Builder { - private final Context context; - private final Map apis = new HashMap(); - private final Set connectionCallbacks = new HashSet(); - private final Set connectionFailedListeners = new HashSet(); - private final Set scopes = new HashSet(); - private String accountName; - private int clientId = -1; - private FragmentActivity fragmentActivity; - private Looper looper; - private int gravityForPopups; - private OnConnectionFailedListener unresolvedConnectionFailedListener; - private View viewForPopups; - - /** - * Builder to help construct the {@link GoogleApiClient} object. - * - * @param context The context to use for the connection. - */ - public Builder(Context context) { - this.context = context; - this.looper = context.getMainLooper(); - } - - /** - * Builder to help construct the {@link GoogleApiClient} object. - * - * @param context The context to use for the connection. - * @param connectedListener The listener where the results of the asynchronous - * {@link #connect()} call are delivered. - * @param connectionFailedListener The listener which will be notified if the connection - * attempt fails. - */ - public Builder(Context context, ConnectionCallbacks connectedListener, - OnConnectionFailedListener connectionFailedListener) { - this(context); - addConnectionCallbacks(connectedListener); - addOnConnectionFailedListener(connectionFailedListener); - } - - /** - * Specify which Apis are requested by your app. See {@link Api} for more information. - * - * @param api The Api requested by your app. - * @param options Any additional parameters required for the specific AP - * @see Api - */ - public Builder addApi(Api api, O options) { - apis.put(api, options); - return this; - } - - /** - * Specify which Apis are requested by your app. See {@link Api} for more information. - * - * @param api The Api requested by your app. - * @see Api - */ - public Builder addApi(Api api) { - apis.put(api, null); - return this; - } - - /** - * Registers a listener to receive connection events from this {@link GoogleApiClient}. - * Applications should balance calls to this method with calls to - * {@link #unregisterConnectionCallbacks(ConnectionCallbacks)} to avoid - * leaking resources. - *

- * If the specified listener is already registered to receive connection events, this - * method will not add a duplicate entry for the same listener. - *

- * Note that the order of messages received here may not be stable, so clients should not - * rely on the order that multiple listeners receive events in. - * - * @param listener the listener where the results of the asynchronous {@link #connect()} - * call are delivered. - */ - public Builder addConnectionCallbacks(ConnectionCallbacks listener) { - connectionCallbacks.add(listener); - return this; - } - - /** - * Adds a listener to register to receive connection failed events from this - * {@link GoogleApiClient}. Applications should balance calls to this method with calls to - * {@link #unregisterConnectionFailedListener(OnConnectionFailedListener)} to avoid - * leaking resources. - *

- * If the specified listener is already registered to receive connection failed events, - * this method will not add a duplicate entry for the same listener. - *

- * Note that the order of messages received here may not be stable, so clients should not - * rely on the order that multiple listeners receive events in. - * - * @param listener the listener where the results of the asynchronous {@link #connect()} - * call are delivered. - */ - public Builder addOnConnectionFailedListener(OnConnectionFailedListener listener) { - connectionFailedListeners.add(listener); - return this; - } - - /** - * Specify the OAuth 2.0 scopes requested by your app. See - * {@link com.google.android.gms.common.Scopes} for more information. - * - * @param scope The OAuth 2.0 scopes requested by your app. - * @see com.google.android.gms.common.Scopes - */ - public Builder addScope(Scope scope) { - scopes.add(scope.getScopeUri()); - return this; - } - - /** - * Builds a new {@link GoogleApiClient} object for communicating with the Google APIs. - * - * @return The {@link GoogleApiClient} object. - */ - public GoogleApiClient build() { - return new GoogleApiClientImpl(context, looper, getAccountInfo(), apis, - connectionCallbacks, connectionFailedListeners, clientId); - } - - private AccountInfo getAccountInfo() { - return null; - } - - public Builder enableAutoManage(FragmentActivity fragmentActivity, int cliendId, - OnConnectionFailedListener unresolvedConnectionFailedListener) - throws NullPointerException, IllegalArgumentException, IllegalStateException { - this.fragmentActivity = fragmentActivity; - this.clientId = cliendId; - this.unresolvedConnectionFailedListener = unresolvedConnectionFailedListener; - return this; - } - - /** - * Specify an account name on the device that should be used. If this is never called, the - * client will use the current default account for Google Play services for this - * application. - * - * @param accountName The account name on the device that should be used by - * {@link GoogleApiClient}. - */ - public Builder setAccountName(String accountName) { - this.accountName = accountName; - return this; - } - - /** - * Specifies the part of the screen at which games service popups (for example, - * "welcome back" or "achievement unlocked" popups) will be displayed using gravity. - * - * @param gravityForPopups The gravity which controls the placement of games service popups. - */ - public Builder setGravityForPopups(int gravityForPopups) { - this.gravityForPopups = gravityForPopups; - return this; - } - - /** - * Sets a {@link Handler} to indicate which thread to use when invoking callbacks. Will not - * be used directly to handle callbacks. If this is not called then the application's main - * thread will be used. - */ - public Builder setHandler(Handler handler) { - this.looper = handler.getLooper(); - return this; - } - - /** - * Sets the {@link View} to use as a content view for popups. - * - * @param viewForPopups The view to use as a content view for popups. View cannot be null. - */ - public Builder setViewForPopups(View viewForPopups) { - this.viewForPopups = viewForPopups; - return this; - } - - /** - * Specify that the default account should be used when connecting to services. - */ - public Builder useDefaultAccount() { - this.accountName = AuthConstants.DEFAULT_ACCOUNT; - return this; - } - } - - /** - * Provides callbacks that are called when the client is connected or disconnected from the - * service. Most applications implement {@link #onConnected(Bundle)} to start making requests. - */ - @PublicApi - public interface ConnectionCallbacks { - /** - * A suspension cause informing that the service has been killed. - */ - int CAUSE_SERVICE_DISCONNECTED = 1; - /** - * A suspension cause informing you that a peer device connection was lost. - */ - int CAUSE_NETWORK_LOST = 2; - - /** - * After calling {@link #connect()}, this method will be invoked asynchronously when the - * connect request has successfully completed. After this callback, the application can - * make requests on other methods provided by the client and expect that no user - * intervention is required to call methods that use account and scopes provided to the - * client constructor. - *

- * Note that the contents of the {@code connectionHint} Bundle are defined by the specific - * services. Please see the documentation of the specific implementation of - * {@link GoogleApiClient} you are using for more information. - * - * @param connectionHint Bundle of data provided to clients by Google Play services. May - * be null if no content is provided by the service. - */ - void onConnected(Bundle connectionHint); - - /** - * Called when the client is temporarily in a disconnected state. This can happen if there - * is a problem with the remote service (e.g. a crash or resource problem causes it to be - * killed by the system). When called, all requests have been canceled and no outstanding - * listeners will be executed. GoogleApiClient will automatically attempt to restore the - * connection. Applications should disable UI components that require the service, and wait - * for a call to {@link #onConnected(Bundle)} to re-enable them. - * - * @param cause The reason for the disconnection. Defined by constants {@code CAUSE_*}. - */ - void onConnectionSuspended(int cause); - } - - /** - * Provides callbacks for scenarios that result in a failed attempt to connect the client to - * the service. See {@link ConnectionResult} for a list of error codes and suggestions for - * resolution. - */ - @PublicApi - public interface OnConnectionFailedListener { - /** - * Called when there was an error connecting the client to the service. - * - * @param result A {@link ConnectionResult} that can be used for resolving the error, and - * deciding what sort of error occurred. To resolve the error, the resolution - * must be started from an activity with a non-negative {@code requestCode} - * passed to {@link ConnectionResult#startResolutionForResult(Activity, int)}. - * Applications should implement {@link Activity#onActivityResult} in their - * Activity to call {@link #connect()} again if the user has resolved the - * issue (resultCode is {@link Activity#RESULT_OK}). - */ - void onConnectionFailed(ConnectionResult result); - } -} diff --git a/play-services-base/src/main/java/com/google/android/gms/common/api/PendingResult.java b/play-services-base/src/main/java/com/google/android/gms/common/api/PendingResult.java deleted file mode 100644 index 28943f18..00000000 --- a/play-services-base/src/main/java/com/google/android/gms/common/api/PendingResult.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2013-2015 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.common.api; - -import java.util.concurrent.TimeUnit; - -/** - * Represents a pending result from calling an API method in Google Play services. The final result - * object from a PendingResult is of type R, which can be retrieved in one of two ways. - *

- *

    - *
  • via blocking calls to {@link #await()}, or {@link #await(long, TimeUnit)}, or
  • - *
  • via a callback by passing in an object implementing interface {@link ResultCallback} to - * {@link #setResultCallback(ResultCallback)}.
  • - *
- * After the result has been retrieved using {@link #await()} or delivered to the result callback, - * it is an error to attempt to retrieve the result again. It is the responsibility of the caller - * or callback receiver to release any resources associated with the returned result. Some result - * types may implement {@link Releasable}, in which case {@link Releasable#release()} should be - * used to free the associated resources. - *

- * TODO: Docs - */ -public interface PendingResult { - /** - * Blocks until the task is completed. This is not allowed on the UI thread. The returned - * result object can have an additional failure mode of INTERRUPTED. - */ - public R await(); - - /** - * Blocks until the task is completed or has timed out waiting for the result. This is not - * allowed on the UI thread. The returned result object can have an additional failure mode - * of either INTERRUPTED or TIMEOUT. - */ - public R await(long time, TimeUnit unit); - - public void cancel(); - - public boolean isCanceled(); - - public void setResultCallback(ResultCallback callback, long time, TimeUnit unit); - - public void setResultCallback(ResultCallback callback); -} diff --git a/play-services-base/src/main/java/com/google/android/gms/common/api/Releasable.java b/play-services-base/src/main/java/com/google/android/gms/common/api/Releasable.java deleted file mode 100644 index 6856634a..00000000 --- a/play-services-base/src/main/java/com/google/android/gms/common/api/Releasable.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2013-2015 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.common.api; - -/** - * Represents a resource, or a holder of resources, which may be released once they are no longer - * needed. - */ -public interface Releasable { - public void release(); -} diff --git a/play-services-base/src/main/java/com/google/android/gms/common/api/ResultCallback.java b/play-services-base/src/main/java/com/google/android/gms/common/api/ResultCallback.java deleted file mode 100644 index 4695dbcb..00000000 --- a/play-services-base/src/main/java/com/google/android/gms/common/api/ResultCallback.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2013-2015 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.common.api; - -/** - * An interface for receiving a {@link Result} from a {@link PendingResult} as an asynchronous - * callback. - */ -public interface ResultCallback { - /** - * Called when the {@link Result} is ready. It is the responsibility of each callback to - * release any resources associated with the result. Some result types may implement - * {@link Releasable}, in which case {@link Releasable#release()} should be used to free the - * associated resources. - * - * @param result The result from the API call. May not be null. - */ - public void onResult(R result); -} diff --git a/play-services-base/src/main/java/org/microg/gms/common/GmsClient.java b/play-services-base/src/main/java/org/microg/gms/common/GmsClient.java index 2d88a881..dfbff345 100644 --- a/play-services-base/src/main/java/org/microg/gms/common/GmsClient.java +++ b/play-services-base/src/main/java/org/microg/gms/common/GmsClient.java @@ -16,6 +16,7 @@ package org.microg.gms.common; +import android.accounts.Account; import android.content.ComponentName; import android.content.Context; import android.content.ServiceConnection; @@ -27,6 +28,7 @@ import android.util.Log; import com.google.android.gms.common.ConnectionResult; import com.google.android.gms.common.api.GoogleApiClient; +import com.google.android.gms.common.internal.GetServiceRequest; import com.google.android.gms.common.internal.IGmsCallbacks; import com.google.android.gms.common.internal.IGmsServiceBroker; @@ -41,18 +43,31 @@ public abstract class GmsClient implements ApiConnection { protected ConnectionState state = ConnectionState.NOT_CONNECTED; private ServiceConnection serviceConnection; private I serviceInterface; + private String actionString; + + protected int serviceId = -1; + protected Account account = null; + protected Bundle extras = new Bundle(); public GmsClient(Context context, GoogleApiClient.ConnectionCallbacks callbacks, - GoogleApiClient.OnConnectionFailedListener connectionFailedListener) { + GoogleApiClient.OnConnectionFailedListener connectionFailedListener, String actionString) { this.context = context; this.callbacks = callbacks; this.connectionFailedListener = connectionFailedListener; + this.actionString = actionString; } - protected abstract String getActionString(); - - protected abstract void onConnectedToBroker(IGmsServiceBroker broker, GmsCallbacks callbacks) - throws RemoteException; + protected void onConnectedToBroker(IGmsServiceBroker broker, GmsCallbacks callbacks) throws RemoteException { + if (serviceId == -1) { + throw new IllegalStateException("Service ID not set in constructor and onConnectedToBroker not implemented"); + } + GetServiceRequest request = new GetServiceRequest(serviceId); + request.extras = new Bundle(); + request.packageName = context.getPackageName(); + request.account = account; + request.extras = extras; + broker.getService(callbacks, request); + } protected abstract I interfaceFromBinder(IBinder binder); @@ -64,12 +79,10 @@ public abstract class GmsClient implements ApiConnection { } state = ConnectionState.CONNECTING; if (serviceConnection != null) { - MultiConnectionKeeper.getInstance(context) - .unbind(getActionString(), serviceConnection); + MultiConnectionKeeper.getInstance(context).unbind(actionString, serviceConnection); } serviceConnection = new GmsServiceConnection(); - if (!MultiConnectionKeeper.getInstance(context).bind(getActionString(), - serviceConnection)) { + if (!MultiConnectionKeeper.getInstance(context).bind(actionString, serviceConnection)) { state = ConnectionState.ERROR; handleConnectionFailed(); } @@ -90,7 +103,7 @@ public abstract class GmsClient implements ApiConnection { } serviceInterface = null; if (serviceConnection != null) { - MultiConnectionKeeper.getInstance(context).unbind(getActionString(), serviceConnection); + MultiConnectionKeeper.getInstance(context).unbind(actionString, serviceConnection); serviceConnection = null; } state = ConnectionState.NOT_CONNECTED; diff --git a/play-services-base/src/main/java/org/microg/gms/common/GmsConnector.java b/play-services-base/src/main/java/org/microg/gms/common/GmsConnector.java index efb66edd..8d6dbdad 100644 --- a/play-services-base/src/main/java/org/microg/gms/common/GmsConnector.java +++ b/play-services-base/src/main/java/org/microg/gms/common/GmsConnector.java @@ -23,25 +23,29 @@ import android.util.Log; import com.google.android.gms.common.api.Api; 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 org.microg.gms.common.api.AbstractPendingResult; import org.microg.gms.common.api.ApiConnection; import org.microg.gms.common.api.GoogleApiClientImpl; -public class GmsConnector { +public class GmsConnector { private static final String TAG = "GmsConnector"; private final GoogleApiClientImpl apiClient; - private final Api api; + private final Api api; private final Callback callback; - public GmsConnector(GoogleApiClient apiClient, Api api, Callback callback) { + public GmsConnector(GoogleApiClient apiClient, Api api, Callback callback) { this.apiClient = (GoogleApiClientImpl) apiClient; this.api = api; this.callback = callback; } + public static PendingResult call(GoogleApiClient client, Api api, GmsConnector.Callback callback) { + return new GmsConnector(client, api, callback).connect(); + } public AbstractPendingResult connect() { Log.d(TAG, "connect()"); @@ -54,8 +58,12 @@ public class GmsConnector { - public R onClientAvailable(C client) throws RemoteException; + public interface Callback { + void onClientAvailable(C client, ResultProvider resultProvider) throws RemoteException; + + interface ResultProvider { + void onResultAvailable(R result); + } } private class Handler extends android.os.Handler { @@ -66,10 +74,15 @@ public class GmsConnector result = (AbstractPendingResult) msg.obj; + final AbstractPendingResult result = (AbstractPendingResult) msg.obj; try { - C connection = (C)apiClient.getApiConnection(api); - result.deliverResult(callback.onClientAvailable(connection)); + C connection = (C) apiClient.getApiConnection(api); + callback.onClientAvailable(connection, new GmsConnector.Callback.ResultProvider() { + @Override + public void onResultAvailable(R realResult) { + result.deliverResult(realResult); + } + }); } catch (RemoteException ignored) { } diff --git a/play-services-base/src/main/java/org/microg/gms/common/api/ApiBuilder.java b/play-services-base/src/main/java/org/microg/gms/common/api/ApiBuilder.java deleted file mode 100644 index b20899df..00000000 --- a/play-services-base/src/main/java/org/microg/gms/common/api/ApiBuilder.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2013-2015 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 org.microg.gms.common.api; - -import android.content.Context; -import android.os.Looper; - -import com.google.android.gms.common.api.AccountInfo; -import com.google.android.gms.common.api.Api; -import com.google.android.gms.common.api.GoogleApiClient; - -public interface ApiBuilder { - ApiConnection build(Context context, Looper looper, O options, AccountInfo accountInfo, - GoogleApiClient.ConnectionCallbacks callbacks, - GoogleApiClient.OnConnectionFailedListener connectionFailedListener); -} diff --git a/play-services-base/src/main/java/org/microg/gms/common/api/ApiConnection.java b/play-services-base/src/main/java/org/microg/gms/common/api/ApiConnection.java deleted file mode 100644 index 019ea5d8..00000000 --- a/play-services-base/src/main/java/org/microg/gms/common/api/ApiConnection.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2013-2015 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 org.microg.gms.common.api; - -public interface ApiConnection { - void connect(); - - void disconnect(); - - boolean isConnected(); - - boolean isConnecting(); -} diff --git a/play-services-base/src/main/java/org/microg/gms/common/api/GoogleApiClientImpl.java b/play-services-base/src/main/java/org/microg/gms/common/api/GoogleApiClientImpl.java deleted file mode 100644 index b47982ca..00000000 --- a/play-services-base/src/main/java/org/microg/gms/common/api/GoogleApiClientImpl.java +++ /dev/null @@ -1,223 +0,0 @@ -/* - * Copyright 2013-2015 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 org.microg.gms.common.api; - -import android.content.Context; -import android.os.Bundle; -import android.os.Looper; -import android.os.Message; -import android.support.v4.app.FragmentActivity; -import android.util.Log; - -import com.google.android.gms.common.ConnectionResult; -import com.google.android.gms.common.api.AccountInfo; -import com.google.android.gms.common.api.Api; -import com.google.android.gms.common.api.GoogleApiClient; -import com.google.android.gms.common.api.PendingResult; -import com.google.android.gms.common.api.Status; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.TimeUnit; - -public class GoogleApiClientImpl implements GoogleApiClient { - private static final String TAG = "GmsApiClientImpl"; - - private final Context context; - private final Looper looper; - private final AccountInfo accountInfo; - private final Map apis = new HashMap(); - private final Map apiConnections = new HashMap(); - private final Handler handler; - private final Set connectionCallbacks = new HashSet(); - private final Set connectionFailedListeners = new HashSet(); - private final int clientId; - private final ConnectionCallbacks baseConnectionCallbacks = new ConnectionCallbacks() { - @Override - public void onConnected(Bundle connectionHint) { - Log.d(TAG, "ConnectionCallbacks : onConnected()"); - for (ConnectionCallbacks callback : connectionCallbacks) { - callback.onConnected(connectionHint); - } - } - - @Override - public void onConnectionSuspended(int cause) { - Log.d(TAG, "ConnectionCallbacks : onConnectionSuspended()"); - for (ConnectionCallbacks callback : connectionCallbacks) { - callback.onConnectionSuspended(cause); - } - } - }; - private final OnConnectionFailedListener baseConnectionFailedListener = new - OnConnectionFailedListener() { - @Override - public void onConnectionFailed(ConnectionResult result) { - Log.d(TAG, "OnConnectionFailedListener : onConnectionFailed()"); - for (OnConnectionFailedListener listener : connectionFailedListeners) { - listener.onConnectionFailed(result); - } - } - }; - - public GoogleApiClientImpl(Context context, Looper looper, AccountInfo accountInfo, - Map apis, - Set connectionCallbacks, - Set connectionFailedListeners, int clientId) { - this.context = context; - this.looper = looper; - this.handler = new Handler(looper); - this.accountInfo = accountInfo; - this.apis.putAll(apis); - this.connectionCallbacks.addAll(connectionCallbacks); - this.connectionFailedListeners.addAll(connectionFailedListeners); - this.clientId = clientId; - - for (Api api : apis.keySet()) { - apiConnections.put(api, api.getBuilder().build(context, looper, - apis.get(api), accountInfo, baseConnectionCallbacks, - baseConnectionFailedListener)); - } - } - - public Looper getLooper() { - return looper; - } - - public ApiConnection getApiConnection(Api api) { - return apiConnections.get(api); - } - - @Override - public ConnectionResult blockingConnect() { - return null; - } - - @Override - public ConnectionResult blockingConnect(long timeout, TimeUnit unit) { - return null; - } - - @Override - public PendingResult clearDefaultAccountAndReconnect() { - return null; - } - - @Override - public synchronized void connect() { - Log.d(TAG, "connect()"); - if (isConnected() || isConnecting()) { - Log.d(TAG, "Already connected/connecting, nothing to do"); - return; - } - for (ApiConnection connection : apiConnections.values()) { - if (!connection.isConnected()) { - connection.connect(); - } - } - } - - @Override - public synchronized void disconnect() { - Log.d(TAG, "disconnect()"); - for (ApiConnection connection : apiConnections.values()) { - if (connection.isConnected()) { - connection.disconnect(); - } - } - } - - @Override - public synchronized boolean isConnected() { - for (ApiConnection connection : apiConnections.values()) { - if (!connection.isConnected()) return false; - } - return true; - } - - @Override - public synchronized boolean isConnecting() { - for (ApiConnection connection : apiConnections.values()) { - if (connection.isConnecting()) return true; - } - return false; - } - - @Override - public boolean isConnectionCallbacksRegistered(ConnectionCallbacks listener) { - return connectionCallbacks.contains(listener); - } - - @Override - public boolean isConnectionFailedListenerRegistered( - OnConnectionFailedListener listener) { - return connectionFailedListeners.contains(listener); - } - - @Override - public synchronized void reconnect() { - Log.d(TAG, "reconnect()"); - disconnect(); - connect(); - } - - @Override - public void registerConnectionCallbacks(ConnectionCallbacks listener) { - connectionCallbacks.add(listener); - } - - @Override - public void registerConnectionFailedListener(OnConnectionFailedListener listener) { - connectionFailedListeners.add(listener); - } - - @Override - public void stopAutoManager(FragmentActivity lifecycleActivity) throws IllegalStateException { - - } - - @Override - public void unregisterConnectionCallbacks(ConnectionCallbacks listener) { - connectionCallbacks.remove(listener); - } - - @Override - public void unregisterConnectionFailedListener(OnConnectionFailedListener listener) { - connectionFailedListeners.remove(listener); - } - - private class Handler extends android.os.Handler { - private Handler(Looper looper) { - super(looper); - } - - @Override - public void handleMessage(Message msg) { - if (msg.what == 0 && msg.obj instanceof Runnable) { - ((Runnable) msg.obj).run(); - } else { - super.handleMessage(msg); - } - } - - public void sendRunnable(Runnable runnable) { - sendMessage(obtainMessage(1, runnable)); - } - } -} diff --git a/play-services-basement b/play-services-basement new file mode 120000 index 00000000..aac14e46 --- /dev/null +++ b/play-services-basement @@ -0,0 +1 @@ +extern/GmsApi/play-services-basement \ No newline at end of file diff --git a/play-services-cast/src/main/AndroidManifest.xml b/play-services-cast/src/main/AndroidManifest.xml index 2031102a..0921b431 100644 --- a/play-services-cast/src/main/AndroidManifest.xml +++ b/play-services-cast/src/main/AndroidManifest.xml @@ -15,10 +15,10 @@ ~ limitations under the License. --> - + - + - + diff --git a/play-services-common-api b/play-services-common-api deleted file mode 120000 index c85558d0..00000000 --- a/play-services-common-api +++ /dev/null @@ -1 +0,0 @@ -extern/GmsApi/play-services-common-api/ \ No newline at end of file diff --git a/play-services-location/src/main/java/org/microg/gms/location/FusedLocationProviderApiImpl.java b/play-services-location/src/main/java/org/microg/gms/location/FusedLocationProviderApiImpl.java index a9d6bf12..5ce97ba8 100644 --- a/play-services-location/src/main/java/org/microg/gms/location/FusedLocationProviderApiImpl.java +++ b/play-services-location/src/main/java/org/microg/gms/location/FusedLocationProviderApiImpl.java @@ -22,7 +22,6 @@ import android.os.Looper; import android.os.RemoteException; import android.util.Log; -import com.google.android.gms.common.api.Api; import com.google.android.gms.common.api.GoogleApiClient; import com.google.android.gms.common.api.PendingResult; import com.google.android.gms.common.api.Result; @@ -33,6 +32,7 @@ import com.google.android.gms.location.LocationRequest; import com.google.android.gms.location.LocationServices; import org.microg.gms.common.GmsConnector; +import org.microg.gms.common.api.ApiConnection; public class FusedLocationProviderApiImpl implements FusedLocationProviderApi { private static final String TAG = "GmsFusedApiImpl"; @@ -50,7 +50,7 @@ public class FusedLocationProviderApiImpl implements FusedLocationProviderApi { @Override public PendingResult requestLocationUpdates(GoogleApiClient client, - final LocationRequest request, final LocationListener listener) { + final LocationRequest request, final LocationListener listener) { return callVoid(client, new Runnable() { @Override public void run(LocationClientImpl client) throws RemoteException { @@ -61,8 +61,8 @@ public class FusedLocationProviderApiImpl implements FusedLocationProviderApi { @Override public PendingResult requestLocationUpdates(GoogleApiClient client, - final LocationRequest request, final LocationListener listener, - final Looper looper) { + final LocationRequest request, final LocationListener listener, + final Looper looper) { return callVoid(client, new Runnable() { @Override public void run(LocationClientImpl client) throws RemoteException { @@ -73,7 +73,7 @@ public class FusedLocationProviderApiImpl implements FusedLocationProviderApi { @Override public PendingResult requestLocationUpdates(GoogleApiClient client, - final LocationRequest request, final PendingIntent callbackIntent) { + final LocationRequest request, final PendingIntent callbackIntent) { return callVoid(client, new Runnable() { @Override public void run(LocationClientImpl client) throws RemoteException { @@ -84,7 +84,7 @@ public class FusedLocationProviderApiImpl implements FusedLocationProviderApi { @Override public PendingResult removeLocationUpdates(GoogleApiClient client, - final LocationListener listener) { + final LocationListener listener) { return callVoid(client, new Runnable() { @Override public void run(LocationClientImpl client) throws RemoteException { @@ -95,7 +95,7 @@ public class FusedLocationProviderApiImpl implements FusedLocationProviderApi { @Override public PendingResult removeLocationUpdates(GoogleApiClient client, - final PendingIntent callbackIntent) { + final PendingIntent callbackIntent) { return callVoid(client, new Runnable() { @Override public void run(LocationClientImpl client) throws RemoteException { @@ -125,15 +125,13 @@ public class FusedLocationProviderApiImpl implements FusedLocationProviderApi { } private PendingResult callVoid(GoogleApiClient client, final Runnable runnable) { - return new GmsConnector(client, LocationServices.API, - new GmsConnector.Callback() { - @Override - public Result onClientAvailable(LocationClientImpl client) throws - RemoteException { - runnable.run(client); - return Status.SUCCESS; - } - }).connect(); + return GmsConnector.call(client, LocationServices.API, new GmsConnector.Callback() { + @Override + public void onClientAvailable(LocationClientImpl client, ResultProvider resultProvider) throws RemoteException { + runnable.run(client); + resultProvider.onResultAvailable(Status.SUCCESS); + } + }); } private interface Runnable { diff --git a/play-services-location/src/main/java/org/microg/gms/location/GoogleLocationManagerClient.java b/play-services-location/src/main/java/org/microg/gms/location/GoogleLocationManagerClient.java index 55713f02..2a15d015 100644 --- a/play-services-location/src/main/java/org/microg/gms/location/GoogleLocationManagerClient.java +++ b/play-services-location/src/main/java/org/microg/gms/location/GoogleLocationManagerClient.java @@ -32,12 +32,7 @@ import org.microg.gms.common.GmsService; public abstract class GoogleLocationManagerClient extends GmsClient { public GoogleLocationManagerClient(Context context, GoogleApiClient.ConnectionCallbacks callbacks, GoogleApiClient.OnConnectionFailedListener connectionFailedListener) { - super(context, callbacks, connectionFailedListener); - } - - @Override - protected String getActionString() { - return GmsService.LOCATION_MANAGER.ACTION; + super(context, callbacks, connectionFailedListener, GmsService.LOCATION_MANAGER.ACTION); } @Override diff --git a/play-services-tasks/build.gradle b/play-services-tasks/build.gradle index cc390af7..d80b1829 100644 --- a/play-services-tasks/build.gradle +++ b/play-services-tasks/build.gradle @@ -48,5 +48,5 @@ android { } dependencies { - compile project(':play-services-common-api') + compile project(':play-services-basement') } diff --git a/play-services-wearable/build.gradle b/play-services-wearable/build.gradle index 94ece58f..d3a8d0ec 100644 --- a/play-services-wearable/build.gradle +++ b/play-services-wearable/build.gradle @@ -42,6 +42,12 @@ android { versionName getMyVersionName() } + sourceSets { + main { + java.srcDirs += 'src/main/protos-java' + } + } + compileOptions { sourceCompatibility JavaVersion.VERSION_1_6 } @@ -50,4 +56,5 @@ android { dependencies { compile project(':play-services-base') compile project(':play-services-wearable-api') + compile 'com.squareup.wire:wire-runtime:1.6.1' } diff --git a/play-services-wearable/src/main/java/com/google/android/gms/wearable/CapabilityApi.java b/play-services-wearable/src/main/java/com/google/android/gms/wearable/CapabilityApi.java new file mode 100644 index 00000000..6f43bc7a --- /dev/null +++ b/play-services-wearable/src/main/java/com/google/android/gms/wearable/CapabilityApi.java @@ -0,0 +1,193 @@ +/* + * Copyright 2013-2016 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; + +import android.net.Uri; + +import com.google.android.gms.common.api.GoogleApiClient; +import com.google.android.gms.common.api.GoogleApiClient.Builder; +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; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.util.Map; + +/** + * Exposes an API to learn about capabilities provided by nodes on the Wear network. + *

+ * Capabilities are local to an application. + */ +@PublicApi +public interface CapabilityApi { + /** + * Capability changed action for use in manifest-based listener filters. + *

+ * Capability events do not support filtering by host, but can be filtered by path. + * + * @see WearableListenerService + */ + String ACTION_CAPABILITY_CHANGED = "com.google.android.gms.wearable.CAPABILITY_CHANGED"; + + /** + * Filter type for {@link #getCapability(GoogleApiClient, String, int)}, {@link #getAllCapabilities(GoogleApiClient, int)}: + * If this filter is set then the full set of nodes that declare the given capability will be + * included in the capability's CapabilityInfo. + */ + int FILTER_ALL = 0; + + /** + * Filter type for {@link #addListener(GoogleApiClient, CapabilityListener, Uri, int)}, if this + * filter is set, the given URI will be taken as a literal path, and the operation will apply + * to the matching capability only. + */ + int FILTER_LITERAL = 0; + + /** + * Filter type for {@link #addListener(GoogleApiClient, CapabilityListener, Uri, int)}, if this + * filter is set, the given URI will be taken as a path prefix, and the operation will apply + * to all matching capabilities. + */ + int FILTER_PREFIX = 1; + + /** + * Filter type for {@link #getCapability(GoogleApiClient, String, int)}, {@link #getAllCapabilities(GoogleApiClient, int): + * If this filter is set then only reachable nodes that declare the given capability will be + * included in the capability's CapabilityInfo. + */ + int FILTER_REACHABLE = 1; + + /** + * Registers a listener to be notified of a specific capability being added to or removed from + * the Wear network. Calls to this method should be balanced with {@link #removeCapabilityListener(GoogleApiClient, CapabilityListener, String)} + * to avoid leaking resources. + *

+ * Listener events will be called on the main thread, or the handler specified on {@code client} + * when it was built (using {@link Builder#setHandler(Handler)}). + *

+ * Callers wishing to be notified of events in the background should use {@link WearableListenerService}. + */ + PendingResult addCapabilityListener(GoogleApiClient client, CapabilityListener listener, String capability); + + /** + * Registers a listener to be notified of capabilities being added to or removed from the Wear + * network. Calls to this method should be balanced with {@link #removeListener(GoogleApiClient, CapabilityListener)} + * to avoid leaking resources. + *

+ * {@code uri} and {@code filterType} can be used to filter the capability changes sent to the + * listener. For example, if {@code uri} and {@code filterType} create a prefix filter, then + * only capabilities matching that prefix will be notified. The {@code uri} follows the rules + * of the {@code } element of {@code }. The path is ignored if a URI host + * is not specified. To match capabilities by name or name prefix, the host must be {@code *}. i.e: + *

+ *

wear://* /
+ * Listener events will be called on the main thread, or the handler specified on {@code client} + * when it was built (using {@link Builder#setHandler(Handler)}). + * + * Callers wishing to be notified of events in the background should use WearableListenerService. + */ + PendingResult addListener(GoogleApiClient client, CapabilityListener listener, Uri uri, @CapabilityFilterType int filterType); + + /** + * Announces that a capability has become available on the local node. + */ + PendingResult addLocalCapability(GoogleApiClient client, String capability); + + /** + * Returns information about all capabilities, including the nodes that declare those + * capabilities. The filter parameter controls whether all nodes are returned, {@link #FILTER_ALL}, + * or only those that are currently reachable by this node, {@link #FILTER_REACHABLE}. + *

+ * The local node will never be returned in the set of nodes. + */ + PendingResult getAllCapabilities(GoogleApiClient client, @NodeFilterType int nodeFilter); + + /** + * Returns information about a capabilities, including the nodes that declare this capability. + * The filter parameter controls whether all nodes are returned, {@link #FILTER_ALL}, or only + * those that are currently reachable by this node, {@link #FILTER_REACHABLE}. + *

+ * The local node will never be returned in the set of nodes. + */ + PendingResult getCapability(GoogleApiClient client, String capability, @NodeFilterType int nodeFilter); + + /** + * Removes a listener which was previously added through {@link #addCapabilityListener(GoogleApiClient, CapabilityListener, String)}. + * The listener is only removed from listening for the capability provided and will continue to + * receive messages for any other capabilities it was previously registered for that have not + * also been removed. + */ + PendingResult removeCapabilityListener(GoogleApiClient client, CapabilityListener listener, String capability); + + /** + * Removes a listener which was previously added through {@link #addListener(GoogleApiClient, CapabilityListener, Uri, int)}. + * The listener is only removed from listening for the capability provided and will continue to + * receive messages for any other capabilities it was previously registered for that have not + * also been removed. + */ + PendingResult removeListener(GoogleApiClient client, CapabilityListener listener); + + /** + * Announces that a capability is no longer available on the local node. Note: this will not + * remove any capabilities announced in the Manifest for an app. + */ + PendingResult removeLocalCapability(GoogleApiClient client, String capability); + + /** + * Result returned from {@link #addLocalCapability(GoogleApiClient, String)} + */ + interface AddLocalCapabilityResult extends Result { + } + + @Retention(RetentionPolicy.SOURCE) + @interface CapabilityFilterType { + } + + /** + * Listener for changes in the reachable nodes providing a capability. + */ + interface CapabilityListener { + void onCapabilityChanged(CapabilityInfo capabilityInfo); + } + + /** + * Result returned from {@link #getAllCapabilities(GoogleApiClient, int)} + */ + interface GetAllCapabilitiesResult extends Result { + Map getAllCapabilities(); + } + + /** + * Result returned from {@link #getCapability(GoogleApiClient, String, int)} + */ + interface GetCapabilityResult extends Result { + CapabilityInfo getCapability(); + } + + @Retention(RetentionPolicy.SOURCE) + @interface NodeFilterType { + } + + /** + * Result returned from {@link #removeLocalCapability(GoogleApiClient, String)} + */ + interface RemoveLocalCapabilityResult extends Result { + } +} diff --git a/play-services-wearable/src/main/java/com/google/android/gms/wearable/ChannelIOException.java b/play-services-wearable/src/main/java/com/google/android/gms/wearable/ChannelIOException.java new file mode 100644 index 00000000..46b99879 --- /dev/null +++ b/play-services-wearable/src/main/java/com/google/android/gms/wearable/ChannelIOException.java @@ -0,0 +1,54 @@ +/* + * Copyright 2013-2016 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; + +import com.google.android.gms.wearable.ChannelApi.ChannelListener; + +import java.io.IOException; + +/** + * A subclass of {@link IOException} which can be thrown from the streams returned by + * {@link Channel#getInputStream(GoogleApiClient)} and {@link Channel#getOutputStream(GoogleApiClient)}. + */ +public class ChannelIOException extends IOException { + + private int closeReason; + private int appSpecificErrorCode; + + public ChannelIOException(String message, int closeReason, int appSpecificErrorCode) { + super(message); + this.closeReason = closeReason; + this.appSpecificErrorCode = appSpecificErrorCode; + } + + /** + * Returns the app-specific error code passed to {@link Channel#close(GoogleApiClient, int)} if + * that's the reason for the stream closing, or {@code 0} otherwise. + */ + public int getAppSpecificErrorCode() { + return appSpecificErrorCode; + } + + /** + * Returns one of {@link ChannelListener#CLOSE_REASON_NORMAL}, {@link ChannelListener#CLOSE_REASON_DISCONNECTED}, + * {@link ChannelListener#CLOSE_REASON_REMOTE_CLOSE}, or {@link ChannelListener#CLOSE_REASON_LOCAL_CLOSE}, + * to indicate the reason for the stream closing. + */ + public int getCloseReason() { + return closeReason; + } +} diff --git a/play-services-wearable/src/main/java/com/google/android/gms/wearable/DataMap.java b/play-services-wearable/src/main/java/com/google/android/gms/wearable/DataMap.java index 0cbb2c63..4a24d29c 100644 --- a/play-services-wearable/src/main/java/com/google/android/gms/wearable/DataMap.java +++ b/play-services-wearable/src/main/java/com/google/android/gms/wearable/DataMap.java @@ -19,12 +19,29 @@ package com.google.android.gms.wearable; import android.os.Bundle; import org.microg.gms.common.PublicApi; +import org.microg.gms.wearable.databundle.DataBundleUtil; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.Map; import java.util.Set; +import static org.microg.gms.wearable.databundle.DataBundleUtil.ASSET_TYPE_CODE; +import static org.microg.gms.wearable.databundle.DataBundleUtil.BOOLEAN_TYPE_CODE; +import static org.microg.gms.wearable.databundle.DataBundleUtil.BYTE_ARRAY_TYPE_CODE; +import static org.microg.gms.wearable.databundle.DataBundleUtil.BYTE_TYPE_CODE; +import static org.microg.gms.wearable.databundle.DataBundleUtil.DATAMAP_TYPE_CODE; +import static org.microg.gms.wearable.databundle.DataBundleUtil.DOUBLE_TYPE_CODE; +import static org.microg.gms.wearable.databundle.DataBundleUtil.FLOAT_ARRAY_TYPE_CODE; +import static org.microg.gms.wearable.databundle.DataBundleUtil.FLOAT_TYPE_CODE; +import static org.microg.gms.wearable.databundle.DataBundleUtil.INTEGER_TYPE_CODE; +import static org.microg.gms.wearable.databundle.DataBundleUtil.LIST_TYPE_CODE; +import static org.microg.gms.wearable.databundle.DataBundleUtil.LONG_ARRAY_TYPE_CODE; +import static org.microg.gms.wearable.databundle.DataBundleUtil.LONG_TYPE_CODE; +import static org.microg.gms.wearable.databundle.DataBundleUtil.STRING_ARRAY_TYPE_CODE; +import static org.microg.gms.wearable.databundle.DataBundleUtil.STRING_TYPE_CODE; + /** * A map of data supported by {@link PutDataMapRequest} and {@link DataMapItem}s. DataMap may * convert to and from Bundles, but will drop any types not explicitly supported by DataMap in the @@ -74,6 +91,40 @@ public class DataMap { return o instanceof DataMap && data.equals(((DataMap) o).data); } + public StoredType getType(String key) { + return types.get(key); + } + + @PublicApi(exclude = true) + public enum StoredType { + Asset(ASSET_TYPE_CODE), Boolean(BOOLEAN_TYPE_CODE), Byte(BYTE_TYPE_CODE), + ByteArray(BYTE_ARRAY_TYPE_CODE), DataMap(DATAMAP_TYPE_CODE), DataMapArrayList(DataMap), + Double(DOUBLE_TYPE_CODE), Float(FLOAT_TYPE_CODE), FloatArray(FLOAT_ARRAY_TYPE_CODE), + Integer(INTEGER_TYPE_CODE), IntegerArrayList(Integer), Long(LONG_TYPE_CODE), + LongArray(LONG_ARRAY_TYPE_CODE), String(STRING_TYPE_CODE), + StringArray(STRING_ARRAY_TYPE_CODE), StringArrayList(String); + + private int typeCode; + private StoredType listType; + + StoredType(int typeCode) { + this.typeCode = typeCode; + } + + StoredType(StoredType listType) { + this.typeCode = LIST_TYPE_CODE; + this.listType = listType; + } + + public int getTypeCode() { + return typeCode; + } + + public StoredType getListType() { + return listType; + } + } + /** * @return a DataMap from a Bundle. The input Bundle is expected to contain only elements * supported by DataMap. Any elements in the Bundle not supported by DataMap will be dropped. @@ -82,7 +133,46 @@ public class DataMap { DataMap res = new DataMap(); if (bundle != null) { for (String key : bundle.keySet()) { - res.data.put(key, bundle.get(key)); + Object val = bundle.get(key); + if (val instanceof Asset) { + res.putAsset(key, (Asset) val); + } else if (val instanceof Boolean) { + res.putBoolean(key, (Boolean) val); + } else if (val instanceof Byte) { + res.putByte(key, (Byte) val); + } else if (val instanceof byte[]) { + res.putByteArray(key, (byte[]) val); + } else if (val instanceof Bundle) { + res.putDataMap(key, DataMap.fromBundle((Bundle) val)); + } else if (val instanceof Double) { + res.putDouble(key, (Double) val); + } else if (val instanceof Float) { + res.putFloat(key, (Float) val); + } else if (val instanceof float[]) { + res.putFloatArray(key, (float[]) val); + } else if (val instanceof Integer) { + res.putInt(key, (Integer) val); + } else if (val instanceof Long) { + res.putLong(key, (Long) val); + } else if (val instanceof long[]) { + res.putLongArray(key, (long[]) val); + } else if (val instanceof String) { + res.putString(key, (String) val); + } else if (val instanceof String[]) { + res.putStringArray(key, (String[]) val); + } else if (val instanceof ArrayList) { + if (((ArrayList) val).isEmpty() || ((ArrayList) val).get(0) instanceof String) { + res.putStringArrayList(key, (ArrayList) val); + } else if (((ArrayList) val).get(0) instanceof Bundle) { + ArrayList dataMaps = new ArrayList(); + for (Bundle b : ((ArrayList) val)) { + dataMaps.add(DataMap.fromBundle(b)); + } + res.putDataMapArrayList(key, dataMaps); + } else if (((ArrayList) val).get(0) instanceof Integer) { + res.putIntegerArrayList(key, (ArrayList) val); + } + } } } return res; @@ -92,7 +182,7 @@ public class DataMap { * @return a DataMap from a byte[]. */ public static DataMap fromByteArray(byte[] bytes) { - return null; // TODO + return DataBundleUtil.readDataMap(bytes, Collections.emptyList()); } /** @@ -213,6 +303,11 @@ public class DataMap { } } + public void putAsset(String key, Asset value) { + data.put(key, value); + types.put(key, StoredType.Asset); + } + public void putBoolean(String key, boolean value) { data.put(key, value); types.put(key, StoredType.Boolean); @@ -302,7 +397,7 @@ public class DataMap { for (String key : data.keySet()) { switch (types.get(key)) { case Asset: - bundle.putParcelable(key, (Asset)data.get(key)); + bundle.putParcelable(key, (Asset) data.get(key)); break; case Boolean: bundle.putBoolean(key, (Boolean) data.get(key)); @@ -317,7 +412,11 @@ public class DataMap { bundle.putBundle(key, ((DataMap) data.get(key)).toBundle()); break; case DataMapArrayList: - // TODO + ArrayList bundles = new ArrayList(); + for (DataMap dataMap : ((ArrayList) data.get(key))) { + bundles.add(dataMap.toBundle()); + } + bundle.putParcelableArrayList(key, bundles); break; case Double: bundle.putDouble(key, (Double) data.get(key)); @@ -355,15 +454,10 @@ public class DataMap { } public byte[] toByteArray() { - return null; // TODO + return DataBundleUtil.createBytes(this); } public String toString() { return "DataMap{size=" + size() + "}"; } - - private enum StoredType { - Asset, Boolean, Byte, ByteArray, DataMap, DataMapArrayList, Double, Float, FloatArray, - Integer, IntegerArrayList, Long, LongArray, String, StringArray, StringArrayList - } } diff --git a/play-services-wearable/src/main/java/com/google/android/gms/wearable/MessageApi.java b/play-services-wearable/src/main/java/com/google/android/gms/wearable/MessageApi.java deleted file mode 100644 index e2016f73..00000000 --- a/play-services-wearable/src/main/java/com/google/android/gms/wearable/MessageApi.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright 2013-2015 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; - -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; - -@PublicApi -public interface MessageApi { - - /** - * A value returned by {@link SendMessageResult#getRequestId()} when - * {@link #sendMessage(GoogleApiClient, String, String, byte[])} fails. - */ - int UNKNOWN_REQUEST_ID = -1; - - /** - * Registers a listener to be notified of received messages. Calls to this method should - * balanced with {@link #removeListener(GoogleApiClient, MessageListener)} to avoid leaking - * resources. - *

- * Callers wishing to be notified of events in the background should use {@link WearableListenerService}. - */ - PendingResult addListener(GoogleApiClient client, MessageListener listener); - - /** - * Removes a message listener which was previously added through - * {@link #addListener(GoogleApiClient, MessageListener)}. - */ - PendingResult removeListener(GoogleApiClient client, MessageListener listener); - - /** - * Sends {@code byte[]} data to the specified node. - * - * @param nodeId identifier for a particular node on the Android Wear network. Valid targets - * may be obtained through {@link NodeApi#getConnectedNodes(GoogleApiClient)} - * or from the host in {@link DataItem#getUri()}. - * @param path identifier used to specify a particular endpoint at the receiving node - * @param data small array of information to pass to the target node. Generally not larger - * than 100k - */ - PendingResult sendMessage(GoogleApiClient client, String nodeId, - String path, byte[] data); - - /** - * Used with {@link MessageApi#addListener(GoogleApiClient, MessageListener)} to receive - * message events. - *

- * Callers wishing to be notified of events in the background should use - * {@link WearableListenerService}. - */ - interface MessageListener { - /** - * Notification that a message has been received. - */ - void onMessageReceived(MessageEvent messageEvent); - } - - /** - * Contains the request id assigned to the message. On failure, the id will be - * {@link MessageApi#UNKNOWN_REQUEST_ID} and the status will be unsuccessful. - */ - interface SendMessageResult extends Result { - /** - * @return an ID used to identify the sent message. If {@link #getStatus()} is not - * successful, this value will be {@link MessageApi#UNKNOWN_REQUEST_ID}. - */ - int getRequestId(); - } -} 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 420652a3..1a505b50 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 @@ -19,6 +19,7 @@ package com.google.android.gms.wearable; 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; @@ -27,6 +28,7 @@ import org.microg.gms.wearable.WearableApiBuilder; /** * An API for the Android Wear platform. */ +@PublicApi public class Wearable { /** * Token to pass to {@link GoogleApiClient.Builder#addApi(Api)} to enable the Wearable features. @@ -38,6 +40,12 @@ public class Wearable { public static final NodeApi NodeApi = new NodeApiImpl(); public static class WearableOptions implements Api.ApiOptions.Optional { + /** + * Special option for microG to allow implementation of a FOSS first party Android Wear app + */ + @PublicApi(exclude = true) + public boolean firstPartyMode = false; + public static class Builder { public WearableOptions build() { return new WearableOptions(); diff --git a/play-services-wearable/src/main/java/com/google/android/gms/wearable/WearableListenerService.java b/play-services-wearable/src/main/java/com/google/android/gms/wearable/WearableListenerService.java index 5817c5d3..b3e6c8ff 100644 --- a/play-services-wearable/src/main/java/com/google/android/gms/wearable/WearableListenerService.java +++ b/play-services-wearable/src/main/java/com/google/android/gms/wearable/WearableListenerService.java @@ -18,41 +18,251 @@ package com.google.android.gms.wearable; import android.app.Service; import android.content.Intent; +import android.os.Binder; +import android.os.Handler; +import android.os.HandlerThread; import android.os.IBinder; +import android.os.Looper; +import android.os.RemoteException; +import android.util.Log; + +import com.google.android.gms.common.data.DataHolder; +import com.google.android.gms.wearable.internal.AmsEntityUpdateParcelable; +import com.google.android.gms.wearable.internal.AncsNotificationParcelable; +import com.google.android.gms.wearable.internal.CapabilityInfoParcelable; +import com.google.android.gms.wearable.internal.ChannelEventParcelable; +import com.google.android.gms.wearable.internal.IWearableListener; +import com.google.android.gms.wearable.internal.MessageEventParcelable; +import com.google.android.gms.wearable.internal.NodeParcelable; + +import org.microg.gms.common.PublicApi; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import static org.microg.gms.common.Constants.GMS_PACKAGE_NAME; + +@PublicApi +public abstract class WearableListenerService extends Service implements CapabilityApi.CapabilityListener, ChannelApi.ChannelListener, DataApi.DataListener, MessageApi.MessageListener, NodeApi.NodeListener { + private static final String BIND_LISTENER_INTENT_ACTION = "com.google.android.gms.wearable.BIND_LISTENER"; + private static final String TAG = "GmsWearListenerSvc"; + + private HandlerThread handlerThread; + private IWearableListener listener; + private ServiceHandler serviceHandler; + private Object lock = new Object(); + private boolean disconnected = false; -public abstract class WearableListenerService extends Service implements DataApi.DataListener, MessageApi.MessageListener, NodeApi.NodeListener { @Override public IBinder onBind(Intent intent) { + if (BIND_LISTENER_INTENT_ACTION.equals(intent.getAction())) { + return listener.asBinder(); + } return null; } + @Override + public void onCapabilityChanged(CapabilityInfo capabilityInfo) { + } + + public void onConnectedNodes(List connectedNodes) { + } + + @Override + public void onChannelClosed(Channel channel, int closeReason, int appSpecificErrorCode) { + } + + @Override + public void onChannelOpened(Channel channel) { + } + @Override public void onCreate() { super.onCreate(); + handlerThread = new HandlerThread("WearableListenerService"); + handlerThread.start(); + serviceHandler = new ServiceHandler(handlerThread.getLooper()); + listener = new Listener(); } @Override public void onDataChanged(DataEventBuffer dataEvents) { - } @Override public void onDestroy() { + synchronized (lock) { + if (serviceHandler == null) { + throw new IllegalStateException("serviceHandler not set, did you override onCreate() but forget to call super.onCreate()?"); + } + serviceHandler.getLooper().quit(); + } super.onDestroy(); } + @PublicApi(exclude = true) + public void onEntityUpdate(AmsEntityUpdate entityUpdate) { + } + + @Override + public void onInputClosed(Channel channel, @ChannelApi.CloseReason int closeReason, int appSpecificErrorCode) { + } + @Override public void onMessageReceived(MessageEvent messageEvent) { + } + @PublicApi(exclude = true) + public void onNotificationReceived(AncsNotification notification) { + } + + @Override + public void onOutputClosed(Channel channel, @ChannelApi.CloseReason int closeReason, int appSpecificErrorCode) { } @Override public void onPeerConnected(Node peer) { - } @Override public void onPeerDisconnected(Node peer) { + } + private class Listener extends IWearableListener.Stub { + private int knownGoodUid = -1; + + private boolean post(Runnable runnable) { + int callingUid = Binder.getCallingUid(); + if (callingUid != knownGoodUid) { + // TODO: Verify Gms is calling + String[] packagesForUid = getPackageManager().getPackagesForUid(callingUid); + if (packagesForUid != null) { + if (Arrays.asList(packagesForUid).contains(GMS_PACKAGE_NAME)) { + knownGoodUid = callingUid; + } else { + throw new SecurityException("Caller is not Services Core"); + } + } + } + synchronized (lock) { + if (disconnected) { + return false; + } + serviceHandler.post(runnable); + return true; + } + } + + @Override + public void onDataChanged(final DataHolder data) throws RemoteException { + post(new Runnable() { + @Override + public void run() { + WearableListenerService.this.onDataChanged(new DataEventBuffer(data)); + } + }); + } + + @Override + public void onMessageReceived(final MessageEventParcelable messageEvent) throws RemoteException { + post(new Runnable() { + @Override + public void run() { + WearableListenerService.this.onMessageReceived(messageEvent); + } + }); + } + + @Override + public void onPeerConnected(final NodeParcelable node) throws RemoteException { + post(new Runnable() { + @Override + public void run() { + WearableListenerService.this.onPeerConnected(node); + } + }); + } + + @Override + public void onPeerDisconnected(final NodeParcelable node) throws RemoteException { + post(new Runnable() { + @Override + public void run() { + WearableListenerService.this.onPeerDisconnected(node); + } + }); + } + + @Override + public void onConnectedNodes(final List nodes) throws RemoteException { + post(new Runnable() { + @Override + public void run() { + WearableListenerService.this.onConnectedNodes(new ArrayList(nodes)); + } + }); + } + + @Override + public void onConnectedCapabilityChanged(final CapabilityInfoParcelable capabilityInfo) throws RemoteException { + post(new Runnable() { + @Override + public void run() { + WearableListenerService.this.onCapabilityChanged(capabilityInfo); + } + }); + } + + @Override + public void onNotificationReceived(final AncsNotificationParcelable notification) throws RemoteException { + post(new Runnable() { + @Override + public void run() { + WearableListenerService.this.onNotificationReceived(notification); + } + }); + } + + @Override + public void onEntityUpdate(final AmsEntityUpdateParcelable update) throws RemoteException { + post(new Runnable() { + @Override + public void run() { + WearableListenerService.this.onEntityUpdate(update); + } + }); + } + + @Override + public void onChannelEvent(final ChannelEventParcelable channelEvent) throws RemoteException { + post(new Runnable() { + @Override + public void run() { + switch (channelEvent.eventType) { + case 1: + WearableListenerService.this.onChannelOpened(channelEvent.channel); + break; + case 2: + WearableListenerService.this.onChannelClosed(channelEvent.channel, channelEvent.closeReason, channelEvent.appSpecificErrorCode); + break; + case 3: + WearableListenerService.this.onInputClosed(channelEvent.channel, channelEvent.closeReason, channelEvent.appSpecificErrorCode); + break; + case 4: + WearableListenerService.this.onOutputClosed(channelEvent.channel, channelEvent.closeReason, channelEvent.appSpecificErrorCode); + break; + default: + Log.w(TAG, "Unknown ChannelEvent.eventType"); + } + } + }); + } + } + + private class ServiceHandler extends Handler { + public ServiceHandler(Looper looper) { + super(looper); + } } } diff --git a/play-services-wearable/src/main/java/org/microg/gms/wearable/BaseWearableCallbacks.java b/play-services-wearable/src/main/java/org/microg/gms/wearable/BaseWearableCallbacks.java new file mode 100644 index 00000000..5d58d576 --- /dev/null +++ b/play-services-wearable/src/main/java/org/microg/gms/wearable/BaseWearableCallbacks.java @@ -0,0 +1,117 @@ +/* + * Copyright 2013-2016 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 org.microg.gms.wearable; + +import android.os.RemoteException; +import android.util.Log; + +import com.google.android.gms.common.api.Status; +import com.google.android.gms.common.data.DataHolder; +import com.google.android.gms.wearable.internal.DeleteDataItemsResponse; +import com.google.android.gms.wearable.internal.GetCloudSyncSettingResponse; +import com.google.android.gms.wearable.internal.GetConfigResponse; +import com.google.android.gms.wearable.internal.GetConfigsResponse; +import com.google.android.gms.wearable.internal.GetConnectedNodesResponse; +import com.google.android.gms.wearable.internal.GetDataItemResponse; +import com.google.android.gms.wearable.internal.GetFdForAssetResponse; +import com.google.android.gms.wearable.internal.GetLocalNodeResponse; +import com.google.android.gms.wearable.internal.IWearableCallbacks; +import com.google.android.gms.wearable.internal.PutDataResponse; +import com.google.android.gms.wearable.internal.SendMessageResponse; +import com.google.android.gms.wearable.internal.StorageInfoResponse; + +public class BaseWearableCallbacks extends IWearableCallbacks.Stub { + private static final String TAG = "GmsWearBaseCallback"; + + @Override + public void onGetConfigResponse(GetConfigResponse response) throws RemoteException { + Log.d(TAG, "unimplemented Method: onGetConfigResponse"); + + } + + @Override + public void onPutDataResponse(PutDataResponse response) throws RemoteException { + Log.d(TAG, "unimplemented Method: onPutDataResponse"); + + } + + @Override + public void onGetDataItemResponse(GetDataItemResponse response) throws RemoteException { + Log.d(TAG, "unimplemented Method: onGetDataItemResponse"); + + } + + @Override + public void onDataItemChanged(DataHolder dataHolder) throws RemoteException { + Log.d(TAG, "unimplemented Method: onDataItemChanged"); + + } + + @Override + public void onDeleteDataItemsResponse(DeleteDataItemsResponse response) throws RemoteException { + Log.d(TAG, "unimplemented Method: onDeleteDataItemsResponse"); + + } + + @Override + public void onSendMessageResponse(SendMessageResponse response) throws RemoteException { + Log.d(TAG, "unimplemented Method: onSendMessageResponse"); + + } + + @Override + public void onGetFdForAssetResponse(GetFdForAssetResponse response) throws RemoteException { + Log.d(TAG, "unimplemented Method: onGetFdForAssetResponse"); + + } + + @Override + public void onGetLocalNodeResponse(GetLocalNodeResponse response) throws RemoteException { + Log.d(TAG, "unimplemented Method: onGetLocalNodeResponse"); + + } + + @Override + public void onGetConnectedNodesResponse(GetConnectedNodesResponse response) throws RemoteException { + Log.d(TAG, "unimplemented Method: onGetConnectedNodesResponse"); + + } + + @Override + public void onStatus(Status status) throws RemoteException { + Log.d(TAG, "unimplemented Method: onStatus"); + + } + + @Override + public void onStorageInfoResponse(StorageInfoResponse response) throws RemoteException { + Log.d(TAG, "unimplemented Method: onStorageInfoResponse"); + + } + + @Override + public void onGetConfigsResponse(GetConfigsResponse response) throws RemoteException { + Log.d(TAG, "unimplemented Method: onGetConfigsResponse"); + + } + + @Override + public void onGetCloudSyncSettingResponse(GetCloudSyncSettingResponse response) throws RemoteException { + Log.d(TAG, "unimplemented Method: onGetCloudSyncSettingResponse"); + + } +} diff --git a/play-services-wearable/src/main/java/org/microg/gms/wearable/DataApiImpl.java b/play-services-wearable/src/main/java/org/microg/gms/wearable/DataApiImpl.java index f7a09865..7da5f5f7 100644 --- a/play-services-wearable/src/main/java/org/microg/gms/wearable/DataApiImpl.java +++ b/play-services-wearable/src/main/java/org/microg/gms/wearable/DataApiImpl.java @@ -30,46 +30,46 @@ import com.google.android.gms.wearable.internal.PutDataRequest; public class DataApiImpl implements DataApi { @Override public PendingResult addListener(GoogleApiClient client, DataListener listener) { - return null; + throw new UnsupportedOperationException(); } @Override public PendingResult deleteDataItems(GoogleApiClient client, Uri uri) { - return null; + throw new UnsupportedOperationException(); } @Override public PendingResult getDataItem(GoogleApiClient client, Uri uri) { - return null; + throw new UnsupportedOperationException(); } @Override public PendingResult getDataItems(GoogleApiClient client) { - return null; + throw new UnsupportedOperationException(); } @Override public PendingResult getDataItems(GoogleApiClient client, Uri uri) { - return null; + throw new UnsupportedOperationException(); } @Override public PendingResult getFdForAsset(GoogleApiClient client, DataItemAsset asset) { - return null; + throw new UnsupportedOperationException(); } @Override public PendingResult getFdForAsset(GoogleApiClient client, Asset asset) { - return null; + throw new UnsupportedOperationException(); } @Override public PendingResult putDataItem(GoogleApiClient client, PutDataRequest request) { - return null; + throw new UnsupportedOperationException(); } @Override public PendingResult removeListener(GoogleApiClient client, DataListener listener) { - return null; + throw new UnsupportedOperationException(); } } diff --git a/play-services-wearable/src/main/java/org/microg/gms/wearable/MessageApiImpl.java b/play-services-wearable/src/main/java/org/microg/gms/wearable/MessageApiImpl.java index 3312ad45..2bb784dc 100644 --- a/play-services-wearable/src/main/java/org/microg/gms/wearable/MessageApiImpl.java +++ b/play-services-wearable/src/main/java/org/microg/gms/wearable/MessageApiImpl.java @@ -16,24 +16,42 @@ package org.microg.gms.wearable; +import android.os.RemoteException; +import android.util.Log; + import com.google.android.gms.common.api.GoogleApiClient; import com.google.android.gms.common.api.PendingResult; import com.google.android.gms.common.api.Status; import com.google.android.gms.wearable.MessageApi; +import com.google.android.gms.wearable.Wearable; +import com.google.android.gms.wearable.internal.SendMessageResponse; + +import org.microg.gms.common.GmsConnector; +import org.microg.gms.common.api.ApiConnection; public class MessageApiImpl implements MessageApi { @Override public PendingResult addListener(GoogleApiClient client, MessageListener listener) { - return null; + throw new UnsupportedOperationException(); } @Override public PendingResult removeListener(GoogleApiClient client, MessageListener listener) { - return null; + throw new UnsupportedOperationException(); } @Override - public PendingResult sendMessage(GoogleApiClient client, String nodeId, String path, byte[] data) { - return null; + public PendingResult sendMessage(GoogleApiClient client, final String nodeId, final String path, final byte[] data) { + return GmsConnector.call(client, Wearable.API, new GmsConnector.Callback() { + @Override + public void onClientAvailable(WearableClientImpl client, final ResultProvider resultProvider) throws RemoteException { + client.getServiceInterface().sendMessage(new BaseWearableCallbacks() { + @Override + public void onSendMessageResponse(SendMessageResponse response) throws RemoteException { + resultProvider.onResultAvailable(response); + } + }, nodeId, path, data); + } + }); } } diff --git a/play-services-wearable/src/main/java/org/microg/gms/wearable/NodeApiImpl.java b/play-services-wearable/src/main/java/org/microg/gms/wearable/NodeApiImpl.java index 4cf51a46..d1a86b8a 100644 --- a/play-services-wearable/src/main/java/org/microg/gms/wearable/NodeApiImpl.java +++ b/play-services-wearable/src/main/java/org/microg/gms/wearable/NodeApiImpl.java @@ -24,21 +24,21 @@ import com.google.android.gms.wearable.NodeApi; public class NodeApiImpl implements NodeApi { @Override public PendingResult addListener(GoogleApiClient client, NodeListener listener) { - return null; + throw new UnsupportedOperationException(); } @Override public PendingResult getConnectedNodes(GoogleApiClient client) { - return null; + throw new UnsupportedOperationException(); } @Override public PendingResult getLocalNode(GoogleApiClient client) { - return null; + throw new UnsupportedOperationException(); } @Override public PendingResult removeListener(GoogleApiClient client, NodeListener listener) { - return null; + throw new UnsupportedOperationException(); } } diff --git a/play-services-wearable/src/main/java/org/microg/gms/wearable/WearableApiBuilder.java b/play-services-wearable/src/main/java/org/microg/gms/wearable/WearableApiBuilder.java index 1d103230..768509d9 100644 --- a/play-services-wearable/src/main/java/org/microg/gms/wearable/WearableApiBuilder.java +++ b/play-services-wearable/src/main/java/org/microg/gms/wearable/WearableApiBuilder.java @@ -18,7 +18,6 @@ package org.microg.gms.wearable; import android.content.Context; import android.os.Looper; -import android.util.Log; import com.google.android.gms.common.api.AccountInfo; import com.google.android.gms.common.api.GoogleApiClient; @@ -34,7 +33,6 @@ public class WearableApiBuilder implements ApiBuilder public ApiConnection build(Context context, Looper looper, Wearable.WearableOptions options, AccountInfo accountInfo, GoogleApiClient.ConnectionCallbacks callbacks, GoogleApiClient.OnConnectionFailedListener connectionFailedListener) { - Log.d(TAG, "Wearables not supported"); - return null; + return new WearableClientImpl(context, options, callbacks, connectionFailedListener); } } diff --git a/play-services-wearable/src/main/java/org/microg/gms/wearable/WearableClientImpl.java b/play-services-wearable/src/main/java/org/microg/gms/wearable/WearableClientImpl.java new file mode 100644 index 00000000..310590b2 --- /dev/null +++ b/play-services-wearable/src/main/java/org/microg/gms/wearable/WearableClientImpl.java @@ -0,0 +1,53 @@ +/* + * Copyright 2013-2016 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 org.microg.gms.wearable; + +import android.content.Context; +import android.os.IBinder; +import android.util.Log; + +import com.google.android.gms.common.api.GoogleApiClient; +import com.google.android.gms.wearable.Wearable; +import com.google.android.gms.wearable.internal.IWearableService; + +import org.microg.gms.common.GmsClient; +import org.microg.gms.common.GmsService; +import org.microg.gms.common.api.GoogleApiClientImpl; + +public class WearableClientImpl extends GmsClient { + private static final String TAG = "GmsWearClient"; + + public WearableClientImpl(Context context, Wearable.WearableOptions options, GoogleApiClient.ConnectionCallbacks callbacks, GoogleApiClient.OnConnectionFailedListener connectionFailedListener) { + super(context, callbacks, connectionFailedListener, GmsService.WEARABLE.ACTION); + serviceId = GmsService.WEARABLE.SERVICE_ID; + if (options != null && options.firstPartyMode) + extras.putBoolean("firstPartyMode", true); + Log.d(TAG, ""); + } + + @Override + protected IWearableService interfaceFromBinder(IBinder binder) { + return IWearableService.Stub.asInterface(binder); + } + + public static WearableClientImpl get(GoogleApiClient apiClient) { + if (apiClient instanceof GoogleApiClientImpl) { + return (WearableClientImpl) ((GoogleApiClientImpl) apiClient).getApiConnection(Wearable.API); + } + return null; + } +} diff --git a/play-services-wearable/src/main/java/org/microg/gms/wearable/databundle/DataBundleUtil.java b/play-services-wearable/src/main/java/org/microg/gms/wearable/databundle/DataBundleUtil.java new file mode 100644 index 00000000..69a71964 --- /dev/null +++ b/play-services-wearable/src/main/java/org/microg/gms/wearable/databundle/DataBundleUtil.java @@ -0,0 +1,658 @@ +/* + * Copyright 2013-2016 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 org.microg.gms.wearable.databundle; + +import android.util.SparseArray; + +import com.google.android.gms.wearable.Asset; +import com.google.android.gms.wearable.DataMap; +import com.squareup.wire.Wire; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import okio.ByteString; + +public class DataBundleUtil { + + public static DataMap readDataMap(byte[] bytes, List assets) { + try { + return readDataMap(new Wire().parseFrom(bytes, DataBundle.class), assets); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + public static DataMap readDataMap(DataBundle dataBundle, List assets) { + return readDataMap(dataBundle.entries, assets); + } + + public static DataMap readDataMap(List entries, List assets) { + DataMap dataMap = new DataMap(); + for (DataBundleEntry entry : entries) { + readAndStore(dataMap, entry.key, entry.typedValue, assets); + } + return dataMap; + } + + public static byte[] createBytes(DataMap dataMap) { + AssetAnnotatedDataBundle dataBundle = createDataBundle(dataMap); + if (!dataBundle.getAssets().isEmpty()) { + throw new UnsupportedOperationException(); + } + return dataBundle.getData(); + } + + public static AssetAnnotatedDataBundle createDataBundle(DataMap dataMap) { + AssetAnnotatedDataBundle dataBundle = new AssetAnnotatedDataBundle(); + dataBundle.assets = new ArrayList(); + dataBundle.dataBundle = new DataBundle(createEntryList(dataMap, dataBundle.assets)); + return dataBundle; + } + + private static List createEntryList(DataMap dataMap, List assets) { + List entries = new ArrayList(); + for (String key : dataMap.keySet()) { + entries.add(getTypeHelper(dataMap.getType(key)).loadAndCreateEntry(dataMap, key, assets)); + } + return entries; + } + + private static void readAndStore(DataMap dataMap, String key, DataBundleTypedValue value, List assets) { + if (value.type == null) return; + getTypeHelper(value.type).readAndStore(dataMap, key, value, assets); + } + + + private static SparseArray typeHelperByCode; + + private static void rememberTypeReader(TypeHelper typeHelper) { + typeHelperByCode.put(typeHelper.type, typeHelper); + } + + static TypeHelper getTypeHelper(int type) { + if (typeHelperByCode.get(type) != null) { + return typeHelperByCode.get(type); + } else { + throw new IllegalArgumentException(); + } + } + + static TypeHelper getTypeHelper(DataMap.StoredType type) { + return getTypeHelper(type.getTypeCode()); + } + + static TypeHelper getListInnerTypeHelper(DataMap.StoredType type) { + return getTypeHelper(type.getListType()); + } + + public static final int BYTE_ARRAY_TYPE_CODE = 1; + static TypeHelper BYTEARRAY = new TypeHelper(BYTE_ARRAY_TYPE_CODE) { + @Override + byte[] read(DataBundleValue value, List assets) { + return value.byteArray.toByteArray(); + } + + @Override + DataBundleValue create(byte[] value, List assets) { + return new DataBundleValue.Builder().byteArray(ByteString.of(value)).build(); + } + + @Override + void store(DataMap dataMap, String key, byte[] value) { + dataMap.putByteArray(key, value); + } + + @Override + byte[] load(DataMap dataMap, String key) { + return dataMap.getByteArray(key); + } + }; + + public static final int STRING_TYPE_CODE = 2; + static TypeHelper STRING = new TypeHelper(STRING_TYPE_CODE) { + @Override + String read(DataBundleValue value, List assets) { + return value.stringVal; + } + + @Override + DataBundleValue create(String value, List assets) { + return new DataBundleValue.Builder().stringVal(value).build(); + } + + @Override + void store(DataMap dataMap, String key, String value) { + dataMap.putString(key, value); + } + + @Override + void storeList(DataMap dataMap, String key, ArrayList valueList) { + dataMap.putStringArrayList(key, valueList); + } + + @Override + String load(DataMap dataMap, String key) { + return dataMap.getString(key); + } + + @Override + AnnotatedArrayList loadList(DataMap dataMap, String key) { + AnnotatedArrayList list = new AnnotatedArrayList(this); + list.addAll(dataMap.getStringArrayList(key)); + return list; + } + }; + + public static final int DOUBLE_TYPE_CODE = 3; + static TypeHelper DOUBLE = new TypeHelper(DOUBLE_TYPE_CODE) { + @Override + Double read(DataBundleValue value, List assets) { + return value.doubleVal; + } + + @Override + DataBundleValue create(Double value, List assets) { + return new DataBundleValue.Builder().doubleVal(value).build(); + } + + @Override + void store(DataMap dataMap, String key, Double value) { + dataMap.putDouble(key, value); + } + + @Override + Double load(DataMap dataMap, String key) { + return dataMap.getDouble(key); + } + }; + + public static final int FLOAT_TYPE_CODE = 4; + static TypeHelper FLOAT = new TypeHelper(FLOAT_TYPE_CODE) { + @Override + Float read(DataBundleValue value, List assets) { + return value.floatVal; + } + + @Override + DataBundleValue create(Float value, List assets) { + return new DataBundleValue.Builder().floatVal(value).build(); + } + + @Override + void store(DataMap dataMap, String key, Float value) { + dataMap.putFloat(key, value); + } + + @Override + Float load(DataMap dataMap, String key) { + return dataMap.getFloat(key); + } + }; + + public static final int LONG_TYPE_CODE = 5; + static TypeHelper LONG = new TypeHelper(LONG_TYPE_CODE) { + @Override + Long read(DataBundleValue value, List assets) { + return value.longVal; + } + + @Override + DataBundleValue create(Long value, List assets) { + return new DataBundleValue.Builder().longVal(value).build(); + } + + @Override + void store(DataMap dataMap, String key, Long value) { + dataMap.putLong(key, value); + } + + @Override + Long load(DataMap dataMap, String key) { + return dataMap.getLong(key); + } + }; + + public static final int INTEGER_TYPE_CODE = 6; + static TypeHelper INTEGER = new TypeHelper(INTEGER_TYPE_CODE) { + @Override + Integer read(DataBundleValue value, List assets) { + return value.intVal; + } + + @Override + DataBundleValue create(Integer value, List assets) { + return new DataBundleValue.Builder().intVal(value).build(); + } + + @Override + void store(DataMap dataMap, String key, Integer value) { + dataMap.putInt(key, value); + } + + @Override + void storeList(DataMap dataMap, String key, ArrayList valueList) { + dataMap.putIntegerArrayList(key, valueList); + } + + @Override + Integer load(DataMap dataMap, String key) { + return dataMap.getInt(key); + } + + @Override + AnnotatedArrayList loadList(DataMap dataMap, String key) { + AnnotatedArrayList list = new AnnotatedArrayList(this); + list.addAll(dataMap.getIntegerArrayList(key)); + return list; + } + }; + + public static final int BYTE_TYPE_CODE = 7; + static TypeHelper BYTE = new TypeHelper(BYTE_TYPE_CODE) { + @Override + Byte read(DataBundleValue value, List assets) { + return (byte) (int) value.byteVal; + } + + @Override + DataBundleValue create(Byte value, List assets) { + return new DataBundleValue.Builder().byteVal((int) (byte) value).build(); + } + + @Override + void store(DataMap dataMap, String key, Byte value) { + dataMap.putByte(key, value); + } + + @Override + Byte load(DataMap dataMap, String key) { + return dataMap.getByte(key); + } + }; + + public static final int BOOLEAN_TYPE_CODE = 8; + static TypeHelper BOOLEAN = new TypeHelper(BOOLEAN_TYPE_CODE) { + @Override + Boolean read(DataBundleValue value, List assets) { + return value.booleanVal; + } + + @Override + DataBundleValue create(Boolean value, List assets) { + return new DataBundleValue.Builder().booleanVal(value).build(); + } + + @Override + void store(DataMap dataMap, String key, Boolean value) { + dataMap.putBoolean(key, value); + } + + @Override + Boolean load(DataMap dataMap, String key) { + return dataMap.getBoolean(key); + } + }; + + public static final int DATAMAP_TYPE_CODE = 9; + static TypeHelper DATAMAP = new TypeHelper(DATAMAP_TYPE_CODE) { + @Override + DataMap read(DataBundleValue value, List assets) { + return readDataMap(value.map, assets); + } + + @Override + DataBundleValue create(DataMap value, List assets) { + return new DataBundleValue.Builder().map(createEntryList(value, assets)).build(); + } + + @Override + void store(DataMap dataMap, String key, DataMap value) { + dataMap.putDataMap(key, value); + } + + @Override + void storeList(DataMap dataMap, String key, ArrayList valueList) { + dataMap.putDataMapArrayList(key, valueList); + } + + @Override + DataMap load(DataMap dataMap, String key) { + return dataMap.getDataMap(key); + } + + @Override + AnnotatedArrayList loadList(DataMap dataMap, String key) { + AnnotatedArrayList list = new AnnotatedArrayList(this); + list.addAll(dataMap.getDataMapArrayList(key)); + return list; + } + }; + + public static final int LIST_TYPE_CODE = 10; + static TypeHelper> ARRAYLIST = new TypeHelper>(LIST_TYPE_CODE) { + @Override + AnnotatedArrayList read(DataBundleValue value, List assets) { + TypeHelper innerTypeHelper = NULL; + for (DataBundleTypedValue typedValue : value.list) { + if (innerTypeHelper == NULL) { + innerTypeHelper = getTypeHelper(typedValue.type); + } else if (typedValue.type != innerTypeHelper.type && typedValue.type != NULL.type) { + throw new IllegalArgumentException("List has elements of different types: " + innerTypeHelper.type + " and " + typedValue.type); + } + } + return innerTypeHelper.readList(value.list, assets); + } + + @Override + DataBundleValue create(AnnotatedArrayList value, List assets) { + return new DataBundleValue.Builder().list(value.createList(assets)).build(); + } + + @Override + void store(DataMap dataMap, String key, AnnotatedArrayList value) { + value.store(dataMap, key); + } + + @Override + AnnotatedArrayList load(DataMap dataMap, String key) { + return getListInnerTypeHelper(dataMap.getType(key)).loadList(dataMap, key); + } + }; + + public static final int STRING_ARRAY_TYPE_CODE = 11; + static TypeHelper STRINGARRAY = new TypeHelper(STRING_ARRAY_TYPE_CODE) { + @Override + String[] read(DataBundleValue value, List assets) { + return value.stringArray.toArray(new String[value.stringArray.size()]); + } + + @Override + DataBundleValue create(String[] value, List assets) { + return new DataBundleValue.Builder().stringArray(Arrays.asList(value)).build(); + } + + @Override + void store(DataMap dataMap, String key, String[] value) { + dataMap.putStringArray(key, value); + } + + @Override + String[] load(DataMap dataMap, String key) { + return dataMap.getStringArray(key); + } + }; + + public static final int LONG_ARRAY_TYPE_CODE = 12; + static TypeHelper LONGARRAY = new TypeHelper(LONG_ARRAY_TYPE_CODE) { + @Override + long[] read(DataBundleValue value, List assets) { + long[] longArr = new long[value.longArray.size()]; + for (int i = 0; i < value.longArray.size(); i++) { + longArr[i] = value.longArray.get(i); + } + return longArr; + } + + @Override + DataBundleValue create(long[] value, List assets) { + List longList = new ArrayList(value.length); + for (long l : value) { + longList.add(l); + } + return new DataBundleValue.Builder().longArray(longList).build(); + } + + @Override + void store(DataMap dataMap, String key, long[] value) { + dataMap.putLongArray(key, value); + } + + @Override + long[] load(DataMap dataMap, String key) { + return dataMap.getLongArray(key); + } + }; + + public static final int ASSET_TYPE_CODE = 13; + static TypeHelper ASSET = new TypeHelper(ASSET_TYPE_CODE) { + @Override + Asset read(DataBundleValue value, List assets) { + return assets.get(value.assetIndex); + } + + @Override + DataBundleValue create(Asset value, List assets) { + int index; + if (assets.contains(value)) { + index = assets.indexOf(value); + } else { + index = assets.size(); + assets.add(value); + } + return new DataBundleValue.Builder().assetIndex(index).build(); + } + + @Override + void store(DataMap dataMap, String key, Asset value) { + dataMap.putAsset(key, value); + } + + @Override + Asset load(DataMap dataMap, String key) { + return dataMap.getAsset(key); + } + }; + + public static final int NULL_TYPE_CODE = 14; + static TypeHelper NULL = new TypeHelper(NULL_TYPE_CODE) { + @Override + String read(DataBundleValue value, List assets) { + return null; + } + + @Override + DataBundleValue create(String value, List assets) { + return new DataBundleValue.Builder().build(); + } + + @Override + void store(DataMap dataMap, String key, String value) { + dataMap.putString(key, value); + } + + @Override + void storeList(DataMap dataMap, String key, ArrayList valueList) { + dataMap.putStringArrayList(key, valueList); + } + + @Override + String load(DataMap dataMap, String key) { + return null; + } + + @Override + AnnotatedArrayList loadList(DataMap dataMap, String key) { + AnnotatedArrayList list = new AnnotatedArrayList(this); + list.addAll(dataMap.getStringArrayList(key)); + return list; + } + }; + + public static final int FLOAT_ARRAY_TYPE_CODE = 15; + static TypeHelper FLOATARRAY = new TypeHelper(FLOAT_ARRAY_TYPE_CODE) { + @Override + float[] read(DataBundleValue value, List assets) { + float[] floatArr = new float[value.floatArray.size()]; + for (int i = 0; i < value.floatArray.size(); i++) { + floatArr[i] = value.floatArray.get(i); + } + return floatArr; + } + + @Override + DataBundleValue create(float[] value, List assets) { + List floatList = new ArrayList(value.length); + for (float f : value) { + floatList.add(f); + } + return new DataBundleValue.Builder().floatArray(floatList).build(); + } + + @Override + void store(DataMap dataMap, String key, float[] value) { + dataMap.putFloatArray(key, value); + } + + @Override + float[] load(DataMap dataMap, String key) { + return dataMap.getFloatArray(key); + } + }; + + static { + typeHelperByCode = new SparseArray(); + rememberTypeReader(BYTEARRAY); + rememberTypeReader(STRING); + rememberTypeReader(DOUBLE); + rememberTypeReader(FLOAT); + rememberTypeReader(LONG); + rememberTypeReader(INTEGER); + rememberTypeReader(BYTE); + rememberTypeReader(BOOLEAN); + rememberTypeReader(DATAMAP); + rememberTypeReader(ARRAYLIST); + rememberTypeReader(STRINGARRAY); + rememberTypeReader(LONGARRAY); + rememberTypeReader(ASSET); + rememberTypeReader(NULL); + rememberTypeReader(FLOATARRAY); + } + + static class AssetAnnotatedDataBundle { + private DataBundle dataBundle; + private List assets; + + public List getAssets() { + return assets; + } + + public byte[] getData() { + return dataBundle.toByteArray(); + } + } + + static class AnnotatedArrayList extends ArrayList { + private TypeHelper innerType; + + public AnnotatedArrayList(TypeHelper innerType) { + this.innerType = innerType; + } + + void store(DataMap dataMap, String key) { + innerType.storeList(dataMap, key, this); + } + + public List createList(List assets) { + return innerType.createList(this, assets); + } + } + + static abstract class TypeHelper { + private int type; + + public TypeHelper(int type) { + this.type = type; + } + + abstract T read(DataBundleValue value, List assets); + + abstract DataBundleValue create(T value, List assets); + + T read(DataBundleTypedValue value, List assets) { + if (value.type == NULL_TYPE_CODE) { + return null; + } else if (value.type == type) { + return read(value.value, assets); + } else { + throw new IllegalArgumentException(); + } + } + + abstract void store(DataMap dataMap, String key, T value); + + void storeList(DataMap dataMap, String key, ArrayList valueList) { + throw new UnsupportedOperationException(); + } + + abstract T load(DataMap dataMap, String key); + + AnnotatedArrayList loadList(DataMap dataMap, String key) { + throw new UnsupportedOperationException(); + } + + void readAndStore(DataMap dataMap, String key, DataBundleValue value, List assets) { + store(dataMap, key, read(value, assets)); + } + + void readAndStore(DataMap dataMap, String key, DataBundleTypedValue value, List assets) { + store(dataMap, key, read(value, assets)); + } + + void readAndStore(DataMap dataMap, DataBundleEntry entry, List assets) { + readAndStore(dataMap, entry.key, entry.typedValue, assets); + } + + AnnotatedArrayList readList(List values, List assets) { + AnnotatedArrayList list = new AnnotatedArrayList(this); + for (DataBundleTypedValue value : values) { + list.add(read(value, assets)); + } + return list; + } + + List createList(AnnotatedArrayList value, List assets) { + List list = new ArrayList(); + for (T val : value) { + list.add(createTyped(val, assets)); + } + return list; + } + + void readAndStore(DataMap dataMap, String key, List values, List assets) { + storeList(dataMap, key, readList(values, assets)); + } + + DataBundleTypedValue createTyped(T value, List assets) { + return new DataBundleTypedValue(type, create(value, assets)); + } + + DataBundleValue loadAndCreate(DataMap dataMap, String key, List assets) { + return create(load(dataMap, key), assets); + } + + DataBundleTypedValue loadAndCreateTyped(DataMap dataMap, String key, List assets) { + return createTyped(load(dataMap, key), assets); + } + + DataBundleEntry loadAndCreateEntry(DataMap dataMap, String key, List assets) { + return new DataBundleEntry(key, loadAndCreateTyped(dataMap, key, assets)); + } + } +} diff --git a/play-services-wearable/src/main/protos-java/org/microg/gms/wearable/databundle/DataBundle.java b/play-services-wearable/src/main/protos-java/org/microg/gms/wearable/databundle/DataBundle.java new file mode 100644 index 00000000..ba388652 --- /dev/null +++ b/play-services-wearable/src/main/protos-java/org/microg/gms/wearable/databundle/DataBundle.java @@ -0,0 +1,64 @@ +// Code generated by Wire protocol buffer compiler, do not edit. +// Source file: protos-repo/databundle.proto +package org.microg.gms.wearable.databundle; + +import com.squareup.wire.Message; +import com.squareup.wire.ProtoField; +import java.util.Collections; +import java.util.List; + +import static com.squareup.wire.Message.Label.REPEATED; + +public final class DataBundle extends Message { + + public static final List DEFAULT_ENTRIES = Collections.emptyList(); + + @ProtoField(tag = 1, label = REPEATED, messageType = DataBundleEntry.class) + public final List entries; + + public DataBundle(List entries) { + this.entries = immutableCopyOf(entries); + } + + private DataBundle(Builder builder) { + this(builder.entries); + setBuilder(builder); + } + + @Override + public boolean equals(Object other) { + if (other == this) return true; + if (!(other instanceof DataBundle)) return false; + return equals(entries, ((DataBundle) other).entries); + } + + @Override + public int hashCode() { + int result = hashCode; + return result != 0 ? result : (hashCode = entries != null ? entries.hashCode() : 1); + } + + public static final class Builder extends Message.Builder { + + public List entries; + + public Builder() { + } + + public Builder(DataBundle message) { + super(message); + if (message == null) return; + this.entries = copyOf(message.entries); + } + + public Builder entries(List entries) { + this.entries = checkForNulls(entries); + return this; + } + + @Override + public DataBundle build() { + return new DataBundle(this); + } + } +} diff --git a/play-services-wearable/src/main/protos-java/org/microg/gms/wearable/databundle/DataBundleEntry.java b/play-services-wearable/src/main/protos-java/org/microg/gms/wearable/databundle/DataBundleEntry.java new file mode 100644 index 00000000..a5f52d38 --- /dev/null +++ b/play-services-wearable/src/main/protos-java/org/microg/gms/wearable/databundle/DataBundleEntry.java @@ -0,0 +1,80 @@ +// Code generated by Wire protocol buffer compiler, do not edit. +// Source file: protos-repo/databundle.proto +package org.microg.gms.wearable.databundle; + +import com.squareup.wire.Message; +import com.squareup.wire.ProtoField; + +import static com.squareup.wire.Message.Datatype.STRING; + +public final class DataBundleEntry extends Message { + + public static final String DEFAULT_KEY = ""; + + @ProtoField(tag = 1, type = STRING) + public final String key; + + @ProtoField(tag = 2) + public final DataBundleTypedValue typedValue; + + public DataBundleEntry(String key, DataBundleTypedValue typedValue) { + this.key = key; + this.typedValue = typedValue; + } + + private DataBundleEntry(Builder builder) { + this(builder.key, builder.typedValue); + setBuilder(builder); + } + + @Override + public boolean equals(Object other) { + if (other == this) return true; + if (!(other instanceof DataBundleEntry)) return false; + DataBundleEntry o = (DataBundleEntry) other; + return equals(key, o.key) + && equals(typedValue, o.typedValue); + } + + @Override + public int hashCode() { + int result = hashCode; + if (result == 0) { + result = key != null ? key.hashCode() : 0; + result = result * 37 + (typedValue != null ? typedValue.hashCode() : 0); + hashCode = result; + } + return result; + } + + public static final class Builder extends Message.Builder { + + public String key; + public DataBundleTypedValue typedValue; + + public Builder() { + } + + public Builder(DataBundleEntry message) { + super(message); + if (message == null) return; + this.key = message.key; + this.typedValue = message.typedValue; + } + + public Builder key(String key) { + this.key = key; + return this; + } + + public Builder typedValue(DataBundleTypedValue typedValue) { + this.typedValue = typedValue; + return this; + } + + @Override + public DataBundleEntry build() { + return new DataBundleEntry(this); + } + } +} diff --git a/play-services-wearable/src/main/protos-java/org/microg/gms/wearable/databundle/DataBundleTypedValue.java b/play-services-wearable/src/main/protos-java/org/microg/gms/wearable/databundle/DataBundleTypedValue.java new file mode 100644 index 00000000..9a7d08f6 --- /dev/null +++ b/play-services-wearable/src/main/protos-java/org/microg/gms/wearable/databundle/DataBundleTypedValue.java @@ -0,0 +1,80 @@ +// Code generated by Wire protocol buffer compiler, do not edit. +// Source file: protos-repo/databundle.proto +package org.microg.gms.wearable.databundle; + +import com.squareup.wire.Message; +import com.squareup.wire.ProtoField; + +import static com.squareup.wire.Message.Datatype.INT32; + +public final class DataBundleTypedValue extends Message { + + public static final Integer DEFAULT_TYPE = 0; + + @ProtoField(tag = 1, type = INT32) + public final Integer type; + + @ProtoField(tag = 2) + public final DataBundleValue value; + + public DataBundleTypedValue(Integer type, DataBundleValue value) { + this.type = type; + this.value = value; + } + + private DataBundleTypedValue(Builder builder) { + this(builder.type, builder.value); + setBuilder(builder); + } + + @Override + public boolean equals(Object other) { + if (other == this) return true; + if (!(other instanceof DataBundleTypedValue)) return false; + DataBundleTypedValue o = (DataBundleTypedValue) other; + return equals(type, o.type) + && equals(value, o.value); + } + + @Override + public int hashCode() { + int result = hashCode; + if (result == 0) { + result = type != null ? type.hashCode() : 0; + result = result * 37 + (value != null ? value.hashCode() : 0); + hashCode = result; + } + return result; + } + + public static final class Builder extends Message.Builder { + + public Integer type; + public DataBundleValue value; + + public Builder() { + } + + public Builder(DataBundleTypedValue message) { + super(message); + if (message == null) return; + this.type = message.type; + this.value = message.value; + } + + public Builder type(Integer type) { + this.type = type; + return this; + } + + public Builder value(DataBundleValue value) { + this.value = value; + return this; + } + + @Override + public DataBundleTypedValue build() { + return new DataBundleTypedValue(this); + } + } +} diff --git a/play-services-wearable/src/main/protos-java/org/microg/gms/wearable/databundle/DataBundleValue.java b/play-services-wearable/src/main/protos-java/org/microg/gms/wearable/databundle/DataBundleValue.java new file mode 100644 index 00000000..4b9a120a --- /dev/null +++ b/play-services-wearable/src/main/protos-java/org/microg/gms/wearable/databundle/DataBundleValue.java @@ -0,0 +1,259 @@ +// Code generated by Wire protocol buffer compiler, do not edit. +// Source file: protos-repo/databundle.proto +package org.microg.gms.wearable.databundle; + +import com.squareup.wire.Message; +import com.squareup.wire.ProtoField; +import java.util.Collections; +import java.util.List; +import okio.ByteString; + +import static com.squareup.wire.Message.Datatype.BOOL; +import static com.squareup.wire.Message.Datatype.BYTES; +import static com.squareup.wire.Message.Datatype.DOUBLE; +import static com.squareup.wire.Message.Datatype.FLOAT; +import static com.squareup.wire.Message.Datatype.INT32; +import static com.squareup.wire.Message.Datatype.INT64; +import static com.squareup.wire.Message.Datatype.STRING; +import static com.squareup.wire.Message.Label.REPEATED; + +public final class DataBundleValue extends Message { + + public static final ByteString DEFAULT_BYTEARRAY = ByteString.EMPTY; + public static final String DEFAULT_STRINGVAL = ""; + public static final Double DEFAULT_DOUBLEVAL = 0D; + public static final Float DEFAULT_FLOATVAL = 0F; + public static final Long DEFAULT_LONGVAL = 0L; + public static final Integer DEFAULT_INTVAL = 0; + public static final Integer DEFAULT_BYTEVAL = 0; + public static final Boolean DEFAULT_BOOLEANVAL = false; + public static final List DEFAULT_MAP = Collections.emptyList(); + public static final List DEFAULT_LIST = Collections.emptyList(); + public static final List DEFAULT_STRINGARRAY = Collections.emptyList(); + public static final List DEFAULT_LONGARRAY = Collections.emptyList(); + public static final Integer DEFAULT_ASSETINDEX = 0; + public static final List DEFAULT_FLOATARRAY = Collections.emptyList(); + + @ProtoField(tag = 1, type = BYTES) + public final ByteString byteArray; + + @ProtoField(tag = 2, type = STRING) + public final String stringVal; + + @ProtoField(tag = 3, type = DOUBLE) + public final Double doubleVal; + + @ProtoField(tag = 4, type = FLOAT) + public final Float floatVal; + + @ProtoField(tag = 5, type = INT64) + public final Long longVal; + + @ProtoField(tag = 6, type = INT32) + public final Integer intVal; + + @ProtoField(tag = 7, type = INT32) + public final Integer byteVal; + + @ProtoField(tag = 8, type = BOOL) + public final Boolean booleanVal; + + @ProtoField(tag = 9, label = REPEATED, messageType = DataBundleEntry.class) + public final List map; + + @ProtoField(tag = 10, label = REPEATED, messageType = DataBundleTypedValue.class) + public final List list; + + @ProtoField(tag = 11, type = STRING, label = REPEATED) + public final List stringArray; + + @ProtoField(tag = 12, type = INT64, label = REPEATED) + public final List longArray; + + @ProtoField(tag = 13, type = INT32) + public final Integer assetIndex; + + @ProtoField(tag = 14, type = FLOAT, label = REPEATED) + public final List floatArray; + + public DataBundleValue(ByteString byteArray, String stringVal, Double doubleVal, Float floatVal, Long longVal, Integer intVal, Integer byteVal, Boolean booleanVal, List map, List list, List stringArray, List longArray, Integer assetIndex, List floatArray) { + this.byteArray = byteArray; + this.stringVal = stringVal; + this.doubleVal = doubleVal; + this.floatVal = floatVal; + this.longVal = longVal; + this.intVal = intVal; + this.byteVal = byteVal; + this.booleanVal = booleanVal; + this.map = immutableCopyOf(map); + this.list = immutableCopyOf(list); + this.stringArray = immutableCopyOf(stringArray); + this.longArray = immutableCopyOf(longArray); + this.assetIndex = assetIndex; + this.floatArray = immutableCopyOf(floatArray); + } + + private DataBundleValue(Builder builder) { + this(builder.byteArray, builder.stringVal, builder.doubleVal, builder.floatVal, builder.longVal, builder.intVal, builder.byteVal, builder.booleanVal, builder.map, builder.list, builder.stringArray, builder.longArray, builder.assetIndex, builder.floatArray); + setBuilder(builder); + } + + @Override + public boolean equals(Object other) { + if (other == this) return true; + if (!(other instanceof DataBundleValue)) return false; + DataBundleValue o = (DataBundleValue) other; + return equals(byteArray, o.byteArray) + && equals(stringVal, o.stringVal) + && equals(doubleVal, o.doubleVal) + && equals(floatVal, o.floatVal) + && equals(longVal, o.longVal) + && equals(intVal, o.intVal) + && equals(byteVal, o.byteVal) + && equals(booleanVal, o.booleanVal) + && equals(map, o.map) + && equals(list, o.list) + && equals(stringArray, o.stringArray) + && equals(longArray, o.longArray) + && equals(assetIndex, o.assetIndex) + && equals(floatArray, o.floatArray); + } + + @Override + public int hashCode() { + int result = hashCode; + if (result == 0) { + result = byteArray != null ? byteArray.hashCode() : 0; + result = result * 37 + (stringVal != null ? stringVal.hashCode() : 0); + result = result * 37 + (doubleVal != null ? doubleVal.hashCode() : 0); + result = result * 37 + (floatVal != null ? floatVal.hashCode() : 0); + result = result * 37 + (longVal != null ? longVal.hashCode() : 0); + result = result * 37 + (intVal != null ? intVal.hashCode() : 0); + result = result * 37 + (byteVal != null ? byteVal.hashCode() : 0); + result = result * 37 + (booleanVal != null ? booleanVal.hashCode() : 0); + result = result * 37 + (map != null ? map.hashCode() : 1); + result = result * 37 + (list != null ? list.hashCode() : 1); + result = result * 37 + (stringArray != null ? stringArray.hashCode() : 1); + result = result * 37 + (longArray != null ? longArray.hashCode() : 1); + result = result * 37 + (assetIndex != null ? assetIndex.hashCode() : 0); + result = result * 37 + (floatArray != null ? floatArray.hashCode() : 1); + hashCode = result; + } + return result; + } + + public static final class Builder extends Message.Builder { + + public ByteString byteArray; + public String stringVal; + public Double doubleVal; + public Float floatVal; + public Long longVal; + public Integer intVal; + public Integer byteVal; + public Boolean booleanVal; + public List map; + public List list; + public List stringArray; + public List longArray; + public Integer assetIndex; + public List floatArray; + + public Builder() { + } + + public Builder(DataBundleValue message) { + super(message); + if (message == null) return; + this.byteArray = message.byteArray; + this.stringVal = message.stringVal; + this.doubleVal = message.doubleVal; + this.floatVal = message.floatVal; + this.longVal = message.longVal; + this.intVal = message.intVal; + this.byteVal = message.byteVal; + this.booleanVal = message.booleanVal; + this.map = copyOf(message.map); + this.list = copyOf(message.list); + this.stringArray = copyOf(message.stringArray); + this.longArray = copyOf(message.longArray); + this.assetIndex = message.assetIndex; + this.floatArray = copyOf(message.floatArray); + } + + public Builder byteArray(ByteString byteArray) { + this.byteArray = byteArray; + return this; + } + + public Builder stringVal(String stringVal) { + this.stringVal = stringVal; + return this; + } + + public Builder doubleVal(Double doubleVal) { + this.doubleVal = doubleVal; + return this; + } + + public Builder floatVal(Float floatVal) { + this.floatVal = floatVal; + return this; + } + + public Builder longVal(Long longVal) { + this.longVal = longVal; + return this; + } + + public Builder intVal(Integer intVal) { + this.intVal = intVal; + return this; + } + + public Builder byteVal(Integer byteVal) { + this.byteVal = byteVal; + return this; + } + + public Builder booleanVal(Boolean booleanVal) { + this.booleanVal = booleanVal; + return this; + } + + public Builder map(List map) { + this.map = checkForNulls(map); + return this; + } + + public Builder list(List list) { + this.list = checkForNulls(list); + return this; + } + + public Builder stringArray(List stringArray) { + this.stringArray = checkForNulls(stringArray); + return this; + } + + public Builder longArray(List longArray) { + this.longArray = checkForNulls(longArray); + return this; + } + + public Builder assetIndex(Integer assetIndex) { + this.assetIndex = assetIndex; + return this; + } + + public Builder floatArray(List floatArray) { + this.floatArray = checkForNulls(floatArray); + return this; + } + + @Override + public DataBundleValue build() { + return new DataBundleValue(this); + } + } +} diff --git a/play-services-wearable/src/main/protos-repo/databundle.proto b/play-services-wearable/src/main/protos-repo/databundle.proto new file mode 100644 index 00000000..bc8cb317 --- /dev/null +++ b/play-services-wearable/src/main/protos-repo/databundle.proto @@ -0,0 +1,33 @@ +option java_package = "org.microg.gms.wearable.databundle"; +option java_outer_classname = "DataBundleProto"; + +message DataBundle { + repeated DataBundleEntry entries = 1; +} + +message DataBundleEntry { + optional string key = 1; + optional DataBundleTypedValue typedValue = 2; +} + +message DataBundleTypedValue { + optional int32 type = 1; + optional DataBundleValue value = 2; +} + +message DataBundleValue { + optional bytes byteArray = 1; + optional string stringVal = 2; + optional double doubleVal = 3; + optional float floatVal = 4; + optional int64 longVal = 5; + optional int32 intVal = 6; + optional int32 byteVal = 7; + optional bool booleanVal = 8; + repeated DataBundleEntry map = 9; + repeated DataBundleTypedValue list = 10; + repeated string stringArray = 11; + repeated int64 longArray = 12; + optional int32 assetIndex = 13; + repeated float floatArray = 14; +} diff --git a/settings.gradle b/settings.gradle index 870c2121..13740781 100644 --- a/settings.gradle +++ b/settings.gradle @@ -16,8 +16,8 @@ include ':safe-parcel' +include ':play-services-basement' include ':play-services-cast-api' -include ':play-services-common-api' include ':play-services-iid-api' include ':play-services-location-api' include ':play-services-wearable-api' From 310127db7905a15af2589a161169292275ead064 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Sun, 14 Aug 2016 10:41:13 +0200 Subject: [PATCH 172/293] Disable 'InvalidPackage' lint --- play-services-wearable/build.gradle | 4 ++++ play-services/build.gradle | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/play-services-wearable/build.gradle b/play-services-wearable/build.gradle index d3a8d0ec..d5ad389a 100644 --- a/play-services-wearable/build.gradle +++ b/play-services-wearable/build.gradle @@ -51,6 +51,10 @@ android { compileOptions { sourceCompatibility JavaVersion.VERSION_1_6 } + + lintOptions { + disable 'InvalidPackage' + } } dependencies { diff --git a/play-services/build.gradle b/play-services/build.gradle index 9c4a6711..323f81c6 100644 --- a/play-services/build.gradle +++ b/play-services/build.gradle @@ -45,6 +45,10 @@ android { compileOptions { sourceCompatibility JavaVersion.VERSION_1_6 } + + lintOptions { + disable 'InvalidPackage' + } } dependencies { From e057a9daaea26ea80d15b1e6f795425a7b21e9cf Mon Sep 17 00:00:00 2001 From: Marvin W Date: Sun, 14 Aug 2016 15:01:43 +0200 Subject: [PATCH 173/293] Add parts of dynamite API and firebase database API --- .../android/gms/dynamite/IDynamiteLoader.aidl | 10 +++++ .../idl/CompoundHashParcelable.aidl | 3 ++ .../connection/idl/ConnectionConfig.aidl | 3 ++ .../idl/IConnectionAuthTokenProvider.aidl | 7 +++ .../connection/idl/IGetTokenCallback.aidl | 6 +++ .../connection/idl/IListenHashProvider.aidl | 11 +++++ .../connection/idl/IPersistentConnection.aidl | 44 +++++++++++++++++++ .../idl/IPersistentConnectionDelegate.aidl | 19 ++++++++ .../idl/IRequestResultCallback.aidl | 5 +++ .../connection/idl/RangeParcelable.aidl | 3 ++ .../idl/CompoundHashParcelable.java | 23 ++++++++++ .../connection/idl/ConnectionConfig.java | 23 ++++++++++ .../connection/idl/RangeParcelable.java | 23 ++++++++++ 13 files changed, 180 insertions(+) create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/dynamite/IDynamiteLoader.aidl create mode 100644 play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/CompoundHashParcelable.aidl create mode 100644 play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/ConnectionConfig.aidl create mode 100644 play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/IConnectionAuthTokenProvider.aidl create mode 100644 play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/IGetTokenCallback.aidl create mode 100644 play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/IListenHashProvider.aidl create mode 100644 play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/IPersistentConnection.aidl create mode 100644 play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/IPersistentConnectionDelegate.aidl create mode 100644 play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/IRequestResultCallback.aidl create mode 100644 play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/RangeParcelable.aidl create mode 100644 play-services-api/src/main/java/com/google/firebase/database/connection/idl/CompoundHashParcelable.java create mode 100644 play-services-api/src/main/java/com/google/firebase/database/connection/idl/ConnectionConfig.java create mode 100644 play-services-api/src/main/java/com/google/firebase/database/connection/idl/RangeParcelable.java diff --git a/play-services-api/src/main/aidl/com/google/android/gms/dynamite/IDynamiteLoader.aidl b/play-services-api/src/main/aidl/com/google/android/gms/dynamite/IDynamiteLoader.aidl new file mode 100644 index 00000000..8cb2be99 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/dynamite/IDynamiteLoader.aidl @@ -0,0 +1,10 @@ +package com.google.android.gms.dynamite; + +import com.google.android.gms.dynamic.IObjectWrapper; + +interface IDynamiteLoader { + int getModuleVersion(IObjectWrapper context, String moduleId) = 0; + int getModuleVersion2(IObjectWrapper context, String moduleId, boolean updateConfigIfRequired) = 2; + + IObjectWrapper createModuleContext(IObjectWrapper context, String moduleId, int minVersion) = 1; +} \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/CompoundHashParcelable.aidl b/play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/CompoundHashParcelable.aidl new file mode 100644 index 00000000..689e5918 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/CompoundHashParcelable.aidl @@ -0,0 +1,3 @@ +package com.google.firebase.database.connection.idl; + +parcelable CompoundHashParcelable; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/ConnectionConfig.aidl b/play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/ConnectionConfig.aidl new file mode 100644 index 00000000..d6c1fc31 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/ConnectionConfig.aidl @@ -0,0 +1,3 @@ +package com.google.firebase.database.connection.idl; + +parcelable ConnectionConfig; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/IConnectionAuthTokenProvider.aidl b/play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/IConnectionAuthTokenProvider.aidl new file mode 100644 index 00000000..447f9f4a --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/IConnectionAuthTokenProvider.aidl @@ -0,0 +1,7 @@ +package com.google.firebase.database.connection.idl; + +import com.google.firebase.database.connection.idl.IGetTokenCallback; + +interface IConnectionAuthTokenProvider { + void zero(boolean var1, IGetTokenCallback var2) = 0; +} \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/IGetTokenCallback.aidl b/play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/IGetTokenCallback.aidl new file mode 100644 index 00000000..c4d45cdd --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/IGetTokenCallback.aidl @@ -0,0 +1,6 @@ +package com.google.firebase.database.connection.idl; + +interface IGetTokenCallback { + void zero(String s) = 0; + void onError(String s) = 1; +} \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/IListenHashProvider.aidl b/play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/IListenHashProvider.aidl new file mode 100644 index 00000000..a5aaa187 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/IListenHashProvider.aidl @@ -0,0 +1,11 @@ +package com.google.firebase.database.connection.idl; + +import com.google.firebase.database.connection.idl.CompoundHashParcelable; + +interface IListenHashProvider { + String zzPY() = 0; + + boolean zzPZ() = 1; + + CompoundHashParcelable zzQF() = 2; +} \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/IPersistentConnection.aidl b/play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/IPersistentConnection.aidl new file mode 100644 index 00000000..21e00b1c --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/IPersistentConnection.aidl @@ -0,0 +1,44 @@ +package com.google.firebase.database.connection.idl; + +import com.google.android.gms.dynamic.IObjectWrapper; + +import com.google.firebase.database.connection.idl.ConnectionConfig; +import com.google.firebase.database.connection.idl.IConnectionAuthTokenProvider; +import com.google.firebase.database.connection.idl.IListenHashProvider; +import com.google.firebase.database.connection.idl.IPersistentConnectionDelegate; +import com.google.firebase.database.connection.idl.IRequestResultCallback; + + +interface IPersistentConnection { + void setup(in ConnectionConfig var1, IConnectionAuthTokenProvider var2, IObjectWrapper var3, IPersistentConnectionDelegate var4) = 0; + + void initialize() = 1; + + void shutdown() = 2; + + void refreshAuthToken() = 3; + + void listen(in List var1, IObjectWrapper var2, IListenHashProvider var3, long var4, IRequestResultCallback var6) = 4; + + void unlisten(in List var1, IObjectWrapper var2) = 5; + + void purgeOutstandingWrites() = 6; + + void put(in List var1, IObjectWrapper var2, IRequestResultCallback var3) = 7; + + void compareAndPut(in List var1, IObjectWrapper var2, String var3, IRequestResultCallback var4) = 8; + + void merge(in List var1, IObjectWrapper var2, IRequestResultCallback var3) = 9; + + void onDisconnectPut(in List var1, IObjectWrapper var2, IRequestResultCallback var3) = 10; + + void onDisconnectMerge(in List var1, IObjectWrapper var2, IRequestResultCallback var3) = 11; + + void onDisconnectCancel(in List var1, IRequestResultCallback var2) = 12; + + void interrupt(String var1) = 13; + + void resume(String var1) = 14; + + boolean isInterrupted(String var1) = 15; +} diff --git a/play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/IPersistentConnectionDelegate.aidl b/play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/IPersistentConnectionDelegate.aidl new file mode 100644 index 00000000..9ae649d0 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/IPersistentConnectionDelegate.aidl @@ -0,0 +1,19 @@ +package com.google.firebase.database.connection.idl; + +import com.google.android.gms.dynamic.IObjectWrapper; + +import com.google.firebase.database.connection.idl.RangeParcelable; + +interface IPersistentConnectionDelegate { + void zero(in List var1, IObjectWrapper var2, boolean var3, long var4) = 0; + + void one(in List var1, in List var2, IObjectWrapper var3, long var4) = 1; + + void two() = 2; + + void onDisconnect() = 3; + + void four(boolean var1) = 4; + + void five(IObjectWrapper var1) = 5; +} \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/IRequestResultCallback.aidl b/play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/IRequestResultCallback.aidl new file mode 100644 index 00000000..5806bc35 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/IRequestResultCallback.aidl @@ -0,0 +1,5 @@ +package com.google.firebase.database.connection.idl; + +interface IRequestResultCallback { + void zero(String var1, String var2) = 0; +} \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/RangeParcelable.aidl b/play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/RangeParcelable.aidl new file mode 100644 index 00000000..08d6df18 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/RangeParcelable.aidl @@ -0,0 +1,3 @@ +package com.google.firebase.database.connection.idl; + +parcelable RangeParcelable; \ No newline at end of file diff --git a/play-services-api/src/main/java/com/google/firebase/database/connection/idl/CompoundHashParcelable.java b/play-services-api/src/main/java/com/google/firebase/database/connection/idl/CompoundHashParcelable.java new file mode 100644 index 00000000..2cb50dbf --- /dev/null +++ b/play-services-api/src/main/java/com/google/firebase/database/connection/idl/CompoundHashParcelable.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2016 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.firebase.database.connection.idl; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class CompoundHashParcelable extends AutoSafeParcelable { + public static final Creator CREATOR = new AutoCreator(CompoundHashParcelable.class); +} diff --git a/play-services-api/src/main/java/com/google/firebase/database/connection/idl/ConnectionConfig.java b/play-services-api/src/main/java/com/google/firebase/database/connection/idl/ConnectionConfig.java new file mode 100644 index 00000000..63fd6335 --- /dev/null +++ b/play-services-api/src/main/java/com/google/firebase/database/connection/idl/ConnectionConfig.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2016 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.firebase.database.connection.idl; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class ConnectionConfig extends AutoSafeParcelable { + public static final Creator CREATOR = new AutoCreator(ConnectionConfig.class); +} diff --git a/play-services-api/src/main/java/com/google/firebase/database/connection/idl/RangeParcelable.java b/play-services-api/src/main/java/com/google/firebase/database/connection/idl/RangeParcelable.java new file mode 100644 index 00000000..0645f703 --- /dev/null +++ b/play-services-api/src/main/java/com/google/firebase/database/connection/idl/RangeParcelable.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2016 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.firebase.database.connection.idl; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class RangeParcelable extends AutoSafeParcelable { + public static final Creator CREATOR = new AutoCreator(RangeParcelable.class); +} From c6f5d25850d86a78119c0175678c81178b0500e1 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Sat, 27 Aug 2016 12:28:00 +0200 Subject: [PATCH 174/293] Update Gradle, Add initial Credential API files --- build.gradle | 38 +++ extern/SafeParcel | 2 +- gradle/wrapper/gradle-wrapper.properties | 2 +- play-services-api/build.gradle | 13 +- .../gms/auth/api/credentials/Credential.aidl | 3 + .../api/credentials/CredentialRequest.aidl | 3 + .../credentials/internal/DeleteRequest.aidl | 3 + .../internal/GeneratePasswordRequest.aidl | 3 + .../internal/ICredentialsCallbacks.aidl | 10 + .../internal/ICredentialsService.aidl | 15 ++ .../api/credentials/internal/SaveRequest.aidl | 3 + .../gms/auth/api/credentials/Credential.java | 248 ++++++++++++++++++ .../credentials/CredentialPickerConfig.java | 92 +++++++ .../api/credentials/CredentialRequest.java | 75 ++++++ .../gms/auth/api/credentials/IdToken.java | 58 ++++ .../credentials/internal/DeleteRequest.java | 23 ++ .../internal/GeneratePasswordRequest.java | 23 ++ .../api/credentials/internal/SaveRequest.java | 23 ++ play-services-basement/build.gradle | 13 +- .../android/gms/common/data/DataHolder.java | 24 +- play-services-cast-api/build.gradle | 13 +- play-services-iid-api/build.gradle | 13 +- play-services-location-api/build.gradle | 13 +- play-services-wearable-api/build.gradle | 13 +- 24 files changed, 643 insertions(+), 83 deletions(-) create mode 100644 build.gradle create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/auth/api/credentials/Credential.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/auth/api/credentials/CredentialRequest.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/auth/api/credentials/internal/DeleteRequest.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/auth/api/credentials/internal/GeneratePasswordRequest.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/auth/api/credentials/internal/ICredentialsCallbacks.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/auth/api/credentials/internal/ICredentialsService.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/auth/api/credentials/internal/SaveRequest.aidl create mode 100644 play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/Credential.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/CredentialPickerConfig.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/CredentialRequest.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/IdToken.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/internal/DeleteRequest.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/internal/GeneratePasswordRequest.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/internal/SaveRequest.java diff --git a/build.gradle b/build.gradle new file mode 100644 index 00000000..4b3b586b --- /dev/null +++ b/build.gradle @@ -0,0 +1,38 @@ +/* + * Copyright 2013-2016 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. + */ + +buildscript { + repositories { + jcenter() + } + dependencies { + classpath 'com.android.tools.build:gradle:2.1.3' + classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1' + } +} + +allprojects { + apply plugin: 'idea' + ext.androidBuildVersionTools = "23.0.3" +} + +def androidCompileSdk() { return 23 } + +subprojects { + repositories { + jcenter() + } +} diff --git a/extern/SafeParcel b/extern/SafeParcel index 6e2e63bd..7e7fcee2 160000 --- a/extern/SafeParcel +++ b/extern/SafeParcel @@ -1 +1 @@ -Subproject commit 6e2e63bdf0016b094b41f66b15accb4915cf7561 +Subproject commit 7e7fcee20047116b87406ae0e1296489a46bac73 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index aa76e3eb..06df1f78 100755 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.12-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip diff --git a/play-services-api/build.gradle b/play-services-api/build.gradle index 3e899acf..33871ca2 100644 --- a/play-services-api/build.gradle +++ b/play-services-api/build.gradle @@ -14,15 +14,6 @@ * limitations under the License. */ -buildscript { - repositories { - jcenter() - } - dependencies { - classpath 'com.android.tools.build:gradle:2.1.2' - } -} - apply plugin: 'com.android.library' String getMyVersionName() { @@ -38,8 +29,8 @@ group = 'org.microg' version = getMyVersionName() android { - compileSdkVersion 23 - buildToolsVersion "23.0.3" + compileSdkVersion androidCompileSdk() + buildToolsVersion "$androidBuildVersionTools" defaultConfig { versionName getMyVersionName() diff --git a/play-services-api/src/main/aidl/com/google/android/gms/auth/api/credentials/Credential.aidl b/play-services-api/src/main/aidl/com/google/android/gms/auth/api/credentials/Credential.aidl new file mode 100644 index 00000000..82536b93 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/auth/api/credentials/Credential.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.auth.api.credentials; + +parcelable Credential; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/auth/api/credentials/CredentialRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/auth/api/credentials/CredentialRequest.aidl new file mode 100644 index 00000000..d000f32e --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/auth/api/credentials/CredentialRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.auth.api.credentials; + +parcelable CredentialRequest; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/auth/api/credentials/internal/DeleteRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/auth/api/credentials/internal/DeleteRequest.aidl new file mode 100644 index 00000000..7fa0d4ab --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/auth/api/credentials/internal/DeleteRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.auth.api.credentials.internal; + +parcelable DeleteRequest; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/auth/api/credentials/internal/GeneratePasswordRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/auth/api/credentials/internal/GeneratePasswordRequest.aidl new file mode 100644 index 00000000..814f68da --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/auth/api/credentials/internal/GeneratePasswordRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.auth.api.credentials.internal; + +parcelable GeneratePasswordRequest; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/auth/api/credentials/internal/ICredentialsCallbacks.aidl b/play-services-api/src/main/aidl/com/google/android/gms/auth/api/credentials/internal/ICredentialsCallbacks.aidl new file mode 100644 index 00000000..da248c33 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/auth/api/credentials/internal/ICredentialsCallbacks.aidl @@ -0,0 +1,10 @@ +package com.google.android.gms.auth.api.credentials.internal; + +import com.google.android.gms.common.api.Status; +import com.google.android.gms.auth.api.credentials.Credential; + +interface ICredentialsCallbacks { + void onStatusAndCredential(in Status status, in Credential credential) = 0; + void onStatus(in Status status) = 1; + void onStatusAndString(in Status status, String string) = 2; +} \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/auth/api/credentials/internal/ICredentialsService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/auth/api/credentials/internal/ICredentialsService.aidl new file mode 100644 index 00000000..89c6c7e2 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/auth/api/credentials/internal/ICredentialsService.aidl @@ -0,0 +1,15 @@ +package com.google.android.gms.auth.api.credentials.internal; + +import com.google.android.gms.auth.api.credentials.CredentialRequest; +import com.google.android.gms.auth.api.credentials.internal.ICredentialsCallbacks; +import com.google.android.gms.auth.api.credentials.internal.DeleteRequest; +import com.google.android.gms.auth.api.credentials.internal.GeneratePasswordRequest; +import com.google.android.gms.auth.api.credentials.internal.SaveRequest; + +interface ICredentialsService { + void request(ICredentialsCallbacks callbacks, in CredentialRequest request) = 0; + void save(ICredentialsCallbacks callbacks, in SaveRequest request) = 1; + void delete(ICredentialsCallbacks callbacks, in DeleteRequest request) = 2; + void disableAutoSignIn(ICredentialsCallbacks callbacks) = 3; + void generatePassword(ICredentialsCallbacks callbacks, in GeneratePasswordRequest request) = 4; +} \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/auth/api/credentials/internal/SaveRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/auth/api/credentials/internal/SaveRequest.aidl new file mode 100644 index 00000000..b5bcb593 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/auth/api/credentials/internal/SaveRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.auth.api.credentials.internal; + +parcelable SaveRequest; \ No newline at end of file diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/Credential.java b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/Credential.java new file mode 100644 index 00000000..db4b41f7 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/Credential.java @@ -0,0 +1,248 @@ +/* + * Copyright 2013-2016 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.auth.api.credentials; + +import android.net.Uri; +import android.text.TextUtils; + +import org.microg.gms.common.PublicApi; +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +import java.util.Arrays; +import java.util.List; + +@PublicApi +public class Credential extends AutoSafeParcelable { + + @SafeParceled(1000) + private int versionCode = 1; + + @SafeParceled(1) + private String id; + + @SafeParceled(2) + private String name; + + @SafeParceled(3) + private Uri profilePictureUri; + + @SafeParceled(value = 4, subClass = IdToken.class) + private List tokens; + + @SafeParceled(5) + private String password; + + @SafeParceled(6) + private String accountType; + + @SafeParceled(7) + private String generatedPassword; + + private Credential() { + } + + /** + * Returns the type of federated identity account used to sign in the user. While this may be + * any string, it is strongly recommended that values from {@link com.google.android.gms.auth.api.credentials.IdentityProviders} + * are used, which are the login domains for common identity providers. + * + * @return A string identifying the federated identity provider associated with this account, + * typically in the form of the identity provider's login domain. null will be returned if the + * credential is a password credential. + */ + public String getAccountType() { + return accountType; + } + + /** + * Returns the generated password for an account hint. + */ + public String getGeneratedPassword() { + return generatedPassword; + } + + /** + * Returns the credential identifier, typically an email address or user name, though it may + * also be some encoded unique identifier for a federated identity account. + */ + public String getId() { + return id; + } + + /** + * Returns the ID tokens that assert the identity of the user, if available. ID tokens provide + * a secure mechanism to verify that the user owns the identity asserted by the credential. + *

+ * This is useful for account hints, where the ID token can replace the need to separately + * verify that the user owns their claimed email address - with a valid ID token, it is not + * necessary to send an account activation link to the address, simplifying the account + * creation process for the user. + *

+ * A signed ID token is returned automatically for credential hints when the credential ID is a + * Google account that is authenticated on the device. This ID token can be sent along with + * your application's account creation operation, where the signature can be verified. + */ + public List getIdTokens() { + return tokens; + } + + /** + * Returns the display name of the credential, if available. Typically, the display name will + * be the name of the user, or some other string which the user can easily recognize and + * distinguish from other accounts they may have. + */ + public String getName() { + return name; + } + + /** + * Returns the password used to sign in the user. + */ + public String getPassword() { + return password; + } + + /** + * Returns the URL to an image of the user, if available. + */ + public Uri getProfilePictureUri() { + return profilePictureUri; + } + + @PublicApi(exclude = true) + public String getAsString() { + if (TextUtils.isEmpty(accountType)) { + return id.toLowerCase() + "|"; + } else { + Uri uri = Uri.parse(accountType); + return id.toLowerCase() + "|" + (TextUtils.isEmpty(uri.getScheme()) ? "" : uri.getScheme().toLowerCase()) + "://" + + (TextUtils.isEmpty(uri.getHost()) ? "unknown" : uri.getHost().toLowerCase()) + ":" + uri.getPort(); + } + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || !(o instanceof Credential)) return false; + + Credential that = (Credential) o; + + if (id != null ? !id.equals(that.id) : that.id != null) return false; + if (name != null ? !name.equals(that.name) : that.name != null) return false; + if (profilePictureUri != null ? !profilePictureUri.equals(that.profilePictureUri) : that.profilePictureUri != null) + return false; + if (password != null ? !password.equals(that.password) : that.password != null) + return false; + if (accountType != null ? !accountType.equals(that.accountType) : that.accountType != null) + return false; + return generatedPassword != null ? generatedPassword.equals(that.generatedPassword) : that.generatedPassword == null; + + } + + @Override + public int hashCode() { + return Arrays.hashCode(new Object[]{id, name, profilePictureUri, password, accountType, generatedPassword}); + } + + public static class Builder { + private String id; + private String name; + private Uri profilePictureUri; + private String password; + private String accountType; + + @PublicApi(exclude = true) + public List tokens; + @PublicApi(exclude = true) + private String generatedPassword; + + public Builder(String id) { + this.id = id; + } + + /** + * Copies the information stored in an existing credential, in order to allow that information to be modified. + * + * @param credential the existing credential + */ + public Builder(Credential credential) { + this.id = credential.id; + this.name = credential.name; + this.profilePictureUri = credential.profilePictureUri; + this.password = credential.password; + this.accountType = credential.accountType; + this.tokens = credential.tokens; + this.generatedPassword = credential.generatedPassword; + } + + public Credential build() { + Credential credential = new Credential(); + credential.id = id; + credential.name = name; + credential.profilePictureUri = profilePictureUri; + credential.password = password; + credential.accountType = accountType; + credential.tokens = tokens; + credential.generatedPassword = generatedPassword; + return credential; + } + + /** + * Specifies the account type for a federated credential. The value should be set to + * identity provider's login domain, such as "https://accounts.google.com" for Google + * accounts. The login domains for common identity providers are listed in {@link IdentityProviders}. + * + * @param accountType The type of the account. Typically, one of the values in {@link IdentityProviders}. + */ + public Builder setAccountType(String accountType) { + this.accountType = accountType; + return this; + } + + /** + * Sets the display name for the credential, which should be easy for the user to recognize + * as associated to the credential, and distinguishable from other credentials they may + * have. This string will be displayed more prominently than, or instead of, the account ID + * whenever available. In most cases, the name of the user is sufficient. + */ + public Builder setName(String name) { + this.name = name; + return this; + } + + /** + * Sets the password for the credential. Either the password or the account type must be + * set for a credential, but not both. + */ + public Builder setPassword(String password) { + this.password = password; + return this; + } + + /** + * Sets a profile picture associated with the credential, typically a picture the user has + * selected to represent the account. + */ + public Builder setProfilePictureUri(Uri profilePictureUri) { + this.profilePictureUri = profilePictureUri; + return this; + } + } + + public static final Creator CREATOR = new AutoCreator(Credential.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/CredentialPickerConfig.java b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/CredentialPickerConfig.java new file mode 100644 index 00000000..3cd60f62 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/CredentialPickerConfig.java @@ -0,0 +1,92 @@ +/* + * Copyright 2013-2016 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.auth.api.credentials; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class CredentialPickerConfig extends AutoSafeParcelable { + + @SafeParceled(1000) + private int versionCode = 1; + + @SafeParceled(1) + private boolean showAddAccountButton; + + @SafeParceled(2) + private boolean showCancelButton; + + @SafeParceled(3) + private boolean forNewAccount; + + private CredentialPickerConfig() { + } + + public CredentialPickerConfig(boolean showAddAccountButton, boolean showCancelButton, boolean forNewAccount) { + this.showAddAccountButton = showAddAccountButton; + this.showCancelButton = showCancelButton; + this.forNewAccount = forNewAccount; + } + + public boolean isForNewAccount() { + return forNewAccount; + } + + public boolean shouldShowAddAccountButton() { + return showAddAccountButton; + } + + public boolean shouldShowCancelButton() { + return showCancelButton; + } + + public class Builder { + private boolean showAddAccountButton; + private boolean showCancelButton; + private boolean forNewAccount; + + public CredentialPickerConfig build() { + return new CredentialPickerConfig(showAddAccountButton, showCancelButton, forNewAccount); + } + + /** + * Sets whether the hint request is for a new account sign-up flow. + */ + public Builder setForNewAccount(boolean forNewAccount) { + this.forNewAccount = forNewAccount; + return this; + } + + /** + * Sets whether the add account button should be shown in credential picker dialog. + */ + public Builder setShowAddAccountButton(boolean showAddAccountButton) { + this.showAddAccountButton = showAddAccountButton; + return this; + } + + /** + * Sets whether the cancel button should be shown in credential picker dialog. + */ + public Builder setShowCancelButton(boolean showCancelButton) { + this.showCancelButton = showCancelButton; + return this; + } + } + + public static final Creator CREATOR = new AutoCreator(CredentialPickerConfig.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/CredentialRequest.java b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/CredentialRequest.java new file mode 100644 index 00000000..632ae5f6 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/CredentialRequest.java @@ -0,0 +1,75 @@ +/* + * Copyright 2013-2016 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.auth.api.credentials; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +/** + * Parameters for requesting a Credential, via Auth.CredentialsApi.request(). Instances can be + * created using CredentialRequest.Builder. + */ +public class CredentialRequest extends AutoSafeParcelable { + + @SafeParceled(1000) + private int versionCode = 1; + + @SafeParceled(1) + private boolean passwordLoginSupported; + + @SafeParceled(2) + private String[] accountTypes; + + @SafeParceled(3) + private CredentialPickerConfig credentialPickerConfig; + + @SafeParceled(4) + private CredentialPickerConfig credentialHintPickerConfig; + + public CredentialRequest(boolean passwordLoginSupported, String[] accountTypes, CredentialPickerConfig credentialPickerConfig, CredentialPickerConfig credentialHintPickerConfig) { + this.passwordLoginSupported = passwordLoginSupported; + this.accountTypes = accountTypes; + this.credentialPickerConfig = credentialPickerConfig; + this.credentialHintPickerConfig = credentialHintPickerConfig; + } + + public String[] getAccountTypes() { + return accountTypes; + } + + public CredentialPickerConfig getCredentialHintPickerConfig() { + return credentialHintPickerConfig; + } + + public CredentialPickerConfig getCredentialPickerConfig() { + return credentialPickerConfig; + } + + /** + * @deprecated Use {@link #isPasswordLoginSupported()} + */ + @Deprecated + public boolean getSupportsPasswordLogin() { + return isPasswordLoginSupported(); + } + + public boolean isPasswordLoginSupported() { + return passwordLoginSupported; + } + + public static final Creator CREATOR = new AutoCreator(CredentialRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/IdToken.java b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/IdToken.java new file mode 100644 index 00000000..497ee887 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/IdToken.java @@ -0,0 +1,58 @@ +/* + * Copyright 2013-2016 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.auth.api.credentials; + +import org.microg.gms.common.PublicApi; +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +@PublicApi +public class IdToken extends AutoSafeParcelable { + + @SafeParceled(1000) + private int versionCode = 1; + + @SafeParceled(1) + private String accountType; + + @SafeParceled(2) + private String id; + + private IdToken() { + } + + public IdToken(String accountType, String id) { + this.accountType = accountType; + this.id = id; + } + + /** + * Returns {@code AccountManager} account type for the token. + */ + public String getAccountType() { + return accountType; + } + + /** + * Returns the ID token, formatted according to the rules defined by the account type. + */ + public String getIdToken() { + return id; + } + + public static final Creator CREATOR = new AutoCreator(IdToken.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/internal/DeleteRequest.java b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/internal/DeleteRequest.java new file mode 100644 index 00000000..973c1854 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/internal/DeleteRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2016 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.auth.api.credentials.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class DeleteRequest extends AutoSafeParcelable { + public static final Creator CREATOR = new AutoCreator(DeleteRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/internal/GeneratePasswordRequest.java b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/internal/GeneratePasswordRequest.java new file mode 100644 index 00000000..b412bd50 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/internal/GeneratePasswordRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2016 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.auth.api.credentials.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class GeneratePasswordRequest extends AutoSafeParcelable { + public static final Creator CREATOR = new AutoCreator(GeneratePasswordRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/internal/SaveRequest.java b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/internal/SaveRequest.java new file mode 100644 index 00000000..d028e30f --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/internal/SaveRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2016 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.auth.api.credentials.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class SaveRequest extends AutoSafeParcelable { + public static final Creator CREATOR = new AutoCreator(SaveRequest.class); +} diff --git a/play-services-basement/build.gradle b/play-services-basement/build.gradle index 796ea36c..38d7eb7f 100644 --- a/play-services-basement/build.gradle +++ b/play-services-basement/build.gradle @@ -14,15 +14,6 @@ * limitations under the License. */ -buildscript { - repositories { - jcenter() - } - dependencies { - classpath 'com.android.tools.build:gradle:2.1.2' - } -} - apply plugin: 'com.android.library' String getMyVersionName() { @@ -40,8 +31,8 @@ group = 'org.microg' version = getMyVersionName() android { - compileSdkVersion 23 - buildToolsVersion "23.0.3" + compileSdkVersion androidCompileSdk() + buildToolsVersion "$androidBuildVersionTools" aidlPackageWhiteList "com/google/android/gms/common/internal/ICancelToken.aidl" aidlPackageWhiteList "com/google/android/gms/dynamic/IObjectWrapper.aidl" diff --git a/play-services-basement/src/main/java/com/google/android/gms/common/data/DataHolder.java b/play-services-basement/src/main/java/com/google/android/gms/common/data/DataHolder.java index 51a4a602..e749abfd 100644 --- a/play-services-basement/src/main/java/com/google/android/gms/common/data/DataHolder.java +++ b/play-services-basement/src/main/java/com/google/android/gms/common/data/DataHolder.java @@ -61,7 +61,7 @@ public class DataHolder extends AutoSafeParcelable implements Closeable { private final Bundle metadata; private boolean closed = false; - private Map columnIndizes; + private Map columnIndices; protected static final int FIELD_TYPE_NULL = 0; protected static final int FIELD_TYPE_INTEGER = 1; @@ -300,12 +300,6 @@ public class DataHolder extends AutoSafeParcelable implements Closeable { return windows.toArray(new CursorWindow[windows.size()]); } - @PublicApi(exclude = true) - @Deprecated - public static DataHolder fromCursor(Cursor cursor, int statusCode, Bundle metadata) { - return new DataHolder(cursor, statusCode, metadata); - } - /** * Retrieves the boolean value for a given column at the provided position. * This will throw an {@link IllegalArgumentException} if the column does not exist, the @@ -317,7 +311,7 @@ public class DataHolder extends AutoSafeParcelable implements Closeable { * @return The boolean value in that column. */ public boolean getBoolean(String column, int row, int windowIndex) { - return windows[windowIndex].getLong(row, columnIndizes.get(column)) == 1; + return windows[windowIndex].getLong(row, columnIndices.get(column)) == 1; } /** @@ -331,7 +325,7 @@ public class DataHolder extends AutoSafeParcelable implements Closeable { * @return The byte array value in that column. */ public byte[] getByteArray(String column, int row, int windowIndex) { - return windows[windowIndex].getBlob(row, columnIndizes.get(column)); + return windows[windowIndex].getBlob(row, columnIndices.get(column)); } /** @@ -360,7 +354,7 @@ public class DataHolder extends AutoSafeParcelable implements Closeable { * @return The integer value in that column. */ public int getInteger(String column, int row, int windowIndex) { - return windows[windowIndex].getInt(row, columnIndizes.get(column)); + return windows[windowIndex].getInt(row, columnIndices.get(column)); } /** @@ -374,7 +368,7 @@ public class DataHolder extends AutoSafeParcelable implements Closeable { * @return The long value in that column. */ public long getLong(String column, int row, int windowIndex) { - return windows[windowIndex].getLong(row, columnIndizes.get(column)); + return windows[windowIndex].getLong(row, columnIndices.get(column)); } public int getStatusCode() { @@ -392,7 +386,7 @@ public class DataHolder extends AutoSafeParcelable implements Closeable { * @return The string value in that column. */ public String getString(String column, int row, int windowIndex) { - return windows[windowIndex].getString(row, columnIndizes.get(column)); + return windows[windowIndex].getString(row, columnIndices.get(column)); } /** @@ -406,7 +400,7 @@ public class DataHolder extends AutoSafeParcelable implements Closeable { * @return Whether the column value is null at this position. */ public boolean isNull(String column, int row, int windowIndex) { - return windows[windowIndex].isNull(row, columnIndizes.get(column)); + return windows[windowIndex].isNull(row, columnIndices.get(column)); } public boolean isClosed() { @@ -442,9 +436,9 @@ public class DataHolder extends AutoSafeParcelable implements Closeable { } public void validateContents() { - columnIndizes = new HashMap(); + columnIndices = new HashMap(); for (int i = 0; i < columns.length; i++) { - columnIndizes.put(columns[i], i); + columnIndices.put(columns[i], i); } } diff --git a/play-services-cast-api/build.gradle b/play-services-cast-api/build.gradle index 3ce1445d..b4ddb5c3 100644 --- a/play-services-cast-api/build.gradle +++ b/play-services-cast-api/build.gradle @@ -14,15 +14,6 @@ * limitations under the License. */ -buildscript { - repositories { - jcenter() - } - dependencies { - classpath 'com.android.tools.build:gradle:2.1.2' - } -} - apply plugin: 'com.android.library' String getMyVersionName() { @@ -38,8 +29,8 @@ group = 'org.microg' version = getMyVersionName() android { - compileSdkVersion 23 - buildToolsVersion "23.0.3" + compileSdkVersion androidCompileSdk() + buildToolsVersion "$androidBuildVersionTools" defaultConfig { versionName getMyVersionName() diff --git a/play-services-iid-api/build.gradle b/play-services-iid-api/build.gradle index 3ce1445d..b4ddb5c3 100644 --- a/play-services-iid-api/build.gradle +++ b/play-services-iid-api/build.gradle @@ -14,15 +14,6 @@ * limitations under the License. */ -buildscript { - repositories { - jcenter() - } - dependencies { - classpath 'com.android.tools.build:gradle:2.1.2' - } -} - apply plugin: 'com.android.library' String getMyVersionName() { @@ -38,8 +29,8 @@ group = 'org.microg' version = getMyVersionName() android { - compileSdkVersion 23 - buildToolsVersion "23.0.3" + compileSdkVersion androidCompileSdk() + buildToolsVersion "$androidBuildVersionTools" defaultConfig { versionName getMyVersionName() diff --git a/play-services-location-api/build.gradle b/play-services-location-api/build.gradle index 3ce1445d..b4ddb5c3 100644 --- a/play-services-location-api/build.gradle +++ b/play-services-location-api/build.gradle @@ -14,15 +14,6 @@ * limitations under the License. */ -buildscript { - repositories { - jcenter() - } - dependencies { - classpath 'com.android.tools.build:gradle:2.1.2' - } -} - apply plugin: 'com.android.library' String getMyVersionName() { @@ -38,8 +29,8 @@ group = 'org.microg' version = getMyVersionName() android { - compileSdkVersion 23 - buildToolsVersion "23.0.3" + compileSdkVersion androidCompileSdk() + buildToolsVersion "$androidBuildVersionTools" defaultConfig { versionName getMyVersionName() diff --git a/play-services-wearable-api/build.gradle b/play-services-wearable-api/build.gradle index 3ce1445d..b4ddb5c3 100644 --- a/play-services-wearable-api/build.gradle +++ b/play-services-wearable-api/build.gradle @@ -14,15 +14,6 @@ * limitations under the License. */ -buildscript { - repositories { - jcenter() - } - dependencies { - classpath 'com.android.tools.build:gradle:2.1.2' - } -} - apply plugin: 'com.android.library' String getMyVersionName() { @@ -38,8 +29,8 @@ group = 'org.microg' version = getMyVersionName() android { - compileSdkVersion 23 - buildToolsVersion "23.0.3" + compileSdkVersion androidCompileSdk() + buildToolsVersion "$androidBuildVersionTools" defaultConfig { versionName getMyVersionName() From 4d8fb82ae557562e557a4984583b0d32f55b2b34 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Sat, 27 Aug 2016 12:35:01 +0200 Subject: [PATCH 175/293] Update Gradle --- .gitignore | 1 - build.gradle | 38 ++++++++++++++++++++++++ gradle/wrapper/gradle-wrapper.properties | 2 +- microg-ui-tools/build.gradle | 12 ++------ 4 files changed, 41 insertions(+), 12 deletions(-) create mode 100644 build.gradle diff --git a/.gitignore b/.gitignore index 7ee5ca07..d84bc0b7 100644 --- a/.gitignore +++ b/.gitignore @@ -3,5 +3,4 @@ build/ local.properties *.iml .idea/ -build.gradle BuildConfig.java diff --git a/build.gradle b/build.gradle new file mode 100644 index 00000000..4b3b586b --- /dev/null +++ b/build.gradle @@ -0,0 +1,38 @@ +/* + * Copyright 2013-2016 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. + */ + +buildscript { + repositories { + jcenter() + } + dependencies { + classpath 'com.android.tools.build:gradle:2.1.3' + classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1' + } +} + +allprojects { + apply plugin: 'idea' + ext.androidBuildVersionTools = "23.0.3" +} + +def androidCompileSdk() { return 23 } + +subprojects { + repositories { + jcenter() + } +} diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index aa76e3eb..06df1f78 100755 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.12-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip diff --git a/microg-ui-tools/build.gradle b/microg-ui-tools/build.gradle index ea1ec07b..c3cac8ab 100644 --- a/microg-ui-tools/build.gradle +++ b/microg-ui-tools/build.gradle @@ -14,14 +14,6 @@ * limitations under the License. */ -buildscript { - repositories { - jcenter() - } - dependencies { - classpath 'com.android.tools.build:gradle:2.1.2' - } -} apply plugin: 'com.android.library' String getMyVersionName() { @@ -34,8 +26,8 @@ String getMyVersionName() { } android { - compileSdkVersion 23 - buildToolsVersion "23.0.3" + compileSdkVersion androidCompileSdk() + buildToolsVersion "$androidBuildVersionTools" defaultConfig { versionName getMyVersionName() From c450e2d8adc859972cde572d908193fe6ba73a5b Mon Sep 17 00:00:00 2001 From: Marvin W Date: Sat, 27 Aug 2016 12:46:12 +0200 Subject: [PATCH 176/293] Update Gradle and Sublib --- build.gradle | 19 +++++++++++++++++-- extern/GmsApi | 2 +- gradle/wrapper/gradle-wrapper.properties | 2 +- play-services-base/build.gradle | 13 ++----------- play-services-cast/build.gradle | 13 ++----------- play-services-gcm/build.gradle | 13 ++----------- play-services-iid/build.gradle | 13 ++----------- play-services-location/build.gradle | 13 ++----------- play-services-tasks/build.gradle | 13 ++----------- play-services-wearable/build.gradle | 13 ++----------- play-services/build.gradle | 13 ++----------- 11 files changed, 35 insertions(+), 92 deletions(-) diff --git a/build.gradle b/build.gradle index 7fbd598a..635996ac 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 microG Project Team + * Copyright 2013-2016 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. @@ -14,7 +14,22 @@ * limitations under the License. */ -// Top-level build file where you can add configuration options common to all sub-projects/modules. +buildscript { + repositories { + jcenter() + } + dependencies { + classpath 'com.android.tools.build:gradle:2.1.3' + classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1' + } +} + +allprojects { + apply plugin: 'idea' + ext.androidBuildVersionTools = "23.0.3" +} + +def androidCompileSdk() { return 23 } subprojects { group = 'org.microg' diff --git a/extern/GmsApi b/extern/GmsApi index b9cb95d3..c6f5d258 160000 --- a/extern/GmsApi +++ b/extern/GmsApi @@ -1 +1 @@ -Subproject commit b9cb95d39bdb4bbac6dd0d2b0405e4d5a23717c2 +Subproject commit c6f5d25850d86a78119c0175678c81178b0500e1 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 90babf29..2b30f04c 100755 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -19,4 +19,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.12-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip diff --git a/play-services-base/build.gradle b/play-services-base/build.gradle index a2d4f921..83a0d2c3 100644 --- a/play-services-base/build.gradle +++ b/play-services-base/build.gradle @@ -14,15 +14,6 @@ * limitations under the License. */ -buildscript { - repositories { - jcenter() - } - dependencies { - classpath 'com.android.tools.build:gradle:2.1.2' - } -} - apply plugin: 'com.android.library' String getMyVersionName() { @@ -35,8 +26,8 @@ String getMyVersionName() { } android { - compileSdkVersion 23 - buildToolsVersion "23.0.3" + compileSdkVersion androidCompileSdk() + buildToolsVersion "$androidBuildVersionTools" defaultConfig { versionName getMyVersionName() diff --git a/play-services-cast/build.gradle b/play-services-cast/build.gradle index a407e8b6..88b18fc3 100644 --- a/play-services-cast/build.gradle +++ b/play-services-cast/build.gradle @@ -14,15 +14,6 @@ * limitations under the License. */ -buildscript { - repositories { - jcenter() - } - dependencies { - classpath 'com.android.tools.build:gradle:2.1.2' - } -} - apply plugin: 'com.android.library' String getMyVersionName() { @@ -35,8 +26,8 @@ String getMyVersionName() { } android { - compileSdkVersion 23 - buildToolsVersion "23.0.3" + compileSdkVersion androidCompileSdk() + buildToolsVersion "$androidBuildVersionTools" defaultConfig { versionName getMyVersionName() diff --git a/play-services-gcm/build.gradle b/play-services-gcm/build.gradle index c9b0c102..64aaf2db 100644 --- a/play-services-gcm/build.gradle +++ b/play-services-gcm/build.gradle @@ -14,15 +14,6 @@ * limitations under the License. */ -buildscript { - repositories { - jcenter() - } - dependencies { - classpath 'com.android.tools.build:gradle:2.1.2' - } -} - apply plugin: 'com.android.library' String getMyVersionName() { @@ -35,8 +26,8 @@ String getMyVersionName() { } android { - compileSdkVersion 23 - buildToolsVersion "23.0.3" + compileSdkVersion androidCompileSdk() + buildToolsVersion "$androidBuildVersionTools" defaultConfig { versionName getMyVersionName() diff --git a/play-services-iid/build.gradle b/play-services-iid/build.gradle index d3d6661c..4975b16e 100644 --- a/play-services-iid/build.gradle +++ b/play-services-iid/build.gradle @@ -14,15 +14,6 @@ * limitations under the License. */ -buildscript { - repositories { - jcenter() - } - dependencies { - classpath 'com.android.tools.build:gradle:2.1.2' - } -} - apply plugin: 'com.android.library' String getMyVersionName() { @@ -35,8 +26,8 @@ String getMyVersionName() { } android { - compileSdkVersion 23 - buildToolsVersion "23.0.3" + compileSdkVersion androidCompileSdk() + buildToolsVersion "$androidBuildVersionTools" defaultConfig { versionName getMyVersionName() diff --git a/play-services-location/build.gradle b/play-services-location/build.gradle index 4a211cf9..1ba77d1a 100644 --- a/play-services-location/build.gradle +++ b/play-services-location/build.gradle @@ -14,15 +14,6 @@ * limitations under the License. */ -buildscript { - repositories { - jcenter() - } - dependencies { - classpath 'com.android.tools.build:gradle:2.1.2' - } -} - apply plugin: 'com.android.library' String getMyVersionName() { @@ -35,8 +26,8 @@ String getMyVersionName() { } android { - compileSdkVersion 23 - buildToolsVersion "23.0.3" + compileSdkVersion androidCompileSdk() + buildToolsVersion "$androidBuildVersionTools" defaultConfig { versionName getMyVersionName() diff --git a/play-services-tasks/build.gradle b/play-services-tasks/build.gradle index d80b1829..0dc4acc2 100644 --- a/play-services-tasks/build.gradle +++ b/play-services-tasks/build.gradle @@ -14,15 +14,6 @@ * limitations under the License. */ -buildscript { - repositories { - jcenter() - } - dependencies { - classpath 'com.android.tools.build:gradle:2.1.2' - } -} - apply plugin: 'com.android.library' String getMyVersionName() { @@ -35,8 +26,8 @@ String getMyVersionName() { } android { - compileSdkVersion 23 - buildToolsVersion "23.0.3" + compileSdkVersion androidCompileSdk() + buildToolsVersion "$androidBuildVersionTools" defaultConfig { versionName getMyVersionName() diff --git a/play-services-wearable/build.gradle b/play-services-wearable/build.gradle index d5ad389a..249b5b1b 100644 --- a/play-services-wearable/build.gradle +++ b/play-services-wearable/build.gradle @@ -14,15 +14,6 @@ * limitations under the License. */ -buildscript { - repositories { - jcenter() - } - dependencies { - classpath 'com.android.tools.build:gradle:2.1.2' - } -} - apply plugin: 'com.android.library' String getMyVersionName() { @@ -35,8 +26,8 @@ String getMyVersionName() { } android { - compileSdkVersion 23 - buildToolsVersion "23.0.3" + compileSdkVersion androidCompileSdk() + buildToolsVersion "$androidBuildVersionTools" defaultConfig { versionName getMyVersionName() diff --git a/play-services/build.gradle b/play-services/build.gradle index 323f81c6..c1a7d6dd 100644 --- a/play-services/build.gradle +++ b/play-services/build.gradle @@ -14,15 +14,6 @@ * limitations under the License. */ -buildscript { - repositories { - jcenter() - } - dependencies { - classpath 'com.android.tools.build:gradle:2.1.2' - } -} - apply plugin: 'com.android.library' String getMyVersionName() { @@ -35,8 +26,8 @@ String getMyVersionName() { } android { - compileSdkVersion 23 - buildToolsVersion "23.0.3" + compileSdkVersion androidCompileSdk() + buildToolsVersion "$androidBuildVersionTools" defaultConfig { versionName getMyVersionName() From 7f5440d36edb9aff7c4af6790ced8d861288153c Mon Sep 17 00:00:00 2001 From: Marvin W Date: Fri, 16 Sep 2016 23:03:59 +0200 Subject: [PATCH 177/293] Add Firebase auth api --- .../firebase/auth/api/internal/IFirebaseAuthService.aidl | 5 +++++ .../main/java/com/google/android/gms/common/api/Status.java | 2 ++ 2 files changed, 7 insertions(+) create mode 100644 play-services-api/src/main/aidl/com/google/firebase/auth/api/internal/IFirebaseAuthService.aidl diff --git a/play-services-api/src/main/aidl/com/google/firebase/auth/api/internal/IFirebaseAuthService.aidl b/play-services-api/src/main/aidl/com/google/firebase/auth/api/internal/IFirebaseAuthService.aidl new file mode 100644 index 00000000..6269896b --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/firebase/auth/api/internal/IFirebaseAuthService.aidl @@ -0,0 +1,5 @@ +package com.google.firebase.auth.api.internal; + +interface IFirebaseAuthService { + +} \ No newline at end of file diff --git a/play-services-basement/src/main/java/com/google/android/gms/common/api/Status.java b/play-services-basement/src/main/java/com/google/android/gms/common/api/Status.java index 480ea072..7c225820 100644 --- a/play-services-basement/src/main/java/com/google/android/gms/common/api/Status.java +++ b/play-services-basement/src/main/java/com/google/android/gms/common/api/Status.java @@ -28,9 +28,11 @@ import org.microg.safeparcel.AutoSafeParcelable; */ @PublicApi public final class Status extends AutoSafeParcelable implements Result { + private static final int STATUS_CODE_INTERNAL_ERROR = 8; private static final int STATUS_CODE_INTERRUPTED = 14; private static final int STATUS_CODE_CANCELED = 16; + public static final Status INTERNAL_ERROR = new Status(STATUS_CODE_INTERNAL_ERROR); public static final Status INTERRUPTED = new Status(STATUS_CODE_INTERRUPTED); public static final Status CANCELED = new Status(STATUS_CODE_CANCELED); public static final Status SUCCESS = new Status(0); From 351a4b861594ca25eed5f7a921888563e0fece51 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Fri, 16 Sep 2016 23:05:05 +0200 Subject: [PATCH 178/293] Update Log events --- .../gms/clearcut/LogEventParcelable.java | 81 ++++++++++++++++++- .../playlog/internal/PlayLoggerContext.java | 52 +++++++++--- 2 files changed, 120 insertions(+), 13 deletions(-) diff --git a/play-services-api/src/main/java/com/google/android/gms/clearcut/LogEventParcelable.java b/play-services-api/src/main/java/com/google/android/gms/clearcut/LogEventParcelable.java index 4b041a6f..897a5e86 100644 --- a/play-services-api/src/main/java/com/google/android/gms/clearcut/LogEventParcelable.java +++ b/play-services-api/src/main/java/com/google/android/gms/clearcut/LogEventParcelable.java @@ -16,10 +16,89 @@ package com.google.android.gms.clearcut; +import android.util.Base64; + +import com.google.android.gms.playlog.internal.PlayLoggerContext; + import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +import java.nio.ByteBuffer; +import java.nio.CharBuffer; +import java.nio.charset.Charset; +import java.nio.charset.CharsetDecoder; +import java.util.Arrays; public class LogEventParcelable extends AutoSafeParcelable { - // TODO + @SafeParceled(1) + private int versionCode = 1; + + @SafeParceled(2) + public final PlayLoggerContext context; + + @SafeParceled(3) + public final byte[] bytes; + + @SafeParceled(4) + public final int[] testCodes; + + @SafeParceled(5) + public final String[] mendelPackages; + + @SafeParceled(6) + public final int[] experimentIds; + + @SafeParceled(7) + public final byte[][] experimentTokens; + + @SafeParceled(8) + public final boolean addPhenotypeExperimentTokens; + + private LogEventParcelable() { + context = null; + bytes = null; + testCodes = experimentIds = null; + mendelPackages = null; + experimentTokens = null; + addPhenotypeExperimentTokens = false; + } + + public LogEventParcelable(PlayLoggerContext context, byte[] bytes, int[] testCodes, String[] mendelPackages, int[] experimentIds, byte[][] experimentTokens, boolean addPhenotypeExperimentTokens) { + this.context = context; + this.bytes = bytes; + this.testCodes = testCodes; + this.mendelPackages = mendelPackages; + this.experimentIds = experimentIds; + this.experimentTokens = experimentTokens; + this.addPhenotypeExperimentTokens = addPhenotypeExperimentTokens; + } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder("LogEventParcelable[") + .append(versionCode).append(", ").append(context) + .append(", LogEventBytes: ").append(getBytesAsString()); + if (testCodes != null) sb.append(", TestCodes: ").append(Arrays.toString(testCodes)); + if (mendelPackages != null) + sb.append(", MendelPackages: ").append(Arrays.toString(mendelPackages)); + if (experimentIds != null) + sb.append(", ExperimentIds: ").append(Arrays.toString(experimentIds)); + if (experimentTokens != null) + sb.append(", ExperimentTokens: ").append(Arrays.toString(experimentTokens)); + return sb.append(", AddPhenotypeExperimentTokens: ").append(addPhenotypeExperimentTokens) + .append(']').toString(); + } + + private String getBytesAsString() { + if (bytes == null) return "null"; + try { + CharsetDecoder d = Charset.forName("US-ASCII").newDecoder(); + CharBuffer r = d.decode(ByteBuffer.wrap(bytes)); + return r.toString(); + } catch (Exception e) { + return Base64.encodeToString(bytes, Base64.NO_WRAP); + } + } public static final Creator CREATOR = new AutoCreator(LogEventParcelable.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/playlog/internal/PlayLoggerContext.java b/play-services-api/src/main/java/com/google/android/gms/playlog/internal/PlayLoggerContext.java index ce6818db..065ba239 100644 --- a/play-services-api/src/main/java/com/google/android/gms/playlog/internal/PlayLoggerContext.java +++ b/play-services-api/src/main/java/com/google/android/gms/playlog/internal/PlayLoggerContext.java @@ -27,6 +27,9 @@ public class PlayLoggerContext extends AutoSafeParcelable { @SafeParceled(2) public final String packageName; + @SafeParceled(3) + public final int packageVersionCode; + @SafeParceled(4) public final int logSource; @@ -42,31 +45,56 @@ public class PlayLoggerContext extends AutoSafeParcelable { @SafeParceled(8) public final String logSourceName; + @SafeParceled(9) + public final boolean isAnonymous; + + @SafeParceled(10) + public final int qosTier; + private PlayLoggerContext() { packageName = uploadAccount = logSourceName = null; - logSource = loggingId = -1; - logAndroidId = false; + qosTier = packageVersionCode = logSource = loggingId = -1; + isAnonymous = logAndroidId = false; } - public PlayLoggerContext(String packageName, int logSource, String uploadAccount, int loggingId, String logSourceName) { + public PlayLoggerContext(String packageName, int packageVersionCode, int logSource, String uploadAccount, int loggingId, boolean logAndroidId) { this.packageName = packageName; + this.packageVersionCode = packageVersionCode; this.logSource = logSource; + this.logSourceName = null; this.uploadAccount = uploadAccount; this.loggingId = loggingId; + this.logAndroidId = logAndroidId; + this.isAnonymous = false; + this.qosTier = 0; + } + + public PlayLoggerContext(String packageName, int packageVersionCode, int logSource, String logSourceName, String uploadAccount, int loggingId, boolean isAnonymous, int qosTier) { + this.packageName = packageName; + this.packageVersionCode = packageVersionCode; + this.logSource = logSource; this.logSourceName = logSourceName; - this.logAndroidId = true; + this.uploadAccount = uploadAccount; + this.loggingId = loggingId; + this.logAndroidId = !isAnonymous; + this.isAnonymous = isAnonymous; + this.qosTier = qosTier; } @Override public String toString() { - return "PlayLoggerContext{" + - "packageName='" + packageName + '\'' + - ", logSource=" + logSource + - ", uploadAccount='" + uploadAccount + '\'' + - ", loggingId=" + loggingId + - ", logAndroidId=" + logAndroidId + - ", logSourceName='" + logSourceName + '\'' + - '}'; + final StringBuilder sb = new StringBuilder("PlayLoggerContext[").append(versionCode); + sb.append(", package=").append(packageName); + sb.append(", packageVersionCode=").append(packageVersionCode); + sb.append(", logSource=").append(logSource); + sb.append(", uploadAccount=").append(uploadAccount); + sb.append(", loggingId=").append(loggingId); + sb.append(", logAndroidId=").append(logAndroidId); + sb.append(", logSourceName=").append(logSourceName); + sb.append(", isAnonymous=").append(isAnonymous); + sb.append(", qosTier=").append(qosTier); + sb.append(']'); + return sb.toString(); } public static Creator CREATOR = new AutoCreator(PlayLoggerContext.class); From 18da23b48289427f060af75adde627dcc1401f00 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Fri, 16 Sep 2016 23:05:21 +0200 Subject: [PATCH 179/293] Add SafetyNet API --- .../gms/safetynet/AttestationData.aidl | 3 ++ .../gms/safetynet/HarmfulAppsData.aidl | 3 ++ .../gms/safetynet/SafeBrowsingData.aidl | 3 ++ .../internal/ISafetyNetCallbacks.aidl | 14 +++++++ .../safetynet/internal/ISafetyNetService.aidl | 11 +++++ .../gms/safetynet/AttestationData.java | 41 +++++++++++++++++++ .../gms/safetynet/HarmfulAppsData.java | 23 +++++++++++ .../gms/safetynet/SafeBrowsingData.java | 33 +++++++++++++++ 8 files changed, 131 insertions(+) create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/safetynet/AttestationData.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/safetynet/HarmfulAppsData.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/safetynet/SafeBrowsingData.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/safetynet/internal/ISafetyNetCallbacks.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/safetynet/internal/ISafetyNetService.aidl create mode 100644 play-services-api/src/main/java/com/google/android/gms/safetynet/AttestationData.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/safetynet/HarmfulAppsData.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/safetynet/SafeBrowsingData.java diff --git a/play-services-api/src/main/aidl/com/google/android/gms/safetynet/AttestationData.aidl b/play-services-api/src/main/aidl/com/google/android/gms/safetynet/AttestationData.aidl new file mode 100644 index 00000000..f1e056b4 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/safetynet/AttestationData.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.safetynet; + +parcelable AttestationData; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/safetynet/HarmfulAppsData.aidl b/play-services-api/src/main/aidl/com/google/android/gms/safetynet/HarmfulAppsData.aidl new file mode 100644 index 00000000..9e5456b0 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/safetynet/HarmfulAppsData.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.safetynet; + +parcelable HarmfulAppsData; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/safetynet/SafeBrowsingData.aidl b/play-services-api/src/main/aidl/com/google/android/gms/safetynet/SafeBrowsingData.aidl new file mode 100644 index 00000000..5b18294d --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/safetynet/SafeBrowsingData.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.safetynet; + +parcelable SafeBrowsingData; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/safetynet/internal/ISafetyNetCallbacks.aidl b/play-services-api/src/main/aidl/com/google/android/gms/safetynet/internal/ISafetyNetCallbacks.aidl new file mode 100644 index 00000000..fe57be6d --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/safetynet/internal/ISafetyNetCallbacks.aidl @@ -0,0 +1,14 @@ +package com.google.android.gms.safetynet.internal; + +import com.google.android.gms.common.api.Status; +import com.google.android.gms.safetynet.AttestationData; +import com.google.android.gms.safetynet.HarmfulAppsData; +import com.google.android.gms.safetynet.SafeBrowsingData; + +interface ISafetyNetCallbacks { + void onAttestationData(in Status status, in AttestationData attestationData) = 0; + void onString(String s) = 1; + void onSafeBrowsingData(in Status status, in SafeBrowsingData safeBrowsingData) = 2; + void onBoolean(in Status status, boolean b) = 3; + void onHarmfulAppsData(in Status status, in List harmfulAppsData) = 4; +} \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/safetynet/internal/ISafetyNetService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/safetynet/internal/ISafetyNetService.aidl new file mode 100644 index 00000000..9e23438a --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/safetynet/internal/ISafetyNetService.aidl @@ -0,0 +1,11 @@ +package com.google.android.gms.safetynet.internal; + +import com.google.android.gms.safetynet.internal.ISafetyNetCallbacks; + +interface ISafetyNetService { + void attest(ISafetyNetCallbacks callbacks, in byte[] nonce) = 0; + void getSharedUuid(ISafetyNetCallbacks callbacks) = 1; + void lookupUri(ISafetyNetCallbacks callbacks, String s1, in int[] threatTypes, int i, String s2) = 2; + void init(ISafetyNetCallbacks callbacks) = 3; + void unknown4(ISafetyNetCallbacks callbacks) = 4; +} \ No newline at end of file diff --git a/play-services-api/src/main/java/com/google/android/gms/safetynet/AttestationData.java b/play-services-api/src/main/java/com/google/android/gms/safetynet/AttestationData.java new file mode 100644 index 00000000..91350258 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/safetynet/AttestationData.java @@ -0,0 +1,41 @@ +/* + * Copyright 2013-2016 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.safetynet; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class AttestationData extends AutoSafeParcelable { + @SafeParceled(1) + private int versionCode = 1; + @SafeParceled(2) + private final String jwsResult; + + private AttestationData() { + jwsResult = null; + } + + public AttestationData(String jwsResult) { + this.jwsResult = jwsResult; + } + + public String getJwsResult() { + return jwsResult; + } + + public static final Creator CREATOR = new AutoCreator(AttestationData.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/safetynet/HarmfulAppsData.java b/play-services-api/src/main/java/com/google/android/gms/safetynet/HarmfulAppsData.java new file mode 100644 index 00000000..4837d67c --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/safetynet/HarmfulAppsData.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2016 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.safetynet; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class HarmfulAppsData extends AutoSafeParcelable { + public static final Creator CREATOR = new AutoCreator(HarmfulAppsData.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/safetynet/SafeBrowsingData.java b/play-services-api/src/main/java/com/google/android/gms/safetynet/SafeBrowsingData.java new file mode 100644 index 00000000..ee869f75 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/safetynet/SafeBrowsingData.java @@ -0,0 +1,33 @@ +/* + * Copyright 2013-2016 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.safetynet; + +import com.google.android.gms.common.data.DataHolder; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class SafeBrowsingData extends AutoSafeParcelable { + @SafeParceled(1) + private int versionCode = 1; + @SafeParceled(2) + private String status; + @SafeParceled(3) + private DataHolder data; + + public static final Creator CREATOR = new AutoCreator(SafeBrowsingData.class); +} From a421ff5d950714554200ce4bddb1e8e94cce4655 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Sat, 24 Sep 2016 20:37:20 +0200 Subject: [PATCH 180/293] Add Global Search API classes, use SafeParcel from maven --- .gitmodules | 3 - extern/SafeParcel | 1 - .../IGooglePlaceDetectionService.aidl | 5 ++ .../places/internal/IGooglePlacesService.aidl | 5 ++ .../GetCurrentExperimentIdsRequest.aidl | 3 + .../GetCurrentExperimentIdsResponse.aidl | 3 + .../global/GetGlobalSearchSourcesRequest.aidl | 3 + .../GetGlobalSearchSourcesResponse.aidl | 3 + .../GetPendingExperimentIdsRequest.aidl | 3 + .../GetPendingExperimentIdsResponse.aidl | 3 + .../global/SetExperimentIdsRequest.aidl | 3 + .../global/SetExperimentIdsResponse.aidl | 3 + .../SetIncludeInGlobalSearchRequest.aidl | 3 + .../SetIncludeInGlobalSearchResponse.aidl | 3 + .../internal/IGlobalSearchAdminCallbacks.aidl | 16 +++++ .../internal/IGlobalSearchAdminService.aidl | 14 ++++- .../GetCurrentExperimentIdsRequest.java | 28 +++++++++ .../GetCurrentExperimentIdsResponse.java | 57 ++++++++++++++++++ .../global/GetGlobalSearchSourcesRequest.java | 39 ++++++++++++ .../GetGlobalSearchSourcesResponse.java | 59 +++++++++++++++++++ .../GetPendingExperimentIdsRequest.java | 28 +++++++++ .../GetPendingExperimentIdsResponse.java | 57 ++++++++++++++++++ .../global/SetExperimentIdsRequest.java | 45 ++++++++++++++ .../global/SetExperimentIdsResponse.java | 49 +++++++++++++++ .../SetIncludeInGlobalSearchRequest.java | 47 +++++++++++++++ .../SetIncludeInGlobalSearchResponse.java | 49 +++++++++++++++ play-services-basement/build.gradle | 2 +- .../org/microg/gms/common/GmsService.java | 2 +- safe-parcel | 1 - 29 files changed, 529 insertions(+), 8 deletions(-) delete mode 100644 .gitmodules delete mode 160000 extern/SafeParcel create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/location/places/internal/IGooglePlaceDetectionService.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/location/places/internal/IGooglePlacesService.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/search/global/GetCurrentExperimentIdsRequest.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/search/global/GetCurrentExperimentIdsResponse.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/search/global/GetGlobalSearchSourcesRequest.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/search/global/GetGlobalSearchSourcesResponse.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/search/global/GetPendingExperimentIdsRequest.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/search/global/GetPendingExperimentIdsResponse.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/search/global/SetExperimentIdsRequest.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/search/global/SetExperimentIdsResponse.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/search/global/SetIncludeInGlobalSearchRequest.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/search/global/SetIncludeInGlobalSearchResponse.aidl create mode 100644 play-services-api/src/main/aidl/com/google/android/gms/search/global/internal/IGlobalSearchAdminCallbacks.aidl create mode 100644 play-services-api/src/main/java/com/google/android/gms/search/global/GetCurrentExperimentIdsRequest.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/search/global/GetCurrentExperimentIdsResponse.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/search/global/GetGlobalSearchSourcesRequest.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/search/global/GetGlobalSearchSourcesResponse.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/search/global/GetPendingExperimentIdsRequest.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/search/global/GetPendingExperimentIdsResponse.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/search/global/SetExperimentIdsRequest.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/search/global/SetExperimentIdsResponse.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/search/global/SetIncludeInGlobalSearchRequest.java create mode 100644 play-services-api/src/main/java/com/google/android/gms/search/global/SetIncludeInGlobalSearchResponse.java delete mode 120000 safe-parcel diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 134f71c7..00000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "SafeParcel"] - path = extern/SafeParcel - url = https://github.com/microg/android_external_SafeParcel.git diff --git a/extern/SafeParcel b/extern/SafeParcel deleted file mode 160000 index 7e7fcee2..00000000 --- a/extern/SafeParcel +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 7e7fcee20047116b87406ae0e1296489a46bac73 diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/places/internal/IGooglePlaceDetectionService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/location/places/internal/IGooglePlaceDetectionService.aidl new file mode 100644 index 00000000..39b0a53f --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/location/places/internal/IGooglePlaceDetectionService.aidl @@ -0,0 +1,5 @@ +package com.google.android.gms.location.places.internal; + +interface IGooglePlaceDetectionService { + +} \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/places/internal/IGooglePlacesService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/location/places/internal/IGooglePlacesService.aidl new file mode 100644 index 00000000..854e921e --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/location/places/internal/IGooglePlacesService.aidl @@ -0,0 +1,5 @@ +package com.google.android.gms.location.places.internal; + +interface IGooglePlacesService { + +} \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/search/global/GetCurrentExperimentIdsRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/search/global/GetCurrentExperimentIdsRequest.aidl new file mode 100644 index 00000000..426cbe47 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/search/global/GetCurrentExperimentIdsRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.search.global; + +parcelable GetCurrentExperimentIdsRequest; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/search/global/GetCurrentExperimentIdsResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/search/global/GetCurrentExperimentIdsResponse.aidl new file mode 100644 index 00000000..8fdb4567 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/search/global/GetCurrentExperimentIdsResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.search.global; + +parcelable GetCurrentExperimentIdsResponse; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/search/global/GetGlobalSearchSourcesRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/search/global/GetGlobalSearchSourcesRequest.aidl new file mode 100644 index 00000000..986ab4db --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/search/global/GetGlobalSearchSourcesRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.search.global; + +parcelable GetGlobalSearchSourcesRequest; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/search/global/GetGlobalSearchSourcesResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/search/global/GetGlobalSearchSourcesResponse.aidl new file mode 100644 index 00000000..86d52a13 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/search/global/GetGlobalSearchSourcesResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.search.global; + +parcelable GetGlobalSearchSourcesResponse; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/search/global/GetPendingExperimentIdsRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/search/global/GetPendingExperimentIdsRequest.aidl new file mode 100644 index 00000000..8d7382ed --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/search/global/GetPendingExperimentIdsRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.search.global; + +parcelable GetPendingExperimentIdsRequest; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/search/global/GetPendingExperimentIdsResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/search/global/GetPendingExperimentIdsResponse.aidl new file mode 100644 index 00000000..ca99ad5f --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/search/global/GetPendingExperimentIdsResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.search.global; + +parcelable GetPendingExperimentIdsResponse; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/search/global/SetExperimentIdsRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/search/global/SetExperimentIdsRequest.aidl new file mode 100644 index 00000000..2bd4d8b3 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/search/global/SetExperimentIdsRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.search.global; + +parcelable SetExperimentIdsRequest; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/search/global/SetExperimentIdsResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/search/global/SetExperimentIdsResponse.aidl new file mode 100644 index 00000000..ff552760 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/search/global/SetExperimentIdsResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.search.global; + +parcelable SetExperimentIdsResponse; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/search/global/SetIncludeInGlobalSearchRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/search/global/SetIncludeInGlobalSearchRequest.aidl new file mode 100644 index 00000000..79cbb179 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/search/global/SetIncludeInGlobalSearchRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.search.global; + +parcelable SetIncludeInGlobalSearchRequest; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/search/global/SetIncludeInGlobalSearchResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/search/global/SetIncludeInGlobalSearchResponse.aidl new file mode 100644 index 00000000..a5f2d6d0 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/search/global/SetIncludeInGlobalSearchResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.search.global; + +parcelable SetIncludeInGlobalSearchResponse; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/search/global/internal/IGlobalSearchAdminCallbacks.aidl b/play-services-api/src/main/aidl/com/google/android/gms/search/global/internal/IGlobalSearchAdminCallbacks.aidl new file mode 100644 index 00000000..b08d9530 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/search/global/internal/IGlobalSearchAdminCallbacks.aidl @@ -0,0 +1,16 @@ +package com.google.android.gms.search.global.internal; + +import com.google.android.gms.search.global.GetCurrentExperimentIdsResponse; +import com.google.android.gms.search.global.GetGlobalSearchSourcesResponse; +import com.google.android.gms.search.global.GetPendingExperimentIdsResponse; +import com.google.android.gms.search.global.SetExperimentIdsResponse; +import com.google.android.gms.search.global.SetIncludeInGlobalSearchResponse; + +interface IGlobalSearchAdminCallbacks { + void onGetGlobalSearchSourcesResponse(in GetGlobalSearchSourcesResponse request) = 1; + void onSetExperimentIdsResponse(in SetExperimentIdsResponse response) = 2; + void onGetCurrentExperimentIdsResponse(in GetCurrentExperimentIdsResponse response) = 3; + void onGetPendingExperimentIdsResponse(in GetPendingExperimentIdsResponse response) = 4; + + void onSetIncludeInGlobalSearchResponse(in SetIncludeInGlobalSearchResponse response) = 7; +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/search/global/internal/IGlobalSearchAdminService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/search/global/internal/IGlobalSearchAdminService.aidl index 35ed0dbe..95bc32a7 100644 --- a/play-services-api/src/main/aidl/com/google/android/gms/search/global/internal/IGlobalSearchAdminService.aidl +++ b/play-services-api/src/main/aidl/com/google/android/gms/search/global/internal/IGlobalSearchAdminService.aidl @@ -1,5 +1,17 @@ package com.google.android.gms.search.global.internal; -interface IGlobalSearchAdminService { +import com.google.android.gms.search.global.GetCurrentExperimentIdsRequest; +import com.google.android.gms.search.global.GetGlobalSearchSourcesRequest; +import com.google.android.gms.search.global.GetPendingExperimentIdsRequest; +import com.google.android.gms.search.global.SetExperimentIdsRequest; +import com.google.android.gms.search.global.SetIncludeInGlobalSearchRequest; +import com.google.android.gms.search.global.internal.IGlobalSearchAdminCallbacks; +interface IGlobalSearchAdminService { + void getGlobalSearchSources(in GetGlobalSearchSourcesRequest request, IGlobalSearchAdminCallbacks callbacks) = 1; + void setExperimentIds(in SetExperimentIdsRequest request, IGlobalSearchAdminCallbacks callbacks) = 2; + void getCurrentExperimentIds(in GetCurrentExperimentIdsRequest request, IGlobalSearchAdminCallbacks callbacks) = 3; + void getPendingExperimentIds(in GetPendingExperimentIdsRequest request, IGlobalSearchAdminCallbacks callbacks) = 4; + + void setIncludeInGlobalSearch(in SetIncludeInGlobalSearchRequest request, IGlobalSearchAdminCallbacks callbacks) = 7; } diff --git a/play-services-api/src/main/java/com/google/android/gms/search/global/GetCurrentExperimentIdsRequest.java b/play-services-api/src/main/java/com/google/android/gms/search/global/GetCurrentExperimentIdsRequest.java new file mode 100644 index 00000000..5f83f769 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/search/global/GetCurrentExperimentIdsRequest.java @@ -0,0 +1,28 @@ +/* + * Copyright 2013-2016 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.search.global; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class GetCurrentExperimentIdsRequest extends AutoSafeParcelable { + + @SafeParceled(1000) + private int versionCode = 1; + + public static final Creator CREATOR = new AutoCreator(GetCurrentExperimentIdsRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/search/global/GetCurrentExperimentIdsResponse.java b/play-services-api/src/main/java/com/google/android/gms/search/global/GetCurrentExperimentIdsResponse.java new file mode 100644 index 00000000..d94502e3 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/search/global/GetCurrentExperimentIdsResponse.java @@ -0,0 +1,57 @@ +/* + * Copyright 2013-2016 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.search.global; + +import com.google.android.gms.common.api.Status; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +import java.util.Arrays; + +public class GetCurrentExperimentIdsResponse extends AutoSafeParcelable { + + @SafeParceled(1000) + private int versionCode = 1; + + @SafeParceled(1) + public final Status status; + + @SafeParceled(2) + public final int[] experimentIds; + + private GetCurrentExperimentIdsResponse() { + status = null; + experimentIds = null; + } + + public GetCurrentExperimentIdsResponse(Status status, int[] experimentIds) { + this.status = status; + this.experimentIds = experimentIds; + } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder("GetCurrentExperimentIdsResponse{"); + sb.append("status=").append(status); + sb.append(", experimentIds=").append(Arrays.toString(experimentIds)); + sb.append('}'); + return sb.toString(); + } + + public static final Creator CREATOR = new AutoCreator(GetCurrentExperimentIdsResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/search/global/GetGlobalSearchSourcesRequest.java b/play-services-api/src/main/java/com/google/android/gms/search/global/GetGlobalSearchSourcesRequest.java new file mode 100644 index 00000000..ba1849cc --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/search/global/GetGlobalSearchSourcesRequest.java @@ -0,0 +1,39 @@ +/* + * Copyright 2013-2016 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.search.global; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class GetGlobalSearchSourcesRequest extends AutoSafeParcelable { + + @SafeParceled(1000) + private int versionCode = 1; + + @SafeParceled(1) + public boolean bool; + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder("GetGlobalSearchSourcesRequest{"); + sb.append("bool=").append(bool); + sb.append('}'); + return sb.toString(); + } + + public static final Creator CREATOR = new AutoCreator(GetGlobalSearchSourcesRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/search/global/GetGlobalSearchSourcesResponse.java b/play-services-api/src/main/java/com/google/android/gms/search/global/GetGlobalSearchSourcesResponse.java new file mode 100644 index 00000000..cc771ad3 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/search/global/GetGlobalSearchSourcesResponse.java @@ -0,0 +1,59 @@ +/* + * Copyright 2013-2016 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.search.global; + +import android.os.Parcelable; + +import com.google.android.gms.common.api.Status; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +import java.util.Arrays; + +public class GetGlobalSearchSourcesResponse extends AutoSafeParcelable { + + @SafeParceled(1000) + private int versionCode = 1; + + @SafeParceled(1) + public final Status status; + + @SafeParceled(2) + public final Parcelable[] sources; + + private GetGlobalSearchSourcesResponse() { + status = null; + sources = null; + } + + public GetGlobalSearchSourcesResponse(Status status, Parcelable[] sources) { + this.status = status; + this.sources = sources; + } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder("GetGlobalSearchSourcesResponse{"); + sb.append("status=").append(status); + sb.append(", sources=").append(Arrays.toString(sources)); + sb.append('}'); + return sb.toString(); + } + + public static final Creator CREATOR = new AutoCreator(GetGlobalSearchSourcesResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/search/global/GetPendingExperimentIdsRequest.java b/play-services-api/src/main/java/com/google/android/gms/search/global/GetPendingExperimentIdsRequest.java new file mode 100644 index 00000000..da762433 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/search/global/GetPendingExperimentIdsRequest.java @@ -0,0 +1,28 @@ +/* + * Copyright 2013-2016 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.search.global; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class GetPendingExperimentIdsRequest extends AutoSafeParcelable { + + @SafeParceled(1000) + private int versionCode = 1; + + public static final Creator CREATOR = new AutoCreator(GetPendingExperimentIdsRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/search/global/GetPendingExperimentIdsResponse.java b/play-services-api/src/main/java/com/google/android/gms/search/global/GetPendingExperimentIdsResponse.java new file mode 100644 index 00000000..f786e3f0 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/search/global/GetPendingExperimentIdsResponse.java @@ -0,0 +1,57 @@ +/* + * Copyright 2013-2016 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.search.global; + +import com.google.android.gms.common.api.Status; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +import java.util.Arrays; + +public class GetPendingExperimentIdsResponse extends AutoSafeParcelable { + + @SafeParceled(1000) + private int versionCode = 1; + + @SafeParceled(1) + public final Status status; + + @SafeParceled(2) + public final int[] experimentIds; + + private GetPendingExperimentIdsResponse() { + status = null; + experimentIds = null; + } + + public GetPendingExperimentIdsResponse(Status status, int[] experimentIds) { + this.status = status; + this.experimentIds = experimentIds; + } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder("GetPendingExperimentIdsResponse{"); + sb.append("status=").append(status); + sb.append(", experimentIds=").append(Arrays.toString(experimentIds)); + sb.append('}'); + return sb.toString(); + } + + public static final Creator CREATOR = new AutoCreator(GetPendingExperimentIdsResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/search/global/SetExperimentIdsRequest.java b/play-services-api/src/main/java/com/google/android/gms/search/global/SetExperimentIdsRequest.java new file mode 100644 index 00000000..5a1d3bad --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/search/global/SetExperimentIdsRequest.java @@ -0,0 +1,45 @@ +/* + * Copyright 2013-2016 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.search.global; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +import java.util.Arrays; + +public class SetExperimentIdsRequest extends AutoSafeParcelable { + + @SafeParceled(1000) + private int versionCode = 1; + + @SafeParceled(1) + public byte[] experimentIds; + + @SafeParceled(2) + public boolean enable; + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder("SetExperimentIdsRequest{"); + sb.append("experimentIds=").append(Arrays.toString(experimentIds)); + sb.append(", enable=").append(enable); + sb.append('}'); + return sb.toString(); + } + + public static final Creator CREATOR = new AutoCreator(SetExperimentIdsRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/search/global/SetExperimentIdsResponse.java b/play-services-api/src/main/java/com/google/android/gms/search/global/SetExperimentIdsResponse.java new file mode 100644 index 00000000..61f46fcd --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/search/global/SetExperimentIdsResponse.java @@ -0,0 +1,49 @@ +/* + * Copyright 2013-2016 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.search.global; + +import com.google.android.gms.common.api.Status; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class SetExperimentIdsResponse extends AutoSafeParcelable { + + @SafeParceled(1000) + private int versionCode = 1; + + @SafeParceled(1) + public final Status status; + + private SetExperimentIdsResponse() { + status = null; + } + + public SetExperimentIdsResponse(Status status) { + this.status = status; + } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder("SetExperimentIdsResponse{"); + sb.append("status=").append(status); + sb.append('}'); + return sb.toString(); + } + + public static final Creator CREATOR = new AutoCreator(SetExperimentIdsResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/search/global/SetIncludeInGlobalSearchRequest.java b/play-services-api/src/main/java/com/google/android/gms/search/global/SetIncludeInGlobalSearchRequest.java new file mode 100644 index 00000000..ae0ed18a --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/search/global/SetIncludeInGlobalSearchRequest.java @@ -0,0 +1,47 @@ +/* + * Copyright 2013-2016 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.search.global; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class SetIncludeInGlobalSearchRequest extends AutoSafeParcelable { + + @SafeParceled(1000) + private int versionCode = 1; + + @SafeParceled(1) + public String packageName; + + @SafeParceled(2) + public String source; + + @SafeParceled(3) + public boolean enabled; + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder("SetIncludeInGlobalSearchRequest{"); + sb.append("packageName='").append(packageName).append('\''); + sb.append(", source='").append(source).append('\''); + sb.append(", enabled=").append(enabled); + sb.append('}'); + return sb.toString(); + } + + public static final Creator CREATOR = new AutoCreator(SetIncludeInGlobalSearchRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/search/global/SetIncludeInGlobalSearchResponse.java b/play-services-api/src/main/java/com/google/android/gms/search/global/SetIncludeInGlobalSearchResponse.java new file mode 100644 index 00000000..18c91252 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/search/global/SetIncludeInGlobalSearchResponse.java @@ -0,0 +1,49 @@ +/* + * Copyright 2013-2016 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.search.global; + +import com.google.android.gms.common.api.Status; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class SetIncludeInGlobalSearchResponse extends AutoSafeParcelable { + + @SafeParceled(1000) + private int versionCode = 1; + + @SafeParceled(1) + public final Status status; + + private SetIncludeInGlobalSearchResponse() { + status = null; + } + + public SetIncludeInGlobalSearchResponse(Status status) { + this.status = status; + } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder("SetIncludeInGlobalSearchResponse{"); + sb.append("status=").append(status); + sb.append('}'); + return sb.toString(); + } + + public static final Creator CREATOR = new AutoCreator(SetIncludeInGlobalSearchResponse.class); +} diff --git a/play-services-basement/build.gradle b/play-services-basement/build.gradle index 38d7eb7f..3fb7414a 100644 --- a/play-services-basement/build.gradle +++ b/play-services-basement/build.gradle @@ -48,5 +48,5 @@ android { dependencies { compile 'com.android.support:support-v4:23.4.0' - compile project(':safe-parcel') + compile 'org.microg:safe-parcel:1.4.0' } diff --git a/play-services-basement/src/main/java/org/microg/gms/common/GmsService.java b/play-services-basement/src/main/java/org/microg/gms/common/GmsService.java index 51f6f90b..ca6b0464 100644 --- a/play-services-basement/src/main/java/org/microg/gms/common/GmsService.java +++ b/play-services-basement/src/main/java/org/microg/gms/common/GmsService.java @@ -66,7 +66,7 @@ public enum GmsService { CONTEXT_MANAGER(47, "com.google.android.contextmanager.service.ContextManagerService.START"), AUDIO_MODEM(48, "com.google.android.gms.audiomodem.service.AudioModemService.START"), NEARBY_SHARING(49, "com.google.android.gms.nearby.sharing.service.NearbySharingService.START"), - LIGHTWEIGHT_NETWORK_QUALITY(51, "com.google.android.gms.herrevad.services.LightweightNetworkQualityAndroidService.START"), + LIGHTWEIGHT_NETWORK_QUALITY(50, "com.google.android.gms.herrevad.services.LightweightNetworkQualityAndroidService.START"), PHENOTYPE(51, "com.google.android.gms.phenotype.service.START"), VOICE_UNLOCK(52, "com.google.android.gms.speech.service.START"), NEARBY_CONNECTIONS(54, "com.google.android.gms.nearby.connection.service.START"), diff --git a/safe-parcel b/safe-parcel deleted file mode 120000 index 76875b71..00000000 --- a/safe-parcel +++ /dev/null @@ -1 +0,0 @@ -extern/SafeParcel/safe-parcel \ No newline at end of file From acec513b19aaba856722fc22c9adf3f5e0ea3ac7 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Sat, 24 Sep 2016 20:58:01 +0200 Subject: [PATCH 181/293] Update build tools and target sdk --- .travis.yml | 17 +++++++++++------ build.gradle | 6 +++--- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index a1c9090d..c57a40b2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,15 +4,20 @@ git: before_install: - git submodule update --init --recursive script: - - export JAVA_OPTS="-XX:MaxPermSize=1024m -XX:+CMSClassUnloadingEnabled -XX:+HeapDumpOnOutOfMemoryError -Xmx2048m" + - export JAVA_OPTS="-XX:+CMSClassUnloadingEnabled -XX:+HeapDumpOnOutOfMemoryError -Xmx2048m" - export TERM=dumb - echo sdk.dir $ANDROID_HOME > local.properties - - ./gradlew assembleDebug -x lint + - jdk_switcher use oraclejdk8 + - ./gradlew assemble android: components: - tools - - build-tools-23.0.3 - - android-23 + - build-tools-24.0.2 + - android-24 - extra-android-m2repository - - +before_cache: + - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock +cache: + directories: + - $HOME/.gradle/caches/ + - $HOME/.gradle/wrapper/ diff --git a/build.gradle b/build.gradle index 4b3b586b..9e2799c4 100644 --- a/build.gradle +++ b/build.gradle @@ -19,17 +19,17 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:2.1.3' + classpath 'com.android.tools.build:gradle:2.2.0' classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1' } } allprojects { apply plugin: 'idea' - ext.androidBuildVersionTools = "23.0.3" + ext.androidBuildVersionTools = "24.0.2" } -def androidCompileSdk() { return 23 } +def androidCompileSdk() { return 24 } subprojects { repositories { From 3a219305d801f79c5385583e8ae8a9e9febc0160 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Sat, 24 Sep 2016 21:00:24 +0200 Subject: [PATCH 182/293] Update build tools, sdk version and api lib --- .travis.yml | 14 ++++++-------- build.gradle | 6 +++--- extern/GmsApi | 2 +- safe-parcel | 1 - 4 files changed, 10 insertions(+), 13 deletions(-) delete mode 120000 safe-parcel diff --git a/.travis.yml b/.travis.yml index 8f34e4b8..c57a40b2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,21 +1,19 @@ language: android -sudo: false git: submodules: false before_install: - git submodule update --init --recursive -before_script: - - echo sdk.dir $ANDROID_HOME > local.properties script: + - export JAVA_OPTS="-XX:+CMSClassUnloadingEnabled -XX:+HeapDumpOnOutOfMemoryError -Xmx2048m" - export TERM=dumb - - export JAVA_OPTS="-XX:MaxPermSize=1024m -XX:+CMSClassUnloadingEnabled -XX:+HeapDumpOnOutOfMemoryError -Xmx2048m" - - ./gradlew build + - echo sdk.dir $ANDROID_HOME > local.properties + - jdk_switcher use oraclejdk8 + - ./gradlew assemble android: components: - - platform-tools - tools - - build-tools-23.0.3 - - android-23 + - build-tools-24.0.2 + - android-24 - extra-android-m2repository before_cache: - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock diff --git a/build.gradle b/build.gradle index 635996ac..27dfeb02 100644 --- a/build.gradle +++ b/build.gradle @@ -19,17 +19,17 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:2.1.3' + classpath 'com.android.tools.build:gradle:2.2.0' classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1' } } allprojects { apply plugin: 'idea' - ext.androidBuildVersionTools = "23.0.3" + ext.androidBuildVersionTools = "24.0.2" } -def androidCompileSdk() { return 23 } +def androidCompileSdk() { return 24 } subprojects { group = 'org.microg' diff --git a/extern/GmsApi b/extern/GmsApi index c6f5d258..acec513b 160000 --- a/extern/GmsApi +++ b/extern/GmsApi @@ -1 +1 @@ -Subproject commit c6f5d25850d86a78119c0175678c81178b0500e1 +Subproject commit acec513b19aaba856722fc22c9adf3f5e0ea3ac7 diff --git a/safe-parcel b/safe-parcel deleted file mode 120000 index 5c222c0b..00000000 --- a/safe-parcel +++ /dev/null @@ -1 +0,0 @@ -extern/GmsApi/safe-parcel \ No newline at end of file From 107d70080ad5f8389db97dc0bb7f36d52af46afe Mon Sep 17 00:00:00 2001 From: Marvin W Date: Sun, 2 Oct 2016 20:15:36 +0200 Subject: [PATCH 183/293] Update reference version code --- .../src/main/java/org/microg/gms/common/Constants.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/play-services-basement/src/main/java/org/microg/gms/common/Constants.java b/play-services-basement/src/main/java/org/microg/gms/common/Constants.java index bf74f5b9..6cb9f7cc 100644 --- a/play-services-basement/src/main/java/org/microg/gms/common/Constants.java +++ b/play-services-basement/src/main/java/org/microg/gms/common/Constants.java @@ -17,11 +17,7 @@ package org.microg.gms.common; public class Constants { - /** - * This is the highest version that was looked at during development. - * Does not necessarily mean anything. - */ - public static final int MAX_REFERENCE_VERSION = 9452000; + public static final int MAX_REFERENCE_VERSION = 9683000; public static final String GMS_PACKAGE_NAME = "com.google.android.gms"; public static final String GSF_PACKAGE_NAME = "com.google.android.gsf"; public static final String GMS_PACKAGE_SIGNATURE_SHA1 = "38918a453d07199354f8b19af05ec6562ced5788"; From f7716698dae5c162d63df7d265451d9907064023 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Sun, 6 Nov 2016 02:21:11 +0100 Subject: [PATCH 184/293] Increase basement version and add initial parts of cast-framework-api --- play-services-api/build.gradle | 1 + play-services-basement/build.gradle | 2 +- .../java/org/microg/gms/common/Constants.java | 2 +- play-services-cast-framework-api/build.gradle | 46 +++++++++++++++++++ .../src/main/AndroidManifest.xml | 24 ++++++++++ .../gms/cast/framework/CastOptions.aidl | 3 ++ .../framework/ICastConnectionController.aidl | 5 ++ .../gms/cast/framework/ICastContext.aidl | 15 ++++++ .../gms/cast/framework/ICastSession.aidl | 5 ++ .../cast/framework/IReconnectionService.aidl | 5 ++ .../android/gms/cast/framework/ISession.aidl | 5 ++ .../gms/cast/framework/ISessionManager.aidl | 13 ++++++ .../gms/cast/framework/ISessionProxy.aidl | 5 ++ .../internal/ICastDynamiteModule.aidl | 24 ++++++++++ .../cast/framework/internal/IMediaRouter.aidl | 5 ++ .../framework/media/CastMediaOptions.aidl | 3 ++ .../media/IMediaNotificationService.aidl | 5 ++ .../media/internal/IFetchBitmapTask.aidl | 5 ++ .../IFetchBitmapTaskProgressPublisher.aidl | 5 ++ .../gms/cast/framework/CastOptions.java | 25 ++++++++++ .../framework/media/CastMediaOptions.java | 25 ++++++++++ settings.gradle | 1 + 22 files changed, 227 insertions(+), 2 deletions(-) create mode 100644 play-services-cast-framework-api/build.gradle create mode 100644 play-services-cast-framework-api/src/main/AndroidManifest.xml create mode 100644 play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/CastOptions.aidl create mode 100644 play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ICastConnectionController.aidl create mode 100644 play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ICastContext.aidl create mode 100644 play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ICastSession.aidl create mode 100644 play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/IReconnectionService.aidl create mode 100644 play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ISession.aidl create mode 100644 play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ISessionManager.aidl create mode 100644 play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ISessionProxy.aidl create mode 100644 play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/internal/ICastDynamiteModule.aidl create mode 100644 play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/internal/IMediaRouter.aidl create mode 100644 play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/media/CastMediaOptions.aidl create mode 100644 play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/media/IMediaNotificationService.aidl create mode 100644 play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/media/internal/IFetchBitmapTask.aidl create mode 100644 play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/media/internal/IFetchBitmapTaskProgressPublisher.aidl create mode 100644 play-services-cast-framework-api/src/main/java/com/google/android/gms/cast/framework/CastOptions.java create mode 100644 play-services-cast-framework-api/src/main/java/com/google/android/gms/cast/framework/media/CastMediaOptions.java diff --git a/play-services-api/build.gradle b/play-services-api/build.gradle index 33871ca2..972d5ad2 100644 --- a/play-services-api/build.gradle +++ b/play-services-api/build.gradle @@ -44,6 +44,7 @@ android { dependencies { compile project(':play-services-basement') compile project(':play-services-cast-api') + compile project(':play-services-cast-framework-api') compile project(':play-services-iid-api') compile project(':play-services-location-api') compile project(':play-services-wearable-api') diff --git a/play-services-basement/build.gradle b/play-services-basement/build.gradle index 3fb7414a..8358b839 100644 --- a/play-services-basement/build.gradle +++ b/play-services-basement/build.gradle @@ -47,6 +47,6 @@ android { } dependencies { - compile 'com.android.support:support-v4:23.4.0' + compile 'com.android.support:support-v4:24.2.1' compile 'org.microg:safe-parcel:1.4.0' } diff --git a/play-services-basement/src/main/java/org/microg/gms/common/Constants.java b/play-services-basement/src/main/java/org/microg/gms/common/Constants.java index 6cb9f7cc..9fadb62b 100644 --- a/play-services-basement/src/main/java/org/microg/gms/common/Constants.java +++ b/play-services-basement/src/main/java/org/microg/gms/common/Constants.java @@ -17,7 +17,7 @@ package org.microg.gms.common; public class Constants { - public static final int MAX_REFERENCE_VERSION = 9683000; + public static final int MAX_REFERENCE_VERSION = 10084000; public static final String GMS_PACKAGE_NAME = "com.google.android.gms"; public static final String GSF_PACKAGE_NAME = "com.google.android.gsf"; public static final String GMS_PACKAGE_SIGNATURE_SHA1 = "38918a453d07199354f8b19af05ec6562ced5788"; diff --git a/play-services-cast-framework-api/build.gradle b/play-services-cast-framework-api/build.gradle new file mode 100644 index 00000000..b4ddb5c3 --- /dev/null +++ b/play-services-cast-framework-api/build.gradle @@ -0,0 +1,46 @@ +/* + * Copyright 2013-2015 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' + +String getMyVersionName() { + def stdout = new ByteArrayOutputStream() + if (rootProject.file("gradlew").exists()) + exec { commandLine 'git', 'describe', '--tags', '--always', '--dirty'; standardOutput = stdout } + else // automatic build system, don't tag dirty + exec { commandLine 'git', 'describe', '--tags', '--always'; standardOutput = stdout } + return stdout.toString().trim().substring(1) +} + +group = 'org.microg' +version = getMyVersionName() + +android { + compileSdkVersion androidCompileSdk() + buildToolsVersion "$androidBuildVersionTools" + + defaultConfig { + versionName getMyVersionName() + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_6 + } +} + +dependencies { + compile project(':play-services-basement') +} diff --git a/play-services-cast-framework-api/src/main/AndroidManifest.xml b/play-services-cast-framework-api/src/main/AndroidManifest.xml new file mode 100644 index 00000000..d4913c98 --- /dev/null +++ b/play-services-cast-framework-api/src/main/AndroidManifest.xml @@ -0,0 +1,24 @@ + + + + + + + + + diff --git a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/CastOptions.aidl b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/CastOptions.aidl new file mode 100644 index 00000000..e867d59d --- /dev/null +++ b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/CastOptions.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.cast.framework; + +parcelable CastOptions; \ No newline at end of file diff --git a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ICastConnectionController.aidl b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ICastConnectionController.aidl new file mode 100644 index 00000000..6857ad18 --- /dev/null +++ b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ICastConnectionController.aidl @@ -0,0 +1,5 @@ +package com.google.android.gms.cast.framework; + +interface ICastConnectionController { + +} \ No newline at end of file diff --git a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ICastContext.aidl b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ICastContext.aidl new file mode 100644 index 00000000..25c4ec51 --- /dev/null +++ b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ICastContext.aidl @@ -0,0 +1,15 @@ +package com.google.android.gms.cast.framework; + +import com.google.android.gms.cast.framework.ISessionManager; +import com.google.android.gms.dynamic.IObjectWrapper; + +interface ICastContext { + Bundle getMergedSelectorAsBundle() = 0; + boolean isApplicationVisible() = 1; + //void addAppVisibilityListener(IAppVisibilityListener listener) = 2; + //void removeAppVisibilityListener(IAppVisibilityListener listener) = 3; + ISessionManager getSessionManager() = 4; + void destroy() = 5; + void onActivityResumed(in IObjectWrapper activity) = 6; + void onActivityPaused(in IObjectWrapper activity) = 7; +} \ No newline at end of file diff --git a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ICastSession.aidl b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ICastSession.aidl new file mode 100644 index 00000000..848fb6b5 --- /dev/null +++ b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ICastSession.aidl @@ -0,0 +1,5 @@ +package com.google.android.gms.cast.framework; + +interface ICastSession { + +} \ No newline at end of file diff --git a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/IReconnectionService.aidl b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/IReconnectionService.aidl new file mode 100644 index 00000000..33f19574 --- /dev/null +++ b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/IReconnectionService.aidl @@ -0,0 +1,5 @@ +package com.google.android.gms.cast.framework; + +interface IReconnectionService { + +} \ No newline at end of file diff --git a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ISession.aidl b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ISession.aidl new file mode 100644 index 00000000..51602ea7 --- /dev/null +++ b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ISession.aidl @@ -0,0 +1,5 @@ +package com.google.android.gms.cast.framework; + +interface ISession { + +} \ No newline at end of file diff --git a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ISessionManager.aidl b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ISessionManager.aidl new file mode 100644 index 00000000..c2cc3e66 --- /dev/null +++ b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ISessionManager.aidl @@ -0,0 +1,13 @@ +package com.google.android.gms.cast.framework; + +import com.google.android.gms.dynamic.IObjectWrapper; + +interface ISessionManager { + IObjectWrapper getWrappedCurrentSession() = 0; + //void addSessionManagerListener(ISessionManagerListener listener) = 1; + //void removeSessionManagerListener(ISessionManagerListener listener) = 2; + //void addCastStateListener(ICastStateListener listener) = 3; + //void removeCastStateListener(ICastStateListener listener) = 4; + void endCurrentSession(boolean b, boolean stopCasting) = 5; + IObjectWrapper getWrappedThis() = 6; +} \ No newline at end of file diff --git a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ISessionProxy.aidl b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ISessionProxy.aidl new file mode 100644 index 00000000..7d0a4fad --- /dev/null +++ b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ISessionProxy.aidl @@ -0,0 +1,5 @@ +package com.google.android.gms.cast.framework; + +interface ISessionProxy { + +} \ No newline at end of file diff --git a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/internal/ICastDynamiteModule.aidl b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/internal/ICastDynamiteModule.aidl new file mode 100644 index 00000000..e62d1a67 --- /dev/null +++ b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/internal/ICastDynamiteModule.aidl @@ -0,0 +1,24 @@ +package com.google.android.gms.cast.framework.internal; + +import com.google.android.gms.cast.framework.CastOptions; +import com.google.android.gms.cast.framework.ICastConnectionController; +import com.google.android.gms.cast.framework.ICastContext; +import com.google.android.gms.cast.framework.ICastSession; +import com.google.android.gms.cast.framework.IReconnectionService; +import com.google.android.gms.cast.framework.ISession; +import com.google.android.gms.cast.framework.ISessionProxy; +import com.google.android.gms.cast.framework.internal.IMediaRouter; +import com.google.android.gms.cast.framework.media.CastMediaOptions; +import com.google.android.gms.cast.framework.media.IMediaNotificationService; +import com.google.android.gms.cast.framework.media.internal.IFetchBitmapTask; +import com.google.android.gms.cast.framework.media.internal.IFetchBitmapTaskProgressPublisher; +import com.google.android.gms.dynamic.IObjectWrapper; + +interface ICastDynamiteModule { + ICastContext newCastContextImpl(in IObjectWrapper context, in CastOptions options, IMediaRouter router, in Map map) = 0; + ISession newSessionImpl(String s1, String s2, ISessionProxy proxy) = 1; + ICastSession newCastSessionImpl(in CastOptions options, in IObjectWrapper session, ICastConnectionController controller) = 2; + IMediaNotificationService newMediaNotificationServiceImpl(in IObjectWrapper service, in IObjectWrapper castContext, in IObjectWrapper resources, in CastMediaOptions options) = 3; + IReconnectionService newReconnectionServiceImpl(in IObjectWrapper service, in IObjectWrapper sessionManager, in IObjectWrapper discoveryManager) = 4; + IFetchBitmapTask newFetchBitmapTaskImpl(in IObjectWrapper asyncTask, IFetchBitmapTaskProgressPublisher progressPublisher, int i1, int i2, boolean b1, long l1, int i3, int i4, int i5) = 5; +} \ No newline at end of file diff --git a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/internal/IMediaRouter.aidl b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/internal/IMediaRouter.aidl new file mode 100644 index 00000000..73fd0506 --- /dev/null +++ b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/internal/IMediaRouter.aidl @@ -0,0 +1,5 @@ +package com.google.android.gms.cast.framework.internal; + +interface IMediaRouter { + +} \ No newline at end of file diff --git a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/media/CastMediaOptions.aidl b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/media/CastMediaOptions.aidl new file mode 100644 index 00000000..4186fc4b --- /dev/null +++ b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/media/CastMediaOptions.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.cast.framework.media; + +parcelable CastMediaOptions; \ No newline at end of file diff --git a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/media/IMediaNotificationService.aidl b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/media/IMediaNotificationService.aidl new file mode 100644 index 00000000..03e48729 --- /dev/null +++ b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/media/IMediaNotificationService.aidl @@ -0,0 +1,5 @@ +package com.google.android.gms.cast.framework.media; + +interface IMediaNotificationService { + +} \ No newline at end of file diff --git a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/media/internal/IFetchBitmapTask.aidl b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/media/internal/IFetchBitmapTask.aidl new file mode 100644 index 00000000..c9f2286d --- /dev/null +++ b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/media/internal/IFetchBitmapTask.aidl @@ -0,0 +1,5 @@ +package com.google.android.gms.cast.framework.media.internal; + +interface IFetchBitmapTask { + +} \ No newline at end of file diff --git a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/media/internal/IFetchBitmapTaskProgressPublisher.aidl b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/media/internal/IFetchBitmapTaskProgressPublisher.aidl new file mode 100644 index 00000000..58b80c08 --- /dev/null +++ b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/media/internal/IFetchBitmapTaskProgressPublisher.aidl @@ -0,0 +1,5 @@ +package com.google.android.gms.cast.framework.media.internal; + +interface IFetchBitmapTaskProgressPublisher { + +} \ No newline at end of file diff --git a/play-services-cast-framework-api/src/main/java/com/google/android/gms/cast/framework/CastOptions.java b/play-services-cast-framework-api/src/main/java/com/google/android/gms/cast/framework/CastOptions.java new file mode 100644 index 00000000..7510362a --- /dev/null +++ b/play-services-cast-framework-api/src/main/java/com/google/android/gms/cast/framework/CastOptions.java @@ -0,0 +1,25 @@ +/* + * Copyright 2013-2016 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.cast.framework; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class CastOptions extends AutoSafeParcelable { + + + public static Creator CREATOR = new AutoCreator(CastOptions.class); +} diff --git a/play-services-cast-framework-api/src/main/java/com/google/android/gms/cast/framework/media/CastMediaOptions.java b/play-services-cast-framework-api/src/main/java/com/google/android/gms/cast/framework/media/CastMediaOptions.java new file mode 100644 index 00000000..362e89f2 --- /dev/null +++ b/play-services-cast-framework-api/src/main/java/com/google/android/gms/cast/framework/media/CastMediaOptions.java @@ -0,0 +1,25 @@ +/* + * Copyright 2013-2016 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.cast.framework.media; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class CastMediaOptions extends AutoSafeParcelable { + + + public static Creator CREATOR = new AutoCreator(CastMediaOptions.class); +} diff --git a/settings.gradle b/settings.gradle index 99da0fb4..aed59ec3 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,6 +1,7 @@ include ':play-services-basement' include ':play-services-api' include ':play-services-cast-api' +include ':play-services-cast-framework-api' include ':play-services-iid-api' include ':play-services-location-api' include ':play-services-wearable-api' From 7e04251b381f4f314bc76be163132cfeea4f8380 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Sun, 6 Nov 2016 02:45:48 +0100 Subject: [PATCH 185/293] Prepare for being a maven artifact --- build.gradle | 2 +- play-services-api/gradle.properties | 4 +-- play-services-basement/gradle.properties | 34 +++++++++++++++++++ play-services-cast-api/gradle.properties | 34 +++++++++++++++++++ .../gradle.properties | 34 +++++++++++++++++++ play-services-iid-api/gradle.properties | 34 +++++++++++++++++++ play-services-location-api/gradle.properties | 34 +++++++++++++++++++ play-services-wearable-api/gradle.properties | 34 +++++++++++++++++++ 8 files changed, 207 insertions(+), 3 deletions(-) create mode 100644 play-services-basement/gradle.properties create mode 100644 play-services-cast-api/gradle.properties create mode 100644 play-services-cast-framework-api/gradle.properties create mode 100644 play-services-iid-api/gradle.properties create mode 100644 play-services-location-api/gradle.properties create mode 100644 play-services-wearable-api/gradle.properties diff --git a/build.gradle b/build.gradle index 9e2799c4..92c603d5 100644 --- a/build.gradle +++ b/build.gradle @@ -19,7 +19,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:2.2.0' + classpath 'com.android.tools.build:gradle:2.2.2' classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1' } } diff --git a/play-services-api/gradle.properties b/play-services-api/gradle.properties index f547fef2..221fda84 100644 --- a/play-services-api/gradle.properties +++ b/play-services-api/gradle.properties @@ -1,5 +1,5 @@ # -# Copyright 2013-2015 microG Project Team +# Copyright 2013-2016 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. @@ -14,7 +14,7 @@ # limitations under the License. # -POM_NAME=GmsApi +POM_NAME=Play Services Internal API POM_DESCRIPTION=Interfaces and objects for IPC between Play Services Library and Play Services Core POM_PACKAGING=aar diff --git a/play-services-basement/gradle.properties b/play-services-basement/gradle.properties new file mode 100644 index 00000000..c18a7f49 --- /dev/null +++ b/play-services-basement/gradle.properties @@ -0,0 +1,34 @@ +# +# Copyright 2013-2016 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. +# + +POM_NAME=Play Services Basement +POM_DESCRIPTION=Interfaces and objects used all over Play Services API, Library and Core + +POM_PACKAGING=aar + +POM_URL=https://github.com/microg/android_external_GmsApi + +POM_SCM_URL=https://github.com/microg/android_external_GmsApi +POM_SCM_CONNECTION=scm:git@github.com:microg/android_external_GmsApi.git +POM_SCM_DEV_CONNECTION=scm:git@github.com:microg/android_external_GmsApi.git + +POM_LICENCE_NAME=The Apache Software License, Version 2.0 +POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt +POM_LICENCE_DIST=repo + +POM_DEVELOPER_ID=mar-v-in +POM_DEVELOPER_NAME=Marvin W + diff --git a/play-services-cast-api/gradle.properties b/play-services-cast-api/gradle.properties new file mode 100644 index 00000000..18ff0a50 --- /dev/null +++ b/play-services-cast-api/gradle.properties @@ -0,0 +1,34 @@ +# +# Copyright 2013-2016 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. +# + +POM_NAME=Play Services Internal Cast API +POM_DESCRIPTION=Interfaces and objects for IPC between Play Services Library and Play Services Core + +POM_PACKAGING=aar + +POM_URL=https://github.com/microg/android_external_GmsApi + +POM_SCM_URL=https://github.com/microg/android_external_GmsApi +POM_SCM_CONNECTION=scm:git@github.com:microg/android_external_GmsApi.git +POM_SCM_DEV_CONNECTION=scm:git@github.com:microg/android_external_GmsApi.git + +POM_LICENCE_NAME=The Apache Software License, Version 2.0 +POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt +POM_LICENCE_DIST=repo + +POM_DEVELOPER_ID=mar-v-in +POM_DEVELOPER_NAME=Marvin W + diff --git a/play-services-cast-framework-api/gradle.properties b/play-services-cast-framework-api/gradle.properties new file mode 100644 index 00000000..54557daf --- /dev/null +++ b/play-services-cast-framework-api/gradle.properties @@ -0,0 +1,34 @@ +# +# Copyright 2013-2016 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. +# + +POM_NAME=Play Services Internal Cast Framework API +POM_DESCRIPTION=Interfaces and objects for IPC between Play Services Library and Play Services Core + +POM_PACKAGING=aar + +POM_URL=https://github.com/microg/android_external_GmsApi + +POM_SCM_URL=https://github.com/microg/android_external_GmsApi +POM_SCM_CONNECTION=scm:git@github.com:microg/android_external_GmsApi.git +POM_SCM_DEV_CONNECTION=scm:git@github.com:microg/android_external_GmsApi.git + +POM_LICENCE_NAME=The Apache Software License, Version 2.0 +POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt +POM_LICENCE_DIST=repo + +POM_DEVELOPER_ID=mar-v-in +POM_DEVELOPER_NAME=Marvin W + diff --git a/play-services-iid-api/gradle.properties b/play-services-iid-api/gradle.properties new file mode 100644 index 00000000..d54aab99 --- /dev/null +++ b/play-services-iid-api/gradle.properties @@ -0,0 +1,34 @@ +# +# Copyright 2013-2016 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. +# + +POM_NAME=Play Services Internal IID API +POM_DESCRIPTION=Interfaces and objects for IPC between Play Services Library and Play Services Core + +POM_PACKAGING=aar + +POM_URL=https://github.com/microg/android_external_GmsApi + +POM_SCM_URL=https://github.com/microg/android_external_GmsApi +POM_SCM_CONNECTION=scm:git@github.com:microg/android_external_GmsApi.git +POM_SCM_DEV_CONNECTION=scm:git@github.com:microg/android_external_GmsApi.git + +POM_LICENCE_NAME=The Apache Software License, Version 2.0 +POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt +POM_LICENCE_DIST=repo + +POM_DEVELOPER_ID=mar-v-in +POM_DEVELOPER_NAME=Marvin W + diff --git a/play-services-location-api/gradle.properties b/play-services-location-api/gradle.properties new file mode 100644 index 00000000..de0a3085 --- /dev/null +++ b/play-services-location-api/gradle.properties @@ -0,0 +1,34 @@ +# +# Copyright 2013-2016 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. +# + +POM_NAME=Play Services Internal Location API +POM_DESCRIPTION=Interfaces and objects for IPC between Play Services Library and Play Services Core + +POM_PACKAGING=aar + +POM_URL=https://github.com/microg/android_external_GmsApi + +POM_SCM_URL=https://github.com/microg/android_external_GmsApi +POM_SCM_CONNECTION=scm:git@github.com:microg/android_external_GmsApi.git +POM_SCM_DEV_CONNECTION=scm:git@github.com:microg/android_external_GmsApi.git + +POM_LICENCE_NAME=The Apache Software License, Version 2.0 +POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt +POM_LICENCE_DIST=repo + +POM_DEVELOPER_ID=mar-v-in +POM_DEVELOPER_NAME=Marvin W + diff --git a/play-services-wearable-api/gradle.properties b/play-services-wearable-api/gradle.properties new file mode 100644 index 00000000..c771353e --- /dev/null +++ b/play-services-wearable-api/gradle.properties @@ -0,0 +1,34 @@ +# +# Copyright 2013-2016 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. +# + +POM_NAME=Play Services Internal Wearable API +POM_DESCRIPTION=Interfaces and objects for IPC between Play Services Library and Play Services Core + +POM_PACKAGING=aar + +POM_URL=https://github.com/microg/android_external_GmsApi + +POM_SCM_URL=https://github.com/microg/android_external_GmsApi +POM_SCM_CONNECTION=scm:git@github.com:microg/android_external_GmsApi.git +POM_SCM_DEV_CONNECTION=scm:git@github.com:microg/android_external_GmsApi.git + +POM_LICENCE_NAME=The Apache Software License, Version 2.0 +POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt +POM_LICENCE_DIST=repo + +POM_DEVELOPER_ID=mar-v-in +POM_DEVELOPER_NAME=Marvin W + From 9ff42ae73a02ea971dc557f657b612113dfa6e24 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Sun, 6 Nov 2016 16:10:32 +0100 Subject: [PATCH 186/293] Move things that do not belong into basement back to base --- .../android/gms/common/ConnectionResult.java | 2 - .../android/gms/common/api/AccountInfo.java | 23 - .../google/android/gms/common/api/Api.java | 84 --- .../gms/common/api/GoogleApiClient.java | 494 ------------------ .../android/gms/common/api/PendingResult.java | 59 --- .../org/microg/gms/common/api/ApiBuilder.java | 30 -- .../microg/gms/common/api/ApiConnection.java | 27 - .../gms/common/api/GoogleApiClientImpl.java | 223 -------- .../google/android/gms/wearable/Channel.java | 94 ---- .../android/gms/wearable/ChannelApi.java | 185 ------- .../android/gms/wearable/MessageApi.java | 88 ---- .../internal/ChannelEventParcelable.java | 2 +- .../gms/wearable/internal/ChannelImpl.java | 120 ----- .../wearable/internal/ChannelParcelable.java | 42 ++ .../internal/SendMessageResponse.java | 15 +- 15 files changed, 44 insertions(+), 1444 deletions(-) delete mode 100644 play-services-basement/src/main/java/com/google/android/gms/common/api/AccountInfo.java delete mode 100644 play-services-basement/src/main/java/com/google/android/gms/common/api/Api.java delete mode 100644 play-services-basement/src/main/java/com/google/android/gms/common/api/GoogleApiClient.java delete mode 100644 play-services-basement/src/main/java/com/google/android/gms/common/api/PendingResult.java delete mode 100644 play-services-basement/src/main/java/org/microg/gms/common/api/ApiBuilder.java delete mode 100644 play-services-basement/src/main/java/org/microg/gms/common/api/ApiConnection.java delete mode 100644 play-services-basement/src/main/java/org/microg/gms/common/api/GoogleApiClientImpl.java delete mode 100644 play-services-wearable-api/src/main/java/com/google/android/gms/wearable/Channel.java delete mode 100644 play-services-wearable-api/src/main/java/com/google/android/gms/wearable/ChannelApi.java delete mode 100644 play-services-wearable-api/src/main/java/com/google/android/gms/wearable/MessageApi.java delete mode 100644 play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/ChannelImpl.java create mode 100644 play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/ChannelParcelable.java diff --git a/play-services-basement/src/main/java/com/google/android/gms/common/ConnectionResult.java b/play-services-basement/src/main/java/com/google/android/gms/common/ConnectionResult.java index f6f75c1a..afe7b99d 100644 --- a/play-services-basement/src/main/java/com/google/android/gms/common/ConnectionResult.java +++ b/play-services-basement/src/main/java/com/google/android/gms/common/ConnectionResult.java @@ -22,8 +22,6 @@ import android.content.Intent; import android.content.IntentSender; import android.text.TextUtils; -import com.google.android.gms.common.api.GoogleApiClient; - import java.util.Arrays; /** diff --git a/play-services-basement/src/main/java/com/google/android/gms/common/api/AccountInfo.java b/play-services-basement/src/main/java/com/google/android/gms/common/api/AccountInfo.java deleted file mode 100644 index 109be301..00000000 --- a/play-services-basement/src/main/java/com/google/android/gms/common/api/AccountInfo.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2013-2015 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.common.api; - -import org.microg.safeparcel.AutoSafeParcelable; - -public class AccountInfo extends AutoSafeParcelable { - public static final Creator CREATOR = new AutoCreator(AccountInfo.class); -} diff --git a/play-services-basement/src/main/java/com/google/android/gms/common/api/Api.java b/play-services-basement/src/main/java/com/google/android/gms/common/api/Api.java deleted file mode 100644 index 1b0f03f2..00000000 --- a/play-services-basement/src/main/java/com/google/android/gms/common/api/Api.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright 2013-2015 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.common.api; - -import org.microg.gms.common.PublicApi; -import org.microg.gms.common.api.ApiBuilder; - -/** - * Describes a section of the Google Play Services API that should be made available. Instances of - * this should be passed into {@link GoogleApiClient.Builder#addApi(Api)} to enable the appropriate - * parts of Google Play Services. - *

- * Google APIs are partitioned into sections which allow your application to configure only the - * services it requires. Each Google API provides an API object which can be passed to - * {@link GoogleApiClient.Builder#addApi(Api)} in order to configure and enable that functionality - * in your {@link GoogleApiClient} instance. - *

- * See {@link GoogleApiClient.Builder} for usage examples. - */ -@PublicApi -public final class Api { - - private final ApiBuilder builder; - - @PublicApi(exclude = true) - public Api(ApiBuilder builder) { - this.builder = builder; - } - - @PublicApi(exclude = true) - public ApiBuilder getBuilder() { - return builder; - } - - /** - * Base interface for API options. These are used to configure specific parameters for - * individual API surfaces. The default implementation has no parameters. - */ - @PublicApi - public interface ApiOptions { - /** - * Base interface for {@link ApiOptions} in {@link Api}s that have options. - */ - @PublicApi - interface HasOptions extends ApiOptions { - } - - /** - * Base interface for {@link ApiOptions} that are not required, don't exist. - */ - @PublicApi - interface NotRequiredOptions extends ApiOptions { - } - - /** - * {@link ApiOptions} implementation for {@link Api}s that do not take any options. - */ - @PublicApi - final class NoOptions implements NotRequiredOptions { - } - - /** - * Base interface for {@link ApiOptions} that are optional. - */ - @PublicApi - interface Optional extends HasOptions, NotRequiredOptions { - } - } - -} diff --git a/play-services-basement/src/main/java/com/google/android/gms/common/api/GoogleApiClient.java b/play-services-basement/src/main/java/com/google/android/gms/common/api/GoogleApiClient.java deleted file mode 100644 index 87b05d6b..00000000 --- a/play-services-basement/src/main/java/com/google/android/gms/common/api/GoogleApiClient.java +++ /dev/null @@ -1,494 +0,0 @@ -/* - * Copyright 2013-2015 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.common.api; - -import android.app.Activity; -import android.content.Context; -import android.os.Bundle; -import android.os.Handler; -import android.os.Looper; -import android.support.v4.app.FragmentActivity; -import android.view.View; - -import com.google.android.gms.common.ConnectionResult; - -import org.microg.gms.auth.AuthConstants; -import org.microg.gms.common.PublicApi; -import org.microg.gms.common.api.GoogleApiClientImpl; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.TimeUnit; - -/** - * The main entry point for Google Play services integration. - *

- * GoogleApiClient is used with a variety of static methods. Some of these methods require that - * GoogleApiClient be connected, some will queue up calls before GoogleApiClient is connected; - * check the specific API documentation to determine whether you need to be connected. - *

- * Before any operation is executed, the GoogleApiClient must be connected using the - * {@link #connect()} method. The client is not considered connected until the - * {@link ConnectionCallbacks#onConnected(Bundle)} callback has been called. - *

- * When your app is done using this client, call {@link #disconnect()}, even if the async result - * from {@link #connect()} has not yet been delivered. - *

- * You should instantiate a client object in your Activity's {@link Activity#onCreate(Bundle)} - * method and then call {@link #connect()} in {@link Activity#onStart()} and {@link #disconnect()} - * in {@link Activity#onStop()}, regardless of the state. - */ -@PublicApi -public interface GoogleApiClient { - /** - * Connects the client to Google Play services. Blocks until the connection either succeeds or - * fails. This is not allowed on the UI thread. - * - * @return the result of the connection - */ - ConnectionResult blockingConnect(); - - /** - * Connects the client to Google Play services. Blocks until the connection is set or failed or - * has timed out. This is not allowed on the UI thread. - * - * @param timeout the maximum time to wait - * @param unit the time unit of the {@code timeout} argument - * @return the result of the connection - */ - ConnectionResult blockingConnect(long timeout, TimeUnit unit); - - /** - * Clears the account selected by the user and reconnects the client asking the user to pick an - * account again if {@link Builder#useDefaultAccount()} was set. - * - * @return the pending result is fired once the default account has been cleared, but before - * the client is reconnected - for that {@link ConnectionCallbacks} can be used. - */ - PendingResult clearDefaultAccountAndReconnect(); - - /** - * Connects the client to Google Play services. This method returns immediately, and connects - * to the service in the background. If the connection is successful, - * {@link ConnectionCallbacks#onConnected(Bundle)} is called and enqueued items are executed. - * On a failure, {@link OnConnectionFailedListener#onConnectionFailed(ConnectionResult)} is - * called. - */ - void connect(); - - /** - * Closes the connection to Google Play services. No calls can be made using this client after - * calling this method. Any method calls that haven't executed yet will be canceled. That is - * {@link ResultCallback#onResult(Result)} won't be called, if connection to the service hasn't - * been established yet all calls already made will be canceled. - * - * @see #connect() - */ - void disconnect(); - - /** - * Checks if the client is currently connected to the service, so that requests to other - * methods will succeed. Applications should guard client actions caused by the user with a - * call to this method. - * - * @return {@code true} if the client is connected to the service. - */ - boolean isConnected(); - - /** - * Checks if the client is attempting to connect to the service. - * - * @return {@code true} if the client is attempting to connect to the service. - */ - boolean isConnecting(); - - /** - * Returns {@code true} if the specified listener is currently registered to receive connection - * events. - * - * @param listener The listener to check for. - * @return {@code true} if the specified listener is currently registered to receive connection - * events. - * @see #registerConnectionCallbacks(ConnectionCallbacks) - * @see #unregisterConnectionCallbacks(ConnectionCallbacks) - */ - boolean isConnectionCallbacksRegistered(ConnectionCallbacks listener); - - /** - * Returns {@code true} if the specified listener is currently registered to receive connection - * failed events. - * - * @param listener The listener to check for. - * @return {@code true} if the specified listener is currently registered to receive connection - * failed events. - * @see #registerConnectionFailedListener(OnConnectionFailedListener) - * @see #unregisterConnectionFailedListener(OnConnectionFailedListener) - */ - public boolean isConnectionFailedListenerRegistered(OnConnectionFailedListener listener); - - /** - * Closes the current connection to Google Play services and creates a new connection. - *

- * This method closes the current connection then returns immediately and reconnects to the - * service in the background. - *

- * After calling this method, your application will receive - * {@link ConnectionCallbacks#onConnected(Bundle)} if the connection is successful, or - * {@link OnConnectionFailedListener#onConnectionFailed(ConnectionResult)} if the connection - * failed. - * - * @see #connect() - * @see #disconnect() - */ - void reconnect(); - - /** - * Registers a listener to receive connection events from this {@link GoogleApiClient}. If the - * service is already connected, the listener's {@link ConnectionCallbacks#onConnected(Bundle)} - * method will be called immediately. Applications should balance calls to this method with - * calls to {@link #unregisterConnectionCallbacks(ConnectionCallbacks)} to avoid leaking - * resources. - *

- * If the specified listener is already registered to receive connection events, this method - * will not add a duplicate entry for the same listener, but will still call the listener's - * {@link ConnectionCallbacks#onConnected(Bundle)} method if currently connected. - *

- * Note that the order of messages received here may not be stable, so clients should not rely - * on the order that multiple listeners receive events in. - * - * @param listener the listener where the results of the asynchronous {@link #connect()} call - * are delivered. - */ - void registerConnectionCallbacks(ConnectionCallbacks listener); - - /** - * Registers a listener to receive connection failed events from this {@link GoogleApiClient}. - * Unlike {@link #registerConnectionCallbacks(ConnectionCallbacks)}, if the service is not - * already connected, the listener's - * {@link OnConnectionFailedListener#onConnectionFailed(ConnectionResult)} method will not be - * called immediately. Applications should balance calls to this method with calls to - * {@link #unregisterConnectionFailedListener(OnConnectionFailedListener)} to avoid leaking - * resources. - *

- * If the specified listener is already registered to receive connection failed events, this - * method will not add a duplicate entry for the same listener. - *

- * Note that the order of messages received here may not be stable, so clients should not rely - * on the order that multiple listeners receive events in. - * - * @param listener the listener where the results of the asynchronous {@link #connect()} call - * are delivered. - */ - public void registerConnectionFailedListener(OnConnectionFailedListener listener); - - /** - * Disconnects the client and stops automatic lifecycle management. Use this before creating a - * new client (which might be necessary when switching accounts, changing the set of used APIs - * etc.). - *

- * This method must be called from the main thread. - * - * @param lifecycleActivity the activity managing the client's lifecycle. - * @throws IllegalStateException if called from outside of the main thread. - * @see Builder#enableAutoManage(FragmentActivity, int, OnConnectionFailedListener) - */ - void stopAutoManager(FragmentActivity lifecycleActivity) throws IllegalStateException; - - /** - * Removes a connection listener from this {@link GoogleApiClient}. Note that removing a - * listener does not generate any callbacks. - *

- * If the specified listener is not currently registered to receive connection events, this - * method will have no effect. - * - * @param listener the listener to unregister. - */ - void unregisterConnectionCallbacks(ConnectionCallbacks listener); - - /** - * Removes a connection failed listener from the {@link GoogleApiClient}. Note that removing a - * listener does not generate any callbacks. - *

- * If the specified listener is not currently registered to receive connection failed events, - * this method will have no effect. - * - * @param listener the listener to unregister. - */ - void unregisterConnectionFailedListener(OnConnectionFailedListener listener); - - /** - * Builder to configure a {@link GoogleApiClient}. - */ - @PublicApi - class Builder { - private final Context context; - private final Map apis = new HashMap(); - private final Set connectionCallbacks = new HashSet(); - private final Set connectionFailedListeners = new HashSet(); - private final Set scopes = new HashSet(); - private String accountName; - private int clientId = -1; - private FragmentActivity fragmentActivity; - private Looper looper; - private int gravityForPopups; - private OnConnectionFailedListener unresolvedConnectionFailedListener; - private View viewForPopups; - - /** - * Builder to help construct the {@link GoogleApiClient} object. - * - * @param context The context to use for the connection. - */ - public Builder(Context context) { - this.context = context; - this.looper = context.getMainLooper(); - } - - /** - * Builder to help construct the {@link GoogleApiClient} object. - * - * @param context The context to use for the connection. - * @param connectedListener The listener where the results of the asynchronous - * {@link #connect()} call are delivered. - * @param connectionFailedListener The listener which will be notified if the connection - * attempt fails. - */ - public Builder(Context context, ConnectionCallbacks connectedListener, - OnConnectionFailedListener connectionFailedListener) { - this(context); - addConnectionCallbacks(connectedListener); - addOnConnectionFailedListener(connectionFailedListener); - } - - /** - * Specify which Apis are requested by your app. See {@link Api} for more information. - * - * @param api The Api requested by your app. - * @param options Any additional parameters required for the specific AP - * @see Api - */ - public Builder addApi(Api api, O options) { - apis.put(api, options); - return this; - } - - /** - * Specify which Apis are requested by your app. See {@link Api} for more information. - * - * @param api The Api requested by your app. - * @see Api - */ - public Builder addApi(Api api) { - apis.put(api, null); - return this; - } - - /** - * Registers a listener to receive connection events from this {@link GoogleApiClient}. - * Applications should balance calls to this method with calls to - * {@link #unregisterConnectionCallbacks(ConnectionCallbacks)} to avoid - * leaking resources. - *

- * If the specified listener is already registered to receive connection events, this - * method will not add a duplicate entry for the same listener. - *

- * Note that the order of messages received here may not be stable, so clients should not - * rely on the order that multiple listeners receive events in. - * - * @param listener the listener where the results of the asynchronous {@link #connect()} - * call are delivered. - */ - public Builder addConnectionCallbacks(ConnectionCallbacks listener) { - connectionCallbacks.add(listener); - return this; - } - - /** - * Adds a listener to register to receive connection failed events from this - * {@link GoogleApiClient}. Applications should balance calls to this method with calls to - * {@link #unregisterConnectionFailedListener(OnConnectionFailedListener)} to avoid - * leaking resources. - *

- * If the specified listener is already registered to receive connection failed events, - * this method will not add a duplicate entry for the same listener. - *

- * Note that the order of messages received here may not be stable, so clients should not - * rely on the order that multiple listeners receive events in. - * - * @param listener the listener where the results of the asynchronous {@link #connect()} - * call are delivered. - */ - public Builder addOnConnectionFailedListener(OnConnectionFailedListener listener) { - connectionFailedListeners.add(listener); - return this; - } - - /** - * Specify the OAuth 2.0 scopes requested by your app. See - * {@link com.google.android.gms.common.Scopes} for more information. - * - * @param scope The OAuth 2.0 scopes requested by your app. - * @see com.google.android.gms.common.Scopes - */ - public Builder addScope(Scope scope) { - scopes.add(scope.getScopeUri()); - return this; - } - - /** - * Builds a new {@link GoogleApiClient} object for communicating with the Google APIs. - * - * @return The {@link GoogleApiClient} object. - */ - public GoogleApiClient build() { - return new GoogleApiClientImpl(context, looper, getAccountInfo(), apis, - connectionCallbacks, connectionFailedListeners, clientId); - } - - private AccountInfo getAccountInfo() { - return null; - } - - public Builder enableAutoManage(FragmentActivity fragmentActivity, int cliendId, - OnConnectionFailedListener unresolvedConnectionFailedListener) - throws NullPointerException, IllegalArgumentException, IllegalStateException { - this.fragmentActivity = fragmentActivity; - this.clientId = cliendId; - this.unresolvedConnectionFailedListener = unresolvedConnectionFailedListener; - return this; - } - - /** - * Specify an account name on the device that should be used. If this is never called, the - * client will use the current default account for Google Play services for this - * application. - * - * @param accountName The account name on the device that should be used by - * {@link GoogleApiClient}. - */ - public Builder setAccountName(String accountName) { - this.accountName = accountName; - return this; - } - - /** - * Specifies the part of the screen at which games service popups (for example, - * "welcome back" or "achievement unlocked" popups) will be displayed using gravity. - * - * @param gravityForPopups The gravity which controls the placement of games service popups. - */ - public Builder setGravityForPopups(int gravityForPopups) { - this.gravityForPopups = gravityForPopups; - return this; - } - - /** - * Sets a {@link Handler} to indicate which thread to use when invoking callbacks. Will not - * be used directly to handle callbacks. If this is not called then the application's main - * thread will be used. - */ - public Builder setHandler(Handler handler) { - this.looper = handler.getLooper(); - return this; - } - - /** - * Sets the {@link View} to use as a content view for popups. - * - * @param viewForPopups The view to use as a content view for popups. View cannot be null. - */ - public Builder setViewForPopups(View viewForPopups) { - this.viewForPopups = viewForPopups; - return this; - } - - /** - * Specify that the default account should be used when connecting to services. - */ - public Builder useDefaultAccount() { - this.accountName = AuthConstants.DEFAULT_ACCOUNT; - return this; - } - } - - /** - * Provides callbacks that are called when the client is connected or disconnected from the - * service. Most applications implement {@link #onConnected(Bundle)} to start making requests. - */ - @PublicApi - interface ConnectionCallbacks { - /** - * A suspension cause informing that the service has been killed. - */ - int CAUSE_SERVICE_DISCONNECTED = 1; - /** - * A suspension cause informing you that a peer device connection was lost. - */ - int CAUSE_NETWORK_LOST = 2; - - /** - * After calling {@link #connect()}, this method will be invoked asynchronously when the - * connect request has successfully completed. After this callback, the application can - * make requests on other methods provided by the client and expect that no user - * intervention is required to call methods that use account and scopes provided to the - * client constructor. - *

- * Note that the contents of the {@code connectionHint} Bundle are defined by the specific - * services. Please see the documentation of the specific implementation of - * {@link GoogleApiClient} you are using for more information. - * - * @param connectionHint Bundle of data provided to clients by Google Play services. May - * be null if no content is provided by the service. - */ - void onConnected(Bundle connectionHint); - - /** - * Called when the client is temporarily in a disconnected state. This can happen if there - * is a problem with the remote service (e.g. a crash or resource problem causes it to be - * killed by the system). When called, all requests have been canceled and no outstanding - * listeners will be executed. GoogleApiClient will automatically attempt to restore the - * connection. Applications should disable UI components that require the service, and wait - * for a call to {@link #onConnected(Bundle)} to re-enable them. - * - * @param cause The reason for the disconnection. Defined by constants {@code CAUSE_*}. - */ - void onConnectionSuspended(int cause); - } - - /** - * Provides callbacks for scenarios that result in a failed attempt to connect the client to - * the service. See {@link ConnectionResult} for a list of error codes and suggestions for - * resolution. - */ - @PublicApi - interface OnConnectionFailedListener { - /** - * Called when there was an error connecting the client to the service. - * - * @param result A {@link ConnectionResult} that can be used for resolving the error, and - * deciding what sort of error occurred. To resolve the error, the resolution - * must be started from an activity with a non-negative {@code requestCode} - * passed to {@link ConnectionResult#startResolutionForResult(Activity, int)}. - * Applications should implement {@link Activity#onActivityResult} in their - * Activity to call {@link #connect()} again if the user has resolved the - * issue (resultCode is {@link Activity#RESULT_OK}). - */ - void onConnectionFailed(ConnectionResult result); - } -} diff --git a/play-services-basement/src/main/java/com/google/android/gms/common/api/PendingResult.java b/play-services-basement/src/main/java/com/google/android/gms/common/api/PendingResult.java deleted file mode 100644 index 28943f18..00000000 --- a/play-services-basement/src/main/java/com/google/android/gms/common/api/PendingResult.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2013-2015 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.common.api; - -import java.util.concurrent.TimeUnit; - -/** - * Represents a pending result from calling an API method in Google Play services. The final result - * object from a PendingResult is of type R, which can be retrieved in one of two ways. - *

- *

    - *
  • via blocking calls to {@link #await()}, or {@link #await(long, TimeUnit)}, or
  • - *
  • via a callback by passing in an object implementing interface {@link ResultCallback} to - * {@link #setResultCallback(ResultCallback)}.
  • - *
- * After the result has been retrieved using {@link #await()} or delivered to the result callback, - * it is an error to attempt to retrieve the result again. It is the responsibility of the caller - * or callback receiver to release any resources associated with the returned result. Some result - * types may implement {@link Releasable}, in which case {@link Releasable#release()} should be - * used to free the associated resources. - *

- * TODO: Docs - */ -public interface PendingResult { - /** - * Blocks until the task is completed. This is not allowed on the UI thread. The returned - * result object can have an additional failure mode of INTERRUPTED. - */ - public R await(); - - /** - * Blocks until the task is completed or has timed out waiting for the result. This is not - * allowed on the UI thread. The returned result object can have an additional failure mode - * of either INTERRUPTED or TIMEOUT. - */ - public R await(long time, TimeUnit unit); - - public void cancel(); - - public boolean isCanceled(); - - public void setResultCallback(ResultCallback callback, long time, TimeUnit unit); - - public void setResultCallback(ResultCallback callback); -} diff --git a/play-services-basement/src/main/java/org/microg/gms/common/api/ApiBuilder.java b/play-services-basement/src/main/java/org/microg/gms/common/api/ApiBuilder.java deleted file mode 100644 index 6c12551e..00000000 --- a/play-services-basement/src/main/java/org/microg/gms/common/api/ApiBuilder.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2013-2016 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 org.microg.gms.common.api; - -import android.content.Context; -import android.os.Looper; - -import com.google.android.gms.common.api.AccountInfo; -import com.google.android.gms.common.api.Api; -import com.google.android.gms.common.api.GoogleApiClient; - -public interface ApiBuilder { - ApiConnection build(Context context, Looper looper, O options, AccountInfo accountInfo, - GoogleApiClient.ConnectionCallbacks callbacks, - GoogleApiClient.OnConnectionFailedListener connectionFailedListener); -} diff --git a/play-services-basement/src/main/java/org/microg/gms/common/api/ApiConnection.java b/play-services-basement/src/main/java/org/microg/gms/common/api/ApiConnection.java deleted file mode 100644 index 019ea5d8..00000000 --- a/play-services-basement/src/main/java/org/microg/gms/common/api/ApiConnection.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2013-2015 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 org.microg.gms.common.api; - -public interface ApiConnection { - void connect(); - - void disconnect(); - - boolean isConnected(); - - boolean isConnecting(); -} diff --git a/play-services-basement/src/main/java/org/microg/gms/common/api/GoogleApiClientImpl.java b/play-services-basement/src/main/java/org/microg/gms/common/api/GoogleApiClientImpl.java deleted file mode 100644 index 5993b403..00000000 --- a/play-services-basement/src/main/java/org/microg/gms/common/api/GoogleApiClientImpl.java +++ /dev/null @@ -1,223 +0,0 @@ -/* - * Copyright 2013-2016 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 org.microg.gms.common.api; - -import android.content.Context; -import android.os.Bundle; -import android.os.Looper; -import android.os.Message; -import android.support.v4.app.FragmentActivity; -import android.util.Log; - -import com.google.android.gms.common.ConnectionResult; -import com.google.android.gms.common.api.AccountInfo; -import com.google.android.gms.common.api.Api; -import com.google.android.gms.common.api.GoogleApiClient; -import com.google.android.gms.common.api.PendingResult; -import com.google.android.gms.common.api.Status; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.TimeUnit; - -public class GoogleApiClientImpl implements GoogleApiClient { - private static final String TAG = "GmsApiClientImpl"; - - private final Context context; - private final Looper looper; - private final AccountInfo accountInfo; - private final Map apis = new HashMap(); - private final Map apiConnections = new HashMap(); - private final Handler handler; - private final Set connectionCallbacks = new HashSet(); - private final Set connectionFailedListeners = new HashSet(); - private final int clientId; - private final ConnectionCallbacks baseConnectionCallbacks = new ConnectionCallbacks() { - @Override - public void onConnected(Bundle connectionHint) { - Log.d(TAG, "ConnectionCallbacks : onConnected()"); - for (ConnectionCallbacks callback : connectionCallbacks) { - callback.onConnected(connectionHint); - } - } - - @Override - public void onConnectionSuspended(int cause) { - Log.d(TAG, "ConnectionCallbacks : onConnectionSuspended()"); - for (ConnectionCallbacks callback : connectionCallbacks) { - callback.onConnectionSuspended(cause); - } - } - }; - private final OnConnectionFailedListener baseConnectionFailedListener = new - OnConnectionFailedListener() { - @Override - public void onConnectionFailed(ConnectionResult result) { - Log.d(TAG, "OnConnectionFailedListener : onConnectionFailed()"); - for (OnConnectionFailedListener listener : connectionFailedListeners) { - listener.onConnectionFailed(result); - } - } - }; - - public GoogleApiClientImpl(Context context, Looper looper, AccountInfo accountInfo, - Map apis, - Set connectionCallbacks, - Set connectionFailedListeners, int clientId) { - this.context = context; - this.looper = looper; - this.handler = new Handler(looper); - this.accountInfo = accountInfo; - this.apis.putAll(apis); - this.connectionCallbacks.addAll(connectionCallbacks); - this.connectionFailedListeners.addAll(connectionFailedListeners); - this.clientId = clientId; - - for (Api api : apis.keySet()) { - apiConnections.put(api, api.getBuilder().build(context, looper, - apis.get(api), accountInfo, baseConnectionCallbacks, - baseConnectionFailedListener)); - } - } - - public Looper getLooper() { - return looper; - } - - public ApiConnection getApiConnection(Api api) { - return apiConnections.get(api); - } - - @Override - public ConnectionResult blockingConnect() { - return null; - } - - @Override - public ConnectionResult blockingConnect(long timeout, TimeUnit unit) { - return null; - } - - @Override - public PendingResult clearDefaultAccountAndReconnect() { - return null; - } - - @Override - public synchronized void connect() { - Log.d(TAG, "connect()"); - if (isConnected() || isConnecting()) { - Log.d(TAG, "Already connected/connecting, nothing to do"); - return; - } - for (ApiConnection connection : apiConnections.values()) { - if (!connection.isConnected()) { - connection.connect(); - } - } - } - - @Override - public synchronized void disconnect() { - Log.d(TAG, "disconnect()"); - for (ApiConnection connection : apiConnections.values()) { - if (connection.isConnected()) { - connection.disconnect(); - } - } - } - - @Override - public synchronized boolean isConnected() { - for (ApiConnection connection : apiConnections.values()) { - if (!connection.isConnected()) return false; - } - return true; - } - - @Override - public synchronized boolean isConnecting() { - for (ApiConnection connection : apiConnections.values()) { - if (connection.isConnecting()) return true; - } - return false; - } - - @Override - public boolean isConnectionCallbacksRegistered(ConnectionCallbacks listener) { - return connectionCallbacks.contains(listener); - } - - @Override - public boolean isConnectionFailedListenerRegistered( - OnConnectionFailedListener listener) { - return connectionFailedListeners.contains(listener); - } - - @Override - public synchronized void reconnect() { - Log.d(TAG, "reconnect()"); - disconnect(); - connect(); - } - - @Override - public void registerConnectionCallbacks(ConnectionCallbacks listener) { - connectionCallbacks.add(listener); - } - - @Override - public void registerConnectionFailedListener(OnConnectionFailedListener listener) { - connectionFailedListeners.add(listener); - } - - @Override - public void stopAutoManager(FragmentActivity lifecycleActivity) throws IllegalStateException { - - } - - @Override - public void unregisterConnectionCallbacks(ConnectionCallbacks listener) { - connectionCallbacks.remove(listener); - } - - @Override - public void unregisterConnectionFailedListener(OnConnectionFailedListener listener) { - connectionFailedListeners.remove(listener); - } - - private class Handler extends android.os.Handler { - private Handler(Looper looper) { - super(looper); - } - - @Override - public void handleMessage(Message msg) { - if (msg.what == 0 && msg.obj instanceof Runnable) { - ((Runnable) msg.obj).run(); - } else { - super.handleMessage(msg); - } - } - - public void sendRunnable(Runnable runnable) { - sendMessage(obtainMessage(1, runnable)); - } - } -} diff --git a/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/Channel.java b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/Channel.java deleted file mode 100644 index 7c74ca5f..00000000 --- a/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/Channel.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright 2013-2016 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; - -import android.net.Uri; -import android.os.Parcelable; - -import com.google.android.gms.common.api.GoogleApiClient; -import com.google.android.gms.common.api.PendingResult; -import com.google.android.gms.common.api.Releasable; -import com.google.android.gms.common.api.Result; -import com.google.android.gms.common.api.Status; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; - -/** - * A channel created through {@link ChannelApi#openChannel(GoogleApiClient, String, String)}. - *

- * The implementation of this interface is parcelable and immutable, and implements reasonable {@link #equals(Object)} - * and {@link #hashCode()} methods, so can be used in collections. - */ -public interface Channel extends Parcelable { - - PendingResult addListener(GoogleApiClient client, ChannelApi.ChannelListener listener); - - PendingResult close(GoogleApiClient client, int errorCode); - - PendingResult close(GoogleApiClient client); - - PendingResult getInputStream(GoogleApiClient client); - - PendingResult getOutputStream(GoogleApiClient client); - - String getPath(); - - PendingResult receiveFile(GoogleApiClient client, Uri uri, boolean append); - - PendingResult removeListener(GoogleApiClient client, ChannelApi.ChannelListener listener); - - PendingResult sendFile(GoogleApiClient client, Uri uri); - - PendingResult sendFile(GoogleApiClient client, Uri uri, long startOffset, long length); - - interface GetInputStreamResult extends Releasable, Result { - /** - * Returns an input stream which can read data from the remote node. The stream should be - * closed when no longer needed. This method will only return {@code null} if this result's - * {@linkplain #getStatus() status} was not {@linkplain Status#isSuccess() success}. - *

- * The returned stream will throw {@link IOException} on read if any connection errors - * occur. This exception might be a {@link ChannelIOException}. - *

- * Since data for this stream comes over the network, reads may block for a long time. - *

- * Multiple calls to this method will return the same instance. - */ - InputStream getInputStream(); - } - - interface GetOutputStreamResult extends Releasable, Result { - /** - * Returns an output stream which can send data to a remote node. The stream should be - * closed when no longer needed. This method will only return {@code null} if this result's - * {@linkplain #getStatus() status} was not {@linkplain Status#isSuccess() success}. - *

- * The returned stream will throw {@link IOException} on read if any connection errors - * occur. This exception might be a {@link ChannelIOException}. - *

- * Since data for this stream comes over the network, reads may block for a long time. - *

- * Data written to this stream is buffered. If you wish to send the current data without - * waiting for the buffer to fill up, {@linkplain OutputStream#flush() flush} the stream. - *

- * Multiple calls to this method will return the same instance. - */ - OutputStream getOutputStream(); - } -} diff --git a/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/ChannelApi.java b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/ChannelApi.java deleted file mode 100644 index 66d6ae71..00000000 --- a/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/ChannelApi.java +++ /dev/null @@ -1,185 +0,0 @@ -/* - * Copyright 2013-2016 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; - -import com.google.android.gms.common.api.GoogleApiClient; -import com.google.android.gms.common.api.GoogleApiClient.Builder; -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.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; - -/** - * Client interface for Wearable Channel API. Allows apps on a wearable device to send and receive - * data from other wearable nodes. - *

- * Channels are bidirectional. Each side, both the initiator and the receiver may both read and - * write to the channel by using {@link Channel#getOutputStream(GoogleApiClient)} and {@link Channel#getInputStream(GoogleApiClient)}. - * Once a channel is established, the API for the initiator and receiver are identical. - *

- * Channels are only available when the wearable nodes are connected. When the remote node - * disconnects, all existing channels will be closed. Any listeners (added through {@link #addListener(GoogleApiClient, ChannelListener)} - * and any installed {@link WearableListenerService}) will be notified of the channel closing. - */ -public interface ChannelApi { - /** - * Channel action for use in listener filters. - * - * @see WearableListenerService - */ - String ACTION_CHANNEL_EVENT = "com.google.android.gms.wearable.CHANNEL_EVENT"; - - /** - * Registers a listener to be notified of channel events. Calls to this method should be - * balanced with calls to {@link #removeListener(GoogleApiClient, ChannelListener)} to avoid - * leaking resources. - *

- * Listener events will be called on the main thread, or the handler specified on {@code client} - * when it was built (using {@link Builder#setHandler(Handler)}). - *

- * Callers wishing to be notified of events in the background should use {@link WearableListenerService}. - * - * @param client a connected client - * @param listener a listener which will be notified of changes to any channel - */ - PendingResult addListener(GoogleApiClient client, ChannelListener listener); - - /** - * Opens a channel to exchange data with a remote node. - *

- * Channel which are no longer needed should be closed using {@link Channel#close(GoogleApiClient)}. - *

- * This call involves a network round trip, so may be long running. {@code client} must remain - * connected during that time, or the request will be cancelled (like any other Play Services - * API calls). - * - * @param client a connected client - * @param nodeId the node ID of a wearable node, as returned from {@link NodeApi#getConnectedNodes(GoogleApiClient)} - * @param path an app-specific identifier for the channel - */ - PendingResult openChannel(GoogleApiClient client, String nodeId, String path); - - /** - * Removes a listener which was previously added through {@link #addListener(GoogleApiClient, ChannelListener)}. - * - * @param client a connected client - * @param listener a listener which was added using {@link #addListener(GoogleApiClient, ChannelListener)} - */ - PendingResult removeListener(GoogleApiClient client, ChannelListener listener); - - /** - * A listener which will be notified on changes to channels. - */ - interface ChannelListener { - /** - * Value passed to {@link #onChannelClosed(Channel, int, int)}, {@link #onInputClosed(Channel, int, int)} - * and {@link #onOutputClosed(Channel, int, int)} when the closing is due to a remote node - * being disconnected. - */ - int CLOSE_REASON_DISCONNECTED = 1; - - /** - * Value passed to {@link #onChannelClosed(Channel, int, int)}, {@link #onInputClosed(Channel, int, int)} - * and {@link #onOutputClosed(Channel, int, int)} when the stream is closed due to the - * local node calling {@link Channel#close(GoogleApiClient)} or {@link Channel#close(GoogleApiClient, int)}. - */ - int CLOSE_REASON_LOCAL_CLOSE = 3; - - /** - * Value passed to {@link #onInputClosed(Channel, int, int)} or {@link #onOutputClosed(Channel, int, int)} - * (but not {@link #onChannelClosed(Channel, int, int)}), when the stream was closed under - * normal conditions, e.g the whole file was read, or the OutputStream on the remote node - * was closed normally. - */ - int CLOSE_REASON_NORMAL = 0; - - /** - * Value passed to {@link #onChannelClosed(Channel, int, int)}, {@link #onInputClosed(Channel, int, int)} - * and {@link #onOutputClosed(Channel, int, int)} when the stream is closed due to the - * remote node calling {@link Channel#close(GoogleApiClient)} or {@link Channel#close(GoogleApiClient, int)}. - */ - int CLOSE_REASON_REMOTE_CLOSE = 2; - - /** - * Called when a channel is closed. This can happen through an explicit call to {@link Channel#close(GoogleApiClient)} - * or {@link #close(GoogleApiClient, int)} on either side of the connection, or due to - * disconnecting from the remote node. - * - * @param closeReason the reason for the channel closing. One of {@link #CLOSE_REASON_DISCONNECTED}, - * {@link #CLOSE_REASON_REMOTE_CLOSE}, or {@link #CLOSE_REASON_LOCAL_CLOSE}. - * @param appSpecificErrorCode the error code specified on {@link Channel#close(GoogleApiClient, int)}, - * or 0 if closeReason is {@link #CLOSE_REASON_DISCONNECTED}. - */ - void onChannelClosed(Channel channel, int closeReason, int appSpecificErrorCode); - - /** - * Called when a new channel is opened by a remote node. - */ - void onChannelOpened(Channel channel); - - /** - * Called when the input side of a channel is closed. - * - * @param closeReason the reason for the channel closing. One of {@link #CLOSE_REASON_DISCONNECTED}, - * {@link #CLOSE_REASON_REMOTE_CLOSE}, {@link #CLOSE_REASON_LOCAL_CLOSE} - * or {@link #CLOSE_REASON_NORMAL}. - * @param appSpecificErrorCode the error code specified on {@link Channel#close(GoogleApiClient, int)}, - * or 0 if closeReason is {@link #CLOSE_REASON_DISCONNECTED} or - * {@link #CLOSE_REASON_NORMAL}. - */ - void onInputClosed(Channel channel, @CloseReason int closeReason, int appSpecificErrorCode); - - /** - * Called when the output side of a channel is closed. - * - * @param closeReason the reason for the channel closing. One of {@link #CLOSE_REASON_DISCONNECTED}, - * {@link #CLOSE_REASON_REMOTE_CLOSE}, {@link #CLOSE_REASON_LOCAL_CLOSE} - * or {@link #CLOSE_REASON_NORMAL}. - * @param appSpecificErrorCode the error code specified on {@link Channel#close(GoogleApiClient, int)}, - * or 0 if closeReason is {@link #CLOSE_REASON_DISCONNECTED} or - * {@link #CLOSE_REASON_NORMAL}. - */ - void onOutputClosed(Channel channel, @CloseReason int closeReason, int appSpecificErrorCode); - } - - /** - * An annotation for values passed to {@link ChannelListener#onChannelClosed(Channel, int, int)}, - * and other methods on the {@link ChannelListener} interface. Annotated method parameters will - * always take one of the following values: - *

    - *
  • {@link ChannelListener#CLOSE_REASON_DISCONNECTED}
  • - *
  • {@link ChannelListener#CLOSE_REASON_NORMAL}
  • - *
  • {@link ChannelListener#CLOSE_REASON_LOCAL_CLOSE}
  • - *
  • {@link ChannelListener#CLOSE_REASON_REMOTE_CLOSE}
  • - *
- */ - @Retention(RetentionPolicy.SOURCE) - @interface CloseReason { - } - - /** - * Result of {@link #openChannel(GoogleApiClient, String, String)}. - */ - interface OpenChannelResult extends Result { - /** - * Returns the newly created channel, or {@code null}, if the connection couldn't be opened. - */ - Channel getChannel(); - } -} diff --git a/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/MessageApi.java b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/MessageApi.java deleted file mode 100644 index e2016f73..00000000 --- a/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/MessageApi.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright 2013-2015 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; - -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; - -@PublicApi -public interface MessageApi { - - /** - * A value returned by {@link SendMessageResult#getRequestId()} when - * {@link #sendMessage(GoogleApiClient, String, String, byte[])} fails. - */ - int UNKNOWN_REQUEST_ID = -1; - - /** - * Registers a listener to be notified of received messages. Calls to this method should - * balanced with {@link #removeListener(GoogleApiClient, MessageListener)} to avoid leaking - * resources. - *

- * Callers wishing to be notified of events in the background should use {@link WearableListenerService}. - */ - PendingResult addListener(GoogleApiClient client, MessageListener listener); - - /** - * Removes a message listener which was previously added through - * {@link #addListener(GoogleApiClient, MessageListener)}. - */ - PendingResult removeListener(GoogleApiClient client, MessageListener listener); - - /** - * Sends {@code byte[]} data to the specified node. - * - * @param nodeId identifier for a particular node on the Android Wear network. Valid targets - * may be obtained through {@link NodeApi#getConnectedNodes(GoogleApiClient)} - * or from the host in {@link DataItem#getUri()}. - * @param path identifier used to specify a particular endpoint at the receiving node - * @param data small array of information to pass to the target node. Generally not larger - * than 100k - */ - PendingResult sendMessage(GoogleApiClient client, String nodeId, - String path, byte[] data); - - /** - * Used with {@link MessageApi#addListener(GoogleApiClient, MessageListener)} to receive - * message events. - *

- * Callers wishing to be notified of events in the background should use - * {@link WearableListenerService}. - */ - interface MessageListener { - /** - * Notification that a message has been received. - */ - void onMessageReceived(MessageEvent messageEvent); - } - - /** - * Contains the request id assigned to the message. On failure, the id will be - * {@link MessageApi#UNKNOWN_REQUEST_ID} and the status will be unsuccessful. - */ - interface SendMessageResult extends Result { - /** - * @return an ID used to identify the sent message. If {@link #getStatus()} is not - * successful, this value will be {@link MessageApi#UNKNOWN_REQUEST_ID}. - */ - int getRequestId(); - } -} diff --git a/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/ChannelEventParcelable.java b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/ChannelEventParcelable.java index 7336c2be..79a5d9e2 100644 --- a/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/ChannelEventParcelable.java +++ b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/ChannelEventParcelable.java @@ -24,7 +24,7 @@ public class ChannelEventParcelable extends AutoSafeParcelable { @SafeParceled(1) private int versionCode = 1; @SafeParceled(2) - public ChannelImpl channel; + public ChannelParcelable channel; @SafeParceled(3) public int eventType; @SafeParceled(4) diff --git a/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/ChannelImpl.java b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/ChannelImpl.java deleted file mode 100644 index 18ab6ebc..00000000 --- a/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/ChannelImpl.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright 2013-2016 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.internal; - -import android.net.Uri; -import android.util.Log; - -import com.google.android.gms.common.api.GoogleApiClient; -import com.google.android.gms.common.api.PendingResult; -import com.google.android.gms.common.api.Status; -import com.google.android.gms.wearable.Channel; -import com.google.android.gms.wearable.ChannelApi; - -import org.microg.safeparcel.AutoSafeParcelable; -import org.microg.safeparcel.SafeParceled; - -public class ChannelImpl extends AutoSafeParcelable implements Channel { - private static final String TAG = "GmsWearChannelImpl"; - - @SafeParceled(1) - private int versionCode = 1; - @SafeParceled(2) - private String token; - @SafeParceled(3) - private String nodeId; - @SafeParceled(4) - private String path; - - private ChannelImpl() { - } - - public ChannelImpl(String token, String nodeId, String path) { - this.token = token; - this.nodeId = nodeId; - this.path = path; - } - - @Override - public PendingResult addListener(GoogleApiClient client, ChannelApi.ChannelListener listener) { - Log.d(TAG, "unimplemented Method: addListener"); - return null; - } - - @Override - public PendingResult close(GoogleApiClient client, int errorCode) { - Log.d(TAG, "unimplemented Method: close"); - return null; - } - - @Override - public PendingResult close(GoogleApiClient client) { - Log.d(TAG, "unimplemented Method: close"); - return null; - } - - @Override - public PendingResult getInputStream(GoogleApiClient client) { - Log.d(TAG, "unimplemented Method: getInputStream"); - return null; - } - - @Override - public PendingResult getOutputStream(GoogleApiClient client) { - Log.d(TAG, "unimplemented Method: getOutputStream"); - return null; - } - - public String getNodeId() { - return nodeId; - } - - @Override - public String getPath() { - return path; - } - - public String getToken() { - return token; - } - - @Override - public PendingResult receiveFile(GoogleApiClient client, Uri uri, boolean append) { - Log.d(TAG, "unimplemented Method: receiveFile"); - return null; - } - - @Override - public PendingResult removeListener(GoogleApiClient client, ChannelApi.ChannelListener listener) { - Log.d(TAG, "unimplemented Method: removeListener"); - return null; - } - - @Override - public PendingResult sendFile(GoogleApiClient client, Uri uri) { - Log.d(TAG, "unimplemented Method: sendFile"); - return null; - } - - @Override - public PendingResult sendFile(GoogleApiClient client, Uri uri, long startOffset, long length) { - Log.d(TAG, "unimplemented Method: sendFile"); - return null; - } - - public static final Creator CREATOR = new AutoCreator(ChannelImpl.class); -} diff --git a/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/ChannelParcelable.java b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/ChannelParcelable.java new file mode 100644 index 00000000..95f8d643 --- /dev/null +++ b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/ChannelParcelable.java @@ -0,0 +1,42 @@ +/* + * Copyright 2013-2016 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.internal; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class ChannelParcelable extends AutoSafeParcelable { + @SafeParceled(1) + private int versionCode = 1; + @SafeParceled(2) + public String token; + @SafeParceled(3) + public String nodeId; + @SafeParceled(4) + public String path; + + private ChannelParcelable() { + } + + public ChannelParcelable(String token, String nodeId, String path) { + this.token = token; + this.nodeId = nodeId; + this.path = path; + } + + public static final Creator CREATOR = new AutoCreator(ChannelParcelable.class); +} diff --git a/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/SendMessageResponse.java b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/SendMessageResponse.java index 3d8364a6..9ac4e491 100644 --- a/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/SendMessageResponse.java +++ b/play-services-wearable-api/src/main/java/com/google/android/gms/wearable/internal/SendMessageResponse.java @@ -16,13 +16,10 @@ package com.google.android.gms.wearable.internal; -import com.google.android.gms.common.api.Status; -import com.google.android.gms.wearable.MessageApi; - import org.microg.safeparcel.AutoSafeParcelable; import org.microg.safeparcel.SafeParceled; -public class SendMessageResponse extends AutoSafeParcelable implements MessageApi.SendMessageResult { +public class SendMessageResponse extends AutoSafeParcelable { @SafeParceled(1) private int versionCode = 1; @@ -33,15 +30,5 @@ public class SendMessageResponse extends AutoSafeParcelable implements MessageAp @SafeParceled(3) public int requestId = -1; - @Override - public int getRequestId() { - return requestId; - } - - @Override - public Status getStatus() { - return new Status(statusCode); - } - public static final Creator CREATOR = new AutoCreator(SendMessageResponse.class); } From 2e3a13eaa5684a1caefcbf7d55ff80bb0d37ed12 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Sun, 6 Nov 2016 16:13:15 +0100 Subject: [PATCH 187/293] Prepare for maven publishing, adopt api changes --- README.md | 36 +- build.gradle | 2 +- extern/GmsApi | 2 +- play-services-base/gradle.properties | 34 ++ .../android/gms/common/api/AccountInfo.java | 23 + .../google/android/gms/common/api/Api.java | 84 +++ .../gms/common/api/GoogleApiClient.java | 494 ++++++++++++++++++ .../android/gms/common/api/PendingResult.java | 59 +++ .../org/microg/gms/common/GmsConnector.java | 2 + .../api/AbstractPlayServicesClient.java | 4 +- .../org/microg/gms/common/api/ApiBuilder.java | 30 ++ .../microg/gms/common/api/ApiConnection.java | 27 + .../gms/common/api/GoogleApiClientImpl.java | 242 +++++++++ play-services-cast/gradle.properties | 34 ++ play-services-gcm/gradle.properties | 34 ++ play-services-iid/gradle.properties | 34 ++ play-services-location/gradle.properties | 34 ++ play-services-tasks/gradle.properties | 34 ++ play-services-wearable/gradle.properties | 34 ++ .../google/android/gms/wearable/Channel.java | 94 ++++ .../android/gms/wearable/ChannelApi.java | 185 +++++++ .../android/gms/wearable/MessageApi.java | 88 ++++ .../gms/wearable/WearableListenerService.java | 9 +- .../org/microg/gms/wearable/ChannelImpl.java | 107 ++++ .../microg/gms/wearable/MessageApiImpl.java | 22 +- .../wearable/databundle/DataBundleUtil.java | 14 +- play-services/gradle.properties | 34 ++ 27 files changed, 1746 insertions(+), 50 deletions(-) create mode 100644 play-services-base/gradle.properties create mode 100644 play-services-base/src/main/java/com/google/android/gms/common/api/AccountInfo.java create mode 100644 play-services-base/src/main/java/com/google/android/gms/common/api/Api.java create mode 100644 play-services-base/src/main/java/com/google/android/gms/common/api/GoogleApiClient.java create mode 100644 play-services-base/src/main/java/com/google/android/gms/common/api/PendingResult.java create mode 100644 play-services-base/src/main/java/org/microg/gms/common/api/ApiBuilder.java create mode 100644 play-services-base/src/main/java/org/microg/gms/common/api/ApiConnection.java create mode 100644 play-services-base/src/main/java/org/microg/gms/common/api/GoogleApiClientImpl.java create mode 100644 play-services-cast/gradle.properties create mode 100644 play-services-gcm/gradle.properties create mode 100644 play-services-iid/gradle.properties create mode 100644 play-services-location/gradle.properties create mode 100644 play-services-tasks/gradle.properties create mode 100644 play-services-wearable/gradle.properties create mode 100644 play-services-wearable/src/main/java/com/google/android/gms/wearable/Channel.java create mode 100644 play-services-wearable/src/main/java/com/google/android/gms/wearable/ChannelApi.java create mode 100644 play-services-wearable/src/main/java/com/google/android/gms/wearable/MessageApi.java create mode 100644 play-services-wearable/src/main/java/org/microg/gms/wearable/ChannelImpl.java create mode 100644 play-services/gradle.properties diff --git a/README.md b/README.md index 1154cef8..b5adc0ea 100644 --- a/README.md +++ b/README.md @@ -9,38 +9,10 @@ WIP This is still work in progress, and most applications will not build. However feel free to try it out and create issues for missing method calls (please include an application to test it). -Example: DashClock ------------------- -[DashClock](https://code.google.com/p/dashclock/) is an open source clock widget with enhanced features. -However it uses play services as location backend and thus requires proprietary libraries to compile it. +Developer Notes +--------------- -However, it is possible to build DashClock using GmsLib, supporting all it's location features, with or without play services installed. -To do this, download and build GmsLib plus its submodules and install it to the local gradle repository: +Replace all compile includes to com.google.android.gms with org.microg master-SNAPSHOT includes - $ git clone https://github.com/microg/android_external_GmsLib.git GmsLib - $ cd GmsLib - $ git submodule update --init --recursive - $ gradle install + sed -i 's/compile [\'"]com.google.android.gms:\([^:]*\):[^\']*[\'"]/compile \'org.microg:\1:master-SNAPSHOT\'/g' build.gradle -Then update the main/build.gradle to point to non-google gms in local maven: - - repositories { - + maven { url "${System.env.HOME}/.m2/repository" } // This can be mavenLocal() since Gradle 2.0 - mavenCentral() - flatDir { - dirs '../local_aars' - } - } - - dependencies { - compile 'com.android.support:support-v13:22.0.0' - - compile 'com.google.android.gms:play-services:4.0.30' - + compile 'org.microg.gms:play-services:1.0-SNAPSHOT' - //compile 'com.mobeta.android.dslv:drag-sort-listview:0.6.1-SNAPSHOT-AAR' - compile 'com.mobeta.android.dslv:drag-sort-listview:0.6.1-SNAPSHOT-AAR@aar' - compile project(':api') - } - -Afterwards you can compile dashclock the usual way: - - $ gradle :main:assembleDebug diff --git a/build.gradle b/build.gradle index 27dfeb02..bb43d8b6 100644 --- a/build.gradle +++ b/build.gradle @@ -19,7 +19,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:2.2.0' + classpath 'com.android.tools.build:gradle:2.2.2' classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1' } } diff --git a/extern/GmsApi b/extern/GmsApi index acec513b..9ff42ae7 160000 --- a/extern/GmsApi +++ b/extern/GmsApi @@ -1 +1 @@ -Subproject commit acec513b19aaba856722fc22c9adf3f5e0ea3ac7 +Subproject commit 9ff42ae73a02ea971dc557f657b612113dfa6e24 diff --git a/play-services-base/gradle.properties b/play-services-base/gradle.properties new file mode 100644 index 00000000..b31a23e5 --- /dev/null +++ b/play-services-base/gradle.properties @@ -0,0 +1,34 @@ +# +# Copyright 2013-2016 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. +# + +POM_NAME=Play Services Library Base +POM_DESCRIPTION=Base classes used by all Play Services Library modules + +POM_PACKAGING=aar + +POM_URL=https://github.com/microg/android_external_GmsLib + +POM_SCM_URL=https://github.com/microg/android_external_GmsLib +POM_SCM_CONNECTION=scm:git@github.com:microg/android_external_GmsLib.git +POM_SCM_DEV_CONNECTION=scm:git@github.com:microg/android_external_GmsLib.git + +POM_LICENCE_NAME=The Apache Software License, Version 2.0 +POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt +POM_LICENCE_DIST=repo + +POM_DEVELOPER_ID=mar-v-in +POM_DEVELOPER_NAME=Marvin W + diff --git a/play-services-base/src/main/java/com/google/android/gms/common/api/AccountInfo.java b/play-services-base/src/main/java/com/google/android/gms/common/api/AccountInfo.java new file mode 100644 index 00000000..109be301 --- /dev/null +++ b/play-services-base/src/main/java/com/google/android/gms/common/api/AccountInfo.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.common.api; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class AccountInfo extends AutoSafeParcelable { + public static final Creator CREATOR = new AutoCreator(AccountInfo.class); +} diff --git a/play-services-base/src/main/java/com/google/android/gms/common/api/Api.java b/play-services-base/src/main/java/com/google/android/gms/common/api/Api.java new file mode 100644 index 00000000..1b0f03f2 --- /dev/null +++ b/play-services-base/src/main/java/com/google/android/gms/common/api/Api.java @@ -0,0 +1,84 @@ +/* + * Copyright 2013-2015 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.common.api; + +import org.microg.gms.common.PublicApi; +import org.microg.gms.common.api.ApiBuilder; + +/** + * Describes a section of the Google Play Services API that should be made available. Instances of + * this should be passed into {@link GoogleApiClient.Builder#addApi(Api)} to enable the appropriate + * parts of Google Play Services. + *

+ * Google APIs are partitioned into sections which allow your application to configure only the + * services it requires. Each Google API provides an API object which can be passed to + * {@link GoogleApiClient.Builder#addApi(Api)} in order to configure and enable that functionality + * in your {@link GoogleApiClient} instance. + *

+ * See {@link GoogleApiClient.Builder} for usage examples. + */ +@PublicApi +public final class Api { + + private final ApiBuilder builder; + + @PublicApi(exclude = true) + public Api(ApiBuilder builder) { + this.builder = builder; + } + + @PublicApi(exclude = true) + public ApiBuilder getBuilder() { + return builder; + } + + /** + * Base interface for API options. These are used to configure specific parameters for + * individual API surfaces. The default implementation has no parameters. + */ + @PublicApi + public interface ApiOptions { + /** + * Base interface for {@link ApiOptions} in {@link Api}s that have options. + */ + @PublicApi + interface HasOptions extends ApiOptions { + } + + /** + * Base interface for {@link ApiOptions} that are not required, don't exist. + */ + @PublicApi + interface NotRequiredOptions extends ApiOptions { + } + + /** + * {@link ApiOptions} implementation for {@link Api}s that do not take any options. + */ + @PublicApi + final class NoOptions implements NotRequiredOptions { + } + + /** + * Base interface for {@link ApiOptions} that are optional. + */ + @PublicApi + interface Optional extends HasOptions, NotRequiredOptions { + } + } + +} diff --git a/play-services-base/src/main/java/com/google/android/gms/common/api/GoogleApiClient.java b/play-services-base/src/main/java/com/google/android/gms/common/api/GoogleApiClient.java new file mode 100644 index 00000000..87b05d6b --- /dev/null +++ b/play-services-base/src/main/java/com/google/android/gms/common/api/GoogleApiClient.java @@ -0,0 +1,494 @@ +/* + * Copyright 2013-2015 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.common.api; + +import android.app.Activity; +import android.content.Context; +import android.os.Bundle; +import android.os.Handler; +import android.os.Looper; +import android.support.v4.app.FragmentActivity; +import android.view.View; + +import com.google.android.gms.common.ConnectionResult; + +import org.microg.gms.auth.AuthConstants; +import org.microg.gms.common.PublicApi; +import org.microg.gms.common.api.GoogleApiClientImpl; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.TimeUnit; + +/** + * The main entry point for Google Play services integration. + *

+ * GoogleApiClient is used with a variety of static methods. Some of these methods require that + * GoogleApiClient be connected, some will queue up calls before GoogleApiClient is connected; + * check the specific API documentation to determine whether you need to be connected. + *

+ * Before any operation is executed, the GoogleApiClient must be connected using the + * {@link #connect()} method. The client is not considered connected until the + * {@link ConnectionCallbacks#onConnected(Bundle)} callback has been called. + *

+ * When your app is done using this client, call {@link #disconnect()}, even if the async result + * from {@link #connect()} has not yet been delivered. + *

+ * You should instantiate a client object in your Activity's {@link Activity#onCreate(Bundle)} + * method and then call {@link #connect()} in {@link Activity#onStart()} and {@link #disconnect()} + * in {@link Activity#onStop()}, regardless of the state. + */ +@PublicApi +public interface GoogleApiClient { + /** + * Connects the client to Google Play services. Blocks until the connection either succeeds or + * fails. This is not allowed on the UI thread. + * + * @return the result of the connection + */ + ConnectionResult blockingConnect(); + + /** + * Connects the client to Google Play services. Blocks until the connection is set or failed or + * has timed out. This is not allowed on the UI thread. + * + * @param timeout the maximum time to wait + * @param unit the time unit of the {@code timeout} argument + * @return the result of the connection + */ + ConnectionResult blockingConnect(long timeout, TimeUnit unit); + + /** + * Clears the account selected by the user and reconnects the client asking the user to pick an + * account again if {@link Builder#useDefaultAccount()} was set. + * + * @return the pending result is fired once the default account has been cleared, but before + * the client is reconnected - for that {@link ConnectionCallbacks} can be used. + */ + PendingResult clearDefaultAccountAndReconnect(); + + /** + * Connects the client to Google Play services. This method returns immediately, and connects + * to the service in the background. If the connection is successful, + * {@link ConnectionCallbacks#onConnected(Bundle)} is called and enqueued items are executed. + * On a failure, {@link OnConnectionFailedListener#onConnectionFailed(ConnectionResult)} is + * called. + */ + void connect(); + + /** + * Closes the connection to Google Play services. No calls can be made using this client after + * calling this method. Any method calls that haven't executed yet will be canceled. That is + * {@link ResultCallback#onResult(Result)} won't be called, if connection to the service hasn't + * been established yet all calls already made will be canceled. + * + * @see #connect() + */ + void disconnect(); + + /** + * Checks if the client is currently connected to the service, so that requests to other + * methods will succeed. Applications should guard client actions caused by the user with a + * call to this method. + * + * @return {@code true} if the client is connected to the service. + */ + boolean isConnected(); + + /** + * Checks if the client is attempting to connect to the service. + * + * @return {@code true} if the client is attempting to connect to the service. + */ + boolean isConnecting(); + + /** + * Returns {@code true} if the specified listener is currently registered to receive connection + * events. + * + * @param listener The listener to check for. + * @return {@code true} if the specified listener is currently registered to receive connection + * events. + * @see #registerConnectionCallbacks(ConnectionCallbacks) + * @see #unregisterConnectionCallbacks(ConnectionCallbacks) + */ + boolean isConnectionCallbacksRegistered(ConnectionCallbacks listener); + + /** + * Returns {@code true} if the specified listener is currently registered to receive connection + * failed events. + * + * @param listener The listener to check for. + * @return {@code true} if the specified listener is currently registered to receive connection + * failed events. + * @see #registerConnectionFailedListener(OnConnectionFailedListener) + * @see #unregisterConnectionFailedListener(OnConnectionFailedListener) + */ + public boolean isConnectionFailedListenerRegistered(OnConnectionFailedListener listener); + + /** + * Closes the current connection to Google Play services and creates a new connection. + *

+ * This method closes the current connection then returns immediately and reconnects to the + * service in the background. + *

+ * After calling this method, your application will receive + * {@link ConnectionCallbacks#onConnected(Bundle)} if the connection is successful, or + * {@link OnConnectionFailedListener#onConnectionFailed(ConnectionResult)} if the connection + * failed. + * + * @see #connect() + * @see #disconnect() + */ + void reconnect(); + + /** + * Registers a listener to receive connection events from this {@link GoogleApiClient}. If the + * service is already connected, the listener's {@link ConnectionCallbacks#onConnected(Bundle)} + * method will be called immediately. Applications should balance calls to this method with + * calls to {@link #unregisterConnectionCallbacks(ConnectionCallbacks)} to avoid leaking + * resources. + *

+ * If the specified listener is already registered to receive connection events, this method + * will not add a duplicate entry for the same listener, but will still call the listener's + * {@link ConnectionCallbacks#onConnected(Bundle)} method if currently connected. + *

+ * Note that the order of messages received here may not be stable, so clients should not rely + * on the order that multiple listeners receive events in. + * + * @param listener the listener where the results of the asynchronous {@link #connect()} call + * are delivered. + */ + void registerConnectionCallbacks(ConnectionCallbacks listener); + + /** + * Registers a listener to receive connection failed events from this {@link GoogleApiClient}. + * Unlike {@link #registerConnectionCallbacks(ConnectionCallbacks)}, if the service is not + * already connected, the listener's + * {@link OnConnectionFailedListener#onConnectionFailed(ConnectionResult)} method will not be + * called immediately. Applications should balance calls to this method with calls to + * {@link #unregisterConnectionFailedListener(OnConnectionFailedListener)} to avoid leaking + * resources. + *

+ * If the specified listener is already registered to receive connection failed events, this + * method will not add a duplicate entry for the same listener. + *

+ * Note that the order of messages received here may not be stable, so clients should not rely + * on the order that multiple listeners receive events in. + * + * @param listener the listener where the results of the asynchronous {@link #connect()} call + * are delivered. + */ + public void registerConnectionFailedListener(OnConnectionFailedListener listener); + + /** + * Disconnects the client and stops automatic lifecycle management. Use this before creating a + * new client (which might be necessary when switching accounts, changing the set of used APIs + * etc.). + *

+ * This method must be called from the main thread. + * + * @param lifecycleActivity the activity managing the client's lifecycle. + * @throws IllegalStateException if called from outside of the main thread. + * @see Builder#enableAutoManage(FragmentActivity, int, OnConnectionFailedListener) + */ + void stopAutoManager(FragmentActivity lifecycleActivity) throws IllegalStateException; + + /** + * Removes a connection listener from this {@link GoogleApiClient}. Note that removing a + * listener does not generate any callbacks. + *

+ * If the specified listener is not currently registered to receive connection events, this + * method will have no effect. + * + * @param listener the listener to unregister. + */ + void unregisterConnectionCallbacks(ConnectionCallbacks listener); + + /** + * Removes a connection failed listener from the {@link GoogleApiClient}. Note that removing a + * listener does not generate any callbacks. + *

+ * If the specified listener is not currently registered to receive connection failed events, + * this method will have no effect. + * + * @param listener the listener to unregister. + */ + void unregisterConnectionFailedListener(OnConnectionFailedListener listener); + + /** + * Builder to configure a {@link GoogleApiClient}. + */ + @PublicApi + class Builder { + private final Context context; + private final Map apis = new HashMap(); + private final Set connectionCallbacks = new HashSet(); + private final Set connectionFailedListeners = new HashSet(); + private final Set scopes = new HashSet(); + private String accountName; + private int clientId = -1; + private FragmentActivity fragmentActivity; + private Looper looper; + private int gravityForPopups; + private OnConnectionFailedListener unresolvedConnectionFailedListener; + private View viewForPopups; + + /** + * Builder to help construct the {@link GoogleApiClient} object. + * + * @param context The context to use for the connection. + */ + public Builder(Context context) { + this.context = context; + this.looper = context.getMainLooper(); + } + + /** + * Builder to help construct the {@link GoogleApiClient} object. + * + * @param context The context to use for the connection. + * @param connectedListener The listener where the results of the asynchronous + * {@link #connect()} call are delivered. + * @param connectionFailedListener The listener which will be notified if the connection + * attempt fails. + */ + public Builder(Context context, ConnectionCallbacks connectedListener, + OnConnectionFailedListener connectionFailedListener) { + this(context); + addConnectionCallbacks(connectedListener); + addOnConnectionFailedListener(connectionFailedListener); + } + + /** + * Specify which Apis are requested by your app. See {@link Api} for more information. + * + * @param api The Api requested by your app. + * @param options Any additional parameters required for the specific AP + * @see Api + */ + public Builder addApi(Api api, O options) { + apis.put(api, options); + return this; + } + + /** + * Specify which Apis are requested by your app. See {@link Api} for more information. + * + * @param api The Api requested by your app. + * @see Api + */ + public Builder addApi(Api api) { + apis.put(api, null); + return this; + } + + /** + * Registers a listener to receive connection events from this {@link GoogleApiClient}. + * Applications should balance calls to this method with calls to + * {@link #unregisterConnectionCallbacks(ConnectionCallbacks)} to avoid + * leaking resources. + *

+ * If the specified listener is already registered to receive connection events, this + * method will not add a duplicate entry for the same listener. + *

+ * Note that the order of messages received here may not be stable, so clients should not + * rely on the order that multiple listeners receive events in. + * + * @param listener the listener where the results of the asynchronous {@link #connect()} + * call are delivered. + */ + public Builder addConnectionCallbacks(ConnectionCallbacks listener) { + connectionCallbacks.add(listener); + return this; + } + + /** + * Adds a listener to register to receive connection failed events from this + * {@link GoogleApiClient}. Applications should balance calls to this method with calls to + * {@link #unregisterConnectionFailedListener(OnConnectionFailedListener)} to avoid + * leaking resources. + *

+ * If the specified listener is already registered to receive connection failed events, + * this method will not add a duplicate entry for the same listener. + *

+ * Note that the order of messages received here may not be stable, so clients should not + * rely on the order that multiple listeners receive events in. + * + * @param listener the listener where the results of the asynchronous {@link #connect()} + * call are delivered. + */ + public Builder addOnConnectionFailedListener(OnConnectionFailedListener listener) { + connectionFailedListeners.add(listener); + return this; + } + + /** + * Specify the OAuth 2.0 scopes requested by your app. See + * {@link com.google.android.gms.common.Scopes} for more information. + * + * @param scope The OAuth 2.0 scopes requested by your app. + * @see com.google.android.gms.common.Scopes + */ + public Builder addScope(Scope scope) { + scopes.add(scope.getScopeUri()); + return this; + } + + /** + * Builds a new {@link GoogleApiClient} object for communicating with the Google APIs. + * + * @return The {@link GoogleApiClient} object. + */ + public GoogleApiClient build() { + return new GoogleApiClientImpl(context, looper, getAccountInfo(), apis, + connectionCallbacks, connectionFailedListeners, clientId); + } + + private AccountInfo getAccountInfo() { + return null; + } + + public Builder enableAutoManage(FragmentActivity fragmentActivity, int cliendId, + OnConnectionFailedListener unresolvedConnectionFailedListener) + throws NullPointerException, IllegalArgumentException, IllegalStateException { + this.fragmentActivity = fragmentActivity; + this.clientId = cliendId; + this.unresolvedConnectionFailedListener = unresolvedConnectionFailedListener; + return this; + } + + /** + * Specify an account name on the device that should be used. If this is never called, the + * client will use the current default account for Google Play services for this + * application. + * + * @param accountName The account name on the device that should be used by + * {@link GoogleApiClient}. + */ + public Builder setAccountName(String accountName) { + this.accountName = accountName; + return this; + } + + /** + * Specifies the part of the screen at which games service popups (for example, + * "welcome back" or "achievement unlocked" popups) will be displayed using gravity. + * + * @param gravityForPopups The gravity which controls the placement of games service popups. + */ + public Builder setGravityForPopups(int gravityForPopups) { + this.gravityForPopups = gravityForPopups; + return this; + } + + /** + * Sets a {@link Handler} to indicate which thread to use when invoking callbacks. Will not + * be used directly to handle callbacks. If this is not called then the application's main + * thread will be used. + */ + public Builder setHandler(Handler handler) { + this.looper = handler.getLooper(); + return this; + } + + /** + * Sets the {@link View} to use as a content view for popups. + * + * @param viewForPopups The view to use as a content view for popups. View cannot be null. + */ + public Builder setViewForPopups(View viewForPopups) { + this.viewForPopups = viewForPopups; + return this; + } + + /** + * Specify that the default account should be used when connecting to services. + */ + public Builder useDefaultAccount() { + this.accountName = AuthConstants.DEFAULT_ACCOUNT; + return this; + } + } + + /** + * Provides callbacks that are called when the client is connected or disconnected from the + * service. Most applications implement {@link #onConnected(Bundle)} to start making requests. + */ + @PublicApi + interface ConnectionCallbacks { + /** + * A suspension cause informing that the service has been killed. + */ + int CAUSE_SERVICE_DISCONNECTED = 1; + /** + * A suspension cause informing you that a peer device connection was lost. + */ + int CAUSE_NETWORK_LOST = 2; + + /** + * After calling {@link #connect()}, this method will be invoked asynchronously when the + * connect request has successfully completed. After this callback, the application can + * make requests on other methods provided by the client and expect that no user + * intervention is required to call methods that use account and scopes provided to the + * client constructor. + *

+ * Note that the contents of the {@code connectionHint} Bundle are defined by the specific + * services. Please see the documentation of the specific implementation of + * {@link GoogleApiClient} you are using for more information. + * + * @param connectionHint Bundle of data provided to clients by Google Play services. May + * be null if no content is provided by the service. + */ + void onConnected(Bundle connectionHint); + + /** + * Called when the client is temporarily in a disconnected state. This can happen if there + * is a problem with the remote service (e.g. a crash or resource problem causes it to be + * killed by the system). When called, all requests have been canceled and no outstanding + * listeners will be executed. GoogleApiClient will automatically attempt to restore the + * connection. Applications should disable UI components that require the service, and wait + * for a call to {@link #onConnected(Bundle)} to re-enable them. + * + * @param cause The reason for the disconnection. Defined by constants {@code CAUSE_*}. + */ + void onConnectionSuspended(int cause); + } + + /** + * Provides callbacks for scenarios that result in a failed attempt to connect the client to + * the service. See {@link ConnectionResult} for a list of error codes and suggestions for + * resolution. + */ + @PublicApi + interface OnConnectionFailedListener { + /** + * Called when there was an error connecting the client to the service. + * + * @param result A {@link ConnectionResult} that can be used for resolving the error, and + * deciding what sort of error occurred. To resolve the error, the resolution + * must be started from an activity with a non-negative {@code requestCode} + * passed to {@link ConnectionResult#startResolutionForResult(Activity, int)}. + * Applications should implement {@link Activity#onActivityResult} in their + * Activity to call {@link #connect()} again if the user has resolved the + * issue (resultCode is {@link Activity#RESULT_OK}). + */ + void onConnectionFailed(ConnectionResult result); + } +} diff --git a/play-services-base/src/main/java/com/google/android/gms/common/api/PendingResult.java b/play-services-base/src/main/java/com/google/android/gms/common/api/PendingResult.java new file mode 100644 index 00000000..28943f18 --- /dev/null +++ b/play-services-base/src/main/java/com/google/android/gms/common/api/PendingResult.java @@ -0,0 +1,59 @@ +/* + * Copyright 2013-2015 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.common.api; + +import java.util.concurrent.TimeUnit; + +/** + * Represents a pending result from calling an API method in Google Play services. The final result + * object from a PendingResult is of type R, which can be retrieved in one of two ways. + *

+ *

    + *
  • via blocking calls to {@link #await()}, or {@link #await(long, TimeUnit)}, or
  • + *
  • via a callback by passing in an object implementing interface {@link ResultCallback} to + * {@link #setResultCallback(ResultCallback)}.
  • + *
+ * After the result has been retrieved using {@link #await()} or delivered to the result callback, + * it is an error to attempt to retrieve the result again. It is the responsibility of the caller + * or callback receiver to release any resources associated with the returned result. Some result + * types may implement {@link Releasable}, in which case {@link Releasable#release()} should be + * used to free the associated resources. + *

+ * TODO: Docs + */ +public interface PendingResult { + /** + * Blocks until the task is completed. This is not allowed on the UI thread. The returned + * result object can have an additional failure mode of INTERRUPTED. + */ + public R await(); + + /** + * Blocks until the task is completed or has timed out waiting for the result. This is not + * allowed on the UI thread. The returned result object can have an additional failure mode + * of either INTERRUPTED or TIMEOUT. + */ + public R await(long time, TimeUnit unit); + + public void cancel(); + + public boolean isCanceled(); + + public void setResultCallback(ResultCallback callback, long time, TimeUnit unit); + + public void setResultCallback(ResultCallback callback); +} diff --git a/play-services-base/src/main/java/org/microg/gms/common/GmsConnector.java b/play-services-base/src/main/java/org/microg/gms/common/GmsConnector.java index 8d6dbdad..078d8f88 100644 --- a/play-services-base/src/main/java/org/microg/gms/common/GmsConnector.java +++ b/play-services-base/src/main/java/org/microg/gms/common/GmsConnector.java @@ -49,6 +49,7 @@ public class GmsConnector { public AbstractPendingResult connect() { Log.d(TAG, "connect()"); + apiClient.incrementUsageCounter(); apiClient.getApiConnection(api); Looper looper = apiClient.getLooper(); final AbstractPendingResult result = new AbstractPendingResult(looper); @@ -81,6 +82,7 @@ public class GmsConnector { @Override public void onResultAvailable(R realResult) { result.deliverResult(realResult); + apiClient.decrementUsageCounter(); } }); } catch (RemoteException ignored) { diff --git a/play-services-base/src/main/java/org/microg/gms/common/api/AbstractPlayServicesClient.java b/play-services-base/src/main/java/org/microg/gms/common/api/AbstractPlayServicesClient.java index 32d817da..5b8eb16a 100644 --- a/play-services-base/src/main/java/org/microg/gms/common/api/AbstractPlayServicesClient.java +++ b/play-services-base/src/main/java/org/microg/gms/common/api/AbstractPlayServicesClient.java @@ -25,7 +25,7 @@ import org.microg.gms.common.ForwardConnectionCallbacks; import org.microg.gms.common.ForwardConnectionFailedListener; public class AbstractPlayServicesClient implements GooglePlayServicesClient { - private static final String TAG = "GmsPlatServicesClient"; + private static final String TAG = "GmsPlayServicesClient"; protected final GoogleApiClient googleApiClient; @@ -46,7 +46,7 @@ public class AbstractPlayServicesClient implements GooglePlayServicesClient { @Override public void disconnect() { Log.d(TAG, "disconnect()"); - googleApiClient.disconnect(); + //TODO googleApiClient.disconnect(); } @Override diff --git a/play-services-base/src/main/java/org/microg/gms/common/api/ApiBuilder.java b/play-services-base/src/main/java/org/microg/gms/common/api/ApiBuilder.java new file mode 100644 index 00000000..6c12551e --- /dev/null +++ b/play-services-base/src/main/java/org/microg/gms/common/api/ApiBuilder.java @@ -0,0 +1,30 @@ +/* + * Copyright 2013-2016 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 org.microg.gms.common.api; + +import android.content.Context; +import android.os.Looper; + +import com.google.android.gms.common.api.AccountInfo; +import com.google.android.gms.common.api.Api; +import com.google.android.gms.common.api.GoogleApiClient; + +public interface ApiBuilder { + ApiConnection build(Context context, Looper looper, O options, AccountInfo accountInfo, + GoogleApiClient.ConnectionCallbacks callbacks, + GoogleApiClient.OnConnectionFailedListener connectionFailedListener); +} diff --git a/play-services-base/src/main/java/org/microg/gms/common/api/ApiConnection.java b/play-services-base/src/main/java/org/microg/gms/common/api/ApiConnection.java new file mode 100644 index 00000000..019ea5d8 --- /dev/null +++ b/play-services-base/src/main/java/org/microg/gms/common/api/ApiConnection.java @@ -0,0 +1,27 @@ +/* + * Copyright 2013-2015 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 org.microg.gms.common.api; + +public interface ApiConnection { + void connect(); + + void disconnect(); + + boolean isConnected(); + + boolean isConnecting(); +} diff --git a/play-services-base/src/main/java/org/microg/gms/common/api/GoogleApiClientImpl.java b/play-services-base/src/main/java/org/microg/gms/common/api/GoogleApiClientImpl.java new file mode 100644 index 00000000..0757a8c0 --- /dev/null +++ b/play-services-base/src/main/java/org/microg/gms/common/api/GoogleApiClientImpl.java @@ -0,0 +1,242 @@ +/* + * Copyright 2013-2016 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 org.microg.gms.common.api; + +import android.content.Context; +import android.os.Bundle; +import android.os.Looper; +import android.os.Message; +import android.support.v4.app.FragmentActivity; +import android.util.Log; + +import com.google.android.gms.common.ConnectionResult; +import com.google.android.gms.common.api.AccountInfo; +import com.google.android.gms.common.api.Api; +import com.google.android.gms.common.api.GoogleApiClient; +import com.google.android.gms.common.api.PendingResult; +import com.google.android.gms.common.api.Status; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.TimeUnit; + +public class GoogleApiClientImpl implements GoogleApiClient { + private static final String TAG = "GmsApiClientImpl"; + + private final Context context; + private final Looper looper; + private final AccountInfo accountInfo; + private final Map apis = new HashMap(); + private final Map apiConnections = new HashMap(); + private final Handler handler; + private final Set connectionCallbacks = new HashSet(); + private final Set connectionFailedListeners = new HashSet(); + private final int clientId; + private final ConnectionCallbacks baseConnectionCallbacks = new ConnectionCallbacks() { + @Override + public void onConnected(Bundle connectionHint) { + Log.d(TAG, "ConnectionCallbacks : onConnected()"); + for (ConnectionCallbacks callback : connectionCallbacks) { + callback.onConnected(connectionHint); + } + } + + @Override + public void onConnectionSuspended(int cause) { + Log.d(TAG, "ConnectionCallbacks : onConnectionSuspended()"); + for (ConnectionCallbacks callback : connectionCallbacks) { + callback.onConnectionSuspended(cause); + } + } + }; + private final OnConnectionFailedListener baseConnectionFailedListener = new + OnConnectionFailedListener() { + @Override + public void onConnectionFailed(ConnectionResult result) { + Log.d(TAG, "OnConnectionFailedListener : onConnectionFailed()"); + for (OnConnectionFailedListener listener : connectionFailedListeners) { + listener.onConnectionFailed(result); + } + } + }; + private int usageCounter = 0; + private boolean shouldDisconnect = false; + + public GoogleApiClientImpl(Context context, Looper looper, AccountInfo accountInfo, + Map apis, + Set connectionCallbacks, + Set connectionFailedListeners, int clientId) { + this.context = context; + this.looper = looper; + this.handler = new Handler(looper); + this.accountInfo = accountInfo; + this.apis.putAll(apis); + this.connectionCallbacks.addAll(connectionCallbacks); + this.connectionFailedListeners.addAll(connectionFailedListeners); + this.clientId = clientId; + + for (Api api : apis.keySet()) { + apiConnections.put(api, api.getBuilder().build(context, looper, + apis.get(api), accountInfo, baseConnectionCallbacks, + baseConnectionFailedListener)); + } + } + + public synchronized void incrementUsageCounter() { + usageCounter++; + } + + public synchronized void decrementUsageCounter() { + usageCounter--; + if (shouldDisconnect) disconnect(); + } + + public Looper getLooper() { + return looper; + } + + public ApiConnection getApiConnection(Api api) { + return apiConnections.get(api); + } + + @Override + public ConnectionResult blockingConnect() { + return null; + } + + @Override + public ConnectionResult blockingConnect(long timeout, TimeUnit unit) { + return null; + } + + @Override + public PendingResult clearDefaultAccountAndReconnect() { + return null; + } + + @Override + public synchronized void connect() { + Log.d(TAG, "connect()"); + if (isConnected() || isConnecting()) { + if (shouldDisconnect) { + shouldDisconnect = false; + return; + } + Log.d(TAG, "Already connected/connecting, nothing to do"); + return; + } + for (ApiConnection connection : apiConnections.values()) { + if (!connection.isConnected()) { + connection.connect(); + } + } + } + + @Override + public synchronized void disconnect() { + if (usageCounter > 0) { + shouldDisconnect = true; + } else { + Log.d(TAG, "disconnect()"); + for (ApiConnection connection : apiConnections.values()) { + if (connection.isConnected()) { + connection.disconnect(); + } + } + } + } + + @Override + public synchronized boolean isConnected() { + for (ApiConnection connection : apiConnections.values()) { + if (!connection.isConnected()) return false; + } + return true; + } + + @Override + public synchronized boolean isConnecting() { + for (ApiConnection connection : apiConnections.values()) { + if (connection.isConnecting()) return true; + } + return false; + } + + @Override + public boolean isConnectionCallbacksRegistered(ConnectionCallbacks listener) { + return connectionCallbacks.contains(listener); + } + + @Override + public boolean isConnectionFailedListenerRegistered( + OnConnectionFailedListener listener) { + return connectionFailedListeners.contains(listener); + } + + @Override + public synchronized void reconnect() { + Log.d(TAG, "reconnect()"); + disconnect(); + connect(); + } + + @Override + public void registerConnectionCallbacks(ConnectionCallbacks listener) { + connectionCallbacks.add(listener); + } + + @Override + public void registerConnectionFailedListener(OnConnectionFailedListener listener) { + connectionFailedListeners.add(listener); + } + + @Override + public void stopAutoManager(FragmentActivity lifecycleActivity) throws IllegalStateException { + + } + + @Override + public void unregisterConnectionCallbacks(ConnectionCallbacks listener) { + connectionCallbacks.remove(listener); + } + + @Override + public void unregisterConnectionFailedListener(OnConnectionFailedListener listener) { + connectionFailedListeners.remove(listener); + } + + private class Handler extends android.os.Handler { + private Handler(Looper looper) { + super(looper); + } + + @Override + public void handleMessage(Message msg) { + if (msg.what == 0 && msg.obj instanceof Runnable) { + ((Runnable) msg.obj).run(); + } else { + super.handleMessage(msg); + } + } + + public void sendRunnable(Runnable runnable) { + sendMessage(obtainMessage(1, runnable)); + } + } +} diff --git a/play-services-cast/gradle.properties b/play-services-cast/gradle.properties new file mode 100644 index 00000000..937fcc06 --- /dev/null +++ b/play-services-cast/gradle.properties @@ -0,0 +1,34 @@ +# +# Copyright 2013-2016 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. +# + +POM_NAME=Play Services Cast Library +POM_DESCRIPTION=The Play Services Library module to access the Cast API + +POM_PACKAGING=aar + +POM_URL=https://github.com/microg/android_external_GmsLib + +POM_SCM_URL=https://github.com/microg/android_external_GmsLib +POM_SCM_CONNECTION=scm:git@github.com:microg/android_external_GmsLib.git +POM_SCM_DEV_CONNECTION=scm:git@github.com:microg/android_external_GmsLib.git + +POM_LICENCE_NAME=The Apache Software License, Version 2.0 +POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt +POM_LICENCE_DIST=repo + +POM_DEVELOPER_ID=mar-v-in +POM_DEVELOPER_NAME=Marvin W + diff --git a/play-services-gcm/gradle.properties b/play-services-gcm/gradle.properties new file mode 100644 index 00000000..2265b126 --- /dev/null +++ b/play-services-gcm/gradle.properties @@ -0,0 +1,34 @@ +# +# Copyright 2013-2016 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. +# + +POM_NAME=Play Services GCM Library +POM_DESCRIPTION=The Play Services Library module to access Google Cloud Messaging + +POM_PACKAGING=aar + +POM_URL=https://github.com/microg/android_external_GmsLib + +POM_SCM_URL=https://github.com/microg/android_external_GmsLib +POM_SCM_CONNECTION=scm:git@github.com:microg/android_external_GmsLib.git +POM_SCM_DEV_CONNECTION=scm:git@github.com:microg/android_external_GmsLib.git + +POM_LICENCE_NAME=The Apache Software License, Version 2.0 +POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt +POM_LICENCE_DIST=repo + +POM_DEVELOPER_ID=mar-v-in +POM_DEVELOPER_NAME=Marvin W + diff --git a/play-services-iid/gradle.properties b/play-services-iid/gradle.properties new file mode 100644 index 00000000..2e179864 --- /dev/null +++ b/play-services-iid/gradle.properties @@ -0,0 +1,34 @@ +# +# Copyright 2013-2016 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. +# + +POM_NAME=Play Services IID Library +POM_DESCRIPTION=The Play Services Library module to access the InstanceID API + +POM_PACKAGING=aar + +POM_URL=https://github.com/microg/android_external_GmsLib + +POM_SCM_URL=https://github.com/microg/android_external_GmsLib +POM_SCM_CONNECTION=scm:git@github.com:microg/android_external_GmsLib.git +POM_SCM_DEV_CONNECTION=scm:git@github.com:microg/android_external_GmsLib.git + +POM_LICENCE_NAME=The Apache Software License, Version 2.0 +POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt +POM_LICENCE_DIST=repo + +POM_DEVELOPER_ID=mar-v-in +POM_DEVELOPER_NAME=Marvin W + diff --git a/play-services-location/gradle.properties b/play-services-location/gradle.properties new file mode 100644 index 00000000..bfc9b4b2 --- /dev/null +++ b/play-services-location/gradle.properties @@ -0,0 +1,34 @@ +# +# Copyright 2013-2016 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. +# + +POM_NAME=Play Services Cast Library +POM_DESCRIPTION=The Play Services Library module to access Google Location Services + +POM_PACKAGING=aar + +POM_URL=https://github.com/microg/android_external_GmsLib + +POM_SCM_URL=https://github.com/microg/android_external_GmsLib +POM_SCM_CONNECTION=scm:git@github.com:microg/android_external_GmsLib.git +POM_SCM_DEV_CONNECTION=scm:git@github.com:microg/android_external_GmsLib.git + +POM_LICENCE_NAME=The Apache Software License, Version 2.0 +POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt +POM_LICENCE_DIST=repo + +POM_DEVELOPER_ID=mar-v-in +POM_DEVELOPER_NAME=Marvin W + diff --git a/play-services-tasks/gradle.properties b/play-services-tasks/gradle.properties new file mode 100644 index 00000000..328b6fdd --- /dev/null +++ b/play-services-tasks/gradle.properties @@ -0,0 +1,34 @@ +# +# Copyright 2013-2016 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. +# + +POM_NAME=Play Services Library Tasks +POM_DESCRIPTION=Classes used by some Play Services Library modules to abstract tasks + +POM_PACKAGING=aar + +POM_URL=https://github.com/microg/android_external_GmsLib + +POM_SCM_URL=https://github.com/microg/android_external_GmsLib +POM_SCM_CONNECTION=scm:git@github.com:microg/android_external_GmsLib.git +POM_SCM_DEV_CONNECTION=scm:git@github.com:microg/android_external_GmsLib.git + +POM_LICENCE_NAME=The Apache Software License, Version 2.0 +POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt +POM_LICENCE_DIST=repo + +POM_DEVELOPER_ID=mar-v-in +POM_DEVELOPER_NAME=Marvin W + diff --git a/play-services-wearable/gradle.properties b/play-services-wearable/gradle.properties new file mode 100644 index 00000000..036604f2 --- /dev/null +++ b/play-services-wearable/gradle.properties @@ -0,0 +1,34 @@ +# +# Copyright 2013-2016 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. +# + +POM_NAME=Play Services Wearable Library +POM_DESCRIPTION=The Play Services Library module to access the Wearable API + +POM_PACKAGING=aar + +POM_URL=https://github.com/microg/android_external_GmsLib + +POM_SCM_URL=https://github.com/microg/android_external_GmsLib +POM_SCM_CONNECTION=scm:git@github.com:microg/android_external_GmsLib.git +POM_SCM_DEV_CONNECTION=scm:git@github.com:microg/android_external_GmsLib.git + +POM_LICENCE_NAME=The Apache Software License, Version 2.0 +POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt +POM_LICENCE_DIST=repo + +POM_DEVELOPER_ID=mar-v-in +POM_DEVELOPER_NAME=Marvin W + diff --git a/play-services-wearable/src/main/java/com/google/android/gms/wearable/Channel.java b/play-services-wearable/src/main/java/com/google/android/gms/wearable/Channel.java new file mode 100644 index 00000000..7c74ca5f --- /dev/null +++ b/play-services-wearable/src/main/java/com/google/android/gms/wearable/Channel.java @@ -0,0 +1,94 @@ +/* + * Copyright 2013-2016 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; + +import android.net.Uri; +import android.os.Parcelable; + +import com.google.android.gms.common.api.GoogleApiClient; +import com.google.android.gms.common.api.PendingResult; +import com.google.android.gms.common.api.Releasable; +import com.google.android.gms.common.api.Result; +import com.google.android.gms.common.api.Status; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; + +/** + * A channel created through {@link ChannelApi#openChannel(GoogleApiClient, String, String)}. + *

+ * The implementation of this interface is parcelable and immutable, and implements reasonable {@link #equals(Object)} + * and {@link #hashCode()} methods, so can be used in collections. + */ +public interface Channel extends Parcelable { + + PendingResult addListener(GoogleApiClient client, ChannelApi.ChannelListener listener); + + PendingResult close(GoogleApiClient client, int errorCode); + + PendingResult close(GoogleApiClient client); + + PendingResult getInputStream(GoogleApiClient client); + + PendingResult getOutputStream(GoogleApiClient client); + + String getPath(); + + PendingResult receiveFile(GoogleApiClient client, Uri uri, boolean append); + + PendingResult removeListener(GoogleApiClient client, ChannelApi.ChannelListener listener); + + PendingResult sendFile(GoogleApiClient client, Uri uri); + + PendingResult sendFile(GoogleApiClient client, Uri uri, long startOffset, long length); + + interface GetInputStreamResult extends Releasable, Result { + /** + * Returns an input stream which can read data from the remote node. The stream should be + * closed when no longer needed. This method will only return {@code null} if this result's + * {@linkplain #getStatus() status} was not {@linkplain Status#isSuccess() success}. + *

+ * The returned stream will throw {@link IOException} on read if any connection errors + * occur. This exception might be a {@link ChannelIOException}. + *

+ * Since data for this stream comes over the network, reads may block for a long time. + *

+ * Multiple calls to this method will return the same instance. + */ + InputStream getInputStream(); + } + + interface GetOutputStreamResult extends Releasable, Result { + /** + * Returns an output stream which can send data to a remote node. The stream should be + * closed when no longer needed. This method will only return {@code null} if this result's + * {@linkplain #getStatus() status} was not {@linkplain Status#isSuccess() success}. + *

+ * The returned stream will throw {@link IOException} on read if any connection errors + * occur. This exception might be a {@link ChannelIOException}. + *

+ * Since data for this stream comes over the network, reads may block for a long time. + *

+ * Data written to this stream is buffered. If you wish to send the current data without + * waiting for the buffer to fill up, {@linkplain OutputStream#flush() flush} the stream. + *

+ * Multiple calls to this method will return the same instance. + */ + OutputStream getOutputStream(); + } +} diff --git a/play-services-wearable/src/main/java/com/google/android/gms/wearable/ChannelApi.java b/play-services-wearable/src/main/java/com/google/android/gms/wearable/ChannelApi.java new file mode 100644 index 00000000..66d6ae71 --- /dev/null +++ b/play-services-wearable/src/main/java/com/google/android/gms/wearable/ChannelApi.java @@ -0,0 +1,185 @@ +/* + * Copyright 2013-2016 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; + +import com.google.android.gms.common.api.GoogleApiClient; +import com.google.android.gms.common.api.GoogleApiClient.Builder; +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.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +/** + * Client interface for Wearable Channel API. Allows apps on a wearable device to send and receive + * data from other wearable nodes. + *

+ * Channels are bidirectional. Each side, both the initiator and the receiver may both read and + * write to the channel by using {@link Channel#getOutputStream(GoogleApiClient)} and {@link Channel#getInputStream(GoogleApiClient)}. + * Once a channel is established, the API for the initiator and receiver are identical. + *

+ * Channels are only available when the wearable nodes are connected. When the remote node + * disconnects, all existing channels will be closed. Any listeners (added through {@link #addListener(GoogleApiClient, ChannelListener)} + * and any installed {@link WearableListenerService}) will be notified of the channel closing. + */ +public interface ChannelApi { + /** + * Channel action for use in listener filters. + * + * @see WearableListenerService + */ + String ACTION_CHANNEL_EVENT = "com.google.android.gms.wearable.CHANNEL_EVENT"; + + /** + * Registers a listener to be notified of channel events. Calls to this method should be + * balanced with calls to {@link #removeListener(GoogleApiClient, ChannelListener)} to avoid + * leaking resources. + *

+ * Listener events will be called on the main thread, or the handler specified on {@code client} + * when it was built (using {@link Builder#setHandler(Handler)}). + *

+ * Callers wishing to be notified of events in the background should use {@link WearableListenerService}. + * + * @param client a connected client + * @param listener a listener which will be notified of changes to any channel + */ + PendingResult addListener(GoogleApiClient client, ChannelListener listener); + + /** + * Opens a channel to exchange data with a remote node. + *

+ * Channel which are no longer needed should be closed using {@link Channel#close(GoogleApiClient)}. + *

+ * This call involves a network round trip, so may be long running. {@code client} must remain + * connected during that time, or the request will be cancelled (like any other Play Services + * API calls). + * + * @param client a connected client + * @param nodeId the node ID of a wearable node, as returned from {@link NodeApi#getConnectedNodes(GoogleApiClient)} + * @param path an app-specific identifier for the channel + */ + PendingResult openChannel(GoogleApiClient client, String nodeId, String path); + + /** + * Removes a listener which was previously added through {@link #addListener(GoogleApiClient, ChannelListener)}. + * + * @param client a connected client + * @param listener a listener which was added using {@link #addListener(GoogleApiClient, ChannelListener)} + */ + PendingResult removeListener(GoogleApiClient client, ChannelListener listener); + + /** + * A listener which will be notified on changes to channels. + */ + interface ChannelListener { + /** + * Value passed to {@link #onChannelClosed(Channel, int, int)}, {@link #onInputClosed(Channel, int, int)} + * and {@link #onOutputClosed(Channel, int, int)} when the closing is due to a remote node + * being disconnected. + */ + int CLOSE_REASON_DISCONNECTED = 1; + + /** + * Value passed to {@link #onChannelClosed(Channel, int, int)}, {@link #onInputClosed(Channel, int, int)} + * and {@link #onOutputClosed(Channel, int, int)} when the stream is closed due to the + * local node calling {@link Channel#close(GoogleApiClient)} or {@link Channel#close(GoogleApiClient, int)}. + */ + int CLOSE_REASON_LOCAL_CLOSE = 3; + + /** + * Value passed to {@link #onInputClosed(Channel, int, int)} or {@link #onOutputClosed(Channel, int, int)} + * (but not {@link #onChannelClosed(Channel, int, int)}), when the stream was closed under + * normal conditions, e.g the whole file was read, or the OutputStream on the remote node + * was closed normally. + */ + int CLOSE_REASON_NORMAL = 0; + + /** + * Value passed to {@link #onChannelClosed(Channel, int, int)}, {@link #onInputClosed(Channel, int, int)} + * and {@link #onOutputClosed(Channel, int, int)} when the stream is closed due to the + * remote node calling {@link Channel#close(GoogleApiClient)} or {@link Channel#close(GoogleApiClient, int)}. + */ + int CLOSE_REASON_REMOTE_CLOSE = 2; + + /** + * Called when a channel is closed. This can happen through an explicit call to {@link Channel#close(GoogleApiClient)} + * or {@link #close(GoogleApiClient, int)} on either side of the connection, or due to + * disconnecting from the remote node. + * + * @param closeReason the reason for the channel closing. One of {@link #CLOSE_REASON_DISCONNECTED}, + * {@link #CLOSE_REASON_REMOTE_CLOSE}, or {@link #CLOSE_REASON_LOCAL_CLOSE}. + * @param appSpecificErrorCode the error code specified on {@link Channel#close(GoogleApiClient, int)}, + * or 0 if closeReason is {@link #CLOSE_REASON_DISCONNECTED}. + */ + void onChannelClosed(Channel channel, int closeReason, int appSpecificErrorCode); + + /** + * Called when a new channel is opened by a remote node. + */ + void onChannelOpened(Channel channel); + + /** + * Called when the input side of a channel is closed. + * + * @param closeReason the reason for the channel closing. One of {@link #CLOSE_REASON_DISCONNECTED}, + * {@link #CLOSE_REASON_REMOTE_CLOSE}, {@link #CLOSE_REASON_LOCAL_CLOSE} + * or {@link #CLOSE_REASON_NORMAL}. + * @param appSpecificErrorCode the error code specified on {@link Channel#close(GoogleApiClient, int)}, + * or 0 if closeReason is {@link #CLOSE_REASON_DISCONNECTED} or + * {@link #CLOSE_REASON_NORMAL}. + */ + void onInputClosed(Channel channel, @CloseReason int closeReason, int appSpecificErrorCode); + + /** + * Called when the output side of a channel is closed. + * + * @param closeReason the reason for the channel closing. One of {@link #CLOSE_REASON_DISCONNECTED}, + * {@link #CLOSE_REASON_REMOTE_CLOSE}, {@link #CLOSE_REASON_LOCAL_CLOSE} + * or {@link #CLOSE_REASON_NORMAL}. + * @param appSpecificErrorCode the error code specified on {@link Channel#close(GoogleApiClient, int)}, + * or 0 if closeReason is {@link #CLOSE_REASON_DISCONNECTED} or + * {@link #CLOSE_REASON_NORMAL}. + */ + void onOutputClosed(Channel channel, @CloseReason int closeReason, int appSpecificErrorCode); + } + + /** + * An annotation for values passed to {@link ChannelListener#onChannelClosed(Channel, int, int)}, + * and other methods on the {@link ChannelListener} interface. Annotated method parameters will + * always take one of the following values: + *

    + *
  • {@link ChannelListener#CLOSE_REASON_DISCONNECTED}
  • + *
  • {@link ChannelListener#CLOSE_REASON_NORMAL}
  • + *
  • {@link ChannelListener#CLOSE_REASON_LOCAL_CLOSE}
  • + *
  • {@link ChannelListener#CLOSE_REASON_REMOTE_CLOSE}
  • + *
+ */ + @Retention(RetentionPolicy.SOURCE) + @interface CloseReason { + } + + /** + * Result of {@link #openChannel(GoogleApiClient, String, String)}. + */ + interface OpenChannelResult extends Result { + /** + * Returns the newly created channel, or {@code null}, if the connection couldn't be opened. + */ + Channel getChannel(); + } +} diff --git a/play-services-wearable/src/main/java/com/google/android/gms/wearable/MessageApi.java b/play-services-wearable/src/main/java/com/google/android/gms/wearable/MessageApi.java new file mode 100644 index 00000000..e2016f73 --- /dev/null +++ b/play-services-wearable/src/main/java/com/google/android/gms/wearable/MessageApi.java @@ -0,0 +1,88 @@ +/* + * Copyright 2013-2015 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; + +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; + +@PublicApi +public interface MessageApi { + + /** + * A value returned by {@link SendMessageResult#getRequestId()} when + * {@link #sendMessage(GoogleApiClient, String, String, byte[])} fails. + */ + int UNKNOWN_REQUEST_ID = -1; + + /** + * Registers a listener to be notified of received messages. Calls to this method should + * balanced with {@link #removeListener(GoogleApiClient, MessageListener)} to avoid leaking + * resources. + *

+ * Callers wishing to be notified of events in the background should use {@link WearableListenerService}. + */ + PendingResult addListener(GoogleApiClient client, MessageListener listener); + + /** + * Removes a message listener which was previously added through + * {@link #addListener(GoogleApiClient, MessageListener)}. + */ + PendingResult removeListener(GoogleApiClient client, MessageListener listener); + + /** + * Sends {@code byte[]} data to the specified node. + * + * @param nodeId identifier for a particular node on the Android Wear network. Valid targets + * may be obtained through {@link NodeApi#getConnectedNodes(GoogleApiClient)} + * or from the host in {@link DataItem#getUri()}. + * @param path identifier used to specify a particular endpoint at the receiving node + * @param data small array of information to pass to the target node. Generally not larger + * than 100k + */ + PendingResult sendMessage(GoogleApiClient client, String nodeId, + String path, byte[] data); + + /** + * Used with {@link MessageApi#addListener(GoogleApiClient, MessageListener)} to receive + * message events. + *

+ * Callers wishing to be notified of events in the background should use + * {@link WearableListenerService}. + */ + interface MessageListener { + /** + * Notification that a message has been received. + */ + void onMessageReceived(MessageEvent messageEvent); + } + + /** + * Contains the request id assigned to the message. On failure, the id will be + * {@link MessageApi#UNKNOWN_REQUEST_ID} and the status will be unsuccessful. + */ + interface SendMessageResult extends Result { + /** + * @return an ID used to identify the sent message. If {@link #getStatus()} is not + * successful, this value will be {@link MessageApi#UNKNOWN_REQUEST_ID}. + */ + int getRequestId(); + } +} diff --git a/play-services-wearable/src/main/java/com/google/android/gms/wearable/WearableListenerService.java b/play-services-wearable/src/main/java/com/google/android/gms/wearable/WearableListenerService.java index b3e6c8ff..3ce99b5a 100644 --- a/play-services-wearable/src/main/java/com/google/android/gms/wearable/WearableListenerService.java +++ b/play-services-wearable/src/main/java/com/google/android/gms/wearable/WearableListenerService.java @@ -36,6 +36,7 @@ import com.google.android.gms.wearable.internal.MessageEventParcelable; import com.google.android.gms.wearable.internal.NodeParcelable; import org.microg.gms.common.PublicApi; +import org.microg.gms.wearable.ChannelImpl; import java.util.ArrayList; import java.util.Arrays; @@ -241,16 +242,16 @@ public abstract class WearableListenerService extends Service implements Capabil public void run() { switch (channelEvent.eventType) { case 1: - WearableListenerService.this.onChannelOpened(channelEvent.channel); + WearableListenerService.this.onChannelOpened(new ChannelImpl(channelEvent.channel)); break; case 2: - WearableListenerService.this.onChannelClosed(channelEvent.channel, channelEvent.closeReason, channelEvent.appSpecificErrorCode); + WearableListenerService.this.onChannelClosed(new ChannelImpl(channelEvent.channel), channelEvent.closeReason, channelEvent.appSpecificErrorCode); break; case 3: - WearableListenerService.this.onInputClosed(channelEvent.channel, channelEvent.closeReason, channelEvent.appSpecificErrorCode); + WearableListenerService.this.onInputClosed(new ChannelImpl(channelEvent.channel), channelEvent.closeReason, channelEvent.appSpecificErrorCode); break; case 4: - WearableListenerService.this.onOutputClosed(channelEvent.channel, channelEvent.closeReason, channelEvent.appSpecificErrorCode); + WearableListenerService.this.onOutputClosed(new ChannelImpl(channelEvent.channel), channelEvent.closeReason, channelEvent.appSpecificErrorCode); break; default: Log.w(TAG, "Unknown ChannelEvent.eventType"); diff --git a/play-services-wearable/src/main/java/org/microg/gms/wearable/ChannelImpl.java b/play-services-wearable/src/main/java/org/microg/gms/wearable/ChannelImpl.java new file mode 100644 index 00000000..e1284c6c --- /dev/null +++ b/play-services-wearable/src/main/java/org/microg/gms/wearable/ChannelImpl.java @@ -0,0 +1,107 @@ +/* + * Copyright 2013-2016 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 org.microg.gms.wearable; + +import android.net.Uri; +import android.util.Log; + +import com.google.android.gms.common.api.GoogleApiClient; +import com.google.android.gms.common.api.PendingResult; +import com.google.android.gms.common.api.Status; +import com.google.android.gms.wearable.Channel; +import com.google.android.gms.wearable.ChannelApi; +import com.google.android.gms.wearable.internal.ChannelParcelable; + +public class ChannelImpl extends ChannelParcelable implements Channel { + private static final String TAG = "GmsWearChannelImpl"; + + public ChannelImpl(String token, String nodeId, String path) { + super(token, nodeId, path); + } + + public ChannelImpl(ChannelParcelable wrapped) { + this(wrapped.token, wrapped.nodeId, wrapped.path); + } + + + @Override + public PendingResult addListener(GoogleApiClient client, ChannelApi.ChannelListener listener) { + Log.d(TAG, "unimplemented Method: addListener"); + return null; + } + + @Override + public PendingResult close(GoogleApiClient client, int errorCode) { + Log.d(TAG, "unimplemented Method: close"); + return null; + } + + @Override + public PendingResult close(GoogleApiClient client) { + Log.d(TAG, "unimplemented Method: close"); + return null; + } + + @Override + public PendingResult getInputStream(GoogleApiClient client) { + Log.d(TAG, "unimplemented Method: getInputStream"); + return null; + } + + @Override + public PendingResult getOutputStream(GoogleApiClient client) { + Log.d(TAG, "unimplemented Method: getOutputStream"); + return null; + } + + public String getNodeId() { + return nodeId; + } + + @Override + public String getPath() { + return path; + } + + public String getToken() { + return token; + } + + @Override + public PendingResult receiveFile(GoogleApiClient client, Uri uri, boolean append) { + Log.d(TAG, "unimplemented Method: receiveFile"); + return null; + } + + @Override + public PendingResult removeListener(GoogleApiClient client, ChannelApi.ChannelListener listener) { + Log.d(TAG, "unimplemented Method: removeListener"); + return null; + } + + @Override + public PendingResult sendFile(GoogleApiClient client, Uri uri) { + Log.d(TAG, "unimplemented Method: sendFile"); + return null; + } + + @Override + public PendingResult sendFile(GoogleApiClient client, Uri uri, long startOffset, long length) { + Log.d(TAG, "unimplemented Method: sendFile"); + return null; + } +} diff --git a/play-services-wearable/src/main/java/org/microg/gms/wearable/MessageApiImpl.java b/play-services-wearable/src/main/java/org/microg/gms/wearable/MessageApiImpl.java index 2bb784dc..552a486b 100644 --- a/play-services-wearable/src/main/java/org/microg/gms/wearable/MessageApiImpl.java +++ b/play-services-wearable/src/main/java/org/microg/gms/wearable/MessageApiImpl.java @@ -17,7 +17,6 @@ package org.microg.gms.wearable; import android.os.RemoteException; -import android.util.Log; import com.google.android.gms.common.api.GoogleApiClient; import com.google.android.gms.common.api.PendingResult; @@ -27,7 +26,6 @@ import com.google.android.gms.wearable.Wearable; import com.google.android.gms.wearable.internal.SendMessageResponse; import org.microg.gms.common.GmsConnector; -import org.microg.gms.common.api.ApiConnection; public class MessageApiImpl implements MessageApi { @Override @@ -48,10 +46,28 @@ public class MessageApiImpl implements MessageApi { client.getServiceInterface().sendMessage(new BaseWearableCallbacks() { @Override public void onSendMessageResponse(SendMessageResponse response) throws RemoteException { - resultProvider.onResultAvailable(response); + resultProvider.onResultAvailable(new SendMessageResultImpl(response)); } }, nodeId, path, data); } }); } + + public static class SendMessageResultImpl implements SendMessageResult { + private SendMessageResponse response; + + public SendMessageResultImpl(SendMessageResponse response) { + this.response = response; + } + + @Override + public int getRequestId() { + return response.requestId; + } + + @Override + public Status getStatus() { + return new Status(response.statusCode); + } + } } diff --git a/play-services-wearable/src/main/java/org/microg/gms/wearable/databundle/DataBundleUtil.java b/play-services-wearable/src/main/java/org/microg/gms/wearable/databundle/DataBundleUtil.java index 69a71964..cfc41cd2 100644 --- a/play-services-wearable/src/main/java/org/microg/gms/wearable/databundle/DataBundleUtil.java +++ b/play-services-wearable/src/main/java/org/microg/gms/wearable/databundle/DataBundleUtil.java @@ -139,7 +139,7 @@ public class DataBundleUtil { @Override void store(DataMap dataMap, String key, String value) { - dataMap.putString(key, value); + if (value != null) dataMap.putString(key, value); } @Override @@ -174,7 +174,7 @@ public class DataBundleUtil { @Override void store(DataMap dataMap, String key, Double value) { - dataMap.putDouble(key, value); + if (value != null) dataMap.putDouble(key, value); } @Override @@ -197,7 +197,7 @@ public class DataBundleUtil { @Override void store(DataMap dataMap, String key, Float value) { - dataMap.putFloat(key, value); + if (value != null) dataMap.putFloat(key, value); } @Override @@ -220,7 +220,7 @@ public class DataBundleUtil { @Override void store(DataMap dataMap, String key, Long value) { - dataMap.putLong(key, value); + if (value != null) dataMap.putLong(key, value); } @Override @@ -243,7 +243,7 @@ public class DataBundleUtil { @Override void store(DataMap dataMap, String key, Integer value) { - dataMap.putInt(key, value); + if (value != null) dataMap.putInt(key, value); } @Override @@ -278,7 +278,7 @@ public class DataBundleUtil { @Override void store(DataMap dataMap, String key, Byte value) { - dataMap.putByte(key, value); + if (value != null) dataMap.putByte(key, value); } @Override @@ -301,7 +301,7 @@ public class DataBundleUtil { @Override void store(DataMap dataMap, String key, Boolean value) { - dataMap.putBoolean(key, value); + if (value != null) dataMap.putBoolean(key, value); } @Override diff --git a/play-services/gradle.properties b/play-services/gradle.properties new file mode 100644 index 00000000..b8e4412a --- /dev/null +++ b/play-services/gradle.properties @@ -0,0 +1,34 @@ +# +# Copyright 2013-2016 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. +# + +POM_NAME=Play Services Library +POM_DESCRIPTION=The whole package of Play Services libraries. Use play-services-* artifacts if you only need certain parts + +POM_PACKAGING=aar + +POM_URL=https://github.com/microg/android_external_GmsLib + +POM_SCM_URL=https://github.com/microg/android_external_GmsLib +POM_SCM_CONNECTION=scm:git@github.com:microg/android_external_GmsLib.git +POM_SCM_DEV_CONNECTION=scm:git@github.com:microg/android_external_GmsLib.git + +POM_LICENCE_NAME=The Apache Software License, Version 2.0 +POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt +POM_LICENCE_DIST=repo + +POM_DEVELOPER_ID=mar-v-in +POM_DEVELOPER_NAME=Marvin W + From 4bffa5799a9ce406a268941e26fbb4a637d42446 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Mon, 7 Nov 2016 14:55:49 +0100 Subject: [PATCH 188/293] Fix missing api reference --- play-services-cast-framework-api | 1 + settings.gradle | 1 + 2 files changed, 2 insertions(+) create mode 120000 play-services-cast-framework-api diff --git a/play-services-cast-framework-api b/play-services-cast-framework-api new file mode 120000 index 00000000..e7676f17 --- /dev/null +++ b/play-services-cast-framework-api @@ -0,0 +1 @@ +extern/GmsApi/play-services-cast-framework-api/ \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index 13740781..a095f186 100644 --- a/settings.gradle +++ b/settings.gradle @@ -18,6 +18,7 @@ include ':safe-parcel' include ':play-services-basement' include ':play-services-cast-api' +include ':play-services-cast-framework-api' include ':play-services-iid-api' include ':play-services-location-api' include ':play-services-wearable-api' From 4f3d77f9be908150956f247a69015fa2a740b682 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Sun, 13 Nov 2016 15:49:54 +0100 Subject: [PATCH 189/293] Major UI overhaul --- microg-ui-tools/build.gradle | 5 +- .../v4/preference/PreferenceFragment.java | 313 ------------------ .../tools/ui/AbstractAboutFragment.java | 32 +- .../tools/ui/AbstractSelfCheckFragment.java | 2 +- .../tools/ui/AbstractSettingsActivity.java | 79 +++++ .../tools/ui/AbstractSettingsFragment.java | 40 +++ .../org/microg/tools/ui/DialogPreference.java | 113 +++++++ .../tools/ui/DimmableIconPreference.java | 80 +++++ .../tools/ui/ResourceSettingsFragment.java | 38 +++ .../java/org/microg/tools/ui/SwitchBar.java | 270 +++++++++++++++ .../microg/tools/ui/TintIconPreference.java | 44 +++ .../org/microg/tools/ui/ToggleSwitch.java | 60 ++++ .../res/drawable-v21/switchbar_background.xml | 6 + .../src/main/res/drawable/self_check.xml | 11 + .../res/drawable/switchbar_background.xml | 4 + .../res/layout-v21/preference_material.xml | 81 +++++ .../src/main/res/layout/about_root.xml | 6 +- .../src/main/res/layout/app_bar.xml | 49 +++ .../src/main/res/layout/settings_activity.xml | 42 +++ .../src/main/res/layout/switch_bar.xml | 46 +++ .../src/main/res/values/colors.xml | 3 + .../src/main/res/values/strings.xml | 5 +- .../src/main/res/values/themes.xml | 2 +- 23 files changed, 997 insertions(+), 334 deletions(-) delete mode 100644 microg-ui-tools/src/main/java/android/support/v4/preference/PreferenceFragment.java create mode 100644 microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractSettingsActivity.java create mode 100644 microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractSettingsFragment.java create mode 100644 microg-ui-tools/src/main/java/org/microg/tools/ui/DialogPreference.java create mode 100644 microg-ui-tools/src/main/java/org/microg/tools/ui/DimmableIconPreference.java create mode 100644 microg-ui-tools/src/main/java/org/microg/tools/ui/ResourceSettingsFragment.java create mode 100644 microg-ui-tools/src/main/java/org/microg/tools/ui/SwitchBar.java create mode 100644 microg-ui-tools/src/main/java/org/microg/tools/ui/TintIconPreference.java create mode 100644 microg-ui-tools/src/main/java/org/microg/tools/ui/ToggleSwitch.java create mode 100644 microg-ui-tools/src/main/res/drawable-v21/switchbar_background.xml create mode 100644 microg-ui-tools/src/main/res/drawable/self_check.xml create mode 100644 microg-ui-tools/src/main/res/drawable/switchbar_background.xml create mode 100644 microg-ui-tools/src/main/res/layout-v21/preference_material.xml create mode 100644 microg-ui-tools/src/main/res/layout/app_bar.xml create mode 100644 microg-ui-tools/src/main/res/layout/settings_activity.xml create mode 100644 microg-ui-tools/src/main/res/layout/switch_bar.xml diff --git a/microg-ui-tools/build.gradle b/microg-ui-tools/build.gradle index c3cac8ab..cae89799 100644 --- a/microg-ui-tools/build.gradle +++ b/microg-ui-tools/build.gradle @@ -43,7 +43,8 @@ android { } dependencies { - compile 'com.android.support:support-v4:23.4.0' - compile 'com.android.support:appcompat-v7:23.4.0' + compile 'com.android.support:support-v4:25.0.0' + compile 'com.android.support:appcompat-v7:25.0.0' + compile 'com.takisoft.fix:preference-v7:25.0.0.1' } diff --git a/microg-ui-tools/src/main/java/android/support/v4/preference/PreferenceFragment.java b/microg-ui-tools/src/main/java/android/support/v4/preference/PreferenceFragment.java deleted file mode 100644 index 8cb10aa6..00000000 --- a/microg-ui-tools/src/main/java/android/support/v4/preference/PreferenceFragment.java +++ /dev/null @@ -1,313 +0,0 @@ -/* - * Copyright 2013-2016 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 android.support.v4.preference; - -import android.app.Activity; -import android.content.Context; -import android.content.Intent; -import android.os.Bundle; -import android.os.Handler; -import android.os.Message; -import android.preference.Preference; -import android.preference.PreferenceManager; -import android.preference.PreferenceScreen; -import android.support.v4.app.Fragment; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.ListView; - -import java.lang.reflect.Constructor; -import java.lang.reflect.Method; - -public abstract class PreferenceFragment extends Fragment { - - private static final int FIRST_REQUEST_CODE = 100; - private static final int MSG_BIND_PREFERENCES = 1; - private static final String PREFERENCES_TAG = "android:preferences"; - private boolean mHavePrefs; - private boolean mInitDone; - private ListView mList; - private PreferenceManager mPreferenceManager; - - private Handler mHandler = new Handler() { - @Override - public void handleMessage(Message msg) { - switch (msg.what) { - - case MSG_BIND_PREFERENCES: - bindPreferences(); - break; - } - } - }; - - final private Runnable mRequestFocus = new Runnable() { - public void run() { - mList.focusableViewAvailable(mList); - } - }; - - private void bindPreferences() { - PreferenceScreen localPreferenceScreen = getPreferenceScreen(); - if (localPreferenceScreen != null) { - ListView localListView = getListView(); - localPreferenceScreen.bind(localListView); - } - } - - private void ensureList() { - if (mList == null) { - View view = getView(); - if (view == null) { - throw new IllegalStateException("Content view not yet created"); - } - - View listView = view.findViewById(android.R.id.list); - if (!(listView instanceof ListView)) { - throw new RuntimeException( - "Content has view with id attribute 'android.R.id.list' that is not a ListView class"); - } - - mList = (ListView) listView; - if (mList == null) { - throw new RuntimeException( - "Your content must have a ListView whose id attribute is 'android.R.id.list'"); - } - - mHandler.post(mRequestFocus); - } - } - - private void postBindPreferences() { - if (mHandler.hasMessages(MSG_BIND_PREFERENCES)) { - mHandler.obtainMessage(MSG_BIND_PREFERENCES).sendToTarget(); - } - } - - private void requirePreferenceManager() { - if (this.mPreferenceManager == null) { - throw new RuntimeException("This should be called after super.onCreate."); - } - } - - public void addPreferencesFromIntent(Intent intent) { - requirePreferenceManager(); - PreferenceScreen screen = inflateFromIntent(intent, getPreferenceScreen()); - setPreferenceScreen(screen); - } - - public void addPreferencesFromResource(int resId) { - requirePreferenceManager(); - PreferenceScreen screen = inflateFromResource(getActivity(), resId, getPreferenceScreen()); - setPreferenceScreen(screen); - } - - public Preference findPreference(CharSequence key) { - if (mPreferenceManager == null) { - return null; - } - return mPreferenceManager.findPreference(key); - } - - public ListView getListView() { - ensureList(); - return mList; - } - - public PreferenceManager getPreferenceManager() { - return mPreferenceManager; - } - - @Override - public void onActivityCreated(Bundle savedInstanceState) { - super.onActivityCreated(savedInstanceState); - getListView().setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY); - if (mHavePrefs) { - bindPreferences(); - } - mInitDone = true; - if (savedInstanceState != null) { - Bundle localBundle = savedInstanceState.getBundle(PREFERENCES_TAG); - if (localBundle != null) { - PreferenceScreen screen = getPreferenceScreen(); - if (screen != null) { - screen.restoreHierarchyState(localBundle); - } - } - } - } - - @Override - public void onActivityResult(int requestCode, int resultCode, Intent data) { - super.onActivityResult(requestCode, resultCode, data); - dispatchActivityResult(requestCode, resultCode, data); - } - - @Override - public void onCreate(Bundle paramBundle) { - super.onCreate(paramBundle); - mPreferenceManager = createPreferenceManager(); - } - - @Override - public View onCreateView(LayoutInflater paramLayoutInflater, ViewGroup paramViewGroup, - Bundle paramBundle) { - ListView listView = new ListView(paramLayoutInflater.getContext()); - listView.setId(android.R.id.list); - listView.setDrawSelectorOnTop(false); - listView.setPadding(12, 6, 12, 0); - //listView.setSelector(null); - return listView; - } - - @Override - public void onDestroy() { - super.onDestroy(); - dispatchActivityDestroy(); - } - - @Override - public void onDestroyView() { - mList = null; - mHandler.removeCallbacks(mRequestFocus); - mHandler.removeMessages(MSG_BIND_PREFERENCES); - super.onDestroyView(); - } - - @Override - public void onSaveInstanceState(Bundle bundle) { - super.onSaveInstanceState(bundle); - PreferenceScreen screen = getPreferenceScreen(); - if (screen != null) { - Bundle localBundle = new Bundle(); - screen.saveHierarchyState(localBundle); - bundle.putBundle(PREFERENCES_TAG, localBundle); - } - } - - @Override - public void onStop() { - super.onStop(); - dispatchActivityStop(); - } - - /** - * Access methods with visibility private * - */ - - private PreferenceManager createPreferenceManager() { - try { - Constructor c = PreferenceManager.class - .getDeclaredConstructor(Activity.class, int.class); - c.setAccessible(true); - return c.newInstance(this.getActivity(), FIRST_REQUEST_CODE); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - private PreferenceScreen getPreferenceScreen() { - try { - Method m = PreferenceManager.class.getDeclaredMethod("getPreferenceScreen"); - m.setAccessible(true); - return (PreferenceScreen) m.invoke(mPreferenceManager); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - private void setPreferenceScreen(PreferenceScreen preferenceScreen) { - try { - Method m = PreferenceManager.class - .getDeclaredMethod("setPreferences", PreferenceScreen.class); - m.setAccessible(true); - boolean result = (Boolean) m.invoke(mPreferenceManager, preferenceScreen); - if (result && preferenceScreen != null) { - mHavePrefs = true; - if (mInitDone) { - postBindPreferences(); - } - } - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - private void dispatchActivityResult(int requestCode, int resultCode, Intent data) { - try { - Method m = PreferenceManager.class - .getDeclaredMethod("dispatchActivityResult", int.class, int.class, - Intent.class); - m.setAccessible(true); - m.invoke(mPreferenceManager, requestCode, resultCode, data); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - private void dispatchActivityDestroy() { - try { - Method m = PreferenceManager.class.getDeclaredMethod("dispatchActivityDestroy"); - m.setAccessible(true); - m.invoke(mPreferenceManager); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - private void dispatchActivityStop() { - try { - Method m = PreferenceManager.class.getDeclaredMethod("dispatchActivityStop"); - m.setAccessible(true); - m.invoke(mPreferenceManager); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - public PreferenceScreen inflateFromResource(Context context, int resId, - PreferenceScreen rootPreferences) { - PreferenceScreen preferenceScreen; - try { - Method m = PreferenceManager.class - .getDeclaredMethod("inflateFromResource", Context.class, int.class, - PreferenceScreen.class); - m.setAccessible(true); - preferenceScreen = (PreferenceScreen) m - .invoke(mPreferenceManager, context, resId, rootPreferences); - } catch (Exception e) { - throw new RuntimeException(e); - } - return preferenceScreen; - } - - public PreferenceScreen inflateFromIntent(Intent queryIntent, - PreferenceScreen rootPreferences) { - PreferenceScreen preferenceScreen; - try { - Method m = PreferenceManager.class - .getDeclaredMethod("inflateFromIntent", Intent.class, PreferenceScreen.class); - m.setAccessible(true); - preferenceScreen = (PreferenceScreen) m - .invoke(mPreferenceManager, queryIntent, rootPreferences); - } catch (Exception e) { - throw new RuntimeException(e); - } - return preferenceScreen; - } -} diff --git a/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractAboutFragment.java b/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractAboutFragment.java index 7e2a915b..9a728fa0 100644 --- a/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractAboutFragment.java +++ b/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractAboutFragment.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2016 microG Project Team + * Copyright (C) 2013-2016 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. @@ -22,7 +22,6 @@ import android.graphics.drawable.Drawable; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; -import android.support.v4.content.ContextCompat; import android.text.TextUtils; import android.view.LayoutInflater; import android.view.View; @@ -40,21 +39,21 @@ public abstract class AbstractAboutFragment extends Fragment { protected abstract void collectLibraries(List libraries); - protected Drawable getIcon() { + public static Drawable getIcon(Context context) { try { - PackageManager pm = getContext().getPackageManager(); - return pm.getPackageInfo(getContext().getPackageName(), 0).applicationInfo.loadIcon(pm); + PackageManager pm = context.getPackageManager(); + return pm.getPackageInfo(context.getPackageName(), 0).applicationInfo.loadIcon(pm); } catch (PackageManager.NameNotFoundException e) { // Never happens, self package always exists! throw new RuntimeException(e); } } - protected String getAppName() { + public static String getAppName(Context context) { try { - PackageManager pm = getContext().getPackageManager(); - CharSequence label = pm.getPackageInfo(getContext().getPackageName(), 0).applicationInfo.loadLabel(pm); - if (TextUtils.isEmpty(label)) return getContext().getPackageName(); + PackageManager pm = context.getPackageManager(); + CharSequence label = pm.getPackageInfo(context.getPackageName(), 0).applicationInfo.loadLabel(pm); + if (TextUtils.isEmpty(label)) return context.getPackageName(); return label.toString().trim(); } catch (PackageManager.NameNotFoundException e) { // Never happens, self package always exists! @@ -62,7 +61,11 @@ public abstract class AbstractAboutFragment extends Fragment { } } - protected String getLibVersion(String packageName) { + protected String getAppName() { + return getAppName(getContext()); + } + + public static String getLibVersion(String packageName) { try { String versionName = (String) Class.forName(packageName + ".BuildConfig").getField("VERSION_NAME").get(null); if (TextUtils.isEmpty(versionName)) return ""; @@ -72,8 +75,12 @@ public abstract class AbstractAboutFragment extends Fragment { } } + public static String getSelfVersion(Context context) { + return getLibVersion(context.getPackageName()); + } + protected String getSelfVersion() { - return getLibVersion(getContext().getPackageName()); + return getSelfVersion(getContext()); } protected String getSummary() { @@ -84,7 +91,7 @@ public abstract class AbstractAboutFragment extends Fragment { @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View aboutRoot = inflater.inflate(R.layout.about_root, container, false); - ((ImageView) aboutRoot.findViewById(android.R.id.icon)).setImageDrawable(getIcon()); + ((ImageView) aboutRoot.findViewById(android.R.id.icon)).setImageDrawable(getIcon(getContext())); ((TextView) aboutRoot.findViewById(android.R.id.title)).setText(getAppName()); ((TextView) aboutRoot.findViewById(R.id.about_version)).setText(getString(R.string.about_version_str, getSelfVersion())); String summary = getSummary(); @@ -97,6 +104,7 @@ public abstract class AbstractAboutFragment extends Fragment { libraries.add(new Library(BuildConfig.APPLICATION_ID, getString(R.string.lib_name), getString(R.string.lib_license))); libraries.add(new Library("android.support.v4", getString(R.string.about_android_support_v4), getString(R.string.about_android_support_license))); libraries.add(new Library("android.support.v7.appcompat", getString(R.string.about_android_support_v7_appcompat), getString(R.string.about_android_support_license))); + libraries.add(new Library("android.support.v7.preference#hide_version", getString(R.string.about_android_support_v7_preference), getString(R.string.about_android_support_license))); collectLibraries(libraries); Collections.sort(libraries); ((ListView) aboutRoot.findViewById(android.R.id.list)).setAdapter(new LibraryAdapter(getContext(), libraries.toArray(new Library[libraries.size()]))); diff --git a/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractSelfCheckFragment.java b/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractSelfCheckFragment.java index 1a3f25b3..9ef9fd92 100644 --- a/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractSelfCheckFragment.java +++ b/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractSelfCheckFragment.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2016 microG Project Team + * Copyright (C) 2013-2016 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. diff --git a/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractSettingsActivity.java b/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractSettingsActivity.java new file mode 100644 index 00000000..ea5b9427 --- /dev/null +++ b/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractSettingsActivity.java @@ -0,0 +1,79 @@ +package org.microg.tools.ui; + +import android.os.Bundle; +import android.support.v4.app.Fragment; +import android.support.v4.app.FragmentTransaction; +import android.support.v7.app.AppCompatActivity; +import android.support.v7.widget.Toolbar; +import android.view.MenuItem; +import android.view.ViewGroup; + +public class AbstractSettingsActivity extends AppCompatActivity { + protected boolean showHomeAsUp = false; + protected int preferencesResource = 0; + private ViewGroup customBarContainer; + protected int customBarLayout = 0; + protected SwitchBar switchBar; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.settings_activity); + + setSupportActionBar((Toolbar) findViewById(R.id.toolbar)); + if (showHomeAsUp) { + getSupportActionBar().setDisplayHomeAsUpEnabled(true); + } + + switchBar = (SwitchBar) findViewById(R.id.switch_bar); + + customBarContainer = (ViewGroup) findViewById(R.id.custom_bar); + if (customBarLayout != 0) { + customBarContainer.addView(getLayoutInflater().inflate(customBarLayout, customBarContainer, false)); + } + + getSupportFragmentManager().beginTransaction() + .replace(R.id.content_wrapper, getFragment()) + .commit(); + } + + public void setCustomBarLayout(int layout) { + customBarLayout = layout; + if (customBarContainer != null) { + customBarContainer.removeAllViews(); + customBarContainer.addView(getLayoutInflater().inflate(customBarLayout, customBarContainer, false)); + } + } + + public SwitchBar getSwitchBar() { + return switchBar; + } + + public void replaceFragment(Fragment fragment) { + getSupportFragmentManager().beginTransaction() + .addToBackStack("root") + .setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN) + .replace(R.id.content_wrapper, fragment) + .commit(); + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + if (item.getItemId() == android.R.id.home) { + finish(); + return true; + } + return super.onOptionsItemSelected(item); + } + + protected Fragment getFragment() { + if (preferencesResource == 0) { + throw new IllegalStateException("Neither preferencesResource given, nor overriden getFragment()"); + } + ResourceSettingsFragment fragment = new ResourceSettingsFragment(); + Bundle b = new Bundle(); + b.putInt(ResourceSettingsFragment.EXTRA_PREFERENCE_RESOURCE, preferencesResource); + fragment.setArguments(b); + return fragment; + } +} diff --git a/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractSettingsFragment.java b/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractSettingsFragment.java new file mode 100644 index 00000000..89422e48 --- /dev/null +++ b/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractSettingsFragment.java @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2013-2016 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 org.microg.tools.ui; + +import android.support.v4.app.DialogFragment; +import android.support.v7.preference.Preference; + +import com.takisoft.fix.support.v7.preference.PreferenceFragmentCompat; + +public abstract class AbstractSettingsFragment extends PreferenceFragmentCompat { + private static final String TAG = AbstractSettingsFragment.class.getSimpleName(); + + private static final String DIALOG_FRAGMENT_TAG = + "android.support.v7.preference.PreferenceFragment.DIALOG"; + + @Override + public void onDisplayPreferenceDialog(Preference preference) { + if (preference instanceof DialogPreference) { + DialogFragment f = DialogPreference.DialogPreferenceCompatDialogFragment.newInstance(preference.getKey()); + f.setTargetFragment(this, 0); + f.show(getFragmentManager(), DIALOG_FRAGMENT_TAG); + } else { + super.onDisplayPreferenceDialog(preference); + } + } +} diff --git a/microg-ui-tools/src/main/java/org/microg/tools/ui/DialogPreference.java b/microg-ui-tools/src/main/java/org/microg/tools/ui/DialogPreference.java new file mode 100644 index 00000000..b592db48 --- /dev/null +++ b/microg-ui-tools/src/main/java/org/microg/tools/ui/DialogPreference.java @@ -0,0 +1,113 @@ +/* + * Copyright (C) 2013-2016 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 org.microg.tools.ui; + +import android.content.Context; +import android.content.SharedPreferences; +import android.os.Bundle; +import android.support.v4.app.DialogFragment; +import android.support.v7.preference.Preference; +import android.support.v7.preference.PreferenceDialogFragmentCompat; +import android.support.v7.preference.PreferenceFragmentCompat; +import android.support.v7.preference.PreferenceViewHolder; +import android.util.AttributeSet; +import android.view.View; +import android.view.ViewGroup; +import android.widget.LinearLayout; + +public class DialogPreference extends android.support.v7.preference.DialogPreference implements PreferenceFragmentCompat.OnPreferenceDisplayDialogCallback { + + private static final String DIALOG_FRAGMENT_TAG = + "android.support.v7.preference.PreferenceFragment.DIALOG"; + + public DialogPreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { + super(context, attrs, defStyleAttr, defStyleRes); + } + + public DialogPreference(Context context, AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + } + + public DialogPreference(Context context, AttributeSet attrs) { + super(context, attrs); + } + + public DialogPreference(Context context) { + super(context); + } + + protected View onCreateDialogView() { + return null; + } + + /** + * Called when the dialog is dismissed and should be used to save data to + * the {@link SharedPreferences}. + * + * @param positiveResult Whether the positive button was clicked (true), or + * the negative button was clicked or the dialog was canceled (false). + */ + protected void onDialogClosed(boolean positiveResult) { + } + + @Override + public boolean onPreferenceDisplayDialog(PreferenceFragmentCompat caller, Preference pref) { + DialogPreferenceCompatDialogFragment fragment = new DialogPreferenceCompatDialogFragment(); + fragment.setTargetFragment(caller, 0); + fragment.show(caller.getFragmentManager(), DIALOG_FRAGMENT_TAG); + return true; + } + + @Override + public void onBindViewHolder(PreferenceViewHolder view) { + super.onBindViewHolder(view); + + ViewGroup.LayoutParams layoutParams = view.findViewById(R.id.icon_frame).getLayoutParams(); + if (layoutParams instanceof LinearLayout.LayoutParams) { + if (((LinearLayout.LayoutParams) layoutParams).leftMargin < 0) { + ((LinearLayout.LayoutParams) layoutParams).leftMargin = 0; + } + } + } + + public static class DialogPreferenceCompatDialogFragment extends PreferenceDialogFragmentCompat { + + @Override + protected View onCreateDialogView(Context context) { + if (getPreference() instanceof DialogPreference) { + View view = ((DialogPreference) getPreference()).onCreateDialogView(); + if (view != null) return view; + } + return super.onCreateDialogView(context); + } + + @Override + public void onDialogClosed(boolean positiveResult) { + if (getPreference() instanceof DialogPreference) { + ((DialogPreference) getPreference()).onDialogClosed(positiveResult); + } + } + + public static DialogFragment newInstance(String key) { + final DialogPreferenceCompatDialogFragment fragment = new DialogPreferenceCompatDialogFragment(); + final Bundle b = new Bundle(1); + b.putString(ARG_KEY, key); + fragment.setArguments(b); + return fragment; + } + } +} diff --git a/microg-ui-tools/src/main/java/org/microg/tools/ui/DimmableIconPreference.java b/microg-ui-tools/src/main/java/org/microg/tools/ui/DimmableIconPreference.java new file mode 100644 index 00000000..c86f7813 --- /dev/null +++ b/microg-ui-tools/src/main/java/org/microg/tools/ui/DimmableIconPreference.java @@ -0,0 +1,80 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * 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 org.microg.tools.ui; + +import android.content.Context; +import android.graphics.drawable.Drawable; +import android.support.v7.preference.Preference; +import android.support.v7.preference.PreferenceViewHolder; +import android.text.TextUtils; +import android.util.AttributeSet; +import android.view.ViewGroup; +import android.widget.LinearLayout; +import android.widget.TextView; + +/** + * A preference item that can dim the icon when it's disabled, either directly or because its parent + * is disabled. + */ +public class DimmableIconPreference extends Preference { + private static final int ICON_ALPHA_ENABLED = 255; + private static final int ICON_ALPHA_DISABLED = 102; + + private final CharSequence mContentDescription; + + public DimmableIconPreference(Context context) { + this(context, (AttributeSet) null); + } + + public DimmableIconPreference(Context context, AttributeSet attrs) { + super(context, attrs); + mContentDescription = null; + } + + public DimmableIconPreference(Context context, CharSequence contentDescription) { + super(context); + mContentDescription = contentDescription; + } + + protected boolean shouldDimIcon() { + return !isEnabled(); + } + + private void dimIcon(boolean dimmed) { + Drawable icon = getIcon(); + if (icon != null) { + icon.mutate().setAlpha(dimmed ? ICON_ALPHA_DISABLED : ICON_ALPHA_ENABLED); + setIcon(icon); + } + } + + @Override + public void onBindViewHolder(PreferenceViewHolder view) { + super.onBindViewHolder(view); + if (!TextUtils.isEmpty(mContentDescription)) { + final TextView titleView = (TextView) view.findViewById(android.R.id.title); + titleView.setContentDescription(mContentDescription); + } + ViewGroup.LayoutParams layoutParams = view.findViewById(R.id.icon_frame).getLayoutParams(); + if (layoutParams instanceof LinearLayout.LayoutParams) { + if (((LinearLayout.LayoutParams) layoutParams).leftMargin < 0) { + ((LinearLayout.LayoutParams) layoutParams).leftMargin = 0; + } + } + dimIcon(shouldDimIcon()); + } +} diff --git a/microg-ui-tools/src/main/java/org/microg/tools/ui/ResourceSettingsFragment.java b/microg-ui-tools/src/main/java/org/microg/tools/ui/ResourceSettingsFragment.java new file mode 100644 index 00000000..85dd9b1f --- /dev/null +++ b/microg-ui-tools/src/main/java/org/microg/tools/ui/ResourceSettingsFragment.java @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2016 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 org.microg.tools.ui; + +import android.os.Bundle; +import android.support.annotation.Nullable; + +public class ResourceSettingsFragment extends AbstractSettingsFragment { + + public static final String EXTRA_PREFERENCE_RESOURCE = "preferencesResource"; + + protected int preferencesResource; + + @Override + public void onCreatePreferencesFix(@Nullable Bundle savedInstanceState, String rootKey) { + Bundle b = getArguments(); + if (b != null) { + preferencesResource = b.getInt(EXTRA_PREFERENCE_RESOURCE, preferencesResource); + } + if (preferencesResource != 0) { + addPreferencesFromResource(preferencesResource); + } + } +} diff --git a/microg-ui-tools/src/main/java/org/microg/tools/ui/SwitchBar.java b/microg-ui-tools/src/main/java/org/microg/tools/ui/SwitchBar.java new file mode 100644 index 00000000..b086b748 --- /dev/null +++ b/microg-ui-tools/src/main/java/org/microg/tools/ui/SwitchBar.java @@ -0,0 +1,270 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * Copyright (C) 2014-2016 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 org.microg.tools.ui; + +import android.content.Context; +import android.os.Build; +import android.os.Parcel; +import android.os.Parcelable; +import android.support.v7.widget.SwitchCompat; +import android.text.SpannableStringBuilder; +import android.text.TextUtils; +import android.text.style.TextAppearanceSpan; +import android.util.AttributeSet; +import android.view.LayoutInflater; +import android.view.View; +import android.widget.CompoundButton; +import android.widget.LinearLayout; +import android.widget.Switch; +import android.widget.TextView; + +import java.util.ArrayList; + +import static android.os.Build.VERSION.SDK_INT; + +public class SwitchBar extends LinearLayout implements CompoundButton.OnCheckedChangeListener, + View.OnClickListener { + + public static interface OnSwitchChangeListener { + /** + * Called when the checked state of the Switch has changed. + * + * @param switchView The Switch view whose state has changed. + * @param isChecked The new checked state of switchView. + */ + void onSwitchChanged(SwitchCompat switchView, boolean isChecked); + } + + private final TextAppearanceSpan mSummarySpan; + + private ToggleSwitch mSwitch; + private TextView mTextView; + private String mLabel; + private String mSummary; + + private ArrayList mSwitchChangeListeners = + new ArrayList(); + + public SwitchBar(Context context) { + this(context, null); + } + + public SwitchBar(Context context, AttributeSet attrs) { + super(context, attrs); + + LayoutInflater.from(context).inflate(R.layout.switch_bar, this); + + mTextView = (TextView) findViewById(R.id.switch_text); + if (SDK_INT > Build.VERSION_CODES.JELLY_BEAN) { + mTextView.setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_NO); + } + mLabel = getResources().getString(R.string.v7_preference_off); + mSummarySpan = new TextAppearanceSpan(context, android.support.v7.appcompat.R.style.TextAppearance_AppCompat_Widget_Switch); + updateText(); + + mSwitch = (ToggleSwitch) findViewById(R.id.switch_widget); + // Prevent onSaveInstanceState() to be called as we are managing the state of the Switch + // on our own + mSwitch.setSaveEnabled(false); + if (SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { + mSwitch.setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_NO); + } + + addOnSwitchChangeListener(new OnSwitchChangeListener() { + @Override + public void onSwitchChanged(SwitchCompat switchView, boolean isChecked) { + setTextViewLabel(isChecked); + } + }); + + setOnClickListener(this); + + // Default is hide + setVisibility(View.GONE); + } + + public void setTextViewLabel(boolean isChecked) { + mLabel = getResources() + .getString(isChecked ? R.string.v7_preference_on : R.string.v7_preference_off); + updateText(); + } + + public void setSummary(String summary) { + mSummary = summary; + updateText(); + } + + private void updateText() { + if (TextUtils.isEmpty(mSummary)) { + mTextView.setText(mLabel); + return; + } + final SpannableStringBuilder ssb = new SpannableStringBuilder(mLabel).append('\n'); + final int start = ssb.length(); + ssb.append(mSummary); + ssb.setSpan(mSummarySpan, start, ssb.length(), 0); + mTextView.setText(ssb); + } + + public void setChecked(boolean checked) { + setTextViewLabel(checked); + mSwitch.setChecked(checked); + } + + public void setCheckedInternal(boolean checked) { + setTextViewLabel(checked); + mSwitch.setCheckedInternal(checked); + } + + public boolean isChecked() { + return mSwitch.isChecked(); + } + + public void setEnabled(boolean enabled) { + super.setEnabled(enabled); + mTextView.setEnabled(enabled); + mSwitch.setEnabled(enabled); + } + + public final ToggleSwitch getSwitch() { + return mSwitch; + } + + public void show() { + if (!isShowing()) { + setVisibility(View.VISIBLE); + mSwitch.setOnCheckedChangeListener(this); + } + } + + public void hide() { + if (isShowing()) { + setVisibility(View.GONE); + mSwitch.setOnCheckedChangeListener(null); + } + } + + public boolean isShowing() { + return (getVisibility() == View.VISIBLE); + } + + @Override + public void onClick(View v) { + final boolean isChecked = !mSwitch.isChecked(); + setChecked(isChecked); + } + + public void propagateChecked(boolean isChecked) { + final int count = mSwitchChangeListeners.size(); + for (int n = 0; n < count; n++) { + mSwitchChangeListeners.get(n).onSwitchChanged(mSwitch, isChecked); + } + } + + @Override + public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { + propagateChecked(isChecked); + } + + public void addOnSwitchChangeListener(OnSwitchChangeListener listener) { + if (mSwitchChangeListeners.contains(listener)) { + throw new IllegalStateException("Cannot add twice the same OnSwitchChangeListener"); + } + mSwitchChangeListeners.add(listener); + } + + public void removeOnSwitchChangeListener(OnSwitchChangeListener listener) { + if (!mSwitchChangeListeners.contains(listener)) { + throw new IllegalStateException("Cannot remove OnSwitchChangeListener"); + } + mSwitchChangeListeners.remove(listener); + } + + static class SavedState extends BaseSavedState { + boolean checked; + boolean visible; + + SavedState(Parcelable superState) { + super(superState); + } + + /** + * Constructor called from {@link #CREATOR} + */ + private SavedState(Parcel in) { + super(in); + checked = (Boolean) in.readValue(null); + visible = (Boolean) in.readValue(null); + } + + @Override + public void writeToParcel(Parcel out, int flags) { + super.writeToParcel(out, flags); + out.writeValue(checked); + out.writeValue(visible); + } + + @Override + public String toString() { + return "SwitchBar.SavedState{" + + Integer.toHexString(System.identityHashCode(this)) + + " checked=" + checked + + " visible=" + visible + "}"; + } + + public static final Parcelable.Creator CREATOR + = new Parcelable.Creator() { + public SavedState createFromParcel(Parcel in) { + return new SavedState(in); + } + + public SavedState[] newArray(int size) { + return new SavedState[size]; + } + }; + } + + @Override + public Parcelable onSaveInstanceState() { + Parcelable superState = super.onSaveInstanceState(); + + SavedState ss = new SavedState(superState); + ss.checked = mSwitch.isChecked(); + ss.visible = isShowing(); + return ss; + } + + @Override + public void onRestoreInstanceState(Parcelable state) { + SavedState ss = (SavedState) state; + + super.onRestoreInstanceState(ss.getSuperState()); + + mSwitch.setCheckedInternal(ss.checked); + setTextViewLabel(ss.checked); + setVisibility(ss.visible ? View.VISIBLE : View.GONE); + mSwitch.setOnCheckedChangeListener(ss.visible ? this : null); + + requestLayout(); + } + + @Override + public CharSequence getAccessibilityClassName() { + return Switch.class.getName(); + } +} diff --git a/microg-ui-tools/src/main/java/org/microg/tools/ui/TintIconPreference.java b/microg-ui-tools/src/main/java/org/microg/tools/ui/TintIconPreference.java new file mode 100644 index 00000000..ae81350a --- /dev/null +++ b/microg-ui-tools/src/main/java/org/microg/tools/ui/TintIconPreference.java @@ -0,0 +1,44 @@ +package org.microg.tools.ui; + +import android.content.Context; +import android.graphics.drawable.Drawable; +import android.support.v4.graphics.drawable.DrawableCompat; +import android.support.v7.preference.PreferenceViewHolder; +import android.util.AttributeSet; +import android.util.TypedValue; + +import static android.os.Build.VERSION.SDK_INT; +import static android.os.Build.VERSION_CODES.LOLLIPOP; + +public class TintIconPreference extends DimmableIconPreference { + + public TintIconPreference(Context context) { + this(context, (AttributeSet) null); + } + + public TintIconPreference(Context context, AttributeSet attrs) { + super(context, attrs); + } + + private static int getThemeAccentColor(Context context) { + int colorAttr; + if (SDK_INT >= LOLLIPOP) { + colorAttr = android.R.attr.colorAccent; + } else { + //Get colorAccent defined for AppCompat + colorAttr = context.getResources().getIdentifier("colorAccent", "attr", context.getPackageName()); + } + TypedValue outValue = new TypedValue(); + context.getTheme().resolveAttribute(colorAttr, outValue, true); + return outValue.data; + } + + @Override + public void onBindViewHolder(PreferenceViewHolder view) { + super.onBindViewHolder(view); + Drawable icon = getIcon(); + if (icon != null) { + DrawableCompat.setTint(icon, getThemeAccentColor(getContext())); + } + } +} diff --git a/microg-ui-tools/src/main/java/org/microg/tools/ui/ToggleSwitch.java b/microg-ui-tools/src/main/java/org/microg/tools/ui/ToggleSwitch.java new file mode 100644 index 00000000..44f0a09a --- /dev/null +++ b/microg-ui-tools/src/main/java/org/microg/tools/ui/ToggleSwitch.java @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * Copyright (C) 2014-2016 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 org.microg.tools.ui; + +import android.content.Context; +import android.support.v7.widget.SwitchCompat; +import android.util.AttributeSet; + +public class ToggleSwitch extends SwitchCompat { + + private ToggleSwitch.OnBeforeCheckedChangeListener mOnBeforeListener; + + public interface OnBeforeCheckedChangeListener { + boolean onBeforeCheckedChanged(ToggleSwitch toggleSwitch, boolean checked); + } + + public ToggleSwitch(Context context) { + super(context); + } + + public ToggleSwitch(Context context, AttributeSet attrs) { + super(context, attrs); + } + + public ToggleSwitch(Context context, AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + } + + public void setOnBeforeCheckedChangeListener(OnBeforeCheckedChangeListener listener) { + mOnBeforeListener = listener; + } + + @Override + public void setChecked(boolean checked) { + if (mOnBeforeListener != null + && mOnBeforeListener.onBeforeCheckedChanged(this, checked)) { + return; + } + super.setChecked(checked); + } + + public void setCheckedInternal(boolean checked) { + super.setChecked(checked); + } +} diff --git a/microg-ui-tools/src/main/res/drawable-v21/switchbar_background.xml b/microg-ui-tools/src/main/res/drawable-v21/switchbar_background.xml new file mode 100644 index 00000000..20909c3a --- /dev/null +++ b/microg-ui-tools/src/main/res/drawable-v21/switchbar_background.xml @@ -0,0 +1,6 @@ + + + + + diff --git a/microg-ui-tools/src/main/res/drawable/self_check.xml b/microg-ui-tools/src/main/res/drawable/self_check.xml new file mode 100644 index 00000000..5c28f0c3 --- /dev/null +++ b/microg-ui-tools/src/main/res/drawable/self_check.xml @@ -0,0 +1,11 @@ + + + + + \ No newline at end of file diff --git a/microg-ui-tools/src/main/res/drawable/switchbar_background.xml b/microg-ui-tools/src/main/res/drawable/switchbar_background.xml new file mode 100644 index 00000000..643d428b --- /dev/null +++ b/microg-ui-tools/src/main/res/drawable/switchbar_background.xml @@ -0,0 +1,4 @@ + + + diff --git a/microg-ui-tools/src/main/res/layout-v21/preference_material.xml b/microg-ui-tools/src/main/res/layout-v21/preference_material.xml new file mode 100644 index 00000000..2c93ad42 --- /dev/null +++ b/microg-ui-tools/src/main/res/layout-v21/preference_material.xml @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/microg-ui-tools/src/main/res/layout/about_root.xml b/microg-ui-tools/src/main/res/layout/about_root.xml index c731c4a7..4488ae32 100644 --- a/microg-ui-tools/src/main/res/layout/about_root.xml +++ b/microg-ui-tools/src/main/res/layout/about_root.xml @@ -34,7 +34,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center_horizontal" - android:text="@+id/about_root_title" + android:text="@string/about_root_title" android:textAppearance="@style/TextAppearance.AppCompat.Headline" android:textColor="?attr/colorAccent"/> @@ -44,7 +44,7 @@ android:layout_height="wrap_content" android:gravity="center_horizontal" android:visibility="gone" - android:text="@+id/about_root_summary" + android:text="@string/about_root_summary" android:textAppearance="@style/TextAppearance.AppCompat.Subhead" android:textColor="?attr/colorAccent"/> @@ -53,7 +53,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" - android:text="@+id/about_root_version" + android:text="@string/about_root_version" android:textAppearance="@style/TextAppearance.AppCompat.Subhead"/> + + + + + + + + + diff --git a/microg-ui-tools/src/main/res/layout/settings_activity.xml b/microg-ui-tools/src/main/res/layout/settings_activity.xml new file mode 100644 index 00000000..4571b19c --- /dev/null +++ b/microg-ui-tools/src/main/res/layout/settings_activity.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + diff --git a/microg-ui-tools/src/main/res/layout/switch_bar.xml b/microg-ui-tools/src/main/res/layout/switch_bar.xml new file mode 100644 index 00000000..b320e3c9 --- /dev/null +++ b/microg-ui-tools/src/main/res/layout/switch_bar.xml @@ -0,0 +1,46 @@ + + + + + + + + + + \ No newline at end of file diff --git a/microg-ui-tools/src/main/res/values/colors.xml b/microg-ui-tools/src/main/res/values/colors.xml index a9410025..237df0fc 100644 --- a/microg-ui-tools/src/main/res/values/colors.xml +++ b/microg-ui-tools/src/main/res/values/colors.xml @@ -18,4 +18,7 @@ #ff263238 #ff21272b #ff009688 + + #ff37474f + #ff7fcac3 diff --git a/microg-ui-tools/src/main/res/values/strings.xml b/microg-ui-tools/src/main/res/values/strings.xml index 05af915f..8a1de419 100644 --- a/microg-ui-tools/src/main/res/values/strings.xml +++ b/microg-ui-tools/src/main/res/values/strings.xml @@ -17,7 +17,7 @@ microG UI Tools - Apache License 2.0 by microG Team + Apache License 2.0, microG Team Version %1$s %1$s %2$s @@ -39,5 +39,6 @@ v4 Support Library v7 appcompat Support Library - Apache License 2.0 by The Android Open Source Project + v7 preference Support Library + Apache License 2.0, The Android Open Source Project diff --git a/microg-ui-tools/src/main/res/values/themes.xml b/microg-ui-tools/src/main/res/values/themes.xml index 80726729..225a7b5f 100644 --- a/microg-ui-tools/src/main/res/values/themes.xml +++ b/microg-ui-tools/src/main/res/values/themes.xml @@ -16,7 +16,7 @@ - + + + + + + + \ No newline at end of file diff --git a/microg-ui-tools/src/main/res/values/themes.xml b/microg-ui-tools/src/main/res/values/themes.xml index 225a7b5f..578f3291 100644 --- a/microg-ui-tools/src/main/res/values/themes.xml +++ b/microg-ui-tools/src/main/res/values/themes.xml @@ -16,11 +16,19 @@ - + + + + - - - - - - - \ No newline at end of file diff --git a/microg-ui-tools/src/main/res/values/themes.xml b/microg-ui-tools/src/main/res/values/themes.xml deleted file mode 100644 index a90cd275..00000000 --- a/microg-ui-tools/src/main/res/values/themes.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - -