History log of /frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
8ec0ba59c20b8266d735912fb71575834c991acc 09-Jun-2017 Rebecca Silberstein <silberst@google.com> Merge "WifiServiceImpl: check app status for startLOHS" into oc-dev
95bad763cff555fcf37442d5d3129f777bb0b978 08-Jun-2017 Roshan Pius <rpius@google.com> Merge "WifiBackupRestore: Change to |NETWORK_SETTINGS| permission" into oc-dev
a6e534fc17203d535ec786b25aad9ff65afdbbea 08-Jun-2017 Rebecca Silberstein <silberst@google.com> WifiServiceImpl: check app status for startLOHS

When apps register a request for LOHS, they should be the foreground app
at the time of the request. If the requesting app is not the foreground
app, the ERROR_INCOMPATIBLE_MODE error will be returned.

Bug: 62356000
Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh
Test: softap integration tests locally
Test: in progress LOHS integration tests locally
Test: cts-tradefed run cts-dev --module CtsNetTestCases -t
android.net.wifi.cts.WifiManagerTest

Change-Id: Ic51bbc28478f90983555943a45f4fd70f4b2b385
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java
1f6626d7488bba014b42bab8bbcd4720694df485 25-May-2017 Rebecca Silberstein <silberst@google.com> WifiStateMachine: add mode to softap update

Plumb the softap target mode in to WifiStateMachine so we can add it to
the softap state change broadcast.

Also cleaned up some of the error and stopping states noticed due to the
mode updates and tests. This removes extra calls to clear the requests
and uses the ap state change broadcast to notify registered callers
about the LOHS stopping instead of attempting to get intermediate state.

Bug: 62076211
Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh
Change-Id: Icff0a9b30e1eb9e5aa945d289d274da7ec8910eb
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java
f1a0272c0fb3f11bc338e97481d8cb73cfe74641 06-Jun-2017 Roshan Pius <rpius@google.com> WifiBackupRestore: Change to |NETWORK_SETTINGS| permission

Use the new |NETWORK_SETTINGS| permission for all backup/restore
changes.

Bug: 62353755
Test: 'bmgr backup com.android.provider.settings'
Test: 'bmgr restore <sha> com.android.provider.settings'
Test: Unit tests
Change-Id: I5c62ed1b4cb6a6445755aaf0fd1a3b67f0a25501
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java
2f47b2755faffaa1a011ddeb8527bd9c99bb6106 25-May-2017 Rebecca Silberstein <silberst@google.com> WifiStateMachine: add iface name to ap updates

When softap mode changes state, add the interface name to the
ap state change broadcast. This will be used by ConnectivityService to
properly track interface updates and changes.

Bug: 62076211
Test: frameworks/base/wifi/tests/runtests.sh
Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh
Test: softap integration tests locally
Test: manually toggled and confirmed in logs
Test: wifi integration tests
Change-Id: I655dbdbf522c582973bb3fa8a2c42dadceb85a8d
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java
0697df2e29a3255620760667e9192d82102cd85c 31-May-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Add support for installing Passpoint profile via overloaded API" into oc-dev
d35cddaf72ba0d679143fa07e07df330c6893574 25-May-2017 Peter Qiu <zqiu@google.com> Add support for installing Passpoint profile via overloaded API

In N and earlier, WifiManager#addNetwork was used for adding/installing
Passpoint profiles. In O, we've refactored the Passpoint support
and provided dedicated APIs. In order to be backward compatible
with existing apps, we need to continue support installing Passpoint
profile using WifiManager#addNetwork.

Bug: 62142779
Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh
Test: Manually update WifiInstaller to use WifiManager#addNetwork
to install Passpoint profile, and verify it works.

Change-Id: I4a91273dccef5521c2bbca2a83e2ff08ce109a14
Merged-In: I4a91273dccef5521c2bbca2a83e2ff08ce109a14
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java
de6ff4c1fc87364efc5fa15de31325b4450548b0 25-May-2017 Rebecca Silberstein <silberst@google.com> WifiServiceImpl: setWifiEnabled permission check

