Commit Graph

600 Commits

Author SHA1 Message Date
Tomasz Mikolajewski
7182514d8b Merge "Add support for opening JAR/ZIP files via FD." 2016-10-31 05:55:54 +00:00
Tomasz Mikolajewski
5a5c44a2e3 Add support for opening JAR/ZIP files via FD.
Test: Upcoming change in DocumentsUI uses this feature.
Bug: 31783726
Change-Id: Ia74e9bdb66722dfb2855380375a99cc94d288b2e
2016-10-28 11:23:20 +09:00
Romain Guy
de0a3a893f Add a half-precision floating point type
Denormals are fully supported.

This will be useful to store wide-gamut colors in a compact form
(a full RGBA color can be stored in a long using half floats for
each component).

Test: cts-tradefed run singleCommand cts-dev --module CtsUtilTestCases --test android.util.cts.HalfTest
Change-Id: I7e071edd2b66fdf6b375ce0e3e1a72ec3fb635b5
2016-10-22 02:26:32 -07:00
Adam Lesinski
5dc0782254 Update DisplayMetrics even on default display am: 4309721843 am: dab7950d80
am: d7ec1ea697

Change-Id: Iad9907c77fb1b7b81073150807d6f18a75a24d6e
2016-10-14 22:49:40 +00:00
Adam Lesinski
d7ec1ea697 Update DisplayMetrics even on default display am: 4309721843
am: dab7950d80

Change-Id: I8bb2c9c303380abd3e1a54af68b8a8f7da3225f7
2016-10-14 22:41:35 +00:00
Adam Lesinski
4309721843 Update DisplayMetrics even on default display
Fix a bug where the DisplayMetrics wouldn't be updated for a Resources
object on the default display. Since multi-window, we want to update
all Resources.

This didn't always manifest itself due to recreation of assets, which
would force an update of DisplayMetrics. Re-use of an AssetManager from
the cache would expose the bug.

Bug:32133693
Bug:31998629
Test: cts-tradefed run cts --module CtsServicesHostTestCases
Change-Id: Ic51ab82710517b87eb995ccf982085dba876ad58
2016-10-14 18:16:18 +00:00
Joe Onorato
6c9547d8e1 Add android.util.proto package as an @TestApi.
The classes there add a way for the platform to write out
protocol buffers that doesn't require lots of small objects,
generate code, and extra copying.

Includes the plugin for protoc to generate the constants.

Test: proto cts tests

Change-Id: I6385c198cecda9ac6fa533151609e3ace341af01
2016-10-12 16:37:18 -07:00
Hugo Benichi
de310dba78 Better LocalLog
This patch fixes the following issues in LocalLog:
  - reverseDump() uses a descending iterator with linear complexity
    instead of a quadratic loop using get(index) on a linked list.
  - reverseDump() is added to ReadOnlyLocalLog.
  - synchronized section in log() is restricted to mutation of internal
    list.
  - formatting of the log message does not create an internal
    StringBuilder.
  - the instance variable mNow is removed: it was only used inside log()
    as a local variable.
  - remaining instance variables are qualified with final.
  - the linked list is replaced by a fixed capacity array-backed queue.

Test: added unit tests
Change-Id: I1a54f0ad26dd35448d3297ea24df1fd626d20ef3
2016-10-11 09:54:19 +09:00
John Reck
32995223a8 Convert utils fastjni -> @FastNative
Test: builds & boots, refactor no behavior change
Change-Id: Ieb569a70fd05b88a8d2bd7b285099c1fc1888a75
2016-10-10 07:59:25 -07:00
Svet Ganov
5d09c998a0 Backup account access grants
Sync adapters without an account access cannot run until the
user approves the account access (for the case the account
access is not allowed by other policy such as being singed
with the same cert as the authenticator). If the sync adapter
does not have permission to access the account we ask the
user to grant access and take a note. This CL adds backup
for the explicit user grants.

bug:31162498

Change-Id: I31e3f3d010475352c7c54255ac2d3a2fed4d0c72
2016-09-21 14:01:02 +00:00
Svet Ganov
171b77b91e [DO NOT MERGE] Backup account access grants am: 72ed12c55f
am: 0dc4ff0753

Change-Id: Ic6ad395f958b2e09d66467f41bd40e84c34851b9
2016-09-10 00:28:50 +00:00
Svet Ganov
72ed12c55f [DO NOT MERGE] Backup account access grants
Sync adapters without an account access cannot run until the
user approves the account access (for the case the account
access is not allowed by other policy such as being singed
with the same cert as the authenticator). If the sync adapter
does not have permission to access the account we ask the
user to grant access and take a note. This CL adds backup
for the explicit user grants.

bug:31162498

Change-Id: I31e3f3d010475352c7c54255ac2d3a2fed4d0c72
2016-09-09 10:16:57 -07:00
Svetoslav Ganov
388d08b6e3 resolve merge conflicts of a2c1196 to master
Change-Id: I221f03e2cda9e677199698d492d16788c25c9e96
2016-08-31 18:02:57 -07:00
Svetoslav Ganov
a2c1196dc2 Properly close fd backing a MemoryIntArray am: fe2462f3a6
am: b7be22cdaf

Change-Id: Ie598d2310fff4d72f618ecfa9e2efae78c595a10
2016-08-31 01:04:00 +00:00
Svetoslav Ganov
b7be22cdaf Properly close fd backing a MemoryIntArray
am: fe2462f3a6

Change-Id: Iaf35af209d210ba0aa6239bdeb0c81a079d25543
2016-08-31 00:56:32 +00:00
TreeHugger Robot
43896cbc02 Merge "Properly close fd backing a MemoryIntArray" into nyc-mr1-dev 2016-08-31 00:49:42 +00:00
Svetoslav Ganov
fe2462f3a6 Properly close fd backing a MemoryIntArray
Use ParcelFileDescriptor only as an IPC transport
to make sure MemoryIntArray manges its backing fd.

Bug:30310689

Change-Id: Ib3cc13ef4ae2a744e5f7a96099570e0431847bce
2016-08-30 02:26:19 +00:00
TreeHugger Robot
65bbb6fb09 Merge "resolve merge conflicts of 5827257 to master" 2016-08-29 21:46:44 +00:00
Colin Cross
649bfd3dc3 resolve merge conflicts of 5827257 to master
Change-Id: I0077b6991584fc33dcb1ca1aadb634ce930fef3a
2016-08-29 12:50:47 -07:00
Svet Ganov
9d723d3d57 Polish MemoryIntArray
1. Add close guard
2. Adopt instead of clone the ahsmem fd to fix a dangling fd
3. Clear only the return flag when writing fd to parcel
4. Immediately destroy remote MemoryIntArray if stale
5. Throw Java exception if someone closed the fd under us

Change-Id: I85533fec336c40e3380e10d5448e18c9616ec341
2016-08-29 10:51:08 -07:00
Dianne Hackborn
5827257521 Try to mitigate issue #31016187: system_server crash in ArraySet. am: 92aa4b2ba3
am: d43d248848

Change-Id: Ie499c3b715325c23fc5b85442f742453df14e471
2016-08-25 17:30:33 +00:00
Dianne Hackborn
92aa4b2ba3 Try to mitigate issue #31016187: system_server crash in ArraySet.
Instead of crashing, log a wtf and recover.  This is not a problem
in ArraySet, but caused by someone else using an ArraySet without
protecting access to it.  So whoever is calling at this point is
not the cause, and it isn't worthwhile to let them crash.

Change-Id: Iaefa4315b620c9fe24b31507e4aa47a8525c8540
2016-08-25 10:12:02 -07:00
Aurimas Liutikas
f2a45b269d Clean up style issues in ArraySet.
Clean up style issues in preparation to copying ArraySet
implementation to support library.

Fixed:
- Missing spaces around operators, casting
- Added curly braces around if statements that span multiple lines
- Renamed static variables to follow sFoo instead of mFoo
- Moved = to the previous line

Bug: 19109652
Change-Id: Id9a985723b158f51811b3cd796613d0e26fd7e61
2016-08-19 16:36:19 -07:00
Philip P. Moltmann
a01bda837b Allow calls to TimedRemoteCaller in parallel.
Before the second thread canceled the call from the first thread as the
awaitedSequenceId was set to the second thread.

Change-Id: I7de709dee260a009761e0a3e73f3fe0695d2da2a
2016-08-12 14:19:18 -07:00
Neil Fuller
35f46b890d Merge "Add a finalize() method to StrictJarFile" am: d0c0c8dcab am: 2ffb7ebae2 am: f952f52013
am: ce78eb6b45

Change-Id: Ic622fe2adabfed18a6481f8d32685e37f3fe24b0
2016-08-09 11:07:17 +00:00
Neil Fuller
ce78eb6b45 Merge "Add a finalize() method to StrictJarFile" am: d0c0c8dcab am: 2ffb7ebae2
am: f952f52013

Change-Id: I0a621a83670f326d218fe3f77bc5fe9bbad6ea6c
2016-08-09 11:02:07 +00:00
Neil Fuller
f952f52013 Merge "Add a finalize() method to StrictJarFile" am: d0c0c8dcab
am: 2ffb7ebae2

Change-Id: Ie947e8447ecd8e9a61b6d1115174180e41d74311
2016-08-09 10:54:32 +00:00
Neil Fuller
2ffb7ebae2 Merge "Add a finalize() method to StrictJarFile"
am: d0c0c8dcab

Change-Id: Iccab49c98b105aff6105e21274fbc099d10ecb55
2016-08-09 10:49:58 +00:00
Neil Fuller
b69f61472a Add a finalize() method to StrictJarFile
Bug: 25896372
Test: Booted device, installed CTS apps
Test: run cts --class android.util.cts.StrictJarFileTest
Change-Id: I35e238dadd48d2c4ca53ac37a4c5aacdd471a93a
2016-07-29 14:26:35 +01:00
Tejas Khorana
0a7b51a28f Merge "indexOfValue now uses .equals (cont.)" 2016-07-18 20:02:11 +00:00
Tejas Khorana
fb5166dafb indexOfValue now uses .equals (cont.)
Addresses same issue addressed in SparseArray in LongSparseArray in
the method: indexByValue. Made a new method indexByValueByValue that
compares objects using .equals instead of ==.

Change-Id: I55735fe7ca364d0a9caab2a6909c2eaede845619
2016-07-18 12:03:14 -07:00
Tejas Khorana
ac01f6c65b Merge "indexOfValueByValue now uses .equals" 2016-07-18 17:29:50 +00:00
Tejas Khorana
f3b09b9c54 indexOfValueByValue now uses .equals
To address the issue that indexOfValue does not compare objects by
value (using .equals). I have made a method that does the indexOfValue
operation but instead comparing Objects using equals. New method created
as it was too late to change indexOfValue itself.

Change-Id: Ie58ce279aca74ef25ce151d8f8bde769f644f0d0
2016-07-15 10:51:18 -07:00
Felipe Leme
30635df7cb Merge \\\"Removed warning when objects are added on wrong order.\\\" into nyc-dev am: a98e4512df am: 620936768f
am: a22f5a3fb4

Change-Id: I744e2febd16c65c58b7313e704d26d03adc6be9c
2016-06-30 23:51:12 +00:00
Svetoslav Ganov
a22f5a3fb4 Merge \\"Removed warning when objects are added on wrong order.\\" into nyc-dev am: a98e4512df
am: 620936768f

Change-Id: I6986568b24bb4122452314d412b0f3d6422c61b4
2016-06-30 23:44:34 +00:00
Felipe Leme
7524b13642 Merge \"Removed warning when objects are added on wrong order.\" into nyc-dev
am: a98e4512df

Change-Id: Ic93707d6cda6dbdeed851f216eedbd4333d483ae
2016-06-30 23:37:24 +00:00
Felipe Leme
7709041c99 Removed warning when objects are added on wrong order.
append() is used to optimized insertions in the array, but it must
preserve the order of the hashcode array; when it doesn't, it falls back
to append(), but it should not log a warning message

In particular, PendingIntentRecords might have different hashcodes
across different processes.

Fixes: 29912192
Change-Id: I0ab566249829ddb934fd51cf21399b68cb286bd5
2016-06-30 23:19:08 +00:00
Svet Ganov
7f344e4c9c Merge \\\"Mark app pending intents in notification extras\\\" into nyc-dev am: b2cd9c95bf am: 5f7f3fa7a9
am: dc162dde07

Change-Id: I42000bbb614139ee3f0d9a9fcee7f460e52661f8
2016-06-28 00:57:00 +00:00
Svetoslav Ganov
dc162dde07 Merge \\"Mark app pending intents in notification extras\\" into nyc-dev am: b2cd9c95bf
am: 5f7f3fa7a9

Change-Id: Id4bc3ae0c1d79174a22d669dccab3391c231357d
2016-06-28 00:52:01 +00:00
Svet Ganov
7878e736f7 Merge \"Mark app pending intents in notification extras\" into nyc-dev
am: b2cd9c95bf

