Commit Graph

3135 Commits

Author SHA1 Message Date
Jeff Sharkey
7029a23b38 Merge "Defuse Bundles parsed by the system process." into nyc-dev am: c4b0ade
am: a0f6318

* commit 'a0f6318f44244ec4e916d3abecf157beb4fefc8c':
  Defuse Bundles parsed by the system process.
2016-03-17 18:54:28 +00:00
Jeff Sharkey
d136e51a99 Defuse Bundles parsed by the system process.
It's easy for apps to throw custom Parcelables into Bundles, but
if the system tries peeking inside one of these Bundles, it triggers
a BadParcelableException.  If that Bundle was passed away from the
Binder thread that delivered it into the system, we end up with a
nasty runtime restart.

This change mitigates this trouble by "defusing" any Bundles parsed by
the system server.  That is, if it encounters BadParcelableException
while unpacking a Bundle, it logs and delivers an empty Bundle as
the result.

Simultaneously, to help catch the system process sticking its
fingers into Bundles that are destined for other processes, a Bundle
now tracks if it's "defusable."  For example, any Intents delivered
through ActivityThread are marked as being defusable, since they've
arrived at their final destination.  Any other Bundles are considered
to be "in transit" and we log if the system tries unparceling them.

Merges several Parcel boolean fields into a flags int.  Add better
docs to several classes.

Bug: 27581063
Change-Id: I28cf3e7439503b5dc9a429bafae5eb48f21f0d93
2016-03-16 14:45:26 -06:00
Tony Mak
611bff36f8 Fix NotificationListenerService fail to mirror work notification am: 4dc008c
am: 63dbf9c

* commit '63dbf9c2165ae7963d857e396237864ebceab3ee':
  Fix NotificationListenerService fail to mirror work notification
2016-03-16 11:30:57 +00:00
Tony Mak
4dc008cda2 Fix NotificationListenerService fail to mirror work notification
1. Instead of getting application info in runtime, just retrieve the
   one in the context to avoid cross user operation.

2. Functions in PackageManager that retrieve badged icon now return
   badged icon if the targer user is managed profile instead of checking
   whether target user is a managed profile of the user in mContext.

3. Relax the restriction of getUserInfo, if the caller is asking a user
   in the same profile group or having the manage user permission, we let
   it go.

Bug: 26469166

Change-Id: Ia1ffc5743f7d94bd489cdb7571eaed51499ebdd9
2016-03-16 10:49:02 +00:00
Tao Bao
14c59725ae Merge "Don\'t reboot into recovery if block map file is missing." into nyc-dev am: 1b478f756a
am: 688b9e8a06

* commit '688b9e8a06a3ea88623d24acbabd234c336bfb31':
  Don't reboot into recovery if block map file is missing.
