Commit Graph

700 Commits

Author SHA1 Message Date
Makoto Onuki
c4e64bc449 Merge \\"ShortcutManager: deal with changing resource IDs on app update\\" into nyc-mr1-dev am: 3bb4366006
am: a3a56ab9d1

Change-Id: Id5e39a35db803223a89100a8e23a7b3309cd9dd3
2016-06-08 17:23:34 +00:00
Makoto Onuki
3bb4366006 Merge "ShortcutManager: deal with changing resource IDs on app update" into nyc-mr1-dev 2016-06-08 17:00:00 +00:00
Makoto Onuki
78d14004f4 Merge \\"ShortcutManager: Optimize package scanning\\" into nyc-mr1-dev am: 3e27d1254b
am: a495123fc6

Change-Id: Ie210c54c0596de2804f2363b4f4c321603936eaa
2016-06-08 16:28:19 +00:00
Makoto Onuki
3e27d1254b Merge "ShortcutManager: Optimize package scanning" into nyc-mr1-dev 2016-06-08 16:16:40 +00:00
Lorenzo Colitti
2f310da52e Merge changes Ic98e3bcb,Idb0c55fc,Ia8649061,I5e7e5a87 into nyc-mr1-dev am: 3e2bfbd135
am: 3feff1367b

Change-Id: I776625bbc557c747477db70235847dd8b3ab8baf
2016-06-08 06:44:24 +00:00
TreeHugger Robot
3e2bfbd135 Merge changes Ic98e3bcb,Idb0c55fc,Ia8649061,I5e7e5a87 into nyc-mr1-dev
* 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.
2016-06-08 06:35:32 +00:00
Lorenzo Colitti
9acda9c825 Don't treat the lingerExpired broadcast specially.
NetworkMonitor no longer uses the broadcast for lingering, it
uses WakeupMessage instead.

Bug: 23113288
Change-Id: Idb0c55fc68cb8f45b3213c7134213904f227852e
2016-06-08 14:09:07 +09:00
Lorenzo Colitti
762ea7aab7 Add a test for mobile data always on.
Bug: 23113288
Change-Id: Ia8649061a797367d135bb5576600a7cdc85a822e
2016-06-08 14:08:59 +09:00
Lorenzo Colitti
6d553f6dfd Add a FakeSettingsProvider and use it in ConnectivityServiceTest.
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
2016-06-08 14:05:55 +09:00
Makoto Onuki
157b1628fd ShortcutManager: deal with changing resource IDs on app update
- 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
2016-06-07 16:11:30 -07:00
Makoto Onuki
6dd9fb7004 ShortcutManager: Optimize package scanning
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
2016-06-07 10:32:19 -07:00
TreeHugger Robot
5a780c0b17 Merge "Tethering: Own WiFi tethering state and lifetime" 2016-06-03 21:57:05 +00:00
Christopher Wiley
f1315c3cd6 Tethering: Own WiFi tethering state and lifetime
- 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
2016-06-03 13:25:09 -07:00
Makoto Onuki
cffb6041d2 Merge "ShortcutManager: Implement usage report API" into nyc-mr1-dev am: 37087ad710
am: 51c7ce7531

* commit '51c7ce7531f5c1fc1ae442b1c6f206735599cea2':
  ShortcutManager: Implement usage report API

Change-Id: Ia713dbbb510d2f848b8866a4d0dc692f67803522
2016-06-03 15:44:53 +00:00
Makoto Onuki
fdb40b93bb Merge "Merge "ShortcutManager: Break down unit tests" into nyc-mr1-dev am: f6be4c023f" into nyc-mr1-dev-plus-aosp
am: 7d9b79c41b

* commit '7d9b79c41b53a8f936cb50be40c57a13412197bb':
  ShortcutManager: Break down unit tests

Change-Id: If4e742401c1fa02f48d086f9cbdf50d8100e4f16
2016-06-02 22:57:50 +00:00
Makoto Onuki
ac042501c8 ShortcutManager: Implement usage report API
Bug 28536054

Change-Id: I293e8eaad523e3b0d76d562fc381601633451ed3
2016-06-02 15:57:40 -07:00
Chris Wren
95a079adf2 Merge "Give the auto-merger somthing to hang on to." into nyc-mr1-dev am: cf665232f3
am: b58e350e92

* commit 'b58e350e9266b8ced268b21900ab6c065dcac218':
  ShortcutManager: Implement max # of shortcuts

Change-Id: Ide9c5923c0dca42b5285ddcadda0716f2f00084b
2016-06-02 21:07:43 +00:00
Makoto Onuki
51ab2b3fd0 ShortcutManager: Break down unit tests
The test file is getting too big and making the IDE very slow.
Now it's split into multiple files

