Skip to content

Commit 8fd66f8

Browse files
authored
Merge branch 'microg:master' into asterism
2 parents c04c7df + 605ca14 commit 8fd66f8

11 files changed

Lines changed: 128 additions & 10 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/*
2+
* SPDX-FileCopyrightText: 2026 microG Project Team
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
package com.google.android.gms.common.internal.service;
7+
8+
interface ICommonCallbacks {
9+
void onClearDefaultAccountResult(int statusCode);
10+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/*
2+
* SPDX-FileCopyrightText: 2026 microG Project Team
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
package com.google.android.gms.common.internal.service;
7+
8+
import com.google.android.gms.common.internal.service.ICommonCallbacks;
9+
10+
interface ICommonService {
11+
void clearDefaultAccount(in ICommonCallbacks callbacks) = 0;
12+
}

play-services-core/src/main/AndroidManifest.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1167,6 +1167,12 @@
11671167
</intent-filter>
11681168
</service>
11691169

1170+
<service android:name="org.microg.gms.common.GmsCommonService">
1171+
<intent-filter>
1172+
<action android:name="com.google.android.gms.common.service.START" />
1173+
</intent-filter>
1174+
</service>
1175+
11701176
<activity
11711177
android:name="org.microg.gms.mlkit.BarcodeScanningActivity"
11721178
android:exported="true"
@@ -1232,7 +1238,6 @@
12321238
<action android:name="com.google.android.gms.cast.remote_display.service.START" />
12331239
<action android:name="com.google.android.gms.chromesync.service.START" />
12341240
<action android:name="com.google.android.gms.common.download.START" />
1235-
<action android:name="com.google.android.gms.common.service.START" />
12361241
<action android:name="com.google.android.gms.config.START" />
12371242
<action android:name="com.google.android.gms.deviceconnection.service.START" />
12381243
<action android:name="com.google.android.gms.enterprise.loader.service.START" />

play-services-core/src/main/kotlin/org/microg/gms/accountsettings/ui/MainActivity.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ private val SCREEN_ID_TO_URL = hashMapOf(
7171
214 to "https://myaccount.google.com/dashboard",
7272
215 to "https://takeout.google.com",
7373
216 to "https://myaccount.google.com/inactive",
74+
217 to "https://myaccount.google.com/blocklist",
7475
218 to "https://myaccount.google.com/profile-picture?interop=o",
7576
219 to "https://myactivity.google.com/myactivity",
7677
220 to "https://www.google.com/maps/timeline",
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*
2+
* SPDX-FileCopyrightText: 2026 microG Project Team
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
package org.microg.gms.common
7+
8+
import android.content.Context
9+
import android.util.Log
10+
import androidx.lifecycle.Lifecycle
11+
import androidx.lifecycle.LifecycleOwner
12+
import androidx.lifecycle.lifecycleScope
13+
import com.google.android.gms.common.ConnectionResult
14+
import com.google.android.gms.common.internal.GetServiceRequest
15+
import com.google.android.gms.common.internal.IGmsCallbacks
16+
import com.google.android.gms.common.internal.service.ICommonCallbacks
17+
import com.google.android.gms.common.internal.service.ICommonService
18+
import org.microg.gms.BaseService
19+
import org.microg.gms.auth.signin.SignInConfigurationService
20+
21+
private const val TAG = "GmsCommonService"
22+
23+
class GmsCommonService : BaseService(TAG, GmsService.COMMON) {
24+
override fun handleServiceRequest(callback: IGmsCallbacks?, request: GetServiceRequest, service: GmsService?) {
25+
val packageName = PackageUtils.getAndCheckCallingPackage(this, request.packageName) ?: throw IllegalArgumentException("Missing package name")
26+
Log.d(TAG, "handleServiceRequest: start: $packageName")
27+
callback?.onPostInitComplete(ConnectionResult.SUCCESS, GmsCommonServiceImpl(this, packageName, lifecycle).asBinder(), null)
28+
}
29+
}
30+
31+
class GmsCommonServiceImpl(val context: Context, val packageName: String, override val lifecycle: Lifecycle) : ICommonService.Stub(), LifecycleOwner {
32+
override fun clearDefaultAccount(callbacks: ICommonCallbacks?) {
33+
Log.d(TAG, "clearDefaultAccount: packageName: $packageName")
34+
lifecycleScope.launchWhenStarted {
35+
AccountUtils.get(context).removeSelectedAccount(packageName)
36+
SignInConfigurationService.setAuthInfo(context, packageName, null, null)
37+
runCatching { callbacks?.onClearDefaultAccountResult(0) }
38+
}
39+
}
40+
}

play-services-maps/core/hms/src/main/java/com/google/android/gms/maps/internal/CreatorImpl.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import com.google.android.gms.maps.StreetViewPanoramaOptions;
2020
import com.google.android.gms.maps.model.internal.IBitmapDescriptorFactoryDelegate;
2121

22-
import com.huawei.hms.maps.MapsInitializer;
2322
import org.microg.gms.maps.hms.CameraUpdateFactoryImpl;
2423
import org.microg.gms.maps.hms.MapFragmentImpl;
2524
import org.microg.gms.maps.hms.MapViewImpl;
@@ -30,6 +29,7 @@
3029
@Keep
3130
public class CreatorImpl extends ICreator.Stub {
3231
private static final String TAG = "GmsMapCreator";
32+
public static volatile int VERSION = Integer.MAX_VALUE;
3333

3434
@Override
3535
public void init(IObjectWrapper resources) {
@@ -59,6 +59,7 @@ public IBitmapDescriptorFactoryDelegate newBitmapDescriptorFactoryDelegate() {
5959
@Override
6060
public void initV2(IObjectWrapper resources, int flags) {
6161
BitmapDescriptorFactoryImpl.INSTANCE.initialize(ObjectWrapper.unwrapTyped(resources, Resources.class));
62+
VERSION = flags;
6263
//ResourcesContainer.set((Resources) ObjectWrapper.unwrap(resources));
6364
Log.d(TAG, "initV2 " + flags);
6465
}

play-services-maps/core/hms/src/main/kotlin/org/microg/gms/maps/hms/GoogleMap.kt

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import androidx.annotation.IdRes
2222
import androidx.annotation.Keep
2323
import androidx.collection.LongSparseArray
2424
import com.google.android.gms.dynamic.IObjectWrapper
25+
import com.google.android.gms.dynamic.ObjectWrapper
2526
import com.google.android.gms.dynamic.unwrap
2627
import com.google.android.gms.maps.GoogleMap.MAP_TYPE_TERRAIN
2728
import com.google.android.gms.maps.GoogleMapOptions
@@ -588,10 +589,18 @@ class GoogleMapImpl(private val context: Context, var options: GoogleMapOptions)
588589
}
589590

590591
override fun snapshot(callback: ISnapshotReadyCallback, bitmap: IObjectWrapper?) = afterInitialize {
591-
Log.d(TAG, "snapshot")
592-
val hmsBitmap = bitmap.unwrap<Bitmap>() ?: return@afterInitialize
593-
val hmsCallback = HuaweiMap.SnapshotReadyCallback { p0 -> callback.onBitmapReady(p0) }
594-
it.snapshot(hmsCallback, hmsBitmap)
592+
Log.d(TAG, "taking snapshot now")
593+
val hmsBitmap = bitmap.unwrap<Bitmap>()
594+
Log.d(TAG, "provided bitmap. $hmsBitmap")
595+
val hmsCallback = HuaweiMap.SnapshotReadyCallback { result ->
596+
runOnMainLooper {
597+
Log.d(TAG, "take snapshot end. $result")
598+
if (CreatorImpl.VERSION < SNAPSHOT_OLD_VERSION_CODE) {
599+
callback.onBitmapReady(result)
600+
} else callback.onBitmapWrappedReady(ObjectWrapper.wrap(result))
601+
}
602+
}
603+
if (hmsBitmap != null) it.snapshot(hmsCallback, hmsBitmap) else it.snapshot(hmsCallback)
595604
}
596605

597606
override fun snapshotForTest(callback: ISnapshotReadyCallback) = afterInitialize {
@@ -984,6 +993,7 @@ class GoogleMapImpl(private val context: Context, var options: GoogleMapOptions)
984993

985994
companion object {
986995
private const val TAG = "GmsGoogleMap"
996+
private const val SNAPSHOT_OLD_VERSION_CODE = 4000000
987997

988998
private const val TAG_LOGO = "fakeWatermark"
989999
private const val ON_MAP_CALLBACK_DELAY = 300L

play-services-maps/core/hms/src/main/kotlin/org/microg/gms/maps/hms/model/BitmapDescriptorFactory.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,8 @@ import android.util.Log
1212
import com.google.android.gms.dynamic.IObjectWrapper
1313
import com.google.android.gms.dynamic.ObjectWrapper
1414
import com.google.android.gms.maps.model.internal.IBitmapDescriptorFactoryDelegate
15-
import com.huawei.hms.maps.HuaweiMap
1615
import com.huawei.hms.maps.model.BitmapDescriptorFactory
1716

18-
1917
object BitmapDescriptorFactoryImpl : IBitmapDescriptorFactoryDelegate.Stub() {
2018
private val TAG = "GmsMapBitmap"
2119
private var resources: Resources? = null
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/*
2+
* SPDX-FileCopyrightText: 2026 microG Project Team
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
package com.android.vending.billing;
6+
7+
import android.os.Bundle;
8+
9+
interface IInAppBillingInitializeCallback {
10+
void callback(in Bundle bundle);
11+
}

vending-app/src/main/aidl/com/android/vending/billing/IInAppBillingService.aidl

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import com.android.vending.billing.IInAppBillingGetBillingConfigCallback;
1010
import com.android.vending.billing.IInAppBillingGetExternalPaymentDialogIntentCallback;
1111
import com.android.vending.billing.IInAppBillingIsAlternativeBillingOnlyAvailableCallback;
1212
import com.android.vending.billing.IInAppBillingIsExternalPaymentAvailableCallback;
13+
import com.android.vending.billing.IInAppBillingInitializeCallback;
1314

1415

1516
/**
@@ -441,4 +442,14 @@ interface IInAppBillingService {
441442
void showExternalOfferInformationDialog(int apiVersion, String packageName, in Bundle extraParams, IInAppBillingGetExternalPaymentDialogIntentCallback callback) = 1900;
442443

443444
void delegateToBackend(in Bundle bundle, IInAppBillingDelegateToBackendCallback callback) = 2000;
444-
}
445+
446+
/**
447+
* @param apiVersion billing API version that the app is using, must be 22 or later
448+
* @param packageName package name of the calling app
449+
* @param extraParams a Bundle with the following optional keys:
450+
* "callingPackage" - String
451+
* "enablePendingPurchases" - Boolean
452+
* @param callback callback that is invoked with the result, see IInAppBillingInitializeCallback.aidl for details
453+
*/
454+
void initialize(int apiVersion, String packageName, in Bundle extraParams, IInAppBillingInitializeCallback callback) = 2100;
455+
}

0 commit comments

Comments
 (0)