Instead of using the package name to determine if the caller of
setWifiEnabled is from settings or sysui, switch over to use the
NETWORK_SETTINGS permission. This permission check will be done to
avoid stopping softap mode by third-party apps.

Bug: 38163947
Test: frameworks/base/wifi/tests/runtests.sh
Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh
Test: manually tested attempting to enable wifi from settings, quick
settings and quick quick settings when wifi tethering was active
Test: cts-tradefed run cts-dev --module CtsNetTestCases -t
android.net.wifi.cts.WifiManagerTest#testSetWifiEnabledByAppDoesNotStopHotspot

Merged-In: I05a3cab6bc2b4b725badcbb7416f3f5bcd0dc3e9

Change-Id: I05a3cab6bc2b4b725badcbb7416f3f5bcd0dc3e9
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java
0f257d8ab5787450bdd24119ad809ffdfd29f98d 18-May-2017 Rebecca Silberstein <silberst@google.com> WifiServiceImpl: add packageName to startLOHS call

Add the caller's packageName to the startLOHS call. This gets the
packageName from the caller's context for permissions checks. Tests
were also update to reflect this change.

This will be submitted as a topic with a change in frameworks/base.

Bug: 31466854
Test: frameworks/base/wifi/tests/runtests.sh
Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh
Change-Id: I34ba7e4a9485fbfe295acaa9977b2adcd17343c5
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java
a39790ac184ea4b5fb5422c06d0aea0f03fbc6db 12-May-2017 Rebecca Silberstein <silberst@google.com> WifiServiceImpl: implement startLOHS

When an application requests LOHS, check current state for incompatible
modes, outstanding requests and then register a request object for that
caller. If this is the first caller, WifiServiceImpl will then trigger
WifiController to start softap mode. When the softap mode switch
completes, callers will be notified of the outcome via the
LocalOnlyHotspotCallback api.

Bug: 31466854
Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh
Change-Id: If54756914f4daf5aab1663e6d747ead68d42fd1e
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java
a2cbd2429606052cf6f2306c54f8c590d7a55174 11-May-2017 Rebecca Silberstein <silberst@google.com> WifiServiceImpl: implement stopLOHS

When a requestor is done with LOHS, closing the callback will trigger
stopLocalOnlyHotspot. This CL implements the logic to unregister the
request and stop softap mode - if that caller was the last registered
requestor.

In this CL, LocalOnlyHotspotRequestInfo was also updated to use a
different key to track the requests. This was done to support apps
calling with shared uids.

Bug: 31466854
Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh
Change-Id: I585ec1cbd4284e40e068bb47d12f80fc445d9270
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java
a42d526f8a53b25c58062fed33db5fedda8ceee1 16-May-2017 Rebecca Silberstein <silberst@google.com> WifiServiceImpl: act on interface ip mode changes

When Connectivity service notifies WifiService of interface ip mode
changes, we should use them to update our registered LOHS requestors.
When the LOHS is ready to use, we will be notified about the LOCAL_ONLY
mode and trigger the onStarted callback. If tethering starts, we should
notify the requestors via the onFailed call with an INCOMPATIBLE_MODE
error. In the unlikely case of an IP failure, we should also trigger
the onFailed callback with the GENERIC error.

This CL also adds tests and handling for cases where additional LOHS
requests are added after the hotspot is already up and running.

Bug: 31466854
Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh
Change-Id: I1c6a25eca7b23f161ea4403a980292e82968c4c1
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java
878e0cccd652ea556680b9cc101b01142e9ad919 16-May-2017 Rebecca Silberstein <silberst@google.com> WifiServiceImpl: listen and act on softap changes

The registered callers of LocalOnlyHotspot need to be updated when the
hotspot fails or stops. This is currently implemented by having
WifiServiceImpl listen for WIFI_AP_STATE_CHANGE broadcasts. When
updates about softap failures or stopping (disabling or disabled) are
received, appropriate messages are constructed and sent to registered
callers. This CL additionally adds tests confirming this behavior. An
additional helper methods were added to aid testing for sending the
broadcasts and sending messages to the registered LOHS requestors.

