834 Commits

Author SHA1 Message Date
Makoto Onuki
17e94691c2 Merge \\"Don\\'t accept resource references in string fields\\" into nyc-mr1-dev am: 6fa0e4d518
am: 3d3e2e2b17

Change-Id: Ib5a83728239cfa074fb9800b76bc217dcf990b30
2016-07-15 23:56:03 +00:00
Makoto Onuki
6fa0e4d518 Merge "Don't accept resource references in string fields" into nyc-mr1-dev 2016-07-15 23:41:11 +00:00
Makoto Onuki
d36651717e Merge \\"Cache the default launcher.\\" into nyc-mr1-dev am: cf99263662
am: 6406be311c

Change-Id: If7d3f5325388242a196d78f8429c4aba65ef041e
2016-07-15 23:34:53 +00:00
Makoto Onuki
cf99263662 Merge "Cache the default launcher." into nyc-mr1-dev 2016-07-15 22:22:34 +00:00
Makoto Onuki
1030520822 Cache the default launcher.
Originally we always checked with PM for the default launcher,
which would take ~2ms.

Now we cache the result, and clears the cache when (any) preferred
activities change.

Bug 30126557

Change-Id: Iceef288cd372c8bb9b119aa493e5173d894f2302
2016-07-15 12:57:03 -07:00
Hugo Benichi
cf29b41679 Merge \\"APF: filter unwanted ARP replies\\" into nyc-mr1-dev am: b91c1232ee
am: 599c9c764e

Change-Id: Ic45bd53872102c7e6fdf02a79d29f82744ee1695
2016-07-15 04:11:33 +00:00
TreeHugger Robot
b91c1232ee Merge "APF: filter unwanted ARP replies" into nyc-mr1-dev 2016-07-15 03:59:49 +00:00
Makoto Onuki
6a8581339b Merge \\"Handle locale change and pacakge change in different way\\" into nyc-mr1-dev am: 83fa7a8255
am: 22963b8937

Change-Id: I39da795eeed8bb3d0e53b0ed02663cce1088cabf
2016-07-15 00:55:59 +00:00
Makoto Onuki
83fa7a8255 Merge "Handle locale change and pacakge change in different way" into nyc-mr1-dev 2016-07-15 00:39:06 +00:00
Makoto Onuki
6771d73703 Don't accept resource references in string fields
Detect it when a developer accidentally uses @string/... in string fields
and log an error rather than publishing shortcuts with wrong values.

Bug 30140672

Change-Id: I98a60afd7f52282019a94a7a8c30a85ea4c7806b
2016-07-14 12:58:40 -07:00
Philip P. Moltmann
a12eeeb4ef Merge \\"Always trigger a write if no pages are written\\" into nyc-mr1-dev am: 965a706282
am: 0c1814a153

Change-Id: I7d7021e4ff9074bf60c22caa2b897245fe8a5f4b
2016-07-14 19:50:15 +00:00
Makoto Onuki
13260b6ff0 Don't allow shortcuts with non-main activities
Bug 30122758

Change-Id: Id9ead6706d5460fec3d68c7457e3097f30a9a080
2016-07-14 10:49:22 -07:00
Hugo Benichi
38db976514 APF: filter unwanted ARP replies
This patch adds APF filtering of ARP replies for interfaces with APF.

- when the interface has no IPv4 address, broadcast ARP replies with a
  0.0.0.0 target ip are dropped (GARP), ARP requests with a 0.0.0.0
  target ip are dropped.

- when the interface has an IPv4 address, broadcast ARP replies to a
  different ip are dropped (including GARPs to 0.0.0.0), ARP requests to
  a different ip are dropped.

Bug: 29404209
Bug: 30080487
Change-Id: I82613eb865c7f38b6260997fe2caf2aff382ad78
2016-07-14 23:36:53 +09:00
Makoto Onuki
4e6cef49ef Handle locale change and pacakge change in different way
- Stop using a custom callback from AM to detect locale changes
and use the LOCALE_CHANGED broadcast instead.

- This would open up a chance where a publisher app fetches
its won manifest shortcuts after a locale change but
ShortcutManager hasn't updated string resources.

- So instead, at every entry point from ShortcutManager, check
if the locale has changed, and if so, update all resources
(and reset throttling).

- Do the same for package change events too.  At every entry point
from ShortcutManager, check if the caller package has been updated,
or any target activities have been disabled.  If so, rescan the
caller package.

