Commit Graph

576 Commits

Author SHA1 Message Date
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
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
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
The Android Automerger
1ec2fd72ce stephenli@ manually merge many commits up to '032dcff'
* commit '032dcff': (22 commits)
  Remove outdated google services links.
  Fix misc-macro-parentheses warnings in services jni.
  Fix misc-macro-parentheses warnings in hwui and graphic jni.
  Fix misc-macro-parentheses warnings in aapt and androidfw.
  docs: Update to column widths for Complications table
  Fix a11y crash when window layer isn't unique.
  Never set resized while not drag resizing for pinned stack.
  While turning OFF do not honor ON requests.
  Fix GATT autoConnect race condition
  Fix GATT autoConnect race condition
  Fix RTL issue in delete dialog.
  Incorporate feedback on new wallpaper-related APIs
  Mapping up/down of legacy Gps vs. Gnss Status
  Fixed a bug where the chronometer was invisible
  Fixed a bug where the chronometer wasn't updating the time
  Update BlockedNumberContract javadocs.
  [RenderScript] Fix ScriptIntrinsicBlur documentation.
  Update documentation about copyTo and copyFrom.
  DO NOT MERGE Cherry pick libpng usage fixes
  Start the Wear Time System Service with SystemServer
  ...
2016-05-19 23:51:32 +00:00
Phil Weaver
227d33439d Merge "Fix a11y crash when window layer isn't unique." into nyc-dev 2016-05-19 21:50:29 +00:00
Phil Weaver
adaafb2980 Fix a11y crash when window layer isn't unique.
TalkBack is seeing crashes that I can only explain by our assumption
that window layer is unique in all cases. TalkBack reports that it
happens during animation, so I assume that the layer may repeat
transiently.

Reducing our dependence on this assumption by traversing the list of
windows sorted by layer without assuming that the list has the same
length as the list of unsorted windows.

Also documenting the undefined behavior of SparseArray when indexing
beyond its bounds. The undefined behavior itself is intentional for
performance reasons.

Bug: 28679528
Bug: 28815817
Change-Id: I0c9f90b0b458b4cde465f603ba204fe6691e5c2c
2016-05-19 13:32:24 -07:00
Yohei Yukawa
af15c8bcae Merge "Move LocaleList to avoid layering violation." into nyc-dev am: 31884efd13 am: ddaf3f4681
am: bf4c8f730b

* commit 'bf4c8f730b167e5ee65ed7c59dfa1d7867b63fcc':
  Move LocaleList to avoid layering violation.

Change-Id: I78fee5269f7428e34b196573575784fc15cb1372
2016-05-18 02:25:10 +00:00
Yohei Yukawa
23cbe85610 Move LocaleList to avoid layering violation.
Since LocaleList needs to depend on android.os.Parcelable, we cannot let
that class belong to "android.util" package, which causes layering
violation.

Bug: 28819696
Change-Id: Ia8de2ee9df3dd0a42b1fe84574439519b680fe18
2016-05-17 16:42:58 -07:00
Svetoslav Ganov
582ed22116 Merge "Make settings cahches generation mechanism robust." into nyc-dev am: b35301e421 am: d361bbd0db
am: 7cd6a970c0

* commit '7cd6a970c047c06c196cb351d00584180806351e':
  Make settings cahches generation mechanism robust.

Change-Id: I2181d6f48052e4ae3204e39bfb050387065a7fcc
2016-05-13 22:31:32 +00:00
Svetoslav Ganov
04df738bcb Make settings cahches generation mechanism robust.
Settings is using a MemoryIntArray to communicate the settings table
version enabling apps to have up-to-date local caches. However, ashmem
allows an arbitrary process with a handle to the fd (even in read only
mode) to unpin the memory which can then be garbage collected. Here we
make this mechanism fault tolerant against bad apps unpinning the ashmem
region. First, we no longer unpin the ashmem on the client side and if
the ashmem region is purged and cannot be pinned we recreate it and
hook up again with the local app caches. The change also adds a test
that clients can only read while owner can read/write.

bug:28764789

