Commit Graph

5900 Commits

Author SHA1 Message Date
Philip P. Moltmann
94deaf7725 Allow to transfer+seal a install session
... so that one package can supply the data and another one can issue
the commit.

Also allow reading of sealed sessions.

Also lock more in PackageInstallerSession so that we can be sure the
session is not used by the old package anymore once transferred and that
all calls into the session work on consistent data.

Bug: 37281396
Test: cts-tradefed run cts-dev -m CtsContentTestCases --test=android.content.pm.cts.InstallSessionTransferTest
      Installed and uninstalled packages via the PackageInstaller app
      Installed and uninstalled packages via the Google Play Store

Change-Id: Id4b7a0071d703b7d18c9f5bf2bd15ebf67086d07
2017-08-07 10:50:57 -07:00
Jeff Sharkey
67f9d5070a Fix broken javadocs.
Bug: 64337634
Test: make -j32 doc-comment-check-docs
Change-Id: I20fdd3dcddef09111d35946c41c596c7689effa6
2017-08-06 07:37:08 -06:00
Jeff Sharkey
623fbea979 Merge "Fix NPE when reading icon for removed session." into oc-dr1-dev
am: 65abebbadd

Change-Id: I6ef312422ea84b352f8d07a9937c64394b14776a
2017-08-02 22:49:42 +00:00
Jeff Sharkey
d1dd2c662e Fix NPE when reading icon for removed session.
The underlying session may have been destroyed before we go back to
read out the icon.

Test: builds, boots
Bug: 63795821
Change-Id: I16eb32c74a0e3b1d0605392878d65f28437006a6
2017-08-02 15:36:12 +00:00
Todd Kennedy
5e049eb884 Merge "Add new API to retrieve app names in a batch" into oc-mr1-dev 2017-08-02 14:23:16 +00:00
TreeHugger Robot
cd0d29e9fc Merge "Log package parse timings" into oc-mr1-dev 2017-08-01 19:46:29 +00:00
Calin Juravle
565cab11ff Merge changes from topic 'class-loaders-mr1' into oc-mr1-dev
* changes:
  Use the class loader context when optimizing secondary dex files
  Add DexClassLoader to the list of supported class loaders
2017-08-01 18:38:05 +00:00
Makoto Onuki
f6764fb7f7 Merge "Revert "Reduce duplicate strings due to the package cache."" into oc-mr1-dev 2017-08-01 16:11:27 +00:00
Fyodor Kupolov
28a988f7d5 Log package parse timings
Log time it takes to parse a package (parse=) and update the cache
(update_cache=), if time exceeds 100ms threshold.

This can be useful for analyzing bugreports of slow PM init post-OTA.

Test: manual
Bug: 62462279
Change-Id: I4099b21fae6a5db8c8f1cbc2147a33b9ee51767a
2017-07-31 18:45:32 -07:00
Makoto Onuki
63e624a61e Revert "Reduce duplicate strings due to the package cache."
The pool is just broken.... I need to fix it and re-evaluate.

This reverts commit e86a29c6e6.

Change-Id: I296df71e76ffff1d1d0fc8a50e3493e20c124a7b
2017-08-01 00:42:33 +00:00
Bryce Lee
69aac0a7b6 Merge "Do not call onConfigurationChanged for appBound position changes." into oc-dr1-dev
am: 33d4702a12

