0
0
Fork 0
mirror of https://github.com/YTVanced/VancedMicroG synced 2024-12-02 16:07:25 +00:00

Add FACS Cache dummy

This commit is contained in:
Marvin W 2021-05-05 23:34:56 +02:00
parent 3c1cb13e32
commit f6ec0efb63
No known key found for this signature in database
GPG key ID: 072E9235DB996F2A
14 changed files with 170 additions and 0 deletions

View file

@ -0,0 +1,3 @@
package com.google.android.gms.facs.cache;
parcelable FacsCacheCallOptions;

View file

@ -0,0 +1,3 @@
package com.google.android.gms.facs.cache;
parcelable ForceSettingsCacheRefreshResult;

View file

@ -0,0 +1,3 @@
package com.google.android.gms.facs.cache;
parcelable GetActivityControlsSettingsResult;

View file

@ -0,0 +1,3 @@
package com.google.android.gms.facs.cache;
parcelable ReadDeviceLevelSettingsResult;

View file

@ -0,0 +1,3 @@
package com.google.android.gms.facs.cache;
parcelable UpdateActivityControlsSettingsResult;

View file

@ -0,0 +1,15 @@
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;
}

View file

@ -0,0 +1,12 @@
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;
}

View file

@ -0,0 +1,17 @@
/*
* 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<FacsCacheCallOptions> CREATOR = new AutoCreator<>(FacsCacheCallOptions.class);
}

View file

@ -0,0 +1,13 @@
/*
* 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<ForceSettingsCacheRefreshResult> CREATOR = new AutoCreator<>(ForceSettingsCacheRefreshResult.class);
}

View file

@ -0,0 +1,13 @@
/*
* 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<GetActivityControlsSettingsResult> CREATOR = new AutoCreator<>(GetActivityControlsSettingsResult.class);
}

View file

@ -0,0 +1,13 @@
/*
* 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<ReadDeviceLevelSettingsResult> CREATOR = new AutoCreator<>(ReadDeviceLevelSettingsResult.class);
}

View file

@ -0,0 +1,13 @@
/*
* 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<UpdateActivityControlsSettingsResult> CREATOR = new AutoCreator<>(UpdateActivityControlsSettingsResult.class);
}

View file

@ -699,6 +699,12 @@
</intent-filter>
</service>
<service android:name="org.microg.gms.udc.FacsCacheService">
<intent-filter>
<action android:name="com.google.android.gms.facs.cache.service.START" />
</intent-filter>
</service>
<service android:name="org.microg.gms.DummyService">
<intent-filter>
<action android:name="com.google.android.gms.plus.service.START" />
@ -729,6 +735,7 @@
<action android:name="com.google.android.gms.herrevad.services.LightweightNetworkQualityAndroidService.START" />
<action android:name="com.google.android.gms.auth.api.credentials.service.START" />
<action android:name="com.google.android.gms.gass.START" />
<action android:name="com.google.android.gms.audit.service.START" />
</intent-filter>
</service>
</application>

View file

@ -0,0 +1,52 @@
/*
* SPDX-FileCopyrightText: 2021, microG Project Team
* SPDX-License-Identifier: Apache-2.0
*/
package org.microg.gms.udc
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
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)
}
}