Commit Graph

5928 Commits

Author SHA1 Message Date
Jeff Sharkey
5cb2d64b9b Merge "Fix handling of @removed APIs." into oc-mr1-dev 2017-08-10 15:18:58 +00:00
Narayan Kamath
af706b40de Merge "PackageParser: Parse android:classLoader during the full parse." into oc-mr1-dev 2017-08-10 11:04:40 +00:00
TreeHugger Robot
c75f43c1ab Merge "Go: add features for low ram / normal ram devices." into oc-mr1-dev 2017-08-10 04:35:09 +00:00
Dianne Hackborn
2a103f126f Go: add features for low ram / normal ram devices.
Automatically populated from ActivityManager.isLowRamDevice().

Test: manual

Change-Id: I027b8ae0205c9793a91ffdd2635479610a62aff9
2017-08-09 17:14:00 -07:00
Garry Boyer
478f94ba7f Merge "Revert multi-package APK flag to off." into oc-mr1-dev 2017-08-09 23:24:28 +00:00
Jeff Sharkey
f52db085e2 Fix handling of @removed APIs.
The @removed docs tag means that a particular API should be considered
as removed from the API surface area that it otherwise would have been
exposed through.

This set of CLs is fixing a bug where we @removed had been treated as
always removing from the public API.

Bug: 62341924
Test: make -j32 update-api
Change-Id: I336b2df4804e947a0b93a12269d6e7c5594eef7e
2017-08-09 09:18:20 -06:00
TreeHugger Robot
e551d361ac Merge "Allow applications to define failure handlers" into oc-mr1-dev 2017-08-09 14:55:09 +00:00
Narayan Kamath
96c11c58c9 PackageParser: Parse android:classLoader during the full parse.
There's no need to do this during a "lite" parse. Moreover, we don't
resolve resource references during a lite parse, which means that we
lose a lot of flexibility.

Test: CtsAppSecurityTestCases
Bug: 64339642

Change-Id: I7d02faab6bd226d96d63d2edd8c06b94e15e14ad
2017-08-09 15:32:00 +01:00
TreeHugger Robot
a530d79209 Merge "Intern process names." into oc-mr1-dev 2017-08-09 01:10:03 +00:00
TreeHugger Robot
81021c77c8 Merge changes from topic 'ClosebySystem' into oc-mr1-dev
* changes:
  Allow to close session from wrong context.
  Prevent closing by prev owner after transfer.
  Revert "Revert session-transfer change"
2017-08-09 01:01:11 +00:00
TreeHugger Robot
6bf2990e28 Merge "Add virtual preload bit to ApplicationInfo" into oc-mr1-dev 2017-08-08 23:33:03 +00:00
Todd Kennedy
d0084f7583 Allow applications to define failure handlers
Fixes: 37956764
Test: Manual
Test: Create a test app with no handler, see it's not passed to the installer
Test: Create a test app with a handler, see it's passed to the installer
Test: Create a test app with multiple handlers, see one is passed to the installer
Test: Create a test app with a handler defined in a split, see it's not passed to the installer
Change-Id: Idfc3648154afca7ec300019d9695417274118d6f
2017-08-08 22:17:13 +00:00
Makoto Onuki
812d188afb Intern process names.
Bug: 62144301
Test: Boot and start random apps on a secondary user
Change-Id: I8a9b475410c52e1063cff5519b0297ad69dd7925
2017-08-08 14:58:48 -07:00
Todd Kennedy
5eb5a7db83 Add virtual preload bit to ApplicationInfo
Change-Id: I2735b3823a8709b2ffb65cc8085ffcd952d3e1f2
Fixes: 64205417
Test: Manual
Test: Create a sample app and install it as a normal app
Test: See that it returns 'false' for "isVirtualPreload"
Test: Create a sample app and install it as a virtual preload ["--preload"]
Test: See that it returns 'true' for "isVirtualPreload"
Test: Run sample apps after reboot and see they return the correct value
2017-08-08 13:50:07 -07:00
Philip P. Moltmann
7460c5917b Revert "Revert session-transfer change"
This reverts commit 9890f8b426.

Bug: 64467704
Test: cts-tradefed run singleCommand cts-dev -m CtsContentTestCases --test=android.content.pm.cts.InstallSessionParamsUnitTest
      cts-tradefed run singleCommand cts-dev -m CtsContentTestCases --test=android.content.pm.cts.InstallSessionTransferTest
Change-Id: I0cc7e1129d85e4d0de16ade44232a9bd381d6c04
2017-08-08 13:17:15 -07:00
Philip P. Moltmann
7bec053dff Merge "Revert session-transfer change" into oc-mr1-dev 2017-08-08 19:49:13 +00:00
Philip P. Moltmann
9890f8b426 Revert session-transfer change
This reverts:
5d74493f64
94deaf7725

Bug: 64467704
Test: none, 100% revert
Change-Id: I6534c19c594dadfa41457725988485a67f0ed45f
2017-08-08 11:04:56 -07:00
TreeHugger Robot
8c18e1faf8 Merge "Add native bindings for getNamesForUids" into oc-mr1-dev 2017-08-08 15:58:41 +00:00
TreeHugger Robot
fdaad13803 Merge changes from topic 'TransferInstallSession-oc-mr1-dev' into oc-mr1-dev
* changes:
  Allow to read all params used to create session.
  Allow to transfer+seal a install session
2017-08-08 00:45:48 +00:00
Garrett Boyer
476725d011 Revert multi-package APK flag to off.
Disable tests when multi-package APK is disabled.