Change-Id: Id6748aab9ee83844303324ea397d4ac699fb5839
2017-07-31 18:45:19 +00:00
Todd Kennedy
9da8b8a7fc Add new API to retrieve app names in a batch
Change-Id: I57e5c132bc58a32d70007a7a105775b526ff7bb9
Fixes: 62805090
Test: cts-tradefed run commandAndExit cts-dev -m CtsContentTestCases -t android.content.pm.cts.PackageManagerTest#testGetNamesForUids_null
Test: cts-tradefed run commandAndExit cts-dev -m CtsContentTestCases -t android.content.pm.cts.PackageManagerTest#testGetNamesForUids_empty
Test: cts-tradefed run commandAndExit cts-dev -m CtsContentTestCases -t android.content.pm.cts.PackageManagerTest#testGetNamesForUids_valid
2017-07-31 11:29:37 -07:00
TreeHugger Robot
bb77e6c689 Merge "Reduce duplicate strings due to the package cache." into oc-mr1-dev 2017-07-31 17:52:41 +00:00
Bryce Lee
658d984f04 Do not call onConfigurationChanged for appBound position changes.
Since appBounds encodes both dimensions and positions, movement will
cause a diff change. This happens in situations where the dimensions
stay constant, such as dragging a PiP window around.

To avoid flooding the client side with configuration changes, this CL
checks whether the new configuration is equivalent to the existing
configuration with the exception of the position of the appBounds
before sending to the registered callbacks.

Change-Id: I8fbc94458fd9ed3b39494c3587f25e704ec02a7d
Fixes: 63927944
Test: bit FrameworksServicesTests:com.android.server.wm.AppBoundsTests
Test: go/wm-smoke
2017-07-31 08:46:00 -07:00
Makoto Onuki
e86a29c6e6 Reduce duplicate strings due to the package cache.
The following charts are the actual measurement with and without the fix,
using "dumpsys system".
- The red bar is "total private dirty".
- The X axsis is time since boot.

Without fix:
- First boot:
https://docs.google.com/spreadsheets/d/1R6lL0AnAp93HnrqWujJFNgOjj6wvGicgDlbDAevbc3g/edit#gid=0
Private dirty stabilizes at ~16.8M.

- Second boot:
https://docs.google.com/spreadsheets/d/1R6lL0AnAp93HnrqWujJFNgOjj6wvGicgDlbDAevbc3g/edit#gid=1918404197
Private dirty stabilizes at ~17.8M.

With fix:
- First boot:
https://docs.google.com/spreadsheets/d/1R6lL0AnAp93HnrqWujJFNgOjj6wvGicgDlbDAevbc3g/edit#gid=791764875
Private dirty stabilizes at ~17.0M.

- Second boot:
https://docs.google.com/spreadsheets/d/1R6lL0AnAp93HnrqWujJFNgOjj6wvGicgDlbDAevbc3g/edit#gid=1820894299
Private dirty stabilizes at ~17.0M.

Test: build, boot, reboot, adb-install, reboot
bit FrameworksCoreTests:android.content.pm.PackageParserTest

Bug: 64112468
Change-Id: I5ae9c1b2d021fe62526d4e0dd1a52a962b48206e
2017-07-28 15:09:13 -07:00
Bryce Lee
84fa183e7d Merge "Remove rotation and app bounds from Configuration diff." into oc-dr1-dev
am: 5b76ce1b2b

Change-Id: Ibf899e9a08cdab31ae38897add813fc4c8089474
2017-07-28 21:28:05 +00:00
Bryce Lee
5b76ce1b2b Merge "Remove rotation and app bounds from Configuration diff." into oc-dr1-dev 2017-07-28 17:57:09 +00:00
Svetoslav Ganov
899f54da72 Report permission flags for all protections based on SDK am: adb8c522a8
am: 436b901dbb

Change-Id: Ibe7cecd60242f1895434d586af30c2081d451f0b
2017-07-28 16:59:55 +00:00
Svetoslav Ganov
436b901dbb Report permission flags for all protections based on SDK
am: adb8c522a8

Change-Id: Ia30269ec2097d5978ae3e0b3930a38b3f4441ea4
2017-07-28 16:42:59 +00:00
Bryce Lee
0e4a6dfb3f Remove rotation and app bounds from Configuration diff.
The presence of these new flags leads to issues with application that
do not expect their presence. Since these flags can appear at
critical times, such as on orientation change, these issues are
brought to the surface often.

