Commit Graph

12086 Commits

Author SHA1 Message Date
Taran Singh
c0263d94a1 Merge "Add showInsets method in IWindow" 2019-10-03 11:10:02 +00:00
Tarandeep Singh
0bedd94994 Add showInsets method in IWindow
Add showInsets(types, fromIme) in IWindow in order for WM to be able to request
show for any of the InsetTypes.
Note: This will be used in followup CLs.

Bug: 139487540
Bug: 118118435
Test: Build passing

Change-Id: Ie988d0a234befa530ca236a3bb32c77d8a4dce21
2019-10-01 13:22:55 -07:00
Winson Chiu
29f3a0b63d Merge "Revert "Deprecate PackageParser#Package"" 2019-10-01 00:31:40 +00:00
Winson Chiu
8e18a0ab89 Revert "Deprecate PackageParser#Package"
This reverts commit 243e7ea14b.

Reason for revert: b/141854898

Exempt-From-Owner-Approval: Revert for failure to boot

Change-Id: Id6812e5ecf7d88504706b2c4110d83f1034ab85c
2019-10-01 00:23:30 +00:00
TreeHugger Robot
0617359e5a Merge "Allowing more than one app to suspend apps" 2019-09-30 22:43:18 +00:00
Tobias Thierer
1b74a25f2d Merge changes from topics "bug136256059_attempt2", "bug136256059_builder" am: 6ed8fce33f am: ffd40f7bd4 am: 4b461c1588
am: dd268bd09d

Change-Id: Ib2f595355bf3e939e1780ebbd749af360c908641
2019-09-30 03:15:10 -07:00
Tobias Thierer
1afa40c3c4 Move default MimeMap implementation to frameworks. am: 878c77b704 am: 2b754d1fb3 am: effe42d0b5
am: 752d297aab

Change-Id: I938962e186475a2cb403a1ded40379adcaeb5266
2019-09-30 03:14:56 -07:00
Tobias Thierer
dd268bd09d Merge changes from topics "bug136256059_attempt2", "bug136256059_builder" am: 6ed8fce33f am: ffd40f7bd4
am: 4b461c1588

Change-Id: Ie3442bd7a8b27b9d446137079bbacb125dff753d
2019-09-30 03:02:29 -07:00
Tobias Thierer
752d297aab Move default MimeMap implementation to frameworks. am: 878c77b704 am: 2b754d1fb3
am: effe42d0b5

Change-Id: I694d5adf4e852de1ebc9090926812780fdec6d13
2019-09-30 03:02:17 -07:00
Tobias Thierer
4b461c1588 Merge changes from topics "bug136256059_attempt2", "bug136256059_builder" am: 6ed8fce33f
am: ffd40f7bd4

Change-Id: I66ced024c5cda2ef37e62433c8e65b9d49ca9d3f
2019-09-30 02:50:20 -07:00
Tobias Thierer
effe42d0b5 Move default MimeMap implementation to frameworks. am: 878c77b704
am: 2b754d1fb3

Change-Id: I6c282aacb196189458ab5f8d715b51fa786cdfe6
2019-09-30 02:50:08 -07:00
Tobias Thierer
ffd40f7bd4 Merge changes from topics "bug136256059_attempt2", "bug136256059_builder"
am: 6ed8fce33f

Change-Id: If95ba459b29a3fd2eede6390bbab18f95f762587
2019-09-30 02:38:49 -07:00
Tobias Thierer
2b754d1fb3 Move default MimeMap implementation to frameworks.
am: 878c77b704

Change-Id: Ic8f8c2c1fc10809e3245ee6b729e69a4ecb30ffa
2019-09-30 02:38:30 -07:00
Tobias Thierer
6ed8fce33f Merge changes from topics "bug136256059_attempt2", "bug136256059_builder"
* changes:
  MimeMapImpl.createDefaultInstance() -> DefaultMimeMapFactory.create().
  Make MimeMap final and introduce MimeMap.Builder.
  Move default MimeMap implementation to frameworks.
2019-09-30 09:15:53 +00:00
Anna Trostanetski
eb4087d89b Merge "Rate limit non statsd logs." am: e8e6390829 am: c1abc25905 am: 5912d35e17
am: fc8a18878a

Change-Id: Ia88d7f04944c5eece96df1942f8633f379b3780a
2019-09-27 18:42:12 -07:00
Winson Chiu
7267e3ef6b Merge "Deprecate PackageParser#Package" 2019-09-27 18:02:56 +00:00
TreeHugger Robot
a3dfb5f2c4 Merge "Integrate pooled lambda with systrace." 2019-09-27 17:18:07 +00:00
Anna Trostanetski
fc8a18878a Merge "Rate limit non statsd logs." am: e8e6390829 am: c1abc25905
am: 5912d35e17

