94 Commits

Author SHA1 Message Date
Eric Rowe
485ceb8506 Fix wifi association tests
Before fix, test assumed that it was already connected to wifi so remove
these assertions.  Also, since association test may be used against
access points with no outside connectivity, remove the ping test to
8.8.8.8 at the end.

Change-Id: I3d4f3d752b72028f642da9f8e9adda4ad18a6a56
2014-09-11 14:14:25 -07:00
Eric Rowe
86e15557c5 Allow protected wifi in connectivity tests
Change-Id: I31285572f90bfb46cc28fb04e79cb9b407477a7d
2014-09-09 19:25:55 -07:00
Eric Rowe
f5031e5494 Increase long timeout to 2 minutes
Change-Id: I2f9e15c6e551536d61ec52fbaf7f54405fa05bcd
2014-09-05 16:59:51 -07:00
Eric Rowe
2591e00b57 Clean up connectivity tests.
Change-Id: I407cb78aecb43aa8413835a25b4558241d69fd2e
2014-09-03 15:49:16 -07:00
Guang Zhu
12747ab3aa add some missing assert messages for wifi test
Change-Id: I04f4cbbca1a181ab1404fa3abba874e1f78fed3c
2014-08-22 15:08:36 -07:00
Guang Zhu
4afd179a9a follow up minor fixes for connectivity manager test
Change-Id: I8f0606890b21d67130efb3bc02c6825823060139
2014-08-20 17:40:18 -07:00
Guang Zhu
d21f1c1e4d fixes for connectivity manager test suite
* reduced visibility of most util functions in
  ConnectivityManagerTestBase
* reimplemented various waitFor... util function in base class:
  instead of relying on received broadcast and synchronization
  mechanism, we just poll for what we want with a fixed interval
  and a max timeout
* minor style fixes
* removed state transition checks in all test cases of
  ConnectivityManagerMobileTest: since exact state transitions
  are not that interesting, we just care about if we reach a
  particular state and if all network interfaces are in their
  corresponding states
* clarified in comment what each test cases are testing, since
  some of the test case names are not very straightforward
* any wait for DISCONNECTED checkes with ConnectivityManager are
  temporarily commented out

Change-Id: I99cca95c33c6060909e0df684969b75c2dca23a9
2014-08-20 17:15:35 -07:00
Lorenzo Colitti
0a82e80073 Stop using LinkProperties for static configuration.
LinkProperties can represent way more complicated configurations
than what we can actually apply to interfaces. This makes it
error-prone to use it to represent static configuration, both
when trying to apply configuration coming from LinkProperties
and when trying to save configuration from current
LinkProperties.

Instead, move static configuration (IPv4 only, since we don't
support static IPv6 configuration) into a separate
StaticIpConfiguration class.

Bug: 16114392
Bug: 16893413
Change-Id: Ib33f35c004e30b6067bb20235ffa43c247d174df
2014-08-19 11:59:43 -07:00
Robert Greenwalt
df2b878ff4 Fix public API of LinkProperties.
bug:15142362
Change-Id: I1457111da7d3bd09998f7e010febb8bb4c45c8bc
2014-06-08 12:54:23 -07:00
Lorenzo Colitti
247675e5d9 Fix build.
Change-Id: I5c09a406b6c43318cea600171b8dd25eeeffa673
2014-05-20 17:17:21 -07:00
Jaewan Kim
6346155c5a Move IP config from WifiConfiguration to IpConfiguration.
This is so that Ethernet can use it in the future.

Bug: 7606609
Bug: 8687763

Change-Id: I5d1189682b13f1088848809604690648d8d9ecca
2014-05-20 15:24:10 -07:00
Jaewan Kim
6789797485 Revert "Refactor IpConfiguration from WifiConfiguration"
This reverts commit 1284767ceb1affa6d5af77fd26ccf7322df48a6d.

Change-Id: Ibccea84e5dc44c1b8954779660e0721b27f762d4
2014-04-07 09:01:24 +00:00
Jaewan Kim
1284767ceb Refactor IpConfiguration from WifiConfiguration
Bug: 7606609, Bug: 8687763
Change-Id: I736eb3c73a8ffc8f137a04a5ea66ee564dc2b530
2014-04-07 11:35:35 +09:00
Xia Wang
71aae0b6fd Fix state transition verification.
When there is connectivity state change, the network states could be broadcasted multiple times.
The state transition should consider that.

Bug: 13277256
Change-Id: I3d400900a0e2454f9d198629f1c062cbb15bdcd8
2014-03-06 16:09:05 -08:00
Xia Wang
df362d264c Add timer to wait for screen off
bug#: 13278052

