From bdb04c9b206cc19551587664a09d1cfec5d355b1 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Tue, 28 Aug 2018 01:11:24 +0200 Subject: [PATCH] Add various missing stubs --- extern/GmsApi | 2 +- extern/GmsLib | 2 +- .../src/main/AndroidManifest.xml | 14 ++++ .../internal/CastDynamiteModuleImpl.java | 75 ++----------------- .../measurement/MeasurementBrokerService.java | 39 ++++++++++ .../measurement/MeasurementServiceImpl.java | 34 +++++++++ .../gms/phenotype/ConfigurationProvider.java | 65 ++++++++++++++++ 7 files changed, 160 insertions(+), 71 deletions(-) create mode 100644 play-services-core/src/main/java/org/microg/gms/measurement/MeasurementBrokerService.java create mode 100644 play-services-core/src/main/java/org/microg/gms/measurement/MeasurementServiceImpl.java create mode 100644 play-services-core/src/main/java/org/microg/gms/phenotype/ConfigurationProvider.java diff --git a/extern/GmsApi b/extern/GmsApi index db0be6ba..216861e7 160000 --- a/extern/GmsApi +++ b/extern/GmsApi @@ -1 +1 @@ -Subproject commit db0be6ba010f52b4d12e69aed2482c38a3c2406c +Subproject commit 216861e7dd86b11d6fcaafb87f64c22fa35af445 diff --git a/extern/GmsLib b/extern/GmsLib index 90e9b7b7..7015d9e7 160000 --- a/extern/GmsLib +++ b/extern/GmsLib @@ -1 +1 @@ -Subproject commit 90e9b7b79dcaddfce887f87b94f80adeed8791e6 +Subproject commit 7015d9e7f8f793e3b6d009a6e453f84f35b9d1c8 diff --git a/play-services-core/src/main/AndroidManifest.xml b/play-services-core/src/main/AndroidManifest.xml index 2a8b7dd6..6951a941 100644 --- a/play-services-core/src/main/AndroidManifest.xml +++ b/play-services-core/src/main/AndroidManifest.xml @@ -491,6 +491,20 @@ + + + + + + + + + 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 index b5770fee..374deded 100644 --- 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 @@ -16,7 +16,6 @@ package com.google.android.gms.cast.framework.internal; -import android.os.Bundle; import android.os.RemoteException; import android.util.Log; @@ -26,14 +25,12 @@ 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.ISessionManager; 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 com.google.android.gms.dynamic.ObjectWrapper; import java.util.Map; @@ -43,96 +40,36 @@ public class CastDynamiteModuleImpl extends ICastDynamiteModule.Stub { @Override public ICastContext newCastContextImpl(IObjectWrapper context, CastOptions options, IMediaRouter router, Map map) throws RemoteException { Log.d(TAG, "unimplemented Method: newCastContextImpl"); - return new ICastContext.Stub() { - - @Override - public Bundle getMergedSelectorAsBundle() throws RemoteException { - Log.d(TAG, "unimplemented Method: getMergedSelectorAsBundle"); - return new Bundle(); - } - - @Override - public boolean isApplicationVisible() throws RemoteException { - Log.d(TAG, "unimplemented Method: isApplicationVisible"); - return true; - } - - @Override - public ISessionManager getSessionManager() throws RemoteException { - Log.d(TAG, "unimplemented Method: getSessionManager"); - return new ISessionManager.Stub(){ - @Override - public IObjectWrapper getWrappedCurrentSession() throws RemoteException { - Log.d(TAG, "unimplemented Method: getWrappedCurrentSession"); - return ObjectWrapper.wrap(null); - } - - @Override - public void endCurrentSession(boolean b, boolean stopCasting) throws RemoteException { - Log.d(TAG, "unimplemented Method: endCurrentSession"); - - } - - @Override - public IObjectWrapper getWrappedThis() throws RemoteException { - Log.d(TAG, "unimplemented Method: getWrappedThis"); - return ObjectWrapper.wrap(this); - } - }; - } - - @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"); - - } - }; + return null; } @Override public ISession newSessionImpl(String s1, String s2, ISessionProxy proxy) throws RemoteException { Log.d(TAG, "unimplemented Method: newSessionImpl"); - return new ISession.Stub() { - }; + return null; } @Override public ICastSession newCastSessionImpl(CastOptions options, IObjectWrapper session, ICastConnectionController controller) throws RemoteException { Log.d(TAG, "unimplemented Method: newCastSessionImpl"); - return new ICastSession.Stub() { - }; + return null; } @Override public IMediaNotificationService newMediaNotificationServiceImpl(IObjectWrapper service, IObjectWrapper castContext, IObjectWrapper resources, CastMediaOptions options) throws RemoteException { Log.d(TAG, "unimplemented Method: newMediaNotificationServiceImpl"); - return new IMediaNotificationService.Stub() { - }; + return null; } @Override public IReconnectionService newReconnectionServiceImpl(IObjectWrapper service, IObjectWrapper sessionManager, IObjectWrapper discoveryManager) throws RemoteException { Log.d(TAG, "unimplemented Method: newReconnectionServiceImpl"); - return new IReconnectionService.Stub() { - }; + 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 new IFetchBitmapTask.Stub() { - }; + return null; } } diff --git a/play-services-core/src/main/java/org/microg/gms/measurement/MeasurementBrokerService.java b/play-services-core/src/main/java/org/microg/gms/measurement/MeasurementBrokerService.java new file mode 100644 index 00000000..4cd9a0f8 --- /dev/null +++ b/play-services-core/src/main/java/org/microg/gms/measurement/MeasurementBrokerService.java @@ -0,0 +1,39 @@ +/* + * 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.measurement; + +import android.os.RemoteException; +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 org.microg.gms.BaseService; +import org.microg.gms.common.GmsService; + +public class MeasurementBrokerService extends BaseService { + public MeasurementBrokerService() { + super("GmsMeasureBrokerSvc", GmsService.MEASUREMENT); + } + + @Override + public void handleServiceRequest(IGmsCallbacks callback, GetServiceRequest request, GmsService service) throws RemoteException { + callback.onPostInitComplete(CommonStatusCodes.SUCCESS, new MeasurementServiceImpl().asBinder(), null); + } +} diff --git a/play-services-core/src/main/java/org/microg/gms/measurement/MeasurementServiceImpl.java b/play-services-core/src/main/java/org/microg/gms/measurement/MeasurementServiceImpl.java new file mode 100644 index 00000000..c78851b0 --- /dev/null +++ b/play-services-core/src/main/java/org/microg/gms/measurement/MeasurementServiceImpl.java @@ -0,0 +1,34 @@ +/* + * 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.measurement; + +import android.os.Parcel; +import android.os.RemoteException; +import android.util.Log; + +import com.google.android.gms.measurement.internal.IMeasurementService; + +public class MeasurementServiceImpl extends IMeasurementService.Stub { + private static final String TAG = "GmsMeasureSvcImpl"; + + @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/phenotype/ConfigurationProvider.java b/play-services-core/src/main/java/org/microg/gms/phenotype/ConfigurationProvider.java new file mode 100644 index 00000000..131be99b --- /dev/null +++ b/play-services-core/src/main/java/org/microg/gms/phenotype/ConfigurationProvider.java @@ -0,0 +1,65 @@ +/* + * 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.support.annotation.NonNull; +import android.support.annotation.Nullable; +import android.util.Log; + +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(); + } +}