Commit Graph

2946 Commits

Author SHA1 Message Date
Jeff Sharkey
a73b8fd1f4 Add some TestApis to fix build.
Change-Id: Icf0d8d63f3a41d99e46ebe96003863bae637bd9d
2016-01-06 17:37:32 -07:00
Benjamin Franz
b6c0ce4ac9 Allow device and profile owner to modify accounts
The user restriction DISALLOW_MODIFY_ACCOUNTS and the policy
DPM.setAccountManagementDisabled can now be circumvented by a device
or profile owner. This allows the device or profile owner to add
accounts without briefly having to remove the policy.

Bug: 22030831
Change-Id: I2b59c4b3ad354287d7a00f21b2afef072d12517d
2015-12-22 15:50:30 +00:00
Daichi Hirono
e442872eaa Merge "Unmount appfuse when the device FD is closed." 2015-12-22 05:31:57 +00:00
Daichi Hirono
91e3b50636 Unmount appfuse when the device FD is closed.
The CL lets MountService to observe device FD, and request unmount to
vold when the device FD was closed, or remote application providing
appfuse is crashed.

BUG=25756420

Change-Id: I7990694d32affa7f89e3f40badb25098d74d744d
2015-12-22 13:41:33 +09:00
Jeff Sharkey
5b0e5207e1 Point "unlocked" logic at lower level.
There is a race when starting a non-encryption-aware launcher before
we've gone through the user lifecycle to enter the "running unlocked"
state.  This can cause the launcher to choke when it's denied access
to widgets that are still considered locked.

For now, relax the notion of a user being unlocked to reflect the
on-disk state, instead of looking at the user lifecycle.

Also add logging of encryption commands.

Bug: 26267450
Change-Id: Ie330d07418cf10413e0b4380f6d6781684f01952
2015-12-18 19:06:54 -07:00
Jeff Sharkey
2527e2bf15 Merge "Allow library spec and app configs to be read from odm partition" 2015-12-18 16:34:26 +00:00
Jeff Sharkey
0999c0d6e9 Make printing framework encryption-aware.
Only create UserState objects when a user has been unlocked, meaning
we can connect to the spooler.  Ignore package events that occur
while a user is locked, since we'll kick off updateIfNeededLocked()
when that user is eventually unlocked.

In all other cases, throw if someone tries obtaining UserState for
a still-locked user.  This should help catch any edge cases in the
system, and communicate clearly through public APIs that printing
isn't available until the user is unlocked.

Bug: 26246836
Change-Id: If15744621890baee206d355484fe20933afc65d8
2015-12-17 15:12:26 -07:00
Samuel Tan
a6d4744e89 Merge "Add comments to keep Java and native binder PersistableBundle in sync" am: 6de926a7d6
am: 4981ae9083

* commit '4981ae908349767fee7976cc82c54a7fb00ee4fd':
  Add comments to keep Java and native binder PersistableBundle in sync
2015-12-17 09:55:24 -08:00
Samuel Tan
76d3072dd6 Merge "Fix PersistableBundle handling in Parcel.writeValue" am: d12959193c
am: d3decff052

* commit 'd3decff052c4f7471a21fbbb116b32586181b391':
  Fix PersistableBundle handling in Parcel.writeValue
2015-12-17 09:53:44 -08:00
Samuel Tan
33d5888d7a Merge "Specify path for native PersistableBundle implementation" am: 477fa220b1
am: 0bc7647f63

* commit '0bc7647f63bcdf2d63ee71d770f9514a239eaba8':
  Specify path for native PersistableBundle implementation
2015-12-17 09:52:11 -08:00
Hung-ying Tyan
bdc9d58d06 Allow library spec and app configs to be read from odm partition
Currently only feature specs are allowed to be read from /oem/etc/permissions.
ODM may want to add their own library specs and app configs (ie, "app-link",
"system-user-whitelisted-app" and "system-user-blacklisted-app") but they can
only add them to /system/etc/permissions and thus polluted the system.img.
With the fine-grained permission flag introduced in this change, we also tighten
the permission for OEMs so they can only customize the feature specs.

