OSDN Git Service

Change AIDL style to match other AIDL style
authorChristopher Wiley <wiley@google.com>
Tue, 12 Jul 2016 18:46:08 +0000 (11:46 -0700)
committerChristopher Wiley <wiley@google.com>
Wed, 13 Jul 2016 21:28:22 +0000 (14:28 -0700)
Bug: 30090557
Change-Id: Ic0ecca115bb94c04446edfe5c7299a70bc10e4b2
Test: Compiles

aidl/android/net/wifi/IWificond.aidl
server.cpp
server.h
tests/integration/life_cycle_test.cpp
tests/server_unittest.cpp

index 9b20843..4f87cc0 100644 (file)
@@ -22,11 +22,11 @@ import android.net.wifi.IApInterface;
 // subsystems of a device.
 interface IWificond {
 
-  // Create a network interface suitable for use as an AP.
-  IApInterface CreateApInterface();
+    // Create a network interface suitable for use as an AP.
+    IApInterface createApInterface();
 
-  // Tear down all existing interfaces.  This should enable clients to create
-  // future interfaces immediately after this method returns.
-  void TearDownInterfaces();
+    // Tear down all existing interfaces.  This should enable clients to create
+    // future interfaces immediately after this method returns.
+    void tearDownInterfaces();
 
 }
index aec07b7..202f012 100644 (file)
@@ -38,7 +38,7 @@ Server::Server(unique_ptr<HalTool> hal_tool,
 }
 
 
-Status Server::CreateApInterface(sp<IApInterface>* created_interface) {
+Status Server::createApInterface(sp<IApInterface>* created_interface) {
   if (!ap_interfaces_.empty()) {
     // In the future we may support multiple interfaces at once.  However,
     // today, we support just one.
@@ -55,7 +55,7 @@ Status Server::CreateApInterface(sp<IApInterface>* created_interface) {
   return Status::ok();
 }
 
-Status Server::TearDownInterfaces() {
+Status Server::tearDownInterfaces() {
   if (!ap_interfaces_.empty()) {
     ap_interfaces_.clear();
     if (!driver_tool_->UnloadDriver()) {
index f35bc53..991ecbe 100644 (file)
--- a/server.h
+++ b/server.h
@@ -39,10 +39,10 @@ class Server : public android::net::wifi::BnWificond {
          std::unique_ptr<wifi_hal::DriverTool> driver_tool);
   ~Server() override = default;
 
-  android::binder::Status CreateApInterface(
+  android::binder::Status createApInterface(
       android::sp<android::net::wifi::IApInterface>* created_interface) override;
 
-  android::binder::Status TearDownInterfaces() override;
+  android::binder::Status tearDownInterfaces() override;
 
  private:
   // Does the actual work of setting up an interface for a particular mode.
index e556cff..65da4eb 100644 (file)
@@ -125,14 +125,14 @@ TEST_F(SandboxedTest, CanCreateApInterfaces) {
 
   // We should be able to create an AP interface.
   sp<IApInterface> ap_interface;
-  ASSERT_TRUE(service->CreateApInterface(&ap_interface).isOk());
+  ASSERT_TRUE(service->createApInterface(&ap_interface).isOk());
 
   // We should not be able to create two AP interfaces.
   sp<IApInterface> ap_interface2;
-  ASSERT_FALSE(service->CreateApInterface(&ap_interface2).isOk());
+  ASSERT_FALSE(service->createApInterface(&ap_interface2).isOk());
 
   // We can tear down the created interface.
-  ASSERT_TRUE(service->TearDownInterfaces().isOk());
+  ASSERT_TRUE(service->tearDownInterfaces().isOk());
 }
 
 }  // namespace wificond
index 32e9420..932293a 100644 (file)
@@ -70,28 +70,28 @@ TEST_F(ServerTest, CanSetUpApInterface) {
   EXPECT_CALL(*driver_tool_, ChangeFirmwareMode(DriverTool::kFirmwareModeAp))
       .InSequence(sequence)
       .WillOnce(Return(true));
-  EXPECT_TRUE(server_.CreateApInterface(&ap_if).isOk());
+  EXPECT_TRUE(server_.createApInterface(&ap_if).isOk());
   EXPECT_NE(nullptr, ap_if.get());
 }
 
 TEST_F(ServerTest, DoesNotSupportMultipleInterfaces) {
   sp<IApInterface> ap_if;
-  EXPECT_TRUE(server_.CreateApInterface(&ap_if).isOk());
+  EXPECT_TRUE(server_.createApInterface(&ap_if).isOk());
   EXPECT_NE(nullptr, ap_if.get());
   ap_if = nullptr;
-  EXPECT_FALSE(server_.CreateApInterface(&ap_if).isOk());
+  EXPECT_FALSE(server_.createApInterface(&ap_if).isOk());
   EXPECT_EQ(nullptr, ap_if.get());
 }
 
 TEST_F(ServerTest, CanDestroyInterfaces) {
   EXPECT_CALL(*driver_tool_, UnloadDriver()).Times(0);
   sp<IApInterface> ap_if;
-  EXPECT_TRUE(server_.CreateApInterface(&ap_if).isOk());
+  EXPECT_TRUE(server_.createApInterface(&ap_if).isOk());
   // When we tear down the interface, we expect the driver to be unloaded.
   EXPECT_CALL(*driver_tool_, UnloadDriver()).Times(1).WillOnce(Return(true));
-  EXPECT_TRUE(server_.TearDownInterfaces().isOk());
+  EXPECT_TRUE(server_.tearDownInterfaces().isOk());
   // After a teardown, we should be able to create another interface.
-  EXPECT_TRUE(server_.CreateApInterface(&ap_if).isOk());
+  EXPECT_TRUE(server_.createApInterface(&ap_if).isOk());
 }
 
 }  // namespace wificond