Commit Graph

745 Commits

Author SHA1 Message Date
Bryce Lee
f858b5788e Always send configuration to client from resize and relayout.
Previously, the server side would omit reporting new configurations
during resize and relayout if the current configuration matched the
last reported. However, if the last reported came through a resize,
the client side handling would be enqueued as a Handler message. This
leads to the possibility of the client getting a new window frame but
not a new configuration where this is synchronously handled, such as
ViewRootImpl::performTraversals.

To address this issue, we now always send the current configuration
from the server to the client. The client then identifies changes
against its own record of last reported configuration and updates as
appropriate.

This changelist also adds a call to force window relayout during
updateConfiguration, as it's possible this is called after
performTraversals is called or resize is handled, leading to a stale
window frame.

Bug: 24671393
Test: go/wm-smoke
Test: Open Camera while rotating phone to landscape. Added
      temporary logs to detect inconsistencies between measurements
      and reported rotation on draw.

Change-Id: I0d5143dfe80400f6a43ce710750f9fc9d4b93f74
2017-06-30 06:42:50 -07:00
Scott Main
41fc46aaa9 Merge "add links to Log class summary for methods and logcat doc" into oc-dev
am: ea6fea4d5d

Change-Id: I322405e6712ef9affb57d86e43b852e19cdc7f88
2017-06-29 16:19:20 +00:00
Scott Main
450a5bb81c add links to Log class summary for methods and logcat doc
bug: 29123084

Change-Id: Ida1351ca3647faa133905c5ff85df716bffd3203
2017-06-28 23:02:02 +00:00
Joe Onorato
53610791a9 Fix typos that cause infinite recursion and CTS test failure.
Bug: 37171450
Test: bit CtsProtoTestCases:*
Change-Id: Ib758756a64fa19eb976dc0a2b1bb1cd6e42fd6f2
2017-05-30 14:06:33 -07:00
Joe Onorato
416723dccd Fix typos that cause infinite recursion and CTS test failure.
Bug: 37171450
Test: bit CtsProtoTestCases:*
Change-Id: Ib758756a64fa19eb976dc0a2b1bb1cd6e42fd6f2
2017-05-26 19:52:12 -07:00
TreeHugger Robot
a775aec337 Merge "MathUtils.map fix" 2017-05-26 07:26:53 +00:00
Neil Fuller
727cca7a83 Merge "Remove time_zones_by_country.xml file" am: 3436fd4833 am: 1541ef3712 am: 4e9c135a5a
am: 4e9e1ea566

Change-Id: I444faff9c0f779f4c4e99949efb393d0cad66913
2017-05-25 11:08:04 +00:00
Neil Fuller
4e9e1ea566 Merge "Remove time_zones_by_country.xml file" am: 3436fd4833 am: 1541ef3712
am: 4e9c135a5a

Change-Id: I8d03ce9616c702d73fb6a807d45c58afd332b50b
2017-05-25 11:01:07 +00:00
Lucas Dupin
09c4bf8d03 MathUtils.map fix
Test: runtest -x cts/tests/tests/util/src/android/util/cts/MathUtilsTest.java
Bug: 62068907
Change-Id: I26613407a2f477580cbe17160651f1f8972a75d8
2017-05-24 17:08:58 -07:00
Neil Fuller
1e49f6c35f Remove time_zones_by_country.xml file
time_zones_by_country.xml has been replaced by a file that can
be updated outside of an OTA and can be accessed via
libcore.util.TimeZoneFinder. This means parsing code has been
removed from this class and replaced by calls to libcore code.

libcore code uses ICU so this class adapts to
java.util.TimeZone for published public APIs as well as other
knock-ons to reduce impact of this change in telephony code.
All use of classes called TimeZone are fully-qualified to
reduce confusion.

Several public-but-hidden methods have been removed. These
can be returned if there are any important apps relying on
them.

Bug: 25338903
Test: Ran CtsUtilTestCases
Change-Id: I699b4e7420e8d7e61ee68ec96552ab3144c9bab2
2017-05-24 15:31:16 +01:00
Svetoslav Ganov
7c5e0fd431 Merge "Init MemoryIntArray#mFd with -1" am: d6eaa80590 am: a3f14a1531 am: b1274a057f
am: 88993e244a

Change-Id: I2c01823fd8bc0e1485352ea7edba32d84f31cd6a
2017-05-12 06:41:52 +00:00
Svetoslav Ganov
88993e244a Merge "Init MemoryIntArray#mFd with -1" am: d6eaa80590 am: a3f14a1531
am: b1274a057f