Bug: 25759900
Change-Id: I44ef1380b160c2b6a53f2af6de0c5f5eae27a859
2015-12-17 11:14:40 +08:00
Samuel Tan
4981ae9083 Merge "Add comments to keep Java and native binder PersistableBundle in sync"
am: 6de926a7d6

* commit '6de926a7d6439745cd0f01a69a5dd75b006b923d':
  Add comments to keep Java and native binder PersistableBundle in sync
2015-12-17 00:54:03 +00:00
Samuel Tan
d3decff052 Merge "Fix PersistableBundle handling in Parcel.writeValue"
am: d12959193c

* commit 'd12959193c60254b6b03b2a60a9c6e598e9da2e5':
  Fix PersistableBundle handling in Parcel.writeValue
2015-12-17 00:50:53 +00:00
Samuel Tan
0bc7647f63 Merge "Specify path for native PersistableBundle implementation"
am: 477fa220b1

* commit '477fa220b1766a3822171fa514983198e09daabb':
  Specify path for native PersistableBundle implementation
2015-12-17 00:49:19 +00:00
Samuel Tan
6de926a7d6 Merge "Add comments to keep Java and native binder PersistableBundle in sync" 2015-12-17 00:35:58 +00:00
Samuel Tan
d12959193c Merge "Fix PersistableBundle handling in Parcel.writeValue" 2015-12-17 00:35:43 +00:00
Samuel Tan
477fa220b1 Merge "Specify path for native PersistableBundle implementation" 2015-12-17 00:35:35 +00:00
Mahaver Chopra
1ce53bc571 Adding DPM.reboot
Adding new policy in DPM to trigger reboot on the device.
Requirement: Device owner can reboot the device if it is stuck or is
not useable due to some unresponsive UI.

Bug: 25304994
Change-Id: I7a6d5c8ad611de9c1cf6619378e492a306b41626
2015-12-16 17:55:54 +00:00
Esteban Talavera
c063603d9b Merge "Only system can set application restrictions via UserManager" 2015-12-16 10:44:12 +00:00
Samuel Tan
3cefe6a991 Add comments to keep Java and native binder PersistableBundle in sync
Add comments stating that certain methods of the Java binder framework
should be kept in sync with the corresponding methods mirrored in the
native PersistableBundle implementation.

BUG: 25815410
Change-Id: I475b2e9a527291eea58c8178cd733c444dfcfed5
2015-12-15 15:22:52 -08:00
Samuel Tan
ceafe5ed8a Fix PersistableBundle handling in Parcel.writeValue
Previously, in Parcel.writeValue, PersistableBundle objects
would be handled as Parcelable types, since we check for
the Parcelable type before the PersistableBundle type (and
PersistableBundle implements the Parcelable interface).

Fix this by moving the PersistableBundle type "if" condition
above the Parcealble type "if" condition. Also, add a comment
that explicitly states this nuance, in order to prevent future
regressions.

BUG: 25815410
Change-Id: Ia86aa5fc39423422342df0609a0d37e7f38d7ddd
2015-12-15 15:22:52 -08:00
Samuel Tan
0bae77b8f0 Specify path for native PersistableBundle implementation
Specify path for native PersistableBundle implementation in
PersistableBundle.aidl.

BUG: 25815410
Change-Id: If29b06604b938805d5250fe80e54ef9ea1e88365
2015-12-15 15:22:41 -08:00
Esteban Talavera
5b9f167a8e Only system can set application restrictions via UserManager
Preventing apps with MANAGE_USERS from managing application
restrictions via UserManager. Application restrictions should
only be set via DevicePolicyManager.setApplicationRestrictions,
or via Settings (for restricted profiles).

