OSDN Git Service

android-x86/system-connectivity-wificond.git
8 years agoChange include directory
Ningyuan Wang [Fri, 15 Jul 2016 23:47:54 +0000 (16:47 -0700)]
Change include directory

This make our local headers clearly wificond prefixed.

TEST=compile
BUG=None

Change-Id: I68cc9efd2f73bec7a4cbec09a470af58420ac3e1

8 years agoChange AIDL style to match other AIDL style
Christopher Wiley [Tue, 12 Jul 2016 18:46:08 +0000 (11:46 -0700)]
Change AIDL style to match other AIDL style

Bug: 30090557
Change-Id: Ic0ecca115bb94c04446edfe5c7299a70bc10e4b2
Test: Compiles

8 years agoMerge "Initial commit for NL80211Packet"
Ningyuan Wang [Wed, 13 Jul 2016 21:19:33 +0000 (21:19 +0000)]
Merge "Initial commit for NL80211Packet"

8 years agoInitial commit for NL80211Packet
Ningyuan Wang [Thu, 7 Jul 2016 21:25:14 +0000 (14:25 -0700)]
Initial commit for NL80211Packet

This CL adds the initial implementation of class NL80211Packet
as well as the corresponding unit tests.

BUG=29454786
TEST=compile
TEST=run unittests

Change-Id: Ide5393e77650d157cc3045ffdaaf5b62615a5346

8 years agowificond: Fix ServerTest
Ningyuan Wang [Wed, 13 Jul 2016 18:22:31 +0000 (11:22 -0700)]
wificond: Fix ServerTest

ServerTest failed because we no longer turn down interface
explicitly in wificond when setting up interface mode.

TEST=compile
TEST=unit tests

Change-Id: I05448944a063bdb95885ad20aa8228fbea08288a

8 years agoRemove extra interface down
Christopher Wiley [Fri, 8 Jul 2016 22:15:02 +0000 (15:15 -0700)]
Remove extra interface down

This code was put here because WifiStateMachine#setupDriverForSoftAp()
had a similar clause.  However that code was a no-op, because the HAL
was stopped at the point that it was called, preventing WSM from getting
the interface index to turn down.

The very next thing that WSM did after setting the interface status to
down was to start the HAL, which sets the interface state to up anyway.

Change-Id: I184166bfd45b33171c3b2603a4ac3423e1674132

8 years agoMerge "Support more types of nl80211 attributes"
Ningyuan Wang [Thu, 7 Jul 2016 21:14:18 +0000 (21:14 +0000)]
Merge "Support more types of nl80211 attributes"

8 years agoSupport more types of nl80211 attributes
Ningyuan Wang [Thu, 30 Jun 2016 17:36:47 +0000 (10:36 -0700)]
Support more types of nl80211 attributes

This CL includes the following changes:
1.
  Improve the interface design of NL80211Attribute classes.
  Add a function GetAttributeValue() to NL80211NestedAttr class.
2.
  Support more types of nl80211 attributes. This includes all
  size of interger types, string, flag, and raw buffer.
3.
  Guarantee payload size alignment by padding 0s.
4.
  Support FLAG attribute by adding a function AddAttribute(int id).
  We don't instanciate any flag attribute because it has no payload.
5.
  Add corresponding unit tests.

BUG=29454786
TEST=compile
TEST=run unittests

Change-Id: I3653a3babfc1df5dde42eecf4410fd636d26b956

8 years agoSetup wlan0 in AP mode on request
Christopher Wiley [Fri, 24 Jun 2016 20:40:25 +0000 (13:40 -0700)]
Setup wlan0 in AP mode on request

Test: Added unittests that we call appropriate functionality from
      libwifi-system, integration tests continue to pass
Bug: 29579539

Change-Id: I7f3c565765d88f9bb522fd31d2e8e5be6e289e5c

8 years agoMove nl80211 code to its own library
Ningyuan Wang [Thu, 30 Jun 2016 21:29:11 +0000 (14:29 -0700)]
Move nl80211 code to its own library

BUG=29454786
TEST=compile
TEST=unit tests passed

Change-Id: I30db0ec98876967221c15c1519cd5c98211ca379

8 years agoMerge "Initial commit for nl80211 attribute"
TreeHugger Robot [Thu, 30 Jun 2016 18:08:58 +0000 (18:08 +0000)]
Merge "Initial commit for nl80211 attribute"