Change-Id: I1f6571cdbb59eb086fe9e929712ed453ca5ae6d1
2019-09-27 09:33:32 -07:00
Anna Trostanetski
5912d35e17 Merge "Rate limit non statsd logs." am: e8e6390829
am: c1abc25905

Change-Id: Ie6e945dbe51d8b9a871007522565c472eeffefb3
2019-09-27 09:27:19 -07:00
Tobias Thierer
af0cef987d MimeMapImpl.createDefaultInstance() -> DefaultMimeMapFactory.create().
The class no longer implements MimeMap, so the name MimeMapImpl
no longer made sense.

Test: Treehugger
Bug: 136256059
Change-Id: I2cbc70a7769232b704a9bdfde2def832c1e292b8
2019-09-27 17:25:13 +01:00
Anna Trostanetski
c1abc25905 Merge "Rate limit non statsd logs."
am: e8e6390829

Change-Id: Ib6ef1c746f26ceb384f7ed586bfc769a05da271c
2019-09-27 09:15:37 -07:00
Tobias Thierer
878c77b704 Move default MimeMap implementation to frameworks.
This is the second attempt to submit this CL. The first attempt
regressed on app startup because RuntimeInit installed the
custom MimeMap from commonInit() which runs post-fork of the zygote,
but that was fixed by installing it pre-fork.

This CL topic moves the default MimeMap implementation to frameworks.
Libcore starts with a minimal implementation sufficient to pass
CtsLibcoreTestCases,  but frameworks can inject the real implementation.
Before this CL topic, the data files and logic (MimeMapImpl) were part of
core-*.jar on device; after this CL, they instead live in framework.jar.

Tests from MimeMapTest that check behavior of that default
implementation also move to a non-libcore CTS test.

Planned work for follow-up CL:
 1. Make CTS more opinionated, with a plan to assert that all of
    the default mappings are present. How exactly the expectated
    mapping will be bundled in CTS is still TBD.
 2. Add a vendor.mime.types file (defaults to empty) where vendors
    can add additional mappings; I plan to make it such that mappings
    in that file are parsed last but never override any earlier
    mappings, as if each mime type / file extension was prefixed
    with '?'.
 3. Perhaps enforce that public APIs android.webkit.MimeTypeMap
    and java.net.URLConnection.getFileNameMap() behave consistently
    with MimeMap.getDefault().

Test: atest CtsLibcoreTestCases
Test: atest CtsMimeMapTestCases
Test: Checked that CtsLibcoreTestCases still passes on a build that
      is missing the MimeMap.setDefault() call from RuntimeInit.java.
Test: Checked that app startup time does not regress as part of this
      CL topic - see http://b/136256059#comment17
Bug: 136256059

Change-Id: I716914bf1a7e6205e539f0551f010615dacb17a8
2019-09-27 16:53:15 +01:00
atrost
a8f3c48495 Rate limit non statsd logs.
Limit 1 log per app launch as the statd logs as this is spamming logs.
Consider increasing in the future to once every x minutes/seconds if
needed.

Bug: 138374585
Bug: 141714588
Test: flash device
Change-Id: I3ed696fb557527d807d03aecc64c0207d7b93f08
2019-09-27 11:25:06 +00:00
Felipe Leme
4bc790d232 Integrate pooled lambda with systrace.
Looper traces handler calls by calling Handler.getTraceName(), which when used with PooledLambda
ends up showing just:

"android.os.Handler: com.android.internal.util.function.pooled.PooledLambdaImpl"

That name doesn't help understand what's the real bottleneck, and even worse, could let people
think it's the PooledLambda who's causing it.

Which this change, it will display names like:

com.android.server.appop.AppOpsService$Lambda
com.android.server.wm$Lambda

Fixes: 141172840
Test: manual verification (neither PoolLambda nor Message have unit tests)

Change-Id: I80d2158a50a644b10f3724fb42a4a9c2aee63ae9
2019-09-26 16:45:43 -07:00
Jeongik Cha
cac5791954 Merge changes from topic "system_ext" am: a828ee6442 am: dee02a0fae
am: 6a46c5315a

Change-Id: Ic31f9d12fffda486d36ce427848e04c7755cc531
2019-09-26 16:00:00 -07:00
Jeongik Cha
6a46c5315a Merge changes from topic "system_ext" am: a828ee6442
am: dee02a0fae

Change-Id: If2cc7cfe20182578b4e3c515f42209d9446f6a68
2019-09-26 15:53:32 -07:00
Jeongik Cha
dee02a0fae Merge changes from topic "system_ext"
am: a828ee6442

