Skip to content

Commit a20be39

Browse files
authored
[Mono.Android] Add Android API-R preview binding (#4327)
Context: https://web.archive.org/web/20200229224026/https://developer.android.com/preview/overview Android 11 Developer Preview 1 has been released. The Android 11 Developer Preview Program Overview [Timeline and updates][0] section suggests the following timeline: * Developer Preview 1 in February * Developer Preview 2 in March * Developer Preview 3 in April * Beta 1 in May * Beta 2 in June This contains the final APIs and official SDK. * Beta 3 and final release sometime in Q3, 2019. Add support for binding API-R as API-30, with `$(TargetFrameworkVersion)` v10.0.99. [0]: https://web.archive.org/web/20200229224026/https://developer.android.com/preview/overview#timeline
1 parent b366ac1 commit a20be39

File tree

7 files changed

+32756
-0
lines changed

7 files changed

+32756
-0
lines changed

build-tools/Xamarin.Android.Tools.BootstrapTasks/Xamarin.Android.Tools.BootstrapTasks/CheckApiCompatibility.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public sealed class CheckApiCompatibility : Task
2626
{ "v8.1", "v8.0" },
2727
{ "v9.0", "v8.1" },
2828
{ "v10.0", "v9.0" },
29+
{ "v10.0.99", "v10.0" },
2930
};
3031

3132
static readonly string [] assemblies =

build-tools/xaprepare/xaprepare/ConfigAndData/BuildAndroidPlatforms.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ class BuildAndroidPlatforms
3838
new AndroidPlatform (apiName: "Oreo", apiLevel: 27, platformID: "27", include: "v8.1", framework: "v8.1"),
3939
new AndroidPlatform (apiName: "Pie", apiLevel: 28, platformID: "28", include: "v9.0", framework: "v9.0"),
4040
new AndroidPlatform (apiName: "Q", apiLevel: 29, platformID: "29", include: "v10.0", framework: "v10.0"),
41+
new AndroidPlatform (apiName: "R", apiLevel: 30, platformID: "R", include: "v10.0.99", framework: "v10.0.99", stable: false),
4142
};
4243