This CL remedies this problem by first removing the rotation
property. It is not used and the original issue of orientation and
Configuration alignment has been addressed. For app bounds, the CL
reverts the behavior back to identifying diffs as a screen size
change.

Fixes: 64004417
Test: bit FrameworksServicesTests:com.android.server.wm.AppBoundsTests
Test: go/wm-smoke

Change-Id: I1fabb564dfb5c13d897336708523cf7cd5099fa0
2017-07-28 07:49:01 -07:00
Svetoslav Ganov
adb8c522a8 Report permission flags for all protections based on SDK
We added a couple of protection flags that also apply to
normal and dangerous permissions. These flags are folded
in the protection level breaking apps that directly and
compare against the protection constants. Apps that target
older than O SDK don't get protection flags folded into
the protection level.

Test: All permission tests pass
      Added a new test to ensure no protection flags reported
      for normal and dangerous permissions

Change-Id: I87b10a7695d8ecfa7156525d6f3d101fc0639513
bug:62755026
2017-07-28 05:46:53 +00:00
Bart Sears
7a8044dc67 Revert "Report permission flags for all protections based on SDK" am: 784b56e1e6
am: 076d6f7669

Change-Id: I6034405a465919b5e4fc75b4eb109b6ae5259fe0
2017-07-28 05:29:23 +00:00
Bart Sears
076d6f7669 Revert "Report permission flags for all protections based on SDK"
am: 784b56e1e6

Change-Id: Ice7dde53c5613f48d013424a7e99203fd854e532
2017-07-28 05:17:52 +00:00
Bart Sears
784b56e1e6 Revert "Report permission flags for all protections based on SDK"
This reverts commit 852cf98cb8.

Change-Id: I62763bf85ec95a02a245c6b503aa34bb0e9d997a
2017-07-28 05:05:38 +00:00
Svetoslav Ganov
2dfbbb3aa4 Report permission flags for all protections based on SDK am: 852cf98cb8
am: 3cf283558a

Change-Id: Iba5b20a777e4cf8953b73e523f25175d7b274a34
2017-07-28 03:03:51 +00:00
Svetoslav Ganov
3cf283558a Report permission flags for all protections based on SDK
am: 852cf98cb8

Change-Id: I6e87c8f40fa466f2a50f41549be41ea4fb598824
2017-07-28 02:49:30 +00:00
Svetoslav Ganov
852cf98cb8 Report permission flags for all protections based on SDK
We added a couple of protection flags that also apply to
normal and dangerous permissions. These flags are folded
in the protection level breaking apps that directly and
compare against the protection constants. Apps that target
older than O SDK don't get protection flags folded into
the protection level.

Test: All permission tests pass
      Added a new test to ensure no protection flags reproted
      for normal and dangerous permissions

bug:62755026

Change-Id: I72547b0146e6b6919803e33ff64b7208c4a255ad
2017-07-28 01:46:04 +00:00
Todd Kennedy
2a896e9074 Merge "Add cross user permission checks" into oc-mr1-dev 2017-07-27 20:49:56 +00:00
Bryce Lee
d6a2ed194c Merge "Do not report app bound differences as a Configuration change." into oc-dr1-dev
am: 512e5d1b9b

Change-Id: If5c2ce81a92d751c3481d7613611b9373060f78a
2017-07-26 16:25:40 +00:00
Bryce Lee
512e5d1b9b Merge "Do not report app bound differences as a Configuration change." into oc-dr1-dev 2017-07-26 14:20:31 +00:00
TreeHugger Robot
94902c46ba Merge "compressed images on system partition" into oc-mr1-dev 2017-07-26 01:09:33 +00:00
Makoto Onuki
5d26d8ab06 Merge "Don't unbind from the sync adapter before cancelSync()." into oc-dr1-dev
am: 906d8f57bf