Test: Ran framework tests with flag both on and off.
Change-Id: I0aae693816af06eebe1bc6cdeebf8dad4c179260
(cherry picked from commit 17041530bf)
2017-08-07 23:15:07 +00:00
TreeHugger Robot
ce3e863f31 Merge "Reduce duplicate strings due to the package cache." into oc-mr1-dev 2017-08-07 21:05:42 +00:00
Peter Qiu
e2dc2d9e9a Merge "Revert "PackageManager: update documentation for FEATURE_WIFI_PASSPOINT"" into oc-mr1-dev 2017-08-07 20:12:05 +00:00
Peter Qiu
50354046ac Revert "PackageManager: update documentation for FEATURE_WIFI_PASSPOINT"
This reverts commit 8493332166.

Change-Id: Ibecf24689952d4888269863ff02d8c97e14a0c31
2017-08-07 20:06:20 +00:00
TreeHugger Robot
cbf16572eb Merge "PackageManager: update documentation for FEATURE_WIFI_PASSPOINT" into oc-mr1-dev 2017-08-07 18:19:59 +00:00
Philip P. Moltmann
5d74493f64 Allow to read all params used to create session.
So that they can be verified by the app calling commit().

This really only makes sense if the app calling commit is different from
the app that created the session.

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

Change-Id: I5c954ca59b7582555bea847f3ddbba0aeefba301
2017-08-07 10:50:58 -07:00
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
Makoto Onuki
4501c61d65 Reduce duplicate strings due to the package cache.
Change from the previous attempt:
- Fixed the helper class.  The original version had a few bugs.
- Bundle.readFromParcel() now handles a Parcel with a read-write helper
properly.

** Comparison **
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:
- #1 First boot:
-- https://docs.google.com/spreadsheets/d/1CbmU8cQQQw7n7tyqbZi3beRHNuzqcmJgdvzDpi40Q1I/edit#gid=1971317391
-- Private dirty stabilizes at ~16.8M.
-- Loading system packages took 1.8 seconds.

- #2 Second boot:
-- https://docs.google.com/spreadsheets/d/1CbmU8cQQQw7n7tyqbZi3beRHNuzqcmJgdvzDpi40Q1I/edit#gid=982210726
-- Private dirty stabilizes at ~17.5M.
-- Loading system packages took 0.5 seconds.

With fix:
- #3 First boot:
-- https://docs.google.com/spreadsheets/d/1R6lL0AnAp93HnrqWujJFNgOjj6wvGicgDlbDAevbc3g/edit#gid=791764875
-- Private dirty stabilizes at around the same level as #1.
-- Loading system packages took 1.9 seconds.

- #4 Second boot:
-- https://docs.google.com/spreadsheets/d/1CbmU8cQQQw7n7tyqbZi3beRHNuzqcmJgdvzDpi40Q1I/edit#gid=1820894299
-- Private dirty stabilizes at around the same level as #1.
-- Loading system packages took 0.7 seconds.

Package manager start up time with and without the fix:
- (Ignored ones that are too fast; probably the thermal throttling didn't kick in.)
- https://docs.google.com/spreadsheets/d/1CbmU8cQQQw7n7tyqbZi3beRHNuzqcmJgdvzDpi40Q1I/edit#gid=499396796
- Before: 3.5 seconds (average of 5 reboots)
- After: 3.6 seconds (average of 5 reboots)

Package scan speed comparison:
- With the fix, first boot.
08-03 08:49:56.851  1000   779   779 I PackageManager: Finished scanning system apps. Time: 2133 ms, packageCount: 143 , timePerPackage: 14 , cached: 0
08-03 08:49:56.971  1000   779   779 I PackageManager: Finished scanning non-system apps. Time: 121 ms, packageCount: 11 , timePerPackage: 11 , cached: 0

- With the fix, second boot.
08-03 08:53:29.387  1000   779   779 I PackageManager: Finished scanning system apps. Time: 484 ms, packageCount: 143 , timePerPackage: 3 , cached: 143
08-03 08:53:29.424  1000   779   779 I PackageManager: Finished scanning non-system apps. Time: 37 ms, packageCount: 11 , timePerPackage: 3 , cached: 11

** Conclusion **
- This CL wil slightly slow down the boot time (0.2 seconds on a thermal-throttled bullhead), but
the system server's ram consumption will go down to the no-cache level.

- Using the package cache is still faster than not using it.

Test: build, boot, reboot, adb-install, reboot
Test: bit FrameworksCoreTests:android.content.pm.PackageParserTest
Test: bit FrameworksServicesTests:com.android.server.pm.PackageParserTest
Test: cts-tradefed run cts-dev --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -l INFO -m CtsOsTestCases -t android.os.cts.BundleTest

Bug: 64112468
Change-Id: I30691a032cb1dd1c7f6c1966a096c2f0d07a09cb
2017-08-04 14:19:32 -07:00
Todd Kennedy
ad192a392b Add native bindings for getNamesForUids
A new API [getNamesForUids] was recently added to the PackageManager
and this API needs to be accessible to native code. However, there
were two constraints:
1) Instead of hand-rolling the binder, we wanted to auto generate
the bindings directly from the AIDL compiler.
2) We didn't want to expose/annotate all 180+ PackageManager APIs
when only a single API is needed.
So, we chose to create a parallel API that can be used explicitly
for native bindings without exposing the entirety of the
PackageManager.

Bug: 62805090
Test: Manual
Test: Create a native application that calls into the new service
Test: See the call works and data and returned
Change-Id: Ia571ab1607c6c88fef44eb0de6a313a28906c732
2017-08-04 13:36:37 -07:00
Peter Qiu
8493332166 PackageManager: update documentation for FEATURE_WIFI_PASSPOINT
Bug: 64331342
Test: build
Change-Id: I94937e8ff921b01c62e6b478b3ee6e581e38408e
2017-08-04 09:37:50 -07: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