Commit Graph

588 Commits

Author SHA1 Message Date
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
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
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
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