Change-Id: I1db50e323b452520c766be40a0c6524a12e14194
2017-05-12 02:48:26 +00:00
Svet Ganov
32eee4f19d Make sure fd is always initialized
Test: MemoryIntArray tests pass

bug:35791084

Change-Id: Icf1ea7717d58a23b89f85a798826b2f5e4d47401
2017-05-11 16:45:19 -07:00
Svetoslav Ganov
d6eaa80590 Merge "Init MemoryIntArray#mFd with -1" 2017-05-11 23:34:24 +00:00
Chris Wren
d8cc90c303 Merge "expose the UID in the EventLog API" into oc-dev am: 8ae5e04636
am: 21abf1cd20

Change-Id: Id1ccf3fa7a50f276003e98cfebee1407e0fa4090
2017-04-28 18:02:57 +00:00
Chris Wren
21abf1cd20 Merge "expose the UID in the EventLog API" into oc-dev
am: 8ae5e04636

Change-Id: Id199e23d3024c9b137946e7802ee57e5e85281db
2017-04-28 17:46:02 +00:00
Chris Wren
4d6b54d2bf expose the UID in the EventLog API
Bug: 32806111
Test: runtest --path frameworks/base/core/tests/coretests/src/android/metrics
Change-Id: I16800a33bc6d4d37b3addd71b675fd760bd5d7b8
2017-04-28 11:18:07 -04:00
Mukesh Agrawal
503af47c0a Merge "Log: increase visibility of Log.TerribleFailure" am: 5e253647ad am: f6328d6943 am: 864dffcd81
am: ab0c70ea81

Change-Id: I6361cf9eb54eb1c9fbb0c4f49b913b4add870e97
2017-04-27 17:25:00 +00:00
Mukesh Agrawal
ab0c70ea81 Merge "Log: increase visibility of Log.TerribleFailure" am: 5e253647ad am: f6328d6943
am: 864dffcd81

Change-Id: I04838769ed83bd6b8283fbcb658ff89a4f92dee6
2017-04-27 17:12:17 +00:00
Mukesh Agrawal
5e253647ad Merge "Log: increase visibility of Log.TerribleFailure" 2017-04-27 16:40:48 +00:00
Daniel Sandler
84c00e396e Merge "Avoid ClassCastException in ArrayMap." into oc-dev am: f9e5395081
am: c467559093

Change-Id: I078ba5b3ce2acaab5151e37f0a0f718f15a230dd
2017-04-27 01:38:07 +00:00
Daniel Sandler
c467559093 Merge "Avoid ClassCastException in ArrayMap." into oc-dev
am: f9e5395081

Change-Id: I2b8b50865bd6db37092ac5752bf280a74e840074
2017-04-27 01:31:40 +00:00
Dan Sandler
d0ecb1ed10 Avoid ClassCastException in ArrayMap.
Only happens if you're put()ing and clear()ing the map from
different threads, and Dianne told you not to do that.

In addition to avoiding the cache poisoning that results
from concurrent access, ArrayMap now attempts to throw
ConcurrentModificationException if clear() or
ensureCapacity() or put() notices you've modified the map
elsewhere.

Bug: 32994281
Test: runtest -x frameworks/base/core/tests/coretests/src/android/util/ArrayMapTest.java
      runtest -x cts/tests/tests/util/src/android/util/cts/ArrayMapTest.java
Change-Id: Ia75970aa9e2b2b65692179f51243584b9773797f
2017-04-26 14:18:15 -04:00
mukesh agrawal
c2a56b279e Log: increase visibility of Log.TerribleFailure
The Log.setWtfHandler() provides a way to override
the default TerribleFailureHandler, so that we can
test that a piece of code reports as terrible
failure as expected.

Unfortunately, we can't actual use setWtfHandler()
at the moment. The problem is as follows:
1. The Log.setWtfHandler() method requires a
   Log.TerribleFailureHandler instance.
2. The Log.TerribleFailureHandler interface requires
   subclasses to implement a onTerribleFailure()
   method. The method requires a Log.TerribleFailure
   argument.
3. Log.TerribleFailure is a private inner class.

Given the above, classes outside of Log can't create
an appropriate argument to pass to Log.setWtfHandler().

To resolve this, we update the visibility of
Log.TerribleFailure to be the same as that of
Log.setWtfHandler(), and Log.TerribleFailureHandler.

Test: m -j32
Bug: 37425059
Change-Id: Ie646b931869582398d61495e367e0d36e767a3e3
2017-04-26 00:49:34 +00:00
Wale Ogunwale
2e80263ec4 Merge "Switch ActivityRecord last reported config. to MergeConfiguration" into oc-dev am: 3ce611f1b4
am: a17d99a389

Change-Id: I3abcabf0bf75fb7217fb8045d2b6404300f4255f
2017-04-26 00:27:56 +00:00
Wale Ogunwale
a17d99a389 Merge "Switch ActivityRecord last reported config. to MergeConfiguration" into oc-dev
am: 3ce611f1b4

Change-Id: I1dd4284b58c901d89ac82853712d17ffc0e86c0a
2017-04-25 21:16:00 +00:00
Wale Ogunwale
e610d3dba8 Switch ActivityRecord last reported config. to MergeConfiguration
Clean-up before actual fix for b/36897968 that makes the code easier to
follow.

Test: Existing tests pass
Bug: 36897968
Change-Id: I3039548929440f922dc69d7f130169a3d60b1eef
2017-04-25 11:48:43 -07:00
Sunny Goyal
bfb5991945 Merge "Creating a common class for loading drawables and handling various badging" into oc-dev am: 15b48ff4de
am: cdb51ebb41

Change-Id: If4ee1ff513c4f52b102a9252c99e813d783f6d1d
2017-04-19 03:03:37 +00:00
Sunny Goyal
cdb51ebb41 Merge "Creating a common class for loading drawables and handling various badging" into oc-dev
am: 15b48ff4de

Change-Id: Ifce032deebbe1dd66d4e80dd211030765daab4a0
2017-04-19 02:53:05 +00:00
Sunny Goyal
bab3075e2e Creating a common class for loading drawables and handling various badging
Test: Manually tested on device
Bug: 36591157
Change-Id: Ic847537d416650015cecaeb68f47f7f032e0dbaa
2017-04-18 16:36:15 -07:00
Adam Lesinski
08551954aa Merge "Add example to TypedValue.changingConfigurations JavaDoc" into oc-dev am: 4124851b64
am: b8dc42fcf3

Change-Id: I4874c6683a150b98f8edcd4f1d5e60e69b39e457
2017-04-14 16:09:37 +00:00
Adam Lesinski
b8dc42fcf3 Merge "Add example to TypedValue.changingConfigurations JavaDoc" into oc-dev
am: 4124851b64

Change-Id: I2bdfbdbe4e08e4b10b0fe7a2d0ed813f29d72fe7
2017-04-13 21:03:53 +00:00
TreeHugger Robot
4124851b64 Merge "Add example to TypedValue.changingConfigurations JavaDoc" into oc-dev 2017-04-13 20:54:30 +00:00
Adam Lesinski
41a2fb1c75 Add example to TypedValue.changingConfigurations JavaDoc
Also includes a list of possible bits that can be set.

Bug: 36676115
Change-Id: I84fd374a00debb4647719e62cf5a1ef22bb6071c
Test: builds
2017-04-13 11:39:50 -07:00
Hyunyoung Song
47da8197b1 Merge "Update API, add more documentation on AdaptiveIconDrawable" into oc-dev am: 76c13a5fce
am: e99cf60039

Change-Id: Ib821f43548e938a7652f62ef444e0a116aa8a58b
2017-04-13 17:31:16 +00:00
Hyunyoung Song
e99cf60039 Merge "Update API, add more documentation on AdaptiveIconDrawable" into oc-dev
am: 76c13a5fce

Change-Id: I060797416983056208f21c099ba21fdc8409103a
2017-04-13 17:20:50 +00:00
Hyunyoung Song
76c13a5fce Merge "Update API, add more documentation on AdaptiveIconDrawable" into oc-dev 2017-04-13 16:53:43 +00:00
Hyunyoung Song
92e3da2354 Update API, add more documentation on AdaptiveIconDrawable
and fix multiple miscellaneous bugs.

Bug: 37079814
Bug: 37100106
Bug: 34829216

Test: $ runtest --path=frameworks/base/core/tests/coretests/src/android/graphics/drawable/IconTest.java
Test: $ runtest --path=frameworks/base/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java
Test: $ runtest --path=frameworks/base/core/tests/coretests/src/android/grpahics/drawable/AdaptiveIconDrawableTest.java

Change-Id: I0f5b2232853031bf3860ebea2736e894d17e4d2e
2017-04-12 16:06:45 -07:00
Jiaquan He
4bd8bce6d7 Detect unhandled keyboard focused state.
am: 4a81674b45