Change-Id: Ied5b515396764d398807c4f945aaf55af87de03a
2017-07-25 22:58:23 +00:00
Calin Juravle
f1ff36f0f9 Use the class loader context when optimizing secondary dex files
Record the class loader context for secondary dex loads and pass it to
dexopt during compilation.

The class loader context is passed from libcore every time a
BaseDexClassLoader is created and its recorded in the package dex usage
file.

Note that the context may be:
- unknown: if the dex file was not use after the the upgrade and its
context was not yet updated
- unsupported: if any of the class loaders from the loading context is
unsupported (only PathClassLoader and DelegateLastClassLoader are
supported).
- variable: if it changes over time, form one run to another.

In all the above cases the old compilation behavior is preserved for
now.(i.e. the dex file with be compiled with SKIP_SHARED_LIBRARY_CHECK)

Bug: 38138251
Test: runtest -x
services/tests/servicestests/src/com/android/server/pm/dex/
      adb shell cmd package compile -f -m quicken ^Csecondary-dex
com.google.android.gms

(cherry picked from commit 3bec94d78b)

Change-Id: Ie8b78c7c0d5de43733b3d116f8dcb3a65324cca8
2017-07-25 14:21:49 -07:00
TreeHugger Robot
906d8f57bf Merge "Don't unbind from the sync adapter before cancelSync()." into oc-dr1-dev 2017-07-25 20:49:39 +00:00
Bryce Lee
600daddb67 Do not report app bound differences as a Configuration change.
App bounds are an internal Configuration field and should not
influence the diff that determines whether the Configuration has
changed. This changelist ensures this by introducing a new flag that
is identified server side and filtered before informing the client
that the configuration has changed.

Change-Id: Ibf1387f73eaa9b39e6213e1a1109c4cd57554e7c
Fixes: 63927944
Test: bit FrameworksServicesTests:com.android.server.wm.AppBoundsTests#testAppBoundsConfigurationDiff
Test: go/wm-smoke
2017-07-25 18:20:29 +00:00
Todd Kennedy
7c8addfef0 compressed images on system partition
Change-Id: I43c8c331883b5b381fb0f133fff448f3a57d0fe5
Bug: 36446542
Test: Manual
Test: Create a stub and a compressed application; put on the /system partition
Test: Restart the system and see that it decompresses the full application onto the /data partition
Test: Restart again and see that we skip decompression
Test: Create an invalid compressed application [eg. empty file]
Test: Restart the system and see that the stub is disabled
Test: Restart again and see that we skip decompression
2017-07-25 10:45:13 -07:00
TreeHugger Robot
be74124264 Merge "Add API for virtual preloads" into oc-mr1-dev 2017-07-25 16:13:08 +00:00
Todd Kennedy
78a72501af Add API for virtual preloads
Virtual preloads are applications that aren't actually on the
/system partition, but, act as if they were. One such distinction
is that these apps receive Intent.ACTION_BOOT_COMPLETED and start
out of the stopped state.

Change-Id: I812d3e7008b9d87e84aa33dbc4b3d8e8b334533c
Fix: 34855677
Test: Manual
Test: Install an app with "--preload"
Test: See that it receives Intent.ACTION_BOOT_COMPLETED
2017-07-25 06:48:39 -07:00
Todd Kennedy
dbaef6dc62 Add cross user permission checks
Change-Id: I5d46248fafe52dea66a33c416fbe151776b73679
Fixes: 62348076
Test: Manual
2017-07-24 11:28:00 -07:00
Makoto Onuki
4fdefef7a1 Merge "Don't keep parceled extras for history broadcasts." into oc-mr1-dev 2017-07-24 17:42:31 +00:00
Makoto Onuki
5eb5ec71fa Merge "Persist/pacel # of periodic syncs properly." into oc-dr1-dev
am: 5bbf44e715

