* changes:
Give WakeupMessage the ability to transport an object as well.
Don't treat the lingerExpired broadcast specially.
Add a test for mobile data always on.
Add a FakeSettingsProvider and use it in ConnectivityServiceTest.
NetworkMonitor no longer uses the broadcast for lingering, it
uses WakeupMessage instead.
Bug: 23113288
Change-Id: Idb0c55fc68cb8f45b3213c7134213904f227852e
This class makes it easier to test code that uses Settings:
1. Real device or emulator settings don't affect the code under
test; all settings always start off empty.
2. It's possible to change settings from the test without
affecting system settings.
3. No changes are needed to the code under test. The changes to
the tests are simple: just add a fake ContentResolver to
whatever mock Context is already used by the test, and make
that ContentResolver use the fake provider.
Bug: 23113288
Change-Id: I5e7e5a87571444ae49ccf551705620675a36cd17
- When an app is upgraded, all the resource IDs may change. So
if a shortcut is previously published with an icon for res ID 100
and the publisher is upgraded, resource #100 may refer to something
different.
- So now the service also remembers resource names for icon resources,
as wells as string resources. When an app is updated, the service
fetch the updated resource IDs by name.
- Also extract all string resources when a shortcut is published
and persist them, so that even when the original string resources are
removed from the app, the launcher can still show the extracted strings.
- When the system locale changes, re-extract all string resources.
- Also really hide the constants in ShortcutInfo that were
accidentally made public.
Change-Id: I23c29b45c1de5d76175229190a1533c9c62c5960
SM needs to check all packages when a user is unlocked in case
any apps have been upgraded while the user was not running,
in which case it'll publish the manifest shortcuts.
Currently it actually scans all apps' manifests.
This CL optimizes it by remembering the last scan time (for each user)
and checks only the packages that have been updated since then.
Bug 29069154
Change-Id: Id10b6be8915fe7c1e26daccde7951ddbd01ea452
- Add logic to Tethering to track whether the user has requested
tethering via WiFi.
- Subscribe to intents regarding soft AP state to enable and
disable tethering when the AP comes up or goes down.
- Refactor IP configuration logic to do configuration for WiFi
as well as USB.
Bug: 29054780
Test: WiFi tethering continues to work on angler
Tethering related unittests continue to pass.
Change-Id: I6eff2573ca3fd11fabcf138c468ba517ff2daf65
The words "title" and "text" implies that "text" is a secondary label
that's shown with the title, but it turned out the launcher would show
only one of those depending on how much space it has.
So now we change them to "shortLabel" and "longLabel"
Note we're only changing the API surface -- in order to mimimize
the impact to the code, internally we'll keep using the old names.
- Also remove "shortcutRank" while I'm here -- it should be implied
from the order of the XML elements.
Bug 29057378
Change-Id: I3203f63b0318c7462c1c61fef43cf9755fa8c008
am: 4aa3ffcded
* commit '4aa3ffcded843d3b194517ef0d24698ee78a7fea':
Don't drop IPv4 broadcast packets when WiFi multicast lock is held
Change-Id: Ic3c246b6dfe368f942d961ddf3cd8aae3dfdbd03
am: ae8f345d15
* commit 'ae8f345d155a9aa29bce107c6675e2da8ed61a8b':
Don't drop IPv4 broadcast packets when WiFi multicast lock is held
Change-Id: I5b544fe6e52a41d508932c2747294b20862d7ffe
am: 83e50327fc
* commit '83e50327fcf24e4d17a341cc2efaafc95046a8f9':
Don't drop IPv4 broadcast packets when WiFi multicast lock is held
Change-Id: Ib76e96a84820fa36357d820ef6845f6155ec902c
IPv4 broadcast packets can be very common (e.g. every 2s) so they
need to be dropped in the general case. They also may be critical
for certain discovery protocols, so allow them through with APF
when the WiFi multicast lock is held.
Bug: 26238573
Change-Id: I03e09a2b9c779da5da775e78b95e9e0339720eaf
This pushes all TetheredState cleanup logic into a single place.
All new unittests fail without the changes to TetherInterfaceSM.
Bug: 28915272
Test: Compiles, unittests pass, WiFi tethering continues to work.
Change-Id: Ia7bf210e00e9a54f2797baebc2e5333ce314c947
APCT needs a little additional magic to pick up JUnit4 tests.
Bug: 28958508
Test: Tests continue to pass
Change-Id: Ia45d91bb3b06e60e3a46ffe738d4468356e066b3
am: 3fbe5c0d34
* commit '3fbe5c0d34769ca0237a8bf7ea4c38ed1e4f8edd':
Fix first notification of each app is not shown
Change-Id: I645d0ae0b2f55b72510921b9a2abeb71499a5a68
am: 5e08d12331
* commit '5e08d12331c53c6db708877b012187c245097bfc':
Fix first notification of each app is not shown
Change-Id: I428894e3442eb90fed192cfd58b44353ab2b03fe
am: ed353f1738
* commit 'ed353f173852551f0dc0b360512a9abc5c77c28e':
Fix first notification of each app is not shown
Change-Id: Ib3702c334b7d41b75684720d36caaa62cc52f074
Stop passing Tethering's mutex into TetherInterfaceSM, and instead
simply rely on Tethering to acquire its own mutex when accessing
instances of TetherInterfaceSM.
While here, remove some boolean fields (previously guarded by the mutex)
which duplicate state information.
Change-Id: Ie6b2128970981786a5d64fbf700c9f3d0a6721fb
Test: Compiles, unittests pass, WiFi tethering continues to work.
Bug: 28910007
When app tries to post its first notification,
value of now is equal to that of mLastEventTime.
And hence getRate return a very large number.
Bug: 28902358
Change-Id: If5b5b3c46e2bb80a9b40988ba7f7d777e40cc8e7
For now this just drops all non-ICMPv6 packets to ff00::/8 when
mMulticastFilter is true. Multicast ICMPv6 is already mostly
dealt with by other filters - the L2 multicast filter, the RA
filter, the multicast NA filter, and ND offload.
Bug: 28393601
Change-Id: Ia7b0d4f00fac6710093befe6a726b46677a5f20b
Because no code outside of unittests ever issued these commands
to TetherInterfaceSM, we never executed any of the removed codepaths.
Change-Id: Id54f6e4eaeff8b3486cd78ddcc8c2a31011e6436
Test: Compiles. Unittests continue to pass.
Bug: 28798823
This state immediately switched into the TetheredState.
We can safely remove it at only the expense of a misleading state
broadcast.
Bug: 28798823
Test: runtest frameworks-services -c
com.android.server.connectivity.tethering.TetherInterfaceSMTest
Change-Id: I295d830dbdb11717d6e05161d97787ffe871beb3
Add tests for most normal case operations:
- State machine startup.
- Entering a tethered state (as USB interface and not)
- Handling the first notification of an upstream interface
- Handle changes in upstream interface
- Handle unrequested teardown correctly
Bug: 28833951
Test: These tests pass
Change-Id: I2c0c9141bab9eaa92faec8de10fa653fb6236a74
Prove that the concept works by writing a trivial test.
Bug: 28833951
Test: `runtest frameworks-services -c
com.android.server.connectivity.tethering.TetherInterfaceSMTest`
Change-Id: I51911cef7f0d5165221845070befd085497c21a6