667 Commits

Author SHA1 Message Date
Svetoslav Ganov
8bd69610aa Intra-process view hierarchy interrogation does not work.
The content retrieval APIs are synchronous from a client's
perspective but internally they are asynchronous. The client thread
calls into the system requesting an action and providing a callback
to receive the result after which it waits up to a timeout for that
result. The system enforces security and then delegates the request
to a given view hierarchy where a message is posted (from a binder
thread) describing what to be performed by the main UI thread the
result of which it delivered via the mentioned callback. However,
the blocked client thread and the main UI thread of the target view
hierarchy can be the same one, for example an accessibility service
and an activity run in the same process, thus they are executed on the
same main thread. In such a case the retrieval will fail since the UI
thread that has to process the message describing the work to be done
is blocked waiting for a result is has to compute! To avoid this scenario
when making a call the client also passes its process and thread ids so
the accessed view hierarchy can detect if the client making the request
is running in its main UI thread. In such a case the view hierarchy,
specifically the binder thread performing the IPC to it, does not post a
message to be run on the UI thread but passes it to the singleton
interaction client through which all interactions occur and the latter is
responsible to execute the message before starting to wait for the
asynchronous result delivered via the callback. In this case the expected
result is already received so no waiting is performed.

bug:5138933

Change-Id: I382e2d8689f5189110226613c2387f553df98bd3
2011-08-24 16:26:43 -07:00
Brian Muramatsu
fe62e31914 Test for Settings Intent
Bug 4983978

Change-Id: I4d366bbcacdc12e5d86d22f5fab0e934e4ef66db
2011-08-17 18:11:27 -07:00
Jeff Sharkey
b5d55e302d Foreground/background network stats using sets.
Teach NetworkStats about "counter sets" coming from kernel, and use
them to track usage in foreground/background.  Add AID_NET_BW_ACCT to
system_server so it can control counter sets.

Move to composite key of NetworkIdentitySet, UID, set, and tag when
recording historical usage.  Persisting still clusters by identity,
since that is heaviest object.

Request async stats poll during systemReady() to bootstrap later
delta calculations. Reset kernel counters when UID removed. Update
various tests.

Bug: 5105592, 5146067
Change-Id: Idabec9e3ffcaf212879821515602ecde0a03de8c
2011-08-15 17:30:25 -07:00
Kenny Root
bcc954d772 Manifest digest stored during package scanning
This allows things that scanned an APK to pass a hash of the manifest to
others that would then be able to compare it.

Change-Id: I465f5edf3acab2a952c3d321c8df2247ffe012ea
2011-08-10 14:54:21 -07:00
Chet Haase
cbbd93ae70 Fix ViewPropertyAnimator duration and startDelay issues
getDuration() wasn't returning the correct thing in some cases, and
setStartDelay() had no effect whatsoever. Fixed those.

Change-Id: I89f930535ec1acddf57227937a9ad64986548998
2011-08-08 17:34:25 -07:00
Chet Haase
8b699792b6 Fix cancellation of AnimatorSet when child animation has delay
Previously, AnimatorSet incorrectly checked whether child animations were
'running' to figure out what to cancel. If a child animation was started, but
sitting in a startDelay phase, it was not 'running', so the right cancel/end
events would not propagate.

The fix is to add a new isStarted() API to Animator, which returns true when
the animator has started (but not yet ended), regardless of whether the animator
has a startDelay or not. It's basically a superset of the existing isRunning()
method, which only returns true when an animator has actually started setting values.

Change-Id: I126814cb6637b58295b6d18d9b155235671f99be
2011-08-08 15:05:53 -07:00
Tsu Chiang Chuang
4adcfb3b01 Merge "Bandwidth microbenchmark test app for ICS." 2011-08-04 18:34:53 -07:00
Chet Haase
163efc0285 Merge "Fix AnimatorSet cancellation issues" 2011-08-04 15:47:21 -07:00
Chet Haase
b8f574a165 Fix AnimatorSet cancellation issues
AnimatorSet was incorrectly ignoring cancel() when it was in the
initial startDelay phase. Fix is to change isRunning() to be true if the
animator is also in its delay phase.

Change-Id: I1a8c877de24fa294beea0ba30d495658255b13b3
2011-08-04 14:16:48 -07:00
Jeff Sharkey
63d27a9233 Network stats with varint, omit parcel fields.
Persist NetworkStatsHistory using variable-length encoding; since
most buckets have small numbers, we can encode them tighter. Initial
test showed 44% space savings. Also persist packet and operation
counters.