Bug: 22541936
Change-Id: Ieed51ef54b4c23a73f383465e9af9b3bcf18a514
2015-12-15 18:36:34 +00:00
Greg Hackmann
40aa9f1b98 Merge "Trace SQLite operations" am: 6fe06606c4
am: 0f13ddfdff

* commit '0f13ddfdffacffe1c8bcce3adba87dd32b0ab92a':
  Trace SQLite operations
2015-12-14 13:49:02 -08:00
Greg Hackmann
0f13ddfdff Merge "Trace SQLite operations"
am: 6fe06606c4

* commit '6fe06606c4df39487d240cc1fa4ac6d944b33137':
  Trace SQLite operations
2015-12-14 13:37:30 -08:00
Greg Hackmann
e12350faf7 Trace SQLite operations
Inefficient SQLite use can have non-obvious effects on performance.  For
example, insert and update operations can trigger a surprising number of
fsync() calls, especially if they're not grouped together into
transactions.

Add tracepoints around SQLite operations, to make it easier to pinpoint
their effects on the rest of the system.

Change-Id: I30cc3d02eca264e46dcc09ca7512a32519543834
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2015-12-14 12:32:26 -08:00
Andy Hung
1aba5230c5 Merge "Add Android permissions for audioserver" 2015-12-11 20:08:49 +00:00
Jeff Sharkey
b642387b43 Cleaner API for requesting locked status.
Change-Id: I1a5a6703737fb838347eaa292004430f2b9d29c3
2015-12-11 11:15:37 -07:00
Jeff Sharkey
98cb23dccf Merge "Slight API renaming, better behavior." 2015-12-09 22:51:43 +00:00
Jeff Sharkey
e13529a4ad Slight API renaming, better behavior.
Rename APIs to reflect that they're storage-related.  Also move
credential-storage APIs to be system API.

Return a null Context when device-encrypted storage isn't
supported.  This is the easiest way to keep legacy apps working when
upgrading from M to N.

Reduce strictness of path checking so we don't crash when working
with special packages like "android".

Bug: 22358539, 26104027
Change-Id: I38c24fc003488186210a6ae3b64270f86e1efe56
2015-12-09 15:22:54 -07:00
Andy Hung
ed0ea40a41 Add Android permissions for audioserver
audioserver has the same permissions as mediaserver.

TBD: Pare down permissions.

Bug: 24511453
Change-Id: Id7abddd79a730ad95b554a94207df3aa4b676f2a
2015-12-08 15:35:00 -08:00
Christopher Wiley
f26709c7af Merge "Rethrow remote\'s ServiceSpecificException" am: 85eaca25fe
am: b7b3415899

* commit 'b7b341589929b9d8c46f772c253803c97ac1ffb0':
  Rethrow remote's ServiceSpecificException
2015-12-08 23:32:36 +00:00
Christopher Wiley
b7b3415899 Merge "Rethrow remote\'s ServiceSpecificException"
am: 85eaca25fe

* commit '85eaca25fe2a89f883e9a87d8f411cfb315f3e03':
  Rethrow remote's ServiceSpecificException
2015-12-08 23:26:40 +00:00
Christopher Wiley
85eaca25fe Merge "Rethrow remote's ServiceSpecificException" 2015-12-08 23:15:52 +00:00
Xiaohui Chen
13b80b2303 Merge "UserManager: get/set user account name" 2015-12-08 21:42:22 +00:00
Lenka Trochtova
c4dd021322 Introduce ephemeral users.
BUG: 24883058

Change-Id: I2e1d6aa184142c2a3dc0415c0cd407573453cf41
2015-12-08 15:47:10 +01:00
Zoltan Szatmary-Ban
ed6c8cd6ca Merge "Make base user restrictions queriable for system apps" 2015-12-08 10:24:08 +00:00
Jeff Sharkey
e0b2f2e270 Merge "Mount storage after unlock, fix leaving emulation." 2015-12-08 01:35:28 +00:00
Jeff Sharkey
ce14cd0141 Mount storage after unlock, fix leaving emulation.
Delay mounting of storage devices until after the user is unlocked,
which means any emulated storage areas will be ready for use.  Track
separate per-user unlocked states for local versus system lifecycle
state.

