wifi HAL uses "default" service name

The getService() and registerAsService() methods of interface objects
now have default parameters of "default" for the service name. HALs
will not have to use any service name unless they want to register
more than one service.

Test: builds; verify HAL still works

In support of b/33844934

Change-Id: Ia086509b3433976524bc4a0ac4b24385840ce565
This commit is contained in:
Chris Phoenix
2017-01-18 17:47:07 -08:00
parent 742c4db343
commit ab8166fa4e
2 changed files with 2 additions and 4 deletions

View File

@@ -34,7 +34,7 @@ int main(int /*argc*/, char** argv) {
// Setup hwbinder service
android::sp<android::hardware::wifi::V1_0::IWifi> service =
new android::hardware::wifi::V1_0::implementation::Wifi();
CHECK_EQ(service->registerAsService("wifi"), android::NO_ERROR)
CHECK_EQ(service->registerAsService(), android::NO_ERROR)
<< "Failed to register wifi HAL";
joinRpcThreadpool();

View File

@@ -34,8 +34,6 @@ using ::android::sp;
using ::android::hardware::hidl_string;
using ::android::hardware::hidl_vec;
const char kWifiServiceName[] = "wifi";
void stopFramework() {
ASSERT_EQ(std::system("svc wifi disable"), 0);
sleep(5);
@@ -44,7 +42,7 @@ void stopFramework() {
void startFramework() { ASSERT_EQ(std::system("svc wifi enable"), 0); }
sp<IWifi> getWifi() {
sp<IWifi> wifi = IWifi::getService(kWifiServiceName);
sp<IWifi> wifi = IWifi::getService();
return wifi;
}