Let NetworkStatsHistory consumers request which fields they actually
need to reduce parcel overhead.

Tests for verify varint and history field requests, also verify end-
to-end by persisting history into byte[] and restoring. Expose
bandwidth control enabled state. Extend random generation to create
packet and operation counts. Moved operation counts to long.

Fix bug that miscalculated bytes since last persist, which would
cause partial stats loss when battery pulled.

Bug: 4581977, 5023706, 5023635, 5096903
Change-Id: If61e89f681ffa11fe5711471fd9f7c238d3d37b0
2011-08-03 17:21:07 -07:00
Kenny Root
1ebd74acf9 Better error codes for missing files
Make sure that files that don't exist aren't returning bogus 'out of
space' error codes.

Add some Javadoc so I can remember what each thing does in an IDE.

Add copyright header to NativeLibraryHelper

Bug: 3375299
Change-Id: Iac46019160921daca65b21d38897e5165063316e
2011-08-03 16:03:42 -07:00
Tsu Chiang Chuang
33f869951f Bandwidth microbenchmark test app for ICS.
Change-Id: I6fed5c47818f0fe08b9f2c18f1070d3238a469b6
2011-08-02 19:11:41 -07:00
Jeff Sharkey
a63ba59260 Add operation counts to network statistics.
Provide API to increment "operation counts" for a UID and tag, used
to eventually derive bytes/operation stats.  Internally is stored at
network layer, but should belong at data layer.  Switch profiling
to use data layer stats, which are emulated by summarizing network
layer details.

Read packet counts from new /proc/ columns and collect them into
NetworkStatsHistory.  Prevent double-counting by ignoring values from
first snapshot.  Watch for duplicate /proc/ entries.  Update tests
to verify packet and operation counters.

Bug: 5052136, 5097392
Change-Id: I1832f65a2b8a9188f8088f253474a667c21a2f09
2011-07-29 22:24:01 -07:00
Svetoslav Ganov
00aabf7d18 Touch exploration state set to clients asynchronously and depended on talking service being enabled.
1. Upon registration of an accessibility client the latter received only
   the accessiiblity state and waiting for the touch exploration state
   to be sent by the system in async manner. This led the very first
   check of touch exploration state is checked a wrong value to be reported.
   Now a state of the accessibility layer is returned to the client
   upon registration.

2. Removing the dependency on talking accessibility service to be enabled
   for getting into touch exploration mode. What if the user wants to use
   an accessibility service that shows a dialog with the text of the touched
   view?

bug:5051546

Change-Id: Ib377babb3f560929ee73bd3d8b0d277341ba23f7
2011-07-22 17:38:54 -07:00
Jesse Wilson
7a2c813d30 Skip byte order mark (BOM) in JsonReader
Bug: http://code.google.com/p/android/issues/detail?id=18508
Change-Id: I7652080d9ab475c75d0a811a6e2ede4975ebe063
2011-07-20 12:23:23 -07:00
Jesse Wilson
378c368f20 Remove accidental spaces from expected failure message.
Change-Id: I6c004ff09ba12851f57716801d72e9027db00944
2011-07-19 11:29:49 -07:00
Todd Kennedy
783123f79d Add getBlob() to MatrixCursor
Change-Id: I1abfd2fd117a2a31f99e77bd0b395c4ad0cfc6d2
2011-07-19 10:33:41 -07:00
Shimeng (Simon) Wang
ba6e855453 Merge "Add in i18n TLDs and new TLDs to the URL RegEx matcher." 2011-07-19 10:31:52 -07:00
Shimeng (Simon) Wang
52fc810f73 Add in i18n TLDs and new TLDs to the URL RegEx matcher.
also update APIs.

issue: 4384739
Change-Id: I946323d80f85fe43338fdc19c5858356faefa6cc
2011-07-19 10:20:49 -07:00
Bart Sears
07229314af Merge "Revert "Add in i18n TLDs and new TLDs to the URL RegEx matcher."" 2011-07-18 19:45:33 -07:00
Bart Sears
89006fa55c Revert "Add in i18n TLDs and new TLDs to the URL RegEx matcher."
This reverts commit 6050cf65dbdf52f52325dc4513156f9404ffe9d8
2011-07-18 19:43:07 -07:00
Shimeng (Simon) Wang
35ca86d8a4 Merge "Add in i18n TLDs and new TLDs to the URL RegEx matcher." 2011-07-18 18:04:51 -07:00
Shimeng (Simon) Wang
6050cf65db Add in i18n TLDs and new TLDs to the URL RegEx matcher.
issue: 4384739
Change-Id: I96f2263d9a14fc2560583e2719cf7c5ac5c46d9e
2011-07-18 17:24:14 -07:00
Jesse Wilson
a11c2f8674 Merge "Track line and column when parsing JSON." 2011-07-18 14:39:39 -07:00
Jesse Wilson
febae4ed18 Track line and column when parsing JSON.
This is a prerequisite to skipping the BOM if it exists.
Bug: http://code.google.com/p/android/issues/detail?id=18508

Change-Id: I38b1c46f246d8526fa20859b50ca3e25c9f9b9d1
2011-07-18 14:37:22 -07:00
Jesse Wilson
1a1d731c9c Merge "Always escape chars that JavaScript treats as newlines." 2011-07-18 14:27:31 -07:00
Jesse Wilson
0fc0edfd27 Always escape chars that JavaScript treats as newlines.
Related GSON Bug: http://code.google.com/p/google-gson/issues/detail?id=341
Change-Id: I41b1615c4b3b4526f2223a75191f9b0699cdda12
2011-07-18 12:56:42 -07:00
Dianne Hackborn
1b64e0d865 Work on death recipient leaks in Activity Manager and Content Service.
This should fix a leak of process death recipients in the activity manager.

Also add debugging of content observers to try to track down what looks
like a leak of them in the content service.

Change-Id: Id6823679493ef0cde5307bb66490ebe31b878556
2011-07-17 17:50:37 -07:00
Fabrice Di Meglio
50e95eba5c Merge "Implement textDirection heuristic selection." 2011-07-15 09:49:48 -07:00
Doug Felt
cb37912045 Implement textDirection heuristic selection.
Change-Id: I2fcf18de573f2d66494fa5ed61e4273c3c6078c7
2011-07-14 11:24:33 -07:00
Jeff Sharkey
434962e44e Include full network history around current time.
When requesting historical values with time ranges, always include
full values for buckets that span current time.  (It doesn't make
sense to interpolate partial data.)  Move getTotalData() to return
full Entry objects to prepare for packet counts.

Bug: 4691901
Change-Id: I717bd721be9f1d4a47c4121e46e07a56cb15bbf1
2011-07-12 20:20:56 -07:00
Jeff Sharkey
f0c3b1b6b7 Merge "Hide NetworkStatsHistory internals." 2011-07-12 15:19:31 -07:00
Jeff Sharkey
d37948f6ed Hide NetworkStatsHistory internals.
Instead of exposing internal storage details, offer getValues()
accessor which populates values into a recycled structure.

Change-Id: I5228d7099a8f61b2018a435a813435a67dae49b4
2011-07-12 13:57:06 -07:00
Chet Haase
9893fd9771 Merge "Fix Animator cancel() behavior" 2011-07-12 11:58:58 -07:00
Chet Haase
7dfacdb1c8 Fix Animator cancel() behavior
Previously, calling cancel() on an Animator would cause onAnimationCancel
events to be sent to all listeners. This was confusing for listeners
that were keying off this event for performing other actions, when the original
animator wasn't truly canceled (because it wasn't even running, or had already
been canceled earlier). This change hinges listener notification on
the animator actually running; no events are sent otherwise.

Also added the first set of Animator tests to verify that this behavior
is correct.

Change-Id: I81ab56559b5c0343c8dc7880e1c8235f3020975b
2011-07-12 11:55:51 -07:00
Jeff Sharkey
1ea4cc6464 Merge "Return stats from inactive ifaces, packet counts." 2011-07-12 11:09:09 -07:00
Jeff Sharkey
fd8be3e5e7 Return stats from inactive ifaces, packet counts.
When an iface goes inactive, xt_qtaguid maintains historical counters
instead of discarding.  Now reading and returning those values in
NetworkManagementService summary calls.  Tests to verify stats are
returned.

Modify NetworkStats to include rxPackets and txPackets values, and
move to Entry to eventually hide internal storage details.

Bug: 4984539
Change-Id: I1ba0bb5580c62e946d9dff2cc2a6f64aff403efc
2011-07-11 14:39:56 -07:00
Andy McFadden
503f5301cd Merge "Relocate common Calendar classes" 2011-07-11 11:24:23 -07:00
Fabrice Di Meglio
7f86c806ad Fix View reset of layoutDirection and textDirection
- do it in onDetachedFromWindow()
- make naming consistent too
- update unit tests

