Previously, locale resolution happened at Resources level, which
could result in different Resources in the same app using different
locales.
This change moves the locale negotiation to ResourcesManager, which
remembers the locales supported by each Resources as they are
created, and negotiates the locale based on their union.
It also makes sure that the old model of apps getting the default
locale by accessing it through the Configuration's locale attribute
continues to work, since the negotiated locale will be moved to the
top of the list before Resources are created and when they are
updated with a Configuration change.
Bug: 25800576
Bug: 26404653
Change-Id: I0dd81df288327fd8d1229188c9544ee2209c161a
- Propagate nullness and non-null-ness up and down from the interfaces.
- Add non-CTS print tests for IPrintManager binder.
Change-Id: I0c310d9cea8aefba5ce386931521ffaf19712bbb
SpannableStringBuilder used to return the result of getSpans in the
order of start indices because of the interval tree it uses. However,
style spans has to be applied in the order of insertion to get
predictable results. Sorted the results of getSpans ordered first by
priority flag and then by insertion time. Moreover improved the
performance of SpannableStringInternal copy constructor.
Bug: 26240132
Change-Id: I0b0fa7bb30a3bd9ca37dedca66d8993718586027
Whether a network is deemed roaming or not was already being tracked
as part of the NetworkIdentitySet, so the underlying data store
already tracks roaming and native data separately. However, this data
was being aggregated together in NetworkStatsCollection#getSummary,
since the NetworkIdentitySet is converted to an iface name for the
purposes of matching, and the iface name will be identical whether or
not the iface is considered roaming. Now it is separated.
Also fixes a long-standing bug in NetworkIdentitySet where an identity
read from a saved file would always be considered roaming == false,
even if it wasn't at the time it was written.
Bug: 25813438
Change-Id: I11ab5b51182ed8da7af8fde468df065f9fdc3dad
This test used to fail consistently, but currently passes.
Adding it back to see whether whatever was causing it to fail has
since been fixed. If not, need to get failure logs to see what the problem
is during the automatic runs.
Issue #23807249 Fix AutoCancelTest or delete it
Change-Id: Ied0e0d3a700d9ba36d4d5ef8ca95b8072e639851
Keyboard shortcuts are requested via WindowManager, and
the request pipes through to the view root and the window
callback.
Bug: 22405482
Change-Id: Ic0071e91c7b554be3ac9df71e9539ee8a60e822e
Two setters are added, a hidden one for fast unsafe calls when the
input is known to be OK, and a public one for normal users.
A hidden constructor is also added for adjusting locale lists and
moving a locale to the front.
Finally, an indexOf method is added. It's only used in testing now,
but it's potentially useful for others too.
Bug: 26404035
Change-Id: I4ab3140134325456a8c3df1b126ccc6f8e3f43fd
In practice, a lot of apps provide English resources as their default
resources, so assume that English is always supported.
With this change, users can safely set secondary locales after
English in their preferred locale lists. Such settings would help
the apps (and parts of the system that are aware of multiple locales)
consider the user's familiarity with the secondary locale or the
user's preference for glyphs forms in the secondary locale. This
change makes sure that no app unintentionally switches to such
secondary locales.
Note that this doesn't break from the tradition of previous releases.
Traditionally, if the user had set the system locale to English, they
would get the default resources when the app didn't explicitly
provide English resources. This will continue to be the case where
the user's locale list has English in it before another supported
language. (English will be the first locale in most cases.)
Bug: 26192817
Change-Id: I2c1a003760299157786c1b3f9fb116ce18db3b8c
Introduced a new regular expression to autolink URLs. Previous regular
expression used the protocol as an optional rule. The new expression
applies separate rules for strings that do not start with a known
protocol and strings that do start with a known protocol.
- In order to reuse previous regular expression definitions for
different parts of a URL, created constants for different parts of
WEB_URL expression.
- Separated the test cases for WEB_URL in order to remove the suppress
command and make them running again.
- Fixed failing tests for punycode urls, which were causing existing
tests to fail.
- Introduced new a regular expression for URL matching.
- Changed the protocol rule to be case insensitive.
- Updated IANA TLDs.
- Added tests for the new regular expression.
- Added tests for Linkify.
- Bug 9622849 is partially fixed.
Bug: 25727599
Bug: 9622849
Bug: 24500693
Bug: 23189367
Bug: 24543148
Change-Id: Ifd62455d342ca7adb22996246ff652e1d5944bec
When an APK is being installed, the full path to the file is
occasionally passed between processes. To detect changes to the file
during these handovers, the digest of the AndroidManifest.xml entry
could be passed around as well.
This security feature is no longer used and is no longer needed. APKs
should be installed using the modern Package Installer API
(android.content.pm.PackageInstaller).
Bug: 24542768
Change-Id: I2762634c85448e7adcd47ffc9a5294c021e127bd
java.lang.IntegralToString is being removed, replaced
all its usage by com.android.internal.util.HexDump.
(cherry picked from commit 3f72604be806c0173b5dca0225cadf6e7c872147)
Change-Id: I0527d580f5975dca0dfaa6f86fa3695dd49d0849
To avoid long stacktraces being truncated, add code to split up
large chunks along line breaks.
Introduce LineBreakBufferedWriter to chunk up log output. Add a
core test for it.
Change-Id: I34160fbce853c21329f7fa109a9c42506b2066af
Long press on a selection starts drag and drop both for tap and mouse.
Drag on a selection starts drag and drop for mouse.
Bug: 25730231
Change-Id: Idf5df9948f8257433782183464e94cf16b2e372d
- Extend MouseUiController and MouseClickAction to support choosing click
button.
- Introduce ContextMenuUtils to provide useful methods for context menu
testing.
Bug: 25730231
Change-Id: I4f04716428b8cfdcf9f953fe8f8d27f5374b0425
When set, signals that the application is required for the system user and
should not be uninstalled.
Bug: 25616324
Change-Id: Idbbd1618e09c40bdb83fa26c0a3d9662dd73bea4
The primary goal of this CL is to make it clear that BCP-47 is the
expected format to annotate locale information for each
{InputMethod, SpellCkecker}Subtype. In order to avoid possible
compatibility issues, this CL introduce a new "languageTag" attribute
instead of reusing existing "imeSubtypeMode" and "subtypeLocale"
attributes.
For IME developers, this CL changes nothing unless "languageTag"
attribute is specified. To summarize:
A: If only legacy locale-string is specified
(existing IMEs/Spell-Checkers fall into this category):
-> The system uses locale-string.
B: If only LanguageTag is specified:
-> The system uses LanguageTag.
C: If both locale-string and languageTag are specified:
-> The system uses LanguageTag. Legacy locale-string is ignored.
For application developers, there should be some follow-ups CLs because
even with this CL most likely they would still have to take care of
previous versions of Android where:
- Locale#forLanguageTag() (N/A in API Level 20 and prior)
- Locale#toLanguageTag() (N/A in API Level 20 and prior)
- InputMethodSubtype#getLocale() (Deprecated in N)
- SpellCheckerSubtype#getLocale() (Deprecated in N)
- InputMethodSubtype#getLanguageTag() (N/A in M and prior)
- SpellCheckerSubtype#getLanguageTag() (N/A in M and prior)
One idea would be is in the official support library to provide a utility
method that takes care of above tasks and just returns a Locale object.
If we had a utility method in the support library, probably not
returning a Locale object from #getLanguageTag() would make sense.
From performance point of view both existing legacy locale-string
attribute and new LanguageTag attribute are just String objects that
travel from XML manifest to system services to applications via IPCs.
Hence there are no performance implications except for having one more
String objects.
Bug: 22858221
Change-Id: I6db107ad2afc7709167f7c4e5d24bd589ac8bd70
After previous change removed LOCAL_NO_STANDARD_LIBRARIES:=true
it is no longer necessary to explicitly add framework to
LOCAL_JAVA_LIBRARIES as it is added automatically by the build.
Change-Id: I68bf700375e34a10302f76d7463110755b815f85
Added an Android.mk file to core/tests/benchmarks to build the
benchmarks against caliper-api-target to ensure that they build
correctly. Changed the implementations to work with the new
version of Caliper.
Bug: 24848946
Change-Id: Ib28026816dbc5c1d54f65974f4a1abfee299c43f
- Double tap/long press at line end
- Selection handle pops up after making selection by mouse dragging.
Bug: 19544351
Change-Id: Ie6a2567c151159b6dea682257efeb17e0feb9f08
What this CL actually does is just copying the existing concept
"subtypeId" from InputMethodSubtype to SpellCheckerSubtype.
To recap, the underlying problem is that the system has stored only the
return value of SpellCheckerSubtype#hashCode() to track the set of
enabled subtypes, and SpellCheckerSubtype#hashCode() has been
implemented as Arrays.hashCode(new Object[] {locale, extraValue}), which
is problematic because:
- Spell checker developers cannot change "locale" and/or 'extraValue'
if they want to keep enabled subtypes enabled.
- Android Framework developers cannot change the hash function even
when new fields are added if they want to keep enabled subtypes
enabled.
InputMethodSubtype has had the same issue, and what we did was
introducing a concept "subtypeId", which allows IME developers to
specify the return value of #hashCode().
For instance, suppose that a subtype X has already been used in
production with the following attributes:
- locale: "tl_PH"
- extraValues: "key1=value1,key2=value2"
With "subtypeId", you can change the attributes of subtype X without
losing the enabled state of subtype X on devices as follows.
- locale: "fil_PH"
- extraValues: "key1=value1,key2=value2,key3=value3"
- subtypeId: Arrays.hashCode(new Object[] {
"tl_PH", "key1=value1,key2=value2"})
This CL also deprecates existing public constructor of
SpellCheckerSubtype, which was probably published as a public API by
mistake. Note that the constructor of SpellCheckerInfo class is @hide.
Also there is no public API that receives SpellCheckerSubtype object
instantiated by developers with custom data. Making developers to be
able to instantiate SpellCheckerSubtype does not make sense right now.
Bug: 11736916
Bug: 22858221
Change-Id: I98f05c1e9421c47a93769bc4a6fe11b678bc2509
With following CLs, we already have a special rewrite rule of "tl" to
"fil" for IMEs that are targeting older versions of Android earlier than
Lollipop that did not support three letter language codes and used
"tl" (Tagalog) as the language string for "fil" (Filipino).
- 92280cd309b0f5967dd253280962d8581844db89 [1]
- ed65bc0c62ca99a118057db7ad54c4ccc14d52d0 [2]
[1]: I94f203bddceb9c87710cb187cc3cc0ee6d9092a5
[2]: Ica9cd2baac002c406f92331aadd7725d7424046a
With this CL, we have the same rewrite rule for spell checker services.
Bug: 20696126
Change-Id: I0af0f520a15337e33973391c9965364e3ae1ee4c