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
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
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
- 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
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
- 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
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
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
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
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
- 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
- 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