8 years agoInitial commit for nl80211 attribute
Ningyuan Wang [Fri, 24 Jun 2016 22:31:13 +0000 (15:31 -0700)]
Initial commit for nl80211 attribute

This CL includes the following changes:
1. Initial design for NL80211Attribute classes.
2. Unittests verifying the functions of NL80211Attribute
   classes. This also shows how these internal interfaces
   are going to be used.

BUG=29454786
TEST=compile
TEST=run unittests

Change-Id: I52f07f9a45d5966a7787c591c5f90dc1bf55ecf8

8 years agoAdd a developer mode to wificond
Christopher Wiley [Mon, 27 Jun 2016 20:43:03 +0000 (13:43 -0700)]
Add a developer mode to wificond

When wificond starts up it will now check a system property
and claim a slightly different service name if the property
is set to true.

This allows us to restart wificond in a way which prevents the framework
from talking to wificond.

Bug: 29584274
Test: Modified integration tests confirm this is working.

Change-Id: I1aed389fbcb047f466f94ca568b66df4b7f9a419

8 years agoRefactor initial binder configuration
Christopher Wiley [Mon, 27 Jun 2016 18:38:27 +0000 (11:38 -0700)]
Refactor initial binder configuration

Separate blocks of functionality into functions for readability.
Rename event_dispatcher_ to event_dispatcher, since it isn't a class
    member.
Check that service registration was successful.

Bug: 29584274
Change-Id: Iec7c01e8974062403c1a207a80f028b70d9d11c1
Test: unit, integration tests pass

8 years agoExpose IPC interfaces to create/destroy AP interfaces
Christopher Wiley [Thu, 23 Jun 2016 00:20:04 +0000 (17:20 -0700)]
Expose IPC interfaces to create/destroy AP interfaces

Bug: 29579539
Change-Id: I49e050a6c806a5841931b1c2cddfbba7925f744a
Test: Unit, integration tests pass

8 years agoSpeed up LifeCycleTest
Christopher Wiley [Thu, 23 Jun 2016 00:23:46 +0000 (17:23 -0700)]
Speed up LifeCycleTest

IServiceManager::checkService() returns immediately, while
getService() will block for 5 seconds.

Change-Id: Ic64add5b60bff0f509ff879fc75a0194ec883e8f

8 years agoRemove the concept of a chip from wificond
Christopher Wiley [Wed, 22 Jun 2016 21:46:18 +0000 (14:46 -0700)]
Remove the concept of a chip from wificond

Today, there is little point in obsessing about chips, since we have
exactly one chip per device.  At some point, wificond will need to
become aware of chips, but we can make more progress by delaying
speculation until the HAL is ready.

Bug: 29578895
Change-Id: I68b2d069118538555b7a9fb315e62f294f13bbeb
Test: Compiles, unit, integration tests pass

8 years agoWificond: support multiple callbacks registration
Ningyuan Wang [Thu, 16 Jun 2016 21:39:44 +0000 (14:39 -0700)]
Wificond: support multiple callbacks registration

This allows multiple callbacks to be registered
simultaneously with wificond chip object.

Duplicate registrations of the same callback will be ignored.

BUG=29222398
TEST=compile
TEST=A local integration test registering same objects.
    Then check log to ensure it is handled correctly.

Change-Id: I946a9935f6c839ef2f97ed345c20fc2932853b33

8 years agoUse SYSTEM instead of MAIN for wificond logging
Ningyuan Wang [Thu, 16 Jun 2016 20:08:31 +0000 (13:08 -0700)]
Use SYSTEM instead of MAIN for wificond logging

BUG=29418605
TEST=compile
TEST=adb logcat -b system | grep wificond

Change-Id: I1ea949cb5c9cec9884d9cf25be372a8bfd86e1cb

8 years agoWificond: Expose IChip and IClientInterface object
Ningyuan Wang [Tue, 14 Jun 2016 18:35:58 +0000 (11:35 -0700)]
Wificond: Expose IChip and IClientInterface object

This CL enabls wificond to expose chips and client
interfaces through binder.

This also adds an intergration test to verify we can
access these objects through binder.

BUG=29222398
TEST=compile
TEST=unit tests passed
TEST=new intergration tests passed

Change-Id: I352928de382aa22e9bdb27e9dfb49fdc8ce36994

8 years agoMerge "Keep watching file descriptor after callback is called."
TreeHugger Robot [Tue, 14 Jun 2016 18:00:29 +0000 (18:00 +0000)]
Merge "Keep watching file descriptor after callback is called."