- We do *not* do the same check at the LauncherApps entry points,
because the launcher should use the callback to listen to
shortcut changes.

- Also stopped using PackageMonitor for now because we want to
set a higher priority and changing PackageMonitor at this point
seems too much for DR.

Bug 29895275
Bug 30123329

Change-Id: Ib4a2f626a936c7328e2cc032324f5c3d1c3b9122
2016-07-13 17:37:06 -07:00
Makoto Onuki
c7b4815f23 Merge \\"Revert \\"Revert \\"Revert \\"Handle package broadcasts before apps do\\"\\"\\"\\" into nyc-mr1-dev am: 6eefe67b2c
am: a74fce83ae

Change-Id: I8dcd074a8075e38416da0d6e3570545f17d6bc15
2016-07-13 20:27:48 +00:00
Makoto Onuki
f34c308dfd Revert "Revert "Revert "Handle package broadcasts before apps do"""
This reverts commit 886ba78dfb105eb45416587b73b6c6b336448de5.

With the tests updated.

Change-Id: I162e6ca23c667f90feddc1e9f42b554a416295cf
2016-07-13 10:40:31 -07:00
Makoto Onuki
2adc0c392e Merge \\"Revert \\"Revert \\"Handle package broadcasts before apps do\\"\\"\\" into nyc-mr1-dev am: 98802f6007
am: 80dd14e061

Change-Id: I32fcfdc3fb90fe7b0ac14239a721769234c7cb2f
2016-07-13 17:34:11 +00:00
Makoto Onuki
98802f6007 Merge "Revert "Revert "Handle package broadcasts before apps do""" into nyc-mr1-dev 2016-07-13 17:09:37 +00:00
Makoto Onuki
886ba78dfb Revert "Revert "Handle package broadcasts before apps do""
This reverts commit efbbe7ea9db8adab6bff407db1d7fc54bbaf31ee.

Change-Id: I3dbb080db5121307f533a7d411f4f5d47225500e
2016-07-13 17:08:26 +00:00
Makoto Onuki
d0866414f9 Merge \\"Revert \\"Handle package broadcasts before apps do\\"\\" into nyc-mr1-dev am: 7f3187bb0d
am: 5f18bbe034

Change-Id: I05af5e8eb457c19e3dbce414e0e2351c936703ff
2016-07-13 16:58:06 +00:00
Makoto Onuki
7f3187bb0d Merge "Revert "Handle package broadcasts before apps do"" into nyc-mr1-dev 2016-07-13 16:33:39 +00:00
Makoto Onuki
83118dd723 Merge \\"Don\\'t backup & restore disabled shortcuts.\\" into nyc-mr1-dev am: 4885b274c1
am: bc15e3ca2b

