Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Mono.Android] Point AppOpsManager methods to correct enums. #5208

Merged
merged 1 commit into from
Oct 15, 2020

Conversation

jpobst
Copy link
Contributor

@jpobst jpobst commented Oct 14, 2020

Context: #5200

Several API-29 methods are missing from the AppOpsManager class, such as unsafeCheckOp (string, int, string).

From the build logs:

EXEC : warning BG8800: Unknown parameter type 'Android.App.Admin.WatchForeground' for member 'Android.App.AppOpsManagerStartWatchingMode (string, string, Android.App.Admin.WatchForeground, android.app.AppOpsManager.OnOpChangedListener)'. [/Users/builder/azdo/_work/30/s/xamarin-android/src/Mono.Android/Mono.Android.csproj]
EXEC : warning BG8700: Unknown return type 'Android.App.Admin.AppOpsManagerMode' for member 'Android.App.AppOpsManagerUnsafeCheckOp (java.lang.String, int, java.lang.String)'. [/Users/builder/azdo/_work/30/s/xamarin-android/src/Mono.Android/Mono.Android.csproj]
EXEC : warning BG8700: Unknown return type 'Android.App.Admin.AppOpsManagerMode' for member 'Android.App.AppOpsManagerUnsafeCheckOpNoThrow (java.lang.String, int, java.lang.String)'. [/Users/builder/azdo/_work/30/s/xamarin-android/src/Mono.Android/Mono.Android.csproj]
EXEC : warning BG8700: Unknown return type 'Android.App.Admin.AppOpsManagerMode' for member 'Android.App.AppOpsManagerUnsafeCheckOpRaw (java.lang.String, int, java.lang.String)'. [/Users/builder/azdo/_work/30/s/xamarin-android/src/Mono.Android/Mono.Android.csproj]
EXEC : warning BG8700: Unknown return type 'Android.App.Admin.AppOpsManagerMode' for member 'Android.App.AppOpsManagerUnsafeCheckOpRawNoThrow (java.lang.String, int, java.lang.String)'. [/Users/builder/azdo/_work/30/s/xamarin-android/src/Mono.Android/Mono.Android.csproj]

This is because the WatchForeground and AppOpsManagerMode enums exist in the Android.App namespace and not the Android.App.Admin namespace.

This PR updates the method map to point to the correct location for the enumerations, allowing the methods to be correctly bound.

@jpobst jpobst mentioned this pull request Oct 14, 2020
@jpobst jpobst changed the title [Mono.Android] Point AppOpsManager methods to correct enum. [Mono.Android] Point AppOpsManager methods to correct enums. Oct 14, 2020
@jpobst jpobst marked this pull request as ready for review October 14, 2020 16:40
@jpobst jpobst requested a review from jonpryor as a code owner October 14, 2020 16:40
@jonpryor jonpryor merged commit b3d2910 into master Oct 15, 2020
@jonpryor jonpryor deleted the unsafe-check-op branch October 15, 2020 15:03
@brendanzagaeski brendanzagaeski added the bug Component does not function as intended. label Nov 20, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Jan 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Component does not function as intended.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants