169 Commits

Author SHA1 Message Date
Fyodor Kupolov
f4fba91b5f [DO NOT MERGE] Only setSize if -s arg is specified am: b87a491de6 am: 7c9a91094d
am: c9102f2ae2

Change-Id: I28e06c6345e847ade9a89824675302fdf58e1ba9
2016-10-28 00:39:12 +00:00
Fyodor Kupolov
b87a491de6 [DO NOT MERGE] Only setSize if -s arg is specified
Calculate size of installed APKs only when INSTALL_EXTERNAL flag is set.
calculateInstalledSize is expensive and may take up to 20% of total
installation time.

Bug: 32180551
Bug: 29932779
Change-Id: I173d2b38820cc86cbfacecd1bacef57369d10af7
2016-10-27 15:29:41 -07:00
Shunta Sato
4549426d6e Fix: "adb install -s" adaptation for session based install am: 4f26cb5a36
am: 55bcb9f422

Change-Id: Id9dcfdd12f190744fe84136c0a53e2cfb6638516
2016-10-11 16:57:34 +00:00
Shunta Sato
4f26cb5a36 Fix: "adb install -s" adaptation for session based install
Internal implementation of "adb install" has been changed to
session install. As a result '-s' option doesn't work.
Size info is required when using '-s' option in session install.
PackageHelper.fitsOnExternal() returns false and moving app to SD is
failed when size info is not set.

So set size info when '-s' option is used.
And change identity on some method because shell doesn't have some
permission to access to asec.

Bug: 29932779
Author: Ryuki Nakamura <ryuki.x.nakamura@sonymobile.com>
Change-Id: I65edcc0f01ceecaaba17792ad329791a9253d603
2016-10-11 06:33:22 -07:00
Amith Yamasani
42daac6289 Merge \"Add tron logging for retail demo session counters\" into nyc-mr1-dev
am: 30a2b43f6d

Change-Id: Iaca49cc4aad9285e87d869b112b6c2986073f006
2016-06-28 01:06:47 +00:00
Amith Yamasani
b75fc2b2b7 Add tron logging for retail demo session counters
Count each demo user creation and time between
first touch (to dismiss the video) and the start
of inactivity timeout.

Fixed an NPE in SysUI when user switcher is missing.

Bug: 29540372
Change-Id: I7bc0e0dde75e7b213a025683c15c9b3e750643a9
2016-06-27 11:15:38 -07:00
Sudheer Shanka
098bc0d840 Merge \"Add pm operation to set user restrictions.\" into nyc-dev
am: f6824b51cc

Change-Id: I137151742049c0a02d41a02e49abb679234f14b9
2016-06-17 22:08:07 +00:00
Sudheer Shanka
bf0a9a7445 Add pm operation to set user restrictions.
Bug: 29189712
Change-Id: I6fdb3b68dfe3f51119e5ce8008880fc7d9c793df
2016-06-16 09:43:29 -07:00
Dianne Hackborn
a24af982ff Merge "Fix issue #27532364: Security Vulnerability in IIntentSender.send" into nyc-dev
am: 607844efa5

* commit '607844efa59f79bd9fab55eb75f217d21cd15f5f':
  Fix issue #27532364: Security Vulnerability in IIntentSender.send

Change-Id: I749b455402caef335239b540ec8883a8d7b2a974
2016-05-17 18:32:46 +00:00
Dianne Hackborn
0c4e6a8da3 Fix issue #27532364: Security Vulnerability in IIntentSender.send
We need to make IIntentSender oneway...  but when the system is
calling that for itself, it needs to be able to return a result code.

Solution: instead of directly calling the interface, we have a new
IPC through the activity manager.  If the thing being used is the
activity manager impl, it can do the synchronous send and return
the result directly in place.  If not, you only get asynchronous
sending and thus never a failure result back (too bad for you!).

Change-Id: I4096e5b00063e8dba66230585a2dfe67e35e8092
2016-05-13 17:37:08 -07:00
Todd Kennedy
9a50b6abf1 Merge "Don\'t override pre-release target sdk" into nyc-dev
am: 97ef0e7

* commit '97ef0e77afa3be6255b70c8567843ac298386251':
  Don't override pre-release target sdk

Change-Id: Ib70b0e908dc148799875afcedeeb1d59f2d90367
2016-04-27 00:58:47 +00:00
Todd Kennedy
b107271813 Don't override pre-release target sdk
If a package targets a pre-release SDK [eg a letter version] it should not
be allowed to be upgraded by a release SDK [eg a number version]. If one
absolutely must upgrade to a release SDK, use the "--force-sdk" option
during install.

Bug: 28345311
Change-Id: Ic9fb209968e7c5da2c80c5ca4c0f44f5125f610a
2016-04-26 16:25:43 -07:00
Todd Kennedy
61c24ded75 Merge "Add "do not kill" install option" into nyc-dev
am: 6958226

* commit '69582262f0dfa8cdca232d03ff3239fa026326ab':
  Add "do not kill" install option

Change-Id: I438e486400d00070fd424cb811e578d5f3a1c60d
2016-04-26 17:24:02 +00:00
Todd Kennedy
47763629fe Add "do not kill" install option
Passing the "--dont-kill" argument to pm install-create can be used to
install a feature split without killing the contianing application.
Use with caution.

Bug: 27780548
Change-Id: I743ac4f640c9c4251d1b3bc70ddf428bd79e07bf
2016-04-21 15:21:20 -07:00
Fyodor Kupolov
3f7fa3be86 Merge "Fixed arguments order for addSharedAccountsFromParentUser" into nyc-dev
am: da466f7

* commit 'da466f72727a06c71735c35acd70d5b8b284c8be':
  Fixed arguments order for addSharedAccountsFromParentUser

Change-Id: I6b568dc352282bda8e68ddf1b88303e4f158092a
2016-03-30 22:37:37 +00:00
Fyodor Kupolov
4d709f998d Fixed arguments order for addSharedAccountsFromParentUser
Bug: 27900775
Change-Id: I8c48fabddb778bfd94333d4dcdd296fef87cb59a
2016-03-29 11:20:19 -07:00
Dan Willemsen
dc3b852125 resolve merge conflicts of 8416096 to nyc-dev-plus-aosp
Change-Id: I1638601fe84dda01bf52c59eb6c976bc1fe37498
2016-03-23 15:31:32 -07:00
Dan Willemsen
98ff0b72f0 Remove custom copy rules, stop using ACP
Replace some custom rules with BUILD_PREBUILT.

Move tools from ALL_PREBUILTS to BUILD_PREBUILT. All of them are already
in PRODUCT_PACKAGES in build/target/product/base.mk.

Remove uses of ACP and replace with core build system macros or 'cp'

Change-Id: I529e7c6c50fc64ad36b75bb47142f6bde909d141
2016-03-23 13:42:52 -07:00
Alex Klyubin
88b42855c9 Only debuggable packages can be downgraded.
This reflects the change in PackageManager service:
frameworks/base commit 921dd754ab49df0cd580ff96503f7616c4c85f4a.

Bug: 27327503
Change-Id: Ic13788a3850c4d1a3a566b208853de9a6d2c5237
2016-02-24 16:52:01 -08:00
Todd Kennedy
8d9366cfe9 Remove 2nd line from failure
In an attempt to provide more detailed information to the end-user, we
caused tests to fail [they parse the output of the 'pm' command]. Remove
the 2nd line of the output that was causing the failure.

Also took the opportunity to merge changes from the Pm command to the
Cmd command.

Bug: 26131598
Change-Id: I459f9ec8978d87dd571136222f780039e426474e
2015-12-16 13:47:14 -08:00
Todd Kennedy
1fd413f637 Merge "Temporarily stop proxying to cmd" 2015-12-08 17:07:15 +00:00
Lenka Trochtova
c4dd021322 Introduce ephemeral users.
BUG: 24883058

Change-Id: I2e1d6aa184142c2a3dc0415c0cd407573453cf41
2015-12-08 15:47:10 +01:00
Todd Kennedy
9619d049bf Temporarily stop proxying to cmd
Unless the APK is streamed, proxying pm install commands to the cmd command
will generally not work on any system that has SElinux enforcement. This
is due to the system sever [where cmd commands are run] not having access
to the directories where files are uploaded to. We'll re-enable the proxy
once we determine an appropriate, safe location for uploaded APKs.

Bug: 25769800
Change-Id: I73b2da0b03fe8bd9ce29e20b37cb4eeff9b491b4
2015-12-07 13:26:08 -08:00
Todd Kennedy
2699f06555 Add ephemeral installs
* Add a new --ephemeral argument to 'adb install'
* Add plumbing to internally track ephemeralness
* Create new app directory for ephemeral installs

Bug: 25119046
Change-Id: I1d379f5ccd42e9444c9051eef2d025a37bd824fe
2015-12-03 14:47:01 -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
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
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
Xiaohui Chen
f5bf0de1aa clean up USER_OWNER in Pm command
Change-Id: I3092cdf1ca619b4c1ba881955b8a55b97ba10e24
2015-10-26 10:45:15 -07: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
f916524f44 Merge "Add support for --user to "pm path" for work profile use" 2015-10-15 15:55:45 +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
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
Brian Carlstrom
f83612b295 Add support for --user to "pm path" for work profile use
Change-Id: Ic8bb923e15a40f32cc7daa6a344250abfc81e423
2015-09-25 13:08:35 -07:00
Fyodor Kupolov
737b216b5c 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: I5f0d48bcbd3c0b51927926b874fd057c15ac5219
2015-09-25 11:22:13 -07:00
Chris Tate
dcaf0eccb2 am 748dd873: am 8d662a07: am e49dcfed: am 9b7a4ac5: am e62421f1: Merge "Teach Pm about the "always ask" link-handling state" into mnc-dev
* commit '748dd8736fa15f426a5accb265141a6046aa2636':
  Teach Pm about the "always ask" link-handling state
2015-08-26 00:47:50 +00:00
Christopher Tate
47dd08d7fb Teach Pm about the "always ask" link-handling state
Bug 23511867

Change-Id: I74b3c8222a7d22541a96b698edd1a175d378e48f
2015-08-25 12:39:04 -07:00
Xiaohui Chen
2a5c3e59c8 pm: translate incoming user id for installation
Currently the pm install commands will not take virtual user id like
-2.  Adding this feature will make it easier to install packages in a
multi-user environment.

Bug: 19913735
Change-Id: I68b13cf8f2290158f0f4ec5c0966853719c2e80f
2015-08-24 11:00:14 -07:00
Chris Tate
848dd4bfc9 am 14e12258: am 13845aea: am b2d4c550: am b47890c4: am 7e7d79ef: Merge "Make "Ask every time" actually work that way" into mnc-dev
* commit '14e122582c45e236bf2e4c59d10438816f2eed09':
  Make "Ask every time" actually work that way
2015-08-14 17:44:39 +00:00
Christopher Tate
56f0ff3c48 Make "Ask every time" actually work that way
..in link-opening behavior.  If a candidate is marked as "ask
every time," then the user is guaranteed to get a disambiguation
prompt including that candidate even when some other candidate
app is in the "always prefer this over a browser" state.

Bug 23147746

Change-Id: I904d8697a992b3f16f32b1c1b49c2bf9424c7137
2015-08-13 18:56:05 -07:00
Xiaohui Chen
2ccf49e7f4 Clean up USER_OWNER references in am/pm commands.
Bug: 19913735
Change-Id: I9cd27dc037048f4e5e312c769fc59669a4abf3e3
2015-08-04 15:28:29 -07:00
David Stevens
6323fff7df Merge "Add cmd to reset default component enabled setting" 2015-07-23 23:50:52 +00:00
David Stevens
f6ec60dd1e Add cmd to reset default component enabled setting
Change-Id: Ice5e366643bb5c536b579089dcc98e06c9bb5645
2015-07-23 16:42:29 -07:00
Christopher Tate
387225ff01 Add 'pm' operation to set a package's app-linking state
Set an app's state:

  pm set-app-link [--user USER_ID] PACKAGE {always|ask|never|undefined}

Read an app's current state:

  pm get-app-link [--user USER_ID] PACKAGE

The latter prints to stdout one of the strings usable as an argument to
set-app-link.  If an error is encountered, the string printed to
stderr begins with "Error: ".

Bug 19628527

Change-Id: I68b6dc24445917807345a8cf5baa2078490740af
2015-07-20 17:45:17 -07:00
Jeff Sharkey
396080dd02 Add grant flag support to "install-create" verb.
This matches the "install" behavior.

Bug: 22331569
Change-Id: I07bfe067bd4be01fc92126750b0ff25a5c5ba5c9
2015-07-09 09:16:07 -07:00
Dianne Hackborn
ca8e6da41c Fix issue #22023824: Download folder is not created in internal storage
The media provider and some other things need to be given storage access.

Also, seems like we should give storage access to the camera app as well.

And add a dump dump command that will dump data about a particular
permission name.

Change-Id: Idaaa9bba2ff4dc95290cf6d17e5df933df91e909
2015-06-26 13:28:29 -07:00
Dianne Hackborn
a750a63d63 Fix issue #21814207 and issue #21814212 (alarm manager)
Issue #21814207: AlarmManager.setAndAllowWhileIdle should also allow wake locks.

Introduce a whole new infrastructure for providing options when
sending broadcasts, much like ActivityOptions.  There is a single
option right now, asking the activity manager to apply a tempory
whitelist to each receiver of the broadcast.

Issue #21814212: Need to allow configuration of alarm manager parameters

The various alarm manager timing configurations are not modifiable
through settings, much like DeviceIdleController.  Also did a few
tweaks in the existing DeviceIdleController impl.

Change-Id: Ifd01013185acc4de668617b1e46e78e30ebed041
2015-06-17 11:41:45 -07:00