Change-Id: I50ed89f19defd3809f327bc21e7d9ea790dcde4e
2016-06-02 14:00:34 -07:00
Makoto Onuki
7001a61540 ShortcutManager: Implement max # of shortcuts
- Each activity (launcher icon) can have at most 5 dynamic +
manifest shortcuts.

Bug 28536066

Change-Id: Id34371d51c4a1c5e3df7debe3b71b535eb157b6c
2016-06-02 10:47:37 -07:00
Makoto Onuki
9a968df828 Merge "ShortcutManager: API rename" into nyc-mr1-dev am: 60585d12e7
am: facbcba617

* commit 'facbcba617766402b03c2b1ecc889dfc0fd9c4a2':
  ShortcutManager: API rename

Change-Id: If7da8f53354762bb7e035ab8a9c66e73886545ec
2016-06-02 00:50:25 +00:00
Makoto Onuki
eddbfecb8d ShortcutManager: API rename
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
2016-06-01 10:09:10 -07:00
Makoto Onuki
09c6612288 resolve merge conflicts of 8de7c95 to master
Change-Id: I04447215323c7582554dc5f6ae8b105308c6f623
2016-05-27 16:10:34 -07:00
Paul Jensen
c545b8f005 Merge "Don\'t drop IPv4 broadcast packets when WiFi multicast lock is held" into nyc-dev am: 83e50327fc am: ae8f345d15
am: 4aa3ffcded

* commit '4aa3ffcded843d3b194517ef0d24698ee78a7fea':
  Don't drop IPv4 broadcast packets when WiFi multicast lock is held

Change-Id: Ic3c246b6dfe368f942d961ddf3cd8aae3dfdbd03
2016-05-27 22:47:29 +00:00
Makoto Onuki
22fcc68e6b ShortcutManager: Support manifest shortcuts
- Now apps can publish shortcuts via AndroidManifest.xml
(Sample: I5b127150)

- Rename some APIs per API council feedback

