- Added a new API to get the cutout paths.
- Create a @hide class CutoutPathParserInfo
- Used to store the needed info to create the cutout paths.
- Will be used when DisplayCutout.getCutoutPath() is called to
create the cutout paths.
Bug: 172646505
Test: atest DisplayCutoutTest DisplayContentTests WmDisplayCutoutTest
Change-Id: Ief92ce4466f6bffb2a9375388b71de43049b4eef
Replace the usage of the constant and Package/ApkLite from
PackageParser by the alternative in order to move away from
PackageParser.
Bug: 174723245
Test: make
Test: atest -p core/java/android/content/pm \
core/java/com/android/internal/content \
services/core/java/com/android/server/pm \
services/tests/servicestests/src/com/android/server/pm
Change-Id: I4e2a7666b2feede3994a6075edfe4d18e80433e9
(cherry picked from commit ce0715ba54)
The API surface of com.android.dynsystem is already protected by
privileged permission android.permission.INSTALL_DYNAMIC_SYSTEM,
which is only granted to system apps or priv apps.
Thus the feature flag check here is redundant, because eligible
callers of this API (system app) can also set the feature flag.
Bug: 176795908
Test: Presubmit
Test: Test DSU installation Intent
Change-Id: Iedac8763372ef6f11754d3f272f70753fb3d4829
Merged-In: Iedac8763372ef6f11754d3f272f70753fb3d4829
The API surface of com.android.dynsystem is already protected by
privileged permission android.permission.INSTALL_DYNAMIC_SYSTEM,
which is only granted to system apps or priv apps.
Thus the feature flag check here is redundant, because eligible
callers of this API (system app) can also set the feature flag.
Bug: 176795908
Test: Presubmit
Test: Test DSU installation Intent
Change-Id: Iedac8763372ef6f11754d3f272f70753fb3d4829
Just an alias for put to allow `array[index] = value` syntax in Kotlin.
Bug: 163565712
Test: manual, used in tests for separate feature
Change-Id: Ie9e17b8f4d16a52f4dc213e1ada8d61fce9eedaf
* All these methods are still hidden
* Methods take either a dimen or a value with a TypedValue COMPLEX_UNIT (as used for TYPE_DIMENSION)
* Rather than having 8 margin methods, I chose to have only 2, and create an @IntDef MarginType
* Created a set of methods in TypedValue for creating typed value data equivalent to that of dimension resources.
Bug: 175345582
Test: atest TypedValueTest
Change-Id: I3a8a5a1511158a6dbf55d4f9931ba100a369cb35
This change enables the feature-flag which pivots most of the XML
data stored by the system_server to using a binary XML wire format.
Benchmarks have shown this binary format can be written over 4x
faster and parsed over 8x faster than human-readable XML while
seamlessly enabling client code to pivot between the two formats.
Bug: 171832118
Test: atest FrameworksServicesTests
Change-Id: Id43edc0627866aba55e580d17958c689a6cfcfad
As part of preparing to enable the new binary XML wire format across
the device, we ran a large suite of unit tests which uncovered a
handful of bugs where client code was assuming that the serializer
would create TEXT tokens for newlines between tags.
Also relaxes all binary XML classes to accept either "UTF-8" or
"utf-8" as the encoding name. Slight bug fixes to clear names, text,
and attributes for each event to match XmlPullParser documentation.
Fixes for existing unit tests that were assuming human-readable XML,
or assuming that the serialization would perform UTF-8 validation.
Bug: 171832118
Test: atest FrameworksServicesTests
Change-Id: I841fe41e4967b36ab17551294ae0f42fb87a8e71
Create Boolean result callback and apply it to :
-. showSoftInput
-. hideSoftInput
-. isInputMethodPickerShownForTest
-. isImeTraceEnabled
Bug: 163453493
Test: Manual test with keyboard
Test: atest CtsInputMethodTestCases
Change-Id: I1547b98b2aacf764e33aadc9ab784f2013f58f2f
When an attribute value is missing, we can immediately return the
default value instead of paying the cost of throwing an exception.
To bring this benefit to both human-readable and binary XML, this
is implemented by adding a new getAttributeIndex() lookup method
which is then used by default methods.
readExtraAttributes() also appears to be parsing a string list as
a boolean value (which seems very broken), so we add hand-rolled
parsing logic to avoid paying the cost of an exception. Someone
should follow up in the future to investigate if there's an actual
bug here.
Bug: 174544002
Test: manual
Change-Id: Id313d18000e345ca1acd3c66d2c0c0fc44769b71
Bug: 174932174
Test: I solemnly swear I tested this conflict resolution.
Exempt-From-Owner-Approval: refactoring with team leads buy-in
Change-Id: I9262a08ffc1ccede8e519d0eed90ed2bfcf0232c
As general background, OWNERS files expedite code reviews by helping
code authors quickly find relevant reviewers, and they also ensure
that stakeholders are involved in code changes in their areas.
Some teams under frameworks/base/ have been using OWNERS files
successfully for many years, and we're ready to expand them to cover
more areas. Here's the historical coverage statistics for the last
two years of changes before these new OWNERS changes land:
-- 56% of changes are fully covered by OWNERS
-- 17% of changes are partially covered by OWNERS
-- 25% of changes have no OWNERS coverage
Working closely with team leads, we've now identified clear OWNERS on
a per-package basis, and we're using "include" directives whenever
possible to to simplify future maintenance. With this extensive
effort, we've now improved our coverage as follows:
-- 98% of changes are fully covered by OWNERS
-- 1% of changes are partially covered by OWNERS
-- 1% of changes have no OWNERS coverage
This specific change is automatically generated by a script from
detailed ownership information confirmed by team leads.
Bug: 174932174
Test: manual
Exempt-From-Owner-Approval: refactoring with team leads buy-in
Merged-In: I9789c97c1de8e5d962b48c29c57d82fe83729eba
Change-Id: I9789c97c1de8e5d962b48c29c57d82fe83729eba
* changes:
Hand-migration to TypedXml interface.
Mechanically apply TypedXml refaster template.
Mechanical refactoring to new typed XML classes.
Additional hand-migration to TypedXml interface.
"Resolve" both human-readable and binary XML.
This change dumps information through IME tracing for the getter methods
exposed by the InputConnection interface. The dump is done through the
ImeTracing interface and is triggered by events in the wrapper classes
used to handle InputConnection implementations corresponding to:
- different apps
- InputMethodService
The new data is available under inputConnectionCall in the clients
output proto.
Bug: 154348613
Test: flash a device
start IME tracing by calling "adb shell ime tracing start"
end IME tracing by calling "adb shell ime tracing stop"
pull generated trace files and visualize in Winscope
or start tracing directly through ADB Connect and visualize traces
Change-Id: Iabd6af1b858803030848a0ef5e7dd9ecfc562716
Also removed wrong permission check on lockNow()- it was only
allowing non-admin apps with the LOCK_NOW permission when the
device doesn't support the feature.
Test: manual verification trying to switch user when car is moving
Bug: 172376923
Change-Id: Icd1bde3a6f27e08c00d8851d16c1a072f7441f32
Previous changes have applied mechanical refactorings, but this change
hand-migrates the remaining logic which was too complex to identify.
This change should have no behavior change; famous last words.
Bug: 171832118
Test: manual
Exempt-From-Owner-Approval: trivial refactoring
Change-Id: If2d4b1a354481a83edb4bbcfa22f690b7f5e97c3
Recent refactorings have pivoted many XML users across the system
to call resolveSerializer() and resolvePullParser(), which gives us
an easy path to pivot between human-readable XML and our binary XML
wire format.
This change introduces a feature flag (still disabled by default)
for emitting binary XML by default when serializing. It also adds
logic to automatically select the relevant parser by sniffing the
magic file header.
This is the key to our upgrade strategy: we'll gladly parse
human-readable XML from old devices, or binary XML from new devices.
Bug: 171832118
Test: atest FrameworksCoreTests:android.util.XmlTest
Test: atest FrameworksCoreTests:android.util.BinaryXmlTest
Change-Id: I14fdab9a6667819db38116a8ce126f5f2a5a04df
* changes:
Hand-migration to TypedXml interface.
Mechanically apply TypedXml refaster template.
Refaster templates for new TypedXml classes.
Mechanical refactoring to new XML resolvers.
Refine TypedXmlPullParser API interface.
* changes:
Log only current client data in IME tracing
Optimized workflow for IME tracing on InputMethodManagerService side
Optimized workflow for IME tracing on InputMethodService side
Optimized workflow for IME tracing on clients side
Techincally our additions should match the shape of the upstream
XmlPullParser interface, which throws XmlPullParserException when
there is a parsing issue; IOException should be reserved for actual
disk I/O issues.
Improve BinaryXmlPullParser handling of invalid inputs to match
how ForcedTypedXmlPullParser throws on any parsing trouble.
Bug: 171832118
Test: atest FrameworksCoreTests:android.util.XmlTest
Test: atest FrameworksCoreTests:android.util.BinaryXmlTest
Change-Id: I8f0e95d536b53570055a9e174f0849cf635da48c
A recent set of patches had mismatched handling of UTF-8 vs modified
UTF-8; this change converges all paths towards using modified UTF-8
to match the DataInput/Output API contract.
New tests verify that underlying raw data is compatible between the
upstream and local implementations.
Bug: 171832118
Test: atest FrameworksCoreTests:android.util.CharsetUtilsTest
Test: atest FrameworksCoreTests:android.util.XmlTest
Test: atest FrameworksCoreTests:android.util.BinaryXmlTest
Test: atest FrameworksCoreTests:com.android.internal.util.FastDataTest
Change-Id: I49423edc867839fb6626cd8bd361abe7bc512633
IME tracing information is added to bugreport if tracing was
previously enabled. IME tracing is reenabled after data is
dumped in the bugreport.
InputMethodManagerService state information is also dumped
in proto format.
Bug: 167948910, 154348613
Test: start trace by calling "adb shell ime tracing start"
create a bugreport by calling "adb bugreport"
check info in the bugreport zip file or upload to Winscope
Change-Id: Ie87eb8423e2bb70f28c330983d45b95e2e07062d
This change moves from dumping information of all Input Method client
instances to dumping only the current client, which is the one in which
the triggering event happened.
Bug: 154348613
Test: flash a device
start IME tracing by calling "adb shell ime tracing start"
end IME tracing by calling "adb shell ime tracing stop"
pull generated trace files and visualize in Winscope
or start tracing directly through ADB Connect and visualize traces
Change-Id: I46460d3d08947c7d37a8969a2fed6539f35aaf91
Optimized the tracing logic for the IMMS information. The
InputMethodManagerService triggers a tracing dump through the new
method triggerManagerServiceDump, exposed by the ImeTracing
interface.
This change only covers the IMMS information. The clients and
IMS information were added on previous changes.
Bug: 154348613
Test: start IME tracing by calling "adb shell ime tracing start"
end IME tracing by calling "adb shell ime tracing stop"
pull trace using "adb pull /data/misc/wmtrace/ime_trace_managerservice.pb ime_trace_managerservice.pb"
Change-Id: Ia5fb8f47769ec8c6a1a24c18cd19952c0c550274
Optimized the tracing logic for the IMS information. The
InputMethodService triggers a tracing dump through the new method
triggerServiceDump, exposed by the meTracing interface. This
change was done to be able to support custom dumps from clients
and custom dumps from InputMethodService.
This change only covers the IMS information. The IMMS
information will be dumped in next changes.
Bug: 154348613
Test: start IME tracing by calling "adb shell ime tracing start"
end IME tracing by calling "adb shell ime tracing stop"
pull trace using "adb pull /data/misc/wmtrace/ime_trace_service.pb ime_trace_service.pb"
Change-Id: Icda0f82d76fb7db5b2bd8d021069b1ff15a4e15b
Optimized the tracing logic for the IME clients information. The
clients trigger a tracing dump through the new method triggerClientDump
exposed by the ImeTracing interface. This change was done
to be able to support custom dump for clients information and
custom dump from IMS.
This change only covers the clients information. The IMS and IMMS
information will be dumped in next changes.
Bug: 154348613
Test: start IME tracing by calling "adb shell ime tracing start"
end IME tracing by calling "adb shell ime tracing stop"
pull trace using "adb pull /data/misc/wmtrace/ime_trace_clients.pb ime_trace_clients.pb"
Change-Id: I499cb5f45a3e78912b09b9c6cedf1ce5443e797a
* changes:
Custom binary XML wire protocol.
Progress towards efficient XML serialization.
More efficient alternatives to ByteBuffer.
CharsetUtils alternatives that avoid allocations.
We've identified that XML writing and reading uses roughly 1.5% of
all system_server CPU, and can generate many temporary objects.
Building on the recent TypedXmlSerializer/PullParser interfaces, this
change introduces new BinaryXmlSerializer/PullParser implementations
that store data using a custom binary wire protocol. Benchmarking of
a typical packages.xml has shown this new binary approach can write
4.3x faster and read 8.5x faster, while using 2.4x less disk space:
timeWrite_Fast_mean: 27946635
timeWrite_Binary_mean: 6519341
timeRead_Fast_mean: 59562531
timeRead_Binary_mean: 7020185
A major factor in choosing to invest in this new wire protocol is
that it enables the long-tail of over 100 unique XML schemas used
across the OS internals to be transparently upgraded to gain these
benefits with only minimal changes, reducing the risks associated
with rewriting those schemas.
Finally, since the wire protocol is essentially a serialized event
stream, it's trivial to transparently convert this new protocol
into human-readable XML and vice-versa. The tests in this change
demonstrate this translation working correctly, and future changes
will introduce new shell tools to aid development work.
Bug: 171832118
Test: atest FrameworksCoreTests:android.util.XmlTest
Test: atest FrameworksCoreTests:android.util.BinaryXmlTest
Test: atest CorePerfTests:android.util.XmlPerfTest
Change-Id: Ib9390701f09562dca952b3786622675b9c68a462
We've identified that XML writing and reading uses roughly 1.5% of
all system_server CPU, and can generate many temporary objects.
To set the stage for some long-term improvements, this change
introduces new TypedXmlSerializer and TypedXmlPullParser interfaces
which offer efficient access to primitive attributes and text.
This change also updates XmlUtils to redirect primitive operations
through these new interfaces.
Bug: 171832118
Test: atest FrameworksCoreTests:android.util.XmlTest
Change-Id: I5ba3ad87cf79ca10705a96b98855164a27fee021
Internally String.getBytes() calls libcore.util.CharsetUtils methods
for a handful of common charsets, but that path requires new memory
allocations for every call.
This change introduces alternative versions of those methods which
attempt to encode data directly into an already-allocated memory
region. If the destination is to small, callers can detect and pivot
back to calling String.getBytes().
The included benchmarks reveal these raw performance improvements,
in addition to the reduced GC load which is harder to measure:
timeLocal_LargeBuffer[simple]_mean: 424
timeLocal_SmallBuffer[simple]_mean: 511
timeUpstream[simple]_mean: 800
timeLocal_LargeBuffer[complex]_mean: 977
timeLocal_SmallBuffer[complex]_mean: 1266
timeUpstream[complex]_mean: 1468
Bug: 171832118
Test: atest CorePerfTests:android.util.CharsetUtilsPerfTest
Test: atest FrameworksCoreTests:android.util.CharsetUtilsTest
Change-Id: Iac1151e7cb8e88bf82339cada64b0936e1a7578b
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.
Bug: 170729553
Test: Treehugger
Merged-In: I626caf7c1fe46c5ab1f39c2895b42a34319f771a
Change-Id: I54e5ecd11e76ca1de3c5893e3a98b0108e735413
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.
This is a resubmit of ag/12929664 with some APIs excluded that caused
test failures; see bugs 171886397, 171888296, 171864568.
APIs excluded:
Landroid/bluetooth/le/ScanRecord;->parseFromBytes([B)Landroid/bluetooth/le/ScanRecord;
Landroid/os/Process;->myPpid()I
Landroid/os/SharedMemory;->getFd()I
Landroid/hardware/input/InputManager;->INJECT_INPUT_EVENT_MODE_WAIT_FOR_FINISH:I
Bug: 170729553
Test: Treehugger
Change-Id: I8285daa8530260251ecad6f3f38f98e263629ca7
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.
Bug: 170729553
Test: Treehugger
Change-Id: I4c8fd0006f950de9955242e93968fb0996ceb372