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
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
This is the 2nd try of I39dc0c310158ad23ba6c987efce07deaf30ce693.
This is a mechanical refactoring with no behavior change.
With this CL, InputMethodSubtype and SpellCheckerSubtype have the same
getLocaleObject() hidden API, which makes it easy to share the logic in
subsequent CLs.
No behavior change is intended.
Bug: 11736916
Bug: 20696126
Bug: 22858221
Change-Id: I51be014c752b736a808e2b0d56e664941a218a2f
This is a mechanical refactoring with no behavior change.
With this CL, InputMethodSubtype and SpellCheckerSubtype have the same
getLocaleObject() hidden API, which makes it easy to share the logic in
subsequent CLs.
Bug: 11736916
Bug: 20696126
Bug: 22858221
Change-Id: I39dc0c310158ad23ba6c987efce07deaf30ce693
Before introducing behavior changes, this CL adds
SpellCheckerSubtypeTest to make the current behavior clear.
Bug: 11736916
Bug: 20696126
Bug: 22858221
Change-Id: Ied18580f31497156510e1b785adfc248683ba94d
The system can now boot in a "locked" state where only encryption
aware (EA) components can be safely started. When in this state,
PackageManager already filters away non-EA components, but system
services like AccountManager and SyncManager need to carefully handle
these temporarily "missing" components.
As a guiding principle, all known Accounts are still present when
the device is locked, but communication with underlying non-EA
authenticators is blocked.
To keep things simple for now, all SyncManager requests are kept
dormant until the user enters the unlocked state.
The core of this logic is that RegisteredServicesCache now works
with all components regardless of EA status, which prevents us from
accidentally thinking a service was removed when the user is locked.
Bug: 25945136
Change-Id: I8714121f6236b00821769023c4df7de1c8a99944
This is a follow up CL for ed65bc0c62ca99a118057db7ad54c4ccc14d52d0 [1],
which fixed special handling of a fake language code "tl".
[1] Ica9cd2baac002c406f92331aadd7725d7424046a
Bug: 20696126
Change-Id: Ifc8bf2ff6bd617a215e4b68f6b2bf9b94e80db07
This switches keyset unit tests from two unrealistically short 512 bit
RSA keys to a more realistic 2048 bit RSA key and a NIST P-256 EC key.
Change-Id: If615b97dff22a2a4f7f0e6015e410e98b8d395cd
Use MAINDEXCLASSES defined by the build system instead of manually using
$(HOST_OUT_EXECUTABLES)/mainDexClasses.
Change-Id: Iede13c243ef0c4e374c8e80bab4a995cea76b9b1
The center position of a drag handle can be outside of the
screen. In such cases, selection handle tests can be failed.
Changed to drag the visible position to deal with it.
Bug: 25730231
Change-Id: Id9270fc03d0f39041f243c9e9d17deca19925e09
commit 42aed1b8ecf591009f9e2df8eaca4f41074c37c8 changed the hidden
KeySet API to allow packages to retrieve keysets of other packages.
Change the PackageManagerTests to not expect a SecurityExeption
anymore and also make sure that this is supported.
Bug: 25935839
Change-Id: I18c00997a627c9df1eb3826650c1aa71f563a2bd
The majority of the test failures were around the method assertInstall()
failing a check for a symlink between the data directory in /data/data/
to the application directory in /mnt/asec/. There are a handful of other
failures that will be dealt with separately; those have all been suppressed
from running.
Also took the opportunity of adjusting some of the tests to ensure the
device is properly cleaned up. Packages remained installed after a failure.
Bug: 18048725
Change-Id: Id8f6ac53cfe17de43b5d527993d57812b1a63bef
- Set an id for each HandleView to access the hanlde.
- Rename DragOnTextViewActions to DragAction to use it for
dragging handles.
- Introduce HandleCoordinates to provide proper coordinates
for handles.
More tests will be added in following CLs.
Bug: 25730231
Change-Id: I9276bf2f983983ec9aae0ddcf674d3dcee566892
To make suggestion window style Material, this CL does following things:
1. Introduce LinearLayout to be able to split suggestion item and menu.
Currently suggestion menus, "Add to Dictionary" and "Delete" buttons
are children of ListView. It is necessary to introduce LinearLayout
and move these two menus from ListView to this LinearLayout to have a
divider between suggestion items and menus.
2. Extract suggestion window layout definition from Java.
Currently almost all layout of suggestion popup window is done by
Editor.java. By extracting this logic from Java and move it to XML
files, it becomes easy to support both Holo and Material theme.
3. Introduce Material Design.
Suggestion window should respect the running application's theme since
suggestion window is shown as the part of the application.
This patch introduces Material themed suggestion window, and at the
same time, the old window is also kept as the Holo themed suggestion
window.
Bug: 15347319
Change-Id: Ieccea12db95c0a040b38680ae794b1cf6971736f
java.lang.IntegralToString is being removed, replaced
all its usage by com.android.internal.util.HexDump.
Bug: 24932279
(cherry-picked from 15fc0548a536750110e159e06a39ba943eccdd81)
Change-Id: Id6ab88337af12d93cd73c41775b9d5baa1e61d96
With this CL, Paint.hasGlyph returns true if the typeface supports
the passed code point and variation selector pair.
Bug: 11256006
Change-Id: If29cd0c5942dc78bd862804106e29539bdeee569
Previously applications where uninstalled for the system user at a later stage
in a boot process, when PM has already been initialized and registered as
a service. This was causing a flood of PACKAGE_REMOVED broadcasts.
Applications are now uninstalled at an earlier stage, when PM hasn't been
registered. Packages can simply be marked as not installed and broadcast
can be skipped.
Bug: 25626819
Change-Id: Ib64e7c45619809b0efb99cc566a9a2120ed48cd3
It seems like setOrientation(...) is not working.
Instead, fix the orientation of TextViewActivity to portrait.
See: I2f9372997f8301d800109981c6e1a6d4419b641d
Bug: 24495166
Change-Id: I0c5480b7ce6ba1fb8e4e4e3daabe94ebccca4dfd
Added GET_DEFAULT_IMES flag to AppsQueryHelper. Default system IMEs are now
enabled for system user.
Bug: 25276229
Change-Id: I38d74903951200e2207e1864bb3a815f8f2d572f
Per RFC 4330, a NTP server response should be discarded when:
- the stratum is 0 (unspecified), or
- the leap indicator is 3 (unsync'ed), or
- the mode is not 4 (server) / 5 (broadcast), or
- the transmitted time is 0.
Update SntpClient so that such responses would be discarded.
Additionally:
- make some variables suitably "final"
- enable logging
- add alternate requestTime() for testing
- add some miniscule test coverage
Cherry-picked from Jerry Wong's
https://partner-android-review.googlesource.com/#/c/460074
Bug: 24719581
Change-Id: Id11a79a6e53ce95500ed4b4d691a29c260666f6c
Clear suggestionSpan reference since it is not necessary once the
suggestion window is closed.
suggestionSpan is kept for identifying the target text region in
onItemClick method.
This CL is a part of groundwork for Bug 15347319 and no user visible
change is intended with this CL.
Change-Id: Ie0edf215a1b90629e280ce09df4fd6f5d95fbb06