1573 Commits

Author SHA1 Message Date
Dianne Hackborn
b9e2803384 Merge "Move appops command to the service." 2015-11-19 18:47:53 +00:00
Jeff Sharkey
ba51235ef5 More file-based encryption work.
Add new "am unlock-user" command so we can trigger changes from the
command line.

Move FBE check to static method so it can safely be called early
during boot before the mount service is ready.  Move FBE emulation
to persisted system property, and start reading/writing that value.

Change default permission grants to ignore current encryption-aware
flags, since many of the target apps aren't crypto aware.

Always prepare package data directories, which is how we create the
new "user_de" paths during boot.

Bug: 22358539
Change-Id: I6f58ea2d34b3a466d3775d614f8a13de92272621
2015-11-19 11:02:30 -07:00
Dianne Hackborn
268e4e3d00 Move appops command to the service.
The "appops" shell command is now just a wrapper around doing
"cmd appops", no more need to launch a Java VM!

Change-Id: I06fc68762d0ab95a016fb24db0affb0d91197588
2015-11-18 16:29:56 -08:00
Xiaohui Chen
60c2e34543 cmds: fix settings command help msg
There is a missing white space.

Change-Id: I7e7f4783464a7be02a3b2e1a30a629ed1ebdc913
2015-11-18 14:10:42 -08:00
Dianne Hackborn
354c3bc394 Merge "Some debugging improvements." 2015-11-17 00:41:07 +00:00
Dianne Hackborn
3cdb56efea Some debugging improvements.
- Fix dumping of package manager intent filters so the option
  to print the filter detail works again.
- Extend dump resolvers to allow you to specify the specific
  types of resolvers you'd like to dump.
- Add new package manager commands for querying activities,
  services, receivers.
- Move the code for parsing a command line into an intent to
  the framework, so it can be used by the new package manager
  commands and later elsewhere.

Change-Id: I56ea2bb8c3dd0e5198ee333be8f41ad9dcdb626f
2015-11-11 12:45:44 -08:00
Jeff Sharkey
f9fc6d6cc0 More file-based encryption work.
Add granular StorageManager APIs for key creation/destruction and
unlocking/locking.  Start passing through an opaque token as part
of the unlock command, but leave it empty for now.  We now have a
separate "prepare" method that sanity checks that user directories
are correctly setup.

Define a handful of system properties used for marking devices that
should be operating in FBE mode, and if they're emulating FBE.  Wire
a command to "sm", but persisting will come later.

Start using new "encryptionAware" flag on apps previously marked with
coreApp flag, which were apps running in the legacy CryptKeeper
model.  Small tweaks to handle non-encryptionAware voice interaction
services.  Switch PackageManager to consult StorageManager about the
unlocked state of a user.

Bug: 22358539
Change-Id: Ic2865f9b81c10ea39369c441422f7427a3c3c3d6
2015-11-11 10:47:23 -08:00
Todd Kennedy
72cfcd02b8 Move 'un/install' to cmd
Move the implementation of the install variants and uninstall to the cmd
command. Additionally, make two other important changes: 1) replace calls
to the legacy PackageManager#installPackageAsUser with the PackageInstaller
2) allow streaming package bits for 'pm install'

Change-Id: I5680f57208d377daadb69b2cc09c233c02fe5016
2015-11-09 15:07:18 -08:00
Todd Kennedy
18bc3305e4 Revert "Move 'un/install' to cmd"
This reverts commit ec059d839de6d061085dcfd85ce6565dcf4d5b69.

Change-Id: Ieaa1373e96fb4cc20aa41c3159518bd9e86c572b
2015-11-09 15:36:43 +00:00
Todd Kennedy
ec059d839d Move 'un/install' to cmd
Move the implementation of the install variants and uninstall to the cmd
command. Additionally, make two other important changes: 1) replace calls
to the legacy PackageManager#installPackageAsUser with the PackageInstaller
2) allow streaming package bits for 'pm install'

Change-Id: Ia49dac0ccd6470f9d1c1964bdeb3c0b22b856075
2015-11-06 09:27:22 -08:00
Dan Albert
0881a7445f Use std::unique_ptr instead of UniquePtr.
We're deprecating UniquePtr, so we need to move to the real thing.