Change-Id: I457db12fdcc884a121b82320b7d32646133632ca
2016-07-12 22:20:06 +00:00
Makoto Onuki
4885b274c1 Merge "Don't backup & restore disabled shortcuts." into nyc-mr1-dev 2016-07-12 22:01:08 +00:00
Makoto Onuki
efbbe7ea9d Revert "Handle package broadcasts before apps do"
And fix b/29939691 (don't try to load locked users) in a different way

Bug 29939691
Bug 29895275

Change-Id: Ib55f9c5d5547c54daa4e05c1e50bf4bbceaf1991
2016-07-12 14:47:20 -07:00
Makoto Onuki
f3ba2e04be Don't backup & restore disabled shortcuts.
Also a backup & restore test where an app has manifest shortcuts.

Bug 30016960
Bug 29921267

Change-Id: I8c4c3ece50f26d778b2f8f42251c317eb25d1e14
2016-07-12 10:27:31 -07:00
Makoto Onuki
be0e56e9d2 Merge \\"Throw ActivityNotFoundException when failed to launch shortcut\\" into nyc-mr1-dev am: 50752f7391
am: b1e0982173

Change-Id: I466a7c5985cb080e6e2780cfbafa3bb90cc58dbf
2016-07-12 17:19:36 +00:00
Makoto Onuki
2afa465e2c Merge \\"Handle package broadcasts before apps do\\" into nyc-mr1-dev am: ae13eee9c6
am: fcf7db9eed

Change-Id: Idfe3e8ed29c9a5fe8870527e5c5d7470455f4989
2016-07-12 02:16:16 +00:00
Erik Kline
177c82be79 Support requesting async LinkProperties/NetworkCapabilities updates am: acdd639513
am: 915d09b5d4

Change-Id: If177966a19c830a106ce689c7e07a7835bb2c1a1
2016-07-12 01:46:09 +00:00
Makoto Onuki
83f6d2da37 Throw ActivityNotFoundException when failed to launch shortcut
Originally the code used IIntentSender, but I had to switch to calling
startActivitiesInPackage() directly, because sendIntentSender() does
not support returning errors.

Bug 30035853

Change-Id: I5d7669c96a2f1805373c71aebf45b97ac1d01ff6
2016-07-11 14:37:18 -07:00
Makoto Onuki
a2241834a5 Handle package broadcasts before apps do
- Have PM to call the shortcut manager directly before sending a
pacakge broadcast.

- The shortcut manager will enqueue a task to handle a package
broadcast, which will be executed on Handler.

- At the entry points of all external facing methods, block until
all pending tasks are finished.

Bug 29895275

Change-Id: Ib29fa3c9c8d9b9e0ca5c8f1e9da2a390324960a4
2016-07-11 11:28:10 -07:00
Erik Kline
acdd639513 Support requesting async LinkProperties/NetworkCapabilities updates
Bug: 9580643
Change-Id: I1d7ba7645c20d7d53f6eef777dfce43727940f13
2016-07-11 19:17:41 +09:00
Lorenzo Colitti
1656aa5b7d Merge \\"Rewrite lingering.\\" into nyc-mr1-dev am: b0a574fbfc
am: 2249ae1c47

Change-Id: Ieff4a63ad1d5959760e69f68e832ca256ec2c2ae
2016-07-07 11:06:53 +00:00
Lorenzo Colitti
b0a574fbfc Merge "Rewrite lingering." into nyc-mr1-dev 2016-07-07 10:55:39 +00:00
Lorenzo Colitti
b57578ca4f Rewrite lingering.
The two major changes here are:

- Move lingering out of NetworkMonitor. The fact that lingering
  is currently its own state in NetworkMonitor complicates the
  logic there: while a network is lingering it cannot be in any
  other state, we have to take care not to leave LingeringState
  for the wrong reason, etc.
- Instead of keeping a single per-network boolean to indicate
  whether a network is lingered or not, keep a linger timer for
  every request. This allows us to fix various corner-case bugs
  in lingering.

The changes in behaviour compared to the current code can be seen
in the unit test changes. Specifically:

1. Bug fix: when a network is lingered, and a request is added
   and removed to it, the existing code tears the network down
   immediately. The new code just sends another CALLBACK_LOSING
   and resumes lingering with the original timeout.
2. Bug fix: if cell is unvalidated and wifi comes up and
   validates before cell does (as might happen on boot), the
   existing code immediately tears down cell. The new code
   lingers cell, which is correct because unvalidated cell was
   the default network, so an app might have been using it.
3. Correctness improvement: always send CALLBACK_AVAILABLE for
   the new network before sending CALLBACK_LOSING. This was not
   really an issue in practice, because the usual flow is:
    - Network A is the default.
    - Network B connects, CALLBACK_AVAILABLE.
    - Network B validates, CALLBACK_LOSING.

Bug: 23113288
Change-Id: I2f1e779ff6eb869e62921a95aa9d356f380cf30a
2016-07-07 16:18:57 +09:00
Jeff Sharkey
2e2c64556c Merge \"Merge \\"Switch network cycle calculation to use Calendar.\\" into nyc-mr1-dev am: 3a4408640a\" into nyc-mr1-dev-plus-aosp
am: 54a704bfcd

Change-Id: I2924d4f96cf0ab52131570a270091d0d9480af0f
2016-07-07 01:47:39 +00:00
Jeff Sharkey
f2bead5117 Switch network cycle calculation to use Calendar.
The older Time class is deprecated and doesn't handle edge cases
very well.  So migrate the cycle calculation logic to use the
long-standing and well-supported Calendar API.

Bug: 28689087
Change-Id: Ic1802b3f8556402f99bfea4cd625c35dfed81ac0
2016-07-06 17:15:33 -06:00
Hugo Benichi
fc47039136 Merge \\"IpConn metrics: correctly read RA lifetimes\\" into nyc-mr1-dev am: 54756fdfd9
am: 5142df5613

Change-Id: I4d4edbdd30a4a2c321d0141faaa8a0d227c9823a
2016-07-05 12:47:19 +00:00
Hugo Benichi
54756fdfd9 Merge "IpConn metrics: correctly read RA lifetimes" into nyc-mr1-dev 2016-07-05 12:25:55 +00:00
Hugo Benichi
6ccd51a338 IpConn metrics: correctly read RA lifetimes
This patch
  - adds a Builder class for RaEvent.
  - uses this Builder class for correctly recording the minimum
    lifetime seen for every ICMP6 options tracked, instead of
    recording the last lifetime seen.
  - adds unit test coverage for RaEvent logging.

Change-Id: I6443932f5cf7a613a5c695c65a60eab01e60602a
2016-07-05 13:52:24 +09:00
Lorenzo Colitti
83f104b604 Merge \\"Add test coverage for a bug in the lingering code.\\" into nyc-mr1-dev am: b4db945883
am: 759fe4598e

Change-Id: I19439c95167bf215edc67068fb5a6859ab845814
2016-07-05 03:54:35 +00:00
Lorenzo Colitti
09e202103d Add test coverage for a bug in the lingering code.
Bug: 23113288
Change-Id: I573ee5908b9d973931234eb7d2db8ea0aaa4b31e
2016-07-04 17:00:27 +09:00
Phil Weaver
8c1e36b440 Add tests for KeyEventDispatcher.
Some minor but needed changes to the class under test to
gain visibility for tests to do things like make events
on Handlers happen on demand to verify various event ordering.

Change-Id: I5096de697906f8d28b47f47dc2be2f8199ee4e19
2016-07-01 15:57:42 -07:00
Makoto Onuki
88dece9144 Merge \\"Make sure re-published dynamic shortcuts are always enabled\\" into nyc-mr1-dev am: 7df9ce075f
am: 39e24512a1

Change-Id: Icfb06157a5fda86708c5a56afe9491ad902caaae
2016-07-01 16:56:08 +00:00
Makoto Onuki
a1fbcadb57 Merge \\"ShortcutManager: Make sure persisted default launcher still exists.\\" into nyc-mr1-dev am: 5b080d4e90
am: dfbe377b1d

Change-Id: I83ae3f8be3291c3bc2d8a9a4eb3fe5b66957ce19
2016-07-01 16:51:05 +00:00
Makoto Onuki
7df9ce075f Merge "Make sure re-published dynamic shortcuts are always enabled" into nyc-mr1-dev 2016-07-01 16:40:25 +00:00
Makoto Onuki
ee6b6e4a18 ShortcutManager: Make sure persisted default launcher still exists.
- Also make sure to ignore unexported activities.
(e.g. unexported activities shouldn't have shortcuts.)

- Also add unit tests for package manager related operations.

- Also remove stale TODOs (per-activity shortcut count check is
implemented already.)

Bug 29699769
Bug 29516954

Change-Id: Ia18301baf6bec1ad71ae195d9ae3d10bd8386fc4
2016-06-30 17:30:30 -07:00
Makoto Onuki
ff14f73152 Make sure re-published dynamic shortcuts are always enabled
- Originally there was explicit code to take over the disabled flag,
which was simply not necessary.

- Also fix the startShortcut() tests that have temporarily
been disabled.

(Also remove the stale TODOs to avoid conflict with Ia18301ba)

Bug 29633681

Change-Id: I58b12ad6918d7fef4b79059b0c2c7f2df6e32269
2016-06-30 17:11:25 -07:00
Makoto Onuki
b8e1286605 Merge \\"Start shortcuts as if publisher apps did using PendingIntent\\" into nyc-mr1-dev am: 60efbf2586
am: 20a9ca9311

Change-Id: I3bb569bb53b95176dc5e3b19f4122cf75511ac1e
2016-06-30 22:02:51 +00:00
Makoto Onuki
60efbf2586 Merge "Start shortcuts as if publisher apps did using PendingIntent" into nyc-mr1-dev 2016-06-30 21:45:05 +00:00
Lorenzo Colitti
4c1cba64f1 Merge changes I65784f35,Ib6937335 into nyc-mr1-dev am: 74f7f2ec0d
am: e80e63331d

Change-Id: I5cdfe7e952ceb9da89f775f4cd451cc26ed52401
2016-06-30 14:43:30 +00:00