Change-Id: I320fcdbf75166bae793c4409e7344608b696667f
2011-07-11 10:39:29 -07:00
Andy McFadden
64a3b34afa Relocate common Calendar classes
Move some classes from android.pim to com.android.calendarcommon.

Bug 4575374

Change-Id: Iab09cb331a0a74f6b951ab5e5b7c207e8f1b939c
2011-07-08 16:20:13 -07:00
Fabrice Di Meglio
8f5026562f Add charCount heuristic to TextView textDirection
- threshold set to 60% (using a constant)
- fix also one issue during layout direction resolution (parent could be null so delay resolution
up to when parent is no more null)

Change-Id: I65f24a297aac6bc0d5d482ee31b55db0b201e5bf
2011-07-01 14:08:19 -07:00
Fabrice Di Meglio
222688682e Add textDirection support for TextView and ViewGroup
- use ViewGroup inheritance if defined
- use different heuristics (inherit, firstStrong, anyRtl, ltr, rtl)
- add more unit tests

Change-Id: Ic1325aa7d9e4689b181e0a2d08b7dd7fb3f0dbeb
2011-06-28 20:29:08 -07:00
Svetoslav Ganov
f2dd2dfb6c AccessibilityInjectorTest did not restore the default key binsings.
1. AccessibilityInjectorTest changes the key bindings and when done
   restores the defatult ones. The restoreation was not working.

bug:4905620

Change-Id: I812bad0b748637ded0ce69ace12517511f62f726
2011-06-27 12:38:35 -07:00
Tsu Chiang Chuang
b40ec927bb Merge "adding notification stress tests." 2011-06-24 16:55:36 -07:00
Tsu Chiang Chuang
a760e55783 adding notification stress tests.
Change-Id: Ideaae33843685fcbec4c4f38bf9c2ced97c9bf86
2011-06-24 16:19:37 -07:00
Jesse Wilson
df867f8f80 Test that algorithm name is case-insensitive for digest auth.
Change-Id: I891a533ae3b16b838925fa488093c19dfeb32efa
http://code.google.com/p/android/issues/detail?id=16051
2011-06-24 13:50:37 -07:00
Andy McFadden
ae633b2d36 Port EventRecurrence.parse() from native
This adds a Java-language implementation of EventRecurrence.parse(),
to make it easier to relocate it for the benefit of unbundled
Calendar.

Differences from the native version:

 - enforces that FREQ appears first
 - allows (but ignores) X-* parts
 - improved validation on various values
 - error messages are more specific
 - enforces that only one of UNTIL and COUNT may be present [disabled]
 - allows lower-case property and enumeration values [disabled]

As part of the transition process, both versions of the parser are
called on every request, and the results are compared.  If the results
are different a warning message is logged.

An unnecessary constructor was removed.

This also this moves some EventRecurrence tests out of CalendarProvider,
into coretests, and adds a simple parse test with the examples from
the RFC.

Bug 4575374

Change-Id: If737ed1272fda65c93363d87b2da12b85e644f5b
2011-06-21 16:04:48 -07:00
Jeff Sharkey
1b5a2a96f7 Read "qtaguid" network stats, refactor templates.
Teach NMS to read qtaguid stats from kernel, but fall back to older
stats when kernel doesn't support.  Add "tags" to NetworkStats entries
to support qtaguid.  To work around double-reporting bug, subtract
tagged stats from TAG_NONE entry.

Flesh out stronger NetworkTemplate.  All NetworkStatsService requests
now require a template, and moved matching logic into template.

Record UID stats keyed on complete NetworkIdentitySet definition,
similar to how interface stats are stored.  Since previous UID stats
didn't have iface breakdown, discard during file format upgrade.

Change-Id: I0447b5e7d205d73d28e71c889c568e536e91b8e4
2011-06-18 22:23:11 -07:00
Daisuke Miyakawa
1515c0b519 Remove HanziToPinin.java
Those files are moved to ContactsProvider package.

Must be after If786dd286dab47ca1b2ccab38c5fa43ae390c0f7

Bug: 4645142
Change-Id: I774426347e8331fc1c203d5d8e6887e83baffc9f
2011-06-16 17:42:18 -07:00
Fabrice Di Meglio
c01924f156 Update getLayoutDirectionFromLocale() for using ICU
- now relying on ICU.getScript() and ICU.addLikelySubtags() for getting the locale script
- clean unit tests imports

Change-Id: Icdc45fa78490d1e2dde0e83bca0feea8aa205cdf
2011-06-16 14:40:31 -07:00