Change-Id: I2b636d0c54c932342586de47a38c16e93bf978e8
2019-09-26 15:40:26 -07:00
Treehugger Robot
a828ee6442 Merge changes from topic "system_ext"
* changes:
  Consider overlay in system_ext as system's
  Support /system_ext partition
2019-09-26 22:18:07 +00:00
Winson
243e7ea14b Deprecate PackageParser#Package
Replaces PackageParser#Package and it's related structures with
ParsingPackage, ParsedPackage, and AndroidPackage.

This is a large scoped CL, the first step in an eventual goal
to refactor how data is handled in the package parsing and install
process. It introduces as few logic changes as necessary. Mostly
migrating to interfaces and renaming, moving parsing data calls into
3 separate interfaces that outline the intended flow for parsing.

ParsingPackage is built and used during what was PackageParser, now
replaced by ApkParseUtils and it's related classes. This is almost
exactly what was parsed from the XML/files on disk.

ParsedPackage is used when the object exits PackageParser and is
adjusted by PackageManagerService to what is considered the final
"parsed" state, adjusted from literal values, but consistent given
the same APK on disk. This should eventually be moved out of PMS
and possibly collapsed into the previous interface entirely.

AndroidPackage is the final state of the package after parsing and
adjustment has completed and no more mutations should be expected.
There are a few exceptions to this, included in AndroidPackageWrite,
which will eventually be refactored into PackageSetting or another
state class.

This marks PackageParser#Package and all the old infrastructure with
@Deprecated, as none of them are used internally. All usages were
converted, and the legacy Package is only built for un-converted tests
and @UnsupportedAppUsage methods.

There are numerous TODOs still outstanding, but addressing them
in this initial CL would introduce several logic changes. They've been
marked with the bug number and will be handled in follow ups.

This is being merged with caution thrown to the wind because
testing this on devices and in development will be the best way
to debug differences introduced by the migration. Getting it merged
as early as possible gives the most amount of time to fix regressions.

Waiting for tests of all the functionality could take literal years
before covering enough to merge this with all regressions verified.

Given a sample size of 4 heap dumps and the caveat it was taken very
early in the migration, there is a memory overhead of about 200 KB
versus the legacy implementation. This should be verified more
accurately and addressed in follow ups.

This CL also kills child/parent package support, since that's
broken already, and difficult to support with the new interface
structure.

Bug: 135203078

Test: booted an emulator, works generally as expected

Specific tests which failed / failed to build were fixed, but because
not all tests are currently passing before this change, not all were
verified.

Change-Id: I4ba050c228e6c60b8f63a9e3347b1f9a57ef794a
2019-09-26 13:27:17 -07:00
Tobias Thierer
2ee7cf7386 Merge "Introduce ZygoteInit.preForkInit()." am: 52efd46075 am: 4edffff80a am: 023ae56991
am: a3dc6e86fc

Change-Id: I0f30ca38d41c5aa9e444e29d0d23b346dc12909d
2019-09-26 12:36:50 -07:00
TreeHugger Robot
d09a2bf54e Merge "Nullcheck ServiceConnector argument" 2019-09-26 19:33:49 +00:00
Tobias Thierer
a3dc6e86fc Merge "Introduce ZygoteInit.preForkInit()." am: 52efd46075 am: 4edffff80a
am: 023ae56991

Change-Id: I4f6fcc59933e31f0c99d10a5da83aa8c66e5fc3a
2019-09-26 12:29:56 -07:00
Tobias Thierer
023ae56991 Merge "Introduce ZygoteInit.preForkInit()." am: 52efd46075
am: 4edffff80a

Change-Id: Ifc0061d8cf9ee3c5860f31fa9ad821bfcd0b6a88
2019-09-26 12:20:55 -07:00
Tobias Thierer
4edffff80a Merge "Introduce ZygoteInit.preForkInit()."
am: 52efd46075

Change-Id: I5bc25ca924624283126a584917f5adb6ff6eed03
2019-09-26 12:08:06 -07:00
Tobias Thierer
52efd46075 Merge "Introduce ZygoteInit.preForkInit()." 2019-09-26 18:38:39 +00:00
atrost
1904bb31ad Merge "Refactor ChangeReporter and rate limit stats logging." am: 9a253e12cc am: 76191fa6b0 am: 604f8002d8
am: 7564285e10

Change-Id: Ib6605757514b90ec5fb2df03f08fc7d48d12e08e
2019-09-26 10:59:12 -07:00
atrost
7564285e10 Merge "Refactor ChangeReporter and rate limit stats logging." am: 9a253e12cc am: 76191fa6b0
am: 604f8002d8