- Publishers can now "disable" shortcuts.
(https://docs.google.com/presentation/d/1raUn1QBURDb1yrd6mSmVxII9ezNh3MWukODdtufJ29U/edit#slide=id.g13ef592464_7_39)

Bug 28785283
Bug 28536066

Change-Id: I4a126841e43e40139bb4baa6d0f98ad7b3a75ac1
2016-05-27 09:40:58 -07:00
Paul Jensen
4aa3ffcded Merge "Don\'t drop IPv4 broadcast packets when WiFi multicast lock is held" into nyc-dev am: 83e50327fc
am: ae8f345d15

* commit 'ae8f345d155a9aa29bce107c6675e2da8ed61a8b':
  Don't drop IPv4 broadcast packets when WiFi multicast lock is held

Change-Id: I5b544fe6e52a41d508932c2747294b20862d7ffe
2016-05-27 15:08:05 +00:00
Paul Jensen
e8b8f1b48e Merge "Don\'t drop IPv4 broadcast packets when WiFi multicast lock is held" into nyc-dev
am: 83e50327fc

* commit '83e50327fcf24e4d17a341cc2efaafc95046a8f9':
  Don't drop IPv4 broadcast packets when WiFi multicast lock is held

Change-Id: Ib76e96a84820fa36357d820ef6845f6155ec902c
2016-05-27 15:03:48 +00:00
Paul Jensen
f8a01e8431 Don't drop IPv4 broadcast packets when WiFi multicast lock is held
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
2016-05-27 09:18:56 -04:00
Christopher Wiley
f54c5a932a Consolidate cleanup logic in TetherInterfaceSM.TetheredState
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
2016-05-25 14:59:07 -07:00
Christopher Wiley
d905add474 Annotate TetherInterfaceStateMachineTest for APCT
APCT needs a little additional magic to pick up JUnit4 tests.

Bug: 28958508
Test: Tests continue to pass

Change-Id: Ia45d91bb3b06e60e3a46ffe738d4468356e066b3
2016-05-25 14:59:06 -07:00
Sudheer Shanka
b4742164b5 Merge "Merge "Fix usermanager related tests." into nyc-mr1-dev am: bb883ddf59" into nyc-mr1-dev-plus-aosp
am: ff2067f9dc

* commit 'ff2067f9dce6801a7b91e5185a53ee704b802856':
  Fix usermanager related tests.

Change-Id: Ifce5de3f6994d50cdfb5e9fb5a92bc47e7c9331c
2016-05-24 23:09:40 +00:00
Sudheer Shanka
c32abe8646 Fix usermanager related tests.
- Fix failing test
- Updates to include in continuous test execution

Fixes: 28938682
Change-Id: I17dd9ca5cf2579f0649f3939b00b08fa71a106cf
2016-05-24 14:40:59 -07:00
Tony Mak
f6fbfce696 Doc: delete old test_framework.png am: 05c98d5458 am: 734e7725ac am: 130317181e am: 5e08d12331
am: 3fbe5c0d34

* commit '3fbe5c0d34769ca0237a8bf7ea4c38ed1e4f8edd':
  Fix first notification of each app is not shown

Change-Id: I645d0ae0b2f55b72510921b9a2abeb71499a5a68
2016-05-24 20:26:03 +00:00
Adarsh Fernando
3fbe5c0d34 Doc: delete old test_framework.png am: 05c98d5458 am: 734e7725ac am: 130317181e
am: 5e08d12331

* commit '5e08d12331c53c6db708877b012187c245097bfc':
  Fix first notification of each app is not shown

Change-Id: I428894e3442eb90fed192cfd58b44353ab2b03fe
2016-05-24 20:16:34 +00:00
Tony Mak
18b1826a8c Merge "Fix first notification of each app is not shown" into nyc-dev
am: ed353f1738

* commit 'ed353f173852551f0dc0b360512a9abc5c77c28e':
  Fix first notification of each app is not shown

Change-Id: Ib3702c334b7d41b75684720d36caaa62cc52f074
2016-05-24 20:16:08 +00:00
Tony Mak
ed353f1738 Merge "Fix first notification of each app is not shown" into nyc-dev 2016-05-24 19:46:12 +00:00
Christopher Wiley
4bc8d6b1ac Rely on Tethering mutex for TetherInterfaceSM
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
2016-05-24 11:15:32 -07:00
Tony Mak
fd30332708 Fix first notification of each app is not shown
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
2016-05-24 18:57:50 +01:00
Mitchell Wills
2a86e67c41 Merge "Rename TetherInterfaceSM to TetherInterfaceStateMachine" 2016-05-24 17:51:33 +00:00
Lorenzo Colitti
3c94cc1970 Merge "Support IPv6 multicast filtering in APF." into nyc-dev am: d954c6368f am: 50282f0cb7
am: 19665ab032

* commit '19665ab032d5ea5355175719a90a9e90d28e15ea':
  Support IPv6 multicast filtering in APF.

Change-Id: I7c77efb518a7343fb8b7e1fb9f5246903e4860c5
2016-05-24 03:27:07 +00:00
Lorenzo Colitti
19665ab032 Merge "Support IPv6 multicast filtering in APF." into nyc-dev am: d954c6368f
am: 50282f0cb7

* commit '50282f0cb7bbdd117cb31db3b127adb0f4f196a0':
  Support IPv6 multicast filtering in APF.

Change-Id: I58cb62ff0bb5304d614b8eb61da148c6a5d94bed
2016-05-24 03:22:11 +00:00
Lorenzo Colitti
09a2690f91 Merge "Support IPv6 multicast filtering in APF." into nyc-dev
am: d954c6368f

* commit 'd954c6368fc6e591385e608fa6ebb42dc7606074':
  Support IPv6 multicast filtering in APF.

Change-Id: I6123c2390aa9641652fd200adcc16f9724799aab
2016-05-24 03:19:29 +00:00
Lorenzo Colitti
d954c6368f Merge "Support IPv6 multicast filtering in APF." into nyc-dev 2016-05-24 03:14:38 +00:00
Mitchell Wills
c5baad0250 Rename TetherInterfaceSM to TetherInterfaceStateMachine
Change-Id: I324690b20f37cef6d58872e21b126a87d16f7ec8
2016-05-23 17:37:32 -07:00
Lorenzo Colitti
11e13e2175 Support IPv6 multicast filtering in APF.
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
2016-05-24 00:02:07 +09:00
Christopher Wiley
2ea4166c74 Remove dead code from TetherInterfaceSM
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
2016-05-20 17:57:54 -07:00
Christopher Wiley
79e7fde00d Remove transient StartingState from TetherInterfaceSM
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
2016-05-20 17:43:33 -07:00
Christopher Wiley
1b3830a2af Expand test coverage of TetherInterfaceSM
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
2016-05-20 17:36:46 -07:00
Christopher Wiley
1cc6ffd2b3 Add demonstration unittest for TetherInterfaceSM
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
2016-05-20 15:56:31 -07:00
Chris Wren
2e00a96162 Merge "rate limit notification enqueues" into nyc-dev am: 585ff8bd12 am: 4ca84fa6b5
am: 2fab26a9ac

* commit '2fab26a9ac3703c33b5b6fdb850de4ce341497bc':
  rate limit notification enqueues

Change-Id: I916d6c89709bdee5d1fffcb59defe032cf1eb71b
2016-05-20 17:02:00 +00:00
Chris Wren
4ca84fa6b5 Merge "rate limit notification enqueues" into nyc-dev
am: 585ff8bd12

* commit '585ff8bd126ffac98164a87d24a9add5c23f9597':
  rate limit notification enqueues

Change-Id: I48a05345b210a68e507e648402a2ff19da44b7fc
2016-05-20 16:11:34 +00:00