|
| 1 | +using System; |
| 2 | +using Android.Runtime; |
| 3 | + |
| 4 | +namespace Android.Bluetooth |
| 5 | +{ |
| 6 | + // Proposed |
| 7 | + partial class BluetoothGattServerCallback |
| 8 | + { |
| 9 | + // Old and busted |
| 10 | + [Obsolete ("Use OnServiceAdded(Android.Bluetooth.GattStatus, Android.Bluetooth.BluetoothGattService)", true)] |
| 11 | + [Register ("onServiceAdded", "(ILandroid/bluetooth/BluetoothGattService;)V", "GetOnServiceAdded_ILandroid_bluetooth_BluetoothGattService_Handler_ext")] |
| 12 | + public virtual void OnServiceAdded (ProfileState status, BluetoothGattService service) |
| 13 | + { |
| 14 | + ActualOnServiceAdded (status, service); |
| 15 | + } |
| 16 | + |
| 17 | + void ActualOnServiceAdded (ProfileState status, BluetoothGattService service) |
| 18 | + { |
| 19 | + this.OnServiceAdded ((GattStatus) (int) status, service); |
| 20 | + } |
| 21 | + |
| 22 | + static Delegate cb_onServiceAdded_ILandroid_bluetooth_BluetoothGattService_ext; |
| 23 | +#pragma warning disable 0169 |
| 24 | + static Delegate GetOnServiceAdded_ILandroid_bluetooth_BluetoothGattService_Handler_ext () |
| 25 | + { |
| 26 | + if (cb_onServiceAdded_ILandroid_bluetooth_BluetoothGattService_ext == null) |
| 27 | + cb_onServiceAdded_ILandroid_bluetooth_BluetoothGattService_ext = JNINativeWrapper.CreateDelegate ((Action<IntPtr, IntPtr, int, IntPtr>) n_OnServiceAdded_ILandroid_bluetooth_BluetoothGattService_ext); |
| 28 | + return cb_onServiceAdded_ILandroid_bluetooth_BluetoothGattService_ext; |
| 29 | + } |
| 30 | + |
| 31 | + static void n_OnServiceAdded_ILandroid_bluetooth_BluetoothGattService_ext (IntPtr jnienv, IntPtr native__this, int native_status, IntPtr native_service) |
| 32 | + { |
| 33 | + Android.Bluetooth.BluetoothGattServerCallback __this = global::Java.Lang.Object.GetObject<Android.Bluetooth.BluetoothGattServerCallback> (jnienv, native__this, JniHandleOwnership.DoNotTransfer); |
| 34 | + Android.Bluetooth.ProfileState status = (Android.Bluetooth.ProfileState) native_status; |
| 35 | + Android.Bluetooth.BluetoothGattService service = global::Java.Lang.Object.GetObject<Android.Bluetooth.BluetoothGattService> (native_service, JniHandleOwnership.DoNotTransfer); |
| 36 | + __this.ActualOnServiceAdded (status, service); |
| 37 | + } |
| 38 | +#pragma warning restore 0169 |
| 39 | + } |
| 40 | +} |
0 commit comments