4344
public static readonly Dictionary<string, uint> NdkMinimumAPI = new Dictionary<string, uint> {

build-tools/xaprepare/xaprepare/ConfigAndData/Dependencies/AndroidToolchain.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ public AndroidToolchain ()
4040
new AndroidPlatformComponent ("platform-27_r03", apiLevel: "27", pkgRevision: "3"),
4141
new AndroidPlatformComponent ("platform-28_r04", apiLevel: "28", pkgRevision: "4"),
4242
new AndroidPlatformComponent ("platform-29_r01", apiLevel: "29", pkgRevision: "1"),
43+
new AndroidPlatformComponent ("platform-R_r01", apiLevel: "R", pkgRevision: "1"),
4344

4445
new AndroidToolchainComponent ("docs-24_r01", destDir: "docs", pkgRevision: "1"),
4546
new AndroidToolchainComponent ("android_m2repository_r47", destDir: Path.Combine ("extras", "android", "m2repository"), pkgRevision: "47.0.0"),

src/Mono.Android/Profiles/api-30.params.txt

Lines changed: 32724 additions & 0 deletions
Large diffs are not rendered by default.

src/Mono.Android/metadata

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1528,4 +1528,27 @@
15281528
<attr api-since="29" path="/api/package[@name='java.lang']/class[@name='StringBuilder']" name="extends-generic-aware">java.lang.AbstractStringBuilder</attr>
15291529
<!-- We don't need to remove any method from Java.Lang.AbstractStringBuilder because they are all virtual methods -->
15301530

1531+
<!-- Api 30 adjustments -->
1532+
<!-- We need to remove abstract method close from CameraOfflineSession since it is already defined on base abstract class CameraCaptureSession -->
1533+
<remove-node api-since="30" path="/api/package[@name='android.hardware.camera2']/class[@name='CameraOfflineSession']/method[@name='close' and count(parameter)=0]" />
1534+
1535+
<!-- Namespace android.view.inline should be renamed to Android.Views.Inline -->
1536+
<attr api-since="30" path="/api/package[@name='android.view.inline']" name="managedName">Android.Views.Inline</attr>
1537+
1538+
<!-- Google has added getCellIdentity and getCellSignalStrength as abstract method on the base class -->
1539+
<attr api-since="30" path="/api/package[@name='android.telephony']/class[@name='CellInfoCdma']/method[@name='getCellIdentity' and count(parameter)=0]" name="managedReturn">Android.Telephony.CellIdentity</attr>
1540+
<attr api-since="30" path="/api/package[@name='android.telephony']/class[@name='CellInfoCdma']/method[@name='getCellSignalStrength' and count(parameter)=0]" name="managedReturn">Android.Telephony.CellSignalStrength</attr>
1541+
<attr api-since="30" path="/api/package[@name='android.telephony']/class[@name='CellInfoGsm']/method[@name='getCellIdentity' and count(parameter)=0]" name="managedReturn">Android.Telephony.CellIdentity</attr>
1542+
<attr api-since="30" path="/api/package[@name='android.telephony']/class[@name='CellInfoGsm']/method[@name='getCellSignalStrength' and count(parameter)=0]" name="managedReturn">Android.Telephony.CellSignalStrength</attr>
1543+
<attr api-since="30" path="/api/package[@name='android.telephony']/class[@name='CellInfoLte']/method[@name='getCellIdentity' and count(parameter)=0]" name="managedReturn">Android.Telephony.CellIdentity</attr>
1544+
<attr api-since="30" path="/api/package[@name='android.telephony']/class[@name='CellInfoLte']/method[@name='getCellSignalStrength' and count(parameter)=0]" name="managedReturn">Android.Telephony.CellSignalStrength</attr>
1545+
<attr api-since="30" path="/api/package[@name='android.telephony']/class[@name='CellInfoTdscdma']/method[@name='getCellIdentity' and count(parameter)=0]" name="managedReturn">Android.Telephony.CellIdentity</attr>
1546+
<attr api-since="30" path="/api/package[@name='android.telephony']/class[@name='CellInfoTdscdma']/method[@name='getCellSignalStrength' and count(parameter)=0]" name="managedReturn">Android.Telephony.CellSignalStrength</attr>
1547+
<attr api-since="30" path="/api/package[@name='android.telephony']/class[@name='CellInfoWcdma']/method[@name='getCellIdentity' and count(parameter)=0]" name="managedReturn">Android.Telephony.CellIdentity</attr>
1548+
<attr api-since="30" path="/api/package[@name='android.telephony']/class[@name='CellInfoWcdma']/method[@name='getCellSignalStrength' and count(parameter)=0]" name="managedReturn">Android.Telephony.CellSignalStrength</attr>
1549+
1550+
<!-- We don't support methods that require Actions/Functions with more than 16 arguments -->
1551+
<remove-node api-since="30" path="/api/package[@name='java.util']/interface[@jni-signature='Ljava/util/Map;']/method[@name='of' and count(parameter)=16]" />
1552+
<remove-node api-since="30" path="/api/package[@name='java.util']/interface[@jni-signature='Ljava/util/Map;']/method[@name='of' and count(parameter)=18]" />
1553+
<remove-node api-since="30" path="/api/package[@name='java.util']/interface[@jni-signature='Ljava/util/Map;']/method[@name='of' and count(parameter)=20]" />
15311554
</metadata>

src/Mono.Android/methodmap.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,7 @@
375375
1, android.location,Criteria,setAccuracy,accuracy,Android.Locations.Accuracy
376376
1, android.location,Criteria,getPowerRequirement,return,Android.Locations.Power
377377
1, android.location,Criteria,setPowerRequirement,level,Android.Locations.Power
378+
1, android.location,Criteria,setPowerRequirement,powerRequirement,Android.Locations.Power
378379
0, android.location,[Interface]GpsStatus.Listener,onGpsStatusChanged,event,Android.Locations.GpsEvent
379380
0, android.location,Location,convert,outputType,Android.Locations.Format
380381
1, android.location,[Interface]LocationListener,onStatusChanged,status,Android.Locations.Availability
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Compat issues with assembly Mono.Android:
2+
CannotAddAbstractMembers : Member 'Android.Telephony.CellInfo.CellIdentity' is abstract in the implementation but is missing in the contract.
3+
CannotAddAbstractMembers : Member 'Android.Telephony.CellInfo.CellSignalStrength' is abstract in the implementation but is missing in the contract.
4+
CannotAddAbstractMembers : Member 'Android.Telephony.CellInfo.CellIdentity.get()' is abstract in the implementation but is missing in the contract.
5+
CannotAddAbstractMembers : Member 'Android.Telephony.CellInfo.CellSignalStrength.get()' is abstract in the implementation but is missing in the contract.

0 commit comments

Comments
 (0)