Commit Graph

718 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
5e01870015 Merge "Unbind from service on app killed and dedup association requests" 2017-03-27 18:43:37 +00:00
Eugene Susla
a38fbf63fd Unbind from service on app killed and dedup association requests
1. Listen to calling package binder death stopping the scanning on that.
2. Don't restart scanning when a request with the same values was made.

Bug: 30932767
Test: 1.:
  - Using a test app start scanning and kill the app.
  - In debug mode ensure that DeviceDiscoveryService#stopScan gets triggered
2.:
  - Start scanning and rotate the device while device chooser is visible
  - Ensure no visible loss of state is happening
Change-Id: If126a2c963da90172a956fbd88e6b3dcd7ac8b01
2017-03-24 14:03:17 -07:00
Suprabh Shukla
0693ff6d0e Removing unused method indexOfValueByValue
The method was confusing and not used by anyone. Same functionality can
be implemented trivially in the client code.

Test: N/A

Bug: 35765468
Change-Id: Ia019088cd023c62d83760d9ebe883f7559a43375
2017-03-24 01:22:05 +00:00
Pavel Grafov
4ce59d45a7 Request logs from logd with 3s overlap to avoid missing events.
Example: If we got a batch with timestamps [1, 4, 8] and an event
with timestamp 7 was delayed and was added to the buffer later,
if we request the next batch starting from timestamp 8 or 9 that
event will be lost.

The last 3 seconds of events are kept and checked against the next
batch.

Test: afw-test-tradefed-ci run afw-do-security-logging
Change-Id: I55727cfc6143c172edc7dabfd995776f9a0f7eab
Bug: 35373582
Bug: 35026180
Bug: 35648675
2017-03-21 14:52:32 +00:00
Andrii Kulian
c1b59ed73e Merge "Separate global and override config sent to client" 2017-03-17 15:39:37 +00:00
Andrii Kulian
446079600e Separate global and override config sent to client
There is some flakiness in View#onConfigurationChanged callback -
if ViewRootImpl receives config update earlier than ActivityThread,
it may not detect the configuration change and skip inner updates.
Also now ViewRootImpl assumes that it receives the global config as
a param, but instead it gets merged config from WM. This means that
ViewRootImpl#sConfigCallbacks was sending incorrect values to the
recipients.

This CL switches to sending global and override configuration to the
client separately. Also in case if there is a corresponding activity,
it first updates it and waits for update callback to ViewRootImpl.
This way global config and override config for activity will always
be set first and resources will be updated before inner state of
ViewRootImpl is updated.

Bug: 35870157
Bug: 34164473
Test: android.server.cts.ActivityManagerDisplayTests
Test: testOnMovedToDisplayCallback
Change-Id: Ic9e7541cf25ecfac6ec90e48f7efb0ece91f657e
2017-03-16 19:13:02 -07:00
Hyunyoung Song
547010ff86 Add LauncherIcons.AdaptiveIconDrawableWithShadow class to support shadow
b/36088922

Test: Settings app
This utility class can be used to bake shadow in drawable level in
system ui surfaces such as Settings, Overview and ShareSheet.

Change-Id: Iaec867d9ce5b949380c1e5004b68269d1bbeacd4
2017-03-16 13:51:28 -07:00
Narayan Kamath
a444636d39 Merge "MathUtils: Remove static Random field." 2017-03-09 11:13:39 +00:00
Tobias Thierer
137b460e5f Merge "Don't allow MapCollections to iterate past the end." 2017-03-08 12:18:28 +00:00
Narayan Kamath
b192344234 MathUtils: Remove static Random field.
This is unsafe because the random will be seeded in the zygote, which
means all processes on the system generate the same sequence of random
numbers. Fortunately, this code is only used in tests, so get rid of it.

Note that the Random that backs Math.random() is reseeded after every
fork to avoid a similar issue.

Bug: 35918685
Test: HwAccelerationTest
Change-Id: Ice79aa25bb9017f7a0b91659afe04112850cb74b
2017-03-08 10:07:03 +00:00
Eugene Susla
915b42bd95 Merge "Record app<->device association to xml file" 2017-03-08 02:16:13 +00:00
Andreas Gampe
19f1844e7e Merge "Framework: Ensure image heap string literals for Patterns" am: d0f092af84 am: 838851364b
am: 5fe3eb7696

Change-Id: Ia0bf25c740eedee436436e573241a59685db2fbd
2017-03-07 17:08:43 +00:00
Andreas Gampe
838851364b Merge "Framework: Ensure image heap string literals for Patterns"
am: d0f092af84

Change-Id: I69886924b3aca6c050239069c00e166142e2e522
2017-03-07 16:59:12 +00:00
Tobias Thierer
093572cd1b Don't allow MapCollections to iterate past the end.
Prior to this CL, MapCollections such as ArrayMap's entrySet,
keySet and values, exhibited unusual Iterator behavior:
 - instead of throwing NoSuchElementException once the end of
   the Collection was reached, Iterator.next() instead returned
   a null key / a null value / an entry with a null key and value.
 - however, remove() removed the last actual element of the
   Collection; successive calls of next(), remove() would
   result in successive elements being removed, in reverse
   iteration order.
 - Once the Collection had been cleared through calls to remove(),
   ArrayIndexOutOfBoundsException was thrown from iterator.next()
   (for keySet and values) or from iterator.remove (for entrySet).

This CL fixes those Collections' Iterators to let next() throw
NoSuchElementException when hasNext() would have returned false.
Since the new behavior was already guaranteed by the Iterator
documentation, any app compatibility effect from this CL is both
unlikely, and unlikely to be negative.

Bug: 19853326
Test: make cts && cts-tradefed run cts -m CtsUtilTestCases
Change-Id: Ie3f0594f434dd5625799791829bd94fbaef94906
2017-03-07 16:38:43 +00:00
Eugene Susla
47aafbe033 Record app<->device association to xml file
Bug: 30932767
Test: Ensure file not exists -> query associations -> ensure result is empty list
  Associate device -> cat xml file -> ensure record appears as extected
  Disassociate device -> cat xml file -> ensure record is no longer present
Change-Id: Ibe456a6d9292e05e2391f5138e43fdaa37f87e1b
2017-03-06 16:53:32 -08:00
Andreas Gampe
7f8466fab4 Framework: Ensure image heap string literals for Patterns
Do not use Pattern.toString to construct complex patterns. Instead,
make the string literals explicit so they can be compile-time
allocated, thus ending up as clean memory in the image heap.

Bug: 34956610
Test: m
Test: Device boots
Change-Id: I20d45c31243af00168553c218f75fb0795b55149
2017-03-03 09:38:58 -08:00
Romain Guy
95b52fd187 Make Half look like and behave like a boxed instance
Bug: 35765416
Test: HalfTest
Change-Id: I7ef52428f8b4e2c05b91d7eb37cc4cb5ecc5c6b9
2017-02-26 09:37:52 -08:00
Andy Hung
50fb1aebd7 Spline: Fix monotonicity constraint
Test: comparison of code to formula
Change-Id: Ie7c8b3a2a6bc64ea3c837a6674b55c07fe49e12b
2017-02-10 13:53:43 -08:00
TreeHugger Robot
b66cfe8a88 Merge "Added support to authentication." 2017-01-26 01:35:39 +00:00
Dianne Hackborn
c5d458930c Merge "Add some new experiment constants for activity and power manager." 2017-01-25 21:12:12 +00:00
Felipe Leme
436ab6a91d Added support to authentication.
AutoFillService can now require user authentication, both at
FillResponse and Dataset levels;
- FillResponse authentication is typically used when the user data
  need to be unlocked before the first use.
- Dataset authentication is typically used to unlock sensitive data
  such as credit card info.

The authentication can be handled by the service itself (for example,
when it uses the credit card CVV to unlock it) or by the Android
system (when the service asks for fingerprint authentication).

Bug: 31001899

Test: manual verification
Test: CtsAutoFillServiceTestCases passes

Change-Id: If62f42f697ab5ef0d14d991ff1077d1c38808e61
2017-01-25 13:03:32 -08:00
Mark Rathjen
8bd8564a18 Merge "Resolve Android security comments for Android ID migration." 2017-01-25 20:20:29 +00:00
Dianne Hackborn
0ef403e53e Add some new experiment constants for activity and power manager.
Activity manager now has constants, starting with two: bg check
and process limit.

Power manager now has constants, starting with one: controlling
disabling of wake locks from cached processes.

Test: manual

Change-Id: I05db42e2104e9d31584f85251412df2d5efb34b6
2017-01-24 18:23:45 -08:00
Mark Rathjen
7599f1366e Resolve Android security comments for Android ID migration.
- Use 32 byte key instead of 16 byte.
- Use HMAC-SHA256 instead of SHA256 for ssaid generation.
- Update HMAC with all package signatures.
- Use delimiter in between digest arguments.

This change will cause the ssaid of non-legacy installed apps (apps installed
post Android ID migration OTA) to change after an uninstall and reinstall sequence.

Bug: 34395671
Test: Unit tests, CTS tests, Manual tests
Change-Id: I19dec57947368ee5000c2c630b1e4030d46a4ab3
2017-01-23 19:06:41 -08:00