Switch to explicitly lock or unlock user keys during boot of a
device without native FBE support.  This allows us to recover when
the user has disabled emulated FBE.

Force reboot when changing FBE emulation state.

Bug: 26010607, 26027473
Change-Id: Idaf8b63e69f886ddbd848a9fab6d143a5fd10500
2015-12-07 18:02:10 -07:00
Samuel Tan
650c4af010 Merge "Add support for reading and writing double array values" am: 61c0b7cd4d am: ff8ef28e73
am: e769f25fa4

* commit 'e769f25fa496827bf1ba9d74518bafd40082ceb6':
  Add support for reading and writing double array values
2015-12-08 00:00:45 +00:00
Samuel Tan
e769f25fa4 Merge "Add support for reading and writing double array values" am: 61c0b7cd4d
am: ff8ef28e73

* commit 'ff8ef28e73c0959a4993fea975d0bdefbc27a20b':
  Add support for reading and writing double array values
2015-12-07 23:38:14 +00:00
Samuel Tan
ff8ef28e73 Merge "Add support for reading and writing double array values"
am: 61c0b7cd4d

* commit '61c0b7cd4d73381a2f4e3d3836389b130b5006d9':
  Add support for reading and writing double array values
2015-12-07 23:15:15 +00:00
Rubin Xu
cc586c5ab1 Merge "Introduce quiet mode state to managed profile users" 2015-12-07 21:52:40 +00:00
Xiaohui Chen
b3b9258ab6 UserManager: get/set user account name
Bug: 25935510
Change-Id: I0b621fb300be74209534e08a11f1d1a7c049cd5a
2015-12-07 11:32:50 -08:00
Samuel Tan
61c0b7cd4d Merge "Add support for reading and writing double array values" 2015-12-07 18:56:01 +00:00
Rubin Xu
0a29ecd8a5 Introduce quiet mode state to managed profile users
Quiet mode means the user will be free from visual and audio interruptions
from apps inside the managed profile, including notifications, widgets and
others. This CL adds the underlying state bit to users and exposes various
APIs to control and query the quiet mode state.

Bug: 22541941
Change-Id: If5f8e5a897843050e83b6ec26cb39561098f12b9
2015-12-07 18:17:46 +00:00
Todd Kennedy
c72b3101ee Merge "Add ephemeral installs" 2015-12-07 15:33:05 +00:00
Zoltan Szatmary-Ban
3bbceddb94 Make base user restrictions queriable for system apps
Needed by e.g. Settings > Location

Bug:22541939
Change-Id: I6cdd5f1c32cde143232eb53f531bbf3a737d8a9a
2015-12-07 10:43:24 +00:00
Christopher Wiley
80fd1208b9 Rethrow remote's ServiceSpecificException
Certain system services would like to throw exceptions
with specific error codes, so that the framework can catch
these specific conditions and express them appropriately.

Bug: 25800533
Change-Id: I94b3d30fa131f5e14bba893c971615840085459f
2015-12-04 16:06:08 -08:00
Jeff Sharkey
9d8a1048bb Handle non-encryption-aware accounts and sync.
The system can now boot in a "locked" state where only encryption
aware (EA) components can be safely started.  When in this state,
PackageManager already filters away non-EA components, but system
services like AccountManager and SyncManager need to carefully handle
these temporarily "missing" components.

As a guiding principle, all known Accounts are still present when
the device is locked, but communication with underlying non-EA
authenticators is blocked.

To keep things simple for now, all SyncManager requests are kept
dormant until the user enters the unlocked state.

The core of this logic is that RegisteredServicesCache now works
with all components regardless of EA status, which prevents us from
accidentally thinking a service was removed when the user is locked.

Bug: 25945136
Change-Id: I8714121f6236b00821769023c4df7de1c8a99944
2015-12-04 09:36:39 -07:00