Bug: http://b/22403888
Change-Id: I5b7fdf4924dd8c12a8c7dba89278714ca6fdc60a
(cherry picked from commit b0624da1181276ff4caa5e57a7a4abf766902e3e)
2015-11-05 13:03:26 -08:00
Brian Carlstrom
ce8bf86d6d Merge "Fixes for sm and pm usage" am: ffb15da518 am: 671d5965f7
am: f73e78fe1c

* commit 'f73e78fe1cb6803a29f7f85b49792f4e8a7350c8':
  Fixes for sm and pm usage
2015-11-05 18:55:49 +00:00
Brian Carlstrom
ffb15da518 Merge "Fixes for sm and pm usage" 2015-11-05 18:38:56 +00:00
Brian Carlstrom
82bfca4609 Fixes for sm and pm usage
sm showed IllegalArgumentException after usage.
pm inconsistently used "return showUsage()"

Bug: 20948199
Change-Id: I5828489a9d4ef2eabfb97dd408d66e1560a5a983
2015-11-05 10:33:40 -08:00
Todd Kennedy
60459abb21 Implement shell commands for package and user services
Only implement the 'list' package service command. More will follow
in future CLs.

Change-Id: Iae225cd4ee63c7d468a4fd882d8cb4b6b76ccc09
2015-11-02 16:19:50 -08:00
Wale Ogunwale
3797c22ea1 Added StackId object for checking what features a stack supports
Helps make the code easier to follow since we are no longer checking
multiple stack ids at various decision points.

Bug: 25282299
Change-Id: Ifa6864a1ef56ce2eca4c94f87a4e0b993de987cd
2015-11-02 11:32:42 -08:00
Xiaohui Chen
6f02b865df Merge "clean up USER_OWNER in Pm command" 2015-10-27 18:43:22 +00:00
Wale Ogunwale
079a0044a3 API for moving top activity in a stack to pinned stack.
* AMS.moveTopStackActivityToPinnedStack can be used to move the top
activity in a stack to the pinned stack and also specify the bounds
the pinned stack should be sized to.
* 'am stack move-top-activity-to-pinned-stack' command for testing
AMS.moveTopStackActivityToPinnedStack API

Bug: 25006507
Change-Id: I8392b4c39d8542153e691be7a627b7f35fd44884
2015-10-26 12:07:00 -07:00
Xiaohui Chen
f5bf0de1aa clean up USER_OWNER in Pm command
Change-Id: I3092cdf1ca619b4c1ba881955b8a55b97ba10e24
2015-10-26 10:45:15 -07:00
Elliott Hughes
46a114dfcf Merge "Fix lseek argument order." am: 12dccb8a24 am: 9bbe41642a
am: 2876b1f169

* commit '2876b1f169e5342e46b27f3f94a8816837c9f61a':
  Fix lseek argument order.
2015-10-20 23:51:55 +00:00
Elliott Hughes
9bbe41642a Merge "Fix lseek argument order."
am: 12dccb8a24

* commit '12dccb8a2450152102b32bf4882200f6b08a5a5a':
  Fix lseek argument order.
2015-10-20 20:35:44 +00:00
Elliott Hughes
70bef1c4bd Fix lseek argument order.
Change-Id: Ibc2f98e4c26d0ac6ac7b4a73775c5213c4df4518
2015-10-20 13:23:18 -07:00
Pablo Ceballos
63afb86381 Merge "Remove GLTrace support" 2015-10-19 17:55:59 +00:00
Brian Carlstrom
80435a7fcd am bd5b6252: am b9a28ae1: am f916524f: Merge "Add support for --user to "pm path" for work profile use"
* commit 'bd5b6252a5dd068c2db30fbbd16e87a656047197':
  Add support for --user to "pm path" for work profile use
2015-10-15 16:16:07 +00:00
Brian Carlstrom
b9a28ae199 am f916524f: Merge "Add support for --user to "pm path" for work profile use"
* commit 'f916524f44c9955e7c747e5319d17c46a61a3c4c':
  Add support for --user to "pm path" for work profile use