8 years agoKeep watching file descriptor after callback is called.
Ningyuan Wang [Tue, 14 Jun 2016 00:00:31 +0000 (17:00 -0700)]
Keep watching file descriptor after callback is called.

BUG=NONE
TEST=compile and run unittests

Change-Id: I6c8039661071d594f7405288e41622560ca1dc5f

8 years agoAdd missing header guards to server.h
Christopher Wiley [Mon, 13 Jun 2016 23:53:29 +0000 (16:53 -0700)]
Add missing header guards to server.h

Bug: None
Change-Id: I143d6556c85670e75c52c36bcf2726333ca08984
Test: Compiles

8 years agoTest that wificond claims its binder service
Christopher Wiley [Thu, 9 Jun 2016 23:42:49 +0000 (16:42 -0700)]
Test that wificond claims its binder service

Bug: 28867751
Test: Integration, unit tests continue to pass

Change-Id: I6eb42fa25d46154d6c60dc25caa9e606806705f9

8 years agoRe-organize wificond makefile
Christopher Wiley [Fri, 10 Jun 2016 16:25:49 +0000 (09:25 -0700)]
Re-organize wificond makefile

All tests are now run on the device (unittest and integration).
Stop compiling host side versions of our static libraries.
Move IPC related source into a dedicated static library.
  - integration tests need to be able to speak to wificond
  - integration tests should not be linked against wificond internal
    logic
Move server.cpp into the static library implementing wificond.

Bug: 28867751
Test: Compiles, unittests still pass

Change-Id: Ibe118576dbc09b309d589e5a015941428e3096b7

8 years agoFix shell path on linux host
Christopher Wiley [Thu, 9 Jun 2016 21:13:17 +0000 (14:13 -0700)]
Fix shell path on linux host

__ANDROID__ defines our building for a device target vs host target,
not ANDROID.

Bug: 28867215
Change-Id: I52aab82cbd0ed3902105c97fcd8d111440ae893b
Test: ./out/host/linux-x86/nativetest/wificond_unit_test/wificond_unit_test

8 years agoMerge "Add integration test for wificond lifetime"
TreeHugger Robot [Thu, 9 Jun 2016 19:47:48 +0000 (19:47 +0000)]
Merge "Add integration test for wificond lifetime"

8 years agoMerge "Add AIDL defining AP and client interfaces"
TreeHugger Robot [Thu, 9 Jun 2016 18:27:25 +0000 (18:27 +0000)]
Merge "Add AIDL defining AP and client interfaces"

8 years agoMerge "Add android.net.wifi.IWificond AIDL"
Christopher Wiley [Thu, 9 Jun 2016 18:27:13 +0000 (18:27 +0000)]
Merge "Add android.net.wifi.IWificond AIDL"

8 years agoAdd integration test for wificond lifetime
Christopher Wiley [Tue, 7 Jun 2016 15:53:15 +0000 (08:53 -0700)]
Add integration test for wificond lifetime

This test merely confirms that we can stop wificond, then restart it.

Bug: 28867215
Test: This test pases when wificond is added into PRODUCT_PACKAGES for
      a device.

Change-Id: I5e8cc450f9bc299ce67ae97ecee01c665746c501

8 years agoAdd a utility for executing shell commands
Christopher Wiley [Mon, 6 Jun 2016 22:50:59 +0000 (15:50 -0700)]
Add a utility for executing shell commands

This comes in handy for writing integration tests that exercise system
services.

Bug: 28867215
Test: Unitttests pass, added another

Change-Id: Ief84c9170e1d07b3064d7e4016f74175e12ccded

8 years agoAdd AIDL defining AP and client interfaces
Christopher Wiley [Wed, 8 Jun 2016 22:44:55 +0000 (15:44 -0700)]
Add AIDL defining AP and client interfaces

Right now, we don't actually implement any of these classes.

Bug: 29218284
Test: Compiles, integration, unittests complete

Change-Id: Ib2a507a21f1c7366e7eec0c02494b7edd3bbf3fa

8 years agoAdd android.net.wifi.IWificond AIDL
Christopher Wiley [Wed, 8 Jun 2016 21:55:36 +0000 (14:55 -0700)]
Add android.net.wifi.IWificond AIDL

This is the root object exposed by wificond via Binder as described in
the design document.