Change-Id: Ic4dc847f3f3fe86750343ffabedb13dbeb4f61a7
2014-03-03 15:39:46 -08:00
John Spurlock
8a985d24ce Tabs -> spaces in frameworks/base.
Change-Id: I5a84e8e93ac99b5ed0212b37bf66efa5e53864be
2014-02-25 09:49:29 -05:00
Xia Wang
19306af73a Update the Connectivity Manager test suit to use InstrumentationTestCase.
- Remove ConnectivityManagerTestActivity as the test activity could be destroyed
  after a system config change, which cause test failure in the wifi stress test.
- Update all tests to use InstrumentationTestCase, which instruments the test package.

Bug : 10426067

Change-Id: Ibf6f1f7cffd7a7eabc4cc63c7e033b59274b724e
2013-09-16 14:07:25 -07:00
Xia Wang
0076729d38 Use setAirplaneMode() API for Connectivity Manager tests
Change-Id: I2e35c58e4101b6b5fe9efdb5adad922402d38b6f
2013-09-11 14:44:30 -07:00
Xia Wang
11f2b42d8c Remove system user id for cm tests
Change-Id: I51f500c8e7b4e2963093e20c6f20bcfe020995c9
(cherry picked from commit 575495c29007503566e28004bf60018a824b1f1b)
2013-09-10 01:07:33 +00:00
Xia Wang
edc3bb661e Disable a flaky test case
Change-Id: I4ef780ed0c5394b67aa002baefc00e835018c4a0
2013-06-17 17:14:10 -07:00
Xia Wang
1c6911ac1d Add option to set frequency band
- The reason to add the test runner is to set frequency band when the runner
  is created which happens before the test activity is actually launch.
  As the test activity will disable/enable wifi when it
  is created, this cycle will ensure the frequency is set successfully.

Change-Id: Ie9de3d8bab3dda7d4bb9ba604ddd5cb33164e397
2013-05-31 14:10:12 -07:00
Xia Wang
58a5db37b3 Add wifi association test
Change-Id: I1f3f49a1857835522c9c5e02ed4f530b83df1d02
2013-05-08 11:27:27 -07:00
Irfan Sheriff
bcc97ca43a Clean up scan handling
Remove obsolete active/passive scan handling - drivers always
do active scan.

Also, remove AP_SCAN hack for preventing connections and use
the TYPE=ONLY scan.

Bug: 8158647
Change-Id: I8f70e19219ad789b7501a40529bcd6b6524739e8
2013-02-22 09:23:55 -08:00
Wink Saville
35185a9ccf Fix broken test.
Change-Id: I8c5649c9b3d917cf13b94d49da44eaf510643df6
2013-02-12 17:07:21 -08:00
Xia Wang
eb22ed9171 Fix Connectivity Manager test:
-Due to security change, the test pid is not allowed to broadcast
ACTION_AIRPLANE_MODE_CHANGED intent, which is a pretected intent and
can only be sent by the system, change the test app to use system user id.

Change-Id: I2525e30c13a97d5fcab0fc9537e8fac18e0b5457
2013-02-01 16:44:57 -08:00
Xia Wang
c5401d4451 am 63d25816: am 599f9611: am f3ef10b1: am 2297d1e7: Merge "Fix WiFi test:" into jb-mr1.1-dev
# Via Android Git Automerger (3) and others
* commit '63d258167637309c0c85725ecc9112a88bf57824':
  Fix WiFi test:
2013-01-30 19:03:39 -08:00
Xia Wang
63d2581676 am 599f9611: am f3ef10b1: am 2297d1e7: Merge "Fix WiFi test:" into jb-mr1.1-dev
# Via Android Git Automerger (2) and others
* commit '599f9611aab587d13b4d7bac94fc628c675591a1':
  Fix WiFi test:
2013-01-30 19:01:14 -08:00
Xia Wang
f2991add02 Fix WiFi test:
-- In environment where there are too many APs, sometimes, the AP will not show in the scan list.
    Part of the reason is due to the change that the scanning on each frequency is shortened to save power.
    to avoid that, change the test to connect without scanning.

 -- Increase the timer to wait for WiFi to be connected

Change-Id: If1a72607b3c7ad13dbbf788607665986eaf5b6b3
2013-01-30 18:52:27 -08:00
Irfan Sheriff
f2488b6328 Fix connectivitymanagertest
Change-Id: If5687eacec0f502c39b102eb5cf7d9383f0ec056
2013-01-15 10:35:02 -08:00
Kenny Root
58ed5d748c am 768d9e1a: Merge "Correct executable bit for source files"
* commit '768d9e1a72ceee7d4a5f608776b87b62d6ce4a04':
  Correct executable bit for source files