2016-03-15 22:10:09 +00:00
Tao Bao
36baafe92c Don't reboot into recovery if block map file is missing.
We added a third parameter to RecoverySystem.installPackage() to let the
caller to indicate the package has been processed (uncrypt'd). We need
to ensure the caller's claim is true by checking the existence of the
block map. Otherwise the device will fail for sure when booting into
recovery.

Bug: 27620932
Change-Id: I6325455253480055f14eb0cf020689ac37328602
2016-03-15 10:36:19 -07:00
Makoto Onuki
31ed48d735 Merge "Add a flag to log service side runtime exception" into nyc-dev am: 4b19f4a702
am: 5592d0ed7c

* commit '5592d0ed7cb7311cb85683c5e2604e43124abd41':
  Add a flag to log service side runtime exception
2016-03-11 23:58:40 +00:00
Makoto Onuki
f9b941f528 Add a flag to log service side runtime exception
Often during development I get runtime exceptions from system
server but I only see client side stacktrace on logcat, which is
pretty much inconvenient.

Change-Id: I9c60fd92f6008d2c3a7eaf848b89ce3f1dffbe8a
2016-03-10 17:19:08 -08:00
Dianne Hackborn
839ff816a5 Merge "DO NOT MERGE: Add separate information about user whitelist." into nyc-dev 2016-03-10 01:46:03 +00:00
Dianne Hackborn
262ae5c8eb DO NOT MERGE: Add separate information about user whitelist.
Use this in the alarm manager to allow user whitelisted apps
to have free access to scheduling alarms.

Coming next: lifting sync/job restrictions.

Bug #26851107: Allow user whitelist apps more freedom

(Cherry-picked to nyc since it got lost in the branch from master.)

Change-Id: I4dc9f07514627ebdb6b6eff7c7a749f2c51a3797
2016-03-09 17:39:40 -08:00
Joe Onorato
ca3cbc1d63 Merge "Add an API for apps to get their System Health / Battery Stats data." into nyc-dev am: 04a72a2a51
am: af2d5fb699

* commit 'af2d5fb699e18378190139411c87046fa07be092':
  Add an API for apps to get their System Health / Battery Stats data.
2016-03-10 01:02:12 +00:00
Joe Onorato
04a72a2a51 Merge "Add an API for apps to get their System Health / Battery Stats data." into nyc-dev 2016-03-10 00:52:03 +00:00
Joe Onorato
713fec85b8 Add an API for apps to get their System Health / Battery Stats data.
Change-Id: Ib27e1be469b826f6d83d73ce6024102bbdb1d47a
2016-03-09 15:47:24 -08:00
Jeff Sharkey
5b416edcff Merge "Log when pre-N apps send too much to DropBox." into nyc-dev am: 93720d5729
am: 7051cad205

* commit '7051cad205e3ea3269c51811f5586e165d533af0':
  Log when pre-N apps send too much to DropBox.
2016-03-09 23:39:22 +00:00
Jeff Sharkey
93720d5729 Merge "Log when pre-N apps send too much to DropBox." into nyc-dev 2016-03-09 23:31:01 +00:00
Jeff Sharkey
b8e8a91f54 Log when pre-N apps send too much to DropBox.
Once they target N, they'll start getting exceptions, which is
intended to make sure they pay attention to data that would have
otherwise been dropped on the floor.

Bug: 27571535
Change-Id: I49163679c629cd0788327d2c3a654e757ecdcb99
2016-03-09 16:27:42 -07:00
Makoto Onuki
108853ba12 Merge "ShortcutManager: add remaining APIs." into nyc-dev am: 4a07c34ca8
am: 027fd0ae95

* commit '027fd0ae9512b57ec13448d292609ad41ebd0bb6':
  ShortcutManager: add remaining APIs.
2016-03-09 22:35:38 +00:00
Makoto Onuki
4a07c34ca8 Merge "ShortcutManager: add remaining APIs." into nyc-dev 2016-03-09 22:28:45 +00:00
Paul Lawrence
8977af6dd9 Merge "Add API to IMountService to get encryption state" into nyc-dev am: d5a3f3df40
am: 3cb05abdb2

* commit '3cb05abdb2d702af01e84e54cfcaa3008d2116b6':
  Add API to IMountService to get encryption state
2016-03-09 13:57:20 +00:00
Paul Lawrence
d5a3f3df40 Merge "Add API to IMountService to get encryption state" into nyc-dev 2016-03-09 13:42:41 +00:00
Martijn Coenen
6e05f27bff Merge "API to query which cores are exclusively assigned." into nyc-dev am: 2612bbc0f5
am: a249556f80

* commit 'a249556f80a88aa359d44fd71d6c8163c6a5b064':
  API to query which cores are exclusively assigned.
2016-03-09 10:39:48 +00:00
Martijn Coenen
2612bbc0f5 Merge "API to query which cores are exclusively assigned." into nyc-dev 2016-03-09 10:31:03 +00:00
Makoto Onuki
5504622fb0 ShortcutManager: add remaining APIs.
- Icons are now persisted. (under /data/system_ce, as PNGs)
- the "load icon" APIs in LauncherApps are supported.
- Implement updateShortcuts()

- Addressed all the comments on the previous CL
- @hide the newly added constructor for PersistableBundle

- Enhance incoming shortcut validation
- A lot of internal clean-up.

Bug 27548047

Change-Id: I8e3c1ccd3e0a997a6d271c84d81170f0c022b60e
2016-03-08 18:37:32 -08:00
Paul Lawrence
20be5d6247 Add API to IMountService to get encryption state
Bug: 18002358
Change-Id: If7d9c9a5ed38ac37849fcf638ec10c76d2f419a1
2016-03-08 15:03:54 -08:00
Makoto Onuki
af00108ca4 resolve merge conflicts of 1ca3800c44 to master
Change-Id: I4657cdf99900cd555c3109605e8cbdbb0fed79e6
2016-03-08 10:39:25 -08:00
Martijn Coenen
cd4bdf3eb9 API to query which cores are exclusively assigned.
On devices with cpuset support, the foreground app
may have a core exclusively assigned to it. Add an
API that allows apps to query which core that is,
so it can use that to set scheduling affinity.

Bug: 27381794
Change-Id: Iea148776da6d7abb745ccf9e6ad5ad46491e340a
2016-03-08 13:09:32 +01:00
Makoto Onuki
6f7362d925 Introducing ShortcutManager
What's supported:
- Most APIs are implemented, except for SM.updateShortcuts(),
the icon APIs in LA, and LA.startShortcut().
- Persisting information, except for icons
- Throttling

In addition, now PersistableBundle has a public copy
constructor from a Bundle. (Do we want to @hide it?)

TODOs:
- Add icon support
- Implement missing APIs
- Listen to PACKAGE_* broadcasts and do clean-up
- Support multi-launcher apps (pinned shortcuts per launcher)
- Dev option to reset throttling
- Load throttling config from Settings
- Backup & restore
- Figure out LauncherApps permissions (BIND_APPWIDGETS??)
- Other minor TODOs in the code
- Better javadoc

Note: This requires Idf2f9ae816e1f3d822a6286a4cf738c14e29a45e

Bug 27325877

Change-Id: Ia5aa555a4759df5f79a859338f1dc5e624cd0e35
2016-03-04 15:24:49 -08:00
Dianne Hackborn
04d1031b8d Merge "Add APIs to find out the time when a process was created." into nyc-dev am: ef1971ffc5
am: 623ebce5fb

* commit '623ebce5fb9041968c324b418e029df85b13b61e':
  Add APIs to find out the time when a process was created.
2016-03-03 20:43:17 +00:00
Dianne Hackborn
ef1971ffc5 Merge "Add APIs to find out the time when a process was created." into nyc-dev 2016-03-03 19:47:56 +00:00
Vadim Tryshev
07522d52c2 Merge "Adding getManagedUserBadgedDrawableForDensity() to PackageManager." into nyc-dev am: c9f0a1103e
am: dfe2f7ce30

* commit 'dfe2f7ce30dcb40d013da982a975258186195e09':
  Adding getManagedUserBadgedDrawableForDensity() to PackageManager.
2016-03-03 02:09:25 +00:00
Dianne Hackborn
d98885c128 Add APIs to find out the time when a process was created.
Change-Id: Id0d12c377f278fec6e31a98eab0c865a23c006ec
2016-03-02 17:40:52 -08:00
Vadim Tryshev
c9f0a1103e Merge "Adding getManagedUserBadgedDrawableForDensity() to PackageManager." into nyc-dev 2016-03-03 00:28:17 +00:00
Eino-Ville Talvala
0fd379edd6 Merge "Camera2: Switch to auto-gen C++ binder interfaces" into nyc-dev am: 74989b4d3f
am: 72071de87c

* commit '72071de87c62717cc85937b319df8df10cf4b7e9':
  Camera2: Switch to auto-gen C++ binder interfaces
2016-03-02 23:08:24 +00:00
Vadim Tryshev
66ae66a7f7 Adding getManagedUserBadgedDrawableForDensity() to PackageManager.
It allows badging an image regardless of of the user (no
user id parameter). The styling for managed users is applied.

This is useful for new cases where the existing functions
wouldn't badge the icon, but we need it.

Bug: 25192539
Change-Id: I2fd2f226f626fb2e6cda1cfe072013350e12b41c
2016-03-02 14:55:04 -08:00
Eino-Ville Talvala
74989b4d3f Merge "Camera2: Switch to auto-gen C++ binder interfaces" into nyc-dev 2016-03-02 21:47:13 +00:00
Steve McKay
24dd9ad0c0 Merge "Always show intern storage." into nyc-dev am: b4672ef6df
am: 1788dfd223

* commit '1788dfd223c7c62005b8c1e98cd25737f685a912':
  Always show intern storage.
2016-03-02 20:32:39 +00:00
Steve McKay
b4672ef6df Merge "Always show intern storage." into nyc-dev 2016-03-02 18:49:28 +00:00
Steve McKay
7c4395804e Always show intern storage.
Only show debug root when devel mode is enabled.
Remove all traces of "advanced".

Bug: 27297398

Change-Id: Ie7e8be282531bd245351d56ababa8ca625c10fd2
2016-03-02 10:47:59 -08:00
Jeff Sharkey
d1be3e0bdf Merge "When system server goes down, crash apps more." into nyc-dev am: 60b7bcc614
am: 33a64f5e56

* commit '33a64f5e5600d86ef6ce270ce57fffbf4f2ab35d':
  When system server goes down, crash apps more.
2016-03-02 06:57:26 +00:00
Fyodor Kupolov
3fa9f47147 Merge "Disable switching users if the user is in a call" into nyc-dev am: 285bec2641
am: cef5ba5adc

* commit 'cef5ba5adc070e31fb1a568bd8c48b5d631f1cf4':
  Disable switching users if the user is in a call
2016-03-02 06:03:15 +00:00
Jeff Sharkey
c53962d4ed When system server goes down, crash apps more.
Apps making calls into the system server may end up persisting
internal state or making security decisions based on the perceived
success or failure of a call, or the default values returned.

The reality is that if the system process just died, init will be
along shortly to kill all running apps, so we should have no problem
rethrowing the RemoteException as a RuntimeException.

Bug: 27364859
Change-Id: Ife0bcb079636c88d54c44d17eb580409fd79028b
2016-03-01 19:29:16 -07:00
Eino-Ville Talvala
5d2d7788f1 Camera2: Switch to auto-gen C++ binder interfaces
- Move camera AIDL files to frameworks/av
 - Update makefiles to point to new AIDL locations
 - Adjust camera2 implementation to match modifications to AIDL needed
   for native AIDL auto-generation
 - Move Surface.aidl to frameworks/native to allow use in
   native AIDL. Use android::view::Surface in Surface JNI to
   serialize Surface objects to ensure parceling compatibility.
 - Adjust service binder tests to new interface

Bug: 25091611
Change-Id: I85b817374b34a4540fa145328dbe4bbf7f746baf
2016-03-01 17:15:17 -08:00
Fyodor Kupolov
285bec2641 Merge "Disable switching users if the user is in a call" into nyc-dev 2016-03-01 23:21:29 +00:00
Felipe Leme
a917f1b5fd Merge "Created metric events for scoped directory access API." into nyc-dev am: c50bf8e33e
am: 8127a3cd75

* commit '8127a3cd751aacaa9f9d89dcedeb6cb254c006ff':
  Created metric events for scoped directory access API.
2016-03-01 20:27:59 +00:00
Calin Juravle
75a54f3e04 Merge "Restrict the cases when we profile guided compile an apk" into nyc-dev am: e1ac71fe99
am: 48175a5959

* commit '48175a59590a7e3f49bc3dabeea6602c5aa9b230':
  Restrict the cases when we profile guided compile an apk
2016-03-01 19:52:14 +00:00
Felipe Leme
c50bf8e33e Merge "Created metric events for scoped directory access API." into nyc-dev 2016-03-01 18:58:28 +00:00
Felipe Leme
3e166b27fc Created metric events for scoped directory access API.
BUG: 27334821
Change-Id: I8a1bfc328dcd26b42bb66884d14b34ad11aa232f
2016-03-01 10:12:58 -08:00
Calin Juravle
e1ac71fe99 Merge "Restrict the cases when we profile guided compile an apk" into nyc-dev 2016-03-01 17:59:20 +00:00
Jeff Sharkey
3541354007 Merge "Parcelable classes should always be final." into nyc-dev am: 753c347efd
am: 620ef3f226

* commit '620ef3f22654676cd37df23db059a71e0607d6a9':
  Parcelable classes should always be final.
2016-03-01 00:12:20 +00:00
Jeff Sharkey
753c347efd Merge "Parcelable classes should always be final." into nyc-dev 2016-03-01 00:02:43 +00:00