diff --git a/build.gradle b/build.gradle index 2faa2f93..75ac40ef 100644 --- a/build.gradle +++ b/build.gradle @@ -9,13 +9,13 @@ buildscript { ext.androidCompileSdk = 31 repositories { - jcenter() + mavenCentral() google() } dependencies { - classpath 'com.android.tools.build:gradle:7.1.2' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10" + classpath 'com.android.tools.build:gradle:7.2.2' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.21" classpath "com.squareup.wire:wire-gradle-plugin:3.2.2" } } @@ -24,14 +24,14 @@ allprojects { apply plugin: 'idea' group = 'org.microg.gms' - version = "0.2.24.220220" - ext.appVersionCode = 220220001 + version = "0.2.25.223212" + ext.appVersionCode = 223212001 ext.isReleaseVersion = false } subprojects { repositories { - jcenter() + mavenCentral() google() } } \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 7dadbcd5..3a2526d1 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Wed Feb 09 22:14:11 CET 2022 +#Mon Aug 22 06:37:07 CEST 2022 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME diff --git a/play-services-api/build.gradle b/play-services-api/build.gradle index a7e8a5c4..3ac8707a 100644 --- a/play-services-api/build.gradle +++ b/play-services-api/build.gradle @@ -33,8 +33,6 @@ android { dependencies { api project(':play-services-basement') - api project(':play-services-cast-api') - api project(':play-services-cast-framework-api') api project(':play-services-iid-api') - api project(':play-services-location-api') + api project(':play-services-base-api') } \ No newline at end of file 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 3bc93136..ae33a334 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 @@ -5,13 +5,19 @@ import android.accounts.Account; import com.google.android.gms.auth.AccountChangeEventsResponse; import com.google.android.gms.auth.AccountChangeEventsRequest; +import com.google.android.gms.auth.GetHubTokenRequest; +import com.google.android.gms.auth.GetHubTokenInternalResponse; +import com.google.android.gms.auth.HasCababilitiesRequest; interface IAuthManagerService { 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; Bundle getAccounts(in Bundle extras) = 5; Bundle removeAccount(in Account account) = 6; Bundle requestGoogleAccountsAccess(String packageName) = 7; + int hasCapabilities(in HasCababilitiesRequest request) = 8; + GetHubTokenInternalResponse getHubToken(in GetHubTokenRequest request, in Bundle extras) = 9; } diff --git a/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/CorpusStatus.aidl b/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/CorpusStatus.aidl deleted file mode 100644 index f893aef8..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/CorpusStatus.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.appdatasearch; - -parcelable CorpusStatus; \ No newline at end of file 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 deleted file mode 100644 index c7f5e432..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/PIMEUpdate.aidl +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 0ae6e4bc..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/PIMEUpdateResponse.aidl +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index a0a785c1..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/RequestIndexingSpecification.aidl +++ /dev/null @@ -1,3 +0,0 @@ -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/SuggestSpecification.aidl b/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/SuggestSpecification.aidl deleted file mode 100644 index 0b3c47ff..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/SuggestSpecification.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.appdatasearch; - -parcelable SuggestSpecification; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/SuggestionResults.aidl b/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/SuggestionResults.aidl deleted file mode 100644 index 57d2d63b..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/SuggestionResults.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.appdatasearch; - -parcelable SuggestionResults; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/UsageInfo.aidl b/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/UsageInfo.aidl deleted file mode 100644 index b52e3d4f..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/UsageInfo.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.appdatasearch; - -parcelable UsageInfo; \ 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 deleted file mode 100644 index ebc204c7..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/internal/IAppDataSearch.aidl +++ /dev/null @@ -1,14 +0,0 @@ -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/appdatasearch/internal/ILightweightAppDataSearch.aidl b/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/internal/ILightweightAppDataSearch.aidl deleted file mode 100644 index 77e618ac..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/internal/ILightweightAppDataSearch.aidl +++ /dev/null @@ -1,8 +0,0 @@ -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/play-services-api/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 deleted file mode 100644 index 338a1427..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/internal/ILightweightAppDataSearchCallbacks.aidl +++ /dev/null @@ -1,4 +0,0 @@ -package com.google.android.gms.appdatasearch.internal; - -interface ILightweightAppDataSearchCallbacks { -} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/auth/GetHubTokenInternalResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/auth/GetHubTokenInternalResponse.aidl new file mode 100644 index 00000000..f73f91bb --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/auth/GetHubTokenInternalResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.auth; + +parcelable GetHubTokenInternalResponse; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/auth/GetHubTokenRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/auth/GetHubTokenRequest.aidl new file mode 100644 index 00000000..74de2776 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/auth/GetHubTokenRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.auth; + +parcelable GetHubTokenRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/auth/HasCababilitiesRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/auth/HasCababilitiesRequest.aidl new file mode 100644 index 00000000..c0c080cd --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/auth/HasCababilitiesRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.auth; + +parcelable HasCababilitiesRequest; 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 deleted file mode 100644 index 25041d4d..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/clearcut/LogEventParcelable.aidl +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 61e23cff..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/clearcut/internal/IClearcutLoggerCallbacks.aidl +++ /dev/null @@ -1,13 +0,0 @@ -package com.google.android.gms.clearcut.internal; - -import com.google.android.gms.common.api.Status; -import com.google.android.gms.common.data.DataHolder; - -interface IClearcutLoggerCallbacks { - oneway void onLogResult(in Status status) = 0; - oneway void onForceUploadResult(in Status status) = 1; - oneway void onStartCollectForDebugResult(in Status status, long l) = 2; - oneway void onStopCollectForDebugResult(in Status status) = 3; - oneway void onCollectForDebugExpiryTime(in Status status, long l) = 4; - oneway void onLogEventParcelables(in DataHolder data) = 6; -} 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 deleted file mode 100644 index 018252e0..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/clearcut/internal/IClearcutLoggerService.aidl +++ /dev/null @@ -1,14 +0,0 @@ -package com.google.android.gms.clearcut.internal; - -import com.google.android.gms.clearcut.internal.IClearcutLoggerCallbacks; -import com.google.android.gms.clearcut.LogEventParcelable; - -interface IClearcutLoggerService { - oneway void log(IClearcutLoggerCallbacks callbacks, in LogEventParcelable event) = 0; - oneway void forceUpload(IClearcutLoggerCallbacks callbacks) = 1; - oneway void startCollectForDebug(IClearcutLoggerCallbacks callbacks) = 2; - oneway void stopCollectForDebug(IClearcutLoggerCallbacks callbacks) = 3; - oneway void getCollectForDebugExpiryTime(IClearcutLoggerCallbacks callbacks) = 4; - oneway void getLogEventParcelablesLegacy(IClearcutLoggerCallbacks callbacks) = 5; - oneway void getLogEventParcelables(IClearcutLoggerCallbacks callbacks) = 6; -} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/clearcut/internal/PlayLoggerContext.aidl b/play-services-api/src/main/aidl/com/google/android/gms/clearcut/internal/PlayLoggerContext.aidl deleted file mode 100644 index e213b96c..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/clearcut/internal/PlayLoggerContext.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.clearcut.internal; - -parcelable PlayLoggerContext; 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 deleted file mode 100644 index 017a2dc2..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/dynamite/IDynamiteLoader.aidl +++ /dev/null @@ -1,14 +0,0 @@ -package com.google.android.gms.dynamite; - -import com.google.android.gms.dynamic.IObjectWrapper; - -interface IDynamiteLoader { - int getModuleVersion(IObjectWrapper wrappedContext, String moduleId) = 0; - int getModuleVersion2(IObjectWrapper wrappedContext, String moduleId, boolean updateConfigIfRequired) = 2; - int getModuleVersion2NoCrashUtils(IObjectWrapper wrappedContext, String moduleId, boolean updateConfigIfRequired) = 4; - - IObjectWrapper createModuleContext(IObjectWrapper wrappedContext, String moduleId, int minVersion) = 1; - IObjectWrapper createModuleContextNoCrashUtils(IObjectWrapper wrappedContext, String moduleId, int minVersion) = 3; - - int getIDynamiteLoaderVersion() = 5; -} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/facs/cache/FacsCacheCallOptions.aidl b/play-services-api/src/main/aidl/com/google/android/gms/facs/cache/FacsCacheCallOptions.aidl deleted file mode 100644 index 72a9af06..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/facs/cache/FacsCacheCallOptions.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.facs.cache; - -parcelable FacsCacheCallOptions; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/facs/cache/ForceSettingsCacheRefreshResult.aidl b/play-services-api/src/main/aidl/com/google/android/gms/facs/cache/ForceSettingsCacheRefreshResult.aidl deleted file mode 100644 index 5bac21a7..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/facs/cache/ForceSettingsCacheRefreshResult.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.facs.cache; - -parcelable ForceSettingsCacheRefreshResult; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/facs/cache/GetActivityControlsSettingsResult.aidl b/play-services-api/src/main/aidl/com/google/android/gms/facs/cache/GetActivityControlsSettingsResult.aidl deleted file mode 100644 index 627417d4..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/facs/cache/GetActivityControlsSettingsResult.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.facs.cache; - -parcelable GetActivityControlsSettingsResult; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/facs/cache/ReadDeviceLevelSettingsResult.aidl b/play-services-api/src/main/aidl/com/google/android/gms/facs/cache/ReadDeviceLevelSettingsResult.aidl deleted file mode 100644 index 936f2ee5..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/facs/cache/ReadDeviceLevelSettingsResult.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.facs.cache; - -parcelable ReadDeviceLevelSettingsResult; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/facs/cache/UpdateActivityControlsSettingsResult.aidl b/play-services-api/src/main/aidl/com/google/android/gms/facs/cache/UpdateActivityControlsSettingsResult.aidl deleted file mode 100644 index 051f9e0f..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/facs/cache/UpdateActivityControlsSettingsResult.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.facs.cache; - -parcelable UpdateActivityControlsSettingsResult; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/facs/cache/internal/IFacsCacheCallbacks.aidl b/play-services-api/src/main/aidl/com/google/android/gms/facs/cache/internal/IFacsCacheCallbacks.aidl deleted file mode 100644 index ecea95ab..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/facs/cache/internal/IFacsCacheCallbacks.aidl +++ /dev/null @@ -1,15 +0,0 @@ -package com.google.android.gms.facs.cache.internal; - -import com.google.android.gms.common.api.Status; -import com.google.android.gms.facs.cache.ForceSettingsCacheRefreshResult; -import com.google.android.gms.facs.cache.GetActivityControlsSettingsResult; -import com.google.android.gms.facs.cache.ReadDeviceLevelSettingsResult; -import com.google.android.gms.facs.cache.UpdateActivityControlsSettingsResult; - -interface IFacsCacheCallbacks { - void onForceSettingsCacheRefreshResult(in Status status, in ForceSettingsCacheRefreshResult result) = 0; - void onUpdateActivityControlsSettingsResult(in Status status, in UpdateActivityControlsSettingsResult result) = 1; - void onGetActivityControlsSettingsResult(in Status status, in GetActivityControlsSettingsResult result) = 2; - void onWriteDeviceLevelSettingsResult(in Status status) = 3; - void onReadDeviceLevelSettingsResult(in Status status, in ReadDeviceLevelSettingsResult result) = 4; -} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/facs/cache/internal/IFacsCacheService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/facs/cache/internal/IFacsCacheService.aidl deleted file mode 100644 index 534c9de4..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/facs/cache/internal/IFacsCacheService.aidl +++ /dev/null @@ -1,12 +0,0 @@ -package com.google.android.gms.facs.cache.internal; - -import com.google.android.gms.facs.cache.FacsCacheCallOptions; -import com.google.android.gms.facs.cache.internal.IFacsCacheCallbacks; - -interface IFacsCacheService { - void forceSettingsCacheRefresh(IFacsCacheCallbacks callbacks, in FacsCacheCallOptions options) = 0; - void updateActivityControlsSettings(IFacsCacheCallbacks callbacks, in byte[] bytes, in FacsCacheCallOptions options) = 1; - void getActivityControlsSettings(IFacsCacheCallbacks callbacks, in FacsCacheCallOptions options) = 2; - void readDeviceLevelSettings(IFacsCacheCallbacks callbacks) = 3; - void writeDeviceLevelSettings(IFacsCacheCallbacks callbacks, in byte[] bytes) = 4; -} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/measurement/api/internal/IAppMeasurementDynamiteService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/measurement/api/internal/IAppMeasurementDynamiteService.aidl deleted file mode 100644 index 5df0a37f..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/measurement/api/internal/IAppMeasurementDynamiteService.aidl +++ /dev/null @@ -1,55 +0,0 @@ -package com.google.android.gms.measurement.api.internal; - -import com.google.android.gms.dynamic.IObjectWrapper; -import com.google.android.gms.measurement.api.internal.IBundleReceiver; -import com.google.android.gms.measurement.api.internal.IEventHandlerProxy; -import com.google.android.gms.measurement.api.internal.IStringProvider; -import com.google.android.gms.measurement.api.internal.InitializationParams; - -interface IAppMeasurementDynamiteService { - void initialize(in IObjectWrapper context, in InitializationParams params, long timestamp) = 0; - void logEvent(String str, String str2, in Bundle bundle, boolean z, boolean z2, long timestamp) = 1; - void logEventAndBundle(String str, String str2, in Bundle bundle, IBundleReceiver receiver, long j) = 2; - void setUserProperty(String str, String str2, in IObjectWrapper obj, boolean z, long j) = 3; - void getUserProperties(String str, String str2, boolean z, IBundleReceiver receiver) = 4; - void getMaxUserProperties(String str, IBundleReceiver receiver) = 5; - void setUserId(String str, long j) = 6; - void setConditionalUserProperty(in Bundle bundle, long j) = 7; - void clearConditionalUserProperty(String str, String str2, in Bundle bundle) = 8; - void getConditionalUserProperties(String str, String str2, IBundleReceiver receiver) = 9; - void setMeasurementEnabled(boolean z, long j) = 10; - void resetAnalyticsData(long j) = 11; - void setMinimumSessionDuration(long j) = 12; - void setSessionTimeoutDuration(long j) = 13; - void setCurrentScreen(in IObjectWrapper obj, String str, String str2, long j) = 14; - void getCurrentScreenName(IBundleReceiver receiver) = 15; - void getCurrentScreenClass(IBundleReceiver receiver) = 16; - void setInstanceIdProvider(IStringProvider provider) = 17; - void getCachedAppInstanceId(IBundleReceiver receiver) = 18; - void getAppInstanceId(IBundleReceiver receiver) = 19; - void getGmpAppId(IBundleReceiver receiver) = 20; - void generateEventId(IBundleReceiver receiver) = 21; - void beginAdUnitExposure(String str, long j) = 22; - void endAdUnitExposure(String str, long j) = 23; - void onActivityStarted(in IObjectWrapper activity, long j) = 24; - void onActivityStopped(in IObjectWrapper activity, long j) = 25; - void onActivityCreated(in IObjectWrapper activity, in Bundle bundle, long j) = 26; - void onActivityDestroyed(in IObjectWrapper activity, long j) = 27; - void onActivityPaused(in IObjectWrapper activity, long j) = 28; - void onActivityResumed(in IObjectWrapper activity, long j) = 29; - void onActivitySaveInstanceState(in IObjectWrapper activity, IBundleReceiver receiver, long j) = 30; - void performAction(in Bundle bundle, IBundleReceiver receiver, long j) = 31; - void logHealthData(int i, String str, in IObjectWrapper obj, in IObjectWrapper obj2, in IObjectWrapper obj3) = 32; - void setEventInterceptor(IEventHandlerProxy proxy) = 33; - void registerOnMeasurementEventListener(IEventHandlerProxy proxy) = 34; - void unregisterOnMeasurementEventListener(IEventHandlerProxy proxy) = 35; - void initForTests(in Map map) = 36; - void getTestFlag(IBundleReceiver receiver, int i) = 37; - void setDataCollectionEnabled(boolean z) = 38; - void isDataCollectionEnabled(IBundleReceiver receiver) = 39; - - void setDefaultEventParameters(in Bundle bundle) = 41; - void setConsent(in Bundle bundle, long j) = 43; - void setConsentThirdParty(in Bundle bundle, long j) = 44; - void clearMeasurementEnabled(long j) = 42; -} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/measurement/api/internal/IBundleReceiver.aidl b/play-services-api/src/main/aidl/com/google/android/gms/measurement/api/internal/IBundleReceiver.aidl deleted file mode 100644 index 68d80ee8..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/measurement/api/internal/IBundleReceiver.aidl +++ /dev/null @@ -1,5 +0,0 @@ -package com.google.android.gms.measurement.api.internal; - -interface IBundleReceiver { - void onBundle(in Bundle bundle); -} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/measurement/api/internal/IEventHandlerProxy.aidl b/play-services-api/src/main/aidl/com/google/android/gms/measurement/api/internal/IEventHandlerProxy.aidl deleted file mode 100644 index 5325899b..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/measurement/api/internal/IEventHandlerProxy.aidl +++ /dev/null @@ -1,6 +0,0 @@ -package com.google.android.gms.measurement.api.internal; - -interface IEventHandlerProxy { - void f1(String s1, String s2, in Bundle bundle, long j) = 0; - int f2() = 1; -} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/measurement/api/internal/IStringProvider.aidl b/play-services-api/src/main/aidl/com/google/android/gms/measurement/api/internal/IStringProvider.aidl deleted file mode 100644 index 2d8f9d17..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/measurement/api/internal/IStringProvider.aidl +++ /dev/null @@ -1,4 +0,0 @@ -package com.google.android.gms.measurement.api.internal; - -interface IStringProvider { -} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/measurement/api/internal/InitializationParams.aidl b/play-services-api/src/main/aidl/com/google/android/gms/measurement/api/internal/InitializationParams.aidl deleted file mode 100644 index cce367c7..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/measurement/api/internal/InitializationParams.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.measurement.api.internal; - -parcelable InitializationParams; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/measurement/internal/AppMetadata.aidl b/play-services-api/src/main/aidl/com/google/android/gms/measurement/internal/AppMetadata.aidl deleted file mode 100644 index 005edc39..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/measurement/internal/AppMetadata.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.measurement.internal; - -parcelable AppMetadata; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/measurement/internal/ConditionalUserPropertyParcel.aidl b/play-services-api/src/main/aidl/com/google/android/gms/measurement/internal/ConditionalUserPropertyParcel.aidl deleted file mode 100644 index de59ae57..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/measurement/internal/ConditionalUserPropertyParcel.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.measurement.internal; - -parcelable ConditionalUserPropertyParcel; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/measurement/internal/EventParcel.aidl b/play-services-api/src/main/aidl/com/google/android/gms/measurement/internal/EventParcel.aidl deleted file mode 100644 index 372d66f6..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/measurement/internal/EventParcel.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.measurement.internal; - -parcelable EventParcel; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/measurement/internal/IMeasurementService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/measurement/internal/IMeasurementService.aidl deleted file mode 100644 index 1c78896a..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/measurement/internal/IMeasurementService.aidl +++ /dev/null @@ -1,27 +0,0 @@ -package com.google.android.gms.measurement.internal; - -import com.google.android.gms.measurement.internal.AppMetadata; -import com.google.android.gms.measurement.internal.ConditionalUserPropertyParcel; -import com.google.android.gms.measurement.internal.EventParcel; -import com.google.android.gms.measurement.internal.UserAttributeParcel; - -interface IMeasurementService { - void f1(in EventParcel event, in AppMetadata app) = 0; - void f2(in UserAttributeParcel attribute, in AppMetadata app) = 1; - void f4(in AppMetadata app) = 3; -// void f5(in EventParcel p0, String p1, String p2) = 4; -// void f6(in AppMetadata p0) = 5; -// List f7(in AppMetadata p0, boolean p1) = 6; -// byte[] f9(in EventParcel p0, String p1) = 8; - void f10(long p0, String p1, String p2, String p3) = 9; - String f11(in AppMetadata app) = 10; - void f12(in ConditionalUserPropertyParcel property, in AppMetadata app) = 11; -// void f13(ConditionalUserPropertyParcel p0) = 12; -// List getUserProperties(String p0, String p1, boolean p2, in AppMetadata p3) = 13; -// List getUserPropertiesAs(String p0, String p1, String p2, boolean p3) = 14; -// List getConditionalUserProperties(String p0, String p1, in AppMetadata p2) = 15; -// List getCondtionalUserPropertiesAs(String p0, String p1, String p2) = 16; -// void f18(in AppMetadata p0) = 17; - void setDefaultEventParameters(in Bundle params, in AppMetadata app) = 18; -// void f20(in AppMetadata p0) = 19; -} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/measurement/internal/UserAttributeParcel.aidl b/play-services-api/src/main/aidl/com/google/android/gms/measurement/internal/UserAttributeParcel.aidl deleted file mode 100644 index efb3b721..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/measurement/internal/UserAttributeParcel.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.measurement.internal; - -parcelable UserAttributeParcel; 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 deleted file mode 100644 index 9bcdee44..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/playlog/internal/IPlayLogService.aidl +++ /dev/null @@ -1,10 +0,0 @@ -package com.google.android.gms.playlog.internal; - -import com.google.android.gms.clearcut.internal.PlayLoggerContext; -import com.google.android.gms.playlog.internal.LogEvent; - -// Deprecated -interface IPlayLogService { - 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/playlog/internal/LogEvent.aidl b/play-services-api/src/main/aidl/com/google/android/gms/playlog/internal/LogEvent.aidl deleted file mode 100644 index 6e7bed53..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/playlog/internal/LogEvent.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.playlog.internal; - -parcelable LogEvent; 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 deleted file mode 100644 index 404544c2..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/search/administration/internal/ISearchAdministrationService.aidl +++ /dev/null @@ -1,5 +0,0 @@ -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/ClearCorpusRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/ClearCorpusRequest.aidl deleted file mode 100644 index 9f718934..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/ClearCorpusRequest.aidl +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 11b0a4dc..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/GetCorpusInfoRequest.aidl +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index b2e549d7..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/GetCorpusStatusRequest.aidl +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index a837a7db..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/GetCorpusStatusResponse.aidl +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index ad68ef35..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/RequestIndexingRequest.aidl +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 7aaa548c..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/RequestIndexingResponse.aidl +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 863b016f..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/internal/ISearchCorporaCallbacks.aidl +++ /dev/null @@ -1,9 +0,0 @@ -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 deleted file mode 100644 index fe2073c0..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/internal/ISearchCorporaService.aidl +++ /dev/null @@ -1,14 +0,0 @@ -package com.google.android.gms.search.corpora.internal; - -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/GetCurrentExperimentIdsRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/search/global/GetCurrentExperimentIdsRequest.aidl deleted file mode 100644 index 426cbe47..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/search/global/GetCurrentExperimentIdsRequest.aidl +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 8fdb4567..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/search/global/GetCurrentExperimentIdsResponse.aidl +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 986ab4db..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/search/global/GetGlobalSearchSourcesRequest.aidl +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 86d52a13..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/search/global/GetGlobalSearchSourcesResponse.aidl +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 8d7382ed..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/search/global/GetPendingExperimentIdsRequest.aidl +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index ca99ad5f..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/search/global/GetPendingExperimentIdsResponse.aidl +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 2bd4d8b3..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/search/global/SetExperimentIdsRequest.aidl +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index ff552760..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/search/global/SetExperimentIdsResponse.aidl +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 79cbb179..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/search/global/SetIncludeInGlobalSearchRequest.aidl +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index a5f2d6d0..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/search/global/SetIncludeInGlobalSearchResponse.aidl +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index b08d9530..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/search/global/internal/IGlobalSearchAdminCallbacks.aidl +++ /dev/null @@ -1,16 +0,0 @@ -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 deleted file mode 100644 index 95bc32a7..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/search/global/internal/IGlobalSearchAdminService.aidl +++ /dev/null @@ -1,17 +0,0 @@ -package com.google.android.gms.search.global.internal; - -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/aidl/com/google/android/gms/search/queries/QueryRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/search/queries/QueryRequest.aidl deleted file mode 100644 index 1986e95d..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/search/queries/QueryRequest.aidl +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 97047253..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/search/queries/QueryResponse.aidl +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 8bcb891e..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/search/queries/internal/ISearchQueriesCallbacks.aidl +++ /dev/null @@ -1,7 +0,0 @@ -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 deleted file mode 100644 index 091cdae5..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/search/queries/internal/ISearchQueriesService.aidl +++ /dev/null @@ -1,8 +0,0 @@ -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/aidl/com/google/android/gms/usagereporting/UsageReportingOptInOptions.aidl b/play-services-api/src/main/aidl/com/google/android/gms/usagereporting/UsageReportingOptInOptions.aidl deleted file mode 100644 index a88060fb..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/usagereporting/UsageReportingOptInOptions.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.usagereporting; - -parcelable UsageReportingOptInOptions; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/usagereporting/internal/IUsageReportingCallbacks.aidl b/play-services-api/src/main/aidl/com/google/android/gms/usagereporting/internal/IUsageReportingCallbacks.aidl deleted file mode 100644 index 3e877c25..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/usagereporting/internal/IUsageReportingCallbacks.aidl +++ /dev/null @@ -1,11 +0,0 @@ -package com.google.android.gms.usagereporting.internal; - -import com.google.android.gms.common.api.Status; -import com.google.android.gms.usagereporting.UsageReportingOptInOptions; - -interface IUsageReportingCallbacks { - oneway void onOptInOptions(in Status status, in UsageReportingOptInOptions options) = 1; - oneway void onOptInOptionsSet(in Status status) = 2; - oneway void onOptInOptionsChangedListenerAdded(in Status status) = 3; - oneway void onOptInOptionsChangedListenerRemoved(in Status status) = 4; -} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/usagereporting/internal/IUsageReportingOptInOptionsChangedListener.aidl b/play-services-api/src/main/aidl/com/google/android/gms/usagereporting/internal/IUsageReportingOptInOptionsChangedListener.aidl deleted file mode 100644 index 8e9c2875..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/usagereporting/internal/IUsageReportingOptInOptionsChangedListener.aidl +++ /dev/null @@ -1,5 +0,0 @@ -package com.google.android.gms.usagereporting.internal; - -interface IUsageReportingOptInOptionsChangedListener { - oneway void onOptionsChanged() = 1; -} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/usagereporting/internal/IUsageReportingService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/usagereporting/internal/IUsageReportingService.aidl deleted file mode 100644 index 46d6265d..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/usagereporting/internal/IUsageReportingService.aidl +++ /dev/null @@ -1,12 +0,0 @@ -package com.google.android.gms.usagereporting.internal; - -import com.google.android.gms.usagereporting.internal.IUsageReportingCallbacks; -import com.google.android.gms.usagereporting.internal.IUsageReportingOptInOptionsChangedListener; -import com.google.android.gms.usagereporting.UsageReportingOptInOptions; - -interface IUsageReportingService { - oneway void getOptInOptions(IUsageReportingCallbacks callbacks) = 1; - oneway void setOptInOptions(in UsageReportingOptInOptions options, IUsageReportingCallbacks callbacks) = 2; - oneway void addOptInOptionsChangedListener(IUsageReportingOptInOptionsChangedListener listener, IUsageReportingCallbacks callbacks) = 3; - oneway void removeOptInOptionsChangedListener(IUsageReportingOptInOptionsChangedListener listener, IUsageReportingCallbacks callbacks) = 4; -} diff --git a/play-services-api/src/main/aidl/com/mgoogle/android/gms/phenotype/Configurations.aidl b/play-services-api/src/main/aidl/com/mgoogle/android/gms/phenotype/Configurations.aidl deleted file mode 100644 index b6487fc3..00000000 --- a/play-services-api/src/main/aidl/com/mgoogle/android/gms/phenotype/Configurations.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.mgoogle.android.gms.phenotype; - -parcelable Configurations; diff --git a/play-services-api/src/main/aidl/com/mgoogle/android/gms/phenotype/DogfoodsToken.aidl b/play-services-api/src/main/aidl/com/mgoogle/android/gms/phenotype/DogfoodsToken.aidl deleted file mode 100644 index 4150d172..00000000 --- a/play-services-api/src/main/aidl/com/mgoogle/android/gms/phenotype/DogfoodsToken.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.mgoogle.android.gms.phenotype; - -parcelable DogfoodsToken; diff --git a/play-services-api/src/main/aidl/com/mgoogle/android/gms/phenotype/ExperimentTokens.aidl b/play-services-api/src/main/aidl/com/mgoogle/android/gms/phenotype/ExperimentTokens.aidl deleted file mode 100644 index e44110d2..00000000 --- a/play-services-api/src/main/aidl/com/mgoogle/android/gms/phenotype/ExperimentTokens.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.mgoogle.android.gms.phenotype; - -parcelable ExperimentTokens; diff --git a/play-services-api/src/main/aidl/com/mgoogle/android/gms/phenotype/Flag.aidl b/play-services-api/src/main/aidl/com/mgoogle/android/gms/phenotype/Flag.aidl deleted file mode 100644 index 61a342a4..00000000 --- a/play-services-api/src/main/aidl/com/mgoogle/android/gms/phenotype/Flag.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.mgoogle.android.gms.phenotype; - -parcelable Flag; diff --git a/play-services-api/src/main/aidl/com/mgoogle/android/gms/phenotype/FlagOverrides.aidl b/play-services-api/src/main/aidl/com/mgoogle/android/gms/phenotype/FlagOverrides.aidl deleted file mode 100644 index 8c9dc318..00000000 --- a/play-services-api/src/main/aidl/com/mgoogle/android/gms/phenotype/FlagOverrides.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.mgoogle.android.gms.phenotype; - -parcelable FlagOverrides; diff --git a/play-services-api/src/main/aidl/com/mgoogle/android/gms/phenotype/RegistrationInfo.aidl b/play-services-api/src/main/aidl/com/mgoogle/android/gms/phenotype/RegistrationInfo.aidl deleted file mode 100644 index 349f2c6a..00000000 --- a/play-services-api/src/main/aidl/com/mgoogle/android/gms/phenotype/RegistrationInfo.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.mgoogle.android.gms.phenotype; - -parcelable RegistrationInfo; diff --git a/play-services-api/src/main/aidl/com/mgoogle/android/gms/phenotype/internal/IPhenotypeCallbacks.aidl b/play-services-api/src/main/aidl/com/mgoogle/android/gms/phenotype/internal/IPhenotypeCallbacks.aidl deleted file mode 100644 index c03c48f1..00000000 --- a/play-services-api/src/main/aidl/com/mgoogle/android/gms/phenotype/internal/IPhenotypeCallbacks.aidl +++ /dev/null @@ -1,27 +0,0 @@ -package com.mgoogle.android.gms.phenotype.internal; - -import com.google.android.gms.common.api.Status; -import com.mgoogle.android.gms.phenotype.Configurations; -import com.mgoogle.android.gms.phenotype.DogfoodsToken; -import com.mgoogle.android.gms.phenotype.ExperimentTokens; -import com.mgoogle.android.gms.phenotype.Flag; -import com.mgoogle.android.gms.phenotype.FlagOverrides; - -interface IPhenotypeCallbacks { - oneway void onRegistered(in Status status) = 0; - oneway void onWeakRegistered(in Status status) = 1; - oneway void onUnregistered(in Status status) = 2; - oneway void onConfiguration(in Status status, in Configurations configurations) = 3; - oneway void onCommitedToConfiguration(in Status status) = 4; - oneway void onExperimentTokens(in Status status, in ExperimentTokens experimentTokens) = 5; - oneway void onDogfoodsToken(in Status status, in DogfoodsToken dogfoodsToken) = 6; - oneway void onDogfoodsTokenSet(in Status status) = 7; - oneway void onFlag(in Status status, in Flag flag) = 8; - oneway void onCommittedConfiguration(in Status status, in Configurations configuration) = 9; - oneway void onSyncFinished(in Status status, long p1) = 10; - oneway void onFlagOverridesSet(in Status status) = 11; - oneway void onFlagOverrides(in Status status, in FlagOverrides overrides) = 12; - oneway void onAppSpecificPropertiesSet(in Status status) = 13; - - oneway void onServingVersion(in Status status, long version) = 15; -} diff --git a/play-services-api/src/main/aidl/com/mgoogle/android/gms/phenotype/internal/IPhenotypeService.aidl b/play-services-api/src/main/aidl/com/mgoogle/android/gms/phenotype/internal/IPhenotypeService.aidl deleted file mode 100644 index 204d442e..00000000 --- a/play-services-api/src/main/aidl/com/mgoogle/android/gms/phenotype/internal/IPhenotypeService.aidl +++ /dev/null @@ -1,31 +0,0 @@ -package com.mgoogle.android.gms.phenotype.internal; - -import com.mgoogle.android.gms.phenotype.internal.IPhenotypeCallbacks; -import com.mgoogle.android.gms.phenotype.Flag; -import com.mgoogle.android.gms.phenotype.RegistrationInfo; - -interface IPhenotypeService { - oneway void register(IPhenotypeCallbacks callbacks, String p1, int p2, in String[] p3, in byte[] p4) = 0; // returns via callbacks.onRegistered() - oneway void weakRegister(IPhenotypeCallbacks callbacks, String p1, int p2, in String[] p3, in int[] p4, in byte[] p5) = 1; // returns via callbacks.onWeakRegistered() - oneway void unregister(IPhenotypeCallbacks callbacks, String p1) = 2; // returns via callbacks.onUnregistered() - oneway void getConfigurationSnapshot(IPhenotypeCallbacks callbacks, String p1, String p2) = 3; // returns via callbacks.onConfiguration() - oneway void commitToConfiguration(IPhenotypeCallbacks callbacks, String p1) = 4; // returns via callbacks.onCommitedToConfiguration() - oneway void getExperimentTokens(IPhenotypeCallbacks callbacks, String p1, String logSourceName) = 5; // returns via callbacks.onExperimentTokens() - oneway void getDogfoodsToken(IPhenotypeCallbacks callbacks) = 6; // returns via callbacks.onDogfoodsToken() - oneway void setDogfoodsToken(IPhenotypeCallbacks callbacks, in byte[] p1) = 7; // returns via callbacks.onDogfoodsTokenSet() - oneway void getFlag(IPhenotypeCallbacks callbacks, String packageName, String name, int type) = 8; // returns via callbacks.onFlag() - oneway void getCommitedConfiguration(IPhenotypeCallbacks callbacks, String p1) = 9; // returns via callbacks.onCommittedConfiguration() - oneway void getConfigurationSnapshot2(IPhenotypeCallbacks callbacks, String p1, String p2, String p3) = 10; // returns via callbacks.onConfiguration() - oneway void syncAfterOperation(IPhenotypeCallbacks callbacks, String p1, long p2) = 11; // returns via callbacks.onSyncFinished() - oneway void registerSync(IPhenotypeCallbacks callbacks, String p1, int p2, in String[] p3, in byte[] p4, String p5, String p6) = 12; // returns via callbacks.onConfiguration() - oneway void setFlagOverrides(IPhenotypeCallbacks callbacks, String packageName, String user, String flagName, int flagType, int flagDataType, String flagValue) = 13; // returns via callbacks.onFlagOverridesSet() - oneway void deleteFlagOverrides(IPhenotypeCallbacks callbacks, String packageName, String user, String flagName) = 14; // returns via callbacks.onFlagOverrides() - oneway void listFlagOverrides(IPhenotypeCallbacks callbacks, String packageName, String user, String flagName) = 15; // returns via callbacks.onFlagOverrides() - - oneway void clearFlagOverrides(IPhenotypeCallbacks callbacks, String packageName, String user) = 17; // returns via callbacks.onFlagOverridesSet() - oneway void bulkRegister(IPhenotypeCallbacks callbacks, in RegistrationInfo[] infos) = 18; // returns via callbacks.onRegister() - oneway void setAppSpecificProperties(IPhenotypeCallbacks callbacks, String p1, in byte[] p2) = 19; // returns via callbacks.onAppSpecificPropertiesSet() - - oneway void getServingVersion(IPhenotypeCallbacks callbacks) = 21; // returns via callbacks.onServingVersion() - oneway void getExperimentTokens2(IPhenotypeCallbacks callbacks, String p1, String p2, String p3, String p4) = 22; // returns via callbacks.onExperimentTokens() -} 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 deleted file mode 100644 index ecfbbd0d..00000000 --- a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/CorpusStatus.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 final int versionCode; - @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 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/PIMEUpdate.java b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/PIMEUpdate.java deleted file mode 100644 index 2f8a596f..00000000 --- a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/PIMEUpdate.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 deleted file mode 100644 index 6bb080ba..00000000 --- a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/PIMEUpdateResponse.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 final int versionCode; - - @SafeParceled(1) - private String b; - - @SafeParceled(2) - public final byte[] bytes; - - @SafeParceled(3) - public final PIMEUpdate[] updates; - - public PIMEUpdateResponse() { - versionCode = 1; - 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/QuerySpecification.java b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/QuerySpecification.java deleted file mode 100644 index cddcd2ab..00000000 --- a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/QuerySpecification.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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) - private final int versionCode = 2; - @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() { - 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/RequestIndexingSpecification.java b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/RequestIndexingSpecification.java deleted file mode 100644 index 720f773c..00000000 --- a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/RequestIndexingSpecification.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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/com/google/android/gms/appdatasearch/SearchResults.java b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/SearchResults.java deleted file mode 100644 index 3fc9a6f8..00000000 --- a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/SearchResults.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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) - private 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/appdatasearch/SuggestSpecification.java b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/SuggestSpecification.java deleted file mode 100644 index 34dc8333..00000000 --- a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/SuggestSpecification.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 final 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 deleted file mode 100644 index 6ff68066..00000000 --- a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/SuggestionResults.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 final int versionCode; - @SafeParceled(1) - public final String errorMessage; - - @SafeParceled(2) - public final String[] s1; - @SafeParceled(3) - 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; - } - - 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 deleted file mode 100644 index a2f0f9e7..00000000 --- a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/UsageInfo.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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/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 dce80fc1..f746a643 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 @@ -16,16 +16,29 @@ package com.google.android.gms.auth; +import static org.microg.gms.auth.AuthConstants.DEFAULT_ACCOUNT_TYPE; + +import android.accounts.Account; + import org.microg.safeparcel.AutoSafeParcelable; import org.microg.safeparcel.SafeParceled; public class AccountChangeEventsRequest extends AutoSafeParcelable { - @SafeParceled(1) - private final int versionCode = 1; - @SafeParceled(2) - private int i; - @SafeParceled(3) - private String s; + @Field(1) + private int versionCode = 1; + @Field(2) + private int since; + @Field(3) + @Deprecated + private String accountName; + @Field(4) + private Account account; + + public Account getAccount() { + if (account != null) return account; + if (accountName != null) return new Account(accountName, DEFAULT_ACCOUNT_TYPE); + return null; + } public static Creator CREATOR = new AutoCreator(AccountChangeEventsRequest.class); diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/GetHubTokenInternalResponse.java b/play-services-api/src/main/java/com/google/android/gms/auth/GetHubTokenInternalResponse.java new file mode 100644 index 00000000..ccecf291 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/auth/GetHubTokenInternalResponse.java @@ -0,0 +1,21 @@ +/* + * SPDX-FileCopyrightText: 2022 microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.google.android.gms.auth; + +import android.accounts.Account; +import android.content.Intent; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class GetHubTokenInternalResponse extends AutoSafeParcelable { + @Field(1) + public TokenData tokenData; + @Field(2) + public String status; + @Field(3) + public Intent recoveryIntent; + public static final Creator CREATOR = new AutoCreator<>(GetHubTokenInternalResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/GetHubTokenRequest.java b/play-services-api/src/main/java/com/google/android/gms/auth/GetHubTokenRequest.java new file mode 100644 index 00000000..cdaffb51 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/auth/GetHubTokenRequest.java @@ -0,0 +1,20 @@ +/* + * SPDX-FileCopyrightText: 2022 microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.google.android.gms.auth; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class GetHubTokenRequest extends AutoSafeParcelable { + @Field(1) + public String accountName; + @Field(2) + public String service; + @Field(3) + public String packageName; + @Field(4) + public int callerUid; + public static final Creator CREATOR = new AutoCreator<>(GetHubTokenRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/HasCababilitiesRequest.java b/play-services-api/src/main/java/com/google/android/gms/auth/HasCababilitiesRequest.java new file mode 100644 index 00000000..27b94732 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/auth/HasCababilitiesRequest.java @@ -0,0 +1,18 @@ +/* + * SPDX-FileCopyrightText: 2022 microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.google.android.gms.auth; + +import android.accounts.Account; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class HasCababilitiesRequest extends AutoSafeParcelable { + @Field(1) + public Account account; + @Field(2) + public String[] capabilities; + public static final Creator CREATOR = new AutoCreator<>(HasCababilitiesRequest.class); +} 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 deleted file mode 100644 index cb9cb2ec..00000000 --- a/play-services-api/src/main/java/com/google/android/gms/clearcut/LogEventParcelable.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 android.util.Base64; - -import com.google.android.gms.clearcut.internal.LogVerifierResultParcelable; -import com.google.android.gms.clearcut.internal.PlayLoggerContext; -import com.mgoogle.android.gms.phenotype.ExperimentToken; -import com.mgoogle.android.gms.phenotype.GenericDimension; - -import org.microg.safeparcel.AutoSafeParcelable; - -import java.nio.ByteBuffer; -import java.nio.CharBuffer; -import java.nio.charset.CharsetDecoder; -import java.nio.charset.StandardCharsets; -import java.util.Arrays; - -public class LogEventParcelable extends AutoSafeParcelable { - @Field(1) - private final int versionCode = 1; - - @Field(2) - public final PlayLoggerContext context; - - @Field(3) - public final byte[] bytes; - - @Field(4) - public final int[] testCodes; - - @Field(5) - public final String[] mendelPackages; - - @Field(6) - public final int[] experimentIds; - - @Field(7) - public final byte[][] experimentTokens; - - @Field(8) - public final boolean addPhenotypeExperimentTokens; - - @Field(9) - public final ExperimentToken[] experimentTokenParcelables; - - @Field(10) - public final GenericDimension[] genericDimensions; - - @Field(11) - public final LogVerifierResultParcelable logVerifierResult; - - private LogEventParcelable() { - context = null; - bytes = null; - testCodes = experimentIds = null; - mendelPackages = null; - experimentTokens = null; - addPhenotypeExperimentTokens = false; - experimentTokenParcelables = null; - genericDimensions = null; - logVerifierResult = null; - } - - 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; - this.experimentTokenParcelables = null; - this.genericDimensions = null; - this.logVerifierResult = null; - } - - @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 = StandardCharsets.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/clearcut/internal/LogVerifierResultParcelable.java b/play-services-api/src/main/java/com/google/android/gms/clearcut/internal/LogVerifierResultParcelable.java deleted file mode 100644 index 4b1fa834..00000000 --- a/play-services-api/src/main/java/com/google/android/gms/clearcut/internal/LogVerifierResultParcelable.java +++ /dev/null @@ -1,15 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2022 microG Project Team - * SPDX-License-Identifier: Apache-2.0 - */ - -package com.google.android.gms.clearcut.internal; - -import org.microg.safeparcel.AutoSafeParcelable; - -public class LogVerifierResultParcelable extends AutoSafeParcelable { - @Field(1) - public boolean b; - - public static final Creator CREATOR = new AutoCreator<>(LogVerifierResultParcelable.class); -} diff --git a/play-services-api/src/main/java/com/google/android/gms/clearcut/internal/PlayLoggerContext.java b/play-services-api/src/main/java/com/google/android/gms/clearcut/internal/PlayLoggerContext.java deleted file mode 100644 index 85799407..00000000 --- a/play-services-api/src/main/java/com/google/android/gms/clearcut/internal/PlayLoggerContext.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2022 microG Project Team - * SPDX-License-Identifier: Apache-2.0 - */ - -package com.google.android.gms.clearcut.internal; - -import org.microg.safeparcel.AutoSafeParcelable; - -public class PlayLoggerContext extends AutoSafeParcelable { - - @Field(1) - private final int versionCode = 1; - - @Field(2) - public final String packageName; - - @Field(3) - public final int packageVersionCode; - - @Field(4) - public final int logSource; - - @Field(5) - public final String uploadAccount; - - @Field(6) - public final String loggingId; - - @Field(7) - public final boolean logAndroidId; - - @Field(8) - public final String logSourceName; - - @Field(9) - public final boolean isAnonymous; - - @Field(10) - public final int qosTier; - - @Field(11) - public final Integer appMobileSpecId; - - @Field(12) - public final boolean scrubMccMnc; - - @Field(13) - public final Integer piiLevelset; - - private PlayLoggerContext() { - packageName = uploadAccount = logSourceName = loggingId = null; - qosTier = packageVersionCode = logSource = appMobileSpecId = piiLevelset = -1; - isAnonymous = logAndroidId = scrubMccMnc = false; - } - - public PlayLoggerContext(String packageName, int packageVersionCode, int logSource, String logSourceName, String uploadAccount, String loggingId, boolean isAnonymous, int qosTier, boolean scrubMccMnc, int piiLevelset) { - this.packageName = packageName; - this.packageVersionCode = packageVersionCode; - this.logSource = logSource; - this.logSourceName = logSourceName; - this.uploadAccount = uploadAccount; - this.loggingId = loggingId; - this.logAndroidId = !isAnonymous; - this.isAnonymous = isAnonymous; - this.qosTier = qosTier; - this.appMobileSpecId = null; - this.scrubMccMnc = scrubMccMnc; - this.piiLevelset = piiLevelset; - } - - @Override - public String toString() { - 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(", appMobileSpecId=").append(appMobileSpecId); - sb.append(", scrubMccMnc=").append(scrubMccMnc); - sb.append(", piiLevelset=").append(piiLevelset); - sb.append(']'); - return sb.toString(); - } - - public static Creator CREATOR = new AutoCreator(PlayLoggerContext.class); -} diff --git a/play-services-api/src/main/java/com/google/android/gms/facs/cache/FacsCacheCallOptions.java b/play-services-api/src/main/java/com/google/android/gms/facs/cache/FacsCacheCallOptions.java deleted file mode 100644 index c74383e4..00000000 --- a/play-services-api/src/main/java/com/google/android/gms/facs/cache/FacsCacheCallOptions.java +++ /dev/null @@ -1,17 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2021, microG Project Team - * SPDX-License-Identifier: Apache-2.0 - */ - -package com.google.android.gms.facs.cache; - -import org.microg.safeparcel.AutoSafeParcelable; - -public class FacsCacheCallOptions extends AutoSafeParcelable { - @Field(1) - public String instanceId; - @Field(2) - public long version; - - public static final Creator CREATOR = new AutoCreator<>(FacsCacheCallOptions.class); -} diff --git a/play-services-api/src/main/java/com/google/android/gms/facs/cache/ForceSettingsCacheRefreshResult.java b/play-services-api/src/main/java/com/google/android/gms/facs/cache/ForceSettingsCacheRefreshResult.java deleted file mode 100644 index 18f2177b..00000000 --- a/play-services-api/src/main/java/com/google/android/gms/facs/cache/ForceSettingsCacheRefreshResult.java +++ /dev/null @@ -1,13 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2021, microG Project Team - * SPDX-License-Identifier: Apache-2.0 - */ - -package com.google.android.gms.facs.cache; - -import org.microg.safeparcel.AutoSafeParcelable; - -public class ForceSettingsCacheRefreshResult extends AutoSafeParcelable { - - public static final Creator CREATOR = new AutoCreator<>(ForceSettingsCacheRefreshResult.class); -} diff --git a/play-services-api/src/main/java/com/google/android/gms/facs/cache/GetActivityControlsSettingsResult.java b/play-services-api/src/main/java/com/google/android/gms/facs/cache/GetActivityControlsSettingsResult.java deleted file mode 100644 index 6be6139a..00000000 --- a/play-services-api/src/main/java/com/google/android/gms/facs/cache/GetActivityControlsSettingsResult.java +++ /dev/null @@ -1,13 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2021, microG Project Team - * SPDX-License-Identifier: Apache-2.0 - */ - -package com.google.android.gms.facs.cache; - -import org.microg.safeparcel.AutoSafeParcelable; - -public class GetActivityControlsSettingsResult extends AutoSafeParcelable { - - public static final Creator CREATOR = new AutoCreator<>(GetActivityControlsSettingsResult.class); -} diff --git a/play-services-api/src/main/java/com/google/android/gms/facs/cache/ReadDeviceLevelSettingsResult.java b/play-services-api/src/main/java/com/google/android/gms/facs/cache/ReadDeviceLevelSettingsResult.java deleted file mode 100644 index b89f861a..00000000 --- a/play-services-api/src/main/java/com/google/android/gms/facs/cache/ReadDeviceLevelSettingsResult.java +++ /dev/null @@ -1,13 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2021, microG Project Team - * SPDX-License-Identifier: Apache-2.0 - */ - -package com.google.android.gms.facs.cache; - -import org.microg.safeparcel.AutoSafeParcelable; - -public class ReadDeviceLevelSettingsResult extends AutoSafeParcelable { - - public static final Creator CREATOR = new AutoCreator<>(ReadDeviceLevelSettingsResult.class); -} diff --git a/play-services-api/src/main/java/com/google/android/gms/facs/cache/UpdateActivityControlsSettingsResult.java b/play-services-api/src/main/java/com/google/android/gms/facs/cache/UpdateActivityControlsSettingsResult.java deleted file mode 100644 index 4ef2c91d..00000000 --- a/play-services-api/src/main/java/com/google/android/gms/facs/cache/UpdateActivityControlsSettingsResult.java +++ /dev/null @@ -1,13 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2021, microG Project Team - * SPDX-License-Identifier: Apache-2.0 - */ - -package com.google.android.gms.facs.cache; - -import org.microg.safeparcel.AutoSafeParcelable; - -public class UpdateActivityControlsSettingsResult extends AutoSafeParcelable { - - public static final Creator CREATOR = new AutoCreator<>(UpdateActivityControlsSettingsResult.class); -} diff --git a/play-services-api/src/main/java/com/google/android/gms/measurement/api/internal/InitializationParams.java b/play-services-api/src/main/java/com/google/android/gms/measurement/api/internal/InitializationParams.java deleted file mode 100644 index 43d7ff75..00000000 --- a/play-services-api/src/main/java/com/google/android/gms/measurement/api/internal/InitializationParams.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2022 microG Project Team - * SPDX-License-Identifier: Apache-2.0 - */ - -package com.google.android.gms.measurement.api.internal; - -import android.os.Bundle; - -import org.microg.safeparcel.AutoSafeParcelable; - -public class InitializationParams extends AutoSafeParcelable { - @Field(1) - public long field1; - @Field(2) - public long field2; - @Field(3) - public boolean field3; - @Field(4) - public String field4; - @Field(5) - public String field5; - @Field(6) - public String field6; - @Field(7) - public Bundle field7; - @Field(8) - public String field8; - - @Override - public String toString() { - return "InitializationParams{" + - "field1=" + field1 + - ", field2=" + field2 + - ", field3=" + field3 + - ", field4='" + field4 + '\'' + - ", field5='" + field5 + '\'' + - ", field6='" + field6 + '\'' + - ", field7=" + field7 + - ", field8='" + field8 + '\'' + - '}'; - } - - public static final Creator CREATOR = new AutoCreator<>(InitializationParams.class); -} diff --git a/play-services-api/src/main/java/com/google/android/gms/measurement/internal/AppMetadata.java b/play-services-api/src/main/java/com/google/android/gms/measurement/internal/AppMetadata.java deleted file mode 100644 index b2b38f33..00000000 --- a/play-services-api/src/main/java/com/google/android/gms/measurement/internal/AppMetadata.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2020, microG Project Team - * SPDX-License-Identifier: Apache-2.0 - */ - -package com.google.android.gms.measurement.internal; - -import org.microg.safeparcel.AutoSafeParcelable; - -import java.util.List; - -public class AppMetadata extends AutoSafeParcelable { - @Field(2) - public String packageName; - @Field(3) - public String googleAppId; - @Field(4) - public String versionName; - @Field(5) - public String installerPackageName; - @Field(6) - private long field6; - @Field(7) - private long field7; - @Field(8) - private String field8; - @Field(9) - private final boolean field9 = true; - @Field(10) - private boolean field10; - @Field(11) - public long versionCode = Integer.MIN_VALUE; - @Field(12) - private String field12; - @Field(13) - private long field13; - @Field(14) - private long field14; - @Field(15) - public int appType; - @Field(16) - private boolean field16; - @Field(17) - public boolean ssaidCollectionEnabled = true; - @Field(18) - public boolean deferredAnalyticsCollection; - @Field(19) - public String admobAppId; - @Field(21) - public Boolean allowAdPersonalization; - @Field(22) - private long field22; - @Field(23) - public List safelistedEvents; - @Field(24) - public String gaAppId; - @Field(25) - private String field25; - - public String toString() { - return "AppMetadata[" + packageName + "]"; - } - - public static final Creator CREATOR = new AutoCreator<>(AppMetadata.class); -} diff --git a/play-services-api/src/main/java/com/google/android/gms/measurement/internal/ConditionalUserPropertyParcel.java b/play-services-api/src/main/java/com/google/android/gms/measurement/internal/ConditionalUserPropertyParcel.java deleted file mode 100644 index 108c8efe..00000000 --- a/play-services-api/src/main/java/com/google/android/gms/measurement/internal/ConditionalUserPropertyParcel.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2020, microG Project Team - * SPDX-License-Identifier: Apache-2.0 - */ - -package com.google.android.gms.measurement.internal; - -import org.microg.safeparcel.AutoSafeParcelable; - -public class ConditionalUserPropertyParcel extends AutoSafeParcelable { - @Field(2) - public String appId; - @Field(3) - public String origin; - @Field(4) - public UserAttributeParcel userAttribute; - @Field(5) - public long creationTimestamp; - @Field(6) - public boolean active; - @Field(7) - public String triggerEventName; - @Field(8) - public EventParcel timedOutEvent; - @Field(9) - public long triggerTimeout; - @Field(10) - public EventParcel triggerEvent; - @Field(11) - public long timeToLive; - @Field(12) - public EventParcel expiredEvent; - - public static final Creator CREATOR = new AutoCreator<>(ConditionalUserPropertyParcel.class); -} diff --git a/play-services-api/src/main/java/com/google/android/gms/measurement/internal/EventParams.java b/play-services-api/src/main/java/com/google/android/gms/measurement/internal/EventParams.java deleted file mode 100644 index 54de1394..00000000 --- a/play-services-api/src/main/java/com/google/android/gms/measurement/internal/EventParams.java +++ /dev/null @@ -1,17 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2020, microG Project Team - * SPDX-License-Identifier: Apache-2.0 - */ - -package com.google.android.gms.measurement.internal; - -import android.os.Bundle; - -import org.microg.safeparcel.AutoSafeParcelable; - -public class EventParams extends AutoSafeParcelable { - @Field(2) - public Bundle data; - - public static final Creator CREATOR = new AutoCreator<>(EventParams.class); -} diff --git a/play-services-api/src/main/java/com/google/android/gms/measurement/internal/EventParcel.java b/play-services-api/src/main/java/com/google/android/gms/measurement/internal/EventParcel.java deleted file mode 100644 index 7b5b6179..00000000 --- a/play-services-api/src/main/java/com/google/android/gms/measurement/internal/EventParcel.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2020, microG Project Team - * SPDX-License-Identifier: Apache-2.0 - */ - -package com.google.android.gms.measurement.internal; - -import org.microg.safeparcel.AutoSafeParcelable; - -public class EventParcel extends AutoSafeParcelable { - @Field(2) - public String name; - @Field(3) - public EventParams params; - @Field(4) - public String origin; - @Field(5) - public long timestamp; - - public static final Creator CREATOR = new AutoCreator<>(EventParcel.class); -} diff --git a/play-services-api/src/main/java/com/google/android/gms/measurement/internal/UserAttributeParcel.java b/play-services-api/src/main/java/com/google/android/gms/measurement/internal/UserAttributeParcel.java deleted file mode 100644 index d9c74663..00000000 --- a/play-services-api/src/main/java/com/google/android/gms/measurement/internal/UserAttributeParcel.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2020, microG Project Team - * SPDX-License-Identifier: Apache-2.0 - */ - -package com.google.android.gms.measurement.internal; - -import org.microg.safeparcel.AutoSafeParcelable; - -public class UserAttributeParcel extends AutoSafeParcelable { - @Field(1) - public int field1; - @Field(2) - public String name; - @Field(3) - public long timestamp; - @Field(4) - public Long field4; - @Field(6) - public String field6; - @Field(7) - public String field7; - @Field(8) - public Double field8; - - public static final Creator CREATOR = new AutoCreator<>(UserAttributeParcel.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 deleted file mode 100644 index 5b129ba3..00000000 --- a/play-services-api/src/main/java/com/google/android/gms/playlog/internal/LogEvent.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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; - -@Deprecated -public class LogEvent extends AutoSafeParcelable { - - @SafeParceled(1) - private final int versionCode = 1; - - @SafeParceled(2) - public final long eventTime; - - @SafeParceled(3) - public final String tag; - - @SafeParceled(4) - public final byte[] data; - - private LogEvent() { - eventTime = -1; - tag = null; - data = null; - } - - @Override - public String toString() { - return "LogEvent{" + - "eventTime=" + new Date(eventTime) + - ", tag='" + tag + '\'' + - ", data=" + (data == null ? "null" : ('\'' + new String(data) + '\'')) + - '}'; - } - - public static Creator CREATOR = new AutoCreator(LogEvent.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 deleted file mode 100644 index 8e91b869..00000000 --- a/play-services-api/src/main/java/com/google/android/gms/search/corpora/ClearCorpusRequest.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 deleted file mode 100644 index 2da15091..00000000 --- a/play-services-api/src/main/java/com/google/android/gms/search/corpora/GetCorpusInfoRequest.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 deleted file mode 100644 index 923fa08d..00000000 --- a/play-services-api/src/main/java/com/google/android/gms/search/corpora/GetCorpusStatusRequest.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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) - private final int versionCode = 1; - - @SafeParceled(1) - public final String packageName; - - @SafeParceled(2) - public final String corpus; - - private GetCorpusStatusRequest() { - 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 deleted file mode 100644 index 2611d67e..00000000 --- a/play-services-api/src/main/java/com/google/android/gms/search/corpora/GetCorpusStatusResponse.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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) - private int versionCode; - - @SafeParceled(1) - public final Status status; - - @SafeParceled(2) - public final CorpusStatus corpusStatus; - - private GetCorpusStatusResponse() { - status = null; - corpusStatus = null; - } - - public GetCorpusStatusResponse(Status status, CorpusStatus corpusStatus) { - 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 deleted file mode 100644 index 5ad820ee..00000000 --- a/play-services-api/src/main/java/com/google/android/gms/search/corpora/RequestIndexingRequest.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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) - private final int versionCode = 1; - - @SafeParceled(1) - public final String packageName; - - @SafeParceled(2) - public final String corpus; - - @SafeParceled(3) - public final long sequenceNumber; - - private RequestIndexingRequest() { - 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 deleted file mode 100644 index cf25d6a7..00000000 --- a/play-services-api/src/main/java/com/google/android/gms/search/corpora/RequestIndexingResponse.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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) - private int versionCode; - - @SafeParceled(1) - public final Status status; - - @SafeParceled(2) - public final boolean scheduledIndexing; - - private RequestIndexingResponse() { - status = null; - scheduledIndexing = false; - } - - public RequestIndexingResponse(Status status, boolean scheduledIndexing) { - 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/global/GetCurrentExperimentIdsRequest.java b/play-services-api/src/main/java/com/google/android/gms/search/global/GetCurrentExperimentIdsRequest.java deleted file mode 100644 index 4f4fb2f2..00000000 --- a/play-services-api/src/main/java/com/google/android/gms/search/global/GetCurrentExperimentIdsRequest.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 final 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 deleted file mode 100644 index d7c03e83..00000000 --- a/play-services-api/src/main/java/com/google/android/gms/search/global/GetCurrentExperimentIdsResponse.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 final 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 deleted file mode 100644 index d00af636..00000000 --- a/play-services-api/src/main/java/com/google/android/gms/search/global/GetGlobalSearchSourcesRequest.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 final 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 deleted file mode 100644 index e972d4e2..00000000 --- a/play-services-api/src/main/java/com/google/android/gms/search/global/GetGlobalSearchSourcesResponse.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 final 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 deleted file mode 100644 index 38c0a3b1..00000000 --- a/play-services-api/src/main/java/com/google/android/gms/search/global/GetPendingExperimentIdsRequest.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 final 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 deleted file mode 100644 index 0f05c33c..00000000 --- a/play-services-api/src/main/java/com/google/android/gms/search/global/GetPendingExperimentIdsResponse.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 final 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 deleted file mode 100644 index c1c5001d..00000000 --- a/play-services-api/src/main/java/com/google/android/gms/search/global/SetExperimentIdsRequest.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 final 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 deleted file mode 100644 index ae31e4fd..00000000 --- a/play-services-api/src/main/java/com/google/android/gms/search/global/SetExperimentIdsResponse.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 final 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 deleted file mode 100644 index ca8ef82a..00000000 --- a/play-services-api/src/main/java/com/google/android/gms/search/global/SetIncludeInGlobalSearchRequest.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 final 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 deleted file mode 100644 index d31ea040..00000000 --- a/play-services-api/src/main/java/com/google/android/gms/search/global/SetIncludeInGlobalSearchResponse.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 final 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-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 deleted file mode 100644 index b3f42a21..00000000 --- a/play-services-api/src/main/java/com/google/android/gms/search/queries/QueryRequest.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 deleted file mode 100644 index 6b9132b7..00000000 --- a/play-services-api/src/main/java/com/google/android/gms/search/queries/QueryResponse.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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) - private final int versionCode = 1; - - @SafeParceled(1) - public final Status status; - - @SafeParceled(2) - public final SearchResults results; - - private QueryResponse() { - status = null; - results = null; - } - - public QueryResponse(Status status, SearchResults results) { - this.status = status; - this.results = results; - } - - public static Creator CREATOR = new AutoCreator(QueryResponse.class); -} diff --git a/play-services-api/src/main/java/com/google/android/gms/usagereporting/UsageReportingOptInOptions.java b/play-services-api/src/main/java/com/google/android/gms/usagereporting/UsageReportingOptInOptions.java deleted file mode 100644 index 0e7ec10b..00000000 --- a/play-services-api/src/main/java/com/google/android/gms/usagereporting/UsageReportingOptInOptions.java +++ /dev/null @@ -1,15 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2022 microG Project Team - * SPDX-License-Identifier: Apache-2.0 - */ - -package com.google.android.gms.usagereporting; - -import org.microg.safeparcel.AutoSafeParcelable; - -public class UsageReportingOptInOptions extends AutoSafeParcelable { - @Field(2) - public int optInUsageReporting; - - public static final Creator CREATOR = new AutoCreator<>(UsageReportingOptInOptions.class); -} diff --git a/play-services-api/src/main/java/com/mgoogle/android/gms/phenotype/Configuration.java b/play-services-api/src/main/java/com/mgoogle/android/gms/phenotype/Configuration.java deleted file mode 100644 index d179375a..00000000 --- a/play-services-api/src/main/java/com/mgoogle/android/gms/phenotype/Configuration.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2020, microG Project Team - * SPDX-License-Identifier: Apache-2.0 - */ - -package com.mgoogle.android.gms.phenotype; - -import org.microg.safeparcel.AutoSafeParcelable; - -public class Configuration extends AutoSafeParcelable { - @Field(2) - public int flagType; - @Field(3) - public Flag[] flags; - @Field(4) - public String[] names; - public static final Creator CREATOR = new AutoCreator<>(Configuration.class); -} diff --git a/play-services-api/src/main/java/com/mgoogle/android/gms/phenotype/Configurations.java b/play-services-api/src/main/java/com/mgoogle/android/gms/phenotype/Configurations.java deleted file mode 100644 index 8b032262..00000000 --- a/play-services-api/src/main/java/com/mgoogle/android/gms/phenotype/Configurations.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2020, microG Project Team - * SPDX-License-Identifier: Apache-2.0 - */ - -package com.mgoogle.android.gms.phenotype; - -import org.microg.safeparcel.AutoSafeParcelable; - -public class Configurations extends AutoSafeParcelable { - @Field(2) - public String field2; - @Field(3) - public String field3; - @Field(4) - public Configuration[] field4; - @Field(5) - public boolean field5; - @Field(6) - public byte[] field6; - @Field(7) - public long field7; - - public static final Creator CREATOR = new AutoCreator<>(Configurations.class); -} diff --git a/play-services-api/src/main/java/com/mgoogle/android/gms/phenotype/DogfoodsToken.java b/play-services-api/src/main/java/com/mgoogle/android/gms/phenotype/DogfoodsToken.java deleted file mode 100644 index dc7687c1..00000000 --- a/play-services-api/src/main/java/com/mgoogle/android/gms/phenotype/DogfoodsToken.java +++ /dev/null @@ -1,12 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2020, microG Project Team - * SPDX-License-Identifier: Apache-2.0 - */ - -package com.mgoogle.android.gms.phenotype; - -import org.microg.safeparcel.AutoSafeParcelable; - -public class DogfoodsToken extends AutoSafeParcelable { - public static final Creator CREATOR = new AutoCreator<>(DogfoodsToken.class); -} diff --git a/play-services-api/src/main/java/com/mgoogle/android/gms/phenotype/ExperimentToken.java b/play-services-api/src/main/java/com/mgoogle/android/gms/phenotype/ExperimentToken.java deleted file mode 100644 index 4984686b..00000000 --- a/play-services-api/src/main/java/com/mgoogle/android/gms/phenotype/ExperimentToken.java +++ /dev/null @@ -1,12 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2020, microG Project Team - * SPDX-License-Identifier: Apache-2.0 - */ - -package com.mgoogle.android.gms.phenotype; - -import org.microg.safeparcel.AutoSafeParcelable; - -public class ExperimentToken extends AutoSafeParcelable { - public static final Creator CREATOR = new AutoCreator<>(ExperimentToken.class); -} diff --git a/play-services-api/src/main/java/com/mgoogle/android/gms/phenotype/ExperimentTokens.java b/play-services-api/src/main/java/com/mgoogle/android/gms/phenotype/ExperimentTokens.java deleted file mode 100644 index 2726dbeb..00000000 --- a/play-services-api/src/main/java/com/mgoogle/android/gms/phenotype/ExperimentTokens.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2020, microG Project Team - * SPDX-License-Identifier: Apache-2.0 - */ - -package com.mgoogle.android.gms.phenotype; - -import org.microg.safeparcel.AutoSafeParcelable; - -public class ExperimentTokens extends AutoSafeParcelable { - @Field(2) - public String field2; - @Field(3) - public byte[] direct; - @Field(4) - public byte[][] gaia; - @Field(5) - public byte[][] pseudo; - @Field(6) - public byte[][] always; - @Field(7) - public byte[][] other; - @Field(8) - public int[] weak; - @Field(9) - public byte[][] directs; - @Field(10) - public int[] genericDimensions; - public static final Creator CREATOR = new AutoCreator<>(ExperimentTokens.class); -} diff --git a/play-services-api/src/main/java/com/mgoogle/android/gms/phenotype/Flag.java b/play-services-api/src/main/java/com/mgoogle/android/gms/phenotype/Flag.java deleted file mode 100644 index 8318fa59..00000000 --- a/play-services-api/src/main/java/com/mgoogle/android/gms/phenotype/Flag.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2020, microG Project Team - * SPDX-License-Identifier: Apache-2.0 - */ - -package com.mgoogle.android.gms.phenotype; - -import org.microg.safeparcel.AutoSafeParcelable; - -public class Flag extends AutoSafeParcelable { - @Field(2) - public String name; - @Field(3) - private long longValue; - @Field(4) - private boolean boolValue; - @Field(5) - private double doubleValue; - @Field(6) - private String stringValue; - @Field(7) - private byte[] bytesValue; - @Field(8) - public int dataType; - @Field(9) - public int flagType; - - private Flag() { - } - - public Flag(String name, long longValue, int flagType) { - this.name = name; - this.longValue = longValue; - this.dataType = DATA_TYPE_LONG; - this.flagType = flagType; - } - - public Flag(String name, boolean boolValue, int flagType) { - this.name = name; - this.boolValue = boolValue; - this.dataType = DATA_TYPE_BOOL; - this.flagType = flagType; - } - - public Flag(String name, double doubleValue, int flagType) { - this.name = name; - this.doubleValue = doubleValue; - this.dataType = DATA_TYPE_DOUBLE; - this.flagType = flagType; - } - - public Flag(String name, String stringValue, int flagType) { - this.name = name; - this.stringValue = stringValue; - this.dataType = DATA_TYPE_STRING; - this.flagType = flagType; - } - - public Flag(String name, byte[] bytesValue, int flagType) { - this.name = name; - this.bytesValue = bytesValue; - this.dataType = DATA_TYPE_BYTES; - this.flagType = flagType; - } - - public long getLong() { - if (dataType == DATA_TYPE_LONG) - return longValue; - throw new IllegalArgumentException("Not a long type"); - } - - public boolean getBool() { - if (dataType == DATA_TYPE_BOOL) - return boolValue; - throw new IllegalArgumentException("Not a boolean type"); - } - - public double getDouble() { - if (dataType == DATA_TYPE_DOUBLE) - return doubleValue; - throw new IllegalArgumentException("Not a double type"); - } - - public String getString() { - if (dataType == DATA_TYPE_STRING) - return stringValue; - throw new IllegalArgumentException("Not a String type"); - } - - public byte[] getBytes() { - if (dataType == DATA_TYPE_BYTES) - return bytesValue; - throw new IllegalArgumentException("Not a bytes type"); - } - - public static final int DATA_TYPE_LONG = 1; - public static final int DATA_TYPE_BOOL = 2; - public static final int DATA_TYPE_DOUBLE = 3; - public static final int DATA_TYPE_STRING = 4; - public static final int DATA_TYPE_BYTES = 5; - public static final Creator CREATOR = new AutoCreator<>(Flag.class); -} diff --git a/play-services-api/src/main/java/com/mgoogle/android/gms/phenotype/FlagOverrides.java b/play-services-api/src/main/java/com/mgoogle/android/gms/phenotype/FlagOverrides.java deleted file mode 100644 index e13c6ef8..00000000 --- a/play-services-api/src/main/java/com/mgoogle/android/gms/phenotype/FlagOverrides.java +++ /dev/null @@ -1,12 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2020, microG Project Team - * SPDX-License-Identifier: Apache-2.0 - */ - -package com.mgoogle.android.gms.phenotype; - -import org.microg.safeparcel.AutoSafeParcelable; - -public class FlagOverrides extends AutoSafeParcelable { - public static final Creator CREATOR = new AutoCreator<>(FlagOverrides.class); -} diff --git a/play-services-api/src/main/java/com/mgoogle/android/gms/phenotype/GenericDimension.java b/play-services-api/src/main/java/com/mgoogle/android/gms/phenotype/GenericDimension.java deleted file mode 100644 index 40e46bdf..00000000 --- a/play-services-api/src/main/java/com/mgoogle/android/gms/phenotype/GenericDimension.java +++ /dev/null @@ -1,17 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2020, microG Project Team - * SPDX-License-Identifier: Apache-2.0 - */ - -package com.mgoogle.android.gms.phenotype; - -import org.microg.safeparcel.AutoSafeParcelable; - -public class GenericDimension extends AutoSafeParcelable { - @Field(1) - public int a; - @Field(2) - public int b; - - public static final Creator CREATOR = new AutoCreator<>(GenericDimension.class); -} diff --git a/play-services-api/src/main/java/com/mgoogle/android/gms/phenotype/RegistrationInfo.java b/play-services-api/src/main/java/com/mgoogle/android/gms/phenotype/RegistrationInfo.java deleted file mode 100644 index 4e004422..00000000 --- a/play-services-api/src/main/java/com/mgoogle/android/gms/phenotype/RegistrationInfo.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2021 microG Project Team - * SPDX-License-Identifier: Apache-2.0 - */ - -package com.mgoogle.android.gms.phenotype; - -import org.microg.safeparcel.AutoSafeParcelable; - -public class RegistrationInfo extends AutoSafeParcelable { - @Field(1) - public String field1; - @Field(2) - public int field2; - @Field(3) - public String[] field3; - @Field(4) - public byte[] field4; - @Field(5) - public boolean field5; - @Field(6) - public int[] field6; - @Field(7) - public String field7; - - public static final Creator CREATOR = new AutoCreator<>(RegistrationInfo.class); -} diff --git a/play-services-base-core/build.gradle b/play-services-base-core/build.gradle new file mode 100644 index 00000000..727c7921 --- /dev/null +++ b/play-services-base-core/build.gradle @@ -0,0 +1,37 @@ +/* + * SPDX-FileCopyrightText: 2020, microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +apply plugin: 'com.android.library' +apply plugin: 'kotlin-android' +apply plugin: 'maven-publish' +apply plugin: 'signing' + +dependencies { + api project(':play-services-basement') + api "androidx.lifecycle:lifecycle-service:2.5.0" + + implementation "androidx.annotation:annotation:1.4.0" + implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.10' +} + +android { + compileSdkVersion androidCompileSdk + buildToolsVersion "30.0.3" + + defaultConfig { + versionName version + minSdkVersion androidMinSdk + targetSdkVersion androidTargetSdk + } + + sourceSets { + main.java.srcDirs += 'src/main/kotlin' + } + + compileOptions { + sourceCompatibility = 1.8 + targetCompatibility = 1.8 + } +} \ No newline at end of file diff --git a/play-services-base-core/src/main/AndroidManifest.xml b/play-services-base-core/src/main/AndroidManifest.xml new file mode 100644 index 00000000..de583c4d --- /dev/null +++ b/play-services-base-core/src/main/AndroidManifest.xml @@ -0,0 +1,13 @@ + + + + + + + diff --git a/play-services-core/src/main/java/org/microg/gms/AbstractGmsServiceBroker.java b/play-services-base-core/src/main/java/org/microg/gms/AbstractGmsServiceBroker.java similarity index 76% rename from play-services-core/src/main/java/org/microg/gms/AbstractGmsServiceBroker.java rename to play-services-base-core/src/main/java/org/microg/gms/AbstractGmsServiceBroker.java index 364295e0..1cd39310 100644 --- a/play-services-core/src/main/java/org/microg/gms/AbstractGmsServiceBroker.java +++ b/play-services-base-core/src/main/java/org/microg/gms/AbstractGmsServiceBroker.java @@ -48,34 +48,6 @@ public abstract class AbstractGmsServiceBroker extends IGmsServiceBroker.Stub { callGetService(GmsService.PEOPLE, callback, versionCode, packageName, params); } - @Deprecated - @Override - public void getReportingService(IGmsCallbacks callback, int versionCode, String packageName, - Bundle params) throws RemoteException { - callGetService(GmsService.LOCATION_REPORTING, callback, versionCode, packageName, params); - } - - @Deprecated - @Override - public void getGoogleLocationManagerService(IGmsCallbacks callback, int versionCode, - String packageName, Bundle params) throws RemoteException { - callGetService(GmsService.LOCATION_MANAGER, callback, versionCode, packageName, params); - } - - @Deprecated - @Override - public void getPlayLogService(IGmsCallbacks callback, int versionCode, String packageName, - Bundle params) throws RemoteException { - callGetService(GmsService.PLAY_LOG, callback, versionCode, packageName, params); - } - - @Deprecated - @Override - public void getCastMirroringService(IGmsCallbacks callback, int versionCode, String packageName, - Bundle params) throws RemoteException { - callGetService(GmsService.CAST_MIRRORING, callback, versionCode, packageName, params); - } - @Deprecated @Override public void getGoogleIdentityService(IGmsCallbacks callback, int versionCode, @@ -83,13 +55,6 @@ public abstract class AbstractGmsServiceBroker extends IGmsServiceBroker.Stub { callGetService(GmsService.ACCOUNT, callback, versionCode, packageName, params); } - @Deprecated - @Override - public void getCastService(IGmsCallbacks callback, int versionCode, String packageName, - IBinder binder, Bundle params) throws RemoteException { - callGetService(GmsService.CAST, callback, versionCode, packageName, params); - } - @Deprecated @Override public void getAddressService(IGmsCallbacks callback, int versionCode, String packageName) diff --git a/play-services-core/src/main/java/org/microg/gms/BaseService.java b/play-services-base-core/src/main/java/org/microg/gms/BaseService.java similarity index 100% rename from play-services-core/src/main/java/org/microg/gms/BaseService.java rename to play-services-base-core/src/main/java/org/microg/gms/BaseService.java diff --git a/play-services-core/src/main/java/org/microg/gms/DummyService.java b/play-services-base-core/src/main/java/org/microg/gms/DummyService.java similarity index 100% rename from play-services-core/src/main/java/org/microg/gms/DummyService.java rename to play-services-base-core/src/main/java/org/microg/gms/DummyService.java diff --git a/play-services-core/src/main/java/org/microg/gms/common/DeviceConfiguration.java b/play-services-base-core/src/main/java/org/microg/gms/common/DeviceConfiguration.java similarity index 100% rename from play-services-core/src/main/java/org/microg/gms/common/DeviceConfiguration.java rename to play-services-base-core/src/main/java/org/microg/gms/common/DeviceConfiguration.java diff --git a/play-services-core/src/main/java/org/microg/gms/common/DeviceIdentifier.java b/play-services-base-core/src/main/java/org/microg/gms/common/DeviceIdentifier.java similarity index 100% rename from play-services-core/src/main/java/org/microg/gms/common/DeviceIdentifier.java rename to play-services-base-core/src/main/java/org/microg/gms/common/DeviceIdentifier.java diff --git a/play-services-core/src/main/java/org/microg/gms/common/ForegroundServiceContext.java b/play-services-base-core/src/main/java/org/microg/gms/common/ForegroundServiceContext.java similarity index 99% rename from play-services-core/src/main/java/org/microg/gms/common/ForegroundServiceContext.java rename to play-services-base-core/src/main/java/org/microg/gms/common/ForegroundServiceContext.java index 0a5f01c5..217ebcad 100644 --- a/play-services-core/src/main/java/org/microg/gms/common/ForegroundServiceContext.java +++ b/play-services-base-core/src/main/java/org/microg/gms/common/ForegroundServiceContext.java @@ -18,7 +18,7 @@ import android.util.Log; import androidx.annotation.RequiresApi; import androidx.core.app.NotificationCompat; -import com.mgoogle.android.gms.R; +import org.microg.gms.base.core.R; public class ForegroundServiceContext extends ContextWrapper { private static final String TAG = "ForegroundService"; diff --git a/play-services-core/src/main/java/org/microg/gms/common/ForegroundServiceInfo.java b/play-services-base-core/src/main/java/org/microg/gms/common/ForegroundServiceInfo.java similarity index 100% rename from play-services-core/src/main/java/org/microg/gms/common/ForegroundServiceInfo.java rename to play-services-base-core/src/main/java/org/microg/gms/common/ForegroundServiceInfo.java diff --git a/play-services-core/src/main/java/org/microg/gms/common/HttpFormClient.java b/play-services-base-core/src/main/java/org/microg/gms/common/HttpFormClient.java similarity index 100% rename from play-services-core/src/main/java/org/microg/gms/common/HttpFormClient.java rename to play-services-base-core/src/main/java/org/microg/gms/common/HttpFormClient.java diff --git a/play-services-core/src/main/java/org/microg/gms/common/MultiListenerProxy.java b/play-services-base-core/src/main/java/org/microg/gms/common/MultiListenerProxy.java similarity index 100% rename from play-services-core/src/main/java/org/microg/gms/common/MultiListenerProxy.java rename to play-services-base-core/src/main/java/org/microg/gms/common/MultiListenerProxy.java diff --git a/play-services-core/src/main/java/org/microg/gms/common/NonCancelToken.java b/play-services-base-core/src/main/java/org/microg/gms/common/NonCancelToken.java similarity index 100% rename from play-services-core/src/main/java/org/microg/gms/common/NonCancelToken.java rename to play-services-base-core/src/main/java/org/microg/gms/common/NonCancelToken.java diff --git a/play-services-core/src/main/java/org/microg/gms/common/PackageUtils.java b/play-services-base-core/src/main/java/org/microg/gms/common/PackageUtils.java similarity index 100% rename from play-services-core/src/main/java/org/microg/gms/common/PackageUtils.java rename to play-services-base-core/src/main/java/org/microg/gms/common/PackageUtils.java diff --git a/play-services-core/src/main/java/org/microg/gms/common/PhoneInfo.java b/play-services-base-core/src/main/java/org/microg/gms/common/PhoneInfo.java similarity index 100% rename from play-services-core/src/main/java/org/microg/gms/common/PhoneInfo.java rename to play-services-base-core/src/main/java/org/microg/gms/common/PhoneInfo.java diff --git a/play-services-core/src/main/java/org/microg/gms/common/RemoteListenerProxy.java b/play-services-base-core/src/main/java/org/microg/gms/common/RemoteListenerProxy.java similarity index 100% rename from play-services-core/src/main/java/org/microg/gms/common/RemoteListenerProxy.java rename to play-services-base-core/src/main/java/org/microg/gms/common/RemoteListenerProxy.java diff --git a/play-services-core/src/main/java/org/microg/gms/common/Utils.java b/play-services-base-core/src/main/java/org/microg/gms/common/Utils.java similarity index 100% rename from play-services-core/src/main/java/org/microg/gms/common/Utils.java rename to play-services-base-core/src/main/java/org/microg/gms/common/Utils.java diff --git a/play-services-core/src/main/kotlin/org/microg/gms/profile/Build.kt b/play-services-base-core/src/main/kotlin/org/microg/gms/profile/Build.kt similarity index 100% rename from play-services-core/src/main/kotlin/org/microg/gms/profile/Build.kt rename to play-services-base-core/src/main/kotlin/org/microg/gms/profile/Build.kt diff --git a/play-services-core/src/main/kotlin/org/microg/gms/profile/ProfileManager.kt b/play-services-base-core/src/main/kotlin/org/microg/gms/profile/ProfileManager.kt similarity index 100% rename from play-services-core/src/main/kotlin/org/microg/gms/profile/ProfileManager.kt rename to play-services-base-core/src/main/kotlin/org/microg/gms/profile/ProfileManager.kt diff --git a/play-services-core/src/main/kotlin/org/microg/gms/utils/BinderUtils.kt b/play-services-base-core/src/main/kotlin/org/microg/gms/utils/BinderUtils.kt similarity index 100% rename from play-services-core/src/main/kotlin/org/microg/gms/utils/BinderUtils.kt rename to play-services-base-core/src/main/kotlin/org/microg/gms/utils/BinderUtils.kt diff --git a/play-services-core/src/main/kotlin/org/microg/gms/utils/FileXmlResourceParser.kt b/play-services-base-core/src/main/kotlin/org/microg/gms/utils/FileXmlResourceParser.kt similarity index 100% rename from play-services-core/src/main/kotlin/org/microg/gms/utils/FileXmlResourceParser.kt rename to play-services-base-core/src/main/kotlin/org/microg/gms/utils/FileXmlResourceParser.kt diff --git a/play-services-core/src/main/kotlin/org/microg/mgms/settings/SettingsContract.kt b/play-services-base-core/src/main/kotlin/org/microg/mgms/settings/SettingsContract.kt similarity index 100% rename from play-services-core/src/main/kotlin/org/microg/mgms/settings/SettingsContract.kt rename to play-services-base-core/src/main/kotlin/org/microg/mgms/settings/SettingsContract.kt diff --git a/play-services-core/src/main/kotlin/org/microg/mgms/settings/SettingsProvider.kt b/play-services-base-core/src/main/kotlin/org/microg/mgms/settings/SettingsProvider.kt similarity index 97% rename from play-services-core/src/main/kotlin/org/microg/mgms/settings/SettingsProvider.kt rename to play-services-base-core/src/main/kotlin/org/microg/mgms/settings/SettingsProvider.kt index 404aa443..f1829b2c 100644 --- a/play-services-core/src/main/kotlin/org/microg/mgms/settings/SettingsProvider.kt +++ b/play-services-base-core/src/main/kotlin/org/microg/mgms/settings/SettingsProvider.kt @@ -16,7 +16,6 @@ import android.database.MatrixCursor import android.net.Uri import android.preference.PreferenceManager import org.microg.gms.common.PackageUtils.warnIfNotMainProcess -import org.microg.gms.gcm.GcmPrefs import org.microg.mgms.settings.SettingsContract.Auth import org.microg.mgms.settings.SettingsContract.CheckIn import org.microg.mgms.settings.SettingsContract.Gcm @@ -29,6 +28,9 @@ import java.io.File * because it provides safe access from different processes which normal [SharedPreferences] don't. */ class SettingsProvider : ContentProvider() { + companion object { + const val INTERVAL = 1 * 60 * 1000 // 1 minute + } private val preferences: SharedPreferences by lazy { PreferenceManager.getDefaultSharedPreferences(context) @@ -163,9 +165,9 @@ class SettingsProvider : ContentProvider() { Gcm.NETWORK_ROAMING -> Integer.parseInt(preferences.getString(key, "0") ?: "0") Gcm.NETWORK_OTHER -> Integer.parseInt(preferences.getString(key, "0") ?: "0") - Gcm.LEARNT_MOBILE -> preferences.getInt(key, GcmPrefs.INTERVAL) - Gcm.LEARNT_WIFI -> preferences.getInt(key, GcmPrefs.INTERVAL) - Gcm.LEARNT_OTHER -> preferences.getInt(key, GcmPrefs.INTERVAL) + Gcm.LEARNT_MOBILE -> preferences.getInt(key, Companion.INTERVAL) + Gcm.LEARNT_WIFI -> preferences.getInt(key, Companion.INTERVAL) + Gcm.LEARNT_OTHER -> preferences.getInt(key, Companion.INTERVAL) else -> throw IllegalArgumentException("Unknown key: $key") } diff --git a/play-services-base-core/src/main/res/drawable/ic_foreground_notification.xml b/play-services-base-core/src/main/res/drawable/ic_foreground_notification.xml new file mode 100644 index 00000000..ccbc979c --- /dev/null +++ b/play-services-base-core/src/main/res/drawable/ic_foreground_notification.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + diff --git a/play-services-base-core/src/main/res/values-it/strings.xml b/play-services-base-core/src/main/res/values-it/strings.xml new file mode 100644 index 00000000..480b7e30 --- /dev/null +++ b/play-services-base-core/src/main/res/values-it/strings.xml @@ -0,0 +1,7 @@ + + + Avviso Risparmio Energetico + Espandi la notifica + Mantieni i microG in secondo piano + Tocca qui per disattivare l\'ottimizzazione della batteria per microG, poi riavvia il dispositivo per rimuovere questa notifica. + \ No newline at end of file diff --git a/play-services-base-core/src/main/res/values/strings.xml b/play-services-base-core/src/main/res/values/strings.xml new file mode 100644 index 00000000..d236cdaf --- /dev/null +++ b/play-services-base-core/src/main/res/values/strings.xml @@ -0,0 +1,12 @@ + + + + + Battery Saving Warning + Expand notification + Keep microG in background + Tap here to disable battery optimization for vanced microG, then restart the device to remove this notification + diff --git a/play-services-base/build.gradle b/play-services-base/build.gradle index 67fef509..a3fde7fb 100644 --- a/play-services-base/build.gradle +++ b/play-services-base/build.gradle @@ -32,12 +32,12 @@ android { } dependencies { - implementation 'com.google.android.gms:play-services-base:18.0.1' - - api project(':play-services-basement') - api project(':play-services-tasks') api project(':play-services-base-api') - implementation 'androidx.fragment:fragment:1.4.1' - implementation 'com.google.android.gms:play-services-base:18.0.1' + // Dependencies from play-services-base:18.0.1 + api 'androidx.collection:collection:1.2.0' + api 'androidx.core:core:1.8.0' + api 'androidx.fragment:fragment:1.5.0' + api project(':play-services-basement') + api project(':play-services-tasks') } \ No newline at end of file diff --git a/play-services-basement/build.gradle b/play-services-basement/build.gradle index 674edc4c..90870f53 100644 --- a/play-services-basement/build.gradle +++ b/play-services-basement/build.gradle @@ -20,8 +20,10 @@ apply plugin: 'kotlin-android' dependencies { api "org.microg:safe-parcel:1.7.0" - implementation 'androidx.annotation:annotation:1.3.0' - implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.32' + // Dependencies from play-services-basement:18.0.0 + api 'androidx.collection:collection:1.2.0' + api 'androidx.core:core:1.8.0' + api 'androidx.fragment:fragment:1.5.0' } android { diff --git a/play-services-basement/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 index e65fe4ab..8ff5c840 100644 --- a/play-services-basement/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 @@ -8,12 +8,7 @@ import com.google.android.gms.common.internal.ValidateAccountRequest; interface IGmsServiceBroker { 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 getGoogleLocationManagerService(IGmsCallbacks callback, int code, String str, in Bundle params) = 7; - void getPlayLogService(IGmsCallbacks callback, int code, String str, in Bundle params) = 10; - void getCastMirroringService(IGmsCallbacks callback, int code, String str, in Bundle params) = 14; void getGoogleIdentityService(IGmsCallbacks callback, int code, String str, in Bundle params) = 16; - void getCastService(IGmsCallbacks callback, int code, String str, IBinder binder, in Bundle params) = 18; 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-basement/src/main/java/com/google/android/gms/common/Scopes.java b/play-services-basement/src/main/java/com/google/android/gms/common/Scopes.java index a3dfbf5f..520bef02 100644 --- a/play-services-basement/src/main/java/com/google/android/gms/common/Scopes.java +++ b/play-services-basement/src/main/java/com/google/android/gms/common/Scopes.java @@ -18,17 +18,5 @@ 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/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 49f864d4..c9b11ad1 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 @@ -20,37 +20,14 @@ public enum GmsService { UNKNOWN(-2), ANY(-1), PEOPLE(5, "com.google.android.gms.people.service.START"), - LOCATION(6), ACCOUNT(9, "com.google.android.gms.accounts.ACCOUNT_SERVICE"), - CAST(10, "com.google.android.gms.cast.service.BIND_CAST_DEVICE_CONTROLLER_SERVICE"), ADDRESS(12, "com.google.android.gms.identity.service.BIND"), AUTH_PROXY(16, "com.google.android.gms.auth.service.START"), - LIGHTWEIGHT_INDEX(19, "com.google.android.gms.icing.LIGHTWEIGHT_INDEX_SERVICE"), 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"), - CAST_MIRRORING(27, "com.google.android.gms.cast_mirroring.service.START"), - SEARCH_ADMINISTRATION(30), - SEARCH_QUERIES(32), - SEARCH_GLOBAL(33), - SEARCH_CORPORA(36), 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"), SIGN_IN(44, "com.google.android.gms.signin.service.START"), - CONTEXT_MANAGER(47, "com.google.android.contextmanager.service.ContextManagerService.START"), - LIGHTWEIGHT_NETWORK_QUALITY(50, "com.google.android.gms.herrevad.services.LightweightNetworkQualityAndroidService.START"), - PHENOTYPE(51, "com.mgoogle.android.gms.phenotype.service.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"), - MEASUREMENT(93, "com.google.android.gms.measurement.START"), - GASS(116, "com.google.android.gms.gass.START"), - FACS_CACHE(202, "com.google.android.gms.facs.cache.service.START"), IDENTITY_SIGN_IN(212, "com.google.android.gms.auth.api.identity.service.signin.START"), - FACS_SYNC(220, "com.google.android.gms.facs.internal.service.START"), ; public int SERVICE_ID; diff --git a/play-services-cast-api/build.gradle b/play-services-cast-api/build.gradle deleted file mode 100644 index 92e76c5e..00000000 --- a/play-services-cast-api/build.gradle +++ /dev/null @@ -1,41 +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. - */ - -apply plugin: 'com.android.library' - -android { - compileSdkVersion androidCompileSdk - buildToolsVersion "30.0.3" - - aidlPackageWhiteList "com/google/android/gms/cast/ApplicationMetadata.aidl" - aidlPackageWhiteList "com/google/android/gms/cast/LaunchOptions.aidl" - - defaultConfig { - minSdkVersion androidMinSdk - targetSdkVersion androidTargetSdk - } - - compileOptions { - sourceCompatibility = 1.8 - targetCompatibility = 1.8 - } -} - -dependencies { - api project(':play-services-basement') - - api project(':play-services-base-api') -} \ No newline at end of file diff --git a/play-services-cast-api/gradle.properties b/play-services-cast-api/gradle.properties deleted file mode 100644 index f2736ebf..00000000 --- a/play-services-cast-api/gradle.properties +++ /dev/null @@ -1,33 +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. -# - -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 \ No newline at end of file diff --git a/play-services-cast-api/src/main/AndroidManifest.xml b/play-services-cast-api/src/main/AndroidManifest.xml deleted file mode 100644 index d559e589..00000000 --- a/play-services-cast-api/src/main/AndroidManifest.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - diff --git a/play-services-cast-api/src/main/aidl/com/google/android/gms/cast/ApplicationMetadata.aidl b/play-services-cast-api/src/main/aidl/com/google/android/gms/cast/ApplicationMetadata.aidl deleted file mode 100644 index 236c4dbf..00000000 --- a/play-services-cast-api/src/main/aidl/com/google/android/gms/cast/ApplicationMetadata.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.cast; - -parcelable ApplicationMetadata; diff --git a/play-services-cast-api/src/main/aidl/com/google/android/gms/cast/ApplicationStatus.aidl b/play-services-cast-api/src/main/aidl/com/google/android/gms/cast/ApplicationStatus.aidl deleted file mode 100644 index e7ad0532..00000000 --- a/play-services-cast-api/src/main/aidl/com/google/android/gms/cast/ApplicationStatus.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.cast; - -parcelable ApplicationStatus; diff --git a/play-services-cast-api/src/main/aidl/com/google/android/gms/cast/CastDeviceStatus.aidl b/play-services-cast-api/src/main/aidl/com/google/android/gms/cast/CastDeviceStatus.aidl deleted file mode 100644 index 1585adeb..00000000 --- a/play-services-cast-api/src/main/aidl/com/google/android/gms/cast/CastDeviceStatus.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.cast; - -parcelable CastDeviceStatus; diff --git a/play-services-cast-api/src/main/aidl/com/google/android/gms/cast/JoinOptions.aidl b/play-services-cast-api/src/main/aidl/com/google/android/gms/cast/JoinOptions.aidl deleted file mode 100644 index 3eafbddc..00000000 --- a/play-services-cast-api/src/main/aidl/com/google/android/gms/cast/JoinOptions.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.cast; - -parcelable JoinOptions; diff --git a/play-services-cast-api/src/main/aidl/com/google/android/gms/cast/LaunchOptions.aidl b/play-services-cast-api/src/main/aidl/com/google/android/gms/cast/LaunchOptions.aidl deleted file mode 100644 index 85ed609d..00000000 --- a/play-services-cast-api/src/main/aidl/com/google/android/gms/cast/LaunchOptions.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.cast; - -parcelable LaunchOptions; diff --git a/play-services-cast-api/src/main/aidl/com/google/android/gms/cast/RequestItem.aidl b/play-services-cast-api/src/main/aidl/com/google/android/gms/cast/RequestItem.aidl deleted file mode 100644 index 96c3751e..00000000 --- a/play-services-cast-api/src/main/aidl/com/google/android/gms/cast/RequestItem.aidl +++ /dev/null @@ -1,8 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2021, microG Project Team - * SPDX-License-Identifier: Apache-2.0 - */ - -package com.google.android.gms.cast; - -parcelable RequestItem; diff --git a/play-services-cast-api/src/main/aidl/com/google/android/gms/cast/internal/IBundleCallback.aidl b/play-services-cast-api/src/main/aidl/com/google/android/gms/cast/internal/IBundleCallback.aidl deleted file mode 100644 index 15043379..00000000 --- a/play-services-cast-api/src/main/aidl/com/google/android/gms/cast/internal/IBundleCallback.aidl +++ /dev/null @@ -1,10 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2021, microG Project Team - * SPDX-License-Identifier: Apache-2.0 - */ - -package com.google.android.gms.cast.internal; - -interface IBundleCallback { - oneway void onBundle(in Bundle bundle); -} diff --git a/play-services-cast-api/src/main/aidl/com/google/android/gms/cast/internal/ICastDeviceController.aidl b/play-services-cast-api/src/main/aidl/com/google/android/gms/cast/internal/ICastDeviceController.aidl deleted file mode 100644 index 4f91cdda..00000000 --- a/play-services-cast-api/src/main/aidl/com/google/android/gms/cast/internal/ICastDeviceController.aidl +++ /dev/null @@ -1,14 +0,0 @@ -package com.google.android.gms.cast.internal; - -import com.google.android.gms.cast.LaunchOptions; -import com.google.android.gms.cast.JoinOptions; - -interface ICastDeviceController { - oneway void disconnect() = 0; - oneway void stopApplication(String sessionId) = 4; - oneway void sendMessage(String namespace, String message, long requestId) = 8; - oneway void registerNamespace(String namespace) = 10; - oneway void unregisterNamespace(String namespace) = 11; - oneway void launchApplication(String applicationId, in LaunchOptions launchOptions) = 12; - oneway void joinApplication(String applicationId, String sessionId, in JoinOptions joinOptions) = 13; -} diff --git a/play-services-cast-api/src/main/aidl/com/google/android/gms/cast/internal/ICastDeviceControllerListener.aidl b/play-services-cast-api/src/main/aidl/com/google/android/gms/cast/internal/ICastDeviceControllerListener.aidl deleted file mode 100644 index 1d26c14b..00000000 --- a/play-services-cast-api/src/main/aidl/com/google/android/gms/cast/internal/ICastDeviceControllerListener.aidl +++ /dev/null @@ -1,21 +0,0 @@ -package com.google.android.gms.cast.internal; - -import com.google.android.gms.cast.ApplicationMetadata; -import com.google.android.gms.cast.ApplicationStatus; -import com.google.android.gms.cast.CastDeviceStatus; - -interface ICastDeviceControllerListener { - void onDisconnected(int reason) = 0; - void onApplicationConnectionSuccess(in ApplicationMetadata applicationMetadata, String applicationStatus, String sessionId, boolean wasLaunched) = 1; - void onApplicationConnectionFailure(int statusCode) = 2; - // Deprecated: void onStatusReceived(String string1, double double1, boolean boolean1) = 3; - void onTextMessageReceived(String namespace, String message) = 4; - void onBinaryMessageReceived(String namespace, in byte[] data) = 5; - // void onStatusChanged(int status) = 6; // TODO - // void onStatusChanged2(int status) = 7; // TODO - void onApplicationDisconnected(int paramInt) = 8; - void onSendMessageFailure(String response, long requestId, int statusCode) = 9; - void onSendMessageSuccess(String response, long requestId) = 10; - void onApplicationStatusChanged(in ApplicationStatus applicationStatus) = 11; - void onDeviceStatusChanged(in CastDeviceStatus deviceStatus) = 12; -} diff --git a/play-services-cast-api/src/main/aidl/com/google/android/gms/cast/internal/ICastService.aidl b/play-services-cast-api/src/main/aidl/com/google/android/gms/cast/internal/ICastService.aidl deleted file mode 100644 index 7ee5c972..00000000 --- a/play-services-cast-api/src/main/aidl/com/google/android/gms/cast/internal/ICastService.aidl +++ /dev/null @@ -1,18 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2021, microG Project Team - * SPDX-License-Identifier: Apache-2.0 - */ - -package com.google.android.gms.cast.internal; - -import com.google.android.gms.common.api.internal.IStatusCallback; -import com.google.android.gms.cast.internal.IBundleCallback; -import com.google.android.gms.cast.RequestItem; - -interface ICastService { - oneway void broadcastPrecacheMessageLegacy(IStatusCallback callback, in String[] arg2, String precacheData) = 0; - oneway void broadcastPrecacheMessage(IStatusCallback callback, in String[] arg2, String precacheData, in List requestItems) = 1; - oneway void getCxLessStatus(IStatusCallback callback) = 3; - oneway void getFeatureFlags(IBundleCallback callback, in String[] flags) = 4; - oneway void getCastStatusCodeDictionary(IBundleCallback callback, in String[] dictionaries) = 5; -} diff --git a/play-services-cast-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 deleted file mode 100644 index 1e3993b3..00000000 --- a/play-services-cast-api/src/main/java/com/google/android/gms/cast/ApplicationMetadata.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 final int versionCode = 1; - @SafeParceled(2) - public String applicationId; - @SafeParceled(3) - public String name; - @SafeParceled(value = 4, subClass = WebImage.class) - public List images; - @SafeParceled(value = 5, subClass = String.class) - public List namespaces; - @SafeParceled(6) - public String senderAppIdentifier; - @SafeParceled(7) - public 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); - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder("ApplicationMetadata{"); - sb.append("applicationId='").append(applicationId).append("'"); - sb.append(", name='").append(name).append("'"); - sb.append(", images=").append(images.toString()); - if (namespaces != null) { - sb.append(", namespaces=").append(namespaces.toString()); - } - sb.append(", senderAppIdentifier='").append(senderAppIdentifier).append("'"); - if (senderAppLaunchUri != null) { - sb.append(", senderAppLaunchUri='").append(senderAppLaunchUri.toString()).append("'"); - } - sb.append('}'); - return sb.toString(); - } - - public static final Creator CREATOR = new AutoCreator<>(ApplicationMetadata.class); -} diff --git a/play-services-cast-api/src/main/java/com/google/android/gms/cast/ApplicationStatus.java b/play-services-cast-api/src/main/java/com/google/android/gms/cast/ApplicationStatus.java deleted file mode 100644 index 46aa7737..00000000 --- a/play-services-cast-api/src/main/java/com/google/android/gms/cast/ApplicationStatus.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 ApplicationStatus extends AutoSafeParcelable { - - public ApplicationStatus() {} - - public ApplicationStatus(String applicationStatus) { - this.applicationStatus = applicationStatus; - } - - @SafeParceled(1) - private final int versionCode = 1; - @SafeParceled(2) - private String applicationStatus; - - public static final Creator CREATOR = new AutoCreator<>(ApplicationStatus.class); -} diff --git a/play-services-cast-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 deleted file mode 100644 index aaf50ff3..00000000 --- a/play-services-cast-api/src/main/java/com/google/android/gms/cast/CastDevice.java +++ /dev/null @@ -1,193 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 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.InetAddress; -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 CastDevice () { - } - - public CastDevice ( - String id, String name, InetAddress host, int port, String - deviceVersion, String friendlyName, String modelName, String - iconPath, int status, int capabilities) { - this.deviceId = id; - this.address = host.getHostAddress(); - this.servicePort = port; - this.deviceVersion = deviceVersion; - this.friendlyName = friendlyName; - this.icons = new ArrayList<>(); - this.icons.add(new WebImage(Uri.parse(String.format("http://%s:8008%s", this.address, iconPath)))); - this.modelName = modelName; - this.capabilities = capabilities; - } - - /** - * 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 final int versionCode = 3; - - @SafeParceled(2) - private String deviceId; - - @SafeParceled(3) - private String address; - - @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(9) - private int capabilities; - - @SafeParceled(10) - private int status; - - @SafeParceled(11) - private String unknown; // TODO: Need to figure this one out - - 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 String getAddress() { - return address; - } - - public String getModelName() { - return modelName; - } - - public int getServicePort() { - return servicePort; - } - - public boolean hasCapabilities(int[] capabilities) { - for (int capability : capabilities) { - if (!this.hasCapability(capability)) { - return false; - } - } - return true; - } - - public boolean hasCapability(int capability) { - return (capability & capabilities) == capability; - } - - 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); - } - - @Override - public String toString() { - return "CastDevice{" + - "deviceId=" + this.deviceId + - ", address=" + address + - ", friendlyName=" + friendlyName + - ", modelName=" + modelName + - ", deviceVersion=" + deviceVersion + - ", servicePort=" + servicePort + - (icons == null ? "" : (", icons=" + icons)) + - ", capabilities=" + capabilities + - ", status=" + status + - "}"; - } - - public static Creator CREATOR = new AutoCreator<>(CastDevice.class); -} diff --git a/play-services-cast-api/src/main/java/com/google/android/gms/cast/CastDeviceStatus.java b/play-services-cast-api/src/main/java/com/google/android/gms/cast/CastDeviceStatus.java deleted file mode 100644 index ea781b53..00000000 --- a/play-services-cast-api/src/main/java/com/google/android/gms/cast/CastDeviceStatus.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 CastDeviceStatus extends AutoSafeParcelable { - - public CastDeviceStatus() { - } - - public CastDeviceStatus(double volume, boolean mute, int activeInputState, ApplicationMetadata applicationMetadata, int standbyState) { - this.volume = volume; - this.mute = mute; - this.activeInputState = activeInputState; - this.applicationMetadata = applicationMetadata; - this.standbyState = standbyState; - } - - @SafeParceled(1) - private final int versionCode = 1; - @SafeParceled(2) - private double volume; - @SafeParceled(3) - private boolean mute; - @SafeParceled(4) - private int activeInputState; - @SafeParceled(5) - private ApplicationMetadata applicationMetadata; - @SafeParceled(6) - private int standbyState; - - public static final Creator CREATOR = new AutoCreator<>(CastDeviceStatus.class); -} diff --git a/play-services-cast-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 deleted file mode 100644 index ca3a2871..00000000 --- a/play-services-cast-api/src/main/java/com/google/android/gms/cast/CastMediaControlIntent.java +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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"; - - public 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 true if the given category is a custom control category for cast devices, specific to an application ID. - * - * @param applicationId The application ID of the receiver application. - */ - public static boolean isCategoryForCast(String category) { - if (category == null) { - return false; - } - return category.startsWith(CATEGORY_CAST + "/"); - } - - /** - * 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-cast-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 deleted file mode 100644 index e95ed75a..00000000 --- a/play-services-cast-api/src/main/java/com/google/android/gms/cast/CastStatusCodes.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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; -} diff --git a/play-services-cast-api/src/main/java/com/google/android/gms/cast/JoinOptions.java b/play-services-cast-api/src/main/java/com/google/android/gms/cast/JoinOptions.java deleted file mode 100644 index affa9563..00000000 --- a/play-services-cast-api/src/main/java/com/google/android/gms/cast/JoinOptions.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 JoinOptions extends AutoSafeParcelable { - @SafeParceled(1) - private final int versionCode = 1; - @SafeParceled(2) - private final int connectionType = 0; - - public static Creator CREATOR = new AutoCreator<>(JoinOptions.class); -} diff --git a/play-services-cast-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 deleted file mode 100644 index 609302d6..00000000 --- a/play-services-cast-api/src/main/java/com/google/android/gms/cast/LaunchOptions.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 final 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-cast-api/src/main/java/com/google/android/gms/cast/RequestItem.java b/play-services-cast-api/src/main/java/com/google/android/gms/cast/RequestItem.java deleted file mode 100644 index 0fd47c4d..00000000 --- a/play-services-cast-api/src/main/java/com/google/android/gms/cast/RequestItem.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2021, microG Project Team - * SPDX-License-Identifier: Apache-2.0 - */ - -package com.google.android.gms.cast; - -import org.microg.safeparcel.AutoSafeParcelable; - -public class RequestItem extends AutoSafeParcelable { - @Field(2) - public String url; - @Field(3) - public int protocolType; - @Field(4) - public int initialTime; - @Field(5) - public String hlsSegmentFormat; - - public static Creator CREATOR = new AutoCreator(RequestItem.class); -} diff --git a/play-services-cast-framework-api/build.gradle b/play-services-cast-framework-api/build.gradle deleted file mode 100644 index c9b8b637..00000000 --- a/play-services-cast-framework-api/build.gradle +++ /dev/null @@ -1,39 +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. - */ - -apply plugin: 'com.android.library' - -android { - compileSdkVersion androidCompileSdk - buildToolsVersion "30.0.3" - - defaultConfig { - minSdkVersion androidMinSdk - targetSdkVersion androidTargetSdk - } - - compileOptions { - sourceCompatibility = 1.8 - targetCompatibility = 1.8 - } -} - -dependencies { - api project(':play-services-basement') - - api project(':play-services-base-api') - api project(':play-services-cast-api') -} \ No newline at end of file diff --git a/play-services-cast-framework-api/gradle.properties b/play-services-cast-framework-api/gradle.properties deleted file mode 100644 index 69ae4836..00000000 --- a/play-services-cast-framework-api/gradle.properties +++ /dev/null @@ -1,33 +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. -# - -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 \ No newline at end of file diff --git a/play-services-cast-framework-api/src/main/AndroidManifest.xml b/play-services-cast-framework-api/src/main/AndroidManifest.xml deleted file mode 100644 index 89224918..00000000 --- a/play-services-cast-framework-api/src/main/AndroidManifest.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - 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 deleted file mode 100644 index e867d59d..00000000 --- a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/CastOptions.aidl +++ /dev/null @@ -1,3 +0,0 @@ -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/IAppVisibilityListener.aidl b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/IAppVisibilityListener.aidl deleted file mode 100644 index cb173815..00000000 --- a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/IAppVisibilityListener.aidl +++ /dev/null @@ -1,10 +0,0 @@ -package com.google.android.gms.cast.framework; - -import com.google.android.gms.dynamic.IObjectWrapper; - -interface IAppVisibilityListener { - IObjectWrapper getThisObject() = 0; - void onAppEnteredForeground() = 1; - void onAppEnteredBackground() = 2; - int getSupportedVersion() = 3; -} \ 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 deleted file mode 100644 index 4ad8ee32..00000000 --- a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ICastConnectionController.aidl +++ /dev/null @@ -1,11 +0,0 @@ -package com.google.android.gms.cast.framework; - -import com.google.android.gms.cast.LaunchOptions; - -interface ICastConnectionController { - void joinApplication(String applicationId, String sessionId) = 0; - void launchApplication(String applicationId, in LaunchOptions launchOptions) = 1; - void stopApplication(String sessionId) = 2; - void closeConnection(int reason) = 3; // Maybe? - int getSupportedVersion() = 4; -} 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 deleted file mode 100644 index 717671d7..00000000 --- a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ICastContext.aidl +++ /dev/null @@ -1,20 +0,0 @@ -package com.google.android.gms.cast.framework; - -import com.google.android.gms.cast.framework.IAppVisibilityListener; -import com.google.android.gms.cast.framework.ISessionManager; -import com.google.android.gms.cast.framework.IDiscoveryManager; -import com.google.android.gms.dynamic.IObjectWrapper; - -interface ICastContext { - Bundle getMergedSelectorAsBundle() = 0; - boolean isApplicationVisible() = 1; - void addVisibilityChangeListener(IAppVisibilityListener listener) = 2; - void removeVisibilityChangeListener(IAppVisibilityListener listener) = 3; - ISessionManager getSessionManagerImpl() = 4; - IDiscoveryManager getDiscoveryManagerImpl() = 5; - void destroy() = 6; // deprecated? - void onActivityResumed(in IObjectWrapper activity) = 7; // deprecated? - void onActivityPaused(in IObjectWrapper activity) = 8; // deprecated? - IObjectWrapper getWrappedThis() = 9; - void setReceiverApplicationId(String receiverApplicationId, in Map/**/ sessionProvidersByCategory) = 10; -} 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 deleted file mode 100644 index e5c11cba..00000000 --- a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ICastSession.aidl +++ /dev/null @@ -1,15 +0,0 @@ -package com.google.android.gms.cast.framework; - -import android.os.Bundle; - -import com.google.android.gms.cast.ApplicationMetadata; -import com.google.android.gms.common.api.Status; - -interface ICastSession { - void onConnected(in Bundle routeInfoExtra) = 0; - void onConnectionSuspended(int reason) = 1; - void onConnectionFailed(in Status status) = 2; - void onApplicationConnectionSuccess(in ApplicationMetadata applicationMetadata, String applicationStatus, String sessionId, boolean wasLaunched) = 3; - void onApplicationConnectionFailure(int statusCode) = 4; - void disconnectFromDevice(boolean boolean1, int int1) = 5; -} diff --git a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ICastStateListener.aidl b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ICastStateListener.aidl deleted file mode 100644 index 98e20151..00000000 --- a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ICastStateListener.aidl +++ /dev/null @@ -1,9 +0,0 @@ -package com.google.android.gms.cast.framework; - -import com.google.android.gms.dynamic.IObjectWrapper; - -interface ICastStateListener { - IObjectWrapper getWrappedThis() = 0; - void onCastStateChanged(int newState) = 1; - int getSupportedVersion() = 2; -} diff --git a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/IDiscoveryManager.aidl b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/IDiscoveryManager.aidl deleted file mode 100644 index 0c775ac0..00000000 --- a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/IDiscoveryManager.aidl +++ /dev/null @@ -1,12 +0,0 @@ -package com.google.android.gms.cast.framework; - -import com.google.android.gms.cast.framework.IDiscoveryManagerListener; -import com.google.android.gms.dynamic.IObjectWrapper; - -interface IDiscoveryManager { - void startDiscovery() = 0; // Maybe? - void stopDiscovery() = 1; // Maybe? - void addDiscoveryManagerListener(IDiscoveryManagerListener listener) = 2; - void removeDiscoveryManagerListener(IDiscoveryManagerListener listener) = 3; - IObjectWrapper getWrappedThis() = 4; -} diff --git a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/IDiscoveryManagerListener.aidl b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/IDiscoveryManagerListener.aidl deleted file mode 100644 index 701a5c24..00000000 --- a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/IDiscoveryManagerListener.aidl +++ /dev/null @@ -1,8 +0,0 @@ -package com.google.android.gms.cast.framework; - -import com.google.android.gms.dynamic.IObjectWrapper; - -interface IDiscoveryManagerListener { - IObjectWrapper getWrappedThis() = 0; - void onDeviceAvailabilityChanged(boolean deviceAvailable) = 1; -} 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 deleted file mode 100644 index 33f19574..00000000 --- a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/IReconnectionService.aidl +++ /dev/null @@ -1,5 +0,0 @@ -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 deleted file mode 100644 index a5580bc3..00000000 --- a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ISession.aidl +++ /dev/null @@ -1,22 +0,0 @@ -package com.google.android.gms.cast.framework; - -import com.google.android.gms.dynamic.IObjectWrapper; - -interface ISession { - IObjectWrapper getWrappedObject() = 0; - String getCategory() = 1; - String getSessionId() = 2; - String getRouteId() = 3; - boolean isConnected() = 4; - boolean isConnecting() = 5; - boolean isDisconnecting() = 6; - boolean isDisconnected() = 7; - boolean isResuming() = 8; - boolean isSuspended() = 9; - void notifySessionStarted(String sessionId) = 10; - void notifyFailedToStartSession(int error) = 11; - void notifySessionEnded(int error) = 12; - void notifySessionResumed(boolean wasSuspended) = 13; - void notifyFailedToResumeSession(int error) = 14; - void notifySessionSuspended(int reason) = 15; -} 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 deleted file mode 100644 index caf95617..00000000 --- a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ISessionManager.aidl +++ /dev/null @@ -1,19 +0,0 @@ -package com.google.android.gms.cast.framework; - -import android.os.Bundle; - -import com.google.android.gms.dynamic.IObjectWrapper; -import com.google.android.gms.cast.framework.ISessionManagerListener; -import com.google.android.gms.cast.framework.ICastStateListener; - -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; - int getCastState() = 7; - void startSession(in Bundle options) = 8; -} diff --git a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ISessionManagerListener.aidl b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ISessionManagerListener.aidl deleted file mode 100644 index 4dc4ae9d..00000000 --- a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ISessionManagerListener.aidl +++ /dev/null @@ -1,17 +0,0 @@ -package com.google.android.gms.cast.framework; - -import com.google.android.gms.dynamic.IObjectWrapper; - -interface ISessionManagerListener { - IObjectWrapper getWrappedThis() = 0; - void onSessionStarting(IObjectWrapper session) = 1; - void onSessionStarted(IObjectWrapper session, String sessionId) = 2; - void onSessionStartFailed(IObjectWrapper session, int error) = 3; - void onSessionEnding(IObjectWrapper session) = 4; - void onSessionEnded(IObjectWrapper session, int error) = 5; - void onSessionResuming(IObjectWrapper session, String sessionId) = 6; - void onSessionResumed(IObjectWrapper session, boolean wasSuspended) = 7; - void onSessionResumeFailed(IObjectWrapper session, int error) = 8; - void onSessionSuspended(IObjectWrapper session, int reason) = 9; - int getSupportedVersion() = 10; -} diff --git a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ISessionProvider.aidl b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ISessionProvider.aidl deleted file mode 100644 index 5f99e9df..00000000 --- a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ISessionProvider.aidl +++ /dev/null @@ -1,10 +0,0 @@ -package com.google.android.gms.cast.framework; - -import com.google.android.gms.dynamic.IObjectWrapper; - -interface ISessionProvider { - IObjectWrapper getSession(String sessionId) = 0; - boolean isSessionRecoverable() = 1; - String getCategory() = 2; - int getSupportedVersion() = 3; -} 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 deleted file mode 100644 index 170680a0..00000000 --- a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ISessionProxy.aidl +++ /dev/null @@ -1,14 +0,0 @@ -package com.google.android.gms.cast.framework; - -import com.google.android.gms.dynamic.IObjectWrapper; - -interface ISessionProxy { - IObjectWrapper getWrappedSession() = 0; - void start(in Bundle extras) = 1; - void resume(in Bundle extras) = 2; - void end(boolean paramBoolean) = 3; - long getSessionRemainingTimeMs() = 4; - int getSupportedVersion() = 5; - void onStarting(in Bundle routeInfoExtra) = 6; - void onResuming(in Bundle routeInfoExtra) = 7; -} 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 deleted file mode 100644 index 2085775a..00000000 --- a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/internal/ICastDynamiteModule.aidl +++ /dev/null @@ -1,24 +0,0 @@ -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 sessionProviders) = 0; - ISession newSessionImpl(String category, String sessionId, 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; -} 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 deleted file mode 100644 index 3cfba99a..00000000 --- a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/internal/IMediaRouter.aidl +++ /dev/null @@ -1,19 +0,0 @@ -package com.google.android.gms.cast.framework.internal; - -import android.os.Bundle; - -import com.google.android.gms.cast.framework.internal.IMediaRouterCallback; - -interface IMediaRouter { - void registerMediaRouterCallbackImpl(in Bundle selector, IMediaRouterCallback callback) = 0; - void addCallback(in Bundle selector, int flags) = 1; - void removeCallback(in Bundle selector) = 2; - boolean isRouteAvailable(in Bundle selector, int flags) = 3; - void selectRouteById(String routeId) = 4; - void selectDefaultRoute() = 5; - boolean isDefaultRouteSelected() = 6; // Maybe? - Bundle getRouteInfoExtrasById(String routeId) = 7; - String getSelectedRouteId() = 8; // Maybe? - int getSupportedVersion() = 9; - void clearCallbacks() = 10; -} diff --git a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/internal/IMediaRouterCallback.aidl b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/internal/IMediaRouterCallback.aidl deleted file mode 100644 index d28c87c8..00000000 --- a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/internal/IMediaRouterCallback.aidl +++ /dev/null @@ -1,12 +0,0 @@ -package com.google.android.gms.cast.framework.internal; - -import android.os.Bundle; - -interface IMediaRouterCallback { - void onRouteAdded(String routeId, in Bundle extras) = 0; - void onRouteChanged(String routeId, in Bundle extras) = 1; - void onRouteRemoved(String routeId, in Bundle extras) = 2; - void onRouteSelected(String routeId, in Bundle extras) = 3; - void unknown(String routeId, in Bundle extras) = 4; - void onRouteUnselected(String routeId, in Bundle extras, int reason) = 5; -} 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 deleted file mode 100644 index 4186fc4b..00000000 --- a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/media/CastMediaOptions.aidl +++ /dev/null @@ -1,3 +0,0 @@ -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/IImagePicker.aidl b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/media/IImagePicker.aidl deleted file mode 100644 index 05211a38..00000000 --- a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/media/IImagePicker.aidl +++ /dev/null @@ -1,11 +0,0 @@ -package com.google.android.gms.cast.framework.media; - -import com.google.android.gms.common.images.WebImage; -import com.google.android.gms.dynamic.IObjectWrapper; - -interface IImagePicker { - // WebImage onPickImage(MediaMetadata metadata, int int1) = 0; - IObjectWrapper getWrappedClientObject() = 1; - int unknown1() = 2; - // WebImage onPickImage(MediaMetadata metadata, ImageHints imageHints) = 3; -} 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 deleted file mode 100644 index 03e48729..00000000 --- a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/media/IMediaNotificationService.aidl +++ /dev/null @@ -1,5 +0,0 @@ -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/INotificationActionsProvider.aidl b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/media/INotificationActionsProvider.aidl deleted file mode 100644 index 325efe23..00000000 --- a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/media/INotificationActionsProvider.aidl +++ /dev/null @@ -1,5 +0,0 @@ -package com.google.android.gms.cast.framework.media; - -interface INotificationActionsProvider { - -} diff --git a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/media/NotificationOptions.aidl b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/media/NotificationOptions.aidl deleted file mode 100644 index b918b7e6..00000000 --- a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/media/NotificationOptions.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.cast.framework.media; - -parcelable NotificationOptions; 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 deleted file mode 100644 index c9f2286d..00000000 --- a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/media/internal/IFetchBitmapTask.aidl +++ /dev/null @@ -1,5 +0,0 @@ -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 deleted file mode 100644 index 58b80c08..00000000 --- a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/media/internal/IFetchBitmapTaskProgressPublisher.aidl +++ /dev/null @@ -1,5 +0,0 @@ -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 deleted file mode 100644 index adfdb1ca..00000000 --- a/play-services-cast-framework-api/src/main/java/com/google/android/gms/cast/framework/CastOptions.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 com.google.android.gms.cast.LaunchOptions; -import com.google.android.gms.cast.framework.media.CastMediaOptions; - -import org.microg.safeparcel.AutoSafeParcelable; - -import java.util.ArrayList; - -public class CastOptions extends AutoSafeParcelable { - @Field(1) - private final int versionCode = 1; - @Field(2) - private String receiverApplicationId; - @Field(3) - private ArrayList supportedNamespaces; - @Field(4) - private boolean stopReceiverApplicationWhenEndingSession; - @Field(5) - private LaunchOptions launchOptions; - @Field(6) - private boolean resumeSavedSession; - @Field(7) - private CastMediaOptions castMediaOptions; - @Field(8) - private boolean enableReconnectionService; - @Field(9) - private double volumeDeltaBeforeIceCreamSandwich; - - public String getReceiverApplicationId() { - return this.receiverApplicationId; - } - - public LaunchOptions getLaunchOptions() { - return this.launchOptions; - } - - 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/CastState.java b/play-services-cast-framework-api/src/main/java/com/google/android/gms/cast/framework/CastState.java deleted file mode 100644 index 85d57bea..00000000 --- a/play-services-cast-framework-api/src/main/java/com/google/android/gms/cast/framework/CastState.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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; - -public final class CastState { - public static final int NO_DEVICES_AVAILABLE = 1; - public static final int NOT_CONNECTED = 2; - public static final int CONNECTING = 3; - public static final int CONNECTED = 4; - - public static String toString(int castState) { - switch (castState) { - case NO_DEVICES_AVAILABLE: - return "NO_DEVICES_AVAILABLE"; - case NOT_CONNECTED: - return "NOT_CONNECTED"; - case CONNECTING: - return "CONNECTING"; - case CONNECTED: - return "CONNECTED"; - default: - return "UNKNOWN"; - } - } -} 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 deleted file mode 100644 index 742e9798..00000000 --- a/play-services-cast-framework-api/src/main/java/com/google/android/gms/cast/framework/media/CastMediaOptions.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 { - - @Field(1) - private final int versionCode = 1; - @Field(2) - public String mediaIntentReceiverClassName; - @Field(3) - public String expandedControllerActivityClassName; - @Field(4) - public IImagePicker imagePicker; - @Field(5) - public NotificationOptions notificationOptions; - @Field(6) - public boolean bool6; - @Field(7) - public boolean bool7; - - public static Creator CREATOR = new AutoCreator(CastMediaOptions.class); -} diff --git a/play-services-cast-framework-api/src/main/java/com/google/android/gms/cast/framework/media/NotificationOptions.java b/play-services-cast-framework-api/src/main/java/com/google/android/gms/cast/framework/media/NotificationOptions.java deleted file mode 100644 index b6960149..00000000 --- a/play-services-cast-framework-api/src/main/java/com/google/android/gms/cast/framework/media/NotificationOptions.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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; - -import java.util.List; - -public class NotificationOptions extends AutoSafeParcelable { - - @Field(1) - private final int versionCode = 1; - @Field(2) - public List actions; - @Field(3) - public int[] compatActionIndices; - @Field(4) - public long skipStepMs; - @Field(5) - public String targetActivityClassName; - @Field(6) - public int getSmallIconDrawableResId; - @Field(7) - public int getStopLiveStreamDrawableResId; - @Field(8) - public int getPauseDrawableResId; - @Field(9) - public int getPlayDrawableResId; - @Field(10) - public int getSkipNextDrawableResId; - @Field(11) - public int getSkipPrevDrawableResId; - @Field(12) - public int getForwardDrawableResId; - @Field(13) - public int getForward10DrawableResId; - @Field(14) - public int getForward30DrawableResId; - @Field(15) - public int getRewindDrawableResId; - @Field(16) - public int getRewind10DrawableResId; - @Field(17) - public int getRewind30DrawableResId; - @Field(18) - public int getDisconnectDrawableResId; - @Field(19) - public int intvar19; - @Field(20) - public int getCastingToDeviceStringResId; - @Field(21) - public int getStopLiveStreamTitleResId; - @Field(22) - public int intvar22; - @Field(23) - public int intvar23; - @Field(24) - public int intvar24; - @Field(25) - public int intvar25; - @Field(26) - public int intvar26; - @Field(27) - public int intvar27; - @Field(28) - public int intvar28; - @Field(29) - public int intvar29; - @Field(30) - public int intvar30; - @Field(31) - public int intvar31; - @Field(32) - public int intvar32; - @Field(33) - public INotificationActionsProvider notificationActionsProvider; - - public static Creator CREATOR = new AutoCreator(NotificationOptions.class); -} diff --git a/play-services-cast/build.gradle b/play-services-cast/build.gradle deleted file mode 100755 index dbdf42b0..00000000 --- a/play-services-cast/build.gradle +++ /dev/null @@ -1,37 +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. - */ - -apply plugin: 'com.android.library' - -android { - compileSdkVersion androidCompileSdk - buildToolsVersion "30.0.3" - - defaultConfig { - minSdkVersion androidMinSdk - targetSdkVersion androidTargetSdk - } - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } -} - -dependencies { - api project(':play-services-base') - api project(':play-services-cast-api') -} \ No newline at end of file diff --git a/play-services-cast/gradle.properties b/play-services-cast/gradle.properties deleted file mode 100755 index 85daef1f..00000000 --- a/play-services-cast/gradle.properties +++ /dev/null @@ -1,33 +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. -# - -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 \ No newline at end of file diff --git a/play-services-cast/src/main/AndroidManifest.xml b/play-services-cast/src/main/AndroidManifest.xml deleted file mode 100755 index 7e14f394..00000000 --- a/play-services-cast/src/main/AndroidManifest.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - 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 deleted file mode 100755 index aa5e06a5..00000000 --- a/play-services-cast/src/main/java/com/google/android/gms/cast/Cast.java +++ /dev/null @@ -1,223 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 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.CastApiClientBuilder; -import org.microg.gms.cast.CastApiImpl; -import org.microg.gms.common.PublicApi; - -import java.io.IOException; - -@PublicApi -public final class Cast { - - /** - * 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 CastApiClientBuilder()); - - /** - * 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(); - - 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/CastPresentation.java b/play-services-cast/src/main/java/com/google/android/gms/cast/CastPresentation.java deleted file mode 100755 index cfc55685..00000000 --- a/play-services-cast/src/main/java/com/google/android/gms/cast/CastPresentation.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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-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 deleted file mode 100755 index 4f1d59ae..00000000 --- a/play-services-cast/src/main/java/com/google/android/gms/cast/CastRemoteDisplay.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.CastRemoteDisplayApiClientBuilder; -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 CastRemoteDisplayApiClientBuilder()); - - /** - * 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 final CastDevice castDevice; - private final CastRemoteDisplaySessionCallbacks callbacks; - - private CastRemoteDisplayOptions(CastDevice castDevice, CastRemoteDisplaySessionCallbacks callbacks) { - this.castDevice = castDevice; - this.callbacks = callbacks; - } - - public static final class Builder { - private final CastDevice castDevice; - private final 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 deleted file mode 100755 index 5c053581..00000000 --- a/play-services-cast/src/main/java/com/google/android/gms/cast/CastRemoteDisplayApi.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 deleted file mode 100755 index dbc4108a..00000000 --- a/play-services-cast/src/main/java/com/google/android/gms/cast/CastRemoteDisplayLocalService.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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/CastApiClientBuilder.java b/play-services-cast/src/main/java/org/microg/gms/cast/CastApiClientBuilder.java deleted file mode 100755 index 47847803..00000000 --- a/play-services-cast/src/main/java/org/microg/gms/cast/CastApiClientBuilder.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES 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 org.microg.gms.common.api.ApiClient; -import org.microg.gms.common.api.ApiClientBuilder; -import org.microg.gms.common.api.ApiClientSettings; -import org.microg.gms.common.api.ConnectionCallbacks; -import org.microg.gms.common.api.OnConnectionFailedListener; - -public class CastApiClientBuilder implements ApiClientBuilder { - @Override - public ApiClient build(Cast.CastOptions options, Context context, Looper looper, ApiClientSettings clientSettings, ConnectionCallbacks callbacks, 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 deleted file mode 100755 index bb95565e..00000000 --- a/play-services-cast/src/main/java/org/microg/gms/cast/CastApiImpl.java +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES 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 deleted file mode 100755 index 8b6bd502..00000000 --- a/play-services-cast/src/main/java/org/microg/gms/cast/CastClientImpl.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES 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 org.microg.gms.common.DummyApiClient; -import org.microg.gms.common.api.ConnectionCallbacks; -import org.microg.gms.common.api.OnConnectionFailedListener; - -public class CastClientImpl extends DummyApiClient { - public CastClientImpl(Context context, Cast.CastOptions options, ConnectionCallbacks callbacks, OnConnectionFailedListener connectionFailedListener) { - } -} diff --git a/play-services-cast/src/main/java/org/microg/gms/cast/CastRemoteDisplayApiClientBuilder.java b/play-services-cast/src/main/java/org/microg/gms/cast/CastRemoteDisplayApiClientBuilder.java deleted file mode 100755 index b3f5374a..00000000 --- a/play-services-cast/src/main/java/org/microg/gms/cast/CastRemoteDisplayApiClientBuilder.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES 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 org.microg.gms.common.DummyApiClient; -import org.microg.gms.common.api.ApiClient; -import org.microg.gms.common.api.ApiClientBuilder; -import org.microg.gms.common.api.ApiClientSettings; -import org.microg.gms.common.api.ConnectionCallbacks; -import org.microg.gms.common.api.OnConnectionFailedListener; - -public class CastRemoteDisplayApiClientBuilder implements ApiClientBuilder { - @Override - public ApiClient build(CastRemoteDisplay.CastRemoteDisplayOptions options, Context context, Looper looper, ApiClientSettings clientSettings, ConnectionCallbacks callbacks, OnConnectionFailedListener connectionFailedListener) { - return new DummyApiClient(); - } -} 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 deleted file mode 100755 index 4f47a90d..00000000 --- a/play-services-cast/src/main/java/org/microg/gms/cast/CastRemoteDisplayApiImpl.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES 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; - } -} diff --git a/play-services-core-proto/build.gradle b/play-services-core-proto/build.gradle index facb7026..e451ba08 100644 --- a/play-services-core-proto/build.gradle +++ b/play-services-core-proto/build.gradle @@ -7,7 +7,7 @@ apply plugin: 'com.squareup.wire' apply plugin: 'kotlin' dependencies { - implementation "com.squareup.wire:wire-runtime:3.6.1" + implementation 'com.squareup.wire:wire-runtime:4.4.1' } wire { diff --git a/play-services-core-proto/src/main/proto/checkin.proto b/play-services-core-proto/src/main/proto/checkin.proto index 2e0b75f3..5b1e8141 100644 --- a/play-services-core-proto/src/main/proto/checkin.proto +++ b/play-services-core-proto/src/main/proto/checkin.proto @@ -189,7 +189,7 @@ message CheckinRequest { optional int32 glEsVersion = 8; // PackageManager.getSystemSharedLibraryNames - // eg. "android.test.runner", "com.android.future.usb.accessory", "com.android.location.provider", + // eg. "android.test.runner", "com.android.future.usb.accessory", // "com.android.media.remotedisplay", "com.android.mediadrm.signer", "com.google.android.maps", // "com.google.android.media.effects", "com.google.widevine.software.drm", "javax.obex" repeated string sharedLibrary = 9; diff --git a/play-services-core/build.gradle b/play-services-core/build.gradle index 19dac2e6..f6cf41bf 100644 --- a/play-services-core/build.gradle +++ b/play-services-core/build.gradle @@ -19,33 +19,28 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' dependencies { - implementation 'com.squareup.wire:wire-runtime:3.6.1' + implementation 'com.squareup.wire:wire-runtime:4.4.1' implementation 'de.hdodenhof:circleimageview:3.1.0' - implementation "info.armills.chromecast-java-api-v2:api-v2-raw-request:0.10.4-raw-request-1" implementation 'androidx.webkit:webkit:1.4.0' - implementation project(':play-services-cronet-core') + implementation project(':play-services-base-core') implementation project(':play-services-core-proto') implementation project(':play-services-core:microg-ui-tools') // deprecated implementation project(':play-services-api') - implementation project(':play-services-cast-api') implementation project(':play-services-tasks') // AndroidX UI - implementation 'androidx.appcompat:appcompat:1.4.1' - implementation 'androidx.mediarouter:mediarouter:1.2.6' + implementation 'androidx.appcompat:appcompat:1.4.2' + implementation 'androidx.mediarouter:mediarouter:1.3.1' implementation 'androidx.preference:preference-ktx:1.2.0' - implementation "org.microg.gms:conscrypt-gmscore:2.5.1" - implementation 'androidx.annotation:annotation:1.3.0' - implementation 'androidx.lifecycle:lifecycle-service:2.4.1' + implementation 'org.microg.gms:conscrypt-gmscore:2.5.2' // Navigation - implementation 'androidx.navigation:navigation-fragment-ktx:2.4.1' - implementation 'androidx.navigation:navigation-ui-ktx:2.4.1' + implementation 'androidx.navigation:navigation-fragment-ktx:2.5.1' + implementation 'androidx.navigation:navigation-ui-ktx:2.5.1' - implementation 'androidx.lifecycle:lifecycle-service:2.4.1' - implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.10' + implementation 'androidx.lifecycle:lifecycle-service:2.5.1' implementation 'com.android.volley:volley:1.2.1' api project(':play-services-basement') diff --git a/play-services-core/microg-ui-tools/build.gradle b/play-services-core/microg-ui-tools/build.gradle index cfd28f93..54245db4 100644 --- a/play-services-core/microg-ui-tools/build.gradle +++ b/play-services-core/microg-ui-tools/build.gradle @@ -37,7 +37,7 @@ android { } dependencies { - implementation 'androidx.appcompat:appcompat:1.4.1' + implementation 'androidx.appcompat:appcompat:1.4.2' implementation 'androidx.preference:preference:1.2.0' } diff --git a/play-services-core/proguard-rules.pro b/play-services-core/proguard-rules.pro index 265f7b40..9b421ddd 100644 --- a/play-services-core/proguard-rules.pro +++ b/play-services-core/proguard-rules.pro @@ -11,7 +11,6 @@ -dontwarn com.caverock.androidsvg.** -dontwarn org.slf4j.** -dontwarn org.codehaus.jackson.** --dontwarn com.android.location.provider.** -dontwarn java.lang.instrument.ClassFileTransformer -dontwarn sun.misc.SignalHandler -dontwarn com.android.org.conscrypt.SSLParametersImpl @@ -22,7 +21,6 @@ # Keep dynamically loaded GMS classes -keep public class com.google.android.gms.common.security.ProviderInstallerImpl { public *; } --keep public class com.google.android.gms.cast.framework.internal.CastDynamiteModuleImpl { public *; } # Keep AutoSafeParcelables -keep public class * extends org.microg.safeparcel.AutoSafeParcelable { diff --git a/play-services-core/src/main/AndroidManifest.xml b/play-services-core/src/main/AndroidManifest.xml index 1e376be6..540a0748 100644 --- a/play-services-core/src/main/AndroidManifest.xml +++ b/play-services-core/src/main/AndroidManifest.xml @@ -53,8 +53,6 @@ - - @@ -115,13 +113,6 @@ android:name="org.microg.mgms.settings.GoogleSettingsProvider" android:authorities="com.mgoogle.settings" android:exported="true" /> - @@ -310,14 +301,6 @@ - - - - - - - - - - - - + android:resource="@mipmap/ic_launcher" /> @@ -405,74 +381,8 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -480,33 +390,13 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/play-services-core/src/main/ic_launcher-playstore.png b/play-services-core/src/main/ic_launcher-playstore.png index ff47dbb5..62dcd120 100644 Binary files a/play-services-core/src/main/ic_launcher-playstore.png and b/play-services-core/src/main/ic_launcher-playstore.png differ diff --git a/play-services-core/src/main/java/com/google/android/gms/cast/framework/internal/CastContextImpl.java b/play-services-core/src/main/java/com/google/android/gms/cast/framework/internal/CastContextImpl.java deleted file mode 100644 index c453714c..00000000 --- a/play-services-core/src/main/java/com/google/android/gms/cast/framework/internal/CastContextImpl.java +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.internal; - -import android.content.Context; -import android.os.Bundle; -import android.os.IBinder; -import android.os.RemoteException; -import android.util.Log; - -import androidx.mediarouter.media.MediaControlIntent; -import androidx.mediarouter.media.MediaRouteSelector; - -import com.google.android.gms.cast.CastMediaControlIntent; -import com.google.android.gms.cast.framework.CastOptions; -import com.google.android.gms.cast.framework.IAppVisibilityListener; -import com.google.android.gms.cast.framework.ICastContext; -import com.google.android.gms.cast.framework.IDiscoveryManager; -import com.google.android.gms.cast.framework.ISessionProvider; -import com.google.android.gms.dynamic.IObjectWrapper; -import com.google.android.gms.dynamic.ObjectWrapper; - -import java.util.HashMap; -import java.util.Map; - -public class CastContextImpl extends ICastContext.Stub { - private static final String TAG = CastContextImpl.class.getSimpleName(); - - private SessionManagerImpl sessionManager; - private DiscoveryManagerImpl discoveryManager; - - private final Context context; - private final CastOptions options; - private final IMediaRouter router; - private final Map sessionProviders = new HashMap(); - public ISessionProvider defaultSessionProvider; - - private final MediaRouteSelector mergedSelector; - - public CastContextImpl(IObjectWrapper context, CastOptions options, IMediaRouter router, Map sessionProviders) throws RemoteException { - this.context = (Context) ObjectWrapper.unwrap(context); - this.options = options; - this.router = router; - for (Map.Entry entry : sessionProviders.entrySet()) { - this.sessionProviders.put(entry.getKey(), ISessionProvider.Stub.asInterface(entry.getValue())); - } - - String receiverApplicationId = options.getReceiverApplicationId(); - String defaultCategory = CastMediaControlIntent.categoryForCast(receiverApplicationId); - - this.defaultSessionProvider = this.sessionProviders.get(defaultCategory); - - // TODO: This should incorporate passed options - this.mergedSelector = new MediaRouteSelector.Builder() - .addControlCategory(MediaControlIntent.CATEGORY_LIVE_VIDEO) - .addControlCategory(MediaControlIntent.CATEGORY_REMOTE_PLAYBACK) - .addControlCategory(defaultCategory) - .build(); - } - - @Override - public Bundle getMergedSelectorAsBundle() throws RemoteException { - return this.mergedSelector.asBundle(); - } - - @Override - public void addVisibilityChangeListener(IAppVisibilityListener listener) { - Log.d(TAG, "unimplemented Method: addVisibilityChangeListener"); - } - - @Override - public void removeVisibilityChangeListener(IAppVisibilityListener listener) { - Log.d(TAG, "unimplemented Method: removeVisibilityChangeListener"); - } - - @Override - public boolean isApplicationVisible() throws RemoteException { - Log.d(TAG, "unimplemented Method: isApplicationVisible"); - return true; - } - - @Override - public SessionManagerImpl getSessionManagerImpl() { - if (this.sessionManager == null) { - this.sessionManager = new SessionManagerImpl(this); - } - return this.sessionManager; - } - - @Override - public IDiscoveryManager getDiscoveryManagerImpl() throws RemoteException { - if (this.discoveryManager == null) { - this.discoveryManager = new DiscoveryManagerImpl(this); - } - return this.discoveryManager; - } - - @Override - public void destroy() throws RemoteException { - Log.d(TAG, "unimplemented Method: destroy"); - } - - @Override - public void onActivityResumed(IObjectWrapper activity) throws RemoteException { - Log.d(TAG, "unimplemented Method: onActivityResumed"); - - } - - @Override - public void onActivityPaused(IObjectWrapper activity) throws RemoteException { - Log.d(TAG, "unimplemented Method: onActivityPaused"); - } - - @Override - public void setReceiverApplicationId(String receiverApplicationId, Map sessionProvidersByCategory) throws RemoteException { - Log.d(TAG, "unimplemented Method: setReceiverApplicationId"); - } - - public Context getContext() { - return this.context; - } - - public IMediaRouter getRouter() { - return this.router; - } - - public MediaRouteSelector getMergedSelector() { - return this.mergedSelector; - } - - public CastOptions getOptions() { - return this.options; - } - - @Override - public IObjectWrapper getWrappedThis() throws RemoteException { - return ObjectWrapper.wrap(this); - } -} diff --git a/play-services-core/src/main/java/com/google/android/gms/cast/framework/internal/CastDynamiteModuleImpl.java b/play-services-core/src/main/java/com/google/android/gms/cast/framework/internal/CastDynamiteModuleImpl.java deleted file mode 100644 index fccaf432..00000000 --- a/play-services-core/src/main/java/com/google/android/gms/cast/framework/internal/CastDynamiteModuleImpl.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.internal; - -import android.os.RemoteException; -import android.util.Log; - -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.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; - -import java.util.Map; - -public class CastDynamiteModuleImpl extends ICastDynamiteModule.Stub { - private static final String TAG = CastDynamiteModuleImpl.class.getSimpleName(); - - @Override - public ICastContext newCastContextImpl(IObjectWrapper context, CastOptions options, IMediaRouter router, Map sessionProviders) throws RemoteException { - return new CastContextImpl(context, options, router, sessionProviders); - } - - @Override - public ISession newSessionImpl(String category, String sessionId, ISessionProxy proxy) throws RemoteException { - return new SessionImpl(category, sessionId, proxy); - } - - @Override - public ICastSession newCastSessionImpl(CastOptions options, IObjectWrapper session, ICastConnectionController controller) throws RemoteException { - return new CastSessionImpl(options, session, controller); - } - - @Override - public IMediaNotificationService newMediaNotificationServiceImpl(IObjectWrapper service, IObjectWrapper castContext, IObjectWrapper resources, CastMediaOptions options) throws RemoteException { - Log.d(TAG, "unimplemented Method: newMediaNotificationServiceImpl"); - return null; - } - - @Override - public IReconnectionService newReconnectionServiceImpl(IObjectWrapper service, IObjectWrapper sessionManager, IObjectWrapper discoveryManager) throws RemoteException { - Log.d(TAG, "unimplemented Method: newReconnectionServiceImpl"); - return null; - } - - @Override - public IFetchBitmapTask newFetchBitmapTaskImpl(IObjectWrapper asyncTask, IFetchBitmapTaskProgressPublisher progressPublisher, int i1, int i2, boolean b1, long l1, int i3, int i4, int i5) throws RemoteException { - Log.d(TAG, "unimplemented Method: newFetchBitmapTaskImpl"); - return null; - } -} diff --git a/play-services-core/src/main/java/com/google/android/gms/cast/framework/internal/CastSessionImpl.java b/play-services-core/src/main/java/com/google/android/gms/cast/framework/internal/CastSessionImpl.java deleted file mode 100644 index 1ea984e5..00000000 --- a/play-services-core/src/main/java/com/google/android/gms/cast/framework/internal/CastSessionImpl.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.internal; - -import android.os.Bundle; -import android.os.RemoteException; -import android.util.Log; - -import com.google.android.gms.cast.ApplicationMetadata; -import com.google.android.gms.cast.framework.CastOptions; -import com.google.android.gms.cast.framework.ICastConnectionController; -import com.google.android.gms.cast.framework.ICastSession; -import com.google.android.gms.common.api.Status; -import com.google.android.gms.dynamic.IObjectWrapper; -import com.google.android.gms.dynamic.ObjectWrapper; - -public class CastSessionImpl extends ICastSession.Stub { - private static final String TAG = CastSessionImpl.class.getSimpleName(); - private final CastOptions options; - private final SessionImpl session; - private final ICastConnectionController controller; - - public CastSessionImpl(CastOptions options, IObjectWrapper session, ICastConnectionController controller) throws RemoteException { - this.options = options; - this.session = (SessionImpl) ObjectWrapper.unwrap(session); - this.controller = controller; - - this.session.setCastSession(this); - } - - public void launchApplication() throws RemoteException { - this.controller.launchApplication(this.options.getReceiverApplicationId(), this.options.getLaunchOptions()); - } - - @Override - public void onConnected(Bundle routeInfoExtra) throws RemoteException { - this.controller.launchApplication(this.options.getReceiverApplicationId(), this.options.getLaunchOptions()); - } - - @Override - public void onConnectionSuspended(int reason) { - Log.d(TAG, "unimplemented Method: onConnectionSuspended"); - } - - @Override - public void onConnectionFailed(Status status) { - Log.d(TAG, "unimplemented Method: onConnectionFailed"); - } - - @Override - public void onApplicationConnectionSuccess(ApplicationMetadata applicationMetadata, String applicationStatus, String sessionId, boolean wasLaunched) { - this.session.onApplicationConnectionSuccess(applicationMetadata, applicationStatus, sessionId, wasLaunched); - } - - @Override - public void onApplicationConnectionFailure(int statusCode) { - this.session.onApplicationConnectionFailure(statusCode); - } - - @Override - public void disconnectFromDevice(boolean boolean1, int int1) { - Log.d(TAG, "unimplemented Method: disconnectFromDevice"); - } -} diff --git a/play-services-core/src/main/java/com/google/android/gms/cast/framework/internal/DiscoveryManagerImpl.java b/play-services-core/src/main/java/com/google/android/gms/cast/framework/internal/DiscoveryManagerImpl.java deleted file mode 100644 index b6832966..00000000 --- a/play-services-core/src/main/java/com/google/android/gms/cast/framework/internal/DiscoveryManagerImpl.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.internal; - -import android.os.RemoteException; -import android.util.Log; - -import com.google.android.gms.cast.framework.IDiscoveryManager; -import com.google.android.gms.cast.framework.IDiscoveryManagerListener; -import com.google.android.gms.dynamic.IObjectWrapper; -import com.google.android.gms.dynamic.ObjectWrapper; - -import java.util.HashSet; -import java.util.Set; - -public class DiscoveryManagerImpl extends IDiscoveryManager.Stub { - private static final String TAG = DiscoveryManagerImpl.class.getSimpleName(); - - private final CastContextImpl castContextImpl; - - private final Set discoveryManagerListeners = new HashSet(); - - public DiscoveryManagerImpl(CastContextImpl castContextImpl) { - this.castContextImpl = castContextImpl; - } - - @Override - public void startDiscovery() { - Log.d(TAG, "unimplemented Method: startDiscovery"); - } - - @Override - public void stopDiscovery() { - Log.d(TAG, "unimplemented Method: stopDiscovery"); - } - - @Override - public void addDiscoveryManagerListener(IDiscoveryManagerListener listener) { - Log.d(TAG, "unimplemented Method: addDiscoveryManagerListener"); - this.discoveryManagerListeners.add(listener); - } - - @Override - public void removeDiscoveryManagerListener(IDiscoveryManagerListener listener) { - Log.d(TAG, "unimplemented Method: removeDiscoveryManagerListener"); - this.discoveryManagerListeners.remove(listener); - } - - @Override - public IObjectWrapper getWrappedThis() throws RemoteException { - return ObjectWrapper.wrap(this); - } -} diff --git a/play-services-core/src/main/java/com/google/android/gms/cast/framework/internal/MediaRouterCallbackImpl.java b/play-services-core/src/main/java/com/google/android/gms/cast/framework/internal/MediaRouterCallbackImpl.java deleted file mode 100644 index c18e6b86..00000000 --- a/play-services-core/src/main/java/com/google/android/gms/cast/framework/internal/MediaRouterCallbackImpl.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.internal; - -import android.os.Bundle; -import android.os.RemoteException; -import android.util.Log; - -import com.google.android.gms.cast.CastDevice; -import com.google.android.gms.dynamic.ObjectWrapper; - -public class MediaRouterCallbackImpl extends IMediaRouterCallback.Stub { - private static final String TAG = MediaRouterCallbackImpl.class.getSimpleName(); - - private final CastContextImpl castContext; - - public MediaRouterCallbackImpl(CastContextImpl castContext) { - this.castContext = castContext; - } - - @Override - public void onRouteAdded(String routeId, Bundle extras) { - Log.d(TAG, "unimplemented Method: onRouteAdded"); - } - @Override - public void onRouteChanged(String routeId, Bundle extras) { - Log.d(TAG, "unimplemented Method: onRouteChanged"); - } - @Override - public void onRouteRemoved(String routeId, Bundle extras) { - Log.d(TAG, "unimplemented Method: onRouteRemoved"); - } - @Override - public void onRouteSelected(String routeId, Bundle extras) throws RemoteException { - CastDevice castDevice = CastDevice.getFromBundle(extras); - - SessionImpl session = (SessionImpl) ObjectWrapper.unwrap(this.castContext.defaultSessionProvider.getSession(null)); - Bundle routeInfoExtras = this.castContext.getRouter().getRouteInfoExtrasById(routeId); - if (routeInfoExtras != null) { - session.start(this.castContext, castDevice, routeId, routeInfoExtras); - } - } - @Override - public void unknown(String routeId, Bundle extras) { - Log.d(TAG, "unimplemented Method: unknown"); - } - @Override - public void onRouteUnselected(String routeId, Bundle extras, int reason) { - Log.d(TAG, "unimplemented Method: onRouteUnselected"); - } -} diff --git a/play-services-core/src/main/java/com/google/android/gms/cast/framework/internal/SessionImpl.java b/play-services-core/src/main/java/com/google/android/gms/cast/framework/internal/SessionImpl.java deleted file mode 100644 index 7969509e..00000000 --- a/play-services-core/src/main/java/com/google/android/gms/cast/framework/internal/SessionImpl.java +++ /dev/null @@ -1,196 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.internal; - -import android.os.Bundle; -import android.os.RemoteException; -import android.util.Log; - -import com.google.android.gms.cast.ApplicationMetadata; -import com.google.android.gms.cast.CastDevice; -import com.google.android.gms.cast.framework.ISession; -import com.google.android.gms.cast.framework.ISessionProxy; -import com.google.android.gms.dynamic.IObjectWrapper; -import com.google.android.gms.dynamic.ObjectWrapper; - -public class SessionImpl extends ISession.Stub { - private static final String TAG = SessionImpl.class.getSimpleName(); - - private final String category; - private final String sessionId; - private final ISessionProxy proxy; - - private CastSessionImpl castSession; - - private CastContextImpl castContext; - private CastDevice castDevice; - private Bundle routeInfoExtra; - - private boolean mIsConnecting = false; - private boolean mIsConnected = false; - private String routeId = null; - - public SessionImpl(String category, String sessionId, ISessionProxy proxy) { - this.category = category; - this.sessionId = sessionId; - this.proxy = proxy; - } - - public void start(CastContextImpl castContext, CastDevice castDevice, String routeId, Bundle routeInfoExtra) throws RemoteException { - this.castContext = castContext; - this.castDevice = castDevice; - this.routeInfoExtra = routeInfoExtra; - this.routeId = routeId; - - this.mIsConnecting = true; - this.mIsConnected = false; - this.castContext.getSessionManagerImpl().onSessionStarting(this); - this.proxy.start(routeInfoExtra); - } - - public void onApplicationConnectionSuccess(ApplicationMetadata applicationMetadata, String applicationStatus, String sessionId, boolean wasLaunched) { - this.mIsConnecting = false; - this.mIsConnected = true; - this.castContext.getSessionManagerImpl().onSessionStarted(this, sessionId); - try { - this.castContext.getRouter().selectRouteById(this.getRouteId()); - } catch (RemoteException ex) { - Log.e(TAG, "Error calling selectRouteById: " + ex.getMessage()); - } - } - - public void onApplicationConnectionFailure(int statusCode) { - this.mIsConnecting = false; - this.mIsConnected = false; - this.routeId = null; - this.castContext = null; - this.castDevice = null; - this.routeInfoExtra = null; - this.castContext.getSessionManagerImpl().onSessionStartFailed(this, statusCode); - try { - this.castContext.getRouter().selectDefaultRoute(); - } catch (RemoteException ex) { - Log.e(TAG, "Error calling selectDefaultRoute: " + ex.getMessage()); - } - } - - public void onRouteSelected(Bundle extras) { - } - - public CastSessionImpl getCastSession() { - return this.castSession; - } - - public void setCastSession(CastSessionImpl castSession) { - this.castSession = castSession; - } - - public ISessionProxy getSessionProxy() { - return this.proxy; - } - - public IObjectWrapper getWrappedSession() throws RemoteException { - if (this.proxy == null) { - return ObjectWrapper.wrap(null); - } - return this.proxy.getWrappedSession(); - } - - @Override - public String getCategory() { - return this.category; - } - - @Override - public String getSessionId() { - return this.sessionId; - } - - @Override - public String getRouteId() { - return this.routeId; - } - - @Override - public boolean isConnected() { - return this.mIsConnected; - } - - @Override - public boolean isConnecting() { - return this.mIsConnecting; - } - - @Override - public boolean isDisconnecting() { - Log.d(TAG, "unimplemented Method: isDisconnecting"); - return false; - } - - @Override - public boolean isDisconnected() { - Log.d(TAG, "unimplemented Method: isDisconnected"); - return false; - } - - @Override - public boolean isResuming() { - Log.d(TAG, "unimplemented Method: isResuming"); - return false; - } - - @Override - public boolean isSuspended() { - Log.d(TAG, "unimplemented Method: isSuspended"); - return false; - } - - @Override - public void notifySessionStarted(String sessionId) { - Log.d(TAG, "unimplemented Method: notifySessionStarted"); - } - - @Override - public void notifyFailedToStartSession(int error) { - Log.d(TAG, "unimplemented Method: notifyFailedToStartSession"); - } - - @Override - public void notifySessionEnded(int error) { - Log.d(TAG, "unimplemented Method: notifySessionEnded"); - } - - @Override - public void notifySessionResumed(boolean wasSuspended) { - Log.d(TAG, "unimplemented Method: notifySessionResumed"); - } - - @Override - public void notifyFailedToResumeSession(int error) { - Log.d(TAG, "unimplemented Method: notifyFailedToResumeSession"); - } - - @Override - public void notifySessionSuspended(int reason) { - Log.d(TAG, "unimplemented Method: notifySessionSuspended"); - } - - @Override - public IObjectWrapper getWrappedObject() { - return ObjectWrapper.wrap(this); - } -} diff --git a/play-services-core/src/main/java/com/google/android/gms/cast/framework/internal/SessionManagerImpl.java b/play-services-core/src/main/java/com/google/android/gms/cast/framework/internal/SessionManagerImpl.java deleted file mode 100644 index 609ff6c6..00000000 --- a/play-services-core/src/main/java/com/google/android/gms/cast/framework/internal/SessionManagerImpl.java +++ /dev/null @@ -1,226 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.internal; - -import android.os.Bundle; -import android.os.RemoteException; -import android.util.Log; - -import com.google.android.gms.cast.framework.CastState; -import com.google.android.gms.cast.framework.ICastStateListener; -import com.google.android.gms.cast.framework.ISessionManager; -import com.google.android.gms.cast.framework.ISessionManagerListener; -import com.google.android.gms.dynamic.IObjectWrapper; -import com.google.android.gms.dynamic.ObjectWrapper; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - -public class SessionManagerImpl extends ISessionManager.Stub { - private static final String TAG = SessionManagerImpl.class.getSimpleName(); - - private final CastContextImpl castContext; - - private final Set sessionManagerListeners = new HashSet(); - private final Set castStateListeners = new HashSet(); - - private final Map routeSessions = new HashMap<>(); - - private SessionImpl currentSession; - - private int castState = CastState.NO_DEVICES_AVAILABLE; - - public SessionManagerImpl(CastContextImpl castContext) { - this.castContext = castContext; - } - - @Override - public IObjectWrapper getWrappedCurrentSession() throws RemoteException { - if (this.currentSession == null) { - return ObjectWrapper.wrap(null); - } - return this.currentSession.getWrappedSession(); - } - - @Override - public void endCurrentSession(boolean b, boolean stopCasting) throws RemoteException { - Log.d(TAG, "unimplemented Method: endCurrentSession"); - } - - @Override - public void addSessionManagerListener(ISessionManagerListener listener) { - Log.d(TAG, "unimplemented Method: addSessionManagerListener"); - this.sessionManagerListeners.add(listener); - } - - @Override - public void removeSessionManagerListener(ISessionManagerListener listener) { - Log.d(TAG, "unimplemented Method: removeSessionManagerListener"); - this.sessionManagerListeners.remove(listener); - } - - @Override - public void addCastStateListener(ICastStateListener listener) { - Log.d(TAG, "unimplemented Method: addCastStateListener"); - this.castStateListeners.add(listener); - } - - @Override - public void removeCastStateListener(ICastStateListener listener) { - Log.d(TAG, "unimplemented Method: removeCastStateListener"); - this.castStateListeners.remove(listener); - } - - @Override - public IObjectWrapper getWrappedThis() throws RemoteException { - return ObjectWrapper.wrap(this); - } - - @Override - public int getCastState() { - return this.castState; - } - - @Override - public void startSession(Bundle params) { - Log.d(TAG, "unimplemented Method: startSession"); - String routeId = params.getString("CAST_INTENT_TO_CAST_ROUTE_ID_KEY"); - String sessionId = params.getString("CAST_INTENT_TO_CAST_SESSION_ID_KEY"); - } - - public void onRouteSelected(String routeId, Bundle extras) { - Log.d(TAG, "unimplemented Method: onRouteSelected: " + routeId); - } - - private void setCastState(int castState) { - this.castState = castState; - this.onCastStateChanged(); - } - - public void onCastStateChanged() { - for (ICastStateListener listener : this.castStateListeners) { - try { - listener.onCastStateChanged(this.castState); - } catch (RemoteException e) { - Log.d(TAG, "Remote exception calling onCastStateChanged: " + e.getMessage()); - } - } - } - - public void onSessionStarting(SessionImpl session) { - this.setCastState(CastState.CONNECTING); - for (ISessionManagerListener listener : this.sessionManagerListeners) { - try { - listener.onSessionStarting(session.getSessionProxy().getWrappedSession()); - } catch (RemoteException e) { - Log.d(TAG, "Remote exception calling onSessionStarting: " + e.getMessage()); - } - } - } - - public void onSessionStartFailed(SessionImpl session, int error) { - this.currentSession = null; - this.setCastState(CastState.NOT_CONNECTED); - for (ISessionManagerListener listener : this.sessionManagerListeners) { - try { - listener.onSessionStartFailed(session.getSessionProxy().getWrappedSession(), error); - } catch (RemoteException e) { - Log.d(TAG, "Remote exception calling onSessionStartFailed: " + e.getMessage()); - } - } - } - - public void onSessionStarted(SessionImpl session, String sessionId) { - this.currentSession = session; - this.setCastState(CastState.CONNECTED); - for (ISessionManagerListener listener : this.sessionManagerListeners) { - try { - listener.onSessionStarted(session.getSessionProxy().getWrappedSession(), sessionId); - } catch (RemoteException e) { - Log.d(TAG, "Remote exception calling onSessionStarted: " + e.getMessage()); - } - } - } - - public void onSessionResumed(SessionImpl session, boolean wasSuspended) { - this.setCastState(CastState.CONNECTED); - for (ISessionManagerListener listener : this.sessionManagerListeners) { - try { - listener.onSessionResumed(session.getSessionProxy().getWrappedSession(), wasSuspended); - } catch (RemoteException e) { - Log.d(TAG, "Remote exception calling onSessionResumed: " + e.getMessage()); - } - } - } - - public void onSessionEnding(SessionImpl session) { - for (ISessionManagerListener listener : this.sessionManagerListeners) { - try { - listener.onSessionEnding(session.getSessionProxy().getWrappedSession()); - } catch (RemoteException e) { - Log.d(TAG, "Remote exception calling onSessionEnding: " + e.getMessage()); - } - } - } - - public void onSessionEnded(SessionImpl session, int error) { - this.currentSession = null; - this.setCastState(CastState.NOT_CONNECTED); - for (ISessionManagerListener listener : this.sessionManagerListeners) { - try { - listener.onSessionEnded(session.getSessionProxy().getWrappedSession(), error); - } catch (RemoteException e) { - Log.d(TAG, "Remote exception calling onSessionEnded: " + e.getMessage()); - } - } - } - - public void onSessionResuming(SessionImpl session, String sessionId) { - for (ISessionManagerListener listener : this.sessionManagerListeners) { - try { - listener.onSessionResuming(session.getSessionProxy().getWrappedSession(), sessionId); - } catch (RemoteException e) { - Log.d(TAG, "Remote exception calling onSessionResuming: " + e.getMessage()); - } - } - } - - public void onSessionResumeFailed(SessionImpl session, int error) { - this.currentSession = null; - this.setCastState(CastState.NOT_CONNECTED); - for (ISessionManagerListener listener : this.sessionManagerListeners) { - try { - listener.onSessionResumeFailed(session.getSessionProxy().getWrappedSession(), error); - } catch (RemoteException e) { - Log.d(TAG, "Remote exception calling onSessionResumeFailed: " + e.getMessage()); - } - } - } - - public void onSessionSuspended(SessionImpl session, int reason) { - this.setCastState(CastState.NOT_CONNECTED); - for (ISessionManagerListener listener : this.sessionManagerListeners) { - try { - listener.onSessionSuspended(session.getSessionProxy().getWrappedSession(), reason); - } catch (RemoteException e) { - Log.d(TAG, "Remote exception calling onSessionSuspended: " + e.getMessage()); - } - } - } -} diff --git a/play-services-core/src/main/java/com/google/android/gms/cast/media/CastMediaRouteProviderService.java b/play-services-core/src/main/java/com/google/android/gms/cast/media/CastMediaRouteProviderService.java deleted file mode 100644 index bf0553de..00000000 --- a/play-services-core/src/main/java/com/google/android/gms/cast/media/CastMediaRouteProviderService.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.media; - -import androidx.mediarouter.media.MediaRouteProvider; -import androidx.mediarouter.media.MediaRouteProviderService; - -import org.microg.gms.cast.CastMediaRouteProvider; - -public class CastMediaRouteProviderService extends MediaRouteProviderService { - private static final String TAG = CastMediaRouteProviderService.class.getSimpleName(); - - @Override - public MediaRouteProvider onCreateMediaRouteProvider() { - return new CastMediaRouteProvider(this); - } -} diff --git a/play-services-core/src/main/java/com/google/android/gms/chimera/container/DynamiteContext.java b/play-services-core/src/main/java/com/google/android/gms/chimera/container/DynamiteContext.java deleted file mode 100644 index 00bde131..00000000 --- a/play-services-core/src/main/java/com/google/android/gms/chimera/container/DynamiteContext.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2021, microG Project Team - * SPDX-License-Identifier: Apache-2.0 - */ - -package com.google.android.gms.chimera.container; - -import android.content.Context; -import android.content.ContextWrapper; -import android.content.pm.ApplicationInfo; -import android.content.pm.PackageManager; -import android.os.Build; -import android.os.Process; -import android.util.Log; - -import androidx.annotation.RequiresApi; - -import org.microg.gms.common.Constants; - -import java.io.File; - -import dalvik.system.PathClassLoader; - -public class DynamiteContext extends ContextWrapper { - private static final String TAG = "DynamiteContext"; - private final DynamiteModuleInfo moduleInfo; - private final Context originalContext; - private final Context gmsContext; - private final DynamiteContext appContext; - - private ClassLoader classLoader; - - public DynamiteContext(DynamiteModuleInfo moduleInfo, Context base, Context gmsContext, DynamiteContext appContext) { - super(base); - this.moduleInfo = moduleInfo; - this.originalContext = base; - this.gmsContext = gmsContext; - this.appContext = appContext; - } - - @Override - public ClassLoader getClassLoader() { - if (classLoader == null) { - StringBuilder nativeLoaderDirs = new StringBuilder(gmsContext.getApplicationInfo().nativeLibraryDir); - if (Build.VERSION.SDK_INT >= 23 && Process.is64Bit()) { - for (String abi : Build.SUPPORTED_64_BIT_ABIS) { - nativeLoaderDirs.append(File.pathSeparator).append(gmsContext.getApplicationInfo().sourceDir).append("!/lib/").append(abi); - } - } else if (Build.VERSION.SDK_INT >= 21) { - for (String abi : Build.SUPPORTED_32_BIT_ABIS) { - nativeLoaderDirs.append(File.pathSeparator).append(gmsContext.getApplicationInfo().sourceDir).append("!/lib/").append(abi); - } - } else { - nativeLoaderDirs.append(File.pathSeparator).append(gmsContext.getApplicationInfo().sourceDir).append("!/lib/").append(Build.CPU_ABI); - } - classLoader = new PathClassLoader(gmsContext.getApplicationInfo().sourceDir, nativeLoaderDirs.toString(), new FilteredClassLoader(originalContext.getClassLoader(), moduleInfo.getMergedClasses(), moduleInfo.getMergedPackages())); - } - return classLoader; - } - - @Override - public String getPackageName() { - return gmsContext.getPackageName(); - } - - @Override - public ApplicationInfo getApplicationInfo() { - return gmsContext.getApplicationInfo(); - } - - @Override - public Context getApplicationContext() { - return appContext; - } - - @RequiresApi(24) - @Override - public Context createDeviceProtectedStorageContext() { - return new DynamiteContext(moduleInfo, originalContext.createDeviceProtectedStorageContext(), gmsContext.createDeviceProtectedStorageContext(), appContext); - } - - public static DynamiteContext create(String moduleId, Context originalContext) { - try { - DynamiteModuleInfo moduleInfo = new DynamiteModuleInfo(moduleId); - Context gmsContext = originalContext.createPackageContext(Constants.GMS_PACKAGE_NAME, 0); - Context originalAppContext = originalContext.getApplicationContext(); - if (originalAppContext == null || originalAppContext == originalContext) { - return new DynamiteContext(moduleInfo, originalContext, gmsContext, null); - } else { - return new DynamiteContext(moduleInfo, originalContext, gmsContext, new DynamiteContext(moduleInfo, originalAppContext, gmsContext, null)); - } - } catch (PackageManager.NameNotFoundException e) { - Log.w(TAG, e); - return null; - } - } -} diff --git a/play-services-core/src/main/java/com/google/android/gms/chimera/container/DynamiteLoaderImpl.java b/play-services-core/src/main/java/com/google/android/gms/chimera/container/DynamiteLoaderImpl.java deleted file mode 100644 index 62f387df..00000000 --- a/play-services-core/src/main/java/com/google/android/gms/chimera/container/DynamiteLoaderImpl.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.android.gms.chimera.container; - -import android.content.Context; -import android.os.RemoteException; -import android.util.Log; - -import com.google.android.gms.dynamic.IObjectWrapper; -import com.google.android.gms.dynamic.ObjectWrapper; -import com.google.android.gms.dynamite.IDynamiteLoader; - -public class DynamiteLoaderImpl extends IDynamiteLoader.Stub { - private static final String TAG = "GmsDynamiteLoaderImpl"; - - @Override - public IObjectWrapper createModuleContext(IObjectWrapper wrappedContext, String moduleId, int minVersion) throws RemoteException { - // We don't have crash utils, so just forward - return createModuleContextNoCrashUtils(wrappedContext, moduleId, minVersion); - } - - @Override - public IObjectWrapper createModuleContextNoCrashUtils(IObjectWrapper wrappedContext, String moduleId, int minVersion) throws RemoteException { - Log.d(TAG, "createModuleContext for " + moduleId + " at version " + minVersion); - final Context originalContext = (Context) ObjectWrapper.unwrap(wrappedContext); - return ObjectWrapper.wrap(DynamiteContext.create(moduleId, originalContext)); - } - - @Override - public int getIDynamiteLoaderVersion() throws RemoteException { - return 2; - } - - @Override - public int getModuleVersion(IObjectWrapper wrappedContext, String moduleId) throws RemoteException { - return getModuleVersion2(wrappedContext, moduleId, true); - } - - @Override - public int getModuleVersion2(IObjectWrapper wrappedContext, String moduleId, boolean updateConfigIfRequired) throws RemoteException { - // We don't have crash utils, so just forward - return getModuleVersion2NoCrashUtils(wrappedContext, moduleId, updateConfigIfRequired); - } - - @Override - public int getModuleVersion2NoCrashUtils(IObjectWrapper wrappedContext, String moduleId, boolean updateConfigIfRequired) throws RemoteException { - final Context context = (Context) ObjectWrapper.unwrap(wrappedContext); - if (context == null) { - Log.w(TAG, "Invalid client context"); - return 0; - } - - try { - return Class.forName("com.google.android.gms.dynamite.descriptors." + moduleId + ".ModuleDescriptor").getDeclaredField("MODULE_VERSION").getInt(null); - } catch (Exception e) { - Log.w(TAG, "No such module known: " + moduleId); - } - - if (moduleId.equals("com.google.android.gms.googlecertificates")) { - return com.google.android.gms.dynamite.descriptors.com.google.android.gms.googlecertificates.ModuleDescriptor.MODULE_VERSION; - } - if (moduleId.equals("com.google.android.gms.cast.framework.dynamite")) { - Log.d(TAG, "returning temp fix module version for " + moduleId + ". Cast API wil not be functional!"); - return 1; - } - - if (moduleId.equals("com.google.android.gms.maps_dynamite")) { - Log.d(TAG, "returning v1 for maps"); - return 1; - } - - Log.d(TAG, "unimplemented Method: getModuleVersion for " + moduleId); - return 0; - } -} diff --git a/play-services-core/src/main/java/com/google/android/gms/chimera/container/DynamiteModuleInfo.java b/play-services-core/src/main/java/com/google/android/gms/chimera/container/DynamiteModuleInfo.java deleted file mode 100644 index 73d9c735..00000000 --- a/play-services-core/src/main/java/com/google/android/gms/chimera/container/DynamiteModuleInfo.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2021, microG Project Team - * SPDX-License-Identifier: Apache-2.0 - */ - -package com.google.android.gms.chimera.container; - -import java.util.Collection; -import java.util.Collections; - -public class DynamiteModuleInfo { - private Class descriptor; - private final String moduleId; - - public DynamiteModuleInfo(String moduleId) { - this.moduleId = moduleId; - try { - this.descriptor = Class.forName("com.google.android.gms.dynamite.descriptors." + moduleId + ".ModuleDescriptor"); - } catch (Exception e) { - // Ignore - } - } - - public String getModuleId() { - return moduleId; - } - - public int getVersion() { - try { - return descriptor.getDeclaredField("MODULE_VERSION").getInt(null); - } catch (Exception e) { - return 0; - } - } - - public Collection getMergedPackages() { - try { - return (Collection) descriptor.getDeclaredField("MERGED_PACKAGES").get(null); - } catch (Exception e) { - return Collections.emptySet(); - } - } - - public Collection getMergedClasses() { - try { - return (Collection) descriptor.getDeclaredField("MERGED_CLASSES").get(null); - } catch (Exception e) { - return Collections.emptySet(); - } - } -} diff --git a/play-services-core/src/main/java/com/google/android/gms/chimera/container/FilteredClassLoader.java b/play-services-core/src/main/java/com/google/android/gms/chimera/container/FilteredClassLoader.java deleted file mode 100644 index 74c2bb36..00000000 --- a/play-services-core/src/main/java/com/google/android/gms/chimera/container/FilteredClassLoader.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2021, microG Project Team - * SPDX-License-Identifier: Apache-2.0 - */ - -package com.google.android.gms.chimera.container; - -import java.util.Collection; -import java.util.HashSet; - -public class FilteredClassLoader extends ClassLoader { - private static ClassLoader rootClassLoader; - private final Collection allowedClasses; - private final Collection allowedPackages; - - static { - rootClassLoader = ClassLoader.getSystemClassLoader(); - if (rootClassLoader == null) { - rootClassLoader = FilteredClassLoader.class.getClassLoader(); - while (rootClassLoader.getParent() != null) { - rootClassLoader = rootClassLoader.getParent(); - } - } - } - - public FilteredClassLoader(ClassLoader parent, Collection allowedClasses, Collection allowedPackages) { - super(parent); - this.allowedClasses = new HashSet<>(allowedClasses); - this.allowedPackages = new HashSet<>(allowedPackages); - } - - private String getPackageName(String name) { - int lastIndex = name.lastIndexOf("."); - if (lastIndex <= 0) return ""; - return name.substring(0, lastIndex); - } - - private String getClassName(String name) { - int lastIndex = name.indexOf("$"); - if (lastIndex <= 0) return name; - return name.substring(0, lastIndex); - } - - @Override - protected Class loadClass(String name, boolean resolve) throws ClassNotFoundException { - if (name.startsWith("java.")) return rootClassLoader.loadClass(name); - if (allowedClasses.contains(name) || allowedClasses.contains(getClassName(name))) - return super.loadClass(name, resolve); - if (allowedClasses.contains("!" + name) || allowedClasses.contains("!" + getClassName(name))) - return rootClassLoader.loadClass(name); - if (allowedPackages.contains(getPackageName(name))) return super.loadClass(name, resolve); - return rootClassLoader.loadClass(name); - } -} diff --git a/play-services-core/src/main/java/com/google/android/gms/dynamite/descriptors/com/google/android/gms/googlecertificates/ModuleDescriptor.java b/play-services-core/src/main/java/com/google/android/gms/dynamite/descriptors/com/google/android/gms/googlecertificates/ModuleDescriptor.java deleted file mode 100644 index 36de33ae..00000000 --- a/play-services-core/src/main/java/com/google/android/gms/dynamite/descriptors/com/google/android/gms/googlecertificates/ModuleDescriptor.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (C) 2019 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.android.gms.dynamite.descriptors.com.google.android.gms.googlecertificates; - -public class ModuleDescriptor { - public static final String MODULE_ID = "com.google.android.gms.googlecertificates"; - public static final int MODULE_VERSION = 1; -} diff --git a/play-services-core/src/main/java/com/google/android/gms/dynamite/descriptors/com/google/android/gms/measurement/dynamite/ModuleDescriptor.java b/play-services-core/src/main/java/com/google/android/gms/dynamite/descriptors/com/google/android/gms/measurement/dynamite/ModuleDescriptor.java deleted file mode 100644 index 0c3f0bcd..00000000 --- a/play-services-core/src/main/java/com/google/android/gms/dynamite/descriptors/com/google/android/gms/measurement/dynamite/ModuleDescriptor.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.android.gms.dynamite.descriptors.com.google.android.gms.measurement.dynamite; - -public class ModuleDescriptor { - public static final String MODULE_ID = "com.google.android.gms.measurement.dynamite"; - public static final int MODULE_VERSION = 53; -} diff --git a/play-services-core/src/main/java/com/google/android/gms/gcm/http/GoogleHttpService.java b/play-services-core/src/main/java/com/google/android/gms/gcm/http/GoogleHttpService.java deleted file mode 100644 index 2ff141af..00000000 --- a/play-services-core/src/main/java/com/google/android/gms/gcm/http/GoogleHttpService.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.http; - -import android.app.Service; -import android.content.Intent; -import android.os.Bundle; -import android.os.IBinder; -import android.os.RemoteException; - -import com.google.android.gms.http.IGoogleHttpService; - -public class GoogleHttpService extends Service { - @Override - public IBinder onBind(Intent intent) { - return new IGoogleHttpService.Stub() { - @Override - public Bundle checkUrl(String url) throws RemoteException { - return null; // allow - } - }.asBinder(); - } -} diff --git a/play-services-core/src/main/java/org/microg/gms/ChimeraSpoofProvider.java b/play-services-core/src/main/java/org/microg/gms/ChimeraSpoofProvider.java deleted file mode 100644 index 60fb6cfb..00000000 --- a/play-services-core/src/main/java/org/microg/gms/ChimeraSpoofProvider.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (C) 2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES 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; - -import android.content.ContentProvider; -import android.content.ContentValues; -import android.database.Cursor; -import android.database.MatrixCursor; -import android.net.Uri; -import android.util.Log; - -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; - -public class ChimeraSpoofProvider extends ContentProvider { - private static final String TAG = "GmsChimeraSpoof"; - private static final String[] COLUMNS = new String[]{"version", "apkPath", "loaderPath", "apkDescStr"}; - - @Override - public boolean onCreate() { - return true; - } - - @Nullable - @Override - public Cursor query(@NonNull Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) { - MatrixCursor cursor = new MatrixCursor(COLUMNS); - Log.d(TAG, "query: " + uri); - return cursor; - } - - @Nullable - @Override - public String getType(@NonNull Uri uri) { - return "vnd.android.cursor.item/com.mgoogle.android.gms.chimera"; - } - - @Nullable - @Override - public Uri insert(@NonNull Uri uri, ContentValues values) { - return null; - } - - @Override - public int delete(@NonNull Uri uri, String selection, String[] selectionArgs) { - return 0; - } - - @Override - public int update(@NonNull Uri uri, ContentValues values, String selection, String[] selectionArgs) { - return 0; - } -} diff --git a/play-services-core/src/main/java/org/microg/gms/auth/AccountContentProvider.java b/play-services-core/src/main/java/org/microg/gms/auth/AccountContentProvider.java index 2254ba39..bba39ab5 100644 --- a/play-services-core/src/main/java/org/microg/gms/auth/AccountContentProvider.java +++ b/play-services-core/src/main/java/org/microg/gms/auth/AccountContentProvider.java @@ -16,11 +16,7 @@ package org.microg.gms.auth; -import static org.microg.gms.auth.AuthConstants.DEFAULT_ACCOUNT_TYPE; -import static org.microg.gms.auth.AuthConstants.PROVIDER_EXTRA_ACCOUNTS; -import static org.microg.gms.auth.AuthConstants.PROVIDER_EXTRA_CLEAR_PASSWORD; -import static org.microg.gms.auth.AuthConstants.PROVIDER_METHOD_CLEAR_PASSWORD; -import static org.microg.gms.auth.AuthConstants.PROVIDER_METHOD_GET_ACCOUNTS; +import static android.accounts.AccountManager.VISIBILITY_VISIBLE; import android.Manifest; import android.accounts.Account; @@ -41,6 +37,12 @@ import org.microg.gms.common.PackageUtils; import java.util.Arrays; +import static org.microg.gms.auth.AuthConstants.DEFAULT_ACCOUNT_TYPE; +import static org.microg.gms.auth.AuthConstants.PROVIDER_EXTRA_ACCOUNTS; +import static org.microg.gms.auth.AuthConstants.PROVIDER_EXTRA_CLEAR_PASSWORD; +import static org.microg.gms.auth.AuthConstants.PROVIDER_METHOD_CLEAR_PASSWORD; +import static org.microg.gms.auth.AuthConstants.PROVIDER_METHOD_GET_ACCOUNTS; + public class AccountContentProvider extends ContentProvider { private static final String TAG = "GmsAuthProvider"; @@ -57,7 +59,7 @@ public class AccountContentProvider extends ContentProvider { suggestedPackageName = getCallingPackage(); } String packageName = PackageUtils.getAndCheckCallingPackage(getContext(), suggestedPackageName); - Log.d(TAG, "Call from " + packageName); + Log.d(TAG, "Call " + method + " from " + packageName + " with arg " + arg); if (!PackageUtils.callerHasExtendedAccess(getContext())) { String[] packagesForUid = getContext().getPackageManager().getPackagesForUid(Binder.getCallingUid()); if (packagesForUid != null && packagesForUid.length != 0) @@ -71,17 +73,27 @@ public class AccountContentProvider extends ContentProvider { Account[] accounts = null; if (arg != null && (arg.equals(DEFAULT_ACCOUNT_TYPE) || arg.startsWith(DEFAULT_ACCOUNT_TYPE + "."))) { AccountManager am = AccountManager.get(getContext()); - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) { + if (Build.VERSION.SDK_INT >= 18) { accounts = am.getAccountsByTypeForPackage(arg, packageName); } if (accounts == null || accounts.length == 0) { accounts = am.getAccountsByType(arg); } + if (Build.VERSION.SDK_INT >= 26 && accounts != null && arg.equals(DEFAULT_ACCOUNT_TYPE)) { + for (Account account : accounts) { + if (am.getAccountVisibility(account, packageName) == AccountManager.VISIBILITY_UNDEFINED) { + Log.d(TAG, "Make account " + account + " visible to " + packageName); + am.setAccountVisibility(account, packageName, VISIBILITY_VISIBLE); + } + } + } } if (accounts == null) { accounts = new Account[0]; } + result.putParcelableArray(PROVIDER_EXTRA_ACCOUNTS, accounts); + Log.d(TAG, "get_accounts returns: " + Arrays.toString(accounts)); return result; } else if (PROVIDER_METHOD_CLEAR_PASSWORD.equals(method)) { Account a = extras.getParcelable(PROVIDER_EXTRA_CLEAR_PASSWORD); diff --git a/play-services-core/src/main/java/org/microg/gms/auth/AuthManagerServiceImpl.java b/play-services-core/src/main/java/org/microg/gms/auth/AuthManagerServiceImpl.java index 6343439d..622ff4a0 100644 --- a/play-services-core/src/main/java/org/microg/gms/auth/AuthManagerServiceImpl.java +++ b/play-services-core/src/main/java/org/microg/gms/auth/AuthManagerServiceImpl.java @@ -16,25 +16,31 @@ package org.microg.gms.auth; -import static android.accounts.AccountManager.KEY_ACCOUNTS; -import static android.accounts.AccountManager.KEY_ACCOUNT_NAME; -import static android.accounts.AccountManager.KEY_ACCOUNT_TYPE; -import static android.accounts.AccountManager.KEY_AUTHTOKEN; -import static android.accounts.AccountManager.KEY_CALLER_PID; - import android.accounts.Account; import android.accounts.AccountManager; +import android.accounts.AuthenticatorException; +import android.accounts.OperationCanceledException; import android.annotation.SuppressLint; +import android.app.NotificationManager; +import android.app.PendingIntent; import android.content.Context; +import android.content.Intent; import android.content.pm.PackageManager; import android.os.Bundle; import android.os.Parcel; import android.os.RemoteException; +import android.util.Base64; import android.util.Log; +import androidx.core.app.NotificationCompat; + import com.google.android.auth.IAuthManagerService; +import com.mgoogle.android.gms.R; import com.google.android.gms.auth.AccountChangeEventsRequest; import com.google.android.gms.auth.AccountChangeEventsResponse; +import com.google.android.gms.auth.GetHubTokenInternalResponse; +import com.google.android.gms.auth.GetHubTokenRequest; +import com.google.android.gms.auth.HasCababilitiesRequest; import com.google.android.gms.auth.TokenData; import com.google.android.gms.common.api.Scope; @@ -42,9 +48,16 @@ import org.microg.gms.common.PackageUtils; import java.io.IOException; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import java.util.concurrent.TimeUnit; +import static android.accounts.AccountManager.KEY_ACCOUNTS; +import static android.accounts.AccountManager.KEY_ACCOUNT_NAME; +import static android.accounts.AccountManager.KEY_ACCOUNT_TYPE; +import static android.accounts.AccountManager.KEY_AUTHTOKEN; +import static android.accounts.AccountManager.KEY_CALLER_PID; + public class AuthManagerServiceImpl extends IAuthManagerService.Stub { private static final String TAG = "GmsAuthManagerSvc"; @@ -159,6 +172,7 @@ public class AuthManagerServiceImpl extends IAuthManagerService.Stub { return res; } + @Override public Bundle removeAccount(Account account) { Log.w(TAG, "Not implemented: removeAccount(" + account + ")"); return null; @@ -170,6 +184,18 @@ public class AuthManagerServiceImpl extends IAuthManagerService.Stub { return null; } + @Override + public int hasCapabilities(HasCababilitiesRequest request) throws RemoteException { + Log.w(TAG, "Not implemented: hasCapabilities(" + request.account + ", " + Arrays.toString(request.capabilities) + ")"); + return 1; + } + + @Override + public GetHubTokenInternalResponse getHubToken(GetHubTokenRequest request, Bundle extras) throws RemoteException { + Log.w(TAG, "Not implemented: getHubToken()"); + return null; + } + @Override @SuppressLint("MissingPermission") // Workaround bug in Android Linter public Bundle clearToken(String token, Bundle extras) { diff --git a/play-services-core/src/main/java/org/microg/gms/auth/loginservice/AccountAuthenticator.java b/play-services-core/src/main/java/org/microg/gms/auth/loginservice/AccountAuthenticator.java index 2bce17af..89ee692f 100644 --- a/play-services-core/src/main/java/org/microg/gms/auth/loginservice/AccountAuthenticator.java +++ b/play-services-core/src/main/java/org/microg/gms/auth/loginservice/AccountAuthenticator.java @@ -16,16 +16,6 @@ package org.microg.gms.auth.loginservice; -import static android.accounts.AccountManager.KEY_ACCOUNT_AUTHENTICATOR_RESPONSE; -import static android.accounts.AccountManager.KEY_ACCOUNT_NAME; -import static android.accounts.AccountManager.KEY_ACCOUNT_TYPE; -import static android.accounts.AccountManager.KEY_ANDROID_PACKAGE_NAME; -import static android.accounts.AccountManager.KEY_AUTHTOKEN; -import static android.accounts.AccountManager.KEY_BOOLEAN_RESULT; -import static android.accounts.AccountManager.KEY_CALLER_PID; -import static android.accounts.AccountManager.KEY_CALLER_UID; -import static android.accounts.AccountManager.KEY_INTENT; - import android.accounts.AbstractAccountAuthenticator; import android.accounts.Account; import android.accounts.AccountAuthenticatorResponse; @@ -34,8 +24,11 @@ import android.accounts.NetworkErrorException; import android.content.Context; import android.content.Intent; import android.os.Bundle; +import android.util.Base64; import android.util.Log; +import com.mgoogle.android.gms.R; + import org.microg.gms.auth.AuthConstants; import org.microg.gms.auth.AuthManager; import org.microg.gms.auth.AuthResponse; @@ -45,6 +38,16 @@ import org.microg.gms.common.PackageUtils; import java.util.Arrays; import java.util.List; +import static android.accounts.AccountManager.KEY_ACCOUNT_AUTHENTICATOR_RESPONSE; +import static android.accounts.AccountManager.KEY_ACCOUNT_NAME; +import static android.accounts.AccountManager.KEY_ACCOUNT_TYPE; +import static android.accounts.AccountManager.KEY_ANDROID_PACKAGE_NAME; +import static android.accounts.AccountManager.KEY_AUTHTOKEN; +import static android.accounts.AccountManager.KEY_BOOLEAN_RESULT; +import static android.accounts.AccountManager.KEY_CALLER_PID; +import static android.accounts.AccountManager.KEY_CALLER_UID; +import static android.accounts.AccountManager.KEY_INTENT; + class AccountAuthenticator extends AbstractAccountAuthenticator { private static final String TAG = "GmsAuthenticator"; private final Context context; @@ -128,8 +131,8 @@ class AccountAuthenticator extends AbstractAccountAuthenticator { List servicesList = Arrays.asList(services.split(",")); for (String feature : features) { if (feature.startsWith("service_") && !servicesList.contains(feature.substring(8))) { + Log.d(TAG, "Feature " + feature + " not supported"); res = false; - break; } } } else { diff --git a/play-services-core/src/main/java/org/microg/gms/cast/CastDeviceControllerImpl.java b/play-services-core/src/main/java/org/microg/gms/cast/CastDeviceControllerImpl.java deleted file mode 100644 index d6bc80f9..00000000 --- a/play-services-core/src/main/java/org/microg/gms/cast/CastDeviceControllerImpl.java +++ /dev/null @@ -1,314 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES 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.Bundle; -import android.os.RemoteException; -import android.util.Log; - -import com.google.android.gms.cast.ApplicationMetadata; -import com.google.android.gms.cast.ApplicationStatus; -import com.google.android.gms.cast.CastDevice; -import com.google.android.gms.cast.CastDeviceStatus; -import com.google.android.gms.cast.JoinOptions; -import com.google.android.gms.cast.LaunchOptions; -import com.google.android.gms.cast.internal.ICastDeviceController; -import com.google.android.gms.cast.internal.ICastDeviceControllerListener; -import com.google.android.gms.common.api.CommonStatusCodes; -import com.google.android.gms.common.internal.BinderWrapper; - -import java.io.IOException; -import java.util.ArrayList; - -import su.litvak.chromecast.api.v2.Application; -import su.litvak.chromecast.api.v2.ChromeCast; -import su.litvak.chromecast.api.v2.ChromeCastConnectionEvent; -import su.litvak.chromecast.api.v2.ChromeCastConnectionEventListener; -import su.litvak.chromecast.api.v2.ChromeCastRawMessage; -import su.litvak.chromecast.api.v2.ChromeCastRawMessageListener; -import su.litvak.chromecast.api.v2.ChromeCastSpontaneousEvent; -import su.litvak.chromecast.api.v2.ChromeCastSpontaneousEventListener; -import su.litvak.chromecast.api.v2.Namespace; - -public class CastDeviceControllerImpl extends ICastDeviceController.Stub implements - ChromeCastConnectionEventListener, - ChromeCastSpontaneousEventListener, - ChromeCastRawMessageListener, - ICastDeviceControllerListener -{ - private static final String TAG = "GmsCastDeviceController"; - - private final Context context; - private final String packageName; - private final CastDevice castDevice; - boolean notificationEnabled; - long castFlags; - ICastDeviceControllerListener listener; - - ChromeCast chromecast; - - String sessionId = null; - - public CastDeviceControllerImpl(Context context, String packageName, Bundle extras) { - this.context = context; - this.packageName = packageName; - - extras.setClassLoader(BinderWrapper.class.getClassLoader()); - this.castDevice = CastDevice.getFromBundle(extras); - this.notificationEnabled = extras.getBoolean("com.google.android.gms.cast.EXTRA_CAST_FRAMEWORK_NOTIFICATION_ENABLED"); - this.castFlags = extras.getLong("com.google.android.gms.cast.EXTRA_CAST_FLAGS"); - BinderWrapper listenerWrapper = (BinderWrapper)extras.get("listener"); - if (listenerWrapper != null) { - this.listener = ICastDeviceControllerListener.Stub.asInterface(listenerWrapper.binder); - } - - this.chromecast = new ChromeCast(this.castDevice.getAddress()); - this.chromecast.registerListener(this); - this.chromecast.registerRawMessageListener(this); - this.chromecast.registerConnectionListener(this); - } - - @Override - public void connectionEventReceived(ChromeCastConnectionEvent event) { - if (!event.isConnected()) { - this.onDisconnected(CommonStatusCodes.SUCCESS); - } - } - - protected ApplicationMetadata createMetadataFromApplication(Application app) { - if (app == null) { - return null; - } - ApplicationMetadata metadata = new ApplicationMetadata(); - metadata.applicationId = app.id; - metadata.name = app.name; - Log.d(TAG, "unimplemented: ApplicationMetadata.images"); - Log.d(TAG, "unimplemented: ApplicationMetadata.senderAppLaunchUri"); - metadata.images = new ArrayList<>(); - metadata.namespaces = new ArrayList<>(); - for(Namespace namespace : app.namespaces) { - metadata.namespaces.add(namespace.name); - } - metadata.senderAppIdentifier = this.context.getPackageName(); - return metadata; - } - - @Override - public void spontaneousEventReceived(ChromeCastSpontaneousEvent event) { - switch (event.getType()) { - case STATUS: - su.litvak.chromecast.api.v2.Status status = (su.litvak.chromecast.api.v2.Status)event.getData(); - Application app = status.getRunningApp(); - ApplicationMetadata metadata = this.createMetadataFromApplication(app); - if (app != null) { - this.onApplicationStatusChanged(new ApplicationStatus(app.statusText)); - } - int activeInputState = status.activeInput ? 1 : 0; - int standbyState = status.standBy ? 1 : 0; - this.onDeviceStatusChanged(new CastDeviceStatus(status.volume.level, status.volume.muted, activeInputState, metadata, standbyState)); - break; - case CLOSE: - this.onApplicationDisconnected(CommonStatusCodes.SUCCESS); - break; - case MEDIA_STATUS: - case APPEVENT: - default: - break; - } - } - - @Override - public void rawMessageReceived(ChromeCastRawMessage message, Long requestId) { - switch (message.getPayloadType()) { - case STRING: - String response = message.getPayloadUtf8(); - if (requestId != null) { - this.onSendMessageSuccess(response, requestId); - } - this.onTextMessageReceived(message.getNamespace(), response); - break; - case BINARY: - byte[] payload = message.getPayloadBinary(); - this.onBinaryMessageReceived(message.getNamespace(), payload); - break; - } - } - - @Override - public void disconnect() { - try { - this.chromecast.disconnect(); - } catch (IOException e) { - Log.e(TAG, "Error disconnecting chromecast: " + e.getMessage()); - } - } - - @Override - public void sendMessage(String namespace, String message, long requestId) { - try { - this.chromecast.sendRawRequest(namespace, message, requestId); - } catch (IOException e) { - Log.w(TAG, "Error sending cast message: " + e.getMessage()); - this.onSendMessageFailure("", requestId, CommonStatusCodes.NETWORK_ERROR); - } - } - - @Override - public void stopApplication(String sessionId) { - try { - this.chromecast.stopSession(sessionId); - } catch (IOException e) { - Log.w(TAG, "Error sending cast message: " + e.getMessage()); - return; - } - this.sessionId = null; - } - - @Override - public void registerNamespace(String namespace) { - Log.d(TAG, "unimplemented Method: registerNamespace"); - } - - @Override - public void unregisterNamespace(String namespace) { - Log.d(TAG, "unimplemented Method: unregisterNamespace"); - } - - @Override - public void launchApplication(String applicationId, LaunchOptions launchOptions) { - Application app = null; - try { - app = this.chromecast.launchApp(applicationId); - } catch (IOException e) { - Log.w(TAG, "Error launching cast application: " + e.getMessage()); - this.onApplicationConnectionFailure(CommonStatusCodes.NETWORK_ERROR); - return; - } - this.sessionId = app.sessionId; - - ApplicationMetadata metadata = this.createMetadataFromApplication(app); - this.onApplicationConnectionSuccess(metadata, app.statusText, app.sessionId, true); - } - - @Override - public void joinApplication(String applicationId, String sessionId, JoinOptions joinOptions) { - Log.d(TAG, "unimplemented Method: joinApplication"); - this.launchApplication(applicationId, new LaunchOptions()); - } - - public void onDisconnected(int reason) { - if (this.listener != null) { - try { - this.listener.onDisconnected(reason); - } catch (RemoteException ex) { - Log.e(TAG, "Error calling onDisconnected: " + ex.getMessage()); - } - } - } - - public void onApplicationConnectionSuccess(ApplicationMetadata applicationMetadata, String applicationStatus, String sessionId, boolean wasLaunched) { - if (this.listener != null) { - try { - this.listener.onApplicationConnectionSuccess(applicationMetadata, applicationStatus, sessionId, wasLaunched); - } catch (RemoteException ex) { - Log.e(TAG, "Error calling onApplicationConnectionSuccess: " + ex.getMessage()); - } - } - } - - public void onApplicationConnectionFailure(int statusCode) { - if (this.listener != null) { - try { - this.listener.onApplicationConnectionFailure(statusCode); - } catch (RemoteException ex) { - Log.e(TAG, "Error calling onApplicationConnectionFailure: " + ex.getMessage()); - } - } - } - - public void onTextMessageReceived(String namespace, String message) { - if (this.listener != null) { - try { - this.listener.onTextMessageReceived(namespace, message); - } catch (RemoteException ex) { - Log.e(TAG, "Error calling onTextMessageReceived: " + ex.getMessage()); - } - } - } - - public void onBinaryMessageReceived(String namespace, byte[] data) { - if (this.listener != null) { - try { - this.listener.onBinaryMessageReceived(namespace, data); - } catch (RemoteException ex) { - Log.e(TAG, "Error calling onBinaryMessageReceived: " + ex.getMessage()); - } - } - } - - public void onApplicationDisconnected(int paramInt) { - Log.d(TAG, "unimplemented Method: onApplicationDisconnected"); - if (this.listener != null) { - try { - this.listener.onApplicationDisconnected(paramInt); - } catch (RemoteException ex) { - Log.e(TAG, "Error calling onApplicationDisconnected: " + ex.getMessage()); - } - } - } - - public void onSendMessageFailure(String response, long requestId, int statusCode) { - if (this.listener != null) { - try { - this.listener.onSendMessageFailure(response, requestId, statusCode); - } catch (RemoteException ex) { - Log.e(TAG, "Error calling onSendMessageFailure: " + ex.getMessage()); - } - } - } - - public void onSendMessageSuccess(String response, long requestId) { - if (this.listener != null) { - try { - this.listener.onSendMessageSuccess(response, requestId); - } catch (RemoteException ex) { - Log.e(TAG, "Error calling onSendMessageSuccess: " + ex.getMessage()); - } - } - } - - public void onApplicationStatusChanged(ApplicationStatus applicationStatus) { - if (this.listener != null) { - try { - this.listener.onApplicationStatusChanged(applicationStatus); - } catch (RemoteException ex) { - Log.e(TAG, "Error calling onApplicationStatusChanged: " + ex.getMessage()); - } - } - } - - public void onDeviceStatusChanged(CastDeviceStatus deviceStatus) { - if (this.listener != null) { - try { - this.listener.onDeviceStatusChanged(deviceStatus); - } catch (RemoteException ex) { - Log.e(TAG, "Error calling onDeviceStatusChanged: " + ex.getMessage()); - } - } - } -} diff --git a/play-services-core/src/main/java/org/microg/gms/cast/CastDeviceControllerService.java b/play-services-core/src/main/java/org/microg/gms/cast/CastDeviceControllerService.java deleted file mode 100644 index 68d61775..00000000 --- a/play-services-core/src/main/java/org/microg/gms/cast/CastDeviceControllerService.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES 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.os.RemoteException; - -import com.google.android.gms.common.internal.GetServiceRequest; -import com.google.android.gms.common.internal.IGmsCallbacks; - -import org.microg.gms.BaseService; -import org.microg.gms.common.GmsService; - -public class CastDeviceControllerService extends BaseService { - private static final String TAG = CastDeviceControllerService.class.getSimpleName(); - - public CastDeviceControllerService() { - super("GmsCastDeviceControllerSvc", GmsService.CAST); - } - - @Override - public void handleServiceRequest(IGmsCallbacks callback, GetServiceRequest request, GmsService service) throws RemoteException { - callback.onPostInitComplete(0, new CastDeviceControllerImpl(this, request.packageName, request.extras), null); - } -} diff --git a/play-services-core/src/main/java/org/microg/gms/cast/CastMediaRouteController.java b/play-services-core/src/main/java/org/microg/gms/cast/CastMediaRouteController.java deleted file mode 100644 index 0d2aa35f..00000000 --- a/play-services-core/src/main/java/org/microg/gms/cast/CastMediaRouteController.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES 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.Intent; -import android.util.Log; - -import androidx.mediarouter.media.MediaRouteProvider; -import androidx.mediarouter.media.MediaRouter; - -import su.litvak.chromecast.api.v2.ChromeCast; - -public class CastMediaRouteController extends MediaRouteProvider.RouteController { - private static final String TAG = CastMediaRouteController.class.getSimpleName(); - - private final CastMediaRouteProvider provider; - private final String routeId; - private final ChromeCast chromecast; - - public CastMediaRouteController(CastMediaRouteProvider provider, String routeId, String address) { - super(); - - this.provider = provider; - this.routeId = routeId; - this.chromecast = new ChromeCast(address); - } - - public boolean onControlRequest(Intent intent, MediaRouter.ControlRequestCallback callback) { - Log.d(TAG, "unimplemented Method: onControlRequest: " + this.routeId); - return false; - } - - public void onRelease() { - Log.d(TAG, "unimplemented Method: onRelease: " + this.routeId); - } - - public void onSelect() { - Log.d(TAG, "unimplemented Method: onSelect: " + this.routeId); - } - - public void onSetVolume(int volume) { - Log.d(TAG, "unimplemented Method: onSetVolume: " + this.routeId); - } - - public void onUnselect() { - Log.d(TAG, "unimplemented Method: onUnselect: " + this.routeId); - } - - public void onUnselect(int reason) { - Log.d(TAG, "unimplemented Method: onUnselect: " + this.routeId); - } - - public void onUpdateVolume(int delta) { - Log.d(TAG, "unimplemented Method: onUpdateVolume: " + this.routeId); - } -} diff --git a/play-services-core/src/main/java/org/microg/gms/cast/CastMediaRouteProvider.java b/play-services-core/src/main/java/org/microg/gms/cast/CastMediaRouteProvider.java deleted file mode 100644 index e4014ad9..00000000 --- a/play-services-core/src/main/java/org/microg/gms/cast/CastMediaRouteProvider.java +++ /dev/null @@ -1,344 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES 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.annotation.SuppressLint; -import android.content.Context; -import android.content.IntentFilter; -import android.net.nsd.NsdManager; -import android.net.nsd.NsdServiceInfo; -import android.os.Bundle; -import android.os.Handler; -import android.util.Log; - -import androidx.mediarouter.media.MediaControlIntent; -import androidx.mediarouter.media.MediaRouteDescriptor; -import androidx.mediarouter.media.MediaRouteDiscoveryRequest; -import androidx.mediarouter.media.MediaRouteProvider; -import androidx.mediarouter.media.MediaRouteProviderDescriptor; -import androidx.mediarouter.media.MediaRouter; - -import com.google.android.gms.cast.CastDevice; -import com.google.android.gms.cast.CastMediaControlIntent; - -import java.net.InetAddress; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class CastMediaRouteProvider extends MediaRouteProvider { - private static final String TAG = CastMediaRouteProvider.class.getSimpleName(); - - private final Map castDevices = new HashMap<>(); - private final Map serviceCastIds = new HashMap<>(); - - private NsdManager mNsdManager; - private NsdManager.DiscoveryListener mDiscoveryListener; - - private final List customCategories = new ArrayList<>(); - - private enum State { - NOT_DISCOVERING, - DISCOVERY_REQUESTED, - DISCOVERING, - DISCOVERY_STOP_REQUESTED, - } - private State state = State.NOT_DISCOVERING; - - private static final ArrayList BASE_CONTROL_FILTERS = new ArrayList<>(); - static { - IntentFilter filter; - - filter = new IntentFilter(); - filter.addCategory(CastMediaControlIntent.CATEGORY_CAST); - BASE_CONTROL_FILTERS.add(filter); - - filter = new IntentFilter(); - filter.addCategory(MediaControlIntent.CATEGORY_REMOTE_PLAYBACK); - filter.addAction(MediaControlIntent.ACTION_PLAY); - filter.addDataScheme("http"); - filter.addDataScheme("https"); - String[] types = { - "image/jpeg", - "image/pjpeg", - "image/jpg", - "image/webp", - "image/png", - "image/gif", - "image/bmp", - "image/vnd.microsoft.icon", - "image/x-icon", - "image/x-xbitmap", - "audio/wav", - "audio/x-wav", - "audio/mp3", - "audio/x-mp3", - "audio/x-m4a", - "audio/mpeg", - "audio/webm", - "audio/ogg", - "audio/x-matroska", - "video/mp4", - "video/x-m4v", - "video/mp2t", - "video/webm", - "video/ogg", - "video/x-matroska", - "application/x-mpegurl", - "application/vnd.apple.mpegurl", - "application/dash+xml", - "application/vnd.ms-sstr+xml", - }; - for (String type : types) { - try { - filter.addDataType(type); - } catch (IntentFilter.MalformedMimeTypeException ex) { - Log.e(TAG, "Error adding filter type " + type); - } - } - BASE_CONTROL_FILTERS.add(filter); - - filter = new IntentFilter(); - filter.addCategory(MediaControlIntent.CATEGORY_REMOTE_PLAYBACK); - filter.addAction(MediaControlIntent.ACTION_PAUSE); - BASE_CONTROL_FILTERS.add(filter); - - filter = new IntentFilter(); - filter.addCategory(MediaControlIntent.CATEGORY_REMOTE_PLAYBACK); - filter.addAction(MediaControlIntent.ACTION_RESUME); - BASE_CONTROL_FILTERS.add(filter); - - filter = new IntentFilter(); - filter.addCategory(MediaControlIntent.CATEGORY_REMOTE_PLAYBACK); - filter.addAction(MediaControlIntent.ACTION_STOP); - BASE_CONTROL_FILTERS.add(filter); - - filter = new IntentFilter(); - filter.addCategory(MediaControlIntent.CATEGORY_REMOTE_PLAYBACK); - filter.addAction(MediaControlIntent.ACTION_SEEK); - BASE_CONTROL_FILTERS.add(filter); - - filter = new IntentFilter(); - filter.addCategory(MediaControlIntent.CATEGORY_REMOTE_PLAYBACK); - filter.addAction(MediaControlIntent.ACTION_GET_STATUS); - BASE_CONTROL_FILTERS.add(filter); - - filter = new IntentFilter(); - filter.addCategory(MediaControlIntent.CATEGORY_REMOTE_PLAYBACK); - filter.addAction(MediaControlIntent.ACTION_START_SESSION); - BASE_CONTROL_FILTERS.add(filter); - - filter = new IntentFilter(); - filter.addCategory(MediaControlIntent.CATEGORY_REMOTE_PLAYBACK); - filter.addAction(MediaControlIntent.ACTION_GET_SESSION_STATUS); - BASE_CONTROL_FILTERS.add(filter); - - filter = new IntentFilter(); - filter.addCategory(MediaControlIntent.CATEGORY_REMOTE_PLAYBACK); - filter.addAction(MediaControlIntent.ACTION_END_SESSION); - BASE_CONTROL_FILTERS.add(filter); - - filter = new IntentFilter(); - filter.addCategory(CastMediaControlIntent.CATEGORY_CAST_REMOTE_PLAYBACK); - filter.addAction(CastMediaControlIntent.ACTION_SYNC_STATUS); - BASE_CONTROL_FILTERS.add(filter); - - filter = new IntentFilter(); - filter.addCategory(CastMediaControlIntent.CATEGORY_CAST_REMOTE_PLAYBACK); - filter.addAction(CastMediaControlIntent.ACTION_SYNC_STATUS); - BASE_CONTROL_FILTERS.add(filter); - } - - @SuppressLint("NewApi") - public CastMediaRouteProvider(Context context) { - super(context); - - if (android.os.Build.VERSION.SDK_INT < 16) { - Log.i(TAG, "Cast discovery disabled. Android SDK version 16 or higher required."); - return; - } - - mNsdManager = (NsdManager)context.getSystemService(Context.NSD_SERVICE); - - mDiscoveryListener = new NsdManager.DiscoveryListener() { - - @Override - public void onDiscoveryStarted(String regType) { - CastMediaRouteProvider.this.state = State.DISCOVERING; - } - - @Override - public void onServiceFound(NsdServiceInfo service) { - mNsdManager.resolveService(service, new NsdManager.ResolveListener() { - @Override - public void onResolveFailed(NsdServiceInfo serviceInfo, int errorCode) { - if (errorCode == NsdManager.FAILURE_ALREADY_ACTIVE) { - return; - } - Log.e(TAG, "DiscoveryListener Resolve failed. Error code " + errorCode); - } - - @Override - public void onServiceResolved(NsdServiceInfo serviceInfo) { - String name = serviceInfo.getServiceName(); - InetAddress host = serviceInfo.getHost(); - int port = serviceInfo.getPort(); - Map attributes = serviceInfo.getAttributes(); - if (attributes == null) { - Log.e(TAG, "Error getting service attributes from DNS-SD response"); - return; - } - try { - String id = new String(attributes.get("id"), StandardCharsets.UTF_8); - String deviceVersion = new String(attributes.get("ve"), StandardCharsets.UTF_8); - String friendlyName = new String(attributes.get("fn"), StandardCharsets.UTF_8); - String modelName = new String(attributes.get("md"), StandardCharsets.UTF_8); - String iconPath = new String(attributes.get("ic"), StandardCharsets.UTF_8); - int status = Integer.parseInt(new String(attributes.get("st"), StandardCharsets.UTF_8)); - - onChromeCastDiscovered(id, name, host, port, deviceVersion, friendlyName, modelName, iconPath, status); - } catch (NullPointerException ex) { - Log.e(TAG, "Error getting cast details from DNS-SD response", ex); - } - } - }); - } - - @Override - public void onServiceLost(NsdServiceInfo serviceInfo) { - String name = serviceInfo.getServiceName(); - onChromeCastLost(name); - } - - @Override - public void onDiscoveryStopped(String serviceType) { - CastMediaRouteProvider.this.state = State.NOT_DISCOVERING; - } - - @Override - public void onStartDiscoveryFailed(String serviceType, int errorCode) { - CastMediaRouteProvider.this.state = State.NOT_DISCOVERING; - } - - @Override - public void onStopDiscoveryFailed(String serviceType, int errorCode) { - CastMediaRouteProvider.this.state = State.DISCOVERING; - } - }; - } - - private void onChromeCastDiscovered( - String id, String name, InetAddress host, int port, String - deviceVersion, String friendlyName, String modelName, String - iconPath, int status) { - if (!this.castDevices.containsKey(id)) { - // TODO: Capabilities - int capabilities = CastDevice.CAPABILITY_VIDEO_OUT | CastDevice.CAPABILITY_AUDIO_OUT; - - CastDevice castDevice = new CastDevice(id, name, host, port, deviceVersion, friendlyName, modelName, iconPath, status, capabilities); - this.castDevices.put(id, castDevice); - this.serviceCastIds.put(name, id); - } - - publishRoutesInMainThread(); - } - - private void onChromeCastLost(String name) { - String id = this.serviceCastIds.remove(name); - if (id != null) { - this.castDevices.remove(id); - } - - publishRoutesInMainThread(); - } - - @SuppressLint("NewApi") - @Override - public void onDiscoveryRequestChanged(MediaRouteDiscoveryRequest request) { - if (android.os.Build.VERSION.SDK_INT < 16) { - return; - } - - if (request != null && request.isValid() && request.isActiveScan()) { - if (request.getSelector() != null) { - for (String category : request.getSelector().getControlCategories()) { - if (CastMediaControlIntent.isCategoryForCast(category)) { - this.customCategories.add(category); - } - } - } - if (this.state == State.NOT_DISCOVERING) { - mNsdManager.discoverServices("_googlecast._tcp.", NsdManager.PROTOCOL_DNS_SD, mDiscoveryListener); - this.state = State.DISCOVERY_REQUESTED; - } - } else { - if (this.state == State.DISCOVERING) { - mNsdManager.stopServiceDiscovery(mDiscoveryListener); - this.state = State.DISCOVERY_STOP_REQUESTED; - } - } - } - - @Override - public RouteController onCreateRouteController(String routeId) { - CastDevice castDevice = this.castDevices.get(routeId); - if (castDevice == null) { - return null; - } - return new CastMediaRouteController(this, routeId, castDevice.getAddress()); - } - - private void publishRoutesInMainThread() { - Handler mainHandler = new Handler(this.getContext().getMainLooper()); - mainHandler.post(this::publishRoutes); - } - - private void publishRoutes() { - MediaRouteProviderDescriptor.Builder builder = new MediaRouteProviderDescriptor.Builder(); - for (CastDevice castDevice : this.castDevices.values()) { - ArrayList controlFilters = new ArrayList<>(BASE_CONTROL_FILTERS); - // Include any app-specific control filters that have been requested. - // TODO: Do we need to check with the device? - for (String category : this.customCategories) { - IntentFilter filter = new IntentFilter(); - filter.addCategory(category); - controlFilters.add(filter); - } - - Bundle extras = new Bundle(); - castDevice.putInBundle(extras); - MediaRouteDescriptor route = new MediaRouteDescriptor.Builder( - castDevice.getDeviceId(), - castDevice.getFriendlyName()) - .setDescription(castDevice.getModelName()) - .addControlFilters(controlFilters) - .setDeviceType(MediaRouter.RouteInfo.DEVICE_TYPE_TV) - .setPlaybackType(MediaRouter.RouteInfo.PLAYBACK_TYPE_REMOTE) - .setVolumeHandling(MediaRouter.RouteInfo.PLAYBACK_VOLUME_FIXED) - .setVolumeMax(20) - .setVolume(0) - .setEnabled(true) - .setExtras(extras) - .setConnectionState(MediaRouter.RouteInfo.CONNECTION_STATE_DISCONNECTED) - .build(); - builder.addRoute(route); - } - this.setDescriptor(builder.build()); - } -} diff --git a/play-services-core/src/main/java/org/microg/gms/feeds/SubscribedFeedsProvider.java b/play-services-core/src/main/java/org/microg/gms/feeds/SubscribedFeedsProvider.java deleted file mode 100644 index 58ca9eee..00000000 --- a/play-services-core/src/main/java/org/microg/gms/feeds/SubscribedFeedsProvider.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES 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.feeds; - -import android.content.ContentProvider; -import android.content.ContentValues; -import android.database.Cursor; -import android.database.MatrixCursor; -import android.net.Uri; - -public class SubscribedFeedsProvider extends ContentProvider{ - - @Override - public boolean onCreate() { - return false; - } - - @Override - public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) { - return new MatrixCursor(new String[0]); - } - - @Override - public String getType(Uri uri) { - return null; - } - - @Override - public Uri insert(Uri uri, ContentValues values) { - return null; - } - - @Override - public int delete(Uri uri, String selection, String[] selectionArgs) { - return 0; - } - - @Override - public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) { - return 0; - } -} diff --git a/play-services-core/src/main/java/org/microg/gms/gcm/McsService.java b/play-services-core/src/main/java/org/microg/gms/gcm/McsService.java index 9533f353..feea9f61 100644 --- a/play-services-core/src/main/java/org/microg/gms/gcm/McsService.java +++ b/play-services-core/src/main/java/org/microg/gms/gcm/McsService.java @@ -99,6 +99,7 @@ import org.microg.gms.gcm.mcs.IqStanza; import org.microg.gms.gcm.mcs.LoginRequest; import org.microg.gms.gcm.mcs.LoginResponse; import org.microg.gms.gcm.mcs.Setting; +import org.microg.mgms.settings.SettingsProvider; import java.io.Closeable; import java.lang.reflect.Field; @@ -330,8 +331,8 @@ public class McsService extends Service implements Handler.Callback { public synchronized static long getCurrentDelay() { long delay = currentDelay == 0 ? 5000 : currentDelay; - if (currentDelay < GcmPrefs.INTERVAL) currentDelay += 10000; - if (currentDelay >= GcmPrefs.INTERVAL && currentDelay < 600000) currentDelay += GcmPrefs.INTERVAL; + if (currentDelay < SettingsProvider.INTERVAL) currentDelay += 10000; + if (currentDelay >= SettingsProvider.INTERVAL && currentDelay < 600000) currentDelay += SettingsProvider.INTERVAL; return delay; } @@ -500,7 +501,11 @@ public class McsService extends Service implements Handler.Callback { NetworkInfo activeNetworkInfo = cm.getActiveNetworkInfo(); activeNetworkPref = GcmPrefs.get(this).getNetworkPrefForInfo(activeNetworkInfo); if (!GcmPrefs.get(this).isEnabledFor(activeNetworkInfo)) { - logd(this, "Don't connect, because disabled for " + activeNetworkInfo.getTypeName()); + if (activeNetworkInfo != null) { + logd(this, "Don't connect, because disabled for " + activeNetworkInfo.getTypeName()); + } else { + logd(this, "Don't connect, no active network"); + } scheduleReconnect(this); return; } diff --git a/play-services-core/src/main/java/org/microg/gms/icing/AppDataSearchImpl.java b/play-services-core/src/main/java/org/microg/gms/icing/AppDataSearchImpl.java deleted file mode 100644 index 9340def3..00000000 --- a/play-services-core/src/main/java/org/microg/gms/icing/AppDataSearchImpl.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES 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.icing; - -import android.os.Parcel; -import android.os.RemoteException; -import android.util.Log; - -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.SuggestSpecification; -import com.google.android.gms.appdatasearch.SuggestionResults; -import com.google.android.gms.appdatasearch.internal.IAppDataSearch; - -public class AppDataSearchImpl extends IAppDataSearch.Stub { - private static final String TAG = "GmsIcingAppDataImpl"; - - @Override - public boolean onTransact(int code, Parcel data, Parcel reply, int flags) throws RemoteException { - if (super.onTransact(code, data, reply, flags)) return true; - Log.d(TAG, "onTransact [unknown]: " + code + ", " + data + ", " + flags); - return false; - } - - @Override - public SuggestionResults getSuggestions(String var1, String packageName, String[] accounts, int maxNum, SuggestSpecification specs) throws RemoteException { - return new SuggestionResults("Unknown error"); - } - - @Override - public boolean requestIndexing(String packageName, String accountName, long l, RequestIndexingSpecification specs) throws RemoteException { - Log.d(TAG, "requestIndexing: " + accountName + " @ " + packageName + ", " + l); - return true; - } - - @Override - public CorpusStatus getStatus(String packageName, String accountName) throws RemoteException { - Log.d(TAG, "getStatus: " + accountName + " @ " + packageName); - CorpusStatus status = new CorpusStatus(); - status.found = true; - return status; - } - - @Override - public PIMEUpdateResponse requestPIMEUpdate(String s1, String s2, int i, byte[] bs) throws RemoteException { - Log.d(TAG, "requestPIMEUpdate: " + s1 + ", " + s2 + ", " + i + ", " + (bs == null ? "null" : new String(bs))); - return new PIMEUpdateResponse(); - } -} diff --git a/play-services-core/src/main/java/org/microg/gms/icing/GlobalSearchAdminImpl.java b/play-services-core/src/main/java/org/microg/gms/icing/GlobalSearchAdminImpl.java deleted file mode 100644 index e3aaf3e2..00000000 --- a/play-services-core/src/main/java/org/microg/gms/icing/GlobalSearchAdminImpl.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES 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.icing; - -import android.os.Parcel; -import android.os.Parcelable; -import android.os.RemoteException; -import android.util.Log; - -import com.google.android.gms.common.api.Status; -import com.google.android.gms.search.global.GetCurrentExperimentIdsRequest; -import com.google.android.gms.search.global.GetCurrentExperimentIdsResponse; -import com.google.android.gms.search.global.GetGlobalSearchSourcesRequest; -import com.google.android.gms.search.global.GetGlobalSearchSourcesResponse; -import com.google.android.gms.search.global.GetPendingExperimentIdsRequest; -import com.google.android.gms.search.global.GetPendingExperimentIdsResponse; -import com.google.android.gms.search.global.SetExperimentIdsRequest; -import com.google.android.gms.search.global.SetExperimentIdsResponse; -import com.google.android.gms.search.global.SetIncludeInGlobalSearchRequest; -import com.google.android.gms.search.global.SetIncludeInGlobalSearchResponse; -import com.google.android.gms.search.global.internal.IGlobalSearchAdminCallbacks; -import com.google.android.gms.search.global.internal.IGlobalSearchAdminService; - -public class GlobalSearchAdminImpl extends IGlobalSearchAdminService.Stub { - private static final String TAG = "GmsIcingGlobalImpl"; - - @Override - public void getGlobalSearchSources(GetGlobalSearchSourcesRequest request, IGlobalSearchAdminCallbacks callbacks) throws RemoteException { - Log.d(TAG, "getGlobalSearchSources: " + request); - callbacks.onGetGlobalSearchSourcesResponse(new GetGlobalSearchSourcesResponse(Status.SUCCESS, new Parcelable[0])); - } - - @Override - public void setExperimentIds(SetExperimentIdsRequest request, IGlobalSearchAdminCallbacks callbacks) throws RemoteException { - Log.d(TAG, "setExperimentIds: " + request); - callbacks.onSetExperimentIdsResponse(new SetExperimentIdsResponse(Status.SUCCESS)); - } - - @Override - public void getCurrentExperimentIds(GetCurrentExperimentIdsRequest request, IGlobalSearchAdminCallbacks callbacks) throws RemoteException { - Log.d(TAG, "getCurrentExperimentIds: " + request); - callbacks.onGetCurrentExperimentIdsResponse(new GetCurrentExperimentIdsResponse(Status.SUCCESS, new int[0])); - } - - @Override - public void getPendingExperimentIds(GetPendingExperimentIdsRequest request, IGlobalSearchAdminCallbacks callbacks) throws RemoteException { - Log.d(TAG, "getPendingExperimentIds: " + request); - callbacks.onGetPendingExperimentIdsResponse(new GetPendingExperimentIdsResponse(Status.SUCCESS, new int[0])); - } - - @Override - public void setIncludeInGlobalSearch(SetIncludeInGlobalSearchRequest request, IGlobalSearchAdminCallbacks callbacks) throws RemoteException { - Log.d(TAG, "setIncludeInGlobalSearch: " + request); - callbacks.onSetIncludeInGlobalSearchResponse(new SetIncludeInGlobalSearchResponse(Status.SUCCESS)); - } - - @Override - public boolean onTransact(int code, Parcel data, Parcel reply, int flags) throws RemoteException { - if (super.onTransact(code, data, reply, flags)) return true; - Log.d(TAG, "onTransact [unknown]: " + code + ", " + data + ", " + flags); - return false; - } -} diff --git a/play-services-core/src/main/java/org/microg/gms/icing/IndexService.java b/play-services-core/src/main/java/org/microg/gms/icing/IndexService.java deleted file mode 100644 index 03ae062a..00000000 --- a/play-services-core/src/main/java/org/microg/gms/icing/IndexService.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES 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.icing; - -import android.os.RemoteException; -import android.util.Log; - -import com.google.android.gms.common.api.CommonStatusCodes; -import com.google.android.gms.common.internal.GetServiceRequest; -import com.google.android.gms.common.internal.IGmsCallbacks; - -import org.microg.gms.BaseService; -import org.microg.gms.common.GmsService; - -public class IndexService extends BaseService { - private final AppDataSearchImpl appDataSearch = new AppDataSearchImpl(); - private final GlobalSearchAdminImpl globalSearchAdmin = new GlobalSearchAdminImpl(); - private final SearchCorporaImpl searchCorpora = new SearchCorporaImpl(); - private final SearchQueriesImpl searchQueries = new SearchQueriesImpl(); - - public IndexService() { - super("GmsIcingIndexSvc", - GmsService.INDEX, GmsService.SEARCH_ADMINISTRATION, GmsService.SEARCH_CORPORA, - GmsService.SEARCH_GLOBAL, GmsService.SEARCH_IME, GmsService.SEARCH_QUERIES); - } - - @Override - public void handleServiceRequest(IGmsCallbacks callback, GetServiceRequest request, GmsService service) throws RemoteException { - switch (service) { - case INDEX: - callback.onPostInitComplete(0, appDataSearch.asBinder(), null); - break; - case SEARCH_ADMINISTRATION: - Log.w(TAG, "Service not yet implemented: " + service); - callback.onPostInitComplete(CommonStatusCodes.ERROR, null, null); - break; - case SEARCH_QUERIES: - callback.onPostInitComplete(0, searchQueries.asBinder(), null); - break; - case SEARCH_GLOBAL: - callback.onPostInitComplete(0, globalSearchAdmin.asBinder(), null); - break; - case SEARCH_CORPORA: - callback.onPostInitComplete(0, searchCorpora.asBinder(), null); - break; - case SEARCH_IME: - Log.w(TAG, "Service not yet implemented: " + service); - callback.onPostInitComplete(CommonStatusCodes.ERROR, null, null); - break; - } - } -} diff --git a/play-services-core/src/main/java/org/microg/gms/icing/LightweightAppDataSearchImpl.java b/play-services-core/src/main/java/org/microg/gms/icing/LightweightAppDataSearchImpl.java deleted file mode 100644 index 554d86a4..00000000 --- a/play-services-core/src/main/java/org/microg/gms/icing/LightweightAppDataSearchImpl.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES 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.icing; - -import android.os.Parcel; -import android.os.RemoteException; -import android.util.Log; - -import com.google.android.gms.appdatasearch.UsageInfo; -import com.google.android.gms.appdatasearch.internal.ILightweightAppDataSearch; -import com.google.android.gms.appdatasearch.internal.ILightweightAppDataSearchCallbacks; - -import java.util.Arrays; - -public class LightweightAppDataSearchImpl extends ILightweightAppDataSearch.Stub { - private static final String TAG = "GmsIcingLightSearchImpl"; - - public void view(ILightweightAppDataSearchCallbacks callbacks, String packageName, UsageInfo[] usageInfos) { - Log.d(TAG, "view: " + Arrays.toString(usageInfos)); - } - - @Override - public boolean onTransact(int code, Parcel data, Parcel reply, int flags) throws RemoteException { - if (super.onTransact(code, data, reply, flags)) return true; - Log.d(TAG, "onTransact [unknown]: " + code + ", " + data + ", " + flags); - return false; - } -} diff --git a/play-services-core/src/main/java/org/microg/gms/icing/LightweightIndexService.java b/play-services-core/src/main/java/org/microg/gms/icing/LightweightIndexService.java deleted file mode 100644 index d84e1e22..00000000 --- a/play-services-core/src/main/java/org/microg/gms/icing/LightweightIndexService.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES 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.icing; - -import android.os.RemoteException; - -import com.google.android.gms.common.internal.GetServiceRequest; -import com.google.android.gms.common.internal.IGmsCallbacks; - -import org.microg.gms.BaseService; -import org.microg.gms.common.GmsService; - -public class LightweightIndexService extends BaseService { - private final LightweightAppDataSearchImpl appDataSearch = new LightweightAppDataSearchImpl(); - - public LightweightIndexService() { - super("GmsIcingLightIndexSvc", GmsService.LIGHTWEIGHT_INDEX); - } - - @Override - public void handleServiceRequest(IGmsCallbacks callback, GetServiceRequest request, GmsService service) throws RemoteException { - callback.onPostInitComplete(0, appDataSearch.asBinder(), null); - } -} diff --git a/play-services-core/src/main/java/org/microg/gms/icing/SearchCorporaImpl.java b/play-services-core/src/main/java/org/microg/gms/icing/SearchCorporaImpl.java deleted file mode 100644 index 00e60006..00000000 --- a/play-services-core/src/main/java/org/microg/gms/icing/SearchCorporaImpl.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES 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.icing; - -import android.os.Parcel; -import android.os.RemoteException; -import android.util.Log; - -import com.google.android.gms.appdatasearch.CorpusStatus; -import com.google.android.gms.common.api.Status; -import com.google.android.gms.search.corpora.ClearCorpusRequest; -import com.google.android.gms.search.corpora.GetCorpusInfoRequest; -import com.google.android.gms.search.corpora.GetCorpusStatusRequest; -import com.google.android.gms.search.corpora.GetCorpusStatusResponse; -import com.google.android.gms.search.corpora.RequestIndexingRequest; -import com.google.android.gms.search.corpora.RequestIndexingResponse; -import com.google.android.gms.search.corpora.internal.ISearchCorporaCallbacks; -import com.google.android.gms.search.corpora.internal.ISearchCorporaService; - -import java.util.HashMap; -import java.util.Map; - -public class SearchCorporaImpl extends ISearchCorporaService.Stub { - private static final String TAG = "GmsIcingCorporaImpl"; - - // We count the sequence number here to make clients happy. - private final Map corpusSequenceNumbers = new HashMap(); - - @Override - public void requestIndexing(RequestIndexingRequest request, ISearchCorporaCallbacks callbacks) throws RemoteException { - Log.d(TAG, "requestIndexing: " + request); - corpusSequenceNumbers.put(request.packageName + "/" + request.corpus, request.sequenceNumber); - callbacks.onRequestIndexing(new RequestIndexingResponse(Status.SUCCESS, true)); - } - - @Override - public void clearCorpus(ClearCorpusRequest request, ISearchCorporaCallbacks callbacks) throws RemoteException { - Log.d(TAG, "clearCorpus"); - } - - @Override - public void getCorpusStatus(GetCorpusStatusRequest request, ISearchCorporaCallbacks callbacks) throws RemoteException { - Log.d(TAG, "getCorpusStatus: " + request); - CorpusStatus status = new CorpusStatus(); - String numIndex = request.packageName + "/" + request.corpus; - if (corpusSequenceNumbers.containsKey(numIndex)) { - status.found = true; - status.lastIndexedSeqno = corpusSequenceNumbers.get(numIndex); - status.lastCommittedSeqno = status.lastIndexedSeqno; - } - callbacks.onGetCorpusStatus(new GetCorpusStatusResponse(Status.SUCCESS, status)); - } - - @Override - public void getCorpusInfo(GetCorpusInfoRequest request, ISearchCorporaCallbacks callbacks) throws RemoteException { - Log.d(TAG, "getCorpusInfo"); - } - - @Override - public boolean onTransact(int code, Parcel data, Parcel reply, int flags) throws RemoteException { - if (super.onTransact(code, data, reply, flags)) return true; - Log.d(TAG, "onTransact [unknown]: " + code + ", " + data + ", " + flags); - return false; - } -} diff --git a/play-services-core/src/main/java/org/microg/gms/icing/SearchQueriesImpl.java b/play-services-core/src/main/java/org/microg/gms/icing/SearchQueriesImpl.java deleted file mode 100644 index 2c353ab7..00000000 --- a/play-services-core/src/main/java/org/microg/gms/icing/SearchQueriesImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES 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.icing; - -import android.os.Parcel; -import android.os.RemoteException; -import android.util.Log; - -import com.google.android.gms.common.api.Status; -import com.google.android.gms.search.queries.QueryRequest; -import com.google.android.gms.search.queries.QueryResponse; -import com.google.android.gms.search.queries.internal.ISearchQueriesCallbacks; -import com.google.android.gms.search.queries.internal.ISearchQueriesService; - -public class SearchQueriesImpl extends ISearchQueriesService.Stub { - private static final String TAG = "GmsIcingQueriesImpl"; - - @Override - public void query(QueryRequest request, ISearchQueriesCallbacks callbacks) throws RemoteException { - Log.d(TAG, "query: " + request); - callbacks.onQuery(new QueryResponse(Status.CANCELED, null)); - } - - @Override - public boolean onTransact(int code, Parcel data, Parcel reply, int flags) throws RemoteException { - if (super.onTransact(code, data, reply, flags)) return true; - Log.d(TAG, "onTransact [unknown]: " + code + ", " + data + ", " + flags); - return false; - } -} diff --git a/play-services-core/src/main/java/org/microg/gms/location/GoogleLocationManager.java b/play-services-core/src/main/java/org/microg/gms/location/GoogleLocationManager.java deleted file mode 100644 index f90831a4..00000000 --- a/play-services-core/src/main/java/org/microg/gms/location/GoogleLocationManager.java +++ /dev/null @@ -1,247 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES 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 static android.Manifest.permission.ACCESS_COARSE_LOCATION; -import static android.Manifest.permission.ACCESS_FINE_LOCATION; -import static android.content.pm.PackageManager.PERMISSION_GRANTED; -import static android.location.LocationManager.GPS_PROVIDER; -import static com.google.android.gms.location.LocationRequest.PRIORITY_HIGH_ACCURACY; - -import android.Manifest; -import android.app.PendingIntent; -import android.content.Context; -import android.location.Location; -import android.location.LocationManager; -import android.os.Binder; -import android.os.Handler; -import android.os.Looper; -import android.os.RemoteException; -import android.util.Log; - -import androidx.lifecycle.Lifecycle; - -import com.google.android.gms.common.api.Status; -import com.google.android.gms.location.ILocationListener; -import com.google.android.gms.location.LocationRequest; -import com.google.android.gms.location.internal.FusedLocationProviderResult; -import com.google.android.gms.location.internal.LocationRequestUpdateData; - -import org.microg.gms.common.PackageUtils; -import org.microg.gms.common.Utils; - -import java.io.PrintWriter; -import java.util.ArrayList; -import java.util.List; - -public class GoogleLocationManager implements LocationChangeListener { - private static final String TAG = "LocationManager"; - private static final String MOCK_PROVIDER = "mock"; - private static final long VERIFY_CURRENT_REQUESTS_INTERVAL_MS = 5000; // 5 seconds - private static final long SWITCH_ON_FRESHNESS_CLIFF_MS = 30000; // 30 seconds - private static final String ACCESS_MOCK_LOCATION = "android.permission.ACCESS_MOCK_LOCATION"; - - private final Context context; - private final Handler handler; - private final Runnable verifyCurrentRequestsRunnable = this::verifyCurrentRequests; - private final RealLocationProvider gpsProvider; - private final MockLocationProvider mockProvider; - private final List currentRequests = new ArrayList(); - - public GoogleLocationManager(Context context, Lifecycle lifecycle) { - long callingIdentity = Binder.clearCallingIdentity(); - this.context = context; - LocationManager locationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE); - if (Utils.hasSelfPermissionOrNotify(context, Manifest.permission.ACCESS_FINE_LOCATION)) { - this.gpsProvider = new RealLocationProvider(locationManager, GPS_PROVIDER, this); - } else { - this.gpsProvider = null; - } - mockProvider = new MockLocationProvider(this); - handler = new Handler(Looper.getMainLooper()); - Binder.restoreCallingIdentity(callingIdentity); - } - - public void invokeOnceReady(Runnable runnable) { - - } - - public Location getLastLocation(String packageName) { - return getLocation(hasFineLocationPermission(), hasCoarseLocationPermission()); - } - - public Location getLocation(boolean gpsPermission, boolean networkPermission) { - if (mockProvider.getLocation() != null) - return mockProvider.getLocation(); - return null; - } - - private boolean hasCoarseLocationPermission() { - return context.checkCallingPermission(ACCESS_COARSE_LOCATION) == PERMISSION_GRANTED || hasFineLocationPermission(); - } - - private boolean hasFineLocationPermission() { - return context.checkCallingPermission(ACCESS_FINE_LOCATION) == PERMISSION_GRANTED; - } - - private boolean hasMockLocationPermission() { - return context.checkCallingPermission(ACCESS_MOCK_LOCATION) == PERMISSION_GRANTED; - } - - private void requestLocationUpdates(LocationRequestHelper request) { - LocationRequestHelper old = null; - for (LocationRequestHelper req : currentRequests) { - if (req.respondsTo(request.pendingIntent) || req.respondsTo(request.listener) || req.respondsTo(request.callback)) { - old = req; - break; - } - } - if (old != null) { - Log.d(TAG, "Removing replaced location request: " + old); - currentRequests.remove(old); - } - currentRequests.add(request); - if (gpsProvider != null && request.hasFinePermission() && request.locationRequest.getPriority() == PRIORITY_HIGH_ACCURACY) { - Log.d(TAG, "Registering request with high accuracy location provider"); - gpsProvider.addRequest(request); - } else if (gpsProvider != null && old != null) { - Log.d(TAG, "Unregistering request with high accuracy location provider"); - gpsProvider.removeRequest(old); - } else { - Log.w(TAG, "Not providing high accuracy location: missing permission"); - } - handler.postDelayed(this::onLocationChanged, request.locationRequest.getFastestInterval()); - } - - public void requestLocationUpdates(LocationRequest request, ILocationListener listener, String packageName) { - requestLocationUpdates(new LocationRequestHelper(context, request, packageName, Binder.getCallingUid(), listener)); - } - - public void requestLocationUpdates(LocationRequest request, PendingIntent intent, String packageName) { - requestLocationUpdates(new LocationRequestHelper(context, request, packageName, Binder.getCallingUid(), intent)); - } - - private void removeLocationUpdates(LocationRequestHelper request) { - currentRequests.remove(request); - if (gpsProvider != null) gpsProvider.removeRequest(request); - } - - public void removeLocationUpdates(ILocationListener listener, String packageName) { - for (int i = 0; i < currentRequests.size(); i++) { - if (currentRequests.get(i).respondsTo(listener)) { - removeLocationUpdates(currentRequests.get(i)); - i--; - } - } - } - - public void removeLocationUpdates(PendingIntent intent, String packageName) { - for (int i = 0; i < currentRequests.size(); i++) { - if (currentRequests.get(i).respondsTo(intent)) { - removeLocationUpdates(currentRequests.get(i)); - i--; - } - } - } - - public void updateLocationRequest(LocationRequestUpdateData data) { - try { - Log.d(TAG, "updateLocationRequest: " + data); - String packageName = PackageUtils.getCallingPackage(context); - if (data.pendingIntent != null) - packageName = PackageUtils.packageFromPendingIntent(data.pendingIntent); - Log.d(TAG, "Using source package: " + packageName); - if (data.opCode == LocationRequestUpdateData.REQUEST_UPDATES) { - requestLocationUpdates(new LocationRequestHelper(context, packageName, Binder.getCallingUid(), data)); - } else if (data.opCode == LocationRequestUpdateData.REMOVE_UPDATES) { - for (int i = 0; i < currentRequests.size(); i++) { - if (currentRequests.get(i).respondsTo(data.listener) - || currentRequests.get(i).respondsTo(data.pendingIntent) - || currentRequests.get(i).respondsTo(data.callback)) { - removeLocationUpdates(currentRequests.get(i)); - i--; - } - } - } - Log.d(TAG, "Updated current requests, verifying"); - verifyCurrentRequests(); - if (data.fusedLocationProviderCallback != null) { - try { - Log.d(TAG, "Send success result to " + packageName); - data.fusedLocationProviderCallback.onFusedLocationProviderResult(FusedLocationProviderResult.SUCCESS); - } catch (RemoteException ignored) { - } - } - } catch (Exception e) { - Log.w(TAG, "Exception in updateLocationRequest", e); - if (data.fusedLocationProviderCallback != null) { - try { - Log.d(TAG, "Send internal error result"); - data.fusedLocationProviderCallback.onFusedLocationProviderResult(FusedLocationProviderResult.create(Status.INTERNAL_ERROR)); - } catch (RemoteException ignored) { - } - } - } - } - - public void setMockMode(boolean mockMode) { - if (!hasMockLocationPermission()) - return; - mockProvider.setMockEnabled(mockMode); - } - - public void setMockLocation(Location mockLocation) { - if (!hasMockLocationPermission()) - return; - mockProvider.setLocation(mockLocation); - } - - private void verifyCurrentRequests() { - handler.removeCallbacks(verifyCurrentRequestsRunnable); - try { - for (int i = 0; i < currentRequests.size(); i++) { - LocationRequestHelper request = currentRequests.get(i); - if (!request.isActive()) { - removeLocationUpdates(request); - i--; - } - } - } catch (Exception e) { - Log.w(TAG, e); - } - handler.postDelayed(verifyCurrentRequestsRunnable, VERIFY_CURRENT_REQUESTS_INTERVAL_MS); - } - - @Override - public void onLocationChanged() { - for (int i = 0; i < currentRequests.size(); i++) { - LocationRequestHelper request = currentRequests.get(i); - if (!request.report(getLocation(request.initialHasFinePermission, request.initialHasCoarsePermission))) { - removeLocationUpdates(request); - i--; - } - } - } - - public void dump(PrintWriter writer) { - if (gpsProvider != null) gpsProvider.dump(writer); - writer.println(currentRequests.size() + " requests:"); - for (LocationRequestHelper request : currentRequests) { - writer.println(" " + request.id + " package=" + request.packageName + " interval=" + request.locationRequest.getInterval() + " smallestDisplacement=" + request.locationRequest.getSmallestDisplacement()); - } - } -} diff --git a/play-services-core/src/main/java/org/microg/gms/location/GoogleLocationManagerService.java b/play-services-core/src/main/java/org/microg/gms/location/GoogleLocationManagerService.java deleted file mode 100644 index 0f2a7e20..00000000 --- a/play-services-core/src/main/java/org/microg/gms/location/GoogleLocationManagerService.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES 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.os.RemoteException; - -import com.google.android.gms.common.internal.GetServiceRequest; -import com.google.android.gms.common.internal.IGmsCallbacks; - -import org.microg.gms.BaseService; -import org.microg.gms.common.GmsService; - -import java.io.FileDescriptor; -import java.io.PrintWriter; - -public class GoogleLocationManagerService extends BaseService { - private final GoogleLocationManagerServiceImpl impl = new GoogleLocationManagerServiceImpl(this, getLifecycle()); - - public GoogleLocationManagerService() { - super("LocationManager", GmsService.LOCATION_MANAGER, GmsService.GEODATA, GmsService.PLACE_DETECTION); - } - - @Override - public void handleServiceRequest(IGmsCallbacks callback, GetServiceRequest request, GmsService service) throws RemoteException { - - } - - @Override - protected void dump(FileDescriptor fd, PrintWriter writer, String[] args) { - impl.getLocationManager().dump(writer); - } -} diff --git a/play-services-core/src/main/java/org/microg/gms/location/GoogleLocationManagerServiceImpl.java b/play-services-core/src/main/java/org/microg/gms/location/GoogleLocationManagerServiceImpl.java deleted file mode 100644 index 8169a4c7..00000000 --- a/play-services-core/src/main/java/org/microg/gms/location/GoogleLocationManagerServiceImpl.java +++ /dev/null @@ -1,429 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES 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.Context; -import android.location.Location; -import android.os.Binder; -import android.os.Handler; -import android.os.IBinder; -import android.os.Looper; -import android.os.Parcel; -import android.os.RemoteException; -import android.util.Log; - -import androidx.annotation.NonNull; -import androidx.lifecycle.Lifecycle; -import androidx.lifecycle.LifecycleOwner; - -import com.google.android.gms.common.api.Status; -import com.google.android.gms.common.api.internal.IStatusCallback; -import com.google.android.gms.location.ActivityRecognitionResult; -import com.google.android.gms.location.GeofencingRequest; -import com.google.android.gms.location.GestureRequest; -import com.google.android.gms.location.ILocationListener; -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.LocationSettingsResult; -import com.google.android.gms.location.LocationSettingsStates; -import com.google.android.gms.location.internal.DeviceOrientationRequestUpdateData; -import com.google.android.gms.location.internal.IGeofencerCallbacks; -import com.google.android.gms.location.internal.IGoogleLocationManagerService; -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.internal.ParcelableGeofence; -import com.google.android.gms.location.places.AutocompleteFilter; -import com.google.android.gms.location.places.NearbyAlertRequest; -import com.google.android.gms.location.places.PlaceFilter; -import com.google.android.gms.location.places.PlaceReport; -import com.google.android.gms.location.places.PlaceRequest; -import com.google.android.gms.location.places.UserAddedPlace; -import com.google.android.gms.location.places.UserDataType; -import com.google.android.gms.location.places.internal.IPlacesCallbacks; -import com.google.android.gms.location.places.internal.PlacesParams; -import com.google.android.gms.maps.model.LatLng; -import com.google.android.gms.maps.model.LatLngBounds; - -import org.microg.gms.common.PackageUtils; - -import java.util.Arrays; -import java.util.List; - -public class GoogleLocationManagerServiceImpl extends IGoogleLocationManagerService.Stub implements LifecycleOwner { - private static final String TAG = "GmsLocManagerSvcImpl"; - - private final Context context; - private final Lifecycle lifecycle; - private GoogleLocationManager locationManager; - - public GoogleLocationManagerServiceImpl(Context context, Lifecycle lifecycle) { - this.context = context; - this.lifecycle = lifecycle; - } - - @NonNull - @Override - public Lifecycle getLifecycle() { - return lifecycle; - } - - public void invokeOnceReady(Runnable runnable) { - getLocationManager().invokeOnceReady(runnable); - } - - public synchronized GoogleLocationManager getLocationManager() { - if (locationManager == null) - locationManager = new GoogleLocationManager(context, lifecycle); - return locationManager; - } - - @Override - public void addGeofencesList(List geofences, PendingIntent pendingIntent, - IGeofencerCallbacks callbacks, String packageName) throws RemoteException { - Log.d(TAG, "addGeofencesList: " + geofences); - PackageUtils.checkPackageUid(context, packageName, Binder.getCallingUid()); - } - - @Override - public void removeGeofencesByIntent(PendingIntent pendingIntent, IGeofencerCallbacks callbacks, - String packageName) throws RemoteException { - Log.d(TAG, "removeGeofencesByIntent: " + pendingIntent); - PackageUtils.checkPackageUid(context, packageName, Binder.getCallingUid()); - } - - @Override - public void removeGeofencesById(String[] geofenceRequestIds, IGeofencerCallbacks callbacks, - String packageName) throws RemoteException { - Log.d(TAG, "removeGeofencesById: " + Arrays.toString(geofenceRequestIds)); - PackageUtils.checkPackageUid(context, packageName, Binder.getCallingUid()); - } - - @Override - public void removeAllGeofences(IGeofencerCallbacks callbacks, String packageName) throws RemoteException { - Log.d(TAG, "removeAllGeofences"); - PackageUtils.checkPackageUid(context, packageName, Binder.getCallingUid()); - } - - @Override - public void requestActivityUpdates(long detectionIntervalMillis, boolean alwaysTrue, - PendingIntent callbackIntent) throws RemoteException { - Log.d(TAG, "requestActivityUpdates: " + callbackIntent); - } - - @Override - public void removeActivityUpdates(PendingIntent callbackIntent) throws RemoteException { - Log.d(TAG, "removeActivityUpdates: " + callbackIntent); - } - - @Override - public ActivityRecognitionResult getLastActivity(String packageName) throws RemoteException { - Log.d(TAG, "getLastActivity"); - PackageUtils.checkPackageUid(context, packageName, Binder.getCallingUid()); - return null; - } - - @Override - public Status requestGestureUpdates(GestureRequest request, PendingIntent pendingIntent) throws RemoteException { - Log.d(TAG, "requestGestureUpdates"); - return null; - } - - @Override - public Status iglms61(PendingIntent pendingIntent) throws RemoteException { - Log.d(TAG, "iglms61"); - return null; - } - - @Override - public Location getLastLocation() throws RemoteException { - Log.d(TAG, "getLastLocation"); - return getLocationManager().getLastLocation(PackageUtils.getCallingPackage(context)); - } - - @Override - public void requestLocationUpdatesWithListener(LocationRequest request, - final ILocationListener listener) throws RemoteException { - Log.d(TAG, "requestLocationUpdatesWithListener: " + request); - getLocationManager().requestLocationUpdates(request, listener, PackageUtils.getCallingPackage(context)); - } - - @Override - public void requestLocationUpdatesWithIntent(LocationRequest request, - PendingIntent callbackIntent) throws RemoteException { - Log.d(TAG, "requestLocationUpdatesWithIntent: " + request); - getLocationManager().requestLocationUpdates(request, callbackIntent, PackageUtils.packageFromPendingIntent(callbackIntent)); - } - - @Override - public void removeLocationUpdatesWithListener(ILocationListener listener) - throws RemoteException { - Log.d(TAG, "removeLocationUpdatesWithListener: " + listener); - getLocationManager().removeLocationUpdates(listener, PackageUtils.getCallingPackage(context)); - } - - @Override - public void removeLocationUpdatesWithIntent(PendingIntent callbackIntent) - throws RemoteException { - Log.d(TAG, "removeLocationUpdatesWithIntent: " + callbackIntent); - getLocationManager().removeLocationUpdates(callbackIntent, PackageUtils.packageFromPendingIntent(callbackIntent)); - } - - @Override - public void updateLocationRequest(LocationRequestUpdateData locationRequestUpdateData) throws RemoteException { - Log.d(TAG, "updateLocationRequest: " + locationRequestUpdateData); - getLocationManager().updateLocationRequest(locationRequestUpdateData); - } - - @Override - public void setMockMode(boolean mockMode) throws RemoteException { - Log.d(TAG, "setMockMode: " + mockMode); - getLocationManager().setMockMode(mockMode); - } - - @Override - public void setMockLocation(Location mockLocation) throws RemoteException { - Log.d(TAG, "setMockLocation: " + mockLocation); - getLocationManager().setMockLocation(mockLocation); - } - - @Override - public void injectLocation(Location mockLocation, int injectionType) throws RemoteException { - Log.d(TAG, "injectLocation[" + injectionType + "]: " + mockLocation); - } - - @Override - public void iglms14(LatLngBounds var1, int var2, PlaceFilter var3, PlacesParams var4, - IPlacesCallbacks var5) throws RemoteException { - Log.d(TAG, "iglms14: " + var1); - } - - @Override - public void iglms15(String var1, PlacesParams var2, IPlacesCallbacks var3) - throws RemoteException { - Log.d(TAG, "iglms15: " + var1); - } - - @Override - public void iglms16(LatLng var1, PlaceFilter var2, PlacesParams var3, IPlacesCallbacks var4) - throws RemoteException { - Log.d(TAG, "iglms16: " + var1); - } - - @Override - public void iglms17(PlaceFilter var1, PlacesParams var2, IPlacesCallbacks var3) - throws RemoteException { - Log.d(TAG, "iglms17: " + var1); - } - - @Override - public void iglms18(PlaceRequest var1, PlacesParams var2, PendingIntent var3) - throws RemoteException { - Log.d(TAG, "iglms18: " + var1); - } - - @Override - public void iglms19(PlacesParams var1, PendingIntent var2) throws RemoteException { - Log.d(TAG, "iglms19: " + var1); - } - - @Override - public void requestLocationUpdatesWithPackage(LocationRequest request, ILocationListener listener, - String packageName) throws RemoteException { - Log.d(TAG, "requestLocationUpdatesWithPackage: " + request); - PackageUtils.checkPackageUid(context, packageName, Binder.getCallingUid()); - getLocationManager().requestLocationUpdates(request, listener, packageName); - } - - @Override - public Location getLastLocationWithPackage(String packageName) throws RemoteException { - Log.d(TAG, "getLastLocationWithPackage: " + packageName); - PackageUtils.checkPackageUid(context, packageName, Binder.getCallingUid()); - return getLocationManager().getLastLocation(packageName); - } - - @Override - public Location getLastLocationWith(String s) throws RemoteException { - Log.d(TAG, "getLastLocationWith: " + s); - return getLastLocation(); - } - - @Override - public void iglms25(PlaceReport var1, PlacesParams var2) throws RemoteException { - Log.d(TAG, "iglms25: " + var1); - } - - @Override - public LocationAvailability getLocationAvailabilityWithPackage(String packageName) throws RemoteException { - Log.d(TAG, "getLocationAvailabilityWithPackage: " + packageName); - PackageUtils.checkPackageUid(context, packageName, Binder.getCallingUid()); - return new LocationAvailability(); - } - - @Override - public void removeSleepSegmentUpdates(PendingIntent pendingIntent, IStatusCallback callback) throws RemoteException { - Log.d(TAG, "removeSleepSegmentUpdates"); - } - - @Override - public void iglms42(String var1, PlacesParams var2, IPlacesCallbacks var3) - throws RemoteException { - Log.d(TAG, "iglms42: " + var1); - } - - @Override - public void iglms46(UserAddedPlace var1, PlacesParams var2, IPlacesCallbacks var3) - throws RemoteException { - Log.d(TAG, "iglms46: " + var1); - } - - @Override - public void iglms47(LatLngBounds var1, int var2, String var3, PlaceFilter var4, - PlacesParams var5, IPlacesCallbacks var6) throws RemoteException { - Log.d(TAG, "iglms47: " + var1); - } - - @Override - public void iglms48(NearbyAlertRequest var1, PlacesParams var2, PendingIntent var3) - throws RemoteException { - Log.d(TAG, "iglms48: " + var1); - } - - @Override - public void iglms49(PlacesParams var1, PendingIntent var2) throws RemoteException { - Log.d(TAG, "iglms49: " + var1); - } - - @Override - public void iglms50(UserDataType var1, LatLngBounds var2, List var3, PlacesParams var4, - IPlacesCallbacks var5) throws RemoteException { - Log.d(TAG, "iglms50: " + var1); - } - - @Override - public IBinder iglms51() throws RemoteException { - Log.d(TAG, "iglms51"); - return null; - } - - @Override - public void requestLocationSettingsDialog(LocationSettingsRequest settingsRequest, ISettingsCallbacks callback, String packageName) throws RemoteException { - Log.d(TAG, "requestLocationSettingsDialog: " + settingsRequest); - PackageUtils.getAndCheckCallingPackage(context, packageName); - (new Handler(Looper.getMainLooper())).post(() -> { - try { - callback.onLocationSettingsResult(new LocationSettingsResult(new LocationSettingsStates(true, true, true, true, true, true), Status.SUCCESS)); - } catch (RemoteException e) { - Log.w(TAG, e); - } - }); - } - - @Override - public void removeActivityTransitionUpdates(PendingIntent pendingIntent, IStatusCallback callback) throws RemoteException { - Log.d(TAG, "removeActivityTransitionUpdates"); - } - - @Override - public void updateDeviceOrientationRequest(DeviceOrientationRequestUpdateData request) throws RemoteException { - Log.d(TAG, "updateDeviceOrientationRequest: " + request); - } - - @Override - public boolean setActivityRecognitionMode(int mode) throws RemoteException { - Log.d(TAG, "setActivityRecognitionMode: " + mode); - return false; - } - - @Override - public void requestLocationUpdatesInternalWithListener(LocationRequestInternal request, - ILocationListener listener) throws RemoteException { - Log.d(TAG, "requestLocationUpdatesInternalWithListener: " + request); - getLocationManager().requestLocationUpdates(request.request, listener, PackageUtils.getCallingPackage(context)); - } - - @Override - public void requestLocationUpdatesInternalWithIntent(LocationRequestInternal request, - PendingIntent callbackIntent) throws RemoteException { - Log.d(TAG, "requestLocationUpdatesInternalWithIntent: " + request); - getLocationManager().requestLocationUpdates(request.request, callbackIntent, PackageUtils.packageFromPendingIntent(callbackIntent)); - } - - @Override - public IBinder iglms54() throws RemoteException { - Log.d(TAG, "iglms54"); - return null; - } - - @Override - public void iglms55(String var1, LatLngBounds var2, AutocompleteFilter var3, PlacesParams var4, - IPlacesCallbacks var5) throws RemoteException { - Log.d(TAG, "iglms55: " + var1); - } - - @Override - public void addGeofences(GeofencingRequest geofencingRequest, PendingIntent pendingIntent, - IGeofencerCallbacks callbacks) throws RemoteException { - Log.d(TAG, "addGeofences: " + geofencingRequest); - } - - @Override - public void iglms58(List var1, PlacesParams var2, IPlacesCallbacks var3) - throws RemoteException { - Log.d(TAG, "iglms58: " + var1); - } - - @Override - public void iglms65(PendingIntent pendingIntent, IStatusCallback callback) throws RemoteException { - Log.d(TAG, "iglms65"); - } - - @Override - public void iglms66(PendingIntent pendingIntent, IStatusCallback callback) throws RemoteException { - Log.d(TAG, "iglms66"); - } - - @Override - public void iglms68(PendingIntent pendingIntent, IStatusCallback callback) throws RemoteException { - Log.d(TAG, "iglms68"); - } - - @Override - public void iglms71(IStatusCallback callback) throws RemoteException { - Log.d(TAG, "iglms71"); - } - - @Override - public void iglms76(PendingIntent pendingIntent) throws RemoteException { - Log.d(TAG, "iglms76"); - } - - @Override - public int iglms78() throws RemoteException { - Log.d(TAG, "iglms78"); - return 0; - } - - @Override - public boolean onTransact(int code, Parcel data, Parcel reply, int flags) throws RemoteException { - if (super.onTransact(code, data, reply, flags)) return true; - Log.d(TAG, "onTransact [unknown]: " + code + ", " + data + ", " + flags); - return false; - } -} diff --git a/play-services-core/src/main/java/org/microg/gms/location/LocationChangeListener.java b/play-services-core/src/main/java/org/microg/gms/location/LocationChangeListener.java deleted file mode 100644 index 01129d23..00000000 --- a/play-services-core/src/main/java/org/microg/gms/location/LocationChangeListener.java +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES 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 interface LocationChangeListener { - void onLocationChanged(); -} diff --git a/play-services-core/src/main/java/org/microg/gms/location/LocationRequestHelper.java b/play-services-core/src/main/java/org/microg/gms/location/LocationRequestHelper.java deleted file mode 100644 index 8b4da91c..00000000 --- a/play-services-core/src/main/java/org/microg/gms/location/LocationRequestHelper.java +++ /dev/null @@ -1,242 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES 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 static android.Manifest.permission.ACCESS_COARSE_LOCATION; -import static android.Manifest.permission.ACCESS_FINE_LOCATION; - -import android.annotation.TargetApi; -import android.app.AppOpsManager; -import android.app.PendingIntent; -import android.content.Context; -import android.content.Intent; -import android.content.pm.PackageManager; -import android.location.Location; -import android.os.Binder; -import android.os.Build; -import android.os.RemoteException; -import android.util.Log; - -import com.google.android.gms.location.ILocationCallback; -import com.google.android.gms.location.ILocationListener; -import com.google.android.gms.location.LocationRequest; -import com.google.android.gms.location.LocationResult; -import com.google.android.gms.location.internal.LocationRequestUpdateData; - -import java.util.Arrays; -import java.util.UUID; - -public class LocationRequestHelper { - public static final String TAG = "GmsLocRequestHelper"; - private final Context context; - public final LocationRequest locationRequest; - public final boolean initialHasFinePermission; - public final boolean initialHasCoarsePermission; - public final String packageName; - public final int uid; - private final boolean selfHasAppOpsRights; - public ILocationListener listener; - public PendingIntent pendingIntent; - public ILocationCallback callback; - public String id = UUID.randomUUID().toString(); - - private Location lastReport; - private int numReports = 0; - - private LocationRequestHelper(Context context, LocationRequest locationRequest, String packageName, int uid) { - this.context = context; - this.locationRequest = locationRequest; - this.packageName = packageName; - this.uid = uid; - - this.initialHasFinePermission = context.getPackageManager().checkPermission(ACCESS_FINE_LOCATION, packageName) == PackageManager.PERMISSION_GRANTED; - this.initialHasCoarsePermission = context.getPackageManager().checkPermission(ACCESS_COARSE_LOCATION, packageName) == PackageManager.PERMISSION_GRANTED; - - this.selfHasAppOpsRights = context.getPackageManager().checkPermission("android.permission.UPDATE_APP_OPS_STATS", context.getPackageName()) == PackageManager.PERMISSION_GRANTED; - } - - public LocationRequestHelper(Context context, LocationRequest locationRequest, String packageName, int uid, ILocationListener listener) { - this(context, locationRequest, packageName, uid); - this.listener = listener; - } - - public LocationRequestHelper(Context context, LocationRequest locationRequest, String packageName, int uid, PendingIntent pendingIntent) { - this(context, locationRequest, packageName, uid); - this.pendingIntent = pendingIntent; - } - - public LocationRequestHelper(Context context, String packageName, int uid, LocationRequestUpdateData data) { - this(context, data.request.request, packageName, uid); - this.listener = data.listener; - this.pendingIntent = data.pendingIntent; - this.callback = data.callback; - } - - public boolean isActive() { - if (!hasCoarsePermission()) return false; - if (listener != null) { - try { - return listener.asBinder().isBinderAlive(); - } catch (Exception e) { - return false; - } - } else if (pendingIntent != null) { - return true; - } else if (callback != null) { - try { - return callback.asBinder().isBinderAlive(); - } catch (Exception e) { - return false; - } - } else { - return false; - } - } - - /** - * @return whether to continue sending reports to this {@link LocationRequestHelper} - */ - public boolean report(Location location) { - if (location == null) return true; - if (!isActive()) return false; - if (lastReport != null) { - if (location.equals(lastReport)) { - return true; - } - if (location.getTime() - lastReport.getTime() < locationRequest.getFastestInterval()) { - return true; - } - if (location.distanceTo(lastReport) < locationRequest.getSmallestDisplacement()) { - return true; - } - } - lastReport = new Location(location); - lastReport.setProvider("fused"); - Log.d(TAG, "sending Location: " + location + " to " + packageName); - if (listener != null) { - try { - listener.onLocationChanged(lastReport); - } catch (RemoteException e) { - return false; - } - } else if (pendingIntent != null) { - Intent intent = new Intent(); - intent.putExtra("com.google.android.location.LOCATION", lastReport); - try { - pendingIntent.send(context, 0, intent); - } catch (PendingIntent.CanceledException e) { - return false; - } - } else if (callback != null) { - try { - callback.onLocationResult(LocationResult.create(Arrays.asList(lastReport))); - } catch (RemoteException e) { - return false; - } - } - numReports++; - return numReports < locationRequest.getNumUpdates(); - } - - @Override - public String toString() { - return "LocationRequestHelper{" + - "locationRequest=" + locationRequest + - ", hasFinePermission=" + hasFinePermission() + - ", hasCoarsePermission=" + hasCoarsePermission() + - ", packageName='" + packageName + '\'' + - ", lastReport=" + lastReport + - '}'; - } - - public boolean respondsTo(ILocationListener listener) { - return this.listener != null && listener != null && - this.listener.asBinder().equals(listener.asBinder()); - } - - public boolean respondsTo(ILocationCallback callback) { - return this.callback != null && callback != null && - this.callback.asBinder().equals(callback.asBinder()); - } - - public boolean respondsTo(PendingIntent pendingIntent) { - return this.pendingIntent != null && this.pendingIntent.equals(pendingIntent); - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - LocationRequestHelper that = (LocationRequestHelper) o; - - if (!locationRequest.equals(that.locationRequest)) return false; - if (packageName != null ? !packageName.equals(that.packageName) : that.packageName != null) return false; - if (listener != null ? !listener.equals(that.listener) : that.listener != null) return false; - if (pendingIntent != null ? !pendingIntent.equals(that.pendingIntent) : that.pendingIntent != null) - return false; - return !(callback != null ? !callback.equals(that.callback) : that.callback != null); - } - - public boolean hasFinePermission() { - if (Build.VERSION.SDK_INT >= 19) { - return isAppOpsAllowed(AppOpsManager.OPSTR_FINE_LOCATION, initialHasFinePermission); - } else { - return initialHasFinePermission; - } - } - - public boolean hasCoarsePermission() { - if (Build.VERSION.SDK_INT >= 19) { - return isAppOpsAllowed(AppOpsManager.OPSTR_COARSE_LOCATION, initialHasCoarsePermission); - } else { - return initialHasCoarsePermission; - } - } - - @TargetApi(19) - private boolean isAppOpsAllowed(String op, boolean def) { - AppOpsManager appOpsManager = (AppOpsManager) context.getSystemService(Context.APP_OPS_SERVICE); - if (appOpsManager == null) return def; - try { - if (Binder.getCallingUid() == uid && Build.VERSION.SDK_INT >= 23) { - return appOpsManager.noteProxyOpNoThrow(op, packageName) == AppOpsManager.MODE_ALLOWED; - } else if (Build.VERSION.SDK_INT >= 29) { - return appOpsManager.noteProxyOpNoThrow(op, packageName, uid) == AppOpsManager.MODE_ALLOWED; - } else if (selfHasAppOpsRights) { - return appOpsManager.noteOpNoThrow(op, uid, packageName) == AppOpsManager.MODE_ALLOWED; - } else { - // TODO: More variant that works pre-29 and without perms? - Log.w(TAG, "Can't check appops (yet)"); - return def; - } - } catch (Exception e) { - Log.w(TAG, e); - return def; - } - } - - @Override - public int hashCode() { - int result = locationRequest.hashCode(); - result = 31 * result + (packageName != null ? packageName.hashCode() : 0); - result = 31 * result + (listener != null ? listener.hashCode() : 0); - result = 31 * result + (pendingIntent != null ? pendingIntent.hashCode() : 0); - result = 31 * result + (callback != null ? callback.hashCode() : 0); - return result; - } -} diff --git a/play-services-core/src/main/java/org/microg/gms/location/MockLocationProvider.java b/play-services-core/src/main/java/org/microg/gms/location/MockLocationProvider.java deleted file mode 100644 index b8d90223..00000000 --- a/play-services-core/src/main/java/org/microg/gms/location/MockLocationProvider.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES 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 static org.microg.gms.location.LocationConstants.KEY_MOCK_LOCATION; - -import android.location.Location; -import android.os.Bundle; - -public class MockLocationProvider { - private boolean mockEnabled = false; - private Location mockLocation = null; - private final LocationChangeListener changeListener; - - public MockLocationProvider(LocationChangeListener changeListener) { - this.changeListener = changeListener; - } - - public void setMockEnabled(boolean mockEnabled) { - this.mockEnabled = mockEnabled; - } - - public Location getLocation() { - return mockEnabled ? mockLocation : null; - } - - public void setLocation(Location mockLocation) { - if (mockLocation.getExtras() == null) { - mockLocation.setExtras(new Bundle()); - } - mockLocation.getExtras().putBoolean(KEY_MOCK_LOCATION, false); - this.mockLocation = mockLocation; - this.changeListener.onLocationChanged(); - } -} diff --git a/play-services-core/src/main/java/org/microg/gms/location/RealLocationProvider.java b/play-services-core/src/main/java/org/microg/gms/location/RealLocationProvider.java deleted file mode 100644 index c8e0a075..00000000 --- a/play-services-core/src/main/java/org/microg/gms/location/RealLocationProvider.java +++ /dev/null @@ -1,167 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES 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.location.Location; -import android.location.LocationListener; -import android.location.LocationManager; -import android.os.Bundle; -import android.os.Looper; -import android.util.Log; - -import java.io.PrintWriter; -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.atomic.AtomicBoolean; - -@SuppressWarnings("MissingPermission") -public class RealLocationProvider { - public static final String TAG = "GmsLocProviderReal"; - private static final int MIN_GPS_TIME = 10000; - - private final LocationManager locationManager; - private final String name; - private final AtomicBoolean connected = new AtomicBoolean(false); - private final LocationChangeListener changeListener; - - private long connectedMinTime; - private float connectedMinDistance; - private Location lastLocation; - private final List requests = new ArrayList(); - private final LocationListener listener = new LocationListener() { - @Override - public void onLocationChanged(Location location) { - lastLocation = new Location(location); - try { - lastLocation.getExtras().keySet(); // call to unparcel() - } catch (Exception e) { - // Sometimes we need to define the correct ClassLoader before unparcel(). Ignore those. - } - changeListener.onLocationChanged(); - } - - @Override - public void onStatusChanged(String s, int i, Bundle bundle) { - - } - - @Override - public void onProviderEnabled(String s) { - - } - - @Override - public void onProviderDisabled(String s) { - - } - }; - - public RealLocationProvider(LocationManager locationManager, String name, LocationChangeListener changeListener) { - this.locationManager = locationManager; - this.name = name; - this.changeListener = changeListener; - updateLastLocation(); - } - - private void updateLastLocation() { - Location newLocation = locationManager.getLastKnownLocation(name); - if (newLocation != null) lastLocation = newLocation; - } - - public void invokeOnceReady(Runnable runnable) { - // Always ready - runnable.run(); - } - - public Location getLastLocation() { - if (!connected.get()) { - updateLastLocation(); - } - if (lastLocation == null) { - Log.d(TAG, "uh-ok: last location for " + name + " is null!"); - } - return lastLocation; - } - - public void addRequest(LocationRequestHelper request) { - Log.d(TAG, name + ": addRequest " + request); - for (int i = 0; i < requests.size(); i++) { - LocationRequestHelper req = requests.get(i); - if (req.respondsTo(request.pendingIntent) || req.respondsTo(request.listener) || req.respondsTo(request.callback)) { - requests.remove(i); - i--; - } - } - requests.add(request); - updateConnection(); - } - - public void removeRequest(LocationRequestHelper request) { - Log.d(TAG, name + ": removeRequest " + request); - requests.remove(request); - updateConnection(); - } - - private synchronized void updateConnection() { - if (connected.get() && requests.isEmpty()) { - Log.d(TAG, name + ": no longer requesting location update"); - locationManager.removeUpdates(listener); - connected.set(false); - } else if (!requests.isEmpty()) { - long minTime = Long.MAX_VALUE; - float minDistance = Float.MAX_VALUE; - StringBuilder sb = new StringBuilder(); - for (LocationRequestHelper request : requests) { - minTime = Math.min(request.locationRequest.getInterval(), minTime); - minDistance = Math.min(request.locationRequest.getSmallestDisplacement(), minDistance); - if (sb.length() != 0) sb.append(", "); - sb.append(request.packageName).append(":").append(request.locationRequest.getInterval()).append("ms"); - } - if (minTime > MIN_GPS_TIME && name.equals("gps")) { - Log.d(TAG, name + ": ignoring request as " + minTime + "ms (" + sb + "), is less than " + MIN_GPS_TIME); - locationManager.removeUpdates(listener); - connected.set(false); - return; - } - Log.d(TAG, name + ": requesting location updates with interval " + minTime + "ms (" + sb + "), minDistance=" + minDistance); - if (connected.get()) { - if (connectedMinTime != minTime || connectedMinDistance != minDistance) { - locationManager.removeUpdates(listener); - locationManager.requestLocationUpdates(name, minTime, minDistance, listener, - Looper.getMainLooper()); - } - } else { - locationManager.requestLocationUpdates(name, minTime, minDistance, listener, Looper.getMainLooper()); - } - connected.set(true); - connectedMinTime = minTime; - connectedMinDistance = minDistance; - } - } - - public void dump(PrintWriter writer) { - if (writer != null) { - writer.println(name + " provider:"); - writer.println(" last location: " + lastLocation); - writer.println(" active: " + connected.get()); - if (connected.get()) { - writer.println(" interval: " + connectedMinTime); - writer.println(" distance: " + connectedMinDistance); - } - } - } -} diff --git a/play-services-core/src/main/java/org/microg/gms/location/ReportingAndroidService.java b/play-services-core/src/main/java/org/microg/gms/location/ReportingAndroidService.java deleted file mode 100644 index d9c5bda1..00000000 --- a/play-services-core/src/main/java/org/microg/gms/location/ReportingAndroidService.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES 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.os.RemoteException; - -import com.google.android.gms.common.internal.GetServiceRequest; -import com.google.android.gms.common.internal.IGmsCallbacks; - -import org.microg.gms.BaseService; -import org.microg.gms.common.GmsService; - -public class ReportingAndroidService extends BaseService { - private final ReportingServiceImpl reportingService = new ReportingServiceImpl(); - - public ReportingAndroidService() { - super("GmsLocReportingSvc", GmsService.LOCATION_REPORTING); - } - - @Override - public void handleServiceRequest(IGmsCallbacks callback, GetServiceRequest request, GmsService service) throws RemoteException { - callback.onPostInitComplete(0, reportingService.asBinder(), null); - } -} diff --git a/play-services-core/src/main/java/org/microg/gms/location/ReportingServiceImpl.java b/play-services-core/src/main/java/org/microg/gms/location/ReportingServiceImpl.java deleted file mode 100644 index f369f84e..00000000 --- a/play-services-core/src/main/java/org/microg/gms/location/ReportingServiceImpl.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES 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.accounts.Account; -import android.os.Parcel; -import android.os.RemoteException; -import android.util.Log; - -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; -import com.google.android.gms.location.reporting.internal.IReportingService; - -public class ReportingServiceImpl extends IReportingService.Stub { - private static final String TAG = "GmsLocReportSvcImpl"; - - @Override - public ReportingState getReportingState(Account account) throws RemoteException { - Log.d(TAG, "getReportingState"); - return new ReportingState(); - } - - @Override - public int tryOptIn(Account account) throws RemoteException { - Log.d(TAG, "tryOptIn"); - return 0; - } - - @Override - public UploadRequestResult requestUpload(UploadRequest request) throws RemoteException { - Log.d(TAG, "requestUpload"); - return new UploadRequestResult(); - } - - @Override - public int cancelUploadRequest(long l) throws RemoteException { - Log.d(TAG, "cancelUploadRequest"); - return 0; - } - - @Override - public int reportDeviceAtPlace(Account account, PlaceReport report) throws RemoteException { - Log.d(TAG, "reportDeviceAtPlace"); - return 0; - } - - - @Override - public boolean onTransact(int code, Parcel data, Parcel reply, int flags) throws RemoteException { - if (super.onTransact(code, data, reply, flags)) { - return true; - } - - Log.d(TAG, "onTransact [unknown]: " + code + ", " + data + ", " + flags); - return false; - } -} diff --git a/play-services-core/src/main/java/org/microg/gms/mdm/NetworkQualityService.java b/play-services-core/src/main/java/org/microg/gms/mdm/NetworkQualityService.java deleted file mode 100644 index b999101b..00000000 --- a/play-services-core/src/main/java/org/microg/gms/mdm/NetworkQualityService.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES 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.mdm; - -import android.app.Service; -import android.content.Intent; -import android.os.IBinder; -import android.util.Log; - -public class NetworkQualityService extends Service { - private static final String TAG = "GmsMdmQualitySvc"; - - @Override - public IBinder onBind(Intent intent) { - Log.d(TAG, "onBind: " + intent); - return null; - } -} diff --git a/play-services-core/src/main/java/org/microg/gms/phenotype/ConfigurationProvider.java b/play-services-core/src/main/java/org/microg/gms/phenotype/ConfigurationProvider.java deleted file mode 100644 index 19ab1207..00000000 --- a/play-services-core/src/main/java/org/microg/gms/phenotype/ConfigurationProvider.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (C) 2018 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES 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.phenotype; - -import android.content.ContentProvider; -import android.content.ContentValues; -import android.database.Cursor; -import android.database.MatrixCursor; -import android.net.Uri; -import android.util.Log; - -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; - -public class ConfigurationProvider extends ContentProvider { - private static final String TAG = "GmsPhenotypeCfgProvider"; - @Override - public boolean onCreate() { - Log.d(TAG, "unimplemented Method: onCreate"); - return false; - } - - @Nullable - @Override - public Cursor query(@NonNull Uri uri, @Nullable String[] projection, @Nullable String selection, @Nullable String[] selectionArgs, @Nullable String sortOrder) { - selection = Uri.decode(uri.getLastPathSegment()); - if (selection == null) return null; - return new MatrixCursor(new String[]{"key", "value"}); - } - - @Nullable - @Override - public String getType(@NonNull Uri uri) { - return null; - } - - @Nullable - @Override - public Uri insert(@NonNull Uri uri, @Nullable ContentValues contentValues) { - throw new UnsupportedOperationException(); - } - - @Override - public int delete(@NonNull Uri uri, @Nullable String s, @Nullable String[] strings) { - throw new UnsupportedOperationException(); - } - - @Override - public int update(@NonNull Uri uri, @Nullable ContentValues contentValues, @Nullable String s, @Nullable String[] strings) { - throw new UnsupportedOperationException(); - } -} diff --git a/play-services-core/src/main/java/org/microg/gms/playlog/PlayLogService.java b/play-services-core/src/main/java/org/microg/gms/playlog/PlayLogService.java deleted file mode 100644 index 1ee8a893..00000000 --- a/play-services-core/src/main/java/org/microg/gms/playlog/PlayLogService.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES 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.playlog; - -import android.os.RemoteException; - -import com.google.android.gms.common.internal.GetServiceRequest; -import com.google.android.gms.common.internal.IGmsCallbacks; - -import org.microg.gms.BaseService; -import org.microg.gms.common.GmsService; - -@Deprecated -public class PlayLogService extends BaseService { - - private final PlayLogServiceImpl playLogService = new PlayLogServiceImpl(); - - public PlayLogService() { - super("GmsPlayLogSvc", GmsService.PLAY_LOG); - } - - @Override - public void handleServiceRequest(IGmsCallbacks callback, GetServiceRequest request, GmsService service) throws RemoteException { - callback.onPostInitComplete(0, playLogService.asBinder(), null); - } -} diff --git a/play-services-core/src/main/java/org/microg/gms/playlog/PlayLogServiceImpl.java b/play-services-core/src/main/java/org/microg/gms/playlog/PlayLogServiceImpl.java deleted file mode 100644 index 833b264c..00000000 --- a/play-services-core/src/main/java/org/microg/gms/playlog/PlayLogServiceImpl.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES 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.playlog; - -import android.os.Parcel; -import android.os.RemoteException; -import android.util.Log; - -import com.google.android.gms.clearcut.internal.PlayLoggerContext; -import com.google.android.gms.playlog.internal.IPlayLogService; -import com.google.android.gms.playlog.internal.LogEvent; - -import java.util.List; - -@Deprecated -public class PlayLogServiceImpl extends IPlayLogService.Stub { - private static final String TAG = "GmsPlayLogSvcImpl"; - - @Override - public void onEvent(String packageName, PlayLoggerContext context, LogEvent event) throws RemoteException { - Log.d(TAG, "onEvent: context[packageName]:" + context.packageName + " event[tag]:" + event.tag); - } - - @Override - public void onMultiEvent(String packageName, PlayLoggerContext context, List events) throws RemoteException { - for (LogEvent event : events) { - onEvent(packageName, context, event); - } - } - - @Override - public boolean onTransact(int code, Parcel data, Parcel reply, int flags) throws RemoteException { - if (super.onTransact(code, data, reply, flags)) return true; - Log.d(TAG, "onTransact [unknown]: " + code + ", " + data + ", " + flags); - return false; - } -} diff --git a/play-services-core/src/main/java/org/microg/gms/ui/AboutFragment.java b/play-services-core/src/main/java/org/microg/gms/ui/AboutFragment.java index c27b40cb..a9bb73e6 100755 --- a/play-services-core/src/main/java/org/microg/gms/ui/AboutFragment.java +++ b/play-services-core/src/main/java/org/microg/gms/ui/AboutFragment.java @@ -27,11 +27,12 @@ public class AboutFragment extends AbstractAboutFragment { @Override protected void collectLibraries(List libraries) { + libraries.add(new AbstractAboutFragment.Library("org.oscim.android", "V™", "GNU LGPLv3, Hannes Janetzek and devemux86")); libraries.add(new AbstractAboutFragment.Library("de.hdodenhof.circleimageview", "CircleImageView", "Apache License 2.0, Henning Dodenhof")); - libraries.add(new AbstractAboutFragment.Library("su.litvak.chromecast.api.v2", "ChromeCast Java API v2", "Apache License 2.0, Vitaly Litvak")); libraries.add(new AbstractAboutFragment.Library("org.conscrypt", "Conscrypt", "Apache License 2.0, The Android Open Source Project")); - libraries.add(new AbstractAboutFragment.Library("org.chromium.net", "Cronet", "BSD-style License, The Chromium Authors")); libraries.add(new AbstractAboutFragment.Library("org.microg.safeparcel", "SafeParcel", "Apache License 2.0, microG Team")); + libraries.add(new AbstractAboutFragment.Library("org.slf4j", "SLF4J", "MIT License, QOS.ch")); + libraries.add(new AbstractAboutFragment.Library("com.android.volley", "Volley", "Apache License 2.0, The Android Open Source Project")); libraries.add(new AbstractAboutFragment.Library("com.squareup.wire", "Wire Protocol Buffers", "Apache License 2.0, Square Inc.")); } diff --git a/play-services-core/src/main/java/org/microg/gms/ui/AccountSettingsActivity.java b/play-services-core/src/main/java/org/microg/gms/ui/AccountSettingsActivity.java index f0901aec..fa099d49 100755 --- a/play-services-core/src/main/java/org/microg/gms/ui/AccountSettingsActivity.java +++ b/play-services-core/src/main/java/org/microg/gms/ui/AccountSettingsActivity.java @@ -16,11 +16,6 @@ package org.microg.gms.ui; -import static android.accounts.AccountManager.PACKAGE_NAME_KEY_LEGACY_NOT_VISIBLE; -import static android.accounts.AccountManager.VISIBILITY_USER_MANAGED_NOT_VISIBLE; -import static android.accounts.AccountManager.VISIBILITY_USER_MANAGED_VISIBLE; -import static org.microg.gms.auth.AuthManager.PREF_AUTH_VISIBLE; - import android.accounts.Account; import android.accounts.AccountManager; import android.os.Build; @@ -36,6 +31,11 @@ import org.microg.gms.auth.AuthConstants; import org.microg.tools.ui.AbstractSettingsActivity; import org.microg.tools.ui.ResourceSettingsFragment; +import static android.accounts.AccountManager.PACKAGE_NAME_KEY_LEGACY_NOT_VISIBLE; +import static android.accounts.AccountManager.VISIBILITY_NOT_VISIBLE; +import static android.accounts.AccountManager.VISIBILITY_VISIBLE; +import static org.microg.gms.auth.AuthManager.PREF_AUTH_VISIBLE; + public class AccountSettingsActivity extends AbstractSettingsActivity { @Override @@ -60,7 +60,7 @@ public class AccountSettingsActivity extends AbstractSettingsActivity { if (newValue instanceof Boolean) { AccountManager am = AccountManager.get(getContext()); for (Account account : am.getAccountsByType(AuthConstants.DEFAULT_ACCOUNT_TYPE)) { - am.setAccountVisibility(account, PACKAGE_NAME_KEY_LEGACY_NOT_VISIBLE, (Boolean) newValue ? VISIBILITY_USER_MANAGED_VISIBLE : VISIBILITY_USER_MANAGED_NOT_VISIBLE); + am.setAccountVisibility(account, PACKAGE_NAME_KEY_LEGACY_NOT_VISIBLE, (Boolean) newValue ? VISIBILITY_VISIBLE : VISIBILITY_NOT_VISIBLE); } } return true; diff --git a/play-services-core/src/main/kotlin/com/google/android/gms/measurement/internal/AppMeasurementDynamiteService.kt b/play-services-core/src/main/kotlin/com/google/android/gms/measurement/internal/AppMeasurementDynamiteService.kt deleted file mode 100644 index a0f3373c..00000000 --- a/play-services-core/src/main/kotlin/com/google/android/gms/measurement/internal/AppMeasurementDynamiteService.kt +++ /dev/null @@ -1,198 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2022 microG Project Team - * SPDX-License-Identifier: Apache-2.0 - */ -package com.google.android.gms.measurement.internal - -import android.os.Bundle -import android.os.Parcelable -import android.util.Log -import com.google.android.gms.dynamic.IObjectWrapper -import com.google.android.gms.measurement.api.internal.* - -private const val TAG = "AppMeasurementService" - -class AppMeasurementDynamiteService : IAppMeasurementDynamiteService.Stub() { - override fun initialize(context: IObjectWrapper?, params: InitializationParams?, timestamp: Long) { - Log.d(TAG, "Not yet implemented: initialize") - } - - override fun logEvent(str: String?, str2: String?, bundle: Bundle?, z: Boolean, z2: Boolean, timestamp: Long) { - Log.d(TAG, "Not yet implemented: logEvent") - } - - override fun logEventAndBundle(str: String?, str2: String?, bundle: Bundle?, receiver: IBundleReceiver?, j: Long) { - Log.d(TAG, "Not yet implemented: logEventAndBundle") - receiver?.onBundle(Bundle().apply { putByteArray("r", ByteArray(0)) }) - } - - override fun setUserProperty(str: String?, str2: String?, obj: IObjectWrapper?, z: Boolean, j: Long) { - Log.d(TAG, "Not yet implemented: setUserProperty") - } - - override fun getUserProperties(str: String?, str2: String?, z: Boolean, receiver: IBundleReceiver?) { - Log.d(TAG, "Not yet implemented: getUserProperties") - receiver?.onBundle(Bundle()) - } - - override fun getMaxUserProperties(str: String?, receiver: IBundleReceiver?) { - Log.d(TAG, "Not yet implemented: getMaxUserProperties") - receiver?.onBundle(Bundle().apply { putInt("r", 25) }) - } - - override fun setUserId(str: String?, j: Long) { - Log.d(TAG, "Not yet implemented: setUserId") - } - - override fun setConditionalUserProperty(bundle: Bundle?, j: Long) { - Log.d(TAG, "Not yet implemented: setConditionalUserProperty") - } - - override fun clearConditionalUserProperty(str: String?, str2: String?, bundle: Bundle?) { - Log.d(TAG, "Not yet implemented: clearConditionalUserProperty") - } - - override fun getConditionalUserProperties(str: String?, str2: String?, receiver: IBundleReceiver?) { - Log.d(TAG, "Not yet implemented: getConditionalUserProperties") - receiver?.onBundle(Bundle().apply { putParcelableArrayList("r", arrayListOf()) }) - } - - override fun setMeasurementEnabled(z: Boolean, j: Long) { - Log.d(TAG, "Not yet implemented: setMeasurementEnabled") - } - - override fun resetAnalyticsData(j: Long) { - Log.d(TAG, "Not yet implemented: resetAnalyticsData") - } - - override fun setMinimumSessionDuration(j: Long) { - Log.d(TAG, "Not yet implemented: setMinimumSessionDuration") - } - - override fun setSessionTimeoutDuration(j: Long) { - Log.d(TAG, "Not yet implemented: setSessionTimeoutDuration") - } - - override fun setCurrentScreen(obj: IObjectWrapper?, str: String?, str2: String?, j: Long) { - Log.d(TAG, "Not yet implemented: setCurrentScreen") - } - - override fun getCurrentScreenName(receiver: IBundleReceiver?) { - Log.d(TAG, "Not yet implemented: getCurrentScreenName") - } - - override fun getCurrentScreenClass(receiver: IBundleReceiver?) { - Log.d(TAG, "Not yet implemented: getCurrentScreenClass") - } - - override fun setInstanceIdProvider(provider: IStringProvider?) { - Log.d(TAG, "Not yet implemented: setInstanceIdProvider") - } - - override fun getCachedAppInstanceId(receiver: IBundleReceiver?) { - Log.d(TAG, "Not yet implemented: getCachedAppInstanceId") - } - - override fun getAppInstanceId(receiver: IBundleReceiver?) { - Log.d(TAG, "Not yet implemented: getAppInstanceId") - } - - override fun getGmpAppId(receiver: IBundleReceiver?) { - Log.d(TAG, "Not yet implemented: getGmpAppId") - } - - override fun generateEventId(receiver: IBundleReceiver?) { - Log.d(TAG, "Not yet implemented: generateEventId") - } - - override fun beginAdUnitExposure(str: String?, j: Long) { - Log.d(TAG, "Not yet implemented: beginAdUnitExposure") - } - - override fun endAdUnitExposure(str: String?, j: Long) { - Log.d(TAG, "Not yet implemented: endAdUnitExposure") - } - - override fun onActivityStarted(activity: IObjectWrapper?, j: Long) { - Log.d(TAG, "Not yet implemented: onActivityStarted") - } - - override fun onActivityStopped(activity: IObjectWrapper?, j: Long) { - Log.d(TAG, "Not yet implemented: onActivityStopped") - } - - override fun onActivityCreated(activity: IObjectWrapper?, bundle: Bundle?, j: Long) { - Log.d(TAG, "Not yet implemented: onActivityCreated") - } - - override fun onActivityDestroyed(activity: IObjectWrapper?, j: Long) { - Log.d(TAG, "Not yet implemented: onActivityDestroyed") - } - - override fun onActivityPaused(activity: IObjectWrapper?, j: Long) { - Log.d(TAG, "Not yet implemented: onActivityPaused") - } - - override fun onActivityResumed(activity: IObjectWrapper?, j: Long) { - Log.d(TAG, "Not yet implemented: onActivityResumed") - } - - override fun onActivitySaveInstanceState(activity: IObjectWrapper?, receiver: IBundleReceiver?, j: Long) { - Log.d(TAG, "Not yet implemented: onActivitySaveInstanceState") - receiver?.onBundle(Bundle()) - } - - override fun performAction(bundle: Bundle?, receiver: IBundleReceiver?, j: Long) { - Log.d(TAG, "Not yet implemented: performAction") - } - - override fun logHealthData(i: Int, str: String?, obj: IObjectWrapper?, obj2: IObjectWrapper?, obj3: IObjectWrapper?) { - Log.d(TAG, "Not yet implemented: logHealthData") - } - - override fun setEventInterceptor(proxy: IEventHandlerProxy?) { - Log.d(TAG, "Not yet implemented: setEventInterceptor") - } - - override fun registerOnMeasurementEventListener(proxy: IEventHandlerProxy?) { - Log.d(TAG, "Not yet implemented: registerOnMeasurementEventListener") - } - - override fun unregisterOnMeasurementEventListener(proxy: IEventHandlerProxy?) { - Log.d(TAG, "Not yet implemented: unregisterOnMeasurementEventListener") - } - - override fun initForTests(map: MutableMap?) { - Log.d(TAG, "Not yet implemented: initForTests") - } - - override fun getTestFlag(receiver: IBundleReceiver?, i: Int) { - Log.d(TAG, "Not yet implemented: getTestFlag") - } - - override fun setDataCollectionEnabled(z: Boolean) { - Log.d(TAG, "Not yet implemented: setDataCollectionEnabled") - } - - override fun isDataCollectionEnabled(receiver: IBundleReceiver?) { - Log.d(TAG, "Not yet implemented: isDataCollectionEnabled") - receiver?.onBundle(Bundle().apply { putBoolean("r", false) }) - } - - override fun setDefaultEventParameters(bundle: Bundle?) { - Log.d(TAG, "Not yet implemented: setDefaultEventParameters") - } - - override fun setConsent(bundle: Bundle?, j: Long) { - Log.d(TAG, "Not yet implemented: setConsent") - } - - override fun setConsentThirdParty(bundle: Bundle?, j: Long) { - Log.d(TAG, "Not yet implemented: setConsentThirdParty") - } - - override fun clearMeasurementEnabled(j: Long) { - Log.d(TAG, "Not yet implemented: clearMeasurementEnabled") - } - -} diff --git a/play-services-core/src/main/kotlin/org/microg/gms/chimera/ServiceProvider.kt b/play-services-core/src/main/kotlin/org/microg/gms/chimera/ServiceProvider.kt deleted file mode 100644 index 5633c560..00000000 --- a/play-services-core/src/main/kotlin/org/microg/gms/chimera/ServiceProvider.kt +++ /dev/null @@ -1,82 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2020, microG Project Team - * SPDX-License-Identifier: Apache-2.0 - */ - -package org.microg.gms.chimera - -import android.content.ContentProvider -import android.content.ContentValues -import android.content.Intent -import android.database.Cursor -import android.database.MatrixCursor -import android.net.Uri -import android.os.Bundle -import android.util.Log -import androidx.core.os.bundleOf -import org.microg.gms.DummyService -import org.microg.gms.common.GmsService - -class ServiceProvider : ContentProvider() { - - override fun onCreate(): Boolean { - Log.d(TAG, "onCreate") - return true - } - - override fun call(method: String, arg: String?, extras: Bundle?): Bundle? { - when (method) { - "serviceIntentCall" -> { - val serviceAction = extras?.getString("serviceActionBundleKey") ?: return null - val ourServiceAction = GmsService.byAction(serviceAction)?.takeIf { it.SERVICE_ID > 0 }?.ACTION ?: serviceAction - val context = context!! - val intent = Intent(ourServiceAction).apply { `package` = context.packageName } - val resolveInfo = context.packageManager.resolveService(intent, 0) - if (resolveInfo != null) { - intent.setClassName(resolveInfo.serviceInfo.packageName, resolveInfo.serviceInfo.name) - } else { - intent.setClass(context, DummyService::class.java) - } - Log.d(TAG, "$method: $serviceAction -> $intent") - return bundleOf( - "serviceResponseIntentKey" to intent - ) - } - else -> { - Log.d(TAG, "$method: $arg, $extras") - return super.call(method, arg, extras) - } - } - } - - override fun query(uri: Uri, projection: Array?, selection: String?, selectionArgs: Array?, sortOrder: String?): Cursor? { - val cursor = MatrixCursor(COLUMNS) - Log.d(TAG, "query: $uri") - return cursor - } - - override fun insert(uri: Uri, values: ContentValues?): Uri? { - Log.d(TAG, "insert: $uri, $values") - return uri - } - - override fun update(uri: Uri, values: ContentValues?, selection: String?, selectionArgs: Array?): Int { - Log.d(TAG, "update: $uri, $values, $selection, $selectionArgs") - return 0 - } - - override fun delete(uri: Uri, selection: String?, selectionArgs: Array?): Int { - Log.d(TAG, "delete: $uri, $selection, $selectionArgs") - return 0 - } - - override fun getType(uri: Uri): String { - Log.d(TAG, "getType: $uri") - return "vnd.android.cursor.item/com.google.android.gms.chimera" - } - - companion object { - private const val TAG = "ChimeraServiceProvider" - private val COLUMNS = arrayOf("version", "apkPath", "loaderPath", "apkDescStr") - } -} \ No newline at end of file diff --git a/play-services-core/src/main/kotlin/org/microg/gms/clearcut/ClearcutLoggerService.kt b/play-services-core/src/main/kotlin/org/microg/gms/clearcut/ClearcutLoggerService.kt deleted file mode 100644 index 1e0d9b82..00000000 --- a/play-services-core/src/main/kotlin/org/microg/gms/clearcut/ClearcutLoggerService.kt +++ /dev/null @@ -1,79 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2022 microG Project Team - * SPDX-License-Identifier: Apache-2.0 - */ -package org.microg.gms.clearcut - -import android.os.Parcel -import androidx.lifecycle.Lifecycle -import androidx.lifecycle.LifecycleOwner -import androidx.lifecycle.lifecycleScope -import com.google.android.gms.clearcut.LogEventParcelable -import com.google.android.gms.clearcut.internal.IClearcutLoggerCallbacks -import com.google.android.gms.clearcut.internal.IClearcutLoggerService -import com.google.android.gms.common.api.CommonStatusCodes -import com.google.android.gms.common.api.Status -import com.google.android.gms.common.data.DataHolder -import com.google.android.gms.common.internal.GetServiceRequest -import com.google.android.gms.common.internal.IGmsCallbacks -import org.microg.gms.BaseService -import org.microg.gms.common.GmsService -import org.microg.gms.utils.warnOnTransactionIssues - -private const val TAG = "ClearcutLoggerService" -private const val COLLECT_FOR_DEBUG_DURATION = 24L * 60 * 60 * 1000 - -class ClearcutLoggerService : BaseService(TAG, GmsService.CLEARCUT_LOGGER) { - override fun handleServiceRequest(callback: IGmsCallbacks, request: GetServiceRequest, service: GmsService) { - callback.onPostInitComplete(0, ClearcutLoggerServiceImpl(lifecycle), null) - } -} - -class ClearcutLoggerServiceImpl(private val lifecycle: Lifecycle) : IClearcutLoggerService.Stub(), LifecycleOwner { - private var collectForDebugExpiryTime: Long = 0 - - override fun log(callbacks: IClearcutLoggerCallbacks, event: LogEventParcelable) { - lifecycleScope.launchWhenStarted { - callbacks.onLogResult(Status.SUCCESS) - } - } - - override fun forceUpload(callbacks: IClearcutLoggerCallbacks) { - lifecycleScope.launchWhenStarted { - callbacks.onLogResult(Status.SUCCESS) - } - } - - override fun startCollectForDebug(callbacks: IClearcutLoggerCallbacks) { - lifecycleScope.launchWhenStarted { - collectForDebugExpiryTime = System.currentTimeMillis() + COLLECT_FOR_DEBUG_DURATION - callbacks.onStartCollectForDebugResult(Status.SUCCESS, collectForDebugExpiryTime) - } - } - - override fun stopCollectForDebug(callbacks: IClearcutLoggerCallbacks) { - lifecycleScope.launchWhenStarted { - callbacks.onStopCollectForDebugResult(Status.SUCCESS) - } - } - - override fun getCollectForDebugExpiryTime(callbacks: IClearcutLoggerCallbacks) { - lifecycleScope.launchWhenStarted { - callbacks.onCollectForDebugExpiryTime(Status.SUCCESS, collectForDebugExpiryTime) - } - } - - override fun getLogEventParcelablesLegacy(callbacks: IClearcutLoggerCallbacks) { - getLogEventParcelables(callbacks) - } - - override fun getLogEventParcelables(callbacks: IClearcutLoggerCallbacks) { - lifecycleScope.launchWhenStarted { - callbacks.onLogEventParcelables(DataHolder.empty(CommonStatusCodes.SUCCESS)) - } - } - - override fun getLifecycle(): Lifecycle = lifecycle - - override fun onTransact(code: Int, data: Parcel, reply: Parcel?, flags: Int): Boolean = warnOnTransactionIssues(code, reply, flags) { super.onTransact(code, data, reply, flags) } -} diff --git a/play-services-core/src/main/kotlin/org/microg/gms/fonts/FontsProvider.kt b/play-services-core/src/main/kotlin/org/microg/gms/fonts/FontsProvider.kt deleted file mode 100644 index 2ccf28d0..00000000 --- a/play-services-core/src/main/kotlin/org/microg/gms/fonts/FontsProvider.kt +++ /dev/null @@ -1,97 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2020, microG Project Team - * SPDX-License-Identifier: Apache-2.0 - */ - -package org.microg.gms.fonts - -import android.content.ContentProvider -import android.content.ContentValues -import android.database.Cursor -import android.database.MatrixCursor -import android.net.Uri -import android.os.Bundle -import android.os.ParcelFileDescriptor -import android.os.ParcelFileDescriptor.MODE_READ_ONLY -import android.util.Log -import java.io.File - -class FontsProvider : ContentProvider() { - - override fun onCreate(): Boolean { - Log.d(TAG, "onCreate") - return true - } - - override fun call(method: String, arg: String?, extras: Bundle?): Bundle? { - Log.d(TAG, "call $method $arg $extras") - return null - } - - override fun query( - uri: Uri, - projection: Array?, - selection: String?, - selectionArgs: Array?, - sortOrder: String? - ): Cursor { - Log.e(TAG, "query: $uri ${projection?.toList()} $selection ${selectionArgs?.joinToString(prefix = "[", postfix = "]")}") - val cursor = MatrixCursor(COLUMNS) - // We could also return an empty cursor here, but some apps have been reported to crash - // when their expected font is not returned by Google's font provider. - cursor.addRow( - arrayOf( - 1337L, // file_id - 0, // font_ttc_index - null, // font_variation_settings - 400, // font_weight - 0, // font_italic - 0, // result_code: RESULT_CODE_OK - ) - ) - return cursor - } - - override fun insert(uri: Uri, values: ContentValues?): Uri { - Log.d(TAG, "insert: $uri, $values") - return uri - } - - override fun update( - uri: Uri, - values: ContentValues?, - selection: String?, - selectionArgs: Array? - ): Int { - Log.d(TAG, "update: $uri, $values, $selection, $selectionArgs") - return 0 - } - - override fun delete(uri: Uri, selection: String?, selectionArgs: Array?): Int { - Log.d(TAG, "delete: $uri, $selection, $selectionArgs") - return 0 - } - - override fun getType(uri: Uri): String { - Log.d(TAG, "getType: $uri") - return "font/ttf" - } - - override fun openFile(uri: Uri, mode: String): ParcelFileDescriptor? { - Log.d(TAG, "openFile: $uri mode: $mode") - val file = File("/system/fonts/Roboto-Regular.ttf") - return ParcelFileDescriptor.open(file, MODE_READ_ONLY) - } - - companion object { - private const val TAG = "FontsProvider" - private val COLUMNS = arrayOf( - "file_id", - "font_ttc_index", - "font_variation_settings", - "font_weight", - "font_italic", - "result_code" - ) - } -} diff --git a/play-services-core/src/main/kotlin/org/microg/gms/gcm/GcmPrefs.kt b/play-services-core/src/main/kotlin/org/microg/gms/gcm/GcmPrefs.kt index 6f68b5bf..b2402779 100644 --- a/play-services-core/src/main/kotlin/org/microg/gms/gcm/GcmPrefs.kt +++ b/play-services-core/src/main/kotlin/org/microg/gms/gcm/GcmPrefs.kt @@ -11,6 +11,7 @@ import org.microg.gms.gcm.TriggerReceiver.FORCE_TRY_RECONNECT import org.microg.mgms.settings.SettingsContract import org.microg.mgms.settings.SettingsContract.Gcm import org.microg.mgms.settings.SettingsContract.setSettings +import org.microg.mgms.settings.SettingsProvider data class GcmPrefs( val isGcmLogEnabled: Boolean, @@ -36,8 +37,6 @@ data class GcmPrefs( const val PREF_NETWORK_ROAMING = Gcm.NETWORK_ROAMING const val PREF_NETWORK_OTHER = Gcm.NETWORK_OTHER - public const val INTERVAL = 1 * 60 * 1000 // 1 minute - @JvmStatic fun get(context: Context): GcmPrefs { return SettingsContract.getSettings(context, Gcm.getContentUri(context), Gcm.PROJECTION) { c -> @@ -104,13 +103,13 @@ data class GcmPrefs( fun getHeartbeatMsFor(pref: String): Int { return if (PREF_NETWORK_ROAMING == pref) { - if (networkRoaming != 0) networkRoaming * GcmPrefs.INTERVAL else learntMobileInterval + if (networkRoaming != 0) networkRoaming * SettingsProvider.INTERVAL else learntMobileInterval } else if (PREF_NETWORK_MOBILE == pref) { - if (networkMobile != 0) networkMobile * GcmPrefs.INTERVAL else learntMobileInterval + if (networkMobile != 0) networkMobile * SettingsProvider.INTERVAL else learntMobileInterval } else if (PREF_NETWORK_WIFI == pref) { - if (networkWifi != 0) networkWifi * GcmPrefs.INTERVAL else learntWifiInterval + if (networkWifi != 0) networkWifi * SettingsProvider.INTERVAL else learntWifiInterval } else { - if (networkOther != 0) networkOther * GcmPrefs.INTERVAL else learntOtherInterval + if (networkOther != 0) networkOther * SettingsProvider.INTERVAL else learntOtherInterval } } @@ -138,21 +137,21 @@ data class GcmPrefs( PREF_NETWORK_MOBILE, PREF_NETWORK_ROAMING -> { if (time > learntMobileInterval / 4 * 3) { setSettings(context, Gcm.getContentUri(context)) { - put(Gcm.LEARNT_MOBILE, INTERVAL) + put(Gcm.LEARNT_MOBILE, SettingsProvider.INTERVAL) } } } PREF_NETWORK_WIFI -> { if (time > learntWifiInterval / 4 * 3) { setSettings(context, Gcm.getContentUri(context)) { - put(Gcm.LEARNT_WIFI, INTERVAL) + put(Gcm.LEARNT_WIFI, SettingsProvider.INTERVAL) } } } else -> { if (time > learntOtherInterval / 4 * 3) { setSettings(context, Gcm.getContentUri(context)) { - put(Gcm.LEARNT_OTHER, INTERVAL) + put(Gcm.LEARNT_OTHER, SettingsProvider.INTERVAL) } } } diff --git a/play-services-core/src/main/kotlin/org/microg/gms/measurement/MeasurementService.kt b/play-services-core/src/main/kotlin/org/microg/gms/measurement/MeasurementService.kt deleted file mode 100644 index 7f0a0afe..00000000 --- a/play-services-core/src/main/kotlin/org/microg/gms/measurement/MeasurementService.kt +++ /dev/null @@ -1,58 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2022 microG Project Team - * SPDX-License-Identifier: Apache-2.0 - */ - -package org.microg.gms.measurement - -import android.os.Bundle -import android.os.Parcel -import android.util.Log -import com.google.android.gms.common.api.CommonStatusCodes -import com.google.android.gms.common.internal.GetServiceRequest -import com.google.android.gms.common.internal.IGmsCallbacks -import com.google.android.gms.measurement.internal.* -import org.microg.gms.BaseService -import org.microg.gms.common.GmsService -import org.microg.gms.utils.warnOnTransactionIssues - -private const val TAG = "MeasurementService" - -class MeasurementService : BaseService(TAG, GmsService.MEASUREMENT) { - override fun handleServiceRequest(callback: IGmsCallbacks, request: GetServiceRequest, service: GmsService) { - callback.onPostInitComplete(CommonStatusCodes.SUCCESS, MeasurementServiceImpl(), Bundle()) - } -} - -class MeasurementServiceImpl : IMeasurementService.Stub() { - override fun f1(event: EventParcel, app: AppMetadata) { - Log.d(TAG, "f1($event) for $app") - } - - override fun f2(attribute: UserAttributeParcel?, app: AppMetadata) { - Log.d(TAG, "f2($attribute) for $app") - } - - override fun f4(app: AppMetadata) { - Log.d(TAG, "f4() for $app") - } - - override fun f10(p0: Long, p1: String?, p2: String?, p3: String?) { - Log.d(TAG, "f10($p0, $p1, $p2, $p3)") - } - - override fun f11(app: AppMetadata): String? { - Log.d(TAG, "f11() for $app") - return null - } - - override fun f12(property: ConditionalUserPropertyParcel, app: AppMetadata) { - Log.d(TAG, "f12($property) for $app") - } - - override fun setDefaultEventParameters(params: Bundle, app: AppMetadata) { - Log.d(TAG, "setDefaultEventParameters($params) for $app") - } - - override fun onTransact(code: Int, data: Parcel, reply: Parcel?, flags: Int): Boolean = warnOnTransactionIssues(code, reply, flags) { super.onTransact(code, data, reply, flags) } -} diff --git a/play-services-core/src/main/kotlin/org/microg/gms/phenotype/PhenotypeService.kt b/play-services-core/src/main/kotlin/org/microg/gms/phenotype/PhenotypeService.kt deleted file mode 100644 index b8a4b9e7..00000000 --- a/play-services-core/src/main/kotlin/org/microg/gms/phenotype/PhenotypeService.kt +++ /dev/null @@ -1,144 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2020 microG Project Team - * SPDX-License-Identifier: Apache-2.0 - */ - -package org.microg.gms.phenotype - -import android.os.Parcel -import android.util.Log -import com.google.android.gms.common.api.Status -import com.google.android.gms.common.internal.GetServiceRequest -import com.google.android.gms.common.internal.IGmsCallbacks -import com.mgoogle.android.gms.phenotype.* -import com.mgoogle.android.gms.phenotype.internal.IPhenotypeCallbacks -import com.mgoogle.android.gms.phenotype.internal.IPhenotypeService -import org.microg.gms.BaseService -import org.microg.gms.common.GmsService -import org.microg.gms.utils.warnOnTransactionIssues - -private const val TAG = "PhenotypeService" - -class PhenotypeService : BaseService(TAG, GmsService.PHENOTYPE) { - override fun handleServiceRequest(callback: IGmsCallbacks, request: GetServiceRequest?, service: GmsService?) { - callback.onPostInitComplete(0, PhenotypeServiceImpl().asBinder(), null) - } -} - -class PhenotypeServiceImpl : IPhenotypeService.Stub() { - override fun register(callbacks: IPhenotypeCallbacks, p1: String?, p2: Int, p3: Array?, p4: ByteArray?) { - Log.d(TAG, "register($p1, $p2, $p3, $p4)") - callbacks.onRegistered(Status.SUCCESS) - } - - override fun weakRegister(callbacks: IPhenotypeCallbacks, p1: String?, p2: Int, p3: Array?, p4: IntArray?, p5: ByteArray?) { - Log.d(TAG, "weakRegister($p1, $p2, $p3, $p4, $p5)") - callbacks.onWeakRegistered(Status.SUCCESS) - } - - override fun unregister(callbacks: IPhenotypeCallbacks, p1: String?) { - Log.d(TAG, "unregister($p1)") - callbacks.onUnregistered(Status.SUCCESS) - } - - override fun getConfigurationSnapshot(callbacks: IPhenotypeCallbacks, p1: String?, p2: String?) { - Log.d(TAG, "getConfigurationSnapshot($p1, $p2)") - callbacks.onConfiguration(Status.SUCCESS, Configurations().apply { - field4 = emptyArray() - }) - } - - override fun commitToConfiguration(callbacks: IPhenotypeCallbacks, p1: String?) { - Log.d(TAG, "commitToConfiguration($p1)") - callbacks.onCommitedToConfiguration(Status.SUCCESS) - } - - override fun getExperimentTokens(callbacks: IPhenotypeCallbacks, p1: String?, logSourceName: String?) { - Log.d(TAG, "getExperimentTokens($p1, $logSourceName)") - callbacks.onExperimentTokens(Status.SUCCESS, ExperimentTokens()) - } - - override fun getDogfoodsToken(callbacks: IPhenotypeCallbacks) { - Log.d(TAG, "getDogfoodsToken()") - callbacks.onDogfoodsToken(Status.SUCCESS, DogfoodsToken()) - } - - override fun setDogfoodsToken(callbacks: IPhenotypeCallbacks, p1: ByteArray?) { - Log.d(TAG, "setDogfoodsToken($p1)") - callbacks.onDogfoodsTokenSet(Status.SUCCESS) - } - - override fun getFlag(callbacks: IPhenotypeCallbacks, packageName: String?, name: String?, type: Int) { - Log.d(TAG, "setDogfoodsToken($packageName, $name, $type)") - callbacks.onFlag(Status.SUCCESS, null) - } - - override fun getCommitedConfiguration(callbacks: IPhenotypeCallbacks, p1: String?) { - Log.d(TAG, "getCommitedConfiguration($p1)") - callbacks.onCommittedConfiguration(Status.SUCCESS, Configurations().apply { - field4 = emptyArray() - }) - } - - override fun getConfigurationSnapshot2(callbacks: IPhenotypeCallbacks, p1: String?, p2: String?, p3: String?) { - Log.d(TAG, "getConfigurationSnapshot2($p1, $p2, $p3)") - callbacks.onConfiguration(Status.SUCCESS, Configurations().apply { - field4 = emptyArray() - }) - } - - override fun syncAfterOperation(callbacks: IPhenotypeCallbacks, p1: String?, p2: Long) { - Log.d(TAG, "syncAfterOperation($p1, $p2)") - callbacks.onSyncFinished(Status.SUCCESS, p2) - } - - override fun registerSync(callbacks: IPhenotypeCallbacks, p1: String?, p2: Int, p3: Array?, p4: ByteArray?, p5: String?, p6: String?) { - Log.d(TAG, "registerSync($p1, $p2, $p3, $p4, $p5, $p6)") - callbacks.onConfiguration(Status.SUCCESS, Configurations().apply { - field4 = emptyArray() - }) - } - - override fun setFlagOverrides(callbacks: IPhenotypeCallbacks, packageName: String?, user: String?, flagName: String?, flagType: Int, flagDataType: Int, flagValue: String?) { - Log.d(TAG, "setFlagOverrides($packageName, $user, $flagName, $flagDataType, $flagType, $flagDataType, $flagValue)") - callbacks.onFlagOverridesSet(Status.SUCCESS) - } - - override fun deleteFlagOverrides(callbacks: IPhenotypeCallbacks, packageName: String?, user: String?, flagName: String?) { - Log.d(TAG, "deleteFlagOverrides($packageName, $user, $flagName)") - callbacks.onFlagOverrides(Status.SUCCESS, FlagOverrides()) - } - - override fun listFlagOverrides(callbacks: IPhenotypeCallbacks, packageName: String?, user: String?, flagName: String?) { - Log.d(TAG, "listFlagOverrides($packageName, $user, $flagName)") - callbacks.onFlagOverrides(Status.SUCCESS, FlagOverrides()) - } - - override fun clearFlagOverrides(callbacks: IPhenotypeCallbacks, packageName: String?, user: String?) { - Log.d(TAG, "clearFlagOverrides($packageName, $user)") - callbacks.onFlagOverridesSet(Status.SUCCESS) - } - - override fun bulkRegister(callbacks: IPhenotypeCallbacks, infos: Array?) { - Log.d(TAG, "bulkRegister($infos)") - callbacks.onRegistered(Status.SUCCESS) - } - - override fun setAppSpecificProperties(callbacks: IPhenotypeCallbacks, p1: String?, p2: ByteArray?) { - Log.d(TAG, "setAppSpecificProperties($p1, $p2)") - callbacks.onAppSpecificPropertiesSet(Status.SUCCESS) - } - - override fun getServingVersion(callbacks: IPhenotypeCallbacks) { - Log.d(TAG, "getServingVersion()") - callbacks.onServingVersion(Status.SUCCESS, 1) - } - - override fun getExperimentTokens2(callbacks: IPhenotypeCallbacks, p1: String?, p2: String?, p3: String?, p4: String?) { - Log.d(TAG, "getExperimentTokens2($p1, $p2, $p3, $p4)") - callbacks.onExperimentTokens(Status.SUCCESS, ExperimentTokens()) - } - - override fun onTransact(code: Int, data: Parcel, reply: Parcel?, flags: Int): Boolean = - warnOnTransactionIssues(code, reply, flags) { super.onTransact(code, data, reply, flags) } -} diff --git a/play-services-core/src/main/kotlin/org/microg/gms/provision/ProvisionService.kt b/play-services-core/src/main/kotlin/org/microg/gms/provision/ProvisionService.kt deleted file mode 100755 index abf92a67..00000000 --- a/play-services-core/src/main/kotlin/org/microg/gms/provision/ProvisionService.kt +++ /dev/null @@ -1,46 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2020, microG Project Team - * SPDX-License-Identifier: Apache-2.0 - */ - -package org.microg.gms.provision - -import android.app.Service -import android.content.Intent -import android.os.Bundle -import android.util.Log -import androidx.lifecycle.LifecycleService -import androidx.lifecycle.lifecycleScope -import kotlinx.coroutines.delay -import org.microg.gms.checkin.getCheckinServiceInfo -import org.microg.gms.checkin.setCheckinServiceConfiguration -import org.microg.gms.gcm.getGcmServiceInfo -import org.microg.gms.gcm.setGcmServiceConfiguration - -class ProvisionService : LifecycleService() { - private fun Bundle.getBooleanOrNull(key: String): Boolean? { - return if (containsKey(key)) getBoolean(key) else null - } - - override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int { - super.onStartCommand(intent, flags, startId) - lifecycleScope.launchWhenStarted { - intent?.extras?.let { - val s = it.keySet().map { key -> "$key = ${it[key]}" }.joinToString(", ") - Log.d(TAG, "Provisioning: $s") - } - - intent?.extras?.getBooleanOrNull("checkin_enabled")?.let { setCheckinServiceConfiguration(this@ProvisionService, getCheckinServiceInfo(this@ProvisionService).configuration.copy(enabled = it)) } - intent?.extras?.getBooleanOrNull("gcm_enabled")?.let { setGcmServiceConfiguration(this@ProvisionService, getGcmServiceInfo(this@ProvisionService).configuration.copy(enabled = it)) } - // What else? - - delay(2 * 1000) // Wait 2 seconds to give provisioning some extra time - stopSelfResult(startId) - } - return Service.START_NOT_STICKY - } - - companion object { - private const val TAG = "GmsProvision" - } -} diff --git a/play-services-core/src/main/kotlin/org/microg/gms/udc/FacsCacheService.kt b/play-services-core/src/main/kotlin/org/microg/gms/udc/FacsCacheService.kt deleted file mode 100644 index c48e0e81..00000000 --- a/play-services-core/src/main/kotlin/org/microg/gms/udc/FacsCacheService.kt +++ /dev/null @@ -1,55 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2021, microG Project Team - * SPDX-License-Identifier: Apache-2.0 - */ - -package org.microg.gms.udc - -import android.os.Parcel -import android.util.Log -import com.google.android.gms.common.api.Status -import com.google.android.gms.common.internal.GetServiceRequest -import com.google.android.gms.common.internal.IGmsCallbacks -import com.google.android.gms.facs.cache.FacsCacheCallOptions -import com.google.android.gms.facs.cache.internal.IFacsCacheCallbacks -import com.google.android.gms.facs.cache.internal.IFacsCacheService -import org.microg.gms.BaseService -import org.microg.gms.common.GmsService -import org.microg.gms.utils.warnOnTransactionIssues - -private const val TAG = "GmsFacsCache" - -class FacsCacheService : BaseService(TAG, GmsService.FACS_CACHE) { - override fun handleServiceRequest(callback: IGmsCallbacks, request: GetServiceRequest?, service: GmsService?) { - callback.onPostInitComplete(0, FacsCacheServiceImpl().asBinder(), null) - } -} - -class FacsCacheServiceImpl : IFacsCacheService.Stub() { - override fun forceSettingsCacheRefresh(callbacks: IFacsCacheCallbacks, options: FacsCacheCallOptions) { - Log.d(TAG, "forceSettingsCacheRefresh") - callbacks.onForceSettingsCacheRefreshResult(Status.CANCELED, null) - } - - override fun updateActivityControlsSettings(callbacks: IFacsCacheCallbacks, bytes: ByteArray, options: FacsCacheCallOptions) { - Log.d(TAG, "updateActivityControlsSettings") - callbacks.onUpdateActivityControlsSettingsResult(Status.CANCELED, null) - } - - override fun getActivityControlsSettings(callbacks: IFacsCacheCallbacks, options: FacsCacheCallOptions) { - Log.d(TAG, "getActivityControlsSettings") - callbacks.onGetActivityControlsSettingsResult(Status.CANCELED, null) - } - - override fun readDeviceLevelSettings(callbacks: IFacsCacheCallbacks) { - Log.d(TAG, "readDeviceLevelSettings") - callbacks.onReadDeviceLevelSettingsResult(Status.CANCELED, null) - } - - override fun writeDeviceLevelSettings(callbacks: IFacsCacheCallbacks, bytes: ByteArray) { - Log.d(TAG, "writeDeviceLevelSettings") - callbacks.onWriteDeviceLevelSettingsResult(Status.CANCELED) - } - - override fun onTransact(code: Int, data: Parcel, reply: Parcel?, flags: Int): Boolean = warnOnTransactionIssues(code, reply, flags) { super.onTransact(code, data, reply, flags) } -} diff --git a/play-services-core/src/main/kotlin/org/microg/gms/ui/PushNotificationAdvancedFragment.kt b/play-services-core/src/main/kotlin/org/microg/gms/ui/PushNotificationAdvancedFragment.kt index 4e7150cf..d3cef96f 100644 --- a/play-services-core/src/main/kotlin/org/microg/gms/ui/PushNotificationAdvancedFragment.kt +++ b/play-services-core/src/main/kotlin/org/microg/gms/ui/PushNotificationAdvancedFragment.kt @@ -14,6 +14,7 @@ import com.mgoogle.android.gms.R import org.microg.gms.gcm.GcmPrefs import org.microg.gms.gcm.getGcmServiceInfo import org.microg.gms.gcm.setGcmServiceConfiguration +import org.microg.mgms.settings.SettingsProvider class PushNotificationAdvancedFragment : PreferenceFragmentCompat() { private lateinit var networkMobile: ListPreference @@ -97,13 +98,13 @@ class PushNotificationAdvancedFragment : PreferenceFragmentCompat() { private fun getSummaryString(value: Int, learnt: Int): String = when (value) { -1 -> getString(R.string.service_status_disabled_short) 0 -> getString(R.string.service_status_enabled_short) + " / " + getString(R.string.gcm_status_pref_default) + ": " + getHeartbeatString(learnt) - else -> getString(R.string.service_status_enabled_short) + " / " + getString(R.string.gcm_status_pref_manual) + ": " + getHeartbeatString(value * GcmPrefs.INTERVAL) + else -> getString(R.string.service_status_enabled_short) + " / " + getString(R.string.gcm_status_pref_manual) + ": " + getHeartbeatString(value * SettingsProvider.INTERVAL) } private fun getHeartbeatString(heartbeatMs: Int): String { return if (heartbeatMs < 120000) { (heartbeatMs / 1000).toString() + " " + getString(R.string.gcm_status_pref_sec) - } else (heartbeatMs / GcmPrefs.INTERVAL).toString() + " " + getString(R.string.gcm_status_pref_min) + } else (heartbeatMs / SettingsProvider.INTERVAL).toString() + " " + getString(R.string.gcm_status_pref_min) } companion object { diff --git a/play-services-core/src/main/kotlin/org/microg/gms/ui/SettingsFragment.kt b/play-services-core/src/main/kotlin/org/microg/gms/ui/SettingsFragment.kt index b1aa2a7e..a404862b 100644 --- a/play-services-core/src/main/kotlin/org/microg/gms/ui/SettingsFragment.kt +++ b/play-services-core/src/main/kotlin/org/microg/gms/ui/SettingsFragment.kt @@ -13,7 +13,6 @@ import android.content.pm.PackageManager import android.os.Bundle import androidx.preference.Preference import androidx.preference.SwitchPreferenceCompat -import com.google.android.gms.cast.media.CastMediaRouteProviderService import com.mgoogle.android.gms.R import org.microg.gms.checkin.CheckinPrefs import org.microg.gms.gcm.GcmDatabase @@ -28,8 +27,6 @@ class SettingsFragment : ResourceSettingsFragment() { override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { super.onCreatePreferences(savedInstanceState, rootKey) - val pm = requireActivity().packageManager - findPreference(PREF_CHECKIN)?.setOnPreferenceClickListener { findNavController().navigate(requireContext(), R.id.openCheckinSettings) true @@ -44,17 +41,6 @@ class SettingsFragment : ResourceSettingsFragment() { } findPreference(PREF_ABOUT)?.summary = getString(R.string.about_version_str, AboutFragment.getSelfVersion(context)) - findPreference(PREF_CAST_DOUBLE_FIX_ENABLED)?.setOnPreferenceChangeListener { _, newValue -> - pm?.setComponentEnabledSetting( - ComponentName(requireActivity().applicationContext, CastMediaRouteProviderService::class.java), - when (newValue) { - true -> PackageManager.COMPONENT_ENABLED_STATE_DISABLED - else -> PackageManager.COMPONENT_ENABLED_STATE_ENABLED - }, - PackageManager.DONT_KILL_APP) - true - } - findPreference(SettingsContract.CheckIn.HIDE_LAUNCHER_ICON)?.apply { if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) { setOnPreferenceChangeListener { _, newValue -> @@ -94,7 +80,6 @@ class SettingsFragment : ResourceSettingsFragment() { const val PREF_ABOUT = "pref_about" const val PREF_GCM = "pref_gcm" const val PREF_CHECKIN = "pref_checkin" - const val PREF_CAST_DOUBLE_FIX_ENABLED = "pref_cast_double_fix_enabled" } init { diff --git a/play-services-core/src/main/kotlin/org/microg/gms/usagereporting/UsageReportingService.kt b/play-services-core/src/main/kotlin/org/microg/gms/usagereporting/UsageReportingService.kt deleted file mode 100644 index 86831b2e..00000000 --- a/play-services-core/src/main/kotlin/org/microg/gms/usagereporting/UsageReportingService.kt +++ /dev/null @@ -1,53 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2022 microG Project Team - * SPDX-License-Identifier: Apache-2.0 - */ - -package org.microg.gms.usagereporting - -import android.os.Bundle -import android.os.Parcel -import android.util.Log -import com.google.android.gms.common.api.CommonStatusCodes -import com.google.android.gms.common.api.Status -import com.google.android.gms.common.internal.GetServiceRequest -import com.google.android.gms.common.internal.IGmsCallbacks -import com.google.android.gms.usagereporting.UsageReportingOptInOptions -import com.google.android.gms.usagereporting.internal.IUsageReportingCallbacks -import com.google.android.gms.usagereporting.internal.IUsageReportingOptInOptionsChangedListener -import com.google.android.gms.usagereporting.internal.IUsageReportingService -import org.microg.gms.BaseService -import org.microg.gms.common.GmsService -import org.microg.gms.utils.warnOnTransactionIssues - -private const val TAG = "UsageReportingService" - -class UsageReportingService : BaseService(TAG, GmsService.USAGE_REPORTING) { - override fun handleServiceRequest(callback: IGmsCallbacks, request: GetServiceRequest, service: GmsService) { - callback.onPostInitComplete(CommonStatusCodes.SUCCESS, UsageReportingServiceImpl(), Bundle()) - } -} - -class UsageReportingServiceImpl : IUsageReportingService.Stub() { - override fun getOptInOptions(callbacks: IUsageReportingCallbacks) { - // Don't log to prevent log spam - callbacks.onOptInOptions(Status.SUCCESS, UsageReportingOptInOptions().apply { optInUsageReporting = 2 }) - } - - override fun setOptInOptions(options: UsageReportingOptInOptions, callbacks: IUsageReportingCallbacks) { - Log.d(TAG, "setOptInOptions($options)") - callbacks.onOptInOptionsSet(Status.SUCCESS) - } - - override fun addOptInOptionsChangedListener(listener: IUsageReportingOptInOptionsChangedListener, callbacks: IUsageReportingCallbacks) { - Log.d(TAG, "addOptInOptionsChangedListener($listener)") - callbacks.onOptInOptionsChangedListenerAdded(Status.SUCCESS) - } - - override fun removeOptInOptionsChangedListener(listener: IUsageReportingOptInOptionsChangedListener, callbacks: IUsageReportingCallbacks) { - Log.d(TAG, "removeOptInOptionsChangedListener($listener)") - callbacks.onOptInOptionsChangedListenerRemoved(Status.SUCCESS) - } - - override fun onTransact(code: Int, data: Parcel, reply: Parcel?, flags: Int): Boolean = warnOnTransactionIssues(code, reply, flags) { super.onTransact(code, data, reply, flags) } -} diff --git a/play-services-core/src/main/res/drawable-anydpi-v21/microg_light_color_24.xml b/play-services-core/src/main/res/drawable-anydpi-v21/microg_light_color_24.xml deleted file mode 100644 index 9f1500dc..00000000 --- a/play-services-core/src/main/res/drawable-anydpi-v21/microg_light_color_24.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - diff --git a/play-services-core/src/main/res/drawable-v24/ic_launcher_foreground.xml b/play-services-core/src/main/res/drawable-v24/ic_launcher_foreground.xml deleted file mode 100644 index 5f4790a3..00000000 --- a/play-services-core/src/main/res/drawable-v24/ic_launcher_foreground.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/play-services-core/src/main/res/drawable/ic_cast_black.xml b/play-services-core/src/main/res/drawable/ic_cast_black.xml deleted file mode 100644 index 95b6bf72..00000000 --- a/play-services-core/src/main/res/drawable/ic_cast_black.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - \ No newline at end of file diff --git a/play-services-core/src/main/res/drawable/ic_foreground_notification.xml b/play-services-core/src/main/res/drawable/ic_foreground_notification.xml deleted file mode 100644 index efa909af..00000000 --- a/play-services-core/src/main/res/drawable/ic_foreground_notification.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - diff --git a/play-services-core/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/play-services-core/src/main/res/mipmap-anydpi-v26/ic_launcher.xml index 7353dbd1..036d09bc 100644 --- a/play-services-core/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +++ b/play-services-core/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -1,5 +1,5 @@ - + \ No newline at end of file diff --git a/play-services-core/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/play-services-core/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 00000000..036d09bc --- /dev/null +++ b/play-services-core/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/play-services-core/src/main/res/mipmap-hdpi/ic_launcher.png b/play-services-core/src/main/res/mipmap-hdpi/ic_launcher.png index a6c6fb8a..c3a23652 100644 Binary files a/play-services-core/src/main/res/mipmap-hdpi/ic_launcher.png and b/play-services-core/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/play-services-core/src/main/res/mipmap-hdpi/ic_launcher_foreground.png b/play-services-core/src/main/res/mipmap-hdpi/ic_launcher_foreground.png new file mode 100644 index 00000000..d368be8e Binary files /dev/null and b/play-services-core/src/main/res/mipmap-hdpi/ic_launcher_foreground.png differ diff --git a/play-services-core/src/main/res/mipmap-hdpi/ic_launcher_round.png b/play-services-core/src/main/res/mipmap-hdpi/ic_launcher_round.png new file mode 100644 index 00000000..c3a23652 Binary files /dev/null and b/play-services-core/src/main/res/mipmap-hdpi/ic_launcher_round.png differ diff --git a/play-services-core/src/main/res/mipmap-mdpi/ic_launcher.png b/play-services-core/src/main/res/mipmap-mdpi/ic_launcher.png index 41b90dae..b4c18c2b 100644 Binary files a/play-services-core/src/main/res/mipmap-mdpi/ic_launcher.png and b/play-services-core/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/play-services-core/src/main/res/mipmap-mdpi/ic_launcher_foreground.png b/play-services-core/src/main/res/mipmap-mdpi/ic_launcher_foreground.png new file mode 100644 index 00000000..1107ab43 Binary files /dev/null and b/play-services-core/src/main/res/mipmap-mdpi/ic_launcher_foreground.png differ diff --git a/play-services-core/src/main/res/mipmap-mdpi/ic_launcher_round.png b/play-services-core/src/main/res/mipmap-mdpi/ic_launcher_round.png new file mode 100644 index 00000000..b4c18c2b Binary files /dev/null and b/play-services-core/src/main/res/mipmap-mdpi/ic_launcher_round.png differ diff --git a/play-services-core/src/main/res/mipmap-xhdpi/ic_launcher.png b/play-services-core/src/main/res/mipmap-xhdpi/ic_launcher.png index e70c0582..5c096c9a 100644 Binary files a/play-services-core/src/main/res/mipmap-xhdpi/ic_launcher.png and b/play-services-core/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/play-services-core/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png b/play-services-core/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png new file mode 100644 index 00000000..ce5b74b9 Binary files /dev/null and b/play-services-core/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png differ diff --git a/play-services-core/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/play-services-core/src/main/res/mipmap-xhdpi/ic_launcher_round.png new file mode 100644 index 00000000..5c096c9a Binary files /dev/null and b/play-services-core/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ diff --git a/play-services-core/src/main/res/mipmap-xxhdpi/ic_launcher.png b/play-services-core/src/main/res/mipmap-xxhdpi/ic_launcher.png index 03cec2d8..d0eb9245 100644 Binary files a/play-services-core/src/main/res/mipmap-xxhdpi/ic_launcher.png and b/play-services-core/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/play-services-core/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png b/play-services-core/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png new file mode 100644 index 00000000..fde039a7 Binary files /dev/null and b/play-services-core/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png differ diff --git a/play-services-core/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/play-services-core/src/main/res/mipmap-xxhdpi/ic_launcher_round.png new file mode 100644 index 00000000..d0eb9245 Binary files /dev/null and b/play-services-core/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ diff --git a/play-services-core/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/play-services-core/src/main/res/mipmap-xxxhdpi/ic_launcher.png index 092eadd7..9b5db489 100644 Binary files a/play-services-core/src/main/res/mipmap-xxxhdpi/ic_launcher.png and b/play-services-core/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/play-services-core/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png b/play-services-core/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png new file mode 100644 index 00000000..69671122 Binary files /dev/null and b/play-services-core/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png differ diff --git a/play-services-core/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/play-services-core/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png new file mode 100644 index 00000000..9b5db489 Binary files /dev/null and b/play-services-core/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ diff --git a/play-services-core/src/main/res/values-cs/strings.xml b/play-services-core/src/main/res/values-cs/strings.xml index d8af932f..a70ea891 100644 --- a/play-services-core/src/main/res/values-cs/strings.xml +++ b/play-services-core/src/main/res/values-cs/strings.xml @@ -20,10 +20,10 @@ Nastavení Vanced microG Nastavení Vanced microG. - Varování o úspoře baterie - Rozbalit oznámení - Nechte microG běžet na pozadí - Klepnutím zde přejděte do nastavení a zakažte optimalizaci baterie pro aplikaci Vanced microG. Po provedení této akce a restartu zařízení toto oznámení zmizí + + + + Počkejte chviličku… Google Account Manager @@ -90,7 +90,7 @@ Tato akce může trvat několik minut." Cloud Messaging je poskytovatel push oznámení využívaný mnoha aplikacemi třetích stran. Chcete\u2011li jej použít, musíte povolit registraci zařízení. O aplikaci Vanced microG - Opravit duplicity ve Vysílání + Skrýt ikonu ze spouštěče Huawei @@ -125,7 +125,7 @@ Tato akce může trvat několik minut." Registrované aplikace Aplikace se zrušenou registrací Sítě používané pro push oznámení - Povolte toto nastavení, jestliže zaznamenáte duplicity v menu Vysílání + Profil zařízení Vybrat profil diff --git a/play-services-core/src/main/res/values-es/strings.xml b/play-services-core/src/main/res/values-es/strings.xml index eb1a176b..f9050dac 100644 --- a/play-services-core/src/main/res/values-es/strings.xml +++ b/play-services-core/src/main/res/values-es/strings.xml @@ -20,10 +20,10 @@ Ajustes Vanced microG Configurar Vanced microG. - Exclusion de Ahorro de Bateria - Expandir notificación - Mantener microG en segundo plano - Toque aqui y deshabilita la optimización de batería para vanced microG, luego reinicie el dispositivo para cerrar esta notificación + + + + Solo un momento… Administrador de Cuentas Google @@ -90,7 +90,7 @@ Esto puede tardar unos minutos." Cloud Messaging es un proveedor de notificaciónes push usado por muchas aplicaciones de terceros. Pará usarlo tienes que activar registro de dispositivos. Acerca de Vanced microG - Solucion para Cast duplicado + Ocultar microG del lanzador Huawei @@ -125,6 +125,6 @@ Esto puede tardar unos minutos." Apps registradas Apps no registradas Redes para usar para notificaciones push - Activa esto si ves duplicados en tu menú de cast + diff --git a/play-services-core/src/main/res/values-in/strings.xml b/play-services-core/src/main/res/values-in/strings.xml index 63f0aabb..fadff7ff 100644 --- a/play-services-core/src/main/res/values-in/strings.xml +++ b/play-services-core/src/main/res/values-in/strings.xml @@ -20,10 +20,10 @@ Pengaturan Vanced microG Atur Vanced microG. - Memperhatikan Menghemat Baterai - Perluas notifikasi - Pertahankan microG di latar belakang - Ketuk di sini dan nonaktifkan pengoptimalan baterai untuk microG, lalu reboot perangkat untuk menghapus notifikasi ini. + + + + Tunggu sebentar… Pengelola akun Google @@ -90,7 +90,7 @@ Ini bisa berlangsung beberapa menit." Cloud Messaging adalah penyedia notifikasi push yang digunakan pada banyak aplikasi pihak ketiga. Untuk menggunakannya anda harus mengaktifkan device registration. Tentang Vanced microG - Perbaikan Cast terduplikasi + Sembunyikan microG dari peluncur Registrasi perangkat @@ -123,6 +123,6 @@ Ini bisa berlangsung beberapa menit." Aplikasi yang teregistrasi Aplikasi yang tidak teregistrasi Internet yang digunakan untuk notifikasi push - Aktifkan ini jika anda melihat duplikasi di menu casting + diff --git a/play-services-core/src/main/res/values-it/strings.xml b/play-services-core/src/main/res/values-it/strings.xml index 9a4f8e0a..85001ace 100755 --- a/play-services-core/src/main/res/values-it/strings.xml +++ b/play-services-core/src/main/res/values-it/strings.xml @@ -20,11 +20,6 @@ Impostazioni di Vanced microG Configurazione di Vanced microG. - Avviso Risparmio Energetico - Espandi la notifica - Mantieni i microG in secondo piano - Tocca qui per disattivare l\'ottimizzazione della batteria per microG, poi riavvia il dispositivo per rimuovere questa notifica. - Solo un secondo… Gestore Account Google Ci scusiamo… @@ -90,7 +85,6 @@ Questo potrà richiedere un paio di minuti" Messaggistica Cloud è un fornitore di notifiche push presente in molte applicazioni di terze parti. Per utilizzarlo è necessario attivare la registrazione del dispositivo. Informazioni su Vanced microG - Correzione cast duplicato Nascondi microG dal launcher Registra dispositivo @@ -123,7 +117,6 @@ Questo potrà richiedere un paio di minuti" App registrate App non registrate Reti utilizzate per le notifiche push - Attiva questa opzione in caso di voci duplicate nel menù di trasmissione Profilo dispositivo Seleziona profilo diff --git a/play-services-core/src/main/res/values-pt-rBR/strings.xml b/play-services-core/src/main/res/values-pt-rBR/strings.xml index 1bb1c9d8..cb4d32d7 100644 --- a/play-services-core/src/main/res/values-pt-rBR/strings.xml +++ b/play-services-core/src/main/res/values-pt-rBR/strings.xml @@ -19,10 +19,10 @@ Configurações do Vanced microG Configuração do Vanced microG. - Aviso de Economia de Bateria - Expandir notificação - Mantenha o microG em segundo plano - Toque aqui para desativar a otimização da bateria para o vanced microG e, em seguida, reinicie o dispositivo para remover esta notificação + + + + Só um segundo... Gerente de Contas do Google @@ -89,7 +89,7 @@ Isso pode levar alguns minutos." Cloud Messaging é um provedor de notificação push usado por muitos aplicativos de terceiros. Para usá-lo, você deve ativar ao registro do dispositivo. Sobre o Vanced microG - Corrigir duplicação do Cast + Ocultar ícone no menu Huawei @@ -124,7 +124,7 @@ Isso pode levar alguns minutos." Aplicativos registrados Aplicativos não registrados Redes para usar em notificações push - Ative isso se você ver o menu casting duplicado + Perfil do dispositivo Selecionar perfil diff --git a/play-services-core/src/main/res/values-ru/strings.xml b/play-services-core/src/main/res/values-ru/strings.xml index 25151d51..d0dcb83b 100644 --- a/play-services-core/src/main/res/values-ru/strings.xml +++ b/play-services-core/src/main/res/values-ru/strings.xml @@ -20,10 +20,10 @@ Настройки Vanced microG Настройки для Vanced microG. - Уведомление о службе батареи - Разверните уведомление - Удерживать microG в фоне - Нажмите здесь, чтобы отключить режим энергосбережения для microG. Затем перезагрузите устройство, чтобы отключить уведомление. + + + + Секундочку… Настройки аккаунта Google @@ -90,7 +90,7 @@ Cloud Messaging позволяет получать уведомления от многих приложений. Чтобы использовать GCM, включите регистрацию устройства в Google. О Vanced microG - Исправление двух кнопок трансляции + скрыть микрог из лаунчера Huawei @@ -125,6 +125,6 @@ Зарегистрированные приложения Приложения без регистрации Тип сети для получения уведомлений - Включите это если у вас появляются копии устройств в меню трансляции + diff --git a/play-services-core/src/main/res/values/strings.xml b/play-services-core/src/main/res/values/strings.xml index 29c2759b..19f9971f 100755 --- a/play-services-core/src/main/res/values/strings.xml +++ b/play-services-core/src/main/res/values/strings.xml @@ -19,11 +19,6 @@ Vanced microG Settings Setup Vanced microG. - Battery Saving Warning - Expand notification - Keep microG in background - Tap here to disable battery optimization for vanced microG, then restart the device to remove this notification - Just a sec… Google Account Manager Sorry… @@ -89,7 +84,6 @@ This can take a couple of minutes." Cloud Messaging is a push notification provider used by many third-party applications. To use it you must enable device registration. About Vanced microG - Cast duplication fix Hide icon from launcher Huawei @@ -124,7 +118,6 @@ This can take a couple of minutes." Registered apps Unregistered apps Networks to use for push notifications - Enable this if you see duplicates in your casting menu Device profile Select profile diff --git a/play-services-core/src/main/res/xml/preferences_start.xml b/play-services-core/src/main/res/xml/preferences_start.xml index 1e796d7b..363fa233 100755 --- a/play-services-core/src/main/res/xml/preferences_start.xml +++ b/play-services-core/src/main/res/xml/preferences_start.xml @@ -42,12 +42,6 @@ android:targetClass="org.microg.gms.ui.GoogleMoreFragment$AsActivity" android:targetPackage="com.mgoogle.android.gms" /> - - - - - - - diff --git a/play-services-cronet-core/src/main/java/com/google/android/gms/dynamite/descriptors/com/google/android/gms/cronet_dynamite/ModuleDescriptor.java b/play-services-cronet-core/src/main/java/com/google/android/gms/dynamite/descriptors/com/google/android/gms/cronet_dynamite/ModuleDescriptor.java deleted file mode 100644 index c46af5c9..00000000 --- a/play-services-cronet-core/src/main/java/com/google/android/gms/dynamite/descriptors/com/google/android/gms/cronet_dynamite/ModuleDescriptor.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2021, microG Project Team - * SPDX-License-Identifier: Apache-2.0 - */ - -package com.google.android.gms.dynamite.descriptors.com.google.android.gms.cronet_dynamite; - -import java.util.Arrays; -import java.util.List; - -public class ModuleDescriptor { - public static final String MODULE_ID = "com.google.android.gms.cronet_dynamite"; - public static final int MODULE_VERSION = 2; - public static final List MERGED_CLASSES = Arrays.asList( - "org.chromium.net.ApiVersion", - "org.chromium.net.BidirectionalStream", - "org.chromium.net.CallbackException", - "org.chromium.net.CronetEngine", - "org.chromium.net.CronetException", - "org.chromium.net.CronetProvider", - "org.chromium.net.ExperimentalBidirectionalStream", - "org.chromium.net.ExperimentalCronetEngine", - "org.chromium.net.ExperimentalUrlRequest", - "org.chromium.net.ICronetEngineBuilder", - "org.chromium.net.InlineExecutionProhibitedException", - "org.chromium.net.NetworkException", - "org.chromium.net.NetworkQualityRttListener", - "org.chromium.net.NetworkQualityThroughputListener", - "org.chromium.net.QuicException", - "org.chromium.net.RequestFinishedInfo", - "org.chromium.net.UploadDataProvider", - "org.chromium.net.UploadDataProviders", - "org.chromium.net.UploadDataSink", - "org.chromium.net.UrlRequest", - "org.chromium.net.UrlResponseInfo" - ); -} diff --git a/play-services-location-api/build.gradle b/play-services-location-api/build.gradle deleted file mode 100644 index f16d2c33..00000000 --- a/play-services-location-api/build.gradle +++ /dev/null @@ -1,38 +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. - */ - -apply plugin: 'com.android.library' - -android { - compileSdkVersion androidCompileSdk - buildToolsVersion "30.0.3" - - defaultConfig { - minSdkVersion androidMinSdk - targetSdkVersion androidTargetSdk - } - - compileOptions { - sourceCompatibility = 1.8 - targetCompatibility = 1.8 - } -} - -dependencies { - api project(':play-services-basement') - - api project(':play-services-base-api') -} \ No newline at end of file diff --git a/play-services-location-api/gradle.properties b/play-services-location-api/gradle.properties deleted file mode 100644 index de0a3085..00000000 --- a/play-services-location-api/gradle.properties +++ /dev/null @@ -1,34 +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. -# - -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-location-api/src/main/AndroidManifest.xml b/play-services-location-api/src/main/AndroidManifest.xml deleted file mode 100644 index 4a97d616..00000000 --- a/play-services-location-api/src/main/AndroidManifest.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - diff --git a/play-services-location-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 deleted file mode 100644 index 52b4c775..00000000 --- a/play-services-location-api/src/main/aidl/com/google/android/gms/location/ActivityRecognitionResult.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.location; - -parcelable ActivityRecognitionResult; \ No newline at end of file diff --git a/play-services-location-api/src/main/aidl/com/google/android/gms/location/DeviceOrientation.aidl b/play-services-location-api/src/main/aidl/com/google/android/gms/location/DeviceOrientation.aidl deleted file mode 100644 index 3055c41b..00000000 --- a/play-services-location-api/src/main/aidl/com/google/android/gms/location/DeviceOrientation.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.location; - -parcelable DeviceOrientation; diff --git a/play-services-location-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 deleted file mode 100644 index d88a3ac8..00000000 --- a/play-services-location-api/src/main/aidl/com/google/android/gms/location/GeofencingRequest.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.location; - -parcelable GeofencingRequest; diff --git a/play-services-location-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 deleted file mode 100644 index 9fffa77a..00000000 --- a/play-services-location-api/src/main/aidl/com/google/android/gms/location/GestureRequest.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.location; - -parcelable GestureRequest; diff --git a/play-services-location-api/src/main/aidl/com/google/android/gms/location/IDeviceOrientationListener.aidl b/play-services-location-api/src/main/aidl/com/google/android/gms/location/IDeviceOrientationListener.aidl deleted file mode 100644 index e3d3e6f0..00000000 --- a/play-services-location-api/src/main/aidl/com/google/android/gms/location/IDeviceOrientationListener.aidl +++ /dev/null @@ -1,7 +0,0 @@ -package com.google.android.gms.location; - -import com.google.android.gms.location.DeviceOrientation; - -interface IDeviceOrientationListener { - void onDeviceOrientationChanged(in DeviceOrientation deviceOrientation); -} diff --git a/play-services-location-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 deleted file mode 100644 index bbccd355..00000000 --- a/play-services-location-api/src/main/aidl/com/google/android/gms/location/ILocationCallback.aidl +++ /dev/null @@ -1,11 +0,0 @@ -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-location-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 deleted file mode 100644 index 323f9059..00000000 --- a/play-services-location-api/src/main/aidl/com/google/android/gms/location/ILocationListener.aidl +++ /dev/null @@ -1,7 +0,0 @@ -package com.google.android.gms.location; - -import android.location.Location; - -interface ILocationListener { - void onLocationChanged(in Location location); -} diff --git a/play-services-location-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 deleted file mode 100644 index 8037232b..00000000 --- a/play-services-location-api/src/main/aidl/com/google/android/gms/location/LocationAvailability.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.location; - -parcelable LocationAvailability; diff --git a/play-services-location-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 deleted file mode 100644 index 915aa2ae..00000000 --- a/play-services-location-api/src/main/aidl/com/google/android/gms/location/LocationRequest.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.location; - -parcelable LocationRequest; diff --git a/play-services-location-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 deleted file mode 100644 index d79917b7..00000000 --- a/play-services-location-api/src/main/aidl/com/google/android/gms/location/LocationResult.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.location; - -parcelable LocationResult; diff --git a/play-services-location-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 deleted file mode 100644 index 2552ed66..00000000 --- a/play-services-location-api/src/main/aidl/com/google/android/gms/location/LocationSettingsRequest.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.location; - -parcelable LocationSettingsRequest; diff --git a/play-services-location-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 deleted file mode 100644 index 54dad656..00000000 --- a/play-services-location-api/src/main/aidl/com/google/android/gms/location/LocationSettingsResult.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.location; - -parcelable LocationSettingsResult; diff --git a/play-services-location-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 deleted file mode 100644 index 398d9c18..00000000 --- a/play-services-location-api/src/main/aidl/com/google/android/gms/location/LocationStatus.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.location; - -parcelable LocationStatus; diff --git a/play-services-location-api/src/main/aidl/com/google/android/gms/location/internal/DeviceOrientationRequestUpdateData.aidl b/play-services-location-api/src/main/aidl/com/google/android/gms/location/internal/DeviceOrientationRequestUpdateData.aidl deleted file mode 100644 index e92b0f0d..00000000 --- a/play-services-location-api/src/main/aidl/com/google/android/gms/location/internal/DeviceOrientationRequestUpdateData.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.location.internal; - -parcelable DeviceOrientationRequestUpdateData; diff --git a/play-services-location-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 deleted file mode 100644 index 37a17787..00000000 --- a/play-services-location-api/src/main/aidl/com/google/android/gms/location/internal/FusedLocationProviderResult.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.location.internal; - -parcelable FusedLocationProviderResult; diff --git a/play-services-location-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 deleted file mode 100644 index 44f0d67b..00000000 --- a/play-services-location-api/src/main/aidl/com/google/android/gms/location/internal/IFusedLocationProviderCallback.aidl +++ /dev/null @@ -1,7 +0,0 @@ -package com.google.android.gms.location.internal; - -import com.google.android.gms.location.internal.FusedLocationProviderResult; - -interface IFusedLocationProviderCallback { - oneway void onFusedLocationProviderResult(in FusedLocationProviderResult result) = 0; -} diff --git a/play-services-location-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 deleted file mode 100644 index ac3950f5..00000000 --- a/play-services-location-api/src/main/aidl/com/google/android/gms/location/internal/IGeofencerCallbacks.aidl +++ /dev/null @@ -1,9 +0,0 @@ -package com.google.android.gms.location.internal; - -import android.app.PendingIntent; - -interface IGeofencerCallbacks { - void onAddGeofenceResult(int statusCode, in String[] requestIds) = 0; - void onRemoveGeofencesByRequestIdsResult(int statusCode, in String[] requestIds) = 1; - void onRemoveGeofencesByPendingIntentResult(int statusCode, in PendingIntent pendingIntent) = 2; -} diff --git a/play-services-location-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 deleted file mode 100644 index 19f9be10..00000000 --- a/play-services-location-api/src/main/aidl/com/google/android/gms/location/internal/IGoogleLocationManagerService.aidl +++ /dev/null @@ -1,113 +0,0 @@ -package com.google.android.gms.location.internal; - -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.common.api.internal.IStatusCallback; -import com.google.android.gms.location.places.AutocompleteFilter; -import com.google.android.gms.location.places.internal.IPlacesCallbacks; -import com.google.android.gms.location.internal.DeviceOrientationRequestUpdateData; -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.internal.ParcelableGeofence; -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.ActivityRecognitionResult; -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; -import com.google.android.gms.maps.model.LatLng; -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 removeAllGeofences(IGeofencerCallbacks callbacks, String packageName) = 3; -// void removeGeofences(in RemoveGeofencingRequest request, IGeofencerCallbacks callback) = 73; - - void requestActivityUpdates(long detectionIntervalMillis, boolean alwaysTrue, in PendingIntent callbackIntent) = 4; - void removeActivityUpdates(in PendingIntent callbackIntent) = 5; - ActivityRecognitionResult getLastActivity(String packageName) = 63; - - Status requestGestureUpdates(in GestureRequest request, in PendingIntent pendingIntent) = 59; - Status iglms61(in PendingIntent pendingIntent) = 60; - - Location getLastLocation() = 6; - Location getLastLocationWithPackage(String packageName) = 20; - Location getLastLocationWith(String s) = 79; - - 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 flushLocations(IFusedLocationProviderCallback callback) = 66; - - void setMockMode(boolean mockMode) = 11; - void setMockLocation(in Location mockLocation) = 12; - void injectLocation(in Location mockLocation, int injectionType) = 25; - - LocationAvailability getLocationAvailabilityWithPackage(String packageName) = 33; - -// void requestSleepSegmentUpdates(in PendingIntent pendingIntent, in SleepSegmentRequest request, IStatusCallback callback) = 78; - void removeSleepSegmentUpdates(in PendingIntent pendingIntent, IStatusCallback callback) = 68; - - void requestLocationSettingsDialog(in LocationSettingsRequest settingsRequest, ISettingsCallbacks callback, String packageName) = 62; - -// void requestActivityTransitionUpdates(in ActivityTransitionRequest request, in PendingIntent pendingIntent, IStatusCallback callback) = 71; - void removeActivityTransitionUpdates(in PendingIntent pendingIntent, IStatusCallback callback) = 72; - - void updateDeviceOrientationRequest(in DeviceOrientationRequestUpdateData request) = 74; - - boolean setActivityRecognitionMode(int mode) = 76; - - 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 iglms25(in PlaceReport var1, in PlacesParams var2) = 24; - - 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; - - IBinder iglms54() = 53; - void iglms55(String var1, in LatLngBounds var2, in AutocompleteFilter var3, in PlacesParams var4, IPlacesCallbacks var5) = 54; - - void iglms58(in List var1, in PlacesParams var2, IPlacesCallbacks var3) = 57; - - void iglms65(in PendingIntent pendingIntent, IStatusCallback callback) = 64; - void iglms66(in PendingIntent pendingIntent, IStatusCallback callback) = 65; - - void iglms68(in PendingIntent pendingIntent, IStatusCallback callback) = 67; -// void iglms70(in ActivityRecognitionRequest request, in PendingIntent pendingIntent, IStatusCallback callback) = 69; - void iglms71(IStatusCallback callback) = 70; - void iglms76(in PendingIntent pendingIntent) = 75; - int iglms78() = 77; -} diff --git a/play-services-location-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 deleted file mode 100644 index f710d11f..00000000 --- a/play-services-location-api/src/main/aidl/com/google/android/gms/location/internal/ISettingsCallbacks.aidl +++ /dev/null @@ -1,7 +0,0 @@ -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-location-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 deleted file mode 100644 index 4604714a..00000000 --- a/play-services-location-api/src/main/aidl/com/google/android/gms/location/internal/LocationRequestInternal.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.location.internal; - -parcelable LocationRequestInternal; diff --git a/play-services-location-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 deleted file mode 100644 index 812f2ca5..00000000 --- a/play-services-location-api/src/main/aidl/com/google/android/gms/location/internal/LocationRequestUpdateData.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.location.internal; - -parcelable LocationRequestUpdateData; diff --git a/play-services-location-api/src/main/aidl/com/google/android/gms/location/internal/ParcelableGeofence.aidl b/play-services-location-api/src/main/aidl/com/google/android/gms/location/internal/ParcelableGeofence.aidl deleted file mode 100644 index d4d69547..00000000 --- a/play-services-location-api/src/main/aidl/com/google/android/gms/location/internal/ParcelableGeofence.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.location.internal; - -parcelable ParcelableGeofence; \ No newline at end of file diff --git a/play-services-location-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 deleted file mode 100644 index 10b7539c..00000000 --- a/play-services-location-api/src/main/aidl/com/google/android/gms/location/places/AutocompleteFilter.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.location.places; - -parcelable AutocompleteFilter; diff --git a/play-services-location-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 deleted file mode 100644 index b34605c8..00000000 --- a/play-services-location-api/src/main/aidl/com/google/android/gms/location/places/NearbyAlertRequest.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.location.places; - -parcelable NearbyAlertRequest; diff --git a/play-services-location-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 deleted file mode 100644 index 07a4eec6..00000000 --- a/play-services-location-api/src/main/aidl/com/google/android/gms/location/places/PlaceFilter.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.location.places; - -parcelable PlaceFilter; diff --git a/play-services-location-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 deleted file mode 100644 index 993899de..00000000 --- a/play-services-location-api/src/main/aidl/com/google/android/gms/location/places/PlaceReport.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.location.places; - -parcelable PlaceReport; diff --git a/play-services-location-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 deleted file mode 100644 index 8de920ef..00000000 --- a/play-services-location-api/src/main/aidl/com/google/android/gms/location/places/PlaceRequest.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.location.places; - -parcelable PlaceRequest; diff --git a/play-services-location-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 deleted file mode 100644 index aa543a60..00000000 --- a/play-services-location-api/src/main/aidl/com/google/android/gms/location/places/UserAddedPlace.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.location.places; - -parcelable UserAddedPlace; diff --git a/play-services-location-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 deleted file mode 100644 index 503493a3..00000000 --- a/play-services-location-api/src/main/aidl/com/google/android/gms/location/places/UserDataType.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.location.places; - -parcelable UserDataType; diff --git a/play-services-location-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 deleted file mode 100644 index 6e912606..00000000 --- a/play-services-location-api/src/main/aidl/com/google/android/gms/location/places/internal/IPlacesCallbacks.aidl +++ /dev/null @@ -1,9 +0,0 @@ -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/play-services-location-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 deleted file mode 100644 index fa569540..00000000 --- a/play-services-location-api/src/main/aidl/com/google/android/gms/location/places/internal/PlacesParams.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.location.places.internal; - -parcelable PlacesParams; diff --git a/play-services-location-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 deleted file mode 100644 index 4b1bf63c..00000000 --- a/play-services-location-api/src/main/aidl/com/google/android/gms/location/reporting/ReportingState.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.location.reporting; - -parcelable ReportingState; \ No newline at end of file diff --git a/play-services-location-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 deleted file mode 100644 index 69547d7e..00000000 --- a/play-services-location-api/src/main/aidl/com/google/android/gms/location/reporting/UploadRequest.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.location.reporting; - -parcelable UploadRequest; \ No newline at end of file diff --git a/play-services-location-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 deleted file mode 100644 index cf3ec3be..00000000 --- a/play-services-location-api/src/main/aidl/com/google/android/gms/location/reporting/UploadRequestResult.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.location.reporting; - -parcelable UploadRequestResult; \ No newline at end of file diff --git a/play-services-location-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 deleted file mode 100644 index 715b6779..00000000 --- a/play-services-location-api/src/main/aidl/com/google/android/gms/location/reporting/internal/IReportingService.aidl +++ /dev/null @@ -1,15 +0,0 @@ -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 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-location-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 deleted file mode 100644 index 42df9312..00000000 --- a/play-services-location-api/src/main/aidl/com/google/android/gms/maps/model/LatLng.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.maps.model; - -parcelable LatLng; diff --git a/play-services-location-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 deleted file mode 100644 index 70538794..00000000 --- a/play-services-location-api/src/main/aidl/com/google/android/gms/maps/model/LatLngBounds.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.maps.model; - -parcelable LatLngBounds; \ No newline at end of file diff --git a/play-services-location-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 deleted file mode 100644 index 4b67ed85..00000000 --- a/play-services-location-api/src/main/java/com/google/android/gms/location/ActivityRecognitionResult.java +++ /dev/null @@ -1,192 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.content.Intent; -import android.os.Bundle; - -import org.microg.gms.common.PublicApi; -import org.microg.safeparcel.AutoSafeParcelable; -import org.microg.safeparcel.SafeParcelUtil; -import org.microg.safeparcel.SafeParceled; - -import java.util.Collections; -import java.util.List; - -/** - * Result of an activity recognition. - *

- * It contains a list of activities that a user may have been doing at a particular time. The - * activities are sorted by the most probable activity first. A confidence is associated with each - * activity which indicates how likely that activity is. - *

- * {@link #getMostProbableActivity()} will return the most probable activity of the user at the time - * that activity recognition was run. - */ -@PublicApi -public class ActivityRecognitionResult extends AutoSafeParcelable { - - @PublicApi(exclude = true) - public static final String EXTRA_ACTIVITY_RESULT = "com.google.android.location.internal.EXTRA_ACTIVITY_RESULT"; - @PublicApi(exclude = true) - public static final String EXTRA_ACTIVITY_RESULT_LIST = "com.google.android.location.internal.EXTRA_ACTIVITY_RESULT_LIST"; - - @SafeParceled(1000) - private final int versionCode = 2; - - @SafeParceled(value = 1, subClass = DetectedActivity.class) - private final List probableActivities; - - @SafeParceled(2) - private final long time; - - @SafeParceled(3) - private final long elapsedRealtimeMillis; - - @SafeParceled(5) - private final Bundle extras; - - /** - * Constructs an ActivityRecognitionResult. - * - * @param probableActivities the activities that where detected, sorted by confidence (most probable first). - * @param time the UTC time of this detection, in milliseconds since January 1, 1970. - * @param elapsedRealtimeMillis milliseconds since boot - */ - public ActivityRecognitionResult(List probableActivities, long time, long elapsedRealtimeMillis) { - this(probableActivities, time, elapsedRealtimeMillis, null); - } - - /** - * Constructs an ActivityRecognitionResult from a single activity. - * - * @param activity the most probable activity of the device. - * @param time the UTC time of this detection, in milliseconds since January 1, 1970. - * @param elapsedRealtimeMillis milliseconds since boot - */ - public ActivityRecognitionResult(DetectedActivity activity, long time, long elapsedRealtimeMillis) { - this(Collections.singletonList(activity), time, elapsedRealtimeMillis); - } - - private ActivityRecognitionResult(List probableActivities, long time, long elapsedRealtimeMillis, Bundle extras) { - if (probableActivities == null || probableActivities.isEmpty()) - throw new IllegalArgumentException("Must have at least 1 detected activity"); - if (time <= 0 || elapsedRealtimeMillis <= 0) - throw new IllegalArgumentException("Must set times"); - this.probableActivities = probableActivities; - this.time = time; - this.elapsedRealtimeMillis = elapsedRealtimeMillis; - this.extras = extras; - } - - /** - * Extracts the ActivityRecognitionResult from an Intent. - *

- * This is a utility function which extracts the ActivityRecognitionResult from the extras of - * an Intent that was sent from the activity detection service. - * - * @return an ActivityRecognitionResult, or {@code null} if the intent doesn't contain an - * ActivityRecognitionResult. - */ - public static ActivityRecognitionResult extractResult(Intent intent) { - if (intent.hasExtra(EXTRA_ACTIVITY_RESULT_LIST)) { - intent.setExtrasClassLoader(ActivityRecognitionResult.class.getClassLoader()); - List list = intent.getParcelableArrayListExtra(EXTRA_ACTIVITY_RESULT_LIST); - if (list != null && !list.isEmpty()) - return list.get(list.size() - 1); - } - if (intent.hasExtra(EXTRA_ACTIVITY_RESULT)) { - Bundle extras = intent.getExtras(); - extras.setClassLoader(ActivityRecognitionResult.class.getClassLoader()); - Object res = extras.get(EXTRA_ACTIVITY_RESULT); - if (res instanceof ActivityRecognitionResult) - return (ActivityRecognitionResult) res; - if (res instanceof byte[]) - return SafeParcelUtil.fromByteArray((byte[]) res, CREATOR); - } - return null; - } - - /** - * Returns the confidence of the given activity type. - */ - public int getActivityConfidence(int activityType) { - for (DetectedActivity activity : probableActivities) { - if (activity.getType() == activityType) - return activity.getConfidence(); - } - return 0; - } - - /** - * Returns the elapsed real time of this detection in milliseconds since boot, including time - * spent in sleep as obtained by SystemClock.elapsedRealtime(). - */ - public long getElapsedRealtimeMillis() { - return elapsedRealtimeMillis; - } - - /** - * Returns the most probable activity of the user. - */ - public DetectedActivity getMostProbableActivity() { - return probableActivities.get(0); - } - - /** - * Returns the list of activities that where detected with the confidence value associated with - * each activity. The activities are sorted by most probable activity first. - *

- * The sum of the confidences of all detected activities this method returns does not have to - * be <= 100 since some activities are not mutually exclusive (for example, you can be walking - * while in a bus) and some activities are hierarchical (ON_FOOT is a generalization of WALKING - * and RUNNING). - */ - public List getProbableActivities() { - return probableActivities; - } - - /** - * Returns the UTC time of this detection, in milliseconds since January 1, 1970. - */ - public long getTime() { - return time; - } - - /** - * Returns true if an Intent contains an ActivityRecognitionResult. - *

- * This is a utility function that can be called from inside an intent receiver to make sure - * the received intent is from activity recognition. - * - * @return true if the intent contains an ActivityRecognitionResult, false otherwise or the given intent is null - */ - public static boolean hasResult(Intent intent) { - if (intent == null) return false; - if (intent.hasExtra(EXTRA_ACTIVITY_RESULT)) return true; - intent.setExtrasClassLoader(ActivityRecognitionResult.class.getClassLoader()); - List list = intent.getParcelableArrayListExtra(EXTRA_ACTIVITY_RESULT_LIST); - return list != null && !list.isEmpty(); - } - - @Override - public String toString() { - return "ActivityRecognitionResult [probableActivities=" + probableActivities + ", timeMillis" + time + ", elapsedRealtimeMillis=" + elapsedRealtimeMillis + "]"; - } - - public static final Creator CREATOR = new AutoCreator(ActivityRecognitionResult.class); -} diff --git a/play-services-location-api/src/main/java/com/google/android/gms/location/DetectedActivity.java b/play-services-location-api/src/main/java/com/google/android/gms/location/DetectedActivity.java deleted file mode 100644 index 4a75a4d2..00000000 --- a/play-services-location-api/src/main/java/com/google/android/gms/location/DetectedActivity.java +++ /dev/null @@ -1,166 +0,0 @@ -/* - * Copyright (C) 2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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; - -/** - * The detected activity of the device with an an associated confidence. See ActivityRecognitionApi - * for details on how to obtain a DetectedActivity. - */ -@PublicApi -public class DetectedActivity extends AutoSafeParcelable { - - /** - * The device is in a vehicle, such as a car. - */ - public static final int IN_VEHICLE = 0; - - /** - * The device is on a bicycle. - */ - public static final int ON_BICYCLE = 1; - - /** - * The device is on a user who is walking or running. - */ - public static final int ON_FOOT = 2; - - /** - * The device is on a user who is running. This is a sub-activity of ON_FOOT. - */ - public static final int RUNNING = 8; - - /** - * The device is still (not moving). - */ - public static final int STILL = 3; - - /** - * The device angle relative to gravity changed significantly. This often occurs when a device - * is picked up from a desk or a user who is sitting stands up. - */ - public static final int TILTING = 5; - - /** - * Unable to detect the current activity. - */ - public static final int UNKNOWN = 4; - - /** - * The device is on a user who is walking. This is a sub-activity of ON_FOOT. - */ - public static final int WALKING = 7; - - @SafeParceled(1000) - private int versionCode = 1; - - @SafeParceled(1) - private int type; - - @SafeParceled(2) - private int confidence; - - private DetectedActivity() { - } - - - /** - * Constructs a DetectedActivity. - * - * @param activityType the activity that was detected. - * @param confidence value from 0 to 100 indicating how likely it is that the user is performing this activity. - */ - public DetectedActivity(int activityType, int confidence) { - this.type = activityType; - this.confidence = confidence; - } - - @PublicApi(exclude = true) - public DetectedActivity(int versionCode, int type, int confidence) { - this.versionCode = versionCode; - this.type = type; - this.confidence = confidence; - } - - /** - * Returns a value from 0 to 100 indicating the likelihood that the user is performing this - * activity. - *

- * The larger the value, the more consistent the data used to perform the classification is - * with the detected activity. - *

- * This value will be <= 100. It means that larger values indicate that it's likely that the - * detected activity is correct, while a value of <= 50 indicates that there may be another - * activity that is just as or more likely. - *

- * Multiple activities may have high confidence values. For example, the ON_FOOT may have a - * confidence of 100 while the RUNNING activity may have a confidence of 95. The sum of the - * confidences of all detected activities for a classification does not have to be <= 100 since - * some activities are not mutually exclusive (for example, you can be walking while in a bus) - * and some activities are hierarchical (ON_FOOT is a generalization of WALKING and RUNNING). - */ - public int getConfidence() { - return confidence; - } - - /** - * Returns the type of activity that was detected. - */ - public int getType() { - return type; - } - - @PublicApi(exclude = true) - public int getVersionCode() { - return versionCode; - } - - @Override - public String toString() { - return "DetectedActivity [type=" + typeToString(getType()) + ", confidence=" + getConfidence() + "]"; - } - - @PublicApi(exclude = true) - public static String typeToString(int type) { - switch (type) { - case 0: - return "IN_VEHICLE"; - case 1: - return "ON_BICYCLE"; - case 2: - return "ON_FOOT"; - case 3: - return "STILL"; - case 4: - return "UNKNOWN"; - case 5: - return "TILTING"; - case 6: - default: - return Integer.toString(type); - case 7: - return "WALKING"; - case 8: - return "RUNNING"; - } - } - - public static final Creator CREATOR = new AutoCreator(DetectedActivity.class); -} diff --git a/play-services-location-api/src/main/java/com/google/android/gms/location/DeviceOrientation.java b/play-services-location-api/src/main/java/com/google/android/gms/location/DeviceOrientation.java deleted file mode 100644 index 2a17e926..00000000 --- a/play-services-location-api/src/main/java/com/google/android/gms/location/DeviceOrientation.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2022 microG Project Team - * SPDX-License-Identifier: Apache-2.0 - */ - -package com.google.android.gms.location; - -import org.microg.safeparcel.AutoSafeParcelable; - -import java.util.Arrays; - -public class DeviceOrientation extends AutoSafeParcelable { - @Field(1) - private float[] attitude = new float[4]; - @Field(2) - private int attitudeConfidence = -1; - @Field(3) - private int magConfidence = -1; - @Field(4) - private float headingDegrees = Float.NaN; - @Field(5) - private float headingErrorDegrees = Float.NaN; - @Field(6) - private final long elapsedRealtimeNanos = 0; - @Field(7) - private byte flags = 0; - @Field(8) - private float conservativeHeadingErrorVonMisesKappa = Float.NaN; - - public float[] getAttitude() { - if ((flags & 0x10) != 0) return attitude; - return new float[4]; - } - - public void setAttitude(float[] attitude) { - if (attitude.length != 4) throw new IllegalArgumentException(); - this.attitude = attitude; - flags = (byte) (flags | 0x10); - } - - public int getAttitudeConfidence() { - if ((flags & 0x1) != 0) return attitudeConfidence; - return -1; - } - - public void setAttitudeConfidence(int attitudeConfidence) { - this.attitudeConfidence = attitudeConfidence; - flags = (byte) (flags | 0x1); - } - - public int getMagConfidence() { - if ((flags & 0x2) != 0) return magConfidence; - return -1; - } - - public void setMagConfidence(int magConfidence) { - this.magConfidence = magConfidence; - flags = (byte) (flags | 0x2); - } - - public float getHeadingDegrees() { - if ((flags & 0x4) != 0) return headingDegrees; - return Float.NaN; - } - - public void setHeadingDegrees(float headingDegrees) { - this.headingDegrees = headingDegrees; - flags = (byte) (flags | 0x4); - } - - public float getHeadingErrorDegrees() { - if ((flags & 0x8) != 0) return headingErrorDegrees; - return Float.NaN; - } - - public void setHeadingErrorDegrees(float headingErrorDegrees) { - this.headingErrorDegrees = headingErrorDegrees; - flags = (byte) (flags | 0x8); - } - - public float getConservativeHeadingErrorVonMisesKappa() { - if ((flags & 0x20) != 0) return conservativeHeadingErrorVonMisesKappa; - return Float.NaN; - } - - public void setConservativeHeadingErrorVonMisesKappa(float conservativeHeadingErrorVonMisesKappa) { - this.conservativeHeadingErrorVonMisesKappa = conservativeHeadingErrorVonMisesKappa; - flags = (byte) (flags | 0x20); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("DeviceOrientation{"); - if ((flags & 0x10) != 0) - sb.append("attitude=").append(Arrays.toString(attitude)); - if ((flags & 0x1) != 0) - sb.append(", attitudeConfidence=").append(attitudeConfidence); - if ((flags & 0x2) != 0) - sb.append(", magConfidence=").append(magConfidence); - if ((flags & 0x4) != 0) - sb.append(", headingDegrees=").append(headingDegrees); - if ((flags & 0x8) != 0) - sb.append(", headingErrorDegrees=").append(headingErrorDegrees); - return "DeviceOrientation{" + - "attitude=" + Arrays.toString(attitude) + - ", attitudeConfidence=" + attitudeConfidence + - ", magConfidence=" + magConfidence + - ", headingDegrees=" + headingDegrees + - ", headingErrorDegrees=" + headingErrorDegrees + - ", elapsedRealtimeNanos=" + elapsedRealtimeNanos + - ", flags=" + flags + - ", conservativeHeadingErrorVonMisesKappa=" + conservativeHeadingErrorVonMisesKappa + - '}'; - } - - public static final Creator CREATOR = new AutoCreator(DeviceOrientation.class); -} diff --git a/play-services-location-api/src/main/java/com/google/android/gms/location/DeviceOrientationRequest.java b/play-services-location-api/src/main/java/com/google/android/gms/location/DeviceOrientationRequest.java deleted file mode 100644 index 14ce93c1..00000000 --- a/play-services-location-api/src/main/java/com/google/android/gms/location/DeviceOrientationRequest.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2022 microG Project Team - * SPDX-License-Identifier: Apache-2.0 - */ - -package com.google.android.gms.location; - -import android.os.SystemClock; - -import org.microg.safeparcel.AutoSafeParcelable; - -public class DeviceOrientationRequest extends AutoSafeParcelable { - @Field(1) - public boolean shouldUseMag; - @Field(2) - public long minimumSamplingPeriodMs; - @Field(3) - public float smallesAngleChangeRadians; - @Field(4) - public long expirationTime; - @Field(5) - public int numUpdates; - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("Request[shouldUseMag=").append(shouldUseMag); - sb.append(" minimumSamplingPeriod=").append(minimumSamplingPeriodMs).append("ms"); - sb.append(" smallesAngleChange=").append(smallesAngleChangeRadians).append("rad"); - if (expirationTime != Long.MAX_VALUE) - sb.append(" expireIn=").append(SystemClock.elapsedRealtime() - expirationTime).append("ms"); - if (numUpdates != Integer.MAX_VALUE) - sb.append(" num=").append(numUpdates); - sb.append("]"); - return sb.toString(); - } - - public static final Creator CREATOR = new AutoCreator(DeviceOrientationRequest.class); -} diff --git a/play-services-location-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 deleted file mode 100644 index 194aed75..00000000 --- a/play-services-location-api/src/main/java/com/google/android/gms/location/Geofence.java +++ /dev/null @@ -1,172 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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; - -import com.google.android.gms.location.internal.ParcelableGeofence; - -/** - * Represents a geographical region, also known as a geofence. Geofences can be monitored by - * geofencer service. And when the user crosses the boundary of a geofence, an alert will be - * generated. - */ -public interface Geofence { - int GEOFENCE_TRANSITION_DWELL = 4; - - /** - * The transition type indicating that the user enters the geofence(s). - */ - int GEOFENCE_TRANSITION_ENTER = 1; - - /** - * The transition type indicating that the user exits the geofence(s). - */ - int GEOFENCE_TRANSITION_EXIT = 2; - - /** - * Expiration value that indicates the geofence should never expire. - */ - long NEVER_EXPIRE = -1L; - - /** - * Returns the request ID of this geofence. The request ID is a string to identify this geofence - * inside your application. When two geofences with the same requestId are monitored, the new - * one will replace the old one regardless the geographical region these two geofences - * represent. - */ - String getRequestId(); - - /** - * A builder that builds {@link Geofence}. - */ - class Builder { - private int regionType = -1; - private double latitude; - private double longitude; - private float radius; - private long expirationTime = Long.MIN_VALUE; - private int loiteringDelay = -1; - private int notificationResponsiveness; - private String requestId; - private int transitionTypes; - - /** - * Creates a geofence object. - * - * @throws IllegalArgumentException if any parameters are not set or out of range - */ - public Geofence build() throws IllegalArgumentException { - if (requestId == null) { - throw new IllegalArgumentException("Request ID not set."); - } else if (transitionTypes == 0) { - throw new IllegalArgumentException("Transition types not set."); - } else if ((transitionTypes & GEOFENCE_TRANSITION_DWELL) > 0 && loiteringDelay < 0) { - throw new IllegalArgumentException("Non-negative loitering delay needs to be set when transition types include GEOFENCE_TRANSITION_DWELLING."); - } else if (expirationTime == Long.MIN_VALUE) { - throw new IllegalArgumentException("Expiration not set."); - } else if (regionType == -1) { - throw new IllegalArgumentException("Geofence region not set."); - } else if (notificationResponsiveness < 0) { - throw new IllegalArgumentException("Notification responsiveness should be nonnegative."); - } else { - return new ParcelableGeofence(requestId, expirationTime, regionType, latitude, longitude, radius, transitionTypes, notificationResponsiveness, loiteringDelay); - } - } - - /** - * Sets the region of this geofence. The geofence represents a circular area on a flat, horizontal plane. - * - * @param latitude latitude in degrees, between -90 and +90 inclusive - * @param longitude longitude in degrees, between -180 and +180 inclusive - * @param radius radius in meters - */ - public Builder setCircularRegion(double latitude, double longitude, float radius) { - this.regionType = 1; - this.latitude = latitude; - this.longitude = longitude; - this.radius = radius; - return this; - } - - /** - * Sets the expiration duration of geofence. This geofence will be removed automatically - * after this period of time. - * - * @param durationMillis time for this proximity alert, in milliseconds, or {@link #NEVER_EXPIRE} - * to indicate no expiration. When positive, this geofence will be - * removed automatically after this amount of time. - */ - public Builder setExpirationDuration(long durationMillis) { - if (durationMillis < 0) { - expirationTime = -1; - } else { - expirationTime = SystemClock.elapsedRealtime() + durationMillis; - } - return this; - } - - public Builder setLoiteringDelay(int loiteringDelayMs) { - this.loiteringDelay = loiteringDelayMs; - return this; - } - - /** - * Sets the best-effort notification responsiveness of the geofence. Defaults to 0. Setting - * a big responsiveness value, for example 5 minutes, can save power significantly. However, - * setting a very small responsiveness value, for example 5 seconds, doesn't necessarily - * mean you will get notified right after the user enters or exits a geofence: internally, - * the geofence might adjust the responsiveness value to save power when needed. - * - * @param notificationResponsivenessMs notificationResponsivenessMs (milliseconds) defines - * the best-effort description of how soon should the - * callback be called when the transition associated - * with the Geofence is triggered. For instance, if set - * to 300000 milliseconds the callback will be called 5 - * minutes within entering or exiting the geofence. - */ - public Builder setNotificationResponsiveness(int notificationResponsivenessMs) { - this.notificationResponsiveness = notificationResponsivenessMs; - return this; - } - - /** - * Sets the request ID of the geofence. Request ID is a string to identify this geofence - * inside your application. When two geofences with the same requestId are monitored, the - * new one will replace the old one regardless the geographical region these two geofences - * represent. - * - * @param requestId the request ID. The length of the string can be up to 100 characters. - */ - public Builder setRequestId(String requestId) { - this.requestId = requestId; - return this; - } - - /** - * Sets the transition types of interest. Alerts are only generated for the given transition - * types. - * - * @param transitionTypes geofence transition types of interest, as a bitwise-OR of - * GEOFENCE_TRANSITION_ flags. - */ - public Builder setTransitionTypes(int transitionTypes) { - this.transitionTypes = transitionTypes; - return this; - } - } -} diff --git a/play-services-location-api/src/main/java/com/google/android/gms/location/GeofenceStatusCodes.java b/play-services-location-api/src/main/java/com/google/android/gms/location/GeofenceStatusCodes.java deleted file mode 100644 index 8733e4cb..00000000 --- a/play-services-location-api/src/main/java/com/google/android/gms/location/GeofenceStatusCodes.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (C) 2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.CommonStatusCodes; - -public class GeofenceStatusCodes extends CommonStatusCodes { - /** - * Geofence service is not available now. Typically this is because the user turned off - * location access in settings > location access. - */ - public static final int GEOFENCE_NOT_AVAILABLE = 1000; - - /** - * Your app has registered more than 100 geofences. Remove unused ones before adding new - * geofences. - */ - public static final int GEOFENCE_TOO_MANY_GEOFENCES = 1001; - - /** - * You have provided more than 5 different PendingIntents to the addGeofences(GoogleApiClient, - * GeofencingRequest, PendingIntent) call. - */ - public static final int GEOFENCE_TOO_MANY_PENDING_INTENTS = 1002; - - /** - * Returns an untranslated debug (not user-friendly!) string based on the current status code. - */ - public static String getStatusCodeString(int statusCode) { - switch (statusCode) { - case GEOFENCE_NOT_AVAILABLE: - return "GEOFENCE_NOT_AVAILABLE"; - case GEOFENCE_TOO_MANY_GEOFENCES: - return "GEOFENCE_TOO_MANY_GEOFENCES"; - case GEOFENCE_TOO_MANY_PENDING_INTENTS: - return "GEOFENCE_TOO_MANY_PENDING_INTENTS"; - default: - return CommonStatusCodes.getStatusCodeString(statusCode); - } - } -} diff --git a/play-services-location-api/src/main/java/com/google/android/gms/location/GeofencingEvent.java b/play-services-location-api/src/main/java/com/google/android/gms/location/GeofencingEvent.java deleted file mode 100644 index 82b3a107..00000000 --- a/play-services-location-api/src/main/java/com/google/android/gms/location/GeofencingEvent.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright (C) 2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.content.Intent; -import android.location.Location; - -import com.google.android.gms.location.internal.ParcelableGeofence; - -import org.microg.gms.common.PublicApi; -import org.microg.safeparcel.SafeParcelUtil; - -import java.util.ArrayList; -import java.util.List; - -/** - * Represents an event from the GeofencingApi API. The event can be - *

- * A geofence triggering event generated when a geofence transition happens. - * An error happens after geofences are registered and being monitored. - */ -@PublicApi -public class GeofencingEvent { - @PublicApi(exclude = true) - public static final String EXTRA_ERROR_CODE = "gms_error_code"; - @PublicApi(exclude = true) - public static final String EXTRA_TRIGGERING_LOCATION = "com.google.android.location.intent.extra.triggering_location"; - @PublicApi(exclude = true) - public static final String EXTRA_TRANSITION = "com.google.android.location.intent.extra.transition"; - @PublicApi(exclude = true) - public static final String EXTRA_GEOFENCE_LIST = "com.google.android.location.intent.extra.geofence_list"; - - private int errorCode; - private int geofenceTransition; - private List triggeringGeofences; - private Location triggeringLocation; - - /** - * Creates a {@link GeofencingEvent} object from the given intent. - * - * @param intent the intent to extract the geofencing event data from - * @return a {@link GeofencingEvent} object or {@code null} if the given intent is {@code null} - */ - public static GeofencingEvent fromIntent(Intent intent) { - if (intent == null) { - return null; - } - GeofencingEvent event = new GeofencingEvent(); - event.errorCode = intent.getIntExtra(EXTRA_ERROR_CODE, -1); - event.geofenceTransition = intent.getIntExtra(EXTRA_TRANSITION, -1); - if (event.geofenceTransition != 1 && event.geofenceTransition != 2 && event.geofenceTransition != 4) - event.geofenceTransition = -1; - ArrayList parceledGeofences = (ArrayList) intent.getSerializableExtra(EXTRA_GEOFENCE_LIST); - if (parceledGeofences != null) { - event.triggeringGeofences = new ArrayList(); - for (byte[] parceledGeofence : parceledGeofences) { - event.triggeringGeofences.add(SafeParcelUtil.fromByteArray(parceledGeofence, ParcelableGeofence.CREATOR)); - } - } - event.triggeringLocation = intent.getParcelableExtra(EXTRA_TRIGGERING_LOCATION); - return event; - } - - /** - * Returns the error code that explains the error that triggered the intent specified in - * {@link #fromIntent(Intent)}. - * - * @return the error code specified in {@link GeofenceStatusCodes} or {@code -1} if - * {@link #hasError()} returns false. - */ - public int getErrorCode() { - return errorCode; - } - - /** - * Returns the transition type of the geofence transition alert. - * - * @return -1 if the intent specified in {@link #fromIntent(Intent)} is not generated for a - * transition alert; Otherwise returns the GEOFENCE_TRANSITION_ flags value defined in - * {@link Geofence}. - */ - public int getGeofenceTransition() { - return geofenceTransition; - } - - - /** - * Returns a list of geofences that triggered this geofence transition alert. - * - * @return a list of geofences that triggered this geofence transition alert or {@code null} if - * the intent specified in {@link #fromIntent(Intent)} is not generated for a geofence - * transition alert - */ - public List getTriggeringGeofences() { - return triggeringGeofences; - } - - /** - * Gets the location that triggered the geofence transition. Triggering location is only - * available if the calling app links against Google Play services 5.0 SDK. - * - * @return the location that triggered this geofence alert or {@code null} if it's not included - * in the intent specified in {@link #fromIntent(Intent)} - */ - public Location getTriggeringLocation() { - return triggeringLocation; - } - - /** - * Whether an error triggered this intent. - * - * @return {@code true} if an error triggered the intent specified in - * {@link #fromIntent(Intent)}, otherwise {@code false} - */ - public boolean hasError() { - return errorCode != -1; - } -} diff --git a/play-services-location-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 deleted file mode 100644 index 2601d629..00000000 --- a/play-services-location-api/src/main/java/com/google/android/gms/location/GeofencingRequest.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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; - -/** - * TODO: usage - */ -public class GeofencingRequest extends AutoSafeParcelable { - - public static final Creator CREATOR = new AutoCreator(GeofencingRequest.class); -} diff --git a/play-services-location-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 deleted file mode 100644 index 5222b259..00000000 --- a/play-services-location-api/src/main/java/com/google/android/gms/location/GestureRequest.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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-location-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 deleted file mode 100644 index 629be5e1..00000000 --- a/play-services-location-api/src/main/java/com/google/android/gms/location/LocationAvailability.java +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.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 LocationCallback registered via FusedLocationProviderApi#requestLocationUpdates(GoogleApiClient, LocationRequest, LocationCallback, Looper) - * or from a PendingIntent registered via FusedLocationProviderApi#requestLocationUpdates(GoogleApiClient, LocationRequest, PendingIntent). - * It is also available on demand via FusedLocationProviderApi#getLocationAvailability(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 final int versionCode = 2; - - @SafeParceled(1) - @PublicApi(exclude = true) - public int cellStatus; - - @SafeParceled(2) - @PublicApi(exclude = true) - public int wifiStatus; - - @SafeParceled(3) - @PublicApi(exclude = true) - public long elapsedRealtimeNs; - - @SafeParceled(4) - @PublicApi(exclude = true) - public int locationStatus; - - @PublicApi(exclude = true) - public LocationAvailability() { - } - - @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); -} diff --git a/play-services-location-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 deleted file mode 100644 index beeda85d..00000000 --- a/play-services-location-api/src/main/java/com/google/android/gms/location/LocationRequest.java +++ /dev/null @@ -1,524 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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; - -import org.microg.safeparcel.AutoSafeParcelable; - -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. - */ -public class LocationRequest extends AutoSafeParcelable { - - /** - * 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; - - @Field(1000) - private final int versionCode = 1; - @Field(1) - private int priority; - @Field(2) - private long interval; - @Field(3) - private long fastestInterval; - @Field(4) - private boolean explicitFastestInterval; - @Field(5) - private long expirationTime; - @Field(6) - private int numUpdates; - @Field(7) - private float smallestDisplacement; - @Field(8) - private long maxWaitTime; - @Field(9) - private boolean waitForAccurateLocation; - - public LocationRequest() { - 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.smallestDisplacement = 0; - this.maxWaitTime = 0; - } - - /** - * 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(); - } - - /** - * 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; - } - - /** - * Gets the maximum wait time in milliseconds for location updates. If the wait time is smaller than the interval - * requested with {@link #setInterval(long)}, then the interval will be used instead. - * - * @return maximum wait time in milliseconds, inexact - * @see #setMaxWaitTime(long) - */ - public long getMaxWaitTime() { - return maxWaitTime; - } - - /** - * 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 getSmallestDisplacement() { - return smallestDisplacement; - } - - @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; - return Float.compare(that.smallestDisplacement, smallestDisplacement) == 0; - } - - @Override - public int hashCode() { - return Arrays.hashCode( - new Object[]{priority, interval, fastestInterval, explicitFastestInterval, - explicitFastestInterval, numUpdates, smallestDisplacement, maxWaitTime - }); - } - - /** - * Returns whether or not the fastest interval was explicitly specified for the location request. - * - * @return True if the fastest interval was explicitly set for the location request; false otherwise - */ - public boolean isFastestIntervalExplicitlySet() { - return explicitFastestInterval; - } - - /** - * Returns whether the location services will wait a few seconds initially for accurate locations, if accurate - * locations cannot be computed on the device for {@link #PRIORITY_HIGH_ACCURACY} requests. - */ - public boolean isWaitForAccurateLocation() { - return waitForAccurateLocation; - } - - /** - * 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; - explicitFastestInterval = true; - 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; - } - - /** - * Sets the maximum wait time in milliseconds for location updates. - *

- * If you pass a value at least 2x larger than the interval specified with {@link #setInterval(long)}, then - * location delivery may be delayed and multiple locations can be delivered at once. Locations are determined at - * the {@link #setInterval(long)} rate, but can be delivered in batch after the interval you set in this method. - * This can consume less battery and give more accurate locations, depending on the device's hardware capabilities. - * You should set this value to be as large as possible for your needs if you don't need immediate location - * delivery. - * - * @param millis desired maximum wait time in millisecond, inexact - * @return the same object, so that setters can be chained - * @throws IllegalArgumentException if the interval is less than zero - */ - public LocationRequest setMaxWaitTime(long millis) throws IllegalArgumentException { - if (millis < 0) - throw new IllegalArgumentException("interval must not be negative"); - maxWaitTime = 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 setSmallestDisplacement(float smallestDisplacementMeters) { - if (smallestDisplacementMeters < 0) - throw new IllegalArgumentException("smallestDisplacementMeters must not be negative"); - this.smallestDisplacement = smallestDisplacementMeters; - return this; - } - - /** - * Sets whether the client wants the locations services to wait a few seconds for accurate locations initially, - * when accurate locations could not be computed on the device immediately after {@link #PRIORITY_HIGH_ACCURACY} - * request is made. By default the location services will wait for accurate locations. - *

- * Note that this only applies to clients with {@link #PRIORITY_HIGH_ACCURACY} requests. - *

- * Also note this only applies to the initial locations computed right after the location request is added. The - * following inaccurate locations may still be delivered to the clients without delay. - */ - public LocationRequest setWaitForAccurateLocation(boolean waitForAccurateLocation) { - this.waitForAccurateLocation = waitForAccurateLocation; - return this; - } - - private static String priorityToString(int priority) { - switch (priority) { - case PRIORITY_HIGH_ACCURACY: - return "PRIORITY_HIGH_ACCURACY"; - case PRIORITY_BALANCED_POWER_ACCURACY: - return "PRIORITY_BALANCED_POWER_ACCURACY"; - case PRIORITY_LOW_POWER: - return "PRIORITY_LOW_POWER"; - case PRIORITY_NO_POWER: - return "PRIORITY_NO_POWER"; - default: - return "???"; - } - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("Request["); - sb.append(priorityToString(priority)); - if (priority != PRIORITY_NO_POWER) - sb.append(" requested=").append(interval).append("ms"); - sb.append(" fastest=").append(fastestInterval).append("ms"); - if (maxWaitTime > interval) - sb.append(" maxWait=").append(maxWaitTime).append("ms"); - if (smallestDisplacement > 0) - sb.append(" smallestDisplacement=").append(smallestDisplacement).append("m"); - if (expirationTime != Long.MAX_VALUE) - sb.append(" expireIn=").append(SystemClock.elapsedRealtime() - expirationTime).append("ms"); - if (numUpdates != Integer.MAX_VALUE) - sb.append(" num=").append(numUpdates); - sb.append("]"); - return sb.toString(); - } - - public static final Creator CREATOR = new AutoCreator(LocationRequest.class); -} diff --git a/play-services-location-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 deleted file mode 100644 index 60c11544..00000000 --- a/play-services-location-api/src/main/java/com/google/android/gms/location/LocationResult.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 final 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-location-api/src/main/java/com/google/android/gms/location/LocationSettingsConfiguration.java b/play-services-location-api/src/main/java/com/google/android/gms/location/LocationSettingsConfiguration.java deleted file mode 100644 index 29dabea9..00000000 --- a/play-services-location-api/src/main/java/com/google/android/gms/location/LocationSettingsConfiguration.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2021, microG Project Team - * SPDX-License-Identifier: Apache-2.0 - */ - -package com.google.android.gms.location; - -import org.microg.safeparcel.AutoSafeParcelable; - -public class LocationSettingsConfiguration extends AutoSafeParcelable { - @Field(1) - public String justificationText; - @Field(2) - public String experimentId; - @Field(5) - public String titleText; - - public static final Creator CREATOR = new AutoCreator<>(LocationSettingsConfiguration.class); -} diff --git a/play-services-location-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 deleted file mode 100644 index 60f376cf..00000000 --- a/play-services-location-api/src/main/java/com/google/android/gms/location/LocationSettingsRequest.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2015, microG Project Team - * SPDX-License-Identifier: Apache-2.0 - */ - -package com.google.android.gms.location; - -import org.microg.gms.common.PublicApi; -import org.microg.safeparcel.AutoSafeParcelable; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -@PublicApi -public class LocationSettingsRequest extends AutoSafeParcelable { - @Field(1000) - private final int versionCode = 2; - - @Field(value = 1, subClass = LocationRequest.class) - @PublicApi(exclude = true) - public List requests; - - @Field(2) - @PublicApi(exclude = true) - public boolean alwaysShow; - - @Field(3) - @PublicApi(exclude = true) - public boolean needBle; - - @Field(5) - @PublicApi(exclude = true) - public LocationSettingsConfiguration configuration; - - private LocationSettingsRequest() { - } - - private LocationSettingsRequest(List requests, boolean alwaysShow, boolean needBle, LocationSettingsConfiguration configuration) { - this.requests = requests; - this.alwaysShow = alwaysShow; - this.needBle = needBle; - this.configuration = configuration; - } - - /** - * A builder that builds {@link LocationSettingsRequest}. - */ - public static class Builder { - private final List requests = new ArrayList(); - private boolean alwaysShow = false; - private boolean needBle = false; - - /** - * Adds a collection of {@link LocationRequest}s that the client is interested in. Settings - * will be checked for optimal performance of all {@link LocationRequest}s. - */ - public Builder addAllLocationRequests(Collection requests) { - this.requests.addAll(requests); - return this; - } - - /** - * Adds one {@link LocationRequest} that the client is interested in. Settings will be - * checked for optimal performance of all {@link LocationRequest}s. - */ - public Builder addLocationRequest(LocationRequest request) { - requests.add(request); - return this; - } - - /** - * Creates a LocationSettingsRequest that can be used with SettingsApi. - */ - public LocationSettingsRequest build() { - return new LocationSettingsRequest(requests, alwaysShow, needBle, null); - } - - /** - * Whether or not location is required by the calling app in order to continue. Set this to - * true if location is required to continue and false if having location provides better - * results, but is not required. This changes the wording/appearance of the dialog - * accordingly. - */ - public Builder setAlwaysShow(boolean show) { - alwaysShow = show; - return this; - } - - /** - * Sets whether the client wants BLE scan to be enabled. When this flag is set to true, if - * the platform supports BLE scan mode and Bluetooth is off, the dialog will prompt the - * user to enable BLE scan. If the platform doesn't support BLE scan mode, the dialog will - * prompt to enable Bluetooth. - */ - public Builder setNeedBle(boolean needBle) { - this.needBle = needBle; - return this; - } - } - - public static final Creator CREATOR = new AutoCreator(LocationSettingsRequest.class); -} diff --git a/play-services-location-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 deleted file mode 100644 index f5f55e85..00000000 --- a/play-services-location-api/src/main/java/com/google/android/gms/location/LocationSettingsResult.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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; - -/** - * Result of checking settings via checkLocationSettings(GoogleApiClient, LocationSettingsRequest), - * indicates whether a dialog should be shown to ask the user's consent to change their settings. - * The method getStatus() can be be used to confirm if the request was successful. If the current - * location settings don't satisfy the app's requirements and the user has permission to change the - * settings, the app could use startResolutionForResult(Activity, int) to start an intent to show a - * dialog, asking for user's consent to change the settings. The current location settings states - * can be accessed via getLocationSettingsStates(). See LocationSettingsResult for more details. - */ -@PublicApi -public class LocationSettingsResult extends AutoSafeParcelable implements Result { - - @SafeParceled(1000) - private final int versionCode = 1; - - @SafeParceled(1) - private final Status status; - - @SafeParceled(2) - private LocationSettingsStates settings; - - - /** - * Retrieves the location settings states. - */ - 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-location-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 deleted file mode 100644 index 092666a4..00000000 --- a/play-services-location-api/src/main/java/com/google/android/gms/location/LocationSettingsStates.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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; - -/** - * Stores the current states of all location-related settings. - */ -@PublicApi -public class LocationSettingsStates extends AutoSafeParcelable { - - @SafeParceled(1000) - private final int versionCode = 2; - - @SafeParceled(1) - private final boolean gpsUsable; - - @SafeParceled(2) - private final boolean networkLocationUsable; - - @SafeParceled(3) - private final boolean bleUsable; - - @SafeParceled(4) - private final boolean gpsPresent; - - @SafeParceled(5) - private final boolean networkLocationPresent; - - @SafeParceled(6) - private final 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; - } - - public static final Creator CREATOR = new AutoCreator(LocationSettingsStates.class); -} diff --git a/play-services-location-api/src/main/java/com/google/android/gms/location/LocationSettingsStatusCodes.java b/play-services-location-api/src/main/java/com/google/android/gms/location/LocationSettingsStatusCodes.java deleted file mode 100644 index 028de68c..00000000 --- a/play-services-location-api/src/main/java/com/google/android/gms/location/LocationSettingsStatusCodes.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.CommonStatusCodes; -import com.google.android.gms.common.api.Status; - -import org.microg.gms.common.PublicApi; - -/** - * Location settings specific status codes, for use in {@link Status#getStatusCode()} - */ -@PublicApi -public class LocationSettingsStatusCodes extends CommonStatusCodes { - /** - * Location settings can't be changed to meet the requirements, no dialog pops up - */ - public static final int SETTINGS_CHANGE_UNAVAILABLE = 8502; -} diff --git a/play-services-location-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 deleted file mode 100644 index ba82860d..00000000 --- a/play-services-location-api/src/main/java/com/google/android/gms/location/LocationStatus.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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; -import org.microg.safeparcel.SafeParceled; - -import java.util.Arrays; - -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; - 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 = 1; - @SafeParceled(1) - int cellStatus; - @SafeParceled(2) - int wifiStatus; - @SafeParceled(3) - long elapsedRealtimeNanos; - - @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; - return wifiStatus == that.wifiStatus; - } - - @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"; - } - } - - public static final Creator CREATOR = new AutoCreator(LocationStatus.class); -} diff --git a/play-services-location-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 deleted file mode 100644 index a92c6516..00000000 --- a/play-services-location-api/src/main/java/com/google/android/gms/location/internal/ClientIdentity.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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; - -public class ClientIdentity extends AutoSafeParcelable { - public static final Creator CREATOR = new AutoCreator(ClientIdentity.class); -} diff --git a/play-services-location-api/src/main/java/com/google/android/gms/location/internal/DeviceOrientationRequestInternal.java b/play-services-location-api/src/main/java/com/google/android/gms/location/internal/DeviceOrientationRequestInternal.java deleted file mode 100644 index 5b66feaa..00000000 --- a/play-services-location-api/src/main/java/com/google/android/gms/location/internal/DeviceOrientationRequestInternal.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2022 microG Project Team - * SPDX-License-Identifier: Apache-2.0 - */ - -package com.google.android.gms.location.internal; - -import com.google.android.gms.location.DeviceOrientationRequest; - -import org.microg.safeparcel.AutoSafeParcelable; - -import java.util.List; - -public class DeviceOrientationRequestInternal extends AutoSafeParcelable { - - @Field(1) - public DeviceOrientationRequest request; - - @Field(value = 2, subClass = ClientIdentity.class) - public List clients; - - @Field(3) - public String tag; - - @Override - public String toString() { - return "DeviceOrientationRequestInternal{" + - "request=" + request + - ", clients=" + clients + - ", tag='" + tag + '\'' + - '}'; - } - - public static final Creator CREATOR = new AutoCreator(DeviceOrientationRequestInternal.class); -} diff --git a/play-services-location-api/src/main/java/com/google/android/gms/location/internal/DeviceOrientationRequestUpdateData.java b/play-services-location-api/src/main/java/com/google/android/gms/location/internal/DeviceOrientationRequestUpdateData.java deleted file mode 100644 index 5a2e759e..00000000 --- a/play-services-location-api/src/main/java/com/google/android/gms/location/internal/DeviceOrientationRequestUpdateData.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2022 microG Project Team - * SPDX-License-Identifier: Apache-2.0 - */ - -package com.google.android.gms.location.internal; - -import com.google.android.gms.location.IDeviceOrientationListener; - -import org.microg.safeparcel.AutoSafeParcelable; - -public class DeviceOrientationRequestUpdateData extends AutoSafeParcelable { - public static final int REQUEST_UPDATES = 1; - public static final int REMOVE_UPDATES = 2; - - @Field(1) - public int opCode; - - @Field(2) - public DeviceOrientationRequestInternal request; - - @Field(3) - public IDeviceOrientationListener listener; - - @Field(4) - public IFusedLocationProviderCallback fusedLocationProviderCallback; - - @Override - public String toString() { - return "DeviceOrientationRequestUpdateData{" + - "opCode=" + opCode + - ", request=" + request + - ", listener=" + (listener != null ? listener.asBinder() : null) + - ", fusedLocationProviderCallback=" + (fusedLocationProviderCallback != null ? fusedLocationProviderCallback.asBinder() : null) + - '}'; - } - - public static final Creator CREATOR = new AutoCreator(DeviceOrientationRequestUpdateData.class); -} diff --git a/play-services-location-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 deleted file mode 100644 index 1dfbedde..00000000 --- a/play-services-location-api/src/main/java/com/google/android/gms/location/internal/FusedLocationProviderResult.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 final 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-location-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 deleted file mode 100644 index 7d5fc3ad..00000000 --- a/play-services-location-api/src/main/java/com/google/android/gms/location/internal/LocationRequestInternal.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.location.LocationRequest; - -import org.microg.safeparcel.AutoSafeParcelable; - -import java.util.List; - -public class LocationRequestInternal extends AutoSafeParcelable { - - @Field(1000) - private final int versionCode = 1; - - @Field(1) - public LocationRequest request; - - @Field(2) @Deprecated - public boolean requestNlpDebugInfo; - - @Field(3) @Deprecated - public boolean restorePendingIntentListeners; - - @Field(4) @Deprecated - public boolean triggerUpdate; - - @Field(value = 5, subClass = ClientIdentity.class) - public List clients; - - @Field(6) - public String tag; - - @Field(7) - public boolean hideFromAppOps; - - @Field(8) - public boolean forceCoarseLocation; - - @Field(9) - public boolean exemptFromThrottle; - - @Field(10) - public String moduleId; - - @Field(11) - public boolean locationSettingsIgnored; - - @Field(12) - public boolean inaccurateLocationsDelayed; - - @Field(13) - public String contextAttributeTag; - - @Override - public String toString() { - return "LocationRequestInternal{" + - "request=" + request + - ", requestNlpDebugInfo=" + requestNlpDebugInfo + - ", restorePendingIntentListeners=" + restorePendingIntentListeners + - ", triggerUpdate=" + triggerUpdate + - ", clients=" + clients + - ", tag='" + tag + '\'' + - ", hideFromAppOps=" + hideFromAppOps + - ", forceCoarseLocation=" + forceCoarseLocation + - ", exemptFromThrottle=" + exemptFromThrottle + - ", moduleId=" + moduleId + - ", locationSettingsIgnored=" + locationSettingsIgnored + - ", inaccurateLocationsDelayed=" + inaccurateLocationsDelayed + - ", contextAttributeTag=" + contextAttributeTag + - '}'; - } - - public static final Creator CREATOR = new AutoCreator(LocationRequestInternal.class); -} diff --git a/play-services-location-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 deleted file mode 100644 index 41c1edb8..00000000 --- a/play-services-location-api/src/main/java/com/google/android/gms/location/internal/LocationRequestUpdateData.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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; - - @SafeParceled(6) - public IFusedLocationProviderCallback fusedLocationProviderCallback; - - @Override - public String toString() { - return "LocationRequestUpdateData{" + - "opCode=" + opCode + - ", request=" + request + - ", listener=" + (listener != null ? listener.asBinder() : null) + - ", pendingIntent=" + pendingIntent + - ", callback=" + (callback != null ? callback.asBinder() : null) + - ", fusedLocationProviderCallback=" + (fusedLocationProviderCallback != null ? fusedLocationProviderCallback.asBinder() : null) + - '}'; - } - - public static final Creator CREATOR = new AutoCreator(LocationRequestUpdateData.class); -} diff --git a/play-services-location-api/src/main/java/com/google/android/gms/location/internal/ParcelableGeofence.java b/play-services-location-api/src/main/java/com/google/android/gms/location/internal/ParcelableGeofence.java deleted file mode 100644 index d21c02b6..00000000 --- a/play-services-location-api/src/main/java/com/google/android/gms/location/internal/ParcelableGeofence.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (C) 2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.location.Geofence; - -import org.microg.safeparcel.AutoSafeParcelable; -import org.microg.safeparcel.SafeParceled; - -public class ParcelableGeofence extends AutoSafeParcelable implements Geofence { - - @SafeParceled(1000) - private final int versionCode = 1; - - @SafeParceled(1) - public String requestId; - - @SafeParceled(2) - public long expirationTime; - - @SafeParceled(3) - public int regionType; - - @SafeParceled(4) - public double latitude; - - @SafeParceled(5) - public double longitude; - - @SafeParceled(6) - public float radius; - - @SafeParceled(7) - public int transitionType; - - @SafeParceled(8) - public int notificationResponsiveness; - - @SafeParceled(9) - public int loiteringDelay; - - private ParcelableGeofence() { - } - - public ParcelableGeofence(String requestId, long expirationTime, int regionType, double latitude, double longitude, float radius, int transitionType, int notificationResponsiveness, int loiteringDelay) { - this.requestId = requestId; - this.expirationTime = expirationTime; - this.regionType = regionType; - this.latitude = latitude; - this.longitude = longitude; - this.radius = radius; - this.transitionType = transitionType; - this.notificationResponsiveness = notificationResponsiveness; - this.loiteringDelay = loiteringDelay; - } - - @Override - public String getRequestId() { - return requestId; - } - - public static final Creator CREATOR = new AutoCreator(ParcelableGeofence.class); -} diff --git a/play-services-location-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 deleted file mode 100644 index 6ad8c792..00000000 --- a/play-services-location-api/src/main/java/com/google/android/gms/location/places/AutocompleteFilter.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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; -import org.microg.safeparcel.SafeParceled; - -/** - * TODO usage - */ -public class AutocompleteFilter extends AutoSafeParcelable { - - @SafeParceled(1000) - private final int versionCode = 1; - - public static final Creator CREATOR = new AutoCreator(AutocompleteFilter.class); -} diff --git a/play-services-location-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 deleted file mode 100644 index 97c7b7e8..00000000 --- a/play-services-location-api/src/main/java/com/google/android/gms/location/places/NearbyAlertRequest.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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; - -/** - * TODO: usage - */ -public class NearbyAlertRequest extends AutoSafeParcelable { - - public static final Creator CREATOR = new AutoCreator(NearbyAlertRequest.class); -} diff --git a/play-services-location-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 deleted file mode 100644 index 25ad8f3f..00000000 --- a/play-services-location-api/src/main/java/com/google/android/gms/location/places/Place.java +++ /dev/null @@ -1,384 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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-location-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 deleted file mode 100644 index 22bffb6b..00000000 --- a/play-services-location-api/src/main/java/com/google/android/gms/location/places/PlaceFilter.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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; - -/** - * TODO: usage - */ -public class PlaceFilter extends AutoSafeParcelable { - - public static final Creator CREATOR = new AutoCreator(PlaceFilter.class); -} diff --git a/play-services-location-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 deleted file mode 100644 index 5919e691..00000000 --- a/play-services-location-api/src/main/java/com/google/android/gms/location/places/PlaceReport.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.gms.common.PublicApi; -import org.microg.safeparcel.AutoSafeParcelable; -import org.microg.safeparcel.SafeParceled; - -@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-location-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 deleted file mode 100644 index ed6a8556..00000000 --- a/play-services-location-api/src/main/java/com/google/android/gms/location/places/PlaceRequest.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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; - -/** - * TODO: usage - */ -public class PlaceRequest extends AutoSafeParcelable { - public static final Creator CREATOR = new AutoCreator(PlaceRequest.class); -} diff --git a/play-services-location-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 deleted file mode 100644 index e844f20a..00000000 --- a/play-services-location-api/src/main/java/com/google/android/gms/location/places/UserAddedPlace.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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; -import org.microg.safeparcel.SafeParceled; - -/** - * TODO: usage - */ -public class UserAddedPlace extends AutoSafeParcelable { - - @SafeParceled(1000) - private final int versionCode = 1; - - public static final Creator CREATOR = new AutoCreator(UserAddedPlace.class); -} diff --git a/play-services-location-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 deleted file mode 100644 index 2e8776fd..00000000 --- a/play-services-location-api/src/main/java/com/google/android/gms/location/places/UserDataType.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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; - -/** - * TODO: usage - */ -public class UserDataType extends AutoSafeParcelable { - - public static final Creator CREATOR = new AutoCreator(UserDataType.class); -} diff --git a/play-services-location-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 deleted file mode 100644 index 3836a93d..00000000 --- a/play-services-location-api/src/main/java/com/google/android/gms/location/places/internal/PlaceImpl.java +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 final 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-location-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 deleted file mode 100644 index c87ae3d3..00000000 --- a/play-services-location-api/src/main/java/com/google/android/gms/location/places/internal/PlacesParams.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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; -import org.microg.safeparcel.SafeParceled; - -public class PlacesParams extends AutoSafeParcelable { - - @SafeParceled(1000) - private final int versionCode = 1; - @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() { - clientPackageName = locale = accountName = gCoreClientName = null; - } - - public static final Creator CREATOR = new AutoCreator(PlacesParams.class); -} diff --git a/play-services-location-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 deleted file mode 100644 index 1a223471..00000000 --- a/play-services-location-api/src/main/java/com/google/android/gms/location/reporting/ReportingState.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 = 2; - @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; - @SafeParceled(9) - public int expectedOptInResultAssumingLocationEnabled; - - public static final Creator CREATOR = new AutoCreator(ReportingState.class); -} diff --git a/play-services-location-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 deleted file mode 100644 index d3896f3c..00000000 --- a/play-services-location-api/src/main/java/com/google/android/gms/location/reporting/UploadRequest.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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-location-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 deleted file mode 100644 index 2937a81c..00000000 --- a/play-services-location-api/src/main/java/com/google/android/gms/location/reporting/UploadRequestResult.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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); -} diff --git a/play-services-location-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 deleted file mode 100644 index 12ff93a5..00000000 --- a/play-services-location-api/src/main/java/com/google/android/gms/maps/model/LatLng.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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; -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 = 1; - /** - * Latitude, in degrees. This value is in the range [-90, 90]. - */ - @SafeParceled(2) - public final double latitude; - /** - * Longitude, in degrees. This value is in the range [-180, 180). - */ - @SafeParceled(3) - public final double longitude; - - /** - * 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() { - latitude = longitude = 0; - } - - /** - * 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.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); - } - } - - /** - * 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; - - LatLng latLng = (LatLng) o; - - if (Double.compare(latLng.latitude, latitude) != 0) - return false; - return Double.compare(latLng.longitude, longitude) == 0; - } - - @Override - public final int hashCode() { - long tmp1 = Double.doubleToLongBits(latitude); - int tmp2 = 31 + (int) (tmp1 ^ tmp1 >>> 32); - tmp1 = Double.doubleToLongBits(longitude); - return tmp2 * 31 + (int) (tmp1 ^ tmp1 >>> 32); - } - - @Override - public String toString() { - return "lat/lng: (" + latitude + "," + longitude + ")"; - } - - public static Creator CREATOR = new AutoCreator(LatLng.class); -} diff --git a/play-services-location-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 deleted file mode 100644 index 9aa4c12e..00000000 --- a/play-services-location-api/src/main/java/com/google/android/gms/maps/model/LatLngBounds.java +++ /dev/null @@ -1,224 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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; -import org.microg.safeparcel.AutoSafeParcelable; -import org.microg.safeparcel.SafeParceled; - -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 = 1; - /** - * Southwest corner of the bound. - */ - @SafeParceled(2) - public final LatLng southwest; - /** - * Northeast corner of the bound. - */ - @SafeParceled(3) - public final LatLng 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() { - southwest = northeast = null; - } - - /** - * 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.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 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; - return southwest.equals(that.southwest); - } - - /** - * 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 + - '}'; - } - - 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. - */ - 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/play-services-location-api/src/main/java/org/microg/gms/location/LocationConstants.java b/play-services-location-api/src/main/java/org/microg/gms/location/LocationConstants.java deleted file mode 100644 index fc256bc6..00000000 --- a/play-services-location-api/src/main/java/org/microg/gms/location/LocationConstants.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES 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"; - - // 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"; -} diff --git a/play-services-location/build.gradle b/play-services-location/build.gradle deleted file mode 100644 index 4e439ddd..00000000 --- a/play-services-location/build.gradle +++ /dev/null @@ -1,39 +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. - */ - -apply plugin: 'com.android.library' - -android { - compileSdkVersion androidCompileSdk - buildToolsVersion "30.0.3" - - defaultConfig { - minSdkVersion androidMinSdk - targetSdkVersion androidTargetSdk - } - - compileOptions { - sourceCompatibility = 1.8 - targetCompatibility = 1.8 - } -} - -dependencies { - api project(':play-services-base') - api project(':play-services-location-api') - - implementation 'androidx.annotation:annotation:1.3.0' -} \ No newline at end of file diff --git a/play-services-location/gradle.properties b/play-services-location/gradle.properties deleted file mode 100644 index bfc9b4b2..00000000 --- a/play-services-location/gradle.properties +++ /dev/null @@ -1,34 +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. -# - -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-location/src/main/AndroidManifest.xml b/play-services-location/src/main/AndroidManifest.xml deleted file mode 100644 index 79e10fc2..00000000 --- a/play-services-location/src/main/AndroidManifest.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - diff --git a/play-services-location/src/main/java/com/google/android/gms/location/ActivityRecognition.java b/play-services-location/src/main/java/com/google/android/gms/location/ActivityRecognition.java deleted file mode 100644 index f8f11656..00000000 --- a/play-services-location/src/main/java/com/google/android/gms/location/ActivityRecognition.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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; -import com.google.android.gms.common.api.GoogleApiClient.Builder; - -import org.microg.gms.location.ActivityRecognitionApiClientBuilder; -import org.microg.gms.location.ActivityRecognitionApiImpl; - -/** - * The main entry point for activity recognition integration. - */ -public class ActivityRecognition { - public static final String CLIENT_NAME = "activity_recognition"; - - /** - * Token to pass to {@link Builder#addApi(Api)} to enable ContextServices. - */ - public static final Api API = new Api(new ActivityRecognitionApiClientBuilder()); - - /** - * Entry point to the activity recognition APIs. - */ - public static final ActivityRecognitionApi ActivityRecognitionApi = new ActivityRecognitionApiImpl(); -} diff --git a/play-services-location/src/main/java/com/google/android/gms/location/ActivityRecognitionApi.java b/play-services-location/src/main/java/com/google/android/gms/location/ActivityRecognitionApi.java deleted file mode 100644 index 08bc50b9..00000000 --- a/play-services-location/src/main/java/com/google/android/gms/location/ActivityRecognitionApi.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright (C) 2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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; -import android.os.Bundle; - -import com.google.android.gms.common.api.GoogleApiClient; -import com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks; -import com.google.android.gms.common.api.PendingResult; -import com.google.android.gms.common.api.Status; - -/** - * The main entry point for interacting with activity recognition. - *

- * The methods must be used in conjunction with a GoogleApiClient. E.g. - *

- *  new GoogleApiClient.Builder(context)
- *          .addApi(ActivityRecognition.API)
- *          .addConnectionCallbacks(this)
- *          .addOnConnectionFailedListener(this)
- *          .build()
- * 
- */ -public interface ActivityRecognitionApi { - /** - * Removes all activity updates for the specified PendingIntent. - *

- * Calling this function requires the com.google.android.gms.permission.ACTIVITY_RECOGNITION - * permission. - * - * @param client An existing GoogleApiClient. It must be connected at the time of this - * call, which is normally achieved by calling {@link GoogleApiClient#connect()} - * and waiting for {@link ConnectionCallbacks#onConnected(Bundle)} to be - * called. - * @param callbackIntent the PendingIntent that was used in {@code #requestActivityUpdates(GoogleApiClient, long, PendingIntent)} - * or is equal as defined by {@link Object#equals(Object)}. - * @return a PendingResult for the call, check {@link Status#isSuccess()} to determine if it - * was successful. - */ - PendingResult removeActivityUpdates(GoogleApiClient client, PendingIntent callbackIntent); - - /** - * Register for activity recognition updates. - *

- * The activities are detected by periodically waking up the device and reading short bursts of - * sensor data. It only makes use of low power sensors in order to keep the power usage to a - * minimum. For example, it can detect if the user is currently on foot, in a car, on a bicycle - * or still. See {@link DetectedActivity} for more details. - *

- * The activity detection update interval can be controlled with the detectionIntervalMillis - * parameter. Larger values will result in fewer activity detections while improving battery - * life. Smaller values will result in more frequent activity detections but will consume more - * power since the device must be woken up more frequently. {@code Long.MAX_VALUE} means it only - * monitors the results requested by other clients without consuming additional power. - *

- * Activities may be received more frequently than the detectionIntervalMillis parameter if - * another application has also requested activity updates at a faster rate. It may also receive - * updates faster when the activity detection service receives a signal that the current - * activity may change, such as if the device has been still for a long period of time and is - * then unplugged from a phone charger. - *

- * Activities may arrive several seconds after the requested detectionIntervalMillis if the - * activity detection service requires more samples to make a more accurate prediction. - *

- * To conserve battery, activity reporting may stop when the device is 'STILL' for an extended - * period of time. It will resume once the device moves again. This only happens on devices that - * support the Sensor.TYPE_SIGNIFICANT_MOTION hardware. - *

- * Beginning in API 21, activities may be received less frequently than the - * detectionIntervalMillis parameter if the device is in power save mode and the screen is off. - *

- * A common use case is that an application wants to monitor activities in the background and - * perform an action when a specific activity is detected. To do this without needing a service - * that is always on in the background consuming resources, detected activities are delivered - * via an intent. The application specifies a PendingIntent callback (typically an - * IntentService) which will be called with an intent when activities are detected. The intent - * recipient can extract the {@link ActivityRecognitionResult} using {@link ActivityRecognitionResult#extractResult(android.content.Intent)}. - * See the documentation of {@link PendingIntent} for more details. - *

- * Any requests previously registered with {@link #requestActivityUpdates(GoogleApiClient, long, PendingIntent)} - * that have the same PendingIntent (as defined by {@link Object#equals(Object)}) will be - * replaced by this request. - *

- * Calling this function requires the com.google.android.gms.permission.ACTIVITY_RECOGNITION - * permission. - * - * @param client An existing GoogleApiClient. It must be connected at the time - * of this call, which is normally achieved by calling {@link GoogleApiClient#connect()} - * and waiting for {@link ConnectionCallbacks#onConnected(Bundle)} - * to be called. - * @param detectionIntervalMillis the desired time between activity detections. Larger values - * will result in fewer activity detections while improving - * battery life. A value of 0 will result in activity detections - * at the fastest possible rate. - * @param callbackIntent a PendingIntent to be sent for each activity detection. - * @return a PendingResult for the call, check {@link Status#isSuccess()} to determine if it - * was successful. - */ - PendingResult requestActivityUpdates(GoogleApiClient client, long detectionIntervalMillis, PendingIntent callbackIntent); -} 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 deleted file mode 100644 index 077bae35..00000000 --- a/play-services-location/src/main/java/com/google/android/gms/location/FusedLocationProviderApi.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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; -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 com.google.android.gms.common.api.Status; - -import org.microg.gms.location.LocationConstants; - -@Deprecated -public interface FusedLocationProviderApi { - @Deprecated - String KEY_LOCATION_CHANGED = "com.google.android.location.LOCATION"; - String KEY_MOCK_LOCATION = LocationConstants.KEY_MOCK_LOCATION; - - Location getLastLocation(GoogleApiClient client); - - PendingResult requestLocationUpdates(GoogleApiClient client, LocationRequest request, - LocationListener listener); - - PendingResult requestLocationUpdates(GoogleApiClient client, LocationRequest request, - LocationListener listener, Looper looper); - - PendingResult requestLocationUpdates(GoogleApiClient client, LocationRequest request, - PendingIntent callbackIntent); - - PendingResult removeLocationUpdates(GoogleApiClient client, LocationListener listener); - - PendingResult removeLocationUpdates(GoogleApiClient client, - PendingIntent callbackIntent); - - PendingResult setMockMode(GoogleApiClient client, boolean isMockMode); - - PendingResult setMockLocation(GoogleApiClient client, Location mockLocation); -} diff --git a/play-services-location/src/main/java/com/google/android/gms/location/FusedLocationProviderClient.java b/play-services-location/src/main/java/com/google/android/gms/location/FusedLocationProviderClient.java deleted file mode 100644 index a391c720..00000000 --- a/play-services-location/src/main/java/com/google/android/gms/location/FusedLocationProviderClient.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2020, microG Project Team - * SPDX-License-Identifier: Apache-2.0 - */ - -package com.google.android.gms.location; - -import android.content.Context; -import android.location.Location; - -import com.google.android.gms.common.api.Api; -import com.google.android.gms.common.api.GoogleApi; -import com.google.android.gms.tasks.Task; -import com.google.android.gms.tasks.TaskCompletionSource; - -import org.microg.gms.common.PublicApi; -import org.microg.gms.common.api.InstantGoogleApiCall; -import org.microg.gms.common.api.PendingGoogleApiCall; -import org.microg.gms.location.LocationClientImpl; - -@PublicApi -public class FusedLocationProviderClient extends GoogleApi { - @PublicApi(exclude = true) - public FusedLocationProviderClient(Context context) { - super(context, LocationServices.API); - } - - public Task flushLocations() { - return scheduleTask(new PendingGoogleApiCall() { - @Override - public void execute(LocationClientImpl client, TaskCompletionSource completionSource) { - completionSource.setResult(null); - } - }); - } - - public Task getLastLocation() { - return scheduleTask((InstantGoogleApiCall) LocationClientImpl::getLastLocation); - } - - -} 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 deleted file mode 100644 index 9efc66ce..00000000 --- a/play-services-location/src/main/java/com/google/android/gms/location/GeofencingApi.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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; - -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.List; - -/** - * The main entry point for interacting with the geofencing APIs. - *

- * The methods must be used in conjunction with a GoogleApiClient. E.g. - *

- *  new GoogleApiClient.Builder(context)
- *          .addApi(LocationServices.API)
- *          .addConnectionCallbacks(this)
- *          .addOnConnectionFailedListener(this)
- *          .build()
- * 
- */ -@Deprecated -public interface GeofencingApi { - PendingResult addGeofences(GoogleApiClient client, GeofencingRequest geofencingRequest, PendingIntent pendingIntent); - - @Deprecated - PendingResult addGeofences(GoogleApiClient client, List geofences, PendingIntent pendingIntent); - - PendingResult removeGeofences(GoogleApiClient client, List geofenceRequestIds); - - PendingResult removeGeofences(GoogleApiClient client, PendingIntent pendingIntent); -} 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 deleted file mode 100644 index bc8b00ce..00000000 --- a/play-services-location/src/main/java/com/google/android/gms/location/LocationClient.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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; -import android.content.Context; -import android.location.Location; -import android.os.Looper; - -import com.google.android.gms.common.api.GoogleApiClient; - -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"; - - public LocationClient(Context context, ConnectionCallbacks callbacks, - OnConnectionFailedListener connectionFailedListener) { - super(new GoogleApiClient.Builder(context) - .addApi(LocationServices.API) - .addConnectionCallbacks(new ForwardConnectionCallbacks(callbacks)) - .addOnConnectionFailedListener(new ForwardConnectionFailedListener - (connectionFailedListener)) - .build()); - } - - public Location getLastLocation() { - assertConnected(); - return LocationServices.FusedLocationApi.getLastLocation(googleApiClient); - } - - public void requestLocationUpdates(LocationRequest request, - LocationListener listener) { - assertConnected(); - LocationServices.FusedLocationApi.requestLocationUpdates(googleApiClient, request, - listener).await(); - } - - public void requestLocationUpdates(LocationRequest request, - LocationListener listener, Looper looper) { - assertConnected(); - LocationServices.FusedLocationApi.requestLocationUpdates(googleApiClient, request, - listener, looper).await(); - } - - public void requestLocationUpdates(LocationRequest request, - PendingIntent callbackIntent) { - assertConnected(); - LocationServices.FusedLocationApi.requestLocationUpdates(googleApiClient, request, - callbackIntent).await(); - } - - public void removeLocationUpdates(LocationListener listener) { - assertConnected(); - LocationServices.FusedLocationApi.removeLocationUpdates(googleApiClient, listener).await(); - } - - public void removeLocationUpdates(PendingIntent callbackIntent) { - assertConnected(); - LocationServices.FusedLocationApi.removeLocationUpdates(googleApiClient, - callbackIntent).await(); - } - - public void setMockMode(boolean isMockMode) { - assertConnected(); - LocationServices.FusedLocationApi.setMockMode(googleApiClient, isMockMode).await(); - } - - public void setMockLocation(Location mockLocation) { - assertConnected(); - LocationServices.FusedLocationApi.setMockLocation(googleApiClient, mockLocation).await(); - } -} 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 deleted file mode 100644 index 9e204ccf..00000000 --- a/play-services-location/src/main/java/com/google/android/gms/location/LocationListener.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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; - -/** - * 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. - */ - void onLocationChanged(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 deleted file mode 100644 index f1f10a62..00000000 --- a/play-services-location/src/main/java/com/google/android/gms/location/LocationServices.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.content.Context; - -import com.google.android.gms.common.api.Api; -import com.google.android.gms.common.api.GoogleApiClient.Builder; - -import org.microg.gms.location.FusedLocationProviderApiImpl; -import org.microg.gms.location.GeofencingApiImpl; -import org.microg.gms.location.LocationServicesApiClientBuilder; -import org.microg.gms.location.SettingsApiImpl; - -/** - * The main entry point for location services integration. - */ -public class LocationServices { - /** - * Token to pass to {@link Builder#addApi(Api)} to enable LocationServices. - */ - public static final Api API = new Api(new LocationServicesApiClientBuilder()); - - /** - * Entry point to the fused location APIs. - */ - @Deprecated - public static final FusedLocationProviderApi FusedLocationApi = new FusedLocationProviderApiImpl(); - - /** - * Entry point to the geofencing APIs. - */ - @Deprecated - public static final GeofencingApi GeofencingApi = new GeofencingApiImpl(); - - /** - * Entry point to the location settings-enabler dialog APIs. - */ - @Deprecated - public static final SettingsApi SettingsApi = new SettingsApiImpl(); - - public static FusedLocationProviderClient getFusedLocationProviderClient(Context context) { - return new FusedLocationProviderClient(context); - } -} diff --git a/play-services-location/src/main/java/com/google/android/gms/location/LocationStatusCodes.java b/play-services-location/src/main/java/com/google/android/gms/location/LocationStatusCodes.java deleted file mode 100644 index 4e3f7d54..00000000 --- a/play-services-location/src/main/java/com/google/android/gms/location/LocationStatusCodes.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (C) 2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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; - -@Deprecated -public class LocationStatusCodes { - public static final int ERROR = 1; - public static final int GEOFENCE_NOT_AVAILABLE = 1000; - public static final int GEOFENCE_TOO_MANY_GEOFENCES = 1001; - public static final int GEOFENCE_TOO_MANY_PENDING_INTENTS = 1002; - public static final int SUCCESS = 0; -} diff --git a/play-services-location/src/main/java/com/google/android/gms/location/SettingsApi.java b/play-services-location/src/main/java/com/google/android/gms/location/SettingsApi.java deleted file mode 100644 index b6529f7a..00000000 --- a/play-services-location/src/main/java/com/google/android/gms/location/SettingsApi.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (C) 2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.GoogleApiClient; -import com.google.android.gms.common.api.PendingResult; - -/** - * The main entry point for interacting with the location settings-enabler APIs. - *

- * This API makes it easy for an app to ensure that the device's system settings are properly - * configured for the app's location needs. - */ -@Deprecated -public interface SettingsApi { - /** - * Checks if the relevant system settings are enabled on the device to carry out the desired - * location requests. - * - * @param client an existing GoogleApiClient. It does not need to be connected - * at the time of this call, but the result will be delayed until - * the connection is complete. - * @param locationSettingsRequest an object that contains all the location requirements that the - * client is interested in. - * @return result containing the status of the request. - */ - PendingResult checkLocationSettings(GoogleApiClient client, LocationSettingsRequest locationSettingsRequest); -} diff --git a/play-services-location/src/main/java/org/microg/gms/location/ActivityRecognitionApiClientBuilder.java b/play-services-location/src/main/java/org/microg/gms/location/ActivityRecognitionApiClientBuilder.java deleted file mode 100644 index 6c9461b4..00000000 --- a/play-services-location/src/main/java/org/microg/gms/location/ActivityRecognitionApiClientBuilder.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (C) 2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES 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.Api.ApiOptions.NoOptions; - -import org.microg.gms.common.api.ApiClient; -import org.microg.gms.common.api.ApiClientBuilder; -import org.microg.gms.common.api.ApiClientSettings; -import org.microg.gms.common.api.ConnectionCallbacks; -import org.microg.gms.common.api.OnConnectionFailedListener; - -public class ActivityRecognitionApiClientBuilder implements ApiClientBuilder { - @Override - public ApiClient build(NoOptions options, Context context, Looper looper, ApiClientSettings clientSettings, ConnectionCallbacks callbacks, OnConnectionFailedListener connectionFailedListener) { - return new ActivityRecognitionClientImpl(context, callbacks, connectionFailedListener); - } -} diff --git a/play-services-location/src/main/java/org/microg/gms/location/ActivityRecognitionApiImpl.java b/play-services-location/src/main/java/org/microg/gms/location/ActivityRecognitionApiImpl.java deleted file mode 100644 index 7635c826..00000000 --- a/play-services-location/src/main/java/org/microg/gms/location/ActivityRecognitionApiImpl.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (C) 2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES 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.os.RemoteException; - -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.location.ActivityRecognition; -import com.google.android.gms.location.ActivityRecognitionApi; - -import org.microg.gms.common.GmsConnector; - -public class ActivityRecognitionApiImpl implements ActivityRecognitionApi { - private static final String TAG = "GmsActivityApiImpl"; - - @Override - public PendingResult removeActivityUpdates(GoogleApiClient client, final PendingIntent callbackIntent) { - return callVoid(client, new Runnable() { - @Override - public void run(ActivityRecognitionClientImpl client) throws RemoteException { - client.removeActivityUpdates(callbackIntent); - } - }); - } - - @Override - public PendingResult requestActivityUpdates(GoogleApiClient client, final long detectionIntervalMillis, final PendingIntent callbackIntent) { - return callVoid(client, new Runnable() { - @Override - public void run(ActivityRecognitionClientImpl client) throws RemoteException { - client.requestActivityUpdates(detectionIntervalMillis, callbackIntent); - } - }); - } - - private PendingResult callVoid(GoogleApiClient client, final Runnable runnable) { - return GmsConnector.call(client, ActivityRecognition.API, new GmsConnector.Callback() { - @Override - public void onClientAvailable(ActivityRecognitionClientImpl client, ResultProvider resultProvider) throws RemoteException { - runnable.run(client); - resultProvider.onResultAvailable(Status.SUCCESS); - } - }); - } - - private interface Runnable { - void run(ActivityRecognitionClientImpl client) throws RemoteException; - } -} diff --git a/play-services-location/src/main/java/org/microg/gms/location/ActivityRecognitionClientImpl.java b/play-services-location/src/main/java/org/microg/gms/location/ActivityRecognitionClientImpl.java deleted file mode 100644 index f48aa489..00000000 --- a/play-services-location/src/main/java/org/microg/gms/location/ActivityRecognitionClientImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES 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.Context; -import android.os.RemoteException; - -import org.microg.gms.common.api.ConnectionCallbacks; -import org.microg.gms.common.api.OnConnectionFailedListener; - -public class ActivityRecognitionClientImpl extends GoogleLocationManagerClient { - public ActivityRecognitionClientImpl(Context context, ConnectionCallbacks callbacks, OnConnectionFailedListener connectionFailedListener) { - super(context, callbacks, connectionFailedListener); - } - - public void requestActivityUpdates(long detectionIntervalMillis, PendingIntent callbackIntent) throws RemoteException { - getServiceInterface().requestActivityUpdates(detectionIntervalMillis, true, callbackIntent); - } - - public void removeActivityUpdates(PendingIntent callbackIntent) throws RemoteException { - getServiceInterface().removeActivityUpdates(callbackIntent); - } -} 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 deleted file mode 100644 index df10c6a8..00000000 --- a/play-services-location/src/main/java/org/microg/gms/location/FusedLocationProviderApiImpl.java +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES 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.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.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; - -@SuppressWarnings("deprecation") -public class FusedLocationProviderApiImpl implements FusedLocationProviderApi { - private static final String TAG = "GmsFusedApiImpl"; - - @Override - public Location getLastLocation(GoogleApiClient client) { - try { - Log.d(TAG, "getLastLocation(" + client + ")"); - return LocationClientImpl.get(client).getLastLocation(); - } catch (RemoteException e) { - Log.w(TAG, e); - return null; - } - } - - @Override - 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, - 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, - 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, - final LocationListener listener) { - return callVoid(client, new Runnable() { - @Override - public void run(LocationClientImpl client) throws RemoteException { - client.removeLocationUpdates(listener); - } - }); - } - - @Override - 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 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 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 { - void run(LocationClientImpl client) throws RemoteException; - } -} 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 deleted file mode 100644 index 15e52833..00000000 --- a/play-services-location/src/main/java/org/microg/gms/location/GeofencingApiImpl.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES 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.os.RemoteException; - -import androidx.annotation.NonNull; - -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.location.Geofence; -import com.google.android.gms.location.GeofencingApi; -import com.google.android.gms.location.GeofencingRequest; -import com.google.android.gms.location.LocationServices; -import com.google.android.gms.location.internal.IGeofencerCallbacks; -import com.google.android.gms.location.internal.ParcelableGeofence; - -import org.microg.gms.common.GmsConnector; - -import java.util.ArrayList; -import java.util.List; - -public class GeofencingApiImpl implements GeofencingApi { - @Override - public PendingResult addGeofences(GoogleApiClient client, final GeofencingRequest geofencingRequest, final PendingIntent pendingIntent) { - return callGeofencer(client, new Runnable() { - @Override - public void run(LocationClientImpl client, IGeofencerCallbacks callbacks) throws RemoteException { - client.addGeofences(geofencingRequest, pendingIntent, callbacks); - } - }); - } - - @Override - public PendingResult addGeofences(GoogleApiClient client, final List geofences, final PendingIntent pendingIntent) { - final List geofenceList = new ArrayList(); - for (Geofence geofence : geofences) { - if (geofence instanceof ParcelableGeofence) geofenceList.add((ParcelableGeofence) geofence); - } - return callGeofencer(client, new Runnable() { - @Override - public void run(LocationClientImpl client, IGeofencerCallbacks callbacks) throws RemoteException { - client.addGeofences(geofenceList, pendingIntent, callbacks); - } - }); - } - - @Override - public PendingResult removeGeofences(GoogleApiClient client, final List geofenceRequestIds) { - return callGeofencer(client, new Runnable() { - @Override - public void run(LocationClientImpl client, IGeofencerCallbacks callbacks) throws RemoteException { - client.removeGeofences(geofenceRequestIds, callbacks); - } - }); - } - - @Override - public PendingResult removeGeofences(GoogleApiClient client, final PendingIntent pendingIntent) { - return callGeofencer(client, new Runnable() { - @Override - public void run(LocationClientImpl client, IGeofencerCallbacks callbacks) throws RemoteException { - client.removeGeofences(pendingIntent, callbacks); - } - }); - } - - @NonNull - private IGeofencerCallbacks.Stub createGeofencerCallbacks(final GmsConnector.Callback.ResultProvider resultProvider) { - return new IGeofencerCallbacks.Stub(){ - @Override - public void onAddGeofenceResult(int statusCode, String[] requestIds) throws RemoteException { - resultProvider.onResultAvailable(new Status(statusCode)); - } - - @Override - public void onRemoveGeofencesByRequestIdsResult(int statusCode, String[] requestIds) throws RemoteException { - resultProvider.onResultAvailable(new Status(statusCode)); - } - - @Override - public void onRemoveGeofencesByPendingIntentResult(int statusCode, PendingIntent pendingIntent) throws RemoteException { - resultProvider.onResultAvailable(new Status(statusCode)); - } - }; - } - - private PendingResult callGeofencer(GoogleApiClient client, final Runnable runnable) { - return GmsConnector.call(client, LocationServices.API, new GmsConnector.Callback() { - @Override - public void onClientAvailable(LocationClientImpl client, ResultProvider resultProvider) throws RemoteException { - runnable.run(client, createGeofencerCallbacks(resultProvider)); - } - }); - } - - private interface Runnable { - void run(LocationClientImpl client, IGeofencerCallbacks callbacks) throws RemoteException; - } -} 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 deleted file mode 100644 index 3d542782..00000000 --- a/play-services-location/src/main/java/org/microg/gms/location/GoogleLocationManagerClient.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES 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.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.common.Constants; -import org.microg.gms.common.GmsClient; -import org.microg.gms.common.GmsService; -import org.microg.gms.common.api.ConnectionCallbacks; -import org.microg.gms.common.api.OnConnectionFailedListener; - -public abstract class GoogleLocationManagerClient extends GmsClient { - public GoogleLocationManagerClient(Context context, ConnectionCallbacks - callbacks, OnConnectionFailedListener connectionFailedListener) { - super(context, callbacks, connectionFailedListener, GmsService.LOCATION_MANAGER.ACTION); - } - - @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.GMS_VERSION_CODE, - getContext().getPackageName(), bundle); - } -} 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 deleted file mode 100644 index 2e4634d4..00000000 --- a/play-services-location/src/main/java/org/microg/gms/location/LocationClientImpl.java +++ /dev/null @@ -1,181 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES 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.Context; -import android.location.Location; -import android.os.Bundle; -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.GeofencingRequest; -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 com.google.android.gms.location.internal.IGeofencerCallbacks; -import com.google.android.gms.location.internal.ParcelableGeofence; - -import org.microg.gms.common.api.ConnectionCallbacks; -import org.microg.gms.common.api.GoogleApiClientImpl; -import org.microg.gms.common.api.OnConnectionFailedListener; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class LocationClientImpl extends GoogleLocationManagerClient { - private static final String TAG = "GmsLocationClientImpl"; - private NativeLocationClientImpl nativeLocation = null; - private final Map listenerMap = new HashMap(); - - - public LocationClientImpl(Context context, ConnectionCallbacks callbacks, - OnConnectionFailedListener connectionFailedListener) { - super(context, callbacks, connectionFailedListener); - Log.d(TAG, ""); - } - - public static LocationClientImpl get(GoogleApiClient apiClient) { - if (apiClient instanceof GoogleApiClientImpl) { - return (LocationClientImpl) ((GoogleApiClientImpl) apiClient) - .getApiConnection(LocationServices.API); - } - return null; - } - - public void addGeofences(GeofencingRequest request, PendingIntent pendingIntent, IGeofencerCallbacks callbacks) throws RemoteException { - if (nativeLocation != null) { - nativeLocation.addGeofences(request, pendingIntent, callbacks); - } else { - getServiceInterface().addGeofences(request, pendingIntent, callbacks); - } - } - - public void addGeofences(List request, PendingIntent pendingIntent, IGeofencerCallbacks callbacks) throws RemoteException { - if (nativeLocation != null) { - nativeLocation.addGeofences(request, pendingIntent, callbacks); - } else { - getServiceInterface().addGeofencesList(request, pendingIntent, callbacks, getContext().getPackageName()); - } - } - - public void removeGeofences(List geofenceRequestIds, IGeofencerCallbacks callbacks) throws RemoteException { - if (nativeLocation != null) { - nativeLocation.removeGeofences(geofenceRequestIds, callbacks); - } else { - getServiceInterface().removeGeofencesById(geofenceRequestIds.toArray(new String[geofenceRequestIds.size()]), callbacks, getContext().getPackageName()); - } - } - - public void removeGeofences(PendingIntent pendingIntent, IGeofencerCallbacks callbacks) throws RemoteException { - if (nativeLocation != null) { - nativeLocation.removeGeofences(pendingIntent, callbacks); - } else { - getServiceInterface().removeGeofencesByIntent(pendingIntent, callbacks, getContext().getPackageName()); - } - } - - public Location getLastLocation() throws RemoteException { - Log.d(TAG, "getLastLocation()"); - if (nativeLocation != null) { - return nativeLocation.getLastLocation(); - } else { - return getServiceInterface().getLastLocation(); - } - } - - public void requestLocationUpdates(LocationRequest request, final LocationListener listener) - throws RemoteException { - 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); - } - }); - } - getServiceInterface().requestLocationUpdatesWithPackage(request, - listenerMap.get(listener), getContext().getPackageName()); - } - } - - public void requestLocationUpdates(LocationRequest request, PendingIntent pendingIntent) - throws RemoteException { - 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 { - if (nativeLocation != null) { - nativeLocation.removeLocationUpdates(listener); - } else { - getServiceInterface().removeLocationUpdatesWithListener(listenerMap.get(listener)); - } - } - - public void removeLocationUpdates(PendingIntent pendingIntent) throws RemoteException { - if (nativeLocation != null) { - nativeLocation.removeLocationUpdates(pendingIntent); - } else { - getServiceInterface().removeLocationUpdatesWithIntent(pendingIntent); - } - } - - public void setMockMode(boolean isMockMode) throws RemoteException { - if (nativeLocation != null) { - nativeLocation.setMockMode(isMockMode); - } else { - getServiceInterface().setMockMode(isMockMode); - } - } - - public void setMockLocation(Location mockLocation) throws RemoteException { - 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/play-services-location/src/main/java/org/microg/gms/location/LocationServicesApiClientBuilder.java b/play-services-location/src/main/java/org/microg/gms/location/LocationServicesApiClientBuilder.java deleted file mode 100644 index 1984419d..00000000 --- a/play-services-location/src/main/java/org/microg/gms/location/LocationServicesApiClientBuilder.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES 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.Api.ApiOptions.NoOptions; - -import org.microg.gms.common.api.ApiClient; -import org.microg.gms.common.api.ApiClientBuilder; -import org.microg.gms.common.api.ApiClientSettings; -import org.microg.gms.common.api.ConnectionCallbacks; -import org.microg.gms.common.api.OnConnectionFailedListener; - -public class LocationServicesApiClientBuilder implements ApiClientBuilder { - @Override - public ApiClient build(NoOptions options, Context context, Looper looper, ApiClientSettings clientSettings, ConnectionCallbacks callbacks, OnConnectionFailedListener connectionFailedListener) { - return new LocationClientImpl(context, callbacks, connectionFailedListener); - } -} 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 deleted file mode 100644 index b8634708..00000000 --- a/play-services-location/src/main/java/org/microg/gms/location/NativeLocationClientImpl.java +++ /dev/null @@ -1,262 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES 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 static android.location.LocationManager.KEY_LOCATION_CHANGED; -import static android.location.LocationManager.KEY_PROXIMITY_ENTERING; - -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.os.RemoteException; -import android.os.SystemClock; -import android.util.Log; - -import com.google.android.gms.common.api.CommonStatusCodes; -import com.google.android.gms.location.FusedLocationProviderApi; -import com.google.android.gms.location.Geofence; -import com.google.android.gms.location.GeofenceStatusCodes; -import com.google.android.gms.location.GeofencingEvent; -import com.google.android.gms.location.GeofencingRequest; -import com.google.android.gms.location.LocationListener; -import com.google.android.gms.location.LocationRequest; -import com.google.android.gms.location.internal.IGeofencerCallbacks; -import com.google.android.gms.location.internal.ParcelableGeofence; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@SuppressWarnings("MissingPermission") -public class NativeLocationClientImpl { - 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 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 void addGeofences(GeofencingRequest geofencingRequest, PendingIntent pendingIntent, IGeofencerCallbacks callbacks) throws RemoteException { - Log.d(TAG, "addGeofences(GeofencingRequest)"); - callbacks.onAddGeofenceResult(GeofenceStatusCodes.GEOFENCE_NOT_AVAILABLE, new String[0]); - } - - public void addGeofences(List geofences, PendingIntent pendingIntent, IGeofencerCallbacks callbacks) throws RemoteException { - Log.d(TAG, "addGeofences(List)"); - Intent i = new Intent(context, NativePendingIntentForwarder.class); - Bundle bundle = new Bundle(); - bundle.putParcelable(EXTRA_PENDING_INTENT, pendingIntent); - i.putExtras(bundle); - nativePendingMap.put(pendingIntent, PendingIntent.getActivity(context, 0, i, 0)); - List requestIds = new ArrayList(); - for (ParcelableGeofence geofence : geofences) { - locationManager.addProximityAlert(geofence.latitude, geofence.longitude, geofence.radius, - geofence.expirationTime - SystemClock.elapsedRealtime(), nativePendingMap.get(pendingIntent)); - requestIds.add(geofence.getRequestId()); - } - callbacks.onAddGeofenceResult(CommonStatusCodes.SUCCESS, requestIds.toArray(new String[requestIds.size()])); - } - - public void removeGeofences(List requestIds, IGeofencerCallbacks callbacks) throws RemoteException { - Log.d(TAG, "removeGeofences(List)"); - callbacks.onRemoveGeofencesByRequestIdsResult(GeofenceStatusCodes.ERROR, requestIds.toArray(new String[requestIds.size()])); - } - - public void removeGeofences(PendingIntent pendingIntent, IGeofencerCallbacks callbacks) throws RemoteException { - Log.d(TAG, "removeGeofences(PendingIntent)"); - locationManager.removeProximityAlert(nativePendingMap.get(pendingIntent)); - nativePendingMap.remove(pendingIntent); - callbacks.onRemoveGeofencesByPendingIntentResult(CommonStatusCodes.SUCCESS, pendingIntent); - } - - 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.getSmallestDisplacement(), - 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.getSmallestDisplacement(), 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(KEY_PROXIMITY_ENTERING)) { - PendingIntent pendingIntent = intent.getExtras().getParcelable(EXTRA_PENDING_INTENT); - try { - intent.putExtra(GeofencingEvent.EXTRA_TRANSITION, intent.getBooleanExtra(KEY_PROXIMITY_ENTERING, false) ? Geofence.GEOFENCE_TRANSITION_ENTER : Geofence.GEOFENCE_TRANSITION_EXIT); - pendingIntent.send(context, 0, intent); - } catch (PendingIntent.CanceledException e) { - nativePendingMap.remove(pendingIntent); - } - } else if (intent.hasExtra(KEY_LOCATION_CHANGED)) { - PendingIntent pendingIntent = intent.getExtras().getParcelable(EXTRA_PENDING_INTENT); - try { - intent.putExtra(FusedLocationProviderApi.KEY_LOCATION_CHANGED, - intent.getParcelableExtra(KEY_LOCATION_CHANGED)); - 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; - - return listener.equals(that.listener); - } - - @Override - public int hashCode() { - return listener.hashCode(); - } - } -} diff --git a/play-services-location/src/main/java/org/microg/gms/location/SettingsApiImpl.java b/play-services-location/src/main/java/org/microg/gms/location/SettingsApiImpl.java deleted file mode 100644 index b8fe0ffe..00000000 --- a/play-services-location/src/main/java/org/microg/gms/location/SettingsApiImpl.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES 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.common.api.GoogleApiClient; -import com.google.android.gms.common.api.PendingResult; -import com.google.android.gms.common.api.Status; -import com.google.android.gms.location.LocationSettingsRequest; -import com.google.android.gms.location.LocationSettingsResult; -import com.google.android.gms.location.SettingsApi; - -import org.microg.gms.common.api.InstantPendingResult; - -public class SettingsApiImpl implements SettingsApi { - @Override - public PendingResult checkLocationSettings(GoogleApiClient client, LocationSettingsRequest locationSettingsRequest) { - return new InstantPendingResult(new LocationSettingsResult(Status.CANCELED)); - } -} diff --git a/play-services-tasks/build.gradle b/play-services-tasks/build.gradle index f4000187..7f661f6e 100644 --- a/play-services-tasks/build.gradle +++ b/play-services-tasks/build.gradle @@ -30,7 +30,7 @@ android { dependencies { api project(':play-services-basement') - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.10" - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0" - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.0" + implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.10' + implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4' + implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4' } \ No newline at end of file diff --git a/play-services-tasks/src/main/java/com/google/android/gms/tasks/CancellationToken.java b/play-services-tasks/src/main/java/com/google/android/gms/tasks/CancellationToken.java index 00563c5b..ecdd77ca 100644 --- a/play-services-tasks/src/main/java/com/google/android/gms/tasks/CancellationToken.java +++ b/play-services-tasks/src/main/java/com/google/android/gms/tasks/CancellationToken.java @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2020, microG Project Team + * SPDX-FileCopyrightText: 2020 microG Project Team * SPDX-License-Identifier: Apache-2.0 AND CC-BY-4.0 * Notice: Portions of this file are reproduced from work created and shared by Google and used * according to terms described in the Creative Commons 4.0 Attribution License. @@ -10,6 +10,66 @@ package com.google.android.gms.tasks; import org.microg.gms.common.PublicApi; +/** + * Propagates notification that operations should be canceled. + *

+ * Developers writing methods that return a Task should take a {@code CancellationToken} as a parameter if they wish to + * make the Task cancelable (see below code snippet). A {@code CancellationToken} can only be created by creating a new + * instance of {@link CancellationTokenSource}. {@code CancellationToken} is immutable and must be canceled by calling + * {@link CancellationTokenSource#cancel()} on the {@link CancellationTokenSource} that creates it. It can only be + * canceled once. If canceled, it should not be passed to future operations. + *

+ * When {@link CancellationTokenSource#cancel()} is called, all the Tasks with the {@code CancellationToken} from that + * {@link CancellationTokenSource} will be canceled. This operation only flags those Tasks as canceled, and the API + * author is responsible for stopping whatever the Task is actually doing to free up the resources. + *

+ * Cancellable {@link Task} example: + *

+ * public Task doSomething(CancellationToken token) {
+ *
+ *     // Attach a listener that will be called once cancellation is requested.
+ *     token.onCanceledRequested(new OnTokenCanceledListener() {
+ *         @Override
+ *         public void onCanceled() {
+ *             // Some other operations to cancel this Task, such as free resources...
+ *         }
+ *     });
+ *
+ *     final TaskCompletionSource tcs = new TaskCompletionSource<>(token);
+ *
+ *     // do something...
+ *
+ * }
+ *
+ * CancellationTokenSource cts = new CancellationTokenSource();
+ * Task task = doSomething(cts.getToken());
+ * cts.cancel();
+ * 
+ * Cancellable {@link Task} example in {@link android.app.Activity} context: + *
+ * public class MyActivity extends Activity {
+ *     // ...
+ *
+ *     @Override
+ *     public void onStart() {
+ *         super.onStart();
+ *
+ *         // Typically use one cancellation source per lifecycle.
+ *         cancellationSource = new TaskCancellationSource();
+ *
+ *         // That source's token can be passed to multiple calls.
+ *         doSomethingCancellable(cancellationSource.getToken())
+ *             .onSuccessTask(result -> doSomethingElse(result, cancellationSource.getToken()));
+ *     }
+ *
+ *     @Override
+ *     public void onStop() {
+ *         super.onStop();
+ *         cancellationSource.cancel();
+ *     }
+ * }
+ * 
+ */ @PublicApi public abstract class CancellationToken { /** diff --git a/play-services-tasks/src/main/java/com/google/android/gms/tasks/CancellationTokenSource.java b/play-services-tasks/src/main/java/com/google/android/gms/tasks/CancellationTokenSource.java index e704d8f3..044b0466 100644 --- a/play-services-tasks/src/main/java/com/google/android/gms/tasks/CancellationTokenSource.java +++ b/play-services-tasks/src/main/java/com/google/android/gms/tasks/CancellationTokenSource.java @@ -20,7 +20,7 @@ import org.microg.gms.tasks.CancellationTokenImpl; */ @PublicApi public class CancellationTokenSource { - private final CancellationTokenImpl token = new CancellationTokenImpl(); + private CancellationTokenImpl token = new CancellationTokenImpl(); /** * Creates a new {@link CancellationTokenSource} instance. 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 index 7057ca71..db26d0e9 100644 --- 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 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2016, microG Project Team + * SPDX-FileCopyrightText: 2016 microG Project Team * SPDX-License-Identifier: Apache-2.0 AND CC-BY-4.0 * Notice: Portions of this file are reproduced from work created and shared by Google and used * according to terms described in the Creative Commons 4.0 Attribution License. @@ -28,8 +28,9 @@ public interface Continuation { *

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

task.continueWith(new Continuation() {
-     *     @Override
+     * 
+     * task.continueWith(new Continuation() {
+     *     @Override
      *     public String then(Task task) {
      *         try {
      *             return task.getResult(IOException.class);
@@ -42,8 +43,9 @@ public interface Continuation {
      * }
*

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

task.continueWith(new Continuation() {
-     *     @Override
+     * 
+     * task.continueWith(new Continuation() {
+     *     @Override
      *     public String then(Task task) {
      *         if (task.isSuccessful()) {
      *             return task.getResult();
diff --git a/play-services-tasks/src/main/java/com/google/android/gms/tasks/OnCanceledListener.java b/play-services-tasks/src/main/java/com/google/android/gms/tasks/OnCanceledListener.java
index a52e4622..32fd7b0f 100644
--- a/play-services-tasks/src/main/java/com/google/android/gms/tasks/OnCanceledListener.java
+++ b/play-services-tasks/src/main/java/com/google/android/gms/tasks/OnCanceledListener.java
@@ -18,5 +18,5 @@ public interface OnCanceledListener {
     /**
      * Called when the Task is canceled successfully.
      */
-    void onCanceled();
+    public abstract void onCanceled();
 }
diff --git a/play-services-tasks/src/main/java/com/google/android/gms/tasks/SuccessContinuation.java b/play-services-tasks/src/main/java/com/google/android/gms/tasks/SuccessContinuation.java
index 3feb598e..26b49e88 100644
--- a/play-services-tasks/src/main/java/com/google/android/gms/tasks/SuccessContinuation.java
+++ b/play-services-tasks/src/main/java/com/google/android/gms/tasks/SuccessContinuation.java
@@ -1,5 +1,5 @@
 /*
- * SPDX-FileCopyrightText: 2020, microG Project Team
+ * SPDX-FileCopyrightText: 2020 microG Project Team
  * SPDX-License-Identifier: Apache-2.0 AND CC-BY-4.0
  * Notice: Portions of this file are reproduced from work created and shared by Google and used
  *         according to terms described in the Creative Commons 4.0 Attribution License.
@@ -19,7 +19,21 @@ public interface SuccessContinuation {
     /**
      * Returns the result of applying this SuccessContinuation to Task.
      * 

- * The SuccessContinuation only happens then the Task is successful. If the previous Task fails, the onSuccessTask continuation will be skipped and failure listeners will be invoked. + * The SuccessContinuation only happens then the Task is successful. If the previous Task fails, the onSuccessTask + * continuation will be skipped and failure listeners will be invoked. + *

+ *

+     * private Task doSomething(String string) {
+     *     // do something
+     * }
+     * task.onSuccessTask(new SuccessContinuation() {
+     *     @NonNull
+     *     @Override
+     *     public Task then(String string) {
+     *         return doSomething(string);
+     *     }
+     * });
+     * 
* * @param result the result of completed Task * @throws Exception if the result couldn't be produced 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 index f7223779..7cf39477 100644 --- 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 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2016, microG Project Team + * SPDX-FileCopyrightText: 2016 microG Project Team * SPDX-License-Identifier: Apache-2.0 AND CC-BY-4.0 * Notice: Portions of this file are reproduced from work created and shared by Google and used * according to terms described in the Creative Commons 4.0 Attribution License. @@ -177,6 +177,8 @@ public abstract class Task { * Continuation to this Task. *

* The Continuation will be called on the main application thread. + *

+ * If the previous Task is canceled, the returned Task will also be canceled and the Continuation would not execute. * * @see Continuation#then(Task) */ @@ -186,6 +188,8 @@ public abstract class Task { /** * Returns a new Task that will be completed with the result of applying the specified Continuation to this Task. + *

+ * If the previous Task is canceled, the returned Task will also be canceled and the Continuation would not execute. * * @param executor the executor to use to call the Continuation * @see Continuation#then(Task) @@ -199,6 +203,9 @@ public abstract class Task { * Continuation to this Task. *

* The Continuation will be called on the main application thread. + *

+ * If the previous Task is canceled, the Continuation would still execute and task.isCanceled() is true can be + * observed in the Continuation. * * @see Continuation#then(Task) */ @@ -208,6 +215,9 @@ public abstract class Task { /** * Returns a new Task that will be completed with the result of applying the specified Continuation to this Task. + *

+ * If the previous Task is canceled, the Continuation would still execute and task.isCanceled() is true can be + * observed in the Continuation. * * @param executor the executor to use to call the Continuation * @see Continuation#then(Task) 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 index 58fa1e00..4dbe5019 100644 --- 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 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2016, microG Project Team + * SPDX-FileCopyrightText: 2016 microG Project Team * SPDX-License-Identifier: Apache-2.0 AND CC-BY-4.0 * Notice: Portions of this file are reproduced from work created and shared by Google and used * according to terms described in the Creative Commons 4.0 Attribution License. @@ -12,12 +12,39 @@ import org.microg.gms.common.PublicApi; import org.microg.gms.tasks.TaskImpl; /** - * Provides the ability to create an incomplete {@link Task} and later complete it by either + * Provides the ability to create an incomplete {@link Task}-based APIs. + *

+ * Use a {@code TaskCompletionSource} to set a result or exception on a Task returned from an asynchronous API: + *

+ * public class MarcoPolo {
+ *     public static Task marco(int delay) {
+ *         TaskCompletionSource taskCompletionSource = new TaskCompletionSource<>();
+ *
+ *         new Handler().postDelayed(() -> taskCompletionSource.setResult("polo"), delay);
+ *
+ *         return taskCompletionSource.getTask();
+ *     }
+ * }
+ * 
+ * And then your APIs can be used as any other {@link Task}-consuming APIs: + *
+ * public class MyActivity extends Activity {
+ *     @Override
+ *     public void onStart() {
+ *         super.onStart();
+ *
+ *         marco(1000).addOnCompleteListener(
+ *             task -> Log.d(TAG, "got message after one second: " + task.getResult()));
+ *     }
+ * }
+ * 
+ * + * and later complete it by either * calling {@link #setResult(TResult)} or {@link #setException(Exception)}. */ @PublicApi public class TaskCompletionSource { - private final TaskImpl task = new TaskImpl<>(); + private TaskImpl task = new TaskImpl<>(); /** * Creates an instance of {@link TaskCompletionSource}. diff --git a/play-services-tasks/src/main/java/com/google/android/gms/tasks/TaskExecutors.java b/play-services-tasks/src/main/java/com/google/android/gms/tasks/TaskExecutors.java index 7abfa6a7..c4947e13 100644 --- a/play-services-tasks/src/main/java/com/google/android/gms/tasks/TaskExecutors.java +++ b/play-services-tasks/src/main/java/com/google/android/gms/tasks/TaskExecutors.java @@ -24,7 +24,7 @@ public final class TaskExecutors { * An Executor that uses the main application thread. */ public static final Executor MAIN_THREAD = new Executor() { - private final Handler handler = new Handler(Looper.getMainLooper()); + private Handler handler = new Handler(Looper.getMainLooper()); @Override public void execute(Runnable command) { handler.post(command); 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 index 43452562..eabc0553 100644 --- 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 @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2016, microG Project Team + * SPDX-FileCopyrightText: 2016 microG Project Team * SPDX-License-Identifier: Apache-2.0 AND CC-BY-4.0 * Notice: Portions of this file are reproduced from work created and shared by Google and used * according to terms described in the Creative Commons 4.0 Attribution License. @@ -8,15 +8,28 @@ package com.google.android.gms.tasks; -import org.microg.gms.common.PublicApi; +import android.os.Handler; +import android.os.Looper; +import org.microg.gms.common.PublicApi; +import org.microg.gms.tasks.CancellationTokenImpl; +import org.microg.gms.tasks.TaskImpl; + +import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; +import java.util.Collections; +import java.util.List; import java.util.concurrent.Callable; +import java.util.concurrent.CancellationException; +import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutionException; import java.util.concurrent.Executor; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicReference; /** * {@link Task} utility methods. @@ -32,9 +45,17 @@ public final class Tasks { * @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; + public static TResult await(Task task, long timeout, TimeUnit unit) throws ExecutionException, InterruptedException, TimeoutException { + if (task == null) throw new IllegalArgumentException("Task must not be null"); + if (timeout <= 0) throw new IllegalArgumentException("Timeout must be positive"); + if (unit == null) throw new IllegalArgumentException("TimeUnit must not be null"); + if (task.isComplete()) return handleCompletedTask(task); + CountDownLatch latch = new CountDownLatch(1); + task.addOnCompleteListener(Runnable::run, completedTask -> latch.countDown()); + if (latch.await(timeout, unit)) { + return handleCompletedTask(task); + } + throw new TimeoutException("Timed out waiting for Task"); } /** @@ -44,65 +65,242 @@ public final class Tasks { * @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; + public static TResult await(Task task) throws ExecutionException, InterruptedException { + if (Looper.getMainLooper().getThread() == Thread.currentThread()) + throw new IllegalStateException("Must not be invoked on main thread"); + if (task == null) throw new IllegalArgumentException("Task must not be null"); + if (task.isComplete()) return handleCompletedTask(task); + CountDownLatch latch = new CountDownLatch(1); + task.addOnCompleteListener(Runnable::run, completedTask -> latch.countDown()); + latch.await(); + return handleCompletedTask(task); + } + + private static TResult handleCompletedTask(Task task) throws ExecutionException { + if (task.isSuccessful()) { + return task.getResult(); + } + if (task.isCanceled()) { + throw new CancellationException("Task is already canceled"); + } + throw new ExecutionException(task.getException()); } /** - * Returns a Task that will be completed with the result of the specified Callable. + * Returns a {@link Task} that will be completed with the result of the specified {@code Callable}. *

- * The Callable will be called on the main application thread. + * If a non-{@link Exception} throwable is thrown in the callable, the {@link Task} will be failed with a + * {@link RuntimeException} whose cause is the original throwable. + *

+ * The {@code Callable} will be called on the main application thread. + * + * @deprecated Use {@link TaskCompletionSource} instead, which allows the caller to manage their own Executor. */ + @Deprecated public static Task call(Callable callable) { - // TODO - return null; + return call(TaskExecutors.MAIN_THREAD, callable); } /** - * Returns a Task that will be completed with the result of the specified Callable. + * Returns a {@link Task} that will be completed with the result of the specified {@code Callable}. + *

+ * If a non-{@link Exception} throwable is thrown in the callable, the {@link Task} will be failed with a + * {@link RuntimeException} whose cause is the original throwable. * - * @param executor the Executor to use to call the Callable + * @param executor the Executor to use to call the {@code Callable} + * @deprecated Use {@link TaskCompletionSource} instead, which allows the caller to manage their own Executor. */ + @Deprecated public static Task call(Executor executor, Callable callable) { - // TODO - return null; + if (executor == null) throw new IllegalArgumentException("Executor must not be null"); + if (callable == null) throw new IllegalArgumentException("Callable must not be null"); + TaskCompletionSource taskCompletionSource = new TaskCompletionSource<>(); + executor.execute(() -> { + try { + taskCompletionSource.setResult(callable.call()); + } catch (Exception e) { + taskCompletionSource.trySetException(e); + } catch (Throwable t) { + taskCompletionSource.trySetException(new RuntimeException(t)); + } + }); + return taskCompletionSource.getTask(); + } + + /** + * Returns a canceled Task. + */ + public static Task forCancelled() { + TaskImpl task = new TaskImpl<>(); + task.cancel(); + return task; } /** * Returns a completed Task with the specified exception. */ public static Task forException(Exception e) { - // TODO - return null; + TaskImpl task = new TaskImpl<>(); + task.setException(e); + return task; } /** * Returns a completed Task with the specified result. */ public static Task forResult(TResult result) { - // TODO - return null; + TaskImpl task = new TaskImpl<>(); + task.setResult(result); + return task; } /** * Returns a Task that completes successfully when all of the specified Tasks complete * successfully. Does not accept nulls. + *

+ * The returned Task would fail if any of the provided Tasks fail. The returned Task would be set to canceled if + * any of the provided Tasks is canceled and no failure is detected. * * @throws NullPointerException if any of the provided Tasks are null */ public static Task whenAll(Collection> tasks) { - // TODO - return null; + if (tasks == null || tasks.isEmpty()) { + return forResult(null); + } + for (Task task : tasks) { + if (task == null) throw new NullPointerException("null tasks are not accepted"); + } + TaskImpl allTask = new TaskImpl<>(); + AtomicInteger finishedTasks = new AtomicInteger(0); + AtomicInteger failedTasks = new AtomicInteger(0); + AtomicReference exceptionReference = new AtomicReference<>(null); + AtomicBoolean isCancelled = new AtomicBoolean(false); + for (Task task : tasks) { + task.addOnCompleteListener(Runnable::run, completedTask -> { + if (!completedTask.isSuccessful()) { + if (completedTask.isCanceled()) { + isCancelled.set(true); + } else { + exceptionReference.set(completedTask.getException()); + failedTasks.incrementAndGet(); + } + } + if (finishedTasks.incrementAndGet() != tasks.size()) return; + Exception exception = exceptionReference.get(); + if (exception != null) { + allTask.setException(new ExecutionException(failedTasks.get() + " out of " + tasks.size() + " underlying tasks failed", exception)); + } else if (isCancelled.get()) { + allTask.cancel(); + } else { + allTask.setResult(null); + } + }); + } + return allTask; } /** * Returns a Task that completes successfully when all of the specified Tasks complete * successfully. Does not accept nulls. + *

+ * The returned Task would fail if any of the provided Tasks fail. The returned Task would be set to canceled if + * any of the provided Tasks is canceled and no failure is detected. * * @throws NullPointerException if any of the provided Tasks are null */ public static Task whenAll(Task... tasks) { + if (tasks == null || tasks.length == 0) { + return forResult(null); + } return whenAll(Arrays.asList(tasks)); } + + /** + * Returns a Task with a list of Tasks that completes successfully when all of the specified Tasks complete. This + * Task would always succeed even if any of the provided Tasks fail or canceled. Does not accept nulls. + * + * @throws NullPointerException if any of the provided Tasks are null + */ + public static Task>> whenAllComplete(Task... tasks) { + if (tasks == null || tasks.length == 0) { + return forResult(Collections.emptyList()); + } + return whenAllComplete(Arrays.asList(tasks)); + } + + /** + * Returns a Task with a list of Tasks that completes successfully when all of the specified Tasks complete. This + * Task would always succeed even if any of the provided Tasks fail or canceled. Does not accept nulls. + * + * @throws NullPointerException if any of the provided Tasks are null + */ + public static Task>> whenAllComplete(Collection> tasks) { + if (tasks == null || tasks.isEmpty()) { + return forResult(Collections.emptyList()); + } + return whenAll(tasks).continueWithTask(TaskExecutors.MAIN_THREAD, allTask -> forResult(new ArrayList<>(tasks))); + } + + /** + * Returns a Task with a list of Task results that completes successfully when all of the specified Tasks complete + * successfully. This Task would fail if any of the provided Tasks fail. Does not accept nulls. + *

+ * This Task would be set to canceled if any of the provided Tasks is canceled and no failure is detected. + * + * @throws NullPointerException if any of the provided Tasks are null + */ + public static Task> whenAllSuccess(Task... tasks) { + if (tasks == null || tasks.length == 0) { + return forResult(Collections.emptyList()); + } + return whenAllSuccess(Arrays.asList(tasks)); + } + + /** + * Returns a Task with a list of Task results that completes successfully when all of the specified Tasks complete + * successfully. This Task would fail if any of the provided Tasks fail. Does not accept nulls. + *

+ * This Task would be set to canceled if any of the provided Tasks is canceled and no failure is detected. + * + * @throws NullPointerException if any of the provided Tasks are null + */ + public static Task> whenAllSuccess(Collection> tasks) { + if (tasks == null || tasks.isEmpty()) { + return forResult(Collections.emptyList()); + } + return whenAll(tasks).continueWithTask(TaskExecutors.MAIN_THREAD, allTask -> { + List results = new ArrayList<>(tasks.size()); + for (Task task : tasks) { + results.add(task.getResult()); + } + return forResult(results); + }); + } + + /** + * Returns a new Task which will return a TimeoutException if a result is not returned within the specified time + * period. + * + * @return A new Task. + */ + public static Task withTimeout(Task task, long timeout, TimeUnit unit) { + if (task == null) throw new IllegalArgumentException("Task must not be null"); + if (timeout <= 0) throw new IllegalArgumentException("Timeout must be positive"); + if (unit == null) throw new IllegalArgumentException("TimeUnit must not be null"); + CancellationTokenImpl cancellationToken = new CancellationTokenImpl(); + TaskCompletionSource taskCompletionSource = new TaskCompletionSource<>(cancellationToken); + Handler handler = new Handler(Looper.getMainLooper()); + handler.postDelayed(() -> taskCompletionSource.trySetException(new TimeoutException()), unit.toMillis(timeout)); + task.addOnCompleteListener(completedTask -> { + handler.removeCallbacksAndMessages(null); + if (completedTask.isSuccessful()) { + taskCompletionSource.trySetResult(completedTask.getResult()); + } else if (completedTask.isCanceled()) { + cancellationToken.cancel(); + } else { + taskCompletionSource.trySetException(completedTask.getException()); + } + }); + return taskCompletionSource.getTask(); + } } diff --git a/play-services-tasks/src/main/java/org/microg/gms/tasks/CancellationTokenImpl.java b/play-services-tasks/src/main/java/org/microg/gms/tasks/CancellationTokenImpl.java index d9a2fe95..b2a69096 100644 --- a/play-services-tasks/src/main/java/org/microg/gms/tasks/CancellationTokenImpl.java +++ b/play-services-tasks/src/main/java/org/microg/gms/tasks/CancellationTokenImpl.java @@ -10,7 +10,7 @@ import com.google.android.gms.tasks.DuplicateTaskCompletionException; import com.google.android.gms.tasks.OnTokenCanceledListener; public class CancellationTokenImpl extends CancellationToken { - private final TaskImpl task = new TaskImpl<>(); + private TaskImpl task = new TaskImpl<>(); @Override public boolean isCancellationRequested() { diff --git a/play-services-tasks/src/main/java/org/microg/gms/tasks/TaskImpl.java b/play-services-tasks/src/main/java/org/microg/gms/tasks/TaskImpl.java index da62ad3e..ae5c42f1 100644 --- a/play-services-tasks/src/main/java/org/microg/gms/tasks/TaskImpl.java +++ b/play-services-tasks/src/main/java/org/microg/gms/tasks/TaskImpl.java @@ -5,8 +5,6 @@ package org.microg.gms.tasks; -import static com.google.android.gms.tasks.TaskExecutors.MAIN_THREAD; - import android.app.Activity; import com.google.android.gms.tasks.Continuation; @@ -24,13 +22,15 @@ import java.util.concurrent.CancellationException; import java.util.concurrent.Executor; import java.util.concurrent.LinkedBlockingQueue; +import static com.google.android.gms.tasks.TaskExecutors.MAIN_THREAD; + public class TaskImpl extends Task { private final Object lock = new Object(); private boolean completed; private boolean cancelled; private TResult result; private Exception exception; - private final Queue> completionQueue = new LinkedBlockingQueue<>(); + private Queue> completionQueue = new LinkedBlockingQueue<>(); @Override public Task addOnCanceledListener(OnCanceledListener listener) { diff --git a/play-services-tasks/src/main/java/org/microg/gms/tasks/UpdateListenerLifecycleObserver.java b/play-services-tasks/src/main/java/org/microg/gms/tasks/UpdateListenerLifecycleObserver.java index bc31d183..dd307c50 100644 --- a/play-services-tasks/src/main/java/org/microg/gms/tasks/UpdateListenerLifecycleObserver.java +++ b/play-services-tasks/src/main/java/org/microg/gms/tasks/UpdateListenerLifecycleObserver.java @@ -15,9 +15,9 @@ import java.util.List; import java.util.WeakHashMap; public class UpdateListenerLifecycleObserver { - private static final WeakHashMap> map = new WeakHashMap<>(); + private static WeakHashMap> map = new WeakHashMap<>(); private static boolean activityLifecycleCallbacksRegistered = false; - private final List>> list = new ArrayList<>(); + private List>> list = new ArrayList<>(); public synchronized static UpdateListenerLifecycleObserver getObserverForActivity(Activity activity) { WeakReference ref = map.get(activity); diff --git a/play-services-tasks/src/main/kotlin/com/google/android/gms/tasks/Tasks.kt b/play-services-tasks/src/main/kotlin/com/google/android/gms/tasks/Tasks.kt deleted file mode 100644 index d002f7f9..00000000 --- a/play-services-tasks/src/main/kotlin/com/google/android/gms/tasks/Tasks.kt +++ /dev/null @@ -1,153 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2016, JetBrains s.r.o. - * SPDX-FileCopyrightText: 2021, microG Project Team - * SPDX-License-Identifier: Apache-2.0 - */ - -package com.google.android.gms.tasks - -import com.google.android.gms.tasks.* -import kotlinx.coroutines.* -import kotlin.coroutines.* - -/** - * Converts this deferred to the instance of [Task]. - * If deferred is cancelled then resulting task will be cancelled as well. - */ -@kotlinx.coroutines.ExperimentalCoroutinesApi -fun Deferred.asTask(): Task { - val cancellation = CancellationTokenSource() - val source = TaskCompletionSource(cancellation.token) - - invokeOnCompletion callback@{ - if (it is CancellationException) { - cancellation.cancel() - return@callback - } - - val t = getCompletionExceptionOrNull() - if (t == null) { - source.setResult(getCompleted()) - } else { - source.setException(t as? Exception ?: RuntimeExecutionException(t)) - } - } - - return source.task -} - -/** - * Converts this task to an instance of [Deferred]. - * If task is cancelled then resulting deferred will be cancelled as well. - * However, the opposite is not true: if the deferred is cancelled, the [Task] will not be cancelled. - * For bi-directional cancellation, an overload that accepts [CancellationTokenSource] can be used. - */ -fun Task.asDeferred(): Deferred = asDeferredImpl(null) - -/** - * Converts this task to an instance of [Deferred] with a [CancellationTokenSource] to control cancellation. - * The cancellation of this function is bi-directional: - * * If the given task is cancelled, the resulting deferred will be cancelled. - * * If the resulting deferred is cancelled, the provided [cancellationTokenSource] will be cancelled. - * - * Providing a [CancellationTokenSource] that is unrelated to the receiving [Task] is not supported and - * leads to an unspecified behaviour. - */ -@ExperimentalCoroutinesApi // Since 1.5.1, tentatively until 1.6.0 -fun Task.asDeferred(cancellationTokenSource: CancellationTokenSource): Deferred = - asDeferredImpl(cancellationTokenSource) - -private fun Task.asDeferredImpl(cancellationTokenSource: CancellationTokenSource?): Deferred { - val deferred = CompletableDeferred() - if (isComplete) { - val e = exception - if (e == null) { - if (isCanceled) { - deferred.cancel() - } else { - @Suppress("UNCHECKED_CAST") - deferred.complete(result as T) - } - } else { - deferred.completeExceptionally(e) - } - } else { - addOnCompleteListener { - val e = it.exception - if (e == null) { - @Suppress("UNCHECKED_CAST") - if (it.isCanceled) deferred.cancel() else deferred.complete(it.result as T) - } else { - deferred.completeExceptionally(e) - } - } - } - - if (cancellationTokenSource != null) { - deferred.invokeOnCompletion { - cancellationTokenSource.cancel() - } - } - // Prevent casting to CompletableDeferred and manual completion. - return object : Deferred by deferred {} -} - -/** - * Awaits the completion of the task without blocking a thread. - * - * This suspending function is cancellable. - * If the [Job] of the current coroutine is cancelled or completed while this suspending function is waiting, this function - * stops waiting for the completion stage and immediately resumes with [CancellationException]. - * - * For bi-directional cancellation, an overload that accepts [CancellationTokenSource] can be used. - */ -suspend fun Task.await(): T = awaitImpl(null) - -/** - * Awaits the completion of the task that is linked to the given [CancellationTokenSource] to control cancellation. - * - * This suspending function is cancellable and cancellation is bi-directional: - * * If the [Job] of the current coroutine is cancelled or completed while this suspending function is waiting, this function - * cancels the [cancellationTokenSource] and throws a [CancellationException]. - * * If the task is cancelled, then this function will throw a [CancellationException]. - * - * Providing a [CancellationTokenSource] that is unrelated to the receiving [Task] is not supported and - * leads to an unspecified behaviour. - */ -@ExperimentalCoroutinesApi // Since 1.5.1, tentatively until 1.6.0 -suspend fun Task.await(cancellationTokenSource: CancellationTokenSource): T = awaitImpl(cancellationTokenSource) - -private suspend fun Task.awaitImpl(cancellationTokenSource: CancellationTokenSource?): T { - // fast path - if (isComplete) { - val e = exception - return if (e == null) { - if (isCanceled) { - throw CancellationException("Task $this was cancelled normally.") - } else { - @Suppress("UNCHECKED_CAST") - result as T - } - } else { - throw e - } - } - - return suspendCancellableCoroutine { cont -> - addOnCompleteListener { - val e = it.exception - if (e == null) { - @Suppress("UNCHECKED_CAST") - if (it.isCanceled) cont.cancel() else cont.resume(it.result as T) - } else { - cont.resumeWithException(e) - } - } - - if (cancellationTokenSource != null) { - cont.invokeOnCancellation { - cancellationTokenSource.cancel() - } - } - } -} diff --git a/proguard.flags b/proguard.flags index 86ac77f3..fba8c5e2 100644 --- a/proguard.flags +++ b/proguard.flags @@ -11,14 +11,12 @@ -dontwarn com.caverock.androidsvg.** -dontwarn org.slf4j.** -dontwarn org.codehaus.jackson.** --dontwarn com.android.location.provider.** # Disable ProGuard Notes, they won't help here -dontnote # Keep dynamically loaded GMS classes -keep public class com.google.android.gms.common.security.ProviderInstallerImpl { public *; } --keep public class com.google.android.gms.cast.framework.internal.CastDynamiteModuleImpl { public *; } # Keep AutoSafeParcelables -keep public class * extends org.microg.safeparcel.AutoSafeParcelable { diff --git a/settings.gradle b/settings.gradle index 089ba776..af7e406b 100644 --- a/settings.gradle +++ b/settings.gradle @@ -3,20 +3,14 @@ include ':play-services-basement' include ':play-services-tasks' include ':play-services-base-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-api' include ':play-services-core-proto' -include ':play-services-cronet-core' - include ':play-services-core:microg-ui-tools' // Legacy include ':play-services-core' include ':play-services-base' -include ':play-services-cast' -include ':play-services-location' \ No newline at end of file +include ':play-services-base-core' \ No newline at end of file