Change-Id: I1ef79b4b21e976124b268c9126a55d614157059b
2016-05-13 15:14:14 -07:00
Raph Levien
779869cabf Merge "Make LocaleList constructor non-nullable" into nyc-dev am: 4d826831b5 am: c29bc443f8
am: 16e416ec69

* commit '16e416ec69cb281e669c2f38833de33ebaf22962':
  Make LocaleList constructor non-nullable

Change-Id: I4536dacdd94329f2ab8fecef6f5e868d6895b1fd
2016-05-03 00:38:48 +00:00
Raph Levien
10ea92aefa Make LocaleList constructor non-nullable
This commit makes the LocaleList constructor require non-null
arguments in all cases, and fixes all uses of LocaleList that could
previously pass a null to use getEmptyLocaleList() instead (which is
preferred anyway becaues it avoids an allocation.

Bug: 28460668
Change-Id: I4b8b3cfa82914412731c2b79003951c46cb2afa1
2016-05-02 12:57:56 -07:00
The Android Automerger
8bdf39e19c Manually merge branch 'nyc-mr1-dev-plus-aosp' to fix automerger blockage b/28407115 2016-04-27 17:58:24 +00:00
Clara Bayarri
4dc63f78a9 Merge "Cleanup LocaleList docs given API review" into nyc-dev 2016-04-27 15:32:58 +00:00
Clara Bayarri
66f6bd32d8 Cleanup LocaleList docs given API review
-- Remove default constructor from public API since getEmptyLocaleList exists
-- Merge the Locale and Locale[] constructors by providing a single Locale… varargs constructor
-- forLanguageTags, get, toLanguageTags, size, need docs
-- get(int location) should be get(int index)

Plus general docs improvements

Bug: 28296200
Change-Id: I8b4e67184f8c723daebcd251f04947d48bbb5478
2016-04-27 14:55:45 +01:00
Svet Ganov
db2174dcb8 Merge "Ensure local settings caches are not stale" into nyc-dev am: f71d7fe am: d4bc15b
am: 0010741

* commit '0010741818127e6c9449fc49490f0bad14a76240':
  Ensure local settings caches are not stale

Change-Id: I26c4f1f72eda3b2ebfb3ca6e086a0381d357471c
2016-04-26 18:54:37 +00:00
Svet Ganov
53a441ca8e Ensure local settings caches are not stale
We used the system proterties as a shared memory mechanism
to propagate information to local settings caches when the
content has changed and the cache should be cleared. The
system properties are unfortunately updated asynchronously
leading to cases where clients may read stale data.

This change adds a simple int array data structure backed
by shared memory which guarantees individual values are
atomically read and updated without memory tear. Multi-
index opearations are not synchronized between each other.

The settings provider is using the new data structure to
propagate the settings generation which drives when caches
are purged.

We have a single memory array keeping the generation for
different settings tables per user. Since memory array is
not a compact data structure and the user space exceeds
the memory array size we use an in-memory map from keys
to indices in the memory array where the generation id of
a key is stored. A key is derived by the setting type in
the 4 most significant bits and the user id in the 28 least
significant bits.

The mapping from a key to an index is cleared if the user is
removed and the corresponding index in the memory arry is
reset to make it available for other users. The size of the
memory array is derived from the max user count that can be
created at the same time.

bug:18826179

Change-Id: I64009cc5105309ef9aa83aba90b82afc8ad8c659
2016-04-26 11:31:55 -07:00
Siyamed Sinir
5932e8b8f0 Update autoLink URL regex to match empty path, $ and _
Update URL regular expression to match
- path and query that contains dollar sign
- domain name that contains underscore
- empty path with query parameters. i.e. a.com?q=v

Bug: 27436084
Bug: 27501264
Change-Id: I3884624e145ccc1175915327dc2f280ef4e55ce1
2016-04-13 20:10:47 +00:00
Siyamed Sinir
7903aba3ca Fix Patterns.UCS_CHAR character class
Wrap Patterns.UCS_CHAR character class with brackets. Previously CL
Ie6df818dc4d33dfee6ee54432a2231cca51ec423 broke autoLink email and URL
patterns while excluding the empty spaces.

Bug: 28020781
Change-Id: Ieb7d09cb5e544c1e7cbc1a4d665b979c65e7e773
2016-04-11 18:45:29 -07:00
Siyamed Sinir
4b92594857 Merge "Exclude unicode space characters from autoLink URL patterns" into nyc-dev 2016-04-12 00:35:29 +00:00
Doris Liu
0a1a5167be Improve error logging for parsing failures
Bug: 27043594
Change-Id: I901b65f734c49444a78e0714e007e15e2340ab9d
2016-04-08 18:01:54 +00:00
Siyamed Sinir
911c2694e2 Exclude unicode space characters from autoLink URL patterns
Excludes the following space characters from autoLink URL patterns:
\u00A0: no-break space
\u2000: en quad
\u2001: em quad
\u2002: en space
\u2003: em space
\u2004: three-per-em space
\u2005: four-per-em space
\u2006: six-per-em space
\u2007: figure space
\u2008: punctuation space
\u2009: thin space
\u200A: hair space
\u2028: line separator
\u2029: paragraph separator
\u202F: narrow no-break space
\u3000: ideographic space

Bug: 28020781
Change-Id: Ie6df818dc4d33dfee6ee54432a2231cca51ec423
2016-04-05 16:33:58 -07:00
Alex Klyubin
3a21805aa1 Merge "Remove support for DSA with SHA-512 from v2 sig verification." into nyc-dev 2016-03-31 20:46:04 +00:00
Alex Klyubin
dfb5772447 Remove support for DSA with SHA-512 from v2 sig verification.
Android platform does not support DSA with SHA-512. Thus, it does not
make sense to support this unsupported algorithm in APK Signature
Scheme v2.

Bug: 24331392
Change-Id: Ie90b3dd8dd67bad65c64dfb7f6bf427e8ed282ba
2016-03-31 12:06:18 -07:00
Jeff Sharkey
7732e1e544 Fix RootsCache invalidation bugs.
When RootsCache is still running and it detects a provider/package
change, it needs to force reload roots.  Also fix cache invalidation
bug in ContentService to allow for Uri prefix matches.

Mark internal storage broadcasts with flag to bypass new background
checks.

Bug: 27759529
Change-Id: I9d9c6fe15d8640ff56ae7214afb3bac673682c28
2016-03-30 17:14:25 -06:00
Alex Klyubin
9b59bc459b Ignore signature stripping protection for preinstalled APKs.
The current build process may currently strip APK Signature Scheme v2
signatures from prebuilt APKs to be installed on the system or vendor
partitions. However, it leaves intact the signature scheme rollback
protections introduced by APK Signature Scheme v2. Due to a bug, when
the system extracts signer certificates from preinstalled APKs, it
encounters the rollback protection and aborts the extraction process.
This manifests itself as some preinstalled packages not appearing as
installed.

This change makes the system ignore signature scheme rollback
protections when extracting certificates from preinstalled APKs. This
is fine because the process of extracting certificates from
preinstalled APKs does not care about validity/integrity of signatures
and the APKs. It only cares about extracting signer certificates.

Bug: 27829513
Change-Id: I3bed463e776b057e93a0fce915db4014946be1f9
2016-03-24 12:02:20 -07:00
Alex Klyubin
0722ffcd06 Unbreak verifying v2 signatures of large APKs.
The original implementation of APK Signature Scheme v2 verification
mmapped the whole APK. This does not work on devices with limited
amount of contiguous free logical memory, especially on 32-bit
devices where logical address space is relatively small. For example,
a 500 MB APK is unlikely to mmap on a Nexus 6.

This commit fixes the issue by switching the verification strategy
to mmapping each individual 1 MB chunk of the APK, digesting it, and
then immediately munmapping. This is about 5-10% slower than mmapping
the whole APK in one go.

Bug: 27613575
Change-Id: I4167d5a7720c1bb87a0edad5d4f2607f7d554b56
2016-03-18 17:08:46 -07:00