GAP: Disconnect Br/Edr ACL in BLE ON (2/3)
Disconnect Br/Edr ACL links in BLE ON scenario
Change-Id: Ia6975a6454f398831e01287f6e1fd359a319f880
CRs-Fixed: 2230727
diff --git a/packages_apps_bluetooth_ext/jni/com_android_bluetooth_btservice_vendor.cpp b/packages_apps_bluetooth_ext/jni/com_android_bluetooth_btservice_vendor.cpp
index 30a5913..c89a78e 100644
--- a/packages_apps_bluetooth_ext/jni/com_android_bluetooth_btservice_vendor.cpp
+++ b/packages_apps_bluetooth_ext/jni/com_android_bluetooth_btservice_vendor.cpp
@@ -267,6 +267,16 @@
return JNI_TRUE;
}
+static bool bredrstartupNative(JNIEnv *env, jobject obj) {
+
+ ALOGI("%s", __FUNCTION__);
+
+ jboolean result = JNI_FALSE;
+ if (!sBluetoothVendorInterface) return result;
+
+ sBluetoothVendorInterface->bredrstartup();
+ return JNI_TRUE;
+}
static bool setWifiStateNative(JNIEnv *env, jobject obj, jboolean status) {
@@ -316,6 +326,7 @@
{"initNative", "()V", (void *) initNative},
{"cleanupNative", "()V", (void *) cleanupNative},
{"bredrcleanupNative", "()V", (void*) bredrcleanupNative},
+ {"bredrstartupNative", "()V", (void*) bredrstartupNative},
{"setWifiStateNative", "(Z)V", (void*) setWifiStateNative},
{"getProfileInfoNative", "(II)Z", (void*) getProfileInfoNative},
{"getQtiStackStatusNative", "()Z", (void*) getQtiStackStatusNative},
diff --git a/packages_apps_bluetooth_ext/src/btservice/Vendor.java b/packages_apps_bluetooth_ext/src/btservice/Vendor.java
index b3413e7..07ecd8d 100644
--- a/packages_apps_bluetooth_ext/src/btservice/Vendor.java
+++ b/packages_apps_bluetooth_ext/src/btservice/Vendor.java
@@ -83,6 +83,10 @@
bredrcleanupNative();
}
+ public void bredrStartup() {
+ bredrstartupNative();
+ }
+
public void setWifiState(boolean status) {
Log.d(TAG,"setWifiState to: " + status);
setWifiStateNative(status);
@@ -181,6 +185,7 @@
}
}
private native void bredrcleanupNative();
+ private native void bredrstartupNative();
private native void initNative();
private native static void classInitNative();
private native void cleanupNative();
diff --git a/system_bt_ext/btif/src/btif_vendor.cc b/system_bt_ext/btif/src/btif_vendor.cc
index c935ea6..446c812 100644
--- a/system_bt_ext/btif/src/btif_vendor.cc
+++ b/system_bt_ext/btif/src/btif_vendor.cc
@@ -166,6 +166,7 @@
}
btif_queue_release();
btif_dm_bredr_disable();
+ BTA_DmBredrCleanup();
HAL_CBACK(bt_vendor_callbacks, bredr_cleanup_cb, true);
}
@@ -276,6 +277,12 @@
manufacturer_id, power_level, rssi, link_quality,
glitch_count);
}
+static void bredrstartup(void)
+{
+ LOG_INFO(LOG_TAG,"bredrstartup");
+ BTA_DmBredrStartup();
+}
+
static void bredrcleanup(void)
{
LOG_INFO(LOG_TAG,"bredrcleanup");
@@ -422,6 +429,7 @@
NULL,
#endif
bredrcleanup,
+ bredrstartup,
set_wifi_state,
get_profile_info,
set_property_callouts,
diff --git a/vhal/include/hardware/vendor.h b/vhal/include/hardware/vendor.h
index 5b756be..00a532d 100644
--- a/vhal/include/hardware/vendor.h
+++ b/vhal/include/hardware/vendor.h
@@ -168,6 +168,9 @@
/** Does BREDR cleanup */
void (*bredrcleanup)(void);
+ /** Does BREDR startup */
+ void (*bredrstartup)(void);
+
/** set wifi state */
void (*set_wifi_state)(bool);