1584 Commits

Author SHA1 Message Date
Roozbeh Pournader
486117bf5b Merge "Move locale negotiation to ResourcesManager" 2016-01-27 01:48:39 +00:00
Philip P. Moltmann
e33b954165 Merge "Check parameters for callers of IPrintManager" 2016-01-26 22:52:58 +00:00
Roozbeh Pournader
834641b390 Move locale negotiation to ResourcesManager
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
2016-01-25 19:23:38 -08:00
Keisuke Kuroyanagi
a2756f6018 Merge "TextView tests: drag and drop." 2016-01-26 01:26:06 +00:00
Keisuke Kuroyanagi
e27e0850fe Add TextView cursor positioning tests for grapheme clusters.
Bug: 25375561
Bug: 25730231
Change-Id: I7e77e6de027a81ec0f203a1ff9c24a768ffedae3
2016-01-22 06:02:42 +00:00
Philip P. Moltmann
76d7e3ee70 Check parameters for callers of IPrintManager
- Propagate nullness and non-null-ness up and down from the interfaces.
- Add non-CTS print tests for IPrintManager binder.

Change-Id: I0c310d9cea8aefba5ce386931521ffaf19712bbb
2016-01-21 13:27:30 -08:00
Siyamed Sinir
92b9747f1c Merge "Sort the result of SpannableStringBuilder.getSpans" 2016-01-21 19:12:28 +00:00
Siyamed Sinir
fa05ba0b0d Sort the result of SpannableStringBuilder.getSpans
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
2016-01-20 16:27:39 -08:00
Jeff Davidson
c48e3b602e Merge "Implement roaming tracking in NetworkStats summary queries." 2016-01-20 01:43:02 +00:00
Jeff Davidson
a6a78076ee Implement roaming tracking in NetworkStats summary queries.
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
2016-01-19 16:57:51 -08:00
Chet Haase
2b87fe0e09 Merge "Add AutoCancelTest back to framework tests" 2016-01-19 17:33:14 +00:00
Chet Haase
7d97a72da2 Add AutoCancelTest back to framework tests
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
2016-01-19 08:54:37 -08:00
Keisuke Kuroyanagi
a2477acec9 Tests for getPrimaryHorizontal with grapheme boundaries am: a5c53291a8 am: 3bb115ba5c
am: 404a22cf74

* commit '404a22cf74f47bbdbeccb3452aefcfd3c34eee74':
  Tests for getPrimaryHorizontal with grapheme boundaries
2016-01-13 23:05:34 +00:00
Keisuke Kuroyanagi
404a22cf74 Tests for getPrimaryHorizontal with grapheme boundaries am: a5c53291a8
am: 3bb115ba5c

* commit '3bb115ba5c8f176a355384f98e0b5348499b8b76':
  Tests for getPrimaryHorizontal with grapheme boundaries
2016-01-13 19:03:56 +00:00
Keisuke Kuroyanagi
a5c53291a8 Tests for getPrimaryHorizontal with grapheme boundaries
Bug: 25375561
Change-Id: I022473627499d7f18105e3a300754fae5be7da8e
2016-01-13 18:50:43 +00:00
Clara Bayarri
75e097965c Request Keyboard Shortcuts for SysUI Dialog via Window
Keyboard shortcuts are requested via WindowManager, and
the request pipes through to the view root and the window
callback.

Bug: 22405482
Change-Id: Ic0071e91c7b554be3ac9df71e9539ee8a60e822e
2016-01-13 16:56:56 +00:00
Jeremy Klein
502658dd90 Merge "Add a TETHER_PRIVILEGED permission and use it where needed." 2016-01-11 19:10:22 +00:00
Roozbeh Pournader
a514b63749 Merge "Support properly setting and getting LocaleLists" 2016-01-11 17:48:53 +00:00
Roozbeh Pournader
2b5ab18294 Support properly setting and getting LocaleLists
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
2016-01-07 17:08:52 -08:00
Jeremy Klein
d42209db96 Add a TETHER_PRIVILEGED permission and use it where needed.
BUG: 26247383
Change-Id: I73f7227d77926faa9081e83eccb83c8ddee33e08
2016-01-07 10:11:24 -08:00
Siyamed Sinir
f744b0793b Merge "New regular expression to autolink URLs" 2016-01-07 00:14:26 +00:00
Roozbeh Pournader
fb9236cb0c For locale negotiation, assume English is always supported
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
2016-01-05 14:52:38 -08:00
Alex Klyubin
4f6d400b0f Merge "No need to pass digest of AndroidManifest.xml around." 2016-01-05 21:19:41 +00:00
Siyamed Sinir
840385c9f6 New regular expression to autolink URLs
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
2016-01-04 17:59:45 -08:00
Alex Klyubin
31ffb44241 No need to pass digest of AndroidManifest.xml around.
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
2016-01-04 12:31:29 -08:00
George Mount
57bbd6e9c7 Tests for DatePicker keyboard interaction.
Bug 26187865

Change-Id: I26e990ef140d129f716eec0dff705e5f78b6608e
2016-01-04 11:01:49 -08:00
Przemyslaw Szczepaniak
e69a31d750 Use HexDump instead of java.lang.IntegralToString
java.lang.IntegralToString is being removed, replaced
all its usage by com.android.internal.util.HexDump.