Bug: 29218284
Change-Id: Ia6a21285f974d322f3ed9dd20e865fac4c4b31ac
Test: Compiles, unit, integration tests pass.

8 years agoBinder interface skeleten of wificond
Ningyuan Wang [Thu, 2 Jun 2016 22:33:10 +0000 (15:33 -0700)]
Binder interface skeleten of wificond

This CL adds a dummy binder interface of wificond.
There is only one function called Ping() which is
supposed to return a std string "Pong".

BUG=28867093
TEST=compile
TEST=Mannually modify wificond sepolicy file to allow
  binder operations.
     Use an executable to test this interface by calling
  Ping() through binder and verifying the response is
  "Pong".

Change-Id: I8b5b1b65811f018612ad095f692d8acf2289c3c9

8 years agoImplement watching file descriptor for wificond event loop
Ningyuan Wang [Fri, 27 May 2016 20:44:22 +0000 (13:44 -0700)]
Implement watching file descriptor for wificond event loop

This CL allows wificond event loop to watch a file descriptor.
Specific callback will be executed when a file descriptor is
ready for input or output.

BUG=28982981
BUG=28867514
TEST=compile
TEST=run out/host/linux-x86/bin/wificond_unit_test

Change-Id: I6417ccdf08fa175acf90824dab16804d4bc624c5

8 years agoUnit tests for wificond looper backed event loop
Ningyuan Wang [Thu, 26 May 2016 22:49:07 +0000 (15:49 -0700)]
Unit tests for wificond looper backed event loop

BUG=28982981
TEST=compile
TEST=run out/host/linux-x86/bin/wificond_unit_test

Change-Id: If54c7e02b68ca82cbb1fddfae144a71c73561b8d

8 years agoEvent loop wrapper classes for wificond
Ningyuan Wang [Tue, 24 May 2016 20:35:04 +0000 (13:35 -0700)]
Event loop wrapper classes for wificond

This CL includes the following change:
  1. An abstract class EventLoop for the event loop.
  2. An impementation LooperBackedEventLoop using
  looper in libutils.

BUG=28867514
TEST=compile
TEST=manually tested

Change-Id: Ieeded846761d627487144d122d3a733abda46d1e

8 years agoInitial signal handler implementation for wificond
Ningyuan Wang [Mon, 23 May 2016 18:45:16 +0000 (11:45 -0700)]
Initial signal handler implementation for wificond

This signal handler class allows the caller to register
a callack to a spefic POSIX signal.

BUG=28865186
TEST=compile
TEST=kill -2 pid
  Check wificond log to make sure signal is handled.
Change-Id: I1ef4191f36796744e8acf5f5c45bb900725c7d51

8 years agoDummy unittest for wificond
Ningyuan Wang [Fri, 20 May 2016 22:20:54 +0000 (15:20 -0700)]
Dummy unittest for wificond

BUG=28865186
TEST=compile
TEST=compile single package using mm
  Find wificond_unit_test in out/host/linux-x86/bin
  Run it

Change-Id: Ib2c72775940972d21730d615b084be522335823a

8 years agoAdd logging for wificond
Ningyuan Wang [Fri, 20 May 2016 17:24:56 +0000 (10:24 -0700)]
Add logging for wificond

This CL includes the following changes:
  Include loggging.h from android-base
  Print a logging message
  Use .cc suffix instead .cpp to fit Google C++ style guide

BUG=28865186
TEST=compile
TEST=check logcat
  Log will apear in logcat if logging statement is placed
  in the while loop. However it seems that early log will
  get lost. This issue will be addressed latter.

Change-Id: I0e65417feeba4d989a892f88c83437d2ce6c9b72

8 years agoSkeleton of wificond
Ningyuan Wang [Thu, 19 May 2016 22:28:38 +0000 (15:28 -0700)]
Skeleton of wificond

This CL includes the following changes:
  A dummy main.cpp file with infinite loop
  Legal files
  Makefile for wificond
  Init file that starts up the deamen

BUG=28865186
TEST=compile
TEST=
  Add wificond to '/target/product/base.mk'
  Modify sepolicy files
  Flash image to phone
  Adb shell ps -A | grep 'wificond'

Change-Id: Ibb7181e091bf30044994fb0f189d00c239e892bf

8 years agoInitial empty repository
Thomas Joseph Avila [Tue, 17 May 2016 19:33:57 +0000 (12:33 -0700)]
Initial empty repository