Change-Id: Icb54710f8a76f674c75c79e9992eb03264ff3142
2017-07-22 00:57:59 +00:00
TreeHugger Robot
5bbf44e715 Merge "Persist/pacel # of periodic syncs properly." into oc-dr1-dev 2017-07-22 00:45:24 +00:00
David Friedman
93a1ab8ba1 Merge "Docs: Updates guidance about using permissions when accessing OBB expansion files, Bug: 34273998 Test: Ran "make" to verify error-free building." into oc-dev am: e4d0557334
am: f20c492190

Change-Id: I57da50e47d3fdfefa245baffdeaf16322b28fa30
2017-07-21 23:57:01 +00:00
Makoto Onuki
97f82f28da Don't keep parceled extras for history broadcasts.
On dumpsys we do show history broadcast intents with extras, but
if an intent's extras are still parceled, we can't show anything
(but the length) anyway, so let's just remove them, because sometimes
they contain heavy objects such as bitmaps.

Bug: 62144301
Test: manual tests: Boot, add account start apps, insert SIM
Change-Id: Ia64dd46d66fba3098e32c435509f4940ae978710
2017-07-21 16:51:16 -07:00
David Friedman
f20c492190 Merge "Docs: Updates guidance about using permissions when accessing OBB expansion files, Bug: 34273998 Test: Ran "make" to verify error-free building." into oc-dev
am: e4d0557334

Change-Id: I931088e43f29707e1ab5d9764a06adbbe5af1d7e
2017-07-21 23:11:16 +00:00
David Friedman
e4d0557334 Merge "Docs: Updates guidance about using permissions when accessing OBB expansion files, Bug: 34273998 Test: Ran "make" to verify error-free building." into oc-dev 2017-07-21 23:01:56 +00:00
Makoto Onuki
fdc5723076 Persist/pacel # of periodic syncs properly.
(Note it shouldn't be persisting parceled data in the first place.  There's
already a bug filed for that.)

Bug 63935632
Test: manaul test

Change-Id: I5385caa6cd0663c7e13db0256b2c1027abe6c3a1
2017-07-21 15:30:35 -07:00
Makoto Onuki
6a6ae04bd2 Don't unbind from the sync adapter before cancelSync().
- Also remove the unused method from ISyncAdapter.aidl

Bug: 63773598
Test: Manual test
Change-Id: Ifb2fc520759e83ad961032f9e217100e038e1a8c
2017-07-21 11:44:00 -07:00
Calin Juravle
b6f844d28c Add a command line option to optimize individual splits
The new option is "--split SplitName" and applies to "adb shell cmd
package compile" command.

Usage example:
adb shell cmd package compile -m speed --split split_feature_a.apk
com.android.cts.classloadersplitapp

Bug: 38138251

Test: adb install-multiple CtsClassloaderSplitApp.apk
CtsClassloaderSplitAppFeatureA.apk CtsClassloaderSplitAppFeatureB.apk
      adb shell cmd package compile -m speed --split split_feature_a.apk
com.android.cts.classloadersplitapp
      check the status of split_feature_a
      runtest -x
services/tests/servicestests/src/com/android/server/pm/dex/DexoptOptionsTests.java

Change-Id: I579bb12fa6699f99cd3824f185bd9352fb8007c5
2017-07-19 15:04:48 -07:00
Calin Juravle
1d0e83d2ce Refactor the arguments passed to dexopt invocations
Wrap the arguments passed to the various performDexopt calls into the
DexoptOptions object.

This will make adding extra arguments (like compile only a split) much
easier and avoid extending quite a few internal methods.

Bug: 38138251
Test: adb shell cmd package compile ....
      adb shell cmd package bg-dexopt-job ...
      install new apps and check that they compiled
      runtest -x
services/tests/servicestests/src/com/android/server/pm/dex/DexoptOptionsTests.java

Change-Id: Ia9930edd2dceb7535d6168eceb8e3199c82b6306
2017-07-19 14:58:27 -07:00