Change-Id: I8c756acc96cab2d24c19f86c50266c2ef51b5494
2017-04-12 22:51:56 +00:00
TreeHugger Robot
18d993bb72 Merge changes from topics 'KeyboardFocusHighlight-oc-dev', 'KeyboardFocusHighlight_ mDefaultFocusHighlightEnabled-oc-dev', 'KeyboardFocusHighlight_ hasFocusStateSpecified-oc-dev' into oc-dev
* changes:
  Fix broken CTS tests.
  Draw a default focus highlight if needed.
  Add a public API defaultFocusHighlightEnabled.
  Detect unhandled keyboard focused state.
2017-04-12 22:40:15 +00:00
Mark Salyzyn
d845459a36 Merge "jni: isLoggable: adapt to removal of property name size limit" am: cf39eea407 am: 5f98be7f11 am: 3da7584dc4
am: 097487aaaf

Change-Id: Ic482074150cf13499742bffc6049a89ee47d4172
2017-04-11 23:53:58 +00:00
Mark Salyzyn
097487aaaf Merge "jni: isLoggable: adapt to removal of property name size limit" am: cf39eea407 am: 5f98be7f11
am: 3da7584dc4

Change-Id: I2fd96c0c9cae8043bb5fabaa32b542b6965abcf7
2017-04-11 23:44:04 +00:00
Mark Salyzyn
c9668a1805 jni: isLoggable: adapt to removal of property name size limit
(cherry picked from commit 8143fa57ad)

There is no longer a name size limit to the properties, remove
illegalArgumentException if tag length is too large.

Test: build
Bug: 36696208
Change-Id: I4b4329c8c951082ed0d777cdd70ee3e773bed16c
2017-04-11 16:15:23 -07:00
Mark Salyzyn
8143fa57ad jni: isLoggable: adapt to removal of property name size limit
There is no longer a name size limit to the properties, remove
illegalArgumentException if tag length is too large.

Test: build
Bug: 36696208
Change-Id: I4b4329c8c951082ed0d777cdd70ee3e773bed16c
2017-04-11 07:31:40 -07:00
Jiaquan He
4a81674b45 Detect unhandled keyboard focused state.
A View uses a Drawable as its background, which changes
its appearance according to the View's state. This commit
adds an algorithm to detect undefined state_focused in
state specs for those Drawables.

Test: cts-tradefed run singleCommand cts --skip-device-info
--skip-preconditions --abi armeabi-v7a -m CtsGraphicsTestCases
-t android.graphics.drawable.cts.DefaultFocusHighlightTest
Bug: 35096940

Change-Id: I5e9f07141679881fe88f9040aa116ea2f9d537c9
2017-04-10 21:01:49 +00:00
Hugo Benichi
ada3f6b8f1 Merge "Improve utility of IntArray and LongArray" am: 35786735df am: e718797a37 am: 4ca1cb7c10
am: 6f75cb52e8

Change-Id: I82032bf85861cfc8aebffd9e49796fb61b5a19ed
2017-04-10 01:46:36 +00:00
Hugo Benichi
6f75cb52e8 Merge "Improve utility of IntArray and LongArray" am: 35786735df am: e718797a37
am: 4ca1cb7c10

Change-Id: If206b2b4d837dbbb8d0fd0c9a75fad240bb5379e
2017-04-10 01:36:20 +00:00
Hugo Benichi
35786735df Merge "Improve utility of IntArray and LongArray" 2017-04-10 01:09:04 +00:00
Hugo Benichi
112962a6b0 Improve utility of IntArray and LongArray
This patch adds several utility methods to IntArray and LongArray to
make them more useful in the context of a Parcelable class.

More specifically, it is now possible to parcel and unparcel a
{Int, Long}Array with the following one liners:
  - mIntArray = IntArray.wrap(parcel.createIntArray());
  - parcel.writeIntArray(mIntArray.toArray());

This patch also
  - adds unit tests for IntArray and LongArray.
  - adds a method for setting a field at a given index.
  - adds a method for changing the effective array length.
  - adds missing bound checks for negative index values.

Test: added test coverage
Bug: 34901696
Change-Id: Ia0febf4dae048b0a45c75310b5d90b56499320da
2017-04-07 13:18:16 +09:00
TreeHugger Robot
4e4252354d Merge changes from topics 'KeyboardFocusHighlight_mUseDefaultFocusHighlight', 'KeyboardFocusHighlight', 'KeyboardFocusHighlight_DetectUnhandled'
* changes:
  Draw a default focus highlight if needed.
  Add a public API defaultFocusHighlightEnabled.
  Detect unhandled keyboard focused state.
2017-04-04 18:38:21 +00:00