Previously the DisplayMetrics passed to a new ResourcesImpl
object would be generated from the default DisplayAdjustments.
We now use the correct DisplayAdjustments for the ResourcesImpl
and make sure to update them for things like rotation changes.
Bug:29619314
Change-Id: If2ba0d7670a4554dcd3fde9766e2337f20a191fd
(cherry picked from commit 8e8d23214a71d8813ebd3676b192924c530cb913)
We allow each individual Resources object to select the best
Locale for the given APK. This allows one update to the configuration
instead of multiple updates, once the locale is chosen.
The Java locale is selected from the app context's locale.
Bug:28625993
Bug:27325465
Change-Id: I99e1e53f522e560f3b80bbd1e1c605f552dbdff0
We handled stale wakelocks (wakelocks that disappear from /d/wakeup_sources)
differently in previous version of Android. They would be set stale, but still be
updated with their previous counts (they would never disappear).
The method setStale has been replaced with endSample(), which is semantically different.
Once a SamplingTimer has endSample() called, it expects any future calls to update() to
be a new sample, meaning the entire amount passed to update() is included in the kernel
wakelock's total. Since stale wakelocks were never removed from the list, this would
increase by large amounts when nothing had actually changed.
This was exacerbated by the fact that there was a bug where the last wakelock in
/d/wakeup_sources was never parsed, so if the order ever changed, this "stale" wakelock
would suddenly re-appear and the entire amount reported would be charged to the wakelock,
instead of just the difference since the last update.
All this was exposed when we added support to handle wakelocks that would disappear and
reappear with smaller values, meaning the kernel had pruned them from its accounting and
reset them.
Bug:28601080
Change-Id: Ic96027f7d580dac5e20aa73d67e5cedac4ccabeb
Since LocaleList needs to depend on android.os.Parcelable, we cannot let
that class belong to "android.util" package, which causes layering
violation.
Bug: 28819696
Change-Id: Ia8de2ee9df3dd0a42b1fe84574439519b680fe18
Settings is using a MemoryIntArray to communicate the settings table
version enabling apps to have up-to-date local caches. However, ashmem
allows an arbitrary process with a handle to the fd (even in read only
mode) to unpin the memory which can then be garbage collected. Here we
make this mechanism fault tolerant against bad apps unpinning the ashmem
region. First, we no longer unpin the ashmem on the client side and if
the ashmem region is purged and cannot be pinned we recreate it and
hook up again with the local app caches. The change also adds a test
that clients can only read while owner can read/write.
bug:28764789
Change-Id: I1ef79b4b21e976124b268c9126a55d614157059b
NetworkPolicyManagerService (NMPS) keeps an internal list of uid
rules (mUidRules) for network restrictions, and when these rules
changes it needs to notify external listeners (such as
ConnectivityService / CS).
Prior to Android N, both Data Saver mode (the feature previously known
as "Restrict Baground Data") and Battery Save mode used the same set of
firewall rules to implement their restrictions: when Battery Saver mode
NPMS would mark all networks as metered and set the proper firewall
rules externally.
Recently, these 2 modes were split in 2 distinct firewall rules and
NMPS.updateRuleForRestrictBackgroundLocked() was changed to update
the mUidRules logic based on the Data Saver firewall (since the Battery
Saver firewall changes are handled externally, on
updateRuleForRestrictPowerLocked()). As such, CS was not notified when
the power-related changes were made, which would cause apps to get a
state of CONNECTED / CONNECTED when querying its active connection.
This change refactores the mUidRules to use bitmasks, in preparation for
another change that will fix the issue.
It also fixes a minor bug that was preventing removed packages to be
removed from the whitelist.
BUG: 28521946
Change-Id: I9f0e1509a6192cad403f740c1cd76a6b7dab7d26
We used the system proterties as a shared memory mechanism
to propagate information to local settings caches when the
content has changed and the cache should be cleared. The
system properties are unfortunately updated asynchronously
leading to cases where clients may read stale data.
This change adds a simple int array data structure backed
by shared memory which guarantees individual values are
atomically read and updated without memory tear. Multi-
index opearations are not synchronized between each other.
The settings provider is using the new data structure to
propagate the settings generation which drives when caches
are purged.
We have a single memory array keeping the generation for
different settings tables per user. Since memory array is
not a compact data structure and the user space exceeds
the memory array size we use an in-memory map from keys
to indices in the memory array where the generation id of
a key is stored. A key is derived by the setting type in
the 4 most significant bits and the user id in the 28 least
significant bits.
The mapping from a key to an index is cleared if the user is
removed and the corresponding index in the memory arry is
reset to make it available for other users. The size of the
memory array is derived from the max user count that can be
created at the same time.
bug:18826179
Change-Id: I64009cc5105309ef9aa83aba90b82afc8ad8c659
SamplingTimer has been losing some data, as well as not correctly handling
entries that have gone away and come back with less data (reset).
This change correctly ends a SamplingTimer sample by adding the accumulated amount
to the total, then reseting the running counter to accept new values.
This is also triggered automatically when the incoming data is less than what is currently
recorded.
Bug:25695597
Change-Id: I6b540906e6be527578d1003485384a75ba211b52
Vendor may want to introduce their own ZWJ emoji sequence. To delete
them by one back space as the same behavior of Unicode emoji sequence,
use all emoji as the zwj emoji.
Bug: 28248662
Change-Id: I572dad42ee108476962d4b3fe9f3a6019cb50098
While processing an unlock request, we might go async to handle
long-running operations like dispatching PRE_BOOT_COMPLETED. This
change ensures that all unlock requests for a particular user wait
in line behind any pending async operations.
Without this CL, any subsequent unlock requests would immediately
return successful, even though PRE_BOOT_COMPLETED events were still
being processed.
Bug: 28240584
Change-Id: I307d6aaebfb8f38028f3666a2e19e4399b7cf3a7
This is a follow up CL to my previous CL [1], which added a new key
binding Meta+Space to rotate enabled IME subtypes. With this CL,
Shift+Meta+Space starts reverse-rotating enabled IME subtypes as
originally planed.
[1]: I4005692215edfcf8bed3e86b1e07000148f986f5
ae61f7118a92e097e854c840d5726c0920f5db0e
Bug: 25753404
Bug: 28103839
Change-Id: I3694edd80be6dfe18b90360e24ae4d451b331928
- Rewrite existing test about text appearance.
- Add new tests for suggestions popup.
Bug: 25904136
Bug: 27765262
Change-Id: I12e522436a83fa264cd22176d054877eec411708
Excludes the following space characters from autoLink URL patterns:
\u00A0: no-break space
\u2000: en quad
\u2001: em quad
\u2002: en space
\u2003: em space
\u2004: three-per-em space
\u2005: four-per-em space
\u2006: six-per-em space
\u2007: figure space
\u2008: punctuation space
\u2009: thin space
\u200A: hair space
\u2028: line separator
\u2029: paragraph separator
\u202F: narrow no-break space
\u3000: ideographic space
Bug: 28020781
Change-Id: Ie6df818dc4d33dfee6ee54432a2231cca51ec423
- Encode '\u000' - '\u001F', so KXmlParser can read them properly.
Otherwise KXmlParser will ignore CRs/LFs in attributes, and CRs
in text.
- Originally FastXmlSerializer would throw if a string contains
dangling surrogate pairs. Now we REPLACE them with.
Bug 27792649
Change-Id: I10c547dad2475b68f60e9e8208d9a3eae8e20063
If the current active scorer provides a service that can handle the
android.net.scoring.SCORE_NETWORKS action then the NetworkScoreService
will bind to that service to keep the scorer alive. If no service is
discovered then no attempt to bind will be made.
BUG: 27612145
Change-Id: I3f6ed0cbd83e658f1533c3e37b0cac2692c01761
Previously, hasTransientState returned true even when TextView has a
selection that hasn't been created by the user. This unnecessarily
prevents the TextView from being recycled.
This issue was introduced by Ib454b0fbbc2c2f8d198, which fixes that
setHasTransientState(true) is not always coupled with
setHasTransientState(false).
With this CL:
hasTransientState will get true when selection action mode is started.
hasTransientState will get false when selection is removed.
Note that hasTransientState intentionally continues to be true when
selection action mode is terminated with preserving selection.
Bug: 27913323
Change-Id: I960ddfd7221caeb676c23926af06a8a415dec288
ERROR_CANNOT_RESUME is the correct code for one, and relative paths
are supported by the RFC, so change the test to check for success.
Bug: 27580939
Change-Id: Ife99c22a44dd71232466e35d38a2441c16a558f7
This service connects through the print manager to the print spooler:
PrintSpooler.AddPrintersActivity <-> PrintManager <-> PrintManagerService <-> UserState <-> RemotePrintServiceRecommendationService <-> PrintRecommendationService <-> PrintRecommendationServiceImpl
Hence there is a lot of mindless plumming.
The actual changes are only in the AddPrintersActivity which is extended
to show another list of services: The recommended services.
The PrintServiceRecommendationService is based on the experimenal print
service stubs provider. This provider was contributed the Android by
Mopria. As this services uses Android own network discovery service most
code from the experimental provider goes away. In fact the only logic
left over is the selections of mdns-txt fields to look at and the
printer vendor configuration.
This relies on the Android MDNS to get fixed (Bug: 27696905). This also
does not deal with how to update the recommendation service.
Bug: 24533249
Change-Id: I6edc6e25fc08a50d478b61c71bb8ea158b08624c
Previously it was assumed that one Resources object per Activity would be fine.
This proved to be incorrect, as methods like Context#createConfigurationContext()
expect to create a new Resources object that gets updated whenever the Activity Resources
get updated.
To fix this issue, there exists a master override configuration for each Activity. Subsequent
Resources created for an Activity will be based off that master override configuration, and
will be updated accordingly.
Bug:27644297
Bug:27604953
Change-Id: Idb3d851f55ee7981eec4e3fe28e2ea8d55f1192d
Re-enable TextViewActivityMouseTest#testContextMenu that was disabled
by I459f1ab1c6d2d3119fc50166.
Bug: 27765262
Change-Id: I986ec239324d2d65a14be3fb2981777583471c68
Now that CE data isn't available until after a user is unlocked, we
need to delay the PRE_BOOT_COMPLETED broadcasts. This is done by
adding a new RUNNING_UNLOCKING user state to the UserController
lifecycle.
We now track the last fingerprint a user was logged in under, and we
dispatch PRE_BOOT receivers when that fingerprint changes. To work
around battery pull issues, we only persist the updated fingerprint
once all PRE_BOOT receivers have finished. This is less granular
than the original solution, but it's still correct. We only consider
a user as "logged in" once it transitions into the RUNNING_UNLOCKED
state.
When starting a process, track if the user was "unlocked" when
started, so that we only spin up unaware providers in processes
started before user unlock.
Add generic IProgressListener to communicate PRE_BOOT progress and
strings up to lock screen. For now, LockSettingsService just blocks
until finished, but it could display these strings in the future.
Bug: 27220885
Change-Id: I349439776b885acd32f6a578d8951ffd95640be2