summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-08-15Fix clang-tidy warnings in apmanager.HEADandroid-n-mr2-preview-2android-n-mr2-preview-1android-n-mr1-preview-2android-n-mr1-preview-1mastermainChih-Hung Hsieh
am: 2946762690 Change-Id: I4eaba8276e2f6fb0e1a0a935c869ce0de63cf304
2016-08-15Fix clang-tidy warnings in apmanager.Chih-Hung Hsieh
* Add explicit keyword to conversion constructors. Bug: 28341362 * Use const reference type for read-only parameters. Bug: 30407689 Test: build with WITH_TIDY=1 Change-Id: I601f6d5ebeada385d1a8c5c664007dae0c156c40
2016-08-02Remove Brillo-specific LOCAL_MODULE_TAGSDan Willemsen
am: b93f1b54e9 Change-Id: Ibd5ff54327296709daf8a2a895a3c6e54246d750
2016-07-31Remove Brillo-specific LOCAL_MODULE_TAGSDan Willemsen
Replaced with PRODUCT_PACKAGES_ENG in brillo_base.mk Change-Id: I3efe9526bf8e4357e0a442ada9f1d70125d12d34
2016-05-27apmanager: Update libchrome APIs to r395517 am: b83e33fb60Luis Hector Chavez
am: c754716aa5 * commit 'c754716aa50db403034f1aaea961fa1ff1e030ad': apmanager: Update libchrome APIs to r395517 Change-Id: I1bf6a9d0d435d743ca48cbfdde62b50f50761b55
2016-05-27apmanager: Update libchrome APIs to r395517Luis Hector Chavez
am: b83e33fb60 * commit 'b83e33fb609e6fd0559857620f6a7b6ff4d85979': apmanager: Update libchrome APIs to r395517 Change-Id: I07dea3838109f8257138a336db09be205c8477de
2016-05-26apmanager: Update libchrome APIs to r395517android-wear-n-preview-2android-wear-7.1.1_r1android-n-preview-5android-n-preview-4android-n-iot-preview-2nougat-mr1-wear-releasen-iot-preview-2Luis Hector Chavez
The new libchrome has been ported from Chromium and some APIs have changed. Make necessary changes at call sites. Change-Id: I3c50a00168917ec943fdfe816893b91894569888
2016-03-08Don\'t use GID-based capabilities for \'apmanager\'.Jorge Lucangeli Obes
am: 57188eeae6 * commit '57188eeae6e36334e15f2cec96f68fec330b0f34': Don't use GID-based capabilities for 'apmanager'.
2016-03-08Don't use GID-based capabilities for 'apmanager'.android-wear-n-preview-3android-wear-n-preview-1android-n-preview-3android-n-preview-2Jorge Lucangeli Obes
The two daemons launched by 'apmanager', 'hostapd' and 'dnsmasq', already use file capabilities. This means groups |net_admin| and |net_raw| are not needed. Group |inet| is needed for now because current kernels enable Android paranoid networking settings. Once that setting is removed, the group will not be needed anymore but will also be harmless. Bug: 27548062 Change-Id: Ic91cc4d989f4e6961cd54428ce004b17e291b085
2016-03-03Stop using BUILD_STATIC_TEST_LIBRARYDan Willemsen
am: 9da6074419 * commit '9da60744196c3ac74758bea36131d183294f8343': Stop using BUILD_STATIC_TEST_LIBRARY
2016-03-02Stop using BUILD_STATIC_TEST_LIBRARYandroid-n-preview-1Dan Willemsen
This isn't a library for a test, use BUILD_STATIC_LIBRARY instead. Change-Id: If3a10e6fbaae4347b25f002862240136ac937de4
2016-02-04apmanager_test: Compile only on \'eng\' builds.android-cts_7.1_r1android-cts-7.1_r9android-cts-7.1_r8android-cts-7.1_r7android-cts-7.1_r6android-cts-7.1_r5android-cts-7.1_r4android-cts-7.1_r3android-cts-7.1_r29android-cts-7.1_r28android-cts-7.1_r27android-cts-7.1_r26android-cts-7.1_r25android-cts-7.1_r24android-cts-7.1_r23android-cts-7.1_r22android-cts-7.1_r21android-cts-7.1_r20android-cts-7.1_r2android-cts-7.1_r19android-cts-7.1_r18android-cts-7.1_r17android-cts-7.1_r16android-cts-7.1_r15android-cts-7.1_r14android-cts-7.1_r13android-cts-7.1_r12android-cts-7.1_r11android-cts-7.1_r10android-cts-7.1_r1android-7.1.2_r9android-7.1.2_r8android-7.1.2_r6android-7.1.2_r5android-7.1.2_r4android-7.1.2_r39android-7.1.2_r38android-7.1.2_r37android-7.1.2_r36android-7.1.2_r33android-7.1.2_r32android-7.1.2_r30android-7.1.2_r3android-7.1.2_r29android-7.1.2_r28android-7.1.2_r27android-7.1.2_r25android-7.1.2_r24android-7.1.2_r23android-7.1.2_r2android-7.1.2_r19android-7.1.2_r18android-7.1.2_r17android-7.1.2_r16android-7.1.2_r15android-7.1.2_r14android-7.1.2_r13android-7.1.2_r12android-7.1.2_r11android-7.1.2_r10android-7.1.2_r1android-7.1.1_r9android-7.1.1_r8android-7.1.1_r7android-7.1.1_r61android-7.1.1_r60android-7.1.1_r6android-7.1.1_r59android-7.1.1_r58android-7.1.1_r57android-7.1.1_r56android-7.1.1_r55android-7.1.1_r54android-7.1.1_r53android-7.1.1_r52android-7.1.1_r51android-7.1.1_r50android-7.1.1_r49android-7.1.1_r48android-7.1.1_r47android-7.1.1_r46android-7.1.1_r45android-7.1.1_r44android-7.1.1_r43android-7.1.1_r42android-7.1.1_r41android-7.1.1_r40android-7.1.1_r4android-7.1.1_r39android-7.1.1_r38android-7.1.1_r35android-7.1.1_r33android-7.1.1_r32android-7.1.1_r31android-7.1.1_r3android-7.1.1_r28android-7.1.1_r27android-7.1.1_r26android-7.1.1_r25android-7.1.1_r24android-7.1.1_r23android-7.1.1_r22android-7.1.1_r21android-7.1.1_r20android-7.1.1_r2android-7.1.1_r17android-7.1.1_r16android-7.1.1_r15android-7.1.1_r14android-7.1.1_r13android-7.1.1_r12android-7.1.1_r11android-7.1.1_r10android-7.1.1_r1android-7.1.0_r7android-7.1.0_r6android-7.1.0_r5android-7.1.0_r4android-7.1.0_r3android-7.1.0_r2android-7.1.0_r1nougat-mr2.3-releasenougat-mr2.2-releasenougat-mr2.1-releasenougat-mr2-security-releasenougat-mr2-releasenougat-mr2-pixel-releasenougat-mr2-devnougat-mr1.8-releasenougat-mr1.7-releasenougat-mr1.6-releasenougat-mr1.5-releasenougat-mr1.4-releasenougat-mr1.3-releasenougat-mr1.2-releasenougat-mr1.1-releasenougat-mr1-volantis-releasenougat-mr1-security-releasenougat-mr1-releasenougat-mr1-flounder-releasenougat-mr1-devnougat-mr1-cts-releasenougat-dr1-releasenougat-devJorge Lucangeli Obes
am: 66cf1b18c0 * commit '66cf1b18c0a5b62a3beb5b3a165d6ff492afb1c6': apmanager_test: Compile only on 'eng' builds.
2016-02-04apmanager_test: Compile only on 'eng' builds.brillo-m10-releasebrillo-m10-devJorge Lucangeli Obes
Bug: 26967770 Change-Id: I656080fc329ca70c9239ccaf71fa6e90b665dc4f
2016-01-21apmanager: Update libchrome APIs to r369476Alex Vakulenko
am: 33a54245a6 * commit '33a54245a627a89089cd470b2564d04dbe9833ff': apmanager: Update libchrome APIs to r369476
2016-01-20apmanager: Update libchrome APIs to r369476Alex Vakulenko
The new libchrome has been ported from Chromium and some APIs have changed. Make necessary changes at call sites. (cherry picked from commit 33a54245a627a89089cd470b2564d04dbe9833ff) Change-Id: Ie449b7b706bfcef332a4306e93d7d1b1bd5ccf52
2016-01-20apmanager: Update libchrome APIs to r369476Alex Vakulenko
The new libchrome has been ported from Chromium and some APIs have changed. Make necessary changes at call sites. Change-Id: Iff1bdd4bdbded1a4f5f81fdb3a0b5b43a8c43020
2015-12-21apmanager: Disable RTTIbrillo-m9-releasebrillo-m9-devAlex Vakulenko
There is no longer a reliance on RTTI in libbrillo, so disable RTTI in the rest of Brillo codebase. BUG: 26292405 Change-Id: I97dc70bb7cfb17ace734c06025393ced34f7bbd3
2015-11-23Remove D-Bus dependency from Managerbrillo-m8-releasebrillo-m8-devPeter Qiu
Here are the main changes: 1. Cleanup Manager::CreateService and Manager::RemoveService API to remove D-Bus dependency. 1. Use refptr for Service since it will be maintained by both Manager and its adaptor. 2. Move the monitoring of the service creator/owner to the adaptor, since the DBusServiceWatcher is D-Bus specific. Bug: 24194427 TEST=Start AP service on Brillo board, stop weaved, verify service is destroyed and removed from apmanager. TEST=Verify device setup works on Brillo board. TEST=Verify apmanager does not crash on restart. TEST=Run unittests on both Brillo and Chrome OS. Change-Id: I33fd4eec2c1adf12830484ca087bd9dd56767288
2015-11-21Provide abstraction for ManagerAdaptorInterfacePeter Qiu
D-Bus implementation of the interface is also included. Bug: 24194427 TEST=Build apmanager for both Brillo and Chrome OS Change-Id: Id2478673cbca36279fb9e5e87a203a4eb021d1db
2015-11-21Remove D-Bus dependency from ServicePeter Qiu
Here are the main changes: 1. Update service to use ServiceAdaptorInterface instead of using D-Bus adaptor directly. 2. Update D-Bus object registration for Service and Config to be synchronous, to remove unnecessary complexity. This also eliminates the need for Manager::CreateService handler to be asynchronous. 3. Update Service APIs to use the internal Error instead of brillo::Error. 4. Use MockServiceAdaptor for testing, fake version is not needed since the adaptor properties for Service are not being used in test. Bug: 24194427 TEST=Start AP service on both Brillo and Chrome OS devices TEST=Run unittests on both Brillo and Chrome OS Change-Id: Ib94a4b91ef402415470e0131afdeeef5105817e4
2015-11-21Define and implement an AdaptorInterface for ServicePeter Qiu
This interface will be used by Service to communicate with the adaptor that exposes its functionality over IPC. The D-Bus implementation of this interface is included, and integrated to the D-Bus control interface. Bug: 24194427 TEST=Build apmanager for both Brillo and Chrome OS Change-Id: Ib87e13247cb4fbff53081b2e5cbad61bb499ce31
2015-11-21Remove D-Bus dependency from ConfigPeter Qiu
This is achieved by using a generic ConfigAdaptorInterface to communicate with the adaptor. Use FakeConfigAdaptor for testing, which provides the storage for the property variables. While there, update the Config APIs to use the generic internal Error type instead of brillo::Error (which is tailored more towards D-Bus). The D-Bus adaptor will convert it to brillo::Error when returning from D-Bus method calls. Bug: 24194427 TEST=Setup AP on Chrome OS and Brillo device TEST=Run unittests Change-Id: I5aa8ffd0805bcbb0125224f4f430245b70f56b6a
2015-11-20Add support for generic internal error reportingPeter Qiu
Currently, we're using brillo::Error for internal error reporting. However, brillo::Error is more tailored for D-Bus. Instead, implement a new Error class (trimmed down version of shill::Error) for internal error reporting, and provide functions for converting it to RPC specific error object. Bug: None TEST=Run newly added unit tests Change-Id: I2b518fae6eccb8dc9f9f0e96b941289c3846a9af
2015-11-19Define and implement an AdaptorInterface for ConfigPeter Qiu
This interface will be used by Config to communicate with the adaptor that exposes its functionality over IPC. The D-Bus implementation of this interface is included, and integrated to the D-Bus control interface. An upcoming CL will integrate this AdaptorInterface to the Config class, to decouple Config class from the underlying RPC implementation. Bug: 24194427 TEST=Build apmanager for both Brillo and Chrome OS Change-Id: I61d46c37bac875ce4a196dcc4abb752f5880ec50
2015-11-19Refactor D-Bus adaptor for Device out of the Device classPeter Qiu
This removes the RPC specific dependencies out of the Device class. Device adaptors will now be created through the ControlInterface. While there, make the D-Bus object registration for Device object to be synchronous instead of asynchronous. Since the daemon will not be doing anything anyway besides waiting for the registration to complete. This avoids unnecessary complexity with the object registration. Currently for D-Bus, the property variables are being created/stored in the generated adaptor code. This means that the property variables will be stored in the adaptor instead of the Device class itself. Even though this is not ideal, there is no good way around it. In the ideal world, the Device would maintain its property variables, and register them with the RPC specific adaptor. So for the unittest, we will use FakeDeviceAdaptor, which provides the storage for the property variables. Also currently gmock doesn't support mocking of a function that returns a unique_ptr, since it only supports copyable return value and unique_ptr is not copyable. To work around this issue, I've created mock functions that return a raw pointer, and override the proxy/adaptor creation functions to use the mock function in MockControl. Bug: 24194427 TEST=Start AP service on both Brillo and Chrome OS TEST=Run unittests on both Brillo and Chrome OS Change-Id: I8e9f736bb27fe6736f616dd752a37b9cc1be8dfe
2015-11-16dbus: perform D-Bus initialization in DBusControlPeter Qiu
This moves the RPC specific initialization out of the Daemon class, which makes it agnostic of the underlying RPC implementation. Also move the ownership of Manager from Daemon to the ControlInterface implementation. So the ControlInterface is now responsible for creating Manager and exposing it through the underlying RPC interface. This makes it easier to maintain the relevant objects (e.g. Manager, ObjectManager), and avoids possible confusion during cleanup. Bug: 25654681 TEST=Verify device setup works on Brillo device Change-Id: Id2eb8d08346841e294f8286fe191708caa2cbc24
2015-11-16Release interface after station mode interface setup is completedPeter Qiu
This avoids a possible race condition where the interface gets enumerated by shill before it is setup as station mode, resulting in the interface being ignored by shill. Bug: 25704767 TEST=Verify device setup on Edison board Change-Id: If1ef2840273d84ba39d2796ac9b09a5707b319e7
2015-11-06Update file path for D-Bus filesPeter Qiu
Bug: 24194427 TEST=Build for both Brillo and Chrome OS Change-Id: Ic2b87900b1fd8f71a0f2c0ee5d642f14cd40a7ca
2015-11-06dbus: move D-Bus specific files to dbus directoryPeter Qiu
Bug: 24194427 Change-Id: I0317e5c376a1feeaacfe4352491ccf7406e11d84
2015-10-29Fix /data dir creation, 'apmanager' service class.brillo-m7-releasebrillo-m7-mr-devbrillo-m7-devJorge Lucangeli Obes
/data is not guaranteed to be mounted when 'boot' triggers. 'post-fs-data' guarantees that. Also, move the daemon to class 'late_start', since post-fs-data will not happen in time for class 'main'. Bug: 25373880 Change-Id: I524f0a3e20696f502e534669aebb4d388c6822ea
2015-10-28brillo: start AP service after AP interface is enumeratedPeter Qiu
For Brillo devices, it is required to use the AP mode interface that's setup using the HAL API. So explicitly setup an AP mode interface using the HAL API, and wait for the interface to enumerated before starting the AP service. This is achieved by handling the Start request asynchronously. Also explicitly update the AP Config to use the newly created AP interface, to avoid the Config from auto selecting a wrong interface in the case when multiple AP-capable interfaces are presented. Bug: 25113165 TEST=Device setup works on both Brillo boards Change-Id: Icdee32e8bab9cf41a467058aef5ea081562a3442
2015-10-28Use asynchronous handler for org.chromium.Service.Start D-Bus callPeter Qiu
This allows us to handle this D-Bus call asynchronously for Brillo devices. Since we want to wait for the newly created AP interface to be enumerated before starting the service. For now, this handler will return synchronously on both Chrome OS and Brillo. A separate CL (CL:178864) will update this handler to return asynchronously on Brillo. While there, remove the unnecessary mock function for Service.Start and Service.Stop, since these are D-Bus method handlers. Even though the MockService class is now empty, we might still need it when we remove the D-Bus dependency from the Service class (b/24194427), so keep it for now. Bug: 25113165 TEST=Unittest on both Chrome OS and Brillo TEST=Manual test on both Chrome OS and Brillo Change-Id: If0ba13ae89a25bdf9207803d7d6b008e9ad6165e
2015-10-28Start apmanager after WiFi setup is completedPeter Qiu
This avoids a race condition where weaved tries to start an AP service before WiFi driver is initialized. Bug: 25341872 TEST=Device setup on both Brillo boards Change-Id: Iadaa7a6b18dab5adb21ba02d12d7704dabb40332
2015-10-27Merge "apmanager: Rename libchromeos to libbrillo"Alex Vakulenko
2015-10-27apmanager: Rename libchromeos to libbrilloAlex Vakulenko
BUG: 24872993 Change-Id: I750c137a9dab339a9ec9629fb906eddd1109e4b7
2015-10-26Do not use singleton for mock objectsPeter Qiu
Android complains about memory leakage when using singleton for mock objects, and it is not really necessary to use singleton for mock objects either. So remove the singleton from those objects. While there, update the binary path for "sleep" on Android, which is used for starting a dummy process in the test. Bug: 25186794 TEST=Run apmanager_test on Brillo board TEST=Run unittests for Chrome OS Change-Id: Ifb5a5c6876aa67a94411d823109c14a209a46d86
2015-10-22shill_manager: add APIs for setting interface modesPeter Qiu
This is needed to allow apmanager to setup an AP/station mode interface when starting/stopping an AP service. Bug: 25113165 TEST=Device setup on Brillo boards Change-Id: I2b5b708409fe1c59e0333b1e4347d46ba0162847
2015-10-13Use ControlInterface for creating proxiesPeter Qiu
This removes the IPC specific (D-Bus) dependencies from FirewallManager and ShillManager. Bug: 24194427 TEST=Verify wifi bootstrapping on both dragonboard (Android) and wolf TEST=(Chrome OS) Change-Id: Iac3b91300f938e8080d6ab4513fe84dea2880693
2015-10-13Provide an abstraction for control interfacePeter Qiu
Only define/implement APIs for creating proxies for now. Bug: 24194427 TEST=Compile for both Android and Chrome OS Change-Id: I55d387abd0104ab808343f244be5acaa8a4c8549
2015-10-13apmanager: Rename "chromeos" -> "brillo" in include paths and namespacesAlex Vakulenko
libchromeos is transitioning to libbrillo and chromeos namespaces and include directory is changing to brillo. Bug: 24872993 TEST=built for aosp and brillo, all unit tests pass on dragonboard Change-Id: I4c6efbc5bbf80d251e5d91bc3db49f02bc0e4732
2015-10-06Update unittest expectations for AndroidPeter Qiu
We're using different user/group and file path on Android, so update these expectations in unittest for Android. While there, rename apmanager_unittest to apmanager_test, which seems to be the convention for unittest target name on Android. Bug: 24707201 TEST=Run unittest on dragonboard TEST=Run unittest for Chrome OS Change-Id: Ibd6880a713117578b68c814edc7e1cefe9170c75
2015-10-02apmanger: build on non-Linux hostsPeter Qiu
Bug: None Change-Id: I28500105c27014c7bfd490bfa84faf83bc5580d1
2015-10-02Start apmanager during startup on AndroidPeter Qiu
Bug:24575517 TEST=Verify apmanager is running after dragonboard started Change-Id: I43070b3dcb5e03dfc54bc54c05859f0af25b71ad
2015-10-01shill_manager: use ShillDBusProxy for AndroidPeter Qiu
Switch to use ShillDBusProxy now that libshill-client is ready. Bug: None TEST=Start AP service with shill running Change-Id: I53eb12c80badb8855684caa25cdd1a3bd9f2f493
2015-09-29Overwrite dnsmasq pid file path for AndroidPeter Qiu
dnsmasq normally creates a pid file in /var/run/dnsmasq.pid, which doesn't exist on Android. So specify the pid file to a valid file path on Android. Bug: 22828115 TEST=Manual test on dragonboard Change-Id: Ibd1db2d4df71d2693204307ad6886132da4187b7
2015-09-29Use "system" user/group for AndroidPeter Qiu
We currently do not have a dedicated user/group for apmanager on Android. So update the code to use "system" user/group for now. Bug: 22828115 TEST=Manual test on dragonboard Change-Id: I5d327f3d42ff9fe8895e4e9f4fb8477c904d43df
2015-09-29Rename apmanager's Android init filePeter Qiu
Android is using <service>.rc instead of init.<service>.rc. While there, include the init file in the build target and remove the seclabel from the init file. Bug: 22828115 TEST=Manual test on dragonboard Change-Id: Ia29cb197ec1ebca5d3003d62e9f24060bffd073a
2015-09-29Do not run apmanager in minijail for nowPeter Qiu
When starting apmanager through Android's init system, the daemon will be started under "system" user, and that's currently targeted user for running apmanager. So there is no need to use minijail to drop the user privileges to "system" user" again. So skip this for now until we create a new user/group to run apmanager under. Bug: 22828115 TEST=Manual test on dragonboard Change-Id: Ib37553126f9a9a4024a16f68d91d240ca855f55c
2015-09-28Do not run logger on AndroidPeter Qiu
Logger utility doesn't exist on Android, so do not run it on Android. Bug: 24451556 TEST=Manual test on dragonboard TEST=Test AP setup on Chrome OS device Change-Id: I4014f5ca3ab91b348a98169cb355c6841d6530fd
2015-09-27Do not daemonize (fork) the daemon processPeter Qiu
When starting the daemon using an init system, the environment setup is already being handled by the init system, so there is no need to daemonize the daemon process create such setup. By daemonizing the daemon process, it spawns off a new process to run the daemon and terminates the current process. This causes a problem with the init system, where it thinks that the daemon failed to start. We were able to work around it on Chrome OS's upstart script by adding the forking expectation in the init scritp ("expect fork"), but there is not such workaround on Android's init system. Fix it by removing the daemonize call (daemon()) and remove the the forking expectation on Chrome OS's init script. Bug: 24412675 TEST=Manual test on dragonboard TEST=start/stop apmanager on Chrome OS device Change-Id: I4dff678946801310982c3af366ab6182f5864a81