Bug: 31466854
Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh
Change-Id: I5ade861423c7ea25690a084e9e4c7c9861f1dbcd
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java
cd1587091a7a9c0b175fc64f33b6f17e62215829 03-May-2017 Rebecca Silberstein <silberst@google.com> WifiServiceImpl: check caller for watchLOHS

Add a check to see if a caller has the signature only NETWORK_SETTINGS
permission before registering them to watch LocalOnlyHotspot changes.

Bug: 36760523
Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh
Change-Id: Ie52613269d1a0e9e361ff0a96039ee2b894a2204
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java
0c96f88c6d9f031ab76392cdb1255bd249212ad3 30-Apr-2017 Rebecca Silberstein <silberst@google.com> WifiServiceImpl: add binder death callback impl

Binder objects for requesting applications are tracked in
LocalOnlyHotspotRequestInfo objects. When a binder death is detected,
this object calls back in to WifiServiceImpl so the request can be
removed and the hotspot can shutdown if there are not any outstanding
requests.

Added a test to verify behavior when there are not any pending requests,
further testing will be added when we start tracking the startLOHS
requests.

Bug: 31466854
Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh
Change-Id: Ida9cf996683acca03e5478845721501d12ee1a7f
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java
92d08fb607bcf4d9f0dac478f4c14ec45363bfc6 12-May-2017 Amin Shaikh <ashaikh@google.com> Fix NPE in WifiServiceImplTest

Bug: 37794067
Test: runtest --path ./tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java
Change-Id: Ieb08c9fec1a2b130f156def10a6878c5b3340d4e
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java
031cdffdaf223772d4ea52569ec7a08d00013208 02-May-2017 Glen Kuhne <kuh@google.com> Fix potential NPE in WifiService dump

Added nullchecks to WifiServiceImpl & WifiMetrics dump methods usage of
args.
This is a precaution to similar null pointer exceptions that were occuring in
statemachine dump methods.

Bug: 37907061
Test: Added some unit tests
Change-Id: I0ab74421cddc31f7270cdd314fb86678194be0f0
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java
0025465e311fe9504cd79610523a1b8171995acc 30-Apr-2017 Rebecca Silberstein <silberst@google.com> WifiServiceImpl: update API for LOHS

Add a return code for disallowed tethering for the user. Since this
needs to be a new failure mode, the return type for starting LOHS needed
to change. Updated tests to reflect this as well.

This CL will be part of a topic - there is a corresponding WifiManager
change.

Bug: 37073685
Test: frameworks/base/wifi/tests/runtests.sh
Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh
Change-Id: I22d1fcf755d1384d482bd03dbc9a6388dfa4d3db
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java
b09edccf2056d1106da4b901e1e8b26841a02a61 30-Mar-2017 Rebecca Silberstein <silberst@google.com> WifiServiceImpl: add tethering check for LOHS

Before starting up local only hotspot, first make sure we aren't already
tethering. If we are, return null since it is not a valid mode change.
If not, continue to throw UnsupportedOperationException.

Bug: 36765661
Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh
Change-Id: I9a371c4c8ecbbcc658ab8dd844f87b8705bced3c
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java
2fd9436184ea37a297f2abd5e884d30d0014b620 29-Mar-2017 Rebecca Silberstein <silberst@google.com> WifiServiceImpl: add LOHS permission checks

The new calls to start/stopLocalOnlyHotspot and
getLocalOnlyHotspotConfig need to have permission checks to make sure
only valid callers can turn the hotspot on since that disables wifi.
Enabling LocalOnlyHotspot also requires the location permission and that
Location services are enabled. A utility was added to ease testing.

This CL also adds tests verifying the permission checks.

Bug: 36760523
Bug: 37082656
Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh

Change-Id: I91b28ccb44113bb6233a50f643db785e0a509d53
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java
aaa03cbbf831e3518d849d0742539fdf39f0627c 29-Mar-2017 Rebecca Silberstein <silberst@google.com> WifiServiceImpl: add empty calls for LOHS

