OSDN Git Service

service: Rename variable holding advertisement settings
authorJakub Pawlowski <jpawlowski@google.com>
Tue, 12 Jan 2016 21:43:33 +0000 (13:43 -0800)
committerJakub Pawlowski <jpawlowski@google.com>
Tue, 12 Jan 2016 21:59:43 +0000 (13:59 -0800)
There will be more variables with settings. Make sure they
all have unique meaningful names.

Change-Id: I4b23fd3fa5a16f9132801b9141e4f8ed0be33be7

service/ipc/binder/bluetooth_low_energy_binder_server.cpp
service/low_energy_client.cpp
service/low_energy_client.h

index 9dca2de..5322109 100644 (file)
@@ -112,7 +112,7 @@ bool BluetoothLowEnergyBinderServer::StopMultiAdvertising(int client_id) {
   // Create a weak pointer and pass that to the callback to prevent a potential
   // use after free.
   android::wp<BluetoothLowEnergyBinderServer> weak_ptr_to_this(this);
-  auto settings_copy = client->settings();
+  auto settings_copy = client->advertise_settings();
   auto callback = [=](bluetooth::BLEStatus status) {
     auto sp_to_this = weak_ptr_to_this.promote();
     if (!sp_to_this.get()) {
index ec9181f..e8bb16d 100644 (file)
@@ -327,7 +327,7 @@ bool LowEnergyClient::StartAdvertising(const AdvertiseSettings& settings,
 
   adv_data_ = advertise_data;
   scan_response_ = scan_response;
-  settings_ = settings;
+  advertise_settings_ = settings;
 
   AdvertiseParams params;
   GetAdvertiseParams(settings, !scan_response_.data().empty(), &params);
index fd14e64..d75392f 100644 (file)
@@ -65,7 +65,9 @@ class LowEnergyClient : private hal::BluetoothGattInterface::ClientObserver,
   bool IsStoppingAdvertising() const;
 
   // Returns the current advertising settings.
-  const AdvertiseSettings& settings() const { return settings_; }
+  const AdvertiseSettings& advertise_settings() const {
+   return advertise_settings_;
+  }
 
   // BluetoothClientInstace overrides:
   const UUID& GetAppIdentifier() const override;
@@ -119,7 +121,7 @@ class LowEnergyClient : private hal::BluetoothGattInterface::ClientObserver,
   std::atomic_bool scan_rsp_needs_update_;
 
   // Latest advertising settings.
-  AdvertiseSettings settings_;
+  AdvertiseSettings advertise_settings_;
 
   // Whether or not there is a pending call to update advertising or scan
   // response data.