2012-11-07 11:52:12 -08:00
Kenny Root
3a084af2e9 Correct executable bit for source files
Many media files and source code files were marked as executable in Git.
Remove those.

Also a shell script and python script were not marked as executable.

Change-Id: Ieb51bafb46c895a21d2e83696f5a901ba752b2c5
2012-11-07 10:27:31 -08:00
Xia Wang
b2a2096903 Fix WiFi stress test
- Disable lock screen after screen is turned on.
   Without disabling lock screen, device will screen off automatically after around 10 seconds

 - Add a longer timer for ping test when the data traffic is stalled.
   For a short ping test, it is hard to tell whether it is a transient issue or a real issue.

   bug# 7426823

Change-Id: If1a560e11dcdff519562bb2a22651d1fd523b5a2
2012-10-31 17:03:23 -07:00
Xia Wang
2ab453b52b Fix connectivity manager test for tablet with data connection, multi-user support
bug#7366674

Change-Id: Ibbb4becebfc833529e85d8a311366586c5ba54ee
2012-10-17 12:03:29 -07:00
Xia Wang
3272a38dbc Fix Wifi Stress test after wifi settings are moved to Settings.global
Change-Id: I823e99b39bc340683b686bb0dd43a473865656f0
2012-09-26 09:23:59 -07:00
Christopher Tate
c09cdce1b0 Update airplane-mode manipulation for the new Settings namespace
Quick Settings and global actions (aka longpress-Power) toggles are
included in this CL.  The Settings app manipulations are updated in
a different CL because that's a different git package.

Bug 7132230

Change-Id: I50838f5e8d7b25a750d2bcae90bf384b09816dbb
2012-09-10 16:50:57 -07:00
Jeff Brown
9630704ed3 Power manager rewrite.
The major goal of this rewrite is to make it easier to implement
power management policies correctly.  According, the new
implementation primarily uses state-based rather than event-based
triggers for applying changes to the current power state.

For example, when an application requests that the proximity
sensor be used to manage the screen state (by way of a wake lock),
the power manager makes note of the fact that the set of
wake locks changed.  Then it executes a common update function
that recalculates the entire state, first looking at wake locks,
then considering user activity, and eventually determining whether
the screen should be turned on or off.  At this point it may
make a request to a component called the DisplayPowerController
to asynchronously update the display's powe state.  Likewise,
DisplayPowerController makes note of the updated power request
and schedules its own update function to figure out what needs
to be changed.

The big benefit of this approach is that it's easy to mutate
multiple properties of the power state simultaneously then
apply their joint effects together all at once.  Transitions
between states are detected and resolved by the update in
a consistent manner.

The new power manager service has is implemented as a set of
loosely coupled components.  For the most part, information
only flows one way through these components (by issuing a
request to that component) although some components support
sending a message back to indicate when the work has been
completed.  For example, the DisplayPowerController posts
a callback runnable asynchronously to tell the PowerManagerService
when the display is ready.  An important feature of this
approach is that each component neatly encapsulates its
state and maintains its own invariants.  Moreover, we do
not need to worry about deadlocks or awkward mutual exclusion
semantics because most of the requests are asynchronous.

The benefits of this design are especially apparent in
the implementation of the screen on / off and brightness
control animations which are able to take advantage of
framework features like properties, ObjectAnimator
and Choreographer.

The screen on / off animation is now the responsibility
of the power manager (instead of surface flinger).  This change
makes it much easier to ensure that the animation is properly
coordinated with other power state changes and eliminates
the cause of race conditions in the older implementation.

The because of the userActivity() function has been changed
so that it never wakes the device from sleep.  This change
removes ambiguity around forcing or disabling user activity
for various purposes.  To wake the device, use wakeUp().
To put it to sleep, use goToSleep().  Simple.

The power manager service interface and API has been significantly
simplified and consolidated.  Also fixed some inconsistencies
related to how the minimum and maximum screen brightness setting
was presented in brightness control widgets and enforced behind
the scenes.

At present the following features are implemented:

- Wake locks.
- User activity.
- Wake up / go to sleep.
- Power state broadcasts.
- Battery stats and event log notifications.
- Dreams.
- Proximity screen off.
- Animated screen on / off transitions.
- Auto-dimming.
- Auto-brightness control for the screen backlight with
  different timeouts for ramping up versus ramping down.
- Auto-on when plugged or unplugged.
- Stay on when plugged.
- Device administration maximum user activity timeout.
- Application controlled brightness via window manager.

The following features are not yet implemented:

- Reduced user activity timeout for the key guard.
- Reduced user activity timeout for the phone application.
- Coordinating screen on barriers with the window manager.
- Preventing auto-rotation during power state changes.
- Auto-brightness adjustment setting (feature was disabled
  in previous version of the power manager service pending
  an improved UI design so leaving it out for now).
- Interpolated brightness control (a proposed new scheme
  for more compactly specifying auto-brightness levels
  in config.xml).
- Button / keyboard backlight control.
- Change window manager to associated WorkSource with
  KEEP_SCREEN_ON_FLAG wake lock instead of talking
  directly to the battery stats service.
- Optionally support animating screen brightness when
  turning on/off instead of playing electron beam animation
  (config_animateScreenLights).

Change-Id: I1d7a52e98f0449f76d70bf421f6a7f245957d1d7
2012-08-15 03:06:24 -07:00
Irfan Sheriff
88759bbd31 Update WifiManager API
Use feedback based on NSD to update WifiManager API

Change-Id: I0c1dc74f7e2fa7cd697a995b7194e3e0366d7981
2012-07-24 13:34:36 -07:00
Xia Wang
2f19a3103c Fix issue: Disable soft ap when test activity is created.
Add timer for soft ap enalbing timer: 6192139

Change-Id: I9f9a6a1f0787efdfbb924af80f7d610c07cd32e5
2012-05-15 16:10:55 -07:00
Xia Wang
81341fee6d Fix Wifi test
bug: http://b/issue?id=6446248
Change-Id: I22783ed3de37bf51aed7cee9617017868f524f0d
2012-05-06 16:03:34 -07:00
Kenny Root
fb32ab903a Update Wifi tests
Wifi tests used old WifiConfiguration values. This updates it to the new
values.

Change-Id: I14498aebba50f906181fa377b84855eae3d046fc
2012-03-27 21:12:08 -07:00
Xia Wang
6d3c2f0cad Fix test flakiness
Disable soft AP before start the wifi stress test.
If soft AP test failed with AP enabled, the wifi client can not be
enabled.

Change-Id: Ie6950f6b5b662727f2e811d9b81aeb0f4f7cda91
2012-03-12 13:58:45 -07:00
Xia Wang
776cca3b3a Allow CM/WIFI tests running with wifi-only flag.
Change-Id: I12ab8f6f0335574a5af6db497ed76e6d5fec3ab7
2012-03-09 16:59:39 -08:00
Xia Wang
27284da88c Fix CM test
http://b/issue?id=6125619

Change-Id: I33306619424ab54281aaf592c78581179ebbfc6e
2012-03-08 15:57:26 -08:00
Irfan Sheriff
d3975a9177 Fix WifiManager async API
Fix the current asynchronous API to use callback like the way
was done with p2p API.

In the process, fix the use of WPS

Change-Id: Ib6f8714cf51b3525b655948268804e7eaaf17587
2012-03-01 13:57:23 -08:00
Xia Wang
16b7ddcfe6 Remove airplane mode related wifi test for Wi-Fi only devices.
Change-Id: I5b319b98ac68c0b7f053c5baf084c3138db8fe07
2012-02-16 10:00:33 -08:00
Brett Chabot
4dfa295ad8 Use PackageManager to detect wifi-only devices in ConnectivityManagerTest.
Change-Id: I9749bf9024a73af095d4a681bb902594828ad599
2012-02-01 10:32:18 -08:00
Xia Wang
4acb784630 am 87badc20: am 4ac4ab4e: Merge "Remove sleep from test acitivity to avoid ANR when key event is injected bug#: 5737922" into ics-mr1
* commit '87badc20c7d5462ee27f13adf50acaf6a3232884':
  Remove sleep from test acitivity to avoid ANR when key event is injected bug#: 5737922
2012-01-11 17:57:16 -08:00
Xia Wang
8017794091 Remove sleep from test acitivity to avoid ANR when key event is injected
bug#: 5737922

Change-Id: I7871713c5000d122e63127b30d0151b8f5a29bcf
2011-12-19 17:20:04 -08:00
Irfan Sheriff
cdc077c9dd Fix configured network status
For a connected network, keep status as CURRENT. For a network,
that is disconnected it should be ENABLED. A disabled network
will have the status as DISABLED

Also, add a unit test to ensure there is only one CURRENT network
that is connected

Change-Id: Iaa4a7124a0c372a8f6df3d846ae8c15d9b29cf13
2011-12-12 16:47:02 -08:00
Xia Wang
10a3e8fae8 Add extra 2 minute for wifi to shutdown
Change-Id: I3cf2fbf5de8b96b75d5e460e4ad822a1947ff6e7
2011-12-05 12:22:47 -08:00