2015-10-15 16:02:57 +00:00
Brian Carlstrom
f916524f44 Merge "Add support for --user to "pm path" for work profile use" 2015-10-15 15:55:45 +00:00
Wale Ogunwale
5247523c90 Merge "Don't set incorrect stack bounds when rotating screen in docked mode" 2015-10-13 01:58:05 +00:00
Wale Ogunwale
ffc11bb712 Don't set incorrect stack bounds when rotating screen in docked mode
Both window manager and activity manager could decide what the bounds
of other stacks should be when the docked stack exist which can get
out of sync. Now window manager does the bounds calculation and
activity manager asks window manager what the bounds should be when
it needs to resize the stack.

Bug: 24738105
Change-Id: I97356f008b676d2f58a8b54fdb08735ab51394af
2015-10-12 18:56:28 -07:00
Adam Lesinski
f5e18154b0 am b8f8ca51: am 651cb804: am fe1934e4: Merge "RRO: idmap: allow flock(2) to block"
* commit 'b8f8ca5139e3268c7447565940b63a543ebe9ed5':
  RRO: idmap: allow flock(2) to block
2015-10-13 01:24:48 +00:00
Adam Lesinski
81892b095b am 41bf75c6: am 287cd2d1: am bac309ca: Merge "RRO: idmap: fix sorting of overlays.list"
* commit '41bf75c606fa19b473bc87145f766757525ae96c':
  RRO: idmap: fix sorting of overlays.list
2015-10-13 01:24:38 +00:00
Adam Lesinski
45f704a4d0 am 89eaa06a: am 6382a950: am 2327239d: Merge "Handle \'root\' pseudo-package in the appops command"
* commit '89eaa06a10ed399ae9919de2795f76c2af932adc':
  Handle 'root' pseudo-package in the appops command
2015-10-13 01:24:29 +00:00
Adam Lesinski
4ffea4e4da am d0c806b1: am 6029dfa8: am 7caa8f14: Merge "Make \'idmap --scan\' accept more than one input directory"
* commit 'd0c806b10c8e45dcfa950adc36742b15edababea':
  Make 'idmap --scan' accept more than one input directory
2015-10-13 01:24:16 +00:00
Adam Lesinski
651cb804b1 am fe1934e4: Merge "RRO: idmap: allow flock(2) to block"
* commit 'fe1934e470681ff7ec5b8ec0609ae9fe24bd7282':
  RRO: idmap: allow flock(2) to block
2015-10-12 19:34:43 +00:00
Adam Lesinski
287cd2d1e4 am bac309ca: Merge "RRO: idmap: fix sorting of overlays.list"
* commit 'bac309ca8f4ecd1a835aa36f4be2a1fa45577eab':
  RRO: idmap: fix sorting of overlays.list
2015-10-12 19:34:37 +00:00
Adam Lesinski
6382a950cd am 2327239d: Merge "Handle \'root\' pseudo-package in the appops command"
* commit '2327239d65525d8ba2bdbedd6e59809fef447a12':
  Handle 'root' pseudo-package in the appops command
2015-10-12 19:34:28 +00:00
Adam Lesinski
fe1934e470 Merge "RRO: idmap: allow flock(2) to block" 2015-10-12 19:30:23 +00:00
Adam Lesinski
bac309ca8f Merge "RRO: idmap: fix sorting of overlays.list" 2015-10-12 19:29:39 +00:00
Adam Lesinski
2327239d65 Merge "Handle 'root' pseudo-package in the appops command" 2015-10-12 19:29:14 +00:00
Adam Lesinski
6029dfa81a am 7caa8f14: Merge "Make \'idmap --scan\' accept more than one input directory"
* commit '7caa8f14a78d279e0392089dca2f54f27e7f5d15':
  Make 'idmap --scan' accept more than one input directory
2015-10-12 18:59:03 +00:00
Snild Dolkow
3875bf6c04 Handle 'root' pseudo-package in the appops command
The AppOpsService handles the 'root' pseudo-package as any other; it
gets no automatic allowances. This is reasonable, but it blocked me from
accessing the mms-sms provider through the 'content' command, even in a
root shell.

