Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
[XA 5.1] Android.Bluetooth.BluetoothAdapter.Enable is incorrectly marked as [Obsolete("deprecated")] for API level 20 and higher
## Current status of the APIs
As shown on  and , the `Enable()` and `Disable()` methods for BluetoothAdapter have been marked as [Obsolete("deprecated")] for API level 20 and higher starting in Xamarin.Android 5.1.
>  http://developer.xamarin.com/releases/android/xamarin.android_5/xamarin.android_5.1/level_20_diff/mono.android.dll/#Type_Changed_Android.Bluetooth.BluetoothAdapter
>  http://developer.xamarin.com/releases/android/xamarin.android_5/xamarin.android_5.1/level_21_diff/mono.android.dll/#Type_Changed_Android.Bluetooth.BluetoothAdapter
## Expected status of the APIs
Neither the `Enable()` nor `Disable()` method should be marked deprecated.
### Additional information
The `enable()`  and `disable()`  methods are _not_ marked deprecated in the Android API docs.
>  http://developer.android.com/reference/android/bluetooth/BluetoothAdapter.html#enable()
>  http://developer.android.com/reference/android/bluetooth/BluetoothAdapter.html#disable()
And if I'm not mis-understanding the output from `javap`, it looks the Java bytecode doesn't contain a "deprecated" annotation for either of these methods either.
> $ javap -public -v -classpath ~/Library/Developer/Xamarin/android-sdk-macosx/platforms/android-21/android.jar android.bluetooth.BluetoothAdapter
... compare some methods that _are_ deprecated:
> public boolean startLeScan(java.util.UUID, android.bluetooth.BluetoothAdapter$LeScanCallback);
> Deprecated: true
> public void stopLeScan(android.bluetooth.BluetoothAdapter$LeScanCallback);
> Deprecated: true
... against `enable()` and `disable()`:
> public boolean enable();
> public boolean disable();
## Version information
Xamarin.Android 22.214.171.124 (d23da36)
This is presumably a bug in jar2xml, and I'm not sure I want to fix.
The underlying bug will be fixed when we migrate to class-parse.
Also note that this issue isn't limited to BluetoothAdapter.enable(); it's present on *lots* of methods, e.g. Android.App.Service.OnStartCommand():
I have no idea how many methods are erroneously marked as deprecated, but it's clearly at least 2.
Thanks for the insight. Are you able to provide any more information then about when you think this issue will be fixed?
> when [do] you think this issue will be fixed?
The original plan was to work on class-parse integration for 5.1 and make it the default in 5.2.
That got punted to instead work on improving our MSBuild task speed and behavior, so that e.g. rebuilds with no changes should be faster.
So...lol. I have no idea.
*** Bug 29684 has been marked as a duplicate of this bug. ***
I have checked this issue and observed the same behaviour mentioned in bug description. Please refer the screencast : http://www.screencast.com/t/LKQurYOtY
Environment Info :
=== Xamarin Studio ===
Version 5.9.4 (build 5)
Installation UUID: ce927b2a-2c07-44c5-b186-09cfdafba6dc
Mono 4.0.2 ((detached/c99aa0c)
GTK+ 2.24.23 (Raleigh theme)
Package version: 400020005
=== Apple Developer Tools ===
Xcode 6.2 (6776)
=== Xamarin.Android ===
Version: 126.96.36.199 (Enterprise Edition)
Android SDK: /Users/xamarin76/Desktop/android-sdk-macosx
Supported Android versions:
2.3 (API level 10)
4.0.3 (API level 15)
4.1 (API level 16)
4.2 (API level 17)
4.3 (API level 18)
4.4 (API level 19)
4.4.87 (API level 20)
5.0 (API level 21)
Java SDK: /usr
java version "1.7.0_65"
Java(TM) SE Runtime Environment (build 1.7.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)
=== Xamarin Android Player ===
Version: Unknown version
Location: /Applications/Xamarin Android Player.app
=== Build Information ===
Release ID: 509040005
Git revision: 8010a90f6e246b32364e3fb46ef2c9d1be9c9a2b
Build date: 2015-06-08 16:52:06-04
Xamarin addins: 7e93e9c3503f28770f23ce1b7eafd829919f18e8
=== Operating System ===
Mac OS X 10.9.5
Darwin Xamarin76s-Mac-mini.local 13.4.0 Darwin Kernel Version 13.4.0
Sun Aug 17 19:50:11 PDT 2014
Fixed in [master c90a67a]. So as...
I believe that c90a67a was reverted, and the fix needs to be re-thought.
Weird, it should NOT be reverted on that part. I'll check why those Obsolete attributes are back now.
Should be fixed after the migration to class-parse (commit 9d3be1d3).
I have checked this issue with latest C7 build:
xamarin.android-6.1.0-63_5eb9ddcb8cc975c6e866fc389a2524bcaa8c31fb. As per comment 7 , I am able to see the method on assemblies browser windows. Here is the screencast for the same: http://www.screencast.com/t/Ir4ryMfyv7Ev
Hence closing this issue.