Add new calls to start/stopLocalOnlyHotspot and start/stop observing
hotspot updates. The calls will be exposed in a later CL. The calls
throw the UnsupportedOperationException until the implementation is
complete.

Also added tests to verify the exceptions are thrown.

Bug: 36704763
Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh
Test: frameworks/base/wifi/tests/runtests.sh

Change-Id: If6895534ecd1db5fafb3a451b26e2d3018cd60df
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java
a6ff93d77ccfdf527221f3dfa877303c14cea25d 28-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Throttle wifi scan requests from background apps (2/2)." into oc-dev
edabcd4004fe1ad46e58ee973906913cc3edc79e 23-Mar-2017 Rebecca Silberstein <silberst@google.com> WifiServiceImpl: add new methods to start softap

Add the implementations for two new methods to control softap mode.
These methods will be called by other methods in WifiServiceImpl and
also by ConnectivityService. The calls are not intended to be called by
applications and will be protected by the NETWORK_STACK permission.

Note: this CL is adding the calls, they will be used in an upcoming CL.

Bug: 36540346
Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh
Test: frameworks/base/wifi/tests/runtests.sh

Change-Id: I6bc664a32c5df03db1dffb8db20330d9dc904113
Merged-In: I6bc664a32c5df03db1dffb8db20330d9dc904113
Merged-In: If1ab98324b4f860efa93286637a4fdcec7d8f775
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java
bdac915b98217c63284b47a7925f0719c8e40844 18-Apr-2017 Wei Wang <weiwa@google.com> Throttle wifi scan requests from background apps (2/2).

Background apps cannot start wifi scans more frequent than once every 30
minutes.

Bug: 37320631

Test: Manual test. Unit tests with runtest.sh.
Change-Id: I4473dbfa6a9efcb889cca78ed77ff483174be276
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java
3871ff67f4a6970f1831fc8951392746c9e2bfa2 13-Apr-2017 Rebecca Silberstein <silberst@google.com> WifiServiceImpl: setWifiApEnabled unit tests

Add unit tests to cover setWifiApEnabled. This did require a small
change to check a tethering permission and add the user manager.

Bug: 37294233
Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh
Change-Id: I7bdfdcbdfa60605bc2e61f18aa8abeb4bcaf5c56
Merged-In: I77413789b1b2a19c9330f4c9b9978c4a0f5b5bf8
Merged-In: I33ae84d7282dea967a53a644018e20eb2902eca3
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java
05d6ff7612ee795daf3a6fd0ee5a99e01c7a8685 03-Apr-2017 Rebecca Silberstein <silberst@google.com> WifiServiceImpl: check calls to enable wifi

When the user has entered softap mode, apps should not be able to toggle
wifi on. This leaves the user with unexpected behavior. This CL adds
checks for softap mode to make sure only Settings and SysUI (Quick and
QuickQuick settings) can toggle wifi on.

Bug: 36358238
Test: manually
Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh
Test: frameworks/base/wifi/tests/runtests.sh
Test: wifi integration tests
Change-Id: I114757324b529a43c411dc8a01afcb05a23489ee
Merged-In: I114757324b529a43c411dc8a01afcb05a23489ee
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java
184a4207f60c2255486c28b45724c71738d087b7 31-Mar-2017 Rebecca Silberstein <silberst@google.com> WifiServiceImpl: test setWifiEnabled

Before adding mode checks, add unit tests to check current behavior.

Bug: 36358238
Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh
Change-Id: I8de27f2bceebb589b173d91d79dfa3a5afe6a675
Merged-In: I8de27f2bceebb589b173d91d79dfa3a5afe6a675
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java
6232408a5fc660b2d8642d56747e05c15c6255b8 05-Apr-2017 Rebecca Silberstein <silberst@google.com> WifiServiceImpl: fix failing test

Fix failing unit test due to a change in the implementation of
registerContentObserver. This method is final so our mock was not being
called. The implementation change uses a static method, ultimately the
source of the failure.

