Bluetooth enable and disable using ADB is not working in Android 7 Samsung galaxy Note 5

We are trying to enable and disable Bluetooth before we start our automation test using adb commands

Enable

adb shell service call bluetooth_manager 6

Disable

adb shell service call bluetooth_manager 9
adb shell settings put global bluetooth_on 0 in db level

it is changing in the device db level but not reflecting in the device ui level so the test gets failed

We are getting the Bluetooth status using this command

adb shell settings get global bluetooth_on

Are there any other work around to enable and disable the bluetooth using APPIUM java because these commands working in some devices but not in all the device. I am looking for a permanent solution.