OSDN Git Service

Remove more vestiges of PAN GN
authorZach Johnson <zachoverflow@google.com>
Wed, 26 Aug 2020 00:08:19 +0000 (17:08 -0700)
committerZach Johnson <zachoverflow@google.com>
Wed, 26 Aug 2020 00:13:54 +0000 (17:13 -0700)
Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I36a436dea4f3668ee1c393c96c8d5b7b8fbf2bb5

bta/pan/bta_pan_act.cc
bta/pan/bta_pan_int.h
stack/include/pan_api.h
stack/pan/pan_api.cc

index e805ccd..1e2c59a 100644 (file)
@@ -328,13 +328,12 @@ void bta_pan_set_role(tBTA_PAN_DATA* p_data) {
   tBTA_PAN bta_pan;
 
   bta_pan_cb.app_id[0] = p_data->api_set_role.user_app_id;
-  bta_pan_cb.app_id[1] = p_data->api_set_role.gn_app_id;
   bta_pan_cb.app_id[2] = p_data->api_set_role.nap_app_id;
 
   /* set security correctly in api and here */
   status =
       PAN_SetRole(p_data->api_set_role.role, p_data->api_set_role.user_name,
-                  p_data->api_set_role.gn_name, p_data->api_set_role.nap_name);
+                  p_data->api_set_role.nap_name);
 
   bta_pan.set_role.role = p_data->api_set_role.role;
   if (status == PAN_SUCCESS) {
@@ -352,7 +351,7 @@ void bta_pan_set_role(tBTA_PAN_DATA* p_data) {
   }
   /* if status is not success clear everything */
   else {
-    PAN_SetRole(0, NULL, NULL, NULL);
+    PAN_SetRole(0, NULL, NULL);
     bta_sys_remove_uuid(UUID_SERVCLASS_NAP);
     bta_sys_remove_uuid(UUID_SERVCLASS_GN);
     bta_sys_remove_uuid(UUID_SERVCLASS_PANU);
@@ -378,7 +377,7 @@ void bta_pan_disable(void) {
   uint8_t i;
 
   /* close all connections */
-  PAN_SetRole(0, NULL, NULL, NULL);
+  PAN_SetRole(0, NULL, NULL);
 
 #if (BTA_EIR_CANNED_UUID_LIST != TRUE)
   bta_sys_remove_uuid(UUID_SERVCLASS_NAP);
@@ -496,8 +495,7 @@ void bta_pan_conn_open(tBTA_PAN_SCB* p_scb, tBTA_PAN_DATA* p_data) {
   /* If app_id is NAP/GN, check whether there are multiple connections.
      If there are, provide a special app_id to dm to enforce master role only.
      */
-  if ((p_scb->app_id == bta_pan_cb.app_id[1] ||
-       p_scb->app_id == bta_pan_cb.app_id[2]) &&
+  if (p_scb->app_id == bta_pan_cb.app_id[2] &&
       bta_pan_has_multiple_connections(p_scb->app_id)) {
     p_scb->app_id = BTA_APP_ID_PAN_MULTI;
   }
index e525b60..baa0912 100644 (file)
@@ -70,11 +70,9 @@ typedef struct {
 typedef struct {
   BT_HDR hdr;                               /* Event header */
   char user_name[BTA_SERVICE_NAME_LEN + 1]; /* Service name */
-  char gn_name[BTA_SERVICE_NAME_LEN + 1];   /* Service name */
   char nap_name[BTA_SERVICE_NAME_LEN + 1];  /* Service name */
   tBTA_PAN_ROLE role;
   uint8_t user_app_id;
-  uint8_t gn_app_id;
   uint8_t nap_app_id;
 } tBTA_PAN_API_SET_ROLE;
 
index 9284c79..55895a4 100644 (file)
@@ -246,7 +246,6 @@ extern void PAN_Deregister(void);
  *                                      GN and NAP in order
  *
  *                  p_user_name - Service name for PANU role
- *                  p_gn_name   - Service name for GN role
  *                  p_nap_name  - Service name for NAP role
  *                                  Can be NULL if user wants it to be default
  *
@@ -255,7 +254,7 @@ extern void PAN_Deregister(void);
  *
  ******************************************************************************/
 extern tPAN_RESULT PAN_SetRole(uint8_t role, const char* p_user_name,
-                               const char* p_gn_name, const char* p_nap_name);
+                               const char* p_nap_name);
 
 /*******************************************************************************
  *
index 3097c8c..9021380 100644 (file)
@@ -93,7 +93,7 @@ void PAN_Deregister(void) {
   pan_cb.pan_pfilt_ind_cb = NULL;
   pan_cb.pan_mfilt_ind_cb = NULL;
 
-  PAN_SetRole(PAN_ROLE_INACTIVE, NULL, NULL, NULL);
+  PAN_SetRole(PAN_ROLE_INACTIVE, NULL, NULL);
   BNEP_Deregister();
 
   return;
@@ -111,7 +111,6 @@ void PAN_Deregister(void) {
  *                                      PAN_ROLE_CLIENT is for PANU role
  *                                      PAN_ROLE_NAP_SERVER is for NAP role
  *                  p_user_name - Service name for PANU role
- *                  p_gn_name   - Service name for GN role
  *                  p_nap_name  - Service name for NAP role
  *                                      Can be NULL if user wants the default
  *
@@ -120,7 +119,7 @@ void PAN_Deregister(void) {
  *
  ******************************************************************************/
 tPAN_RESULT PAN_SetRole(uint8_t role, const char* p_user_name,
-                        const char* p_gn_name, const char* p_nap_name) {
+                        const char* p_nap_name) {
   /* Check if it is a shutdown request */
   if (role == PAN_ROLE_INACTIVE) {
     pan_close_all_connections();