Bug: 36919372
Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh
Change-Id: I15d680fdf1211c1171708a3305bdcdcf4b916961
Merged-In: I15d680fdf1211c1171708a3305bdcdcf4b916961
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java
36f52ffb5fd16c89f022dead27d8df9e51874160 21-Mar-2017 Rebecca Silberstein <silberst@google.com> WifiServiceImpl: check device encryption at boot

When a device is booting, it may need to be decrypted. This extra step
will restart system services, including wifi. If this restart happens
while we are creating interfaces or loading firmware, we can get odd
exceptions end up crashing. To avoid this, we add a check to see if the
device needs to be decrypted. If it does, we do not start wifi.

Added unittests to cover both decrypted and encrypted boot. Also with
and without wifi enabled.

Bug: 35416881
Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh
Test: frameworks/base/wifi/tests/runtests.sh
Test: wifi integration tests
Change-Id: I8d471c7d0345611f90782dd3bc1b2261957eee73
Merged-In: I8d471c7d0345611f90782dd3bc1b2261957eee73
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java
653cd53f0906a90fbf5b1d9d0bd30917043d1bfc 02-Mar-2017 Glen Kuhne <kuh@google.com> Check validity of staticIpConfigurations

Added a check ensuring Static IP wificonfigurations have a non-null
StaticIpConfiguration and ipAddress.
This fixes a potential stalling of WifiStateMachine in ObtainingIpState
indefinitely.

Bug: 35849629
Test: Added unit test. Existing pass
Change-Id: Ibc55050db99f71acdb821f9c62e0433fda18632f
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java
5c5e8b347d32f7bf5bb1e6f40b1e350f1e9fb0f3 02-Mar-2017 Rebecca Silberstein <silberst@google.com> WifiServiceImpl: protect Settings softap config

Do not allow temporary softap configs to overwrite the user specified
softap config.

Bug: 35809698
Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh
Test: frameworks/base/wifi/tests/runtests.sh
Test: Wifi integration tests
Change-Id: Id6bde08025cea8828e3106482c72ec04d01ff2cb
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java
3c6e92f51984ba8999d5efe622b4a52dd18bdaff 23-Feb-2017 Glen Kuhne <kuh@google.com> Move WSM.updateWifiMetrics into WifiMetrics

Made this functionality internal to WifiMetrics. WSM passes it a list of
Saved Networks, and WifiMetrics does all the counting.

While I was here, cleaned up an unreachable code path in WSM.dump, that
gets preempted by WifiServiceImpl.dump (The part that dumps the raw
proto bytes).

Bug: 35675572
Test: new unit tests
Change-Id: Id0a2b71d08679410931a01c3e958aa1ba5558e6a
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java
f2fdf411925ad172b5e0b25b0c6df880256691d4 20-Dec-2016 Sohani Rao <sohanirao@google.com> Log API surfaces of WifiService

Log following ways to interact with WifiServiceImpl
- AIDL methods, trace calling uid
- AsyncChannel messages sent from and handled by WifiService
using WifiAsyncChannel instead of AsyncChannel
- AsyncChannel messages sent to WifiService using WifiHandler
instead of Handler

This CL changes the construction of WifiServiceImpl to use the
WifiAsyncChannel object instead. Exercise WifiAsyncChannel using
tests added in WifiServiceImplTest and mock logging objects.

Bug: 33780715
Test: Unit tests, Sanity tests (power on and connect to AP),
and verify logging

Change-Id: I7a56806ea1b166d15a4c75e5e0d5bfcaf23c7b98
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java
da918df16e03ee19be62343313d954027d3eb3ab 28-Nov-2016 Rebecca Silberstein <silberst@google.com> WifiServiceImpl: allow for unit tests

Some structural cleanup that allows for WifiServiceImplTest development.

Bug: 33167818
Test: runtests.sh
Change-Id: Ic3ca545f210dfaa3277cc28166b2611b3c818408
/frameworks/opt/net/wifi/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java