(cherry picked from commit 3f72604be806c0173b5dca0225cadf6e7c872147)

Change-Id: I0527d580f5975dca0dfaa6f86fa3695dd49d0849
2015-12-22 13:10:55 +00:00
Andreas Gampe
8413db8c36 Frameworks/base: Change android.util.Log multiline logging
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
2015-12-17 19:00:29 -08:00
Keisuke Kuroyanagi
4307aeb935 TextView tests: drag and drop.
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
2015-12-17 08:54:56 +00:00
Keisuke Kuroyanagi
a0b3c06881 TextView tests: open context menu on right click.
- Extend MouseUiController and MouseClickAction to support choosing click
button.
- Introduce ContextMenuUtils to provide useful methods for context menu
testing.

Bug: 25730231
Change-Id: I4f04716428b8cfdcf9f953fe8f8d27f5374b0425
2015-12-17 08:19:56 +00:00
Fyodor Kupolov
bdbc9692c7 Introduced PRIVATE_FLAG_REQUIRED_FOR_SYSTEM_USER
When set, signals that the application is required for the system user and
should not be uninstalled.

Bug: 25616324
Change-Id: Idbbd1618e09c40bdb83fa26c0a3d9662dd73bea4
2015-12-15 14:49:42 -08:00
Yohei Yukawa
ac0ec1b020 Merge "Use BCP-47 LanguageTag in IME/Spell-Checker." 2015-12-10 17:45:18 +00:00
Keisuke Kuroyanagi
ae3ecaa276 Merge "TextView test: floating toolbar + drag handle interaction." 2015-12-10 07:20:20 +00:00
Keisuke Kuroyanagi
d2441607bd Merge "TextView test: insertion handle movement tests." 2015-12-10 07:18:55 +00:00
Keisuke Kuroyanagi
ff37557795 Merge "Fix selection expansion detection logic." 2015-12-10 07:18:21 +00:00
Keisuke Kuroyanagi
2b69da5183 Merge "TextView tests: Add mouse triple click tests." 2015-12-10 06:01:33 +00:00
Keisuke Kuroyanagi
3c5a52b424 Merge "TextView tests: tests for improved mouse text selection." 2015-12-10 05:14:11 +00:00
Yohei Yukawa
868d19b93b Use BCP-47 LanguageTag in IME/Spell-Checker.
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
2015-12-08 12:27:55 -08:00
Paul Duffin
cde2287208 Merge "Remove framework from LOCAL_JAVA_LIBRARIES" am: e252149ab9 am: ec9081a004
am: e94e7dd181

* commit 'e94e7dd181fb1857bf7aa3b807b64d9bb231edc6':
  Remove framework from LOCAL_JAVA_LIBRARIES
2015-12-08 14:22:55 +00:00
Paul Duffin
b12a3fca7e Remove framework from LOCAL_JAVA_LIBRARIES
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
2015-12-08 13:59:36 +00:00
Andreas Gampe
32f4043ac3 Follow-up to Switch to the latest version of Caliper
Remove LOCAL_NO_STANDARD_LIBRARIES.

(cherry pick from commit c9d6a91cd51a9b7ff00187914fe922b0d22b3d66)

Bug: 24848946
Change-Id: I19feea042c9b4823d4979f4d951476792600edbc
2015-12-08 13:58:08 +00:00
Andreas Gampe
c373adb84d Merge "Follow-up to Switch to the latest version of Caliper" 2015-12-08 02:30:21 +00:00
Andreas Gampe
0fe2de958a Follow-up to Switch to the latest version of Caliper
Translate ResourcesBenchmark to work with the new version of Caliper.

Bug: 24848946
Change-Id: If4a4e5da5cd14da83d093a418147ad6d12c170cc
2015-12-07 18:25:10 -08:00
Andreas Gampe
c9d6a91cd5 Follow-up to Switch to the latest version of Caliper
Remove LOCAL_NO_STANDARD_LIBRARIES.

Bug: 24848946
Change-Id: I19feea042c9b4823d4979f4d951476792600edbc
2015-12-07 18:24:08 -08:00
Paul Duffin
6a75685258 Merge "Switch to the latest version of Caliper" am: ae119af517 am: 5e2d958157
am: 2a56ed70b1

* commit '2a56ed70b1e40039a532e4060074d62062713fcd':
  Switch to the latest version of Caliper
2015-12-07 23:58:26 +00:00
Paul Duffin
76a6cec97f Switch to the latest version of Caliper
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
2015-12-07 12:29:45 +00:00
Keisuke Kuroyanagi
46faad6023 TextView tests: Add mouse triple click tests.
Bug: 19544351
Change-Id: I20f1b169915a8013f7786684f97172767c162420
2015-12-06 10:03:23 -08:00
Keisuke Kuroyanagi
d42cb8ffa7 TextView tests: tests for improved mouse text selection.
- Double tap/long press at line end
- Selection handle pops up after making selection by mouse dragging.

Bug: 19544351
Change-Id: Ie6a2567c151159b6dea682257efeb17e0feb9f08
2015-12-06 10:02:09 -08:00
Yohei Yukawa
0894319162 Add subtypeId for SpellCheckerSubtype.
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
2015-12-04 16:16:47 -08:00
Yohei Yukawa
eae60ba5a4 Rewrite a fake language code "tl" in SpellChecker.
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
2015-12-04 14:43:17 -08:00