Change-Id: I5ed4a64b701041393026b742bc3f451d73c4ed33
2019-09-26 10:52:39 -07:00
atrost
604f8002d8 Merge "Refactor ChangeReporter and rate limit stats logging." am: 9a253e12cc
am: 76191fa6b0

Change-Id: I8c853fb3e09a83ad877f02132608884cfaba966f
2019-09-26 10:45:54 -07:00
atrost
76191fa6b0 Merge "Refactor ChangeReporter and rate limit stats logging."
am: 9a253e12cc

Change-Id: I33b14641d259efea6bf7038da264a3483e71f955
2019-09-26 10:39:31 -07:00
Eugene Susla
2ffea17af2 Nullcheck ServiceConnector argument
Fixes: 141617464
Test: presubmit
Change-Id: I511175ccca23f482892887007e4e8e5b06f00832
2019-09-26 10:33:18 -07:00
Tobias Thierer
a45917eb77 Introduce ZygoteInit.preForkInit().
Until recently, I and apparently some others were under the assumption
that RuntimeInit.commonInit() runs before the Zygote fork. Actually, it
does not.

This CL introduces a method ZygoteInit.preForkInit() which runs before
the Zygote fork. For now, only enableDdms() moves into it and can become
private. This should not alter behavior since enableDdms() is called
from the same places as before, and because enableDdms() (now private)
was already not part of any API surface.

The CL also removes the qualifier "final" from the (static) method
enableDdms(), because it is redundant.

Note: This CL was uploaded with --no-verify because of preexisting
import ordering issues in RuntimeInit.java

Test: Treehugger
Change-Id: I8f637e160a2d7810feb43b6a43ec7d628af18fb8
2019-09-26 16:08:59 +01:00
atrost
6624ffa207 Refactor ChangeReporter and rate limit stats logging.
Only log once per change-package-state(resets every app launch if used
from within the app process).

Next: reset every app launch for server usage as well.

Test: using the test app.
Bug: 138374585
Change-Id: I5587f7138cf2cd8d144e88cf294e65c14bb32bfb
2019-09-26 12:59:19 +01:00
Suprabh Shukla
d3278449d7 Allowing more than one app to suspend apps
We want to allow wellbeing apps to suspend in managed profiles.
This requires changing the internal data design of package-suspend
state to allow more than one suspending package, each with their
own parameters, namely - dialog info, app extras and launcher extras.

Also, removed the restriction of using setPackagesSuspendedAsUser when a
PO/DO exists

Test: atest com.android.server.pm.PackageUserStateTest
atest com.android.server.pm.PackageManagerSettingsTests
atest com.android.server.wm.ActivityStartInterceptorTest
atest GtsSuspendAppsTestCases

Bug: 138812320
Change-Id: If1263142fc9e6687e95af9b8d71ba8eff0c0fae9
2019-09-25 17:11:17 -07:00
Anna Trostanetski
bbf394bf19 Merge "Add package name based APIs to PlatformCompat." am: ef530d9fa4 am: 29a23e753a am: 0a96b3aff3
am: 6dd3bf2e50

Change-Id: Id6ca3662746565a63f6a5db4fa4f67227b9215da
2019-09-25 12:35:26 -07:00
Anna Trostanetski
6dd3bf2e50 Merge "Add package name based APIs to PlatformCompat." am: ef530d9fa4 am: 29a23e753a
am: 0a96b3aff3

Change-Id: I6844ad19650aef716339e2b6a1d91cfe93f0115a
2019-09-25 12:28:52 -07:00
Anna Trostanetski
0a96b3aff3 Merge "Add package name based APIs to PlatformCompat." am: ef530d9fa4
am: 29a23e753a

Change-Id: I1872639b936ddd40a0b4aa75b418faec4d04f308
2019-09-25 12:21:48 -07:00
Anna Trostanetski
29a23e753a Merge "Add package name based APIs to PlatformCompat."
am: ef530d9fa4

Change-Id: Ib6e31e0439efd856cc834ee5590e2419c25f3197
2019-09-25 12:04:33 -07:00
TreeHugger Robot
be0f335f5a Merge "Whitelist packages for user types" 2019-09-25 18:45:13 +00:00
atrost
12d0da3179 Add package name based APIs to PlatformCompat.
The APIs behave the same as the AppInfo APIs, and returns the change is
enabled if there is no installed package with the provided name.

Test: flashed device, used the test app, and made the API use the new
      per-package API.
Bug: 138275545

Change-Id: Ic925751dddc6c2e0996fe195a208f5c689554839
2019-09-25 16:32:07 +01:00
Zimuzo Ezeozue
a56baba8cb Merge "Support a mount mode to bypass FUSE on /storage" 2019-09-25 12:29:38 +00:00