So I tried to change the rules:

$ adb root
$ adb shell appops set root WRITE_SMS allow
Error: No UID for root in user 0

This error occurs in the appops command because there isn't really a
package called root, so the UID lookup via PackageManager fails.

But we know that root is UID 0, so we can just skip the lookup.
(Also, AppOpsService handles the other way around in getOpsLocked method.)

Change-Id: Ie0cad67efa438a74a4d9921d29933610cfb13974
2015-10-07 19:58:17 +02:00
Mårten Kongstad
7197d91eb7 RRO: idmap: fix sorting of overlays.list
Multiple overlay packages with targetPackage="android" are loaded in the
wrong order due to the incorrect order they are listed in overlays.list.
This will cause runtime resource overlay to fail when multiple overlay
packages target the same resources in framework-res.apk.

Correct the order in which overlays are loaded by changing the sorting
of overlays.list.

Background: commit f90f2f8d changed the order in which overlay packages
should be added to ResTables. The expected order is now in ascending
priority. This must be reflected in overlays.list.

Change-Id: I249984c0e34b6009e7280ce2777750c76ab16e37
2015-10-07 19:51:50 +02:00
Mårten Kongstad
83ab0d7c18 Make 'idmap --scan' accept more than one input directory
The 'idmap --scan' command was limited to only scan a single directory
for overlay packages. Update idmap to support any number of directories.

Change-Id: I851f5720a3c1d844235911a0833670652a20a3c8
2015-10-07 19:45:09 +02:00
Mårten Kongstad
df1a5b22cd RRO: idmap: allow flock(2) to block
During creation of an idmap an advisory lock is applied on the
output file using flock(2). This commit removes the LOCK_NB flag
from the call to flock(2).

The reason for this is that if the function were to return
EWOULDBLOCK, the entire idmap operation would be aborted leading
to the device booting without the correct overlay packages applied.

Change-Id: Iad319779976e950d4354e4f60b30439f6f208b77
2015-10-07 19:02:09 +02:00
Pablo Ceballos
a4d4e82927 Remove GLTrace support
GLTrace is defunct, it does not support newer GL features, breaks
security requirements, and has no supported tooling now that Eclipse
is at end of life.

Bug 22329852

Change-Id: I64c58464f8c2c7ae6125f5d5c7884e3fd34d68ea
2015-10-06 15:18:40 -07:00
Makoto Onuki
a52562ca9a setDeviceOwner() now requires a full component name.
Bug 20149907

Change-Id: I24e66159d1d966925aa3a494b1e2839b07cdafa2
2015-10-05 16:05:15 -07:00
Makoto Onuki
3e832afec3 Merge "Fix "pm list permissions GROUP"" 2015-10-05 16:03:00 +00:00
Makoto Onuki
008b932d95 Fix "pm list permissions GROUP"
The command wasn't parsing a group name correctly.

Change-Id: I966e56e2f7b3eab2531be6bec8f744735b865910
2015-10-02 16:51:56 -07:00
Fyodor Kupolov
0df68cd13b Do now allow current user to be removed
It was possible to remove a foreground user using pm remove-user command.
The system ends up in the inconsistent state, because switch does not happen
and the removed user stays in the foreground, but its state is removed.

Also added am get-current-user command.

Change-Id: Ida2dce8f99bac55e106cdd44c93e96cc9142d7fb
2015-10-02 12:19:39 -07:00
Fyodor Kupolov
02cb6e773b Added --restricted option for create-user command
Also moved restricted profile create/setup logic from Settings to
UMS.createRestrictedProfile.

Bug: 24212155
Bug: 24303609
Change-Id: I0346a3368de53f4bb4b6e054349f19adac959d7f
2015-09-28 10:01:54 -07:00
Bart Sears
9249a90977 Revert "Added --restricted option for create-user command"
This reverts commit 737b216b5c28f7d7162f219136d4e8a9eb1a486b.

Change-Id: I4c43967933bb2e46cdb8ad6e643d7037d722cab2
2015-09-26 01:58:59 +00:00