Commit Graph

1714 Commits

Author SHA1 Message Date
TreeHugger Robot
ea1c8b3a76 Merge "Revert "Revert "Revert "Turn on the feature flag for Android S S..."" into sc-dev 2021-02-08 21:45:00 +00:00
Daniel Chapin
0ded361ef4 Revert "Revert "Revert "Turn on the feature flag for Android S S..."
Revert submission 13479025-multiuser_test

Reason for revert: Bug: 179457252
Reverted Changes:
I9e3d23f93:Fix the broken test
Id05757c49:Revert "Revert "Turn on the feature flag for Andro...

Change-Id: I4f77afda470b226007bfffda7f536df3b1d4d28a
2021-02-08 18:50:05 +00:00
Winson
e803a1bd33 Add internal domain verification data classes
Eventually will be used to store state that's included as part of
com.android.server.pm.Settings.

Also adds equality and  Kotlin index operator mutation support to
SparseArray, to improve ease of use.

Exempt-From-Owner-Approval: Already approved by owners on main branch

Bug: 163565712
CTS-Coverage-Bug: 179382047

Test: none, will be tested as part of follow up change

Change-Id: Ie4eca3a99633465337758ee165e07f35c8db87c8
2021-02-04 10:26:57 -08:00
TreeHugger Robot
debc58e074 Merge "Revert "Revert "Turn on the feature flag for Android S Settings.""" into sc-dev 2021-02-04 18:13:48 +00:00
Jason Chiu
2b4207db12 Revert "Revert "Turn on the feature flag for Android S Settings.""
This reverts commit 5ad13e0c25.

Reason for revert: Test case has been fixed

Change-Id: Id05757c494628c1d84943b383cf7639098a3fa3a
2021-02-04 15:57:13 +00:00
TreeHugger Robot
81f656e07f Merge "Revert "Turn on the feature flag for Android S Settings."" into sc-dev 2021-02-03 20:12:00 +00:00
Fan Zhang
5ad13e0c25 Revert "Turn on the feature flag for Android S Settings."
This reverts commit 0197d41019.

Reason for revert: DroidMonitor: Potential culprit for Bug 179262029 - verifying through Forrest before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.

Change-Id: Ifed6374b417d10ca76c3c2805ac985282174b367
2021-02-03 18:11:54 +00:00
TreeHugger Robot
421ce84db7 Merge "Turn on the feature flag for Android S Settings." into sc-dev 2021-02-03 04:58:28 +00:00
Wilson Wu
d8343be5ac Merge "Make IInputMethodManager to oneway (11/N)" into sc-dev 2021-02-02 07:35:56 +00:00
Yi-Ling Chuang
0197d41019 Turn on the feature flag for Android S Settings.
Bug: 169467375
Test: launch Settings and see the the UI.
Change-Id: I1d789c6ed0c5e98549c40e74faef8181d6733b30
2021-02-02 15:31:07 +08:00
Wilson Wu
418598ff85 Merge "Add OWNERS for imetracing" into sc-dev 2021-02-02 00:56:42 +00:00
Wilson Wu
35d4790aa0 Add OWNERS for imetracing
Bug: 178769649
Test: N/A
Change-Id: I6b1279887d37cb1ac6708307312d9400b4bdd47d
2021-01-29 16:02:43 +08:00
shawnlin
f7ff55217c Create an API to get a cutout path
- 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
2021-01-28 19:12:54 +08:00
Wilson Wu
f226a79fee Make IInputMethodManager to oneway (11/N)
Comply following methods to IVoidResultCallback to emulate
current behavior and apply them to one-way.

-. startProtoDump
-. startImeTrace
-. stopImeTrace

Bug: 163453493
Test: atest CtsInputMethodTestCases
Test: 1) Enable the Winscope Trace tile
      2) Do some actions like open keyboard
      3) Disable the Winscope Trace tile
      4) Grad a bugreport and verify trace on go/Winscope
Change-Id: I3eafbc28ed3acf3ba859885bf201cb06b3149b94
2021-01-28 17:09:39 +08:00
Jackal Guo
199d13c73d Merge "Refactor PackageParser (4/n)" into sc-dev 2021-01-28 00:19:02 +00:00
Jeff DeCew
52b003326d Merge "Add 'Android Resources' team as OWNERS of classes in android.util" am: 6671f75e1d am: ce917a8f14 am: d64f05737b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1542391

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I40c11677140a9f4e7d9fe629e2606c978d22a610
2021-01-27 14:16:32 +00:00
Jeff DeCew
6671f75e1d Merge "Add 'Android Resources' team as OWNERS of classes in android.util" 2021-01-27 13:18:49 +00:00
Jackal Guo
f9f526f296 Refactor PackageParser (4/n)
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)
2021-01-27 07:14:40 +00:00
Yo Chiang
cb42566590 Remove feature flag "settings_dynamic_system"
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
2021-01-14 15:45:53 +08:00
Yo Chiang
091f514bf5 Remove feature flag "settings_dynamic_system"
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
2021-01-13 09:34:37 +00:00
TreeHugger Robot
b078a29814 Merge "Add SparseArray#set for Kotlin index= operator" 2021-01-12 18:30:17 +00:00
Winson
590e9ffb4c Add SparseArray#set for Kotlin index= operator
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
2021-01-12 07:59:07 -08:00
Jeff DeCew
d9d24e4489 Add 'Android Resources' team as OWNERS of classes in android.util
Change-Id: If56558ebc4733b8266c231385fab4fb6b9316976
2021-01-07 20:43:22 +00:00
Jeff DeCew
a2114a56c8 Fill out RemoteViews methods for editing LayoutParams.
* 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
2021-01-07 14:30:57 -05:00
vichang
397070ce13 Merge "Deprecate Patterns.IP_ADDRESS" am: 4eb4e375f7 am: 442a80ba19 am: 538caa7bf7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1533540

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I89c8f8865d1ee7cfb0e9d9257c39a2b05894109d
2021-01-06 00:30:49 +00:00
Victor Chang
97006e6b51 Deprecate Patterns.IP_ADDRESS
Bug: 165470548
Test: n/a
Change-Id: Ic1e188ea118c87514815ec9581bb158ab66e22e4
2020-12-24 17:41:19 +00:00
Jeff Sharkey
fe2d1aca7f Enable binary XML by default.
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
2020-12-17 08:16:32 -07:00
Jeff Sharkey
e09d74c644 Prepare for binary XML pivot.
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
2020-12-17 08:16:06 -07:00
Wilson Wu
0e75d9e4dd Merge "Make IInputMethodManager to oneway (5/N)" 2020-12-16 09:33:42 +00:00
Wilson Wu
d833f0dab4 Make IInputMethodManager to oneway (5/N)
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
2020-12-11 17:56:26 +08:00
Eugene Susla
205637383c API for CDM wake-up opt-in
Bug: 168052577
Test: presubmit
Change-Id: I1cd1728099ddf374db4cf0e59f748ea3b655e1ba
2020-12-10 18:57:17 -08:00
Jeff Sharkey
78e84716e6 Mitigate performance TypedXml regression.
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
2020-12-09 12:18:05 -07:00
Jeff Sharkey
0ab7007631 resolve merge conflicts of 358f0d4fc8 to master
Bug: 174932174
Test: I solemnly swear I tested this conflict resolution.
Exempt-From-Owner-Approval: refactoring with team leads buy-in
Change-Id: I9262a08ffc1ccede8e519d0eed90ed2bfcf0232c
2020-12-08 11:01:05 -07:00
Jeff Sharkey
fab0ab3c9c Improve OWNERS coverage across frameworks/base/.
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
2020-12-08 08:36:27 -07:00
Jeff Sharkey
db4ae71beb Merge changes from topic "nov30"
* 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.
2020-12-04 21:32:44 +00:00
Ioana Stefan
0653b692d1 Add InputConnection app and service dump
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
2020-12-02 14:08:04 +00:00
Felipe Leme
22f9645b61 Added support to more @DevicePolicyOperation operations.
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
2020-12-01 10:34:22 -08:00
Jeff Sharkey
1f5d9af0cd Additional hand-migration to TypedXml interface.
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
2020-11-30 20:45:25 -07:00
Jeff Sharkey
42bd76058f "Resolve" both human-readable and binary XML.
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
2020-11-30 20:45:25 -07:00
Jeff Sharkey
3d39cd1cfc Merge changes from topic "nov14"
* 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.
2020-11-18 01:56:22 +00:00
TreeHugger Robot
1082f9e759 Merge "IME tracing integration with bugreport" 2020-11-17 17:25:28 +00:00
Ioana Stefan
06f759835a Merge changes from topics "ime-tracing-interface", "optimized-ime-tracing-clients", "optimized-ime-tracing-imms", "optimized-ime-tracing-ims"
* 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
2020-11-17 15:18:30 +00:00
Jeff Sharkey
03dec84123 Refine TypedXmlPullParser API interface.
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
2020-11-16 14:43:29 -07:00
Jeff Sharkey
50a99364c6 Consistent handling of modified UTF-8.
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
2020-11-13 14:11:41 -07:00
Ioana Stefan
ac24994aaa IME tracing integration with bugreport
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
2020-11-13 14:52:06 +00:00
Ioana Stefan
45296595a3 Log only current client data in IME tracing
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
2020-11-13 14:30:13 +00:00
Ioana Stefan
d7daa0bd67 Optimized workflow for IME tracing on InputMethodManagerService side
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
2020-11-13 12:31:23 +00:00
Ioana Stefan
8418bef70a Optimized workflow for IME tracing on InputMethodService side
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
2020-11-13 12:29:25 +00:00
Ioana Stefan
ab1008480b Optimized workflow for IME tracing on clients side
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
2020-11-13 10:18:47 +00:00
Jeff Sharkey
af7d02531c Merge changes from topic "nov7"
* changes:
  Custom binary XML wire protocol.
  Progress towards efficient XML serialization.
  More efficient alternatives to ByteBuffer.
  CharsetUtils alternatives that avoid allocations.
2020-11-10 23:35:51 +00:00