Change-Id: Idb515255f224c23d60a513713d9e4f93decd7a9c
2016-06-28 00:46:55 +00:00
Svet Ganov
ddb948896c Mark app pending intents in notification extras
We need to make every peniding intent that went in the notification
system to allow special handling of such intents when fired by a
notification listener. If a pending intent from a notification
is sent from a notification listener, we white-list the source app
to run in data saver mode for a short period of time. The problem is
that actions and the notificaion can have extras which bundles may
contain pending intents but the system cannot look into the bundles
as they may contain custom parcelable objects. To address this we
keep a list of all pending intents in the notification allowing
the system to access them without touching the bundle. Currently
the pending intents are written to the parcel twice, once in the
bundle and once as the explicit list. We can come up with a scheme
to optimize this but since pending itents are just a binder pointer
it is not worth the excecise.

bug:29480440

Change-Id: I7328a47017ca226117adf7054900836619f5679b
2016-06-27 17:32:25 -07:00
Erik Wolsheimer
28a04413b8 Merge \\"Add DENSITY_260, DENSITY_300, DENSITY_340\\" into nyc-mr1-dev am: e37ee119c2
am: 4d4d4706ab

Change-Id: Ib807e30b2c8ea58592df33ceb9d1e1344e7dce04
2016-06-15 22:58:23 +00:00
Erik Wolsheimer
178bba4589 Add DENSITY_260, DENSITY_300, DENSITY_340
Add supported screen densities to closer match some hardware's physical specifications

BUG: 24132725
Change-Id: I7138d92fa4e1f4320f9068e154bd8318ac0c45c7
2016-06-15 10:33:09 -07:00
Chet Haase
d9e7d25fc2 Merge "Fixed rounding logic in TypedValue to handle negative values correctly" 2016-06-09 00:31:02 +00:00
Chet Haase
724792d0cf Fixed rounding logic in TypedValue to handle negative values correctly
Simple rounding by +.5 doesn't work for negative values. one-line fix.

Issue #26884580 Resources#getDimensionPixelSize rounds incorrectly for negative values

Change-Id: Ib2314f7e50320dde87d4c5035a59b49e8f015eaf
2016-06-07 16:08:35 -07:00
Alex Klyubin
f3f2ad3819 Merge "Merge "Use correct cert chain from PKCS#7 SignedData block." into nyc-dev am: 7fe19060cf am: 815c681f42" into nyc-mr1-dev-plus-aosp
am: be28ebecb1

* commit 'be28ebecb19778e3731bca4ab13a3eeb1799be7d':
  Use correct cert chain from PKCS#7 SignedData block.

Change-Id: I4407764b81619e091837481b037a6c2a0849f7a8
2016-06-02 00:30:09 +00:00
Alex Klyubin
7fe19060cf Merge "Use correct cert chain from PKCS#7 SignedData block." into nyc-dev 2016-06-01 21:55:05 +00:00
Dianne Hackborn
5101b95710 resolve merge conflicts of e174476 to master
Change-Id: I4005cf91b8a6bf3faa2301d8ce97ab1ad5eed94f
2016-06-01 12:01:38 -07:00
Dianne Hackborn
e9a988caca Work on issue #28942589: Tune job scheduler
We now have a new settings key that provides all of the existing
tuning parameters, plus some newly redone ones for dealing with
different memory levels.

Changed the minimum batching for overall jobs from 2 to 1, so
we will never get in the way of immediately scheduling jobs
when the developer asks for this.  We should now be able to rely
on the doze modes to do better batching of jobs for us when it
is really important.

Also work on issue #28981330: Excessive JobScheduler wakeup alarms.
Use a work source with scheduled alarms to blame them on the app
whose job they are being scheduled for, and add a check for whether
a job's timing constraint has been satisfied before considering it
a possible candidate for the next alarm.  (If it is satisified,
the time is in the past, so we should not schedule an alarm for it.)

Finally clean up a bunch of the dumpsys output to make it easier
to understand.

Change-Id: I06cf2c1310448f47cf386f393e9b267335fabaeb
2016-05-31 18:16:19 -07:00
Alex Klyubin
29045203f3 Use correct cert chain from PKCS#7 SignedData block.
This fixes a bug where APK JAR signature verifier returned the wrong
certificate chain. Rather than returning the cert chain of the
verified SignerInfo, it was returning the bag of certs of the PKCS#7
SignedData block.

This issue was introduced in Android N and thus does not affect
earlier Android platform versions.

Bug: 29055836
Change-Id: I684c0f8e9ff47b922030645e07b6a114c0eb0963
2016-05-31 16:10:00 -07:00