Commit Graph

424299 Commits

Author SHA1 Message Date
Christophe Koessler
d3e7186a06 CountryDetector: Enable detector class override for automotive
The detector class to be used by the CountryDetectorService can be set
by overlaying config_customCountryDetector in the device config.

Test: atest CountryDetectorServiceTest
Bug: 141626568
Merged-In: I158abd6397e3102d13e431ba043e8ce45061b64a
Change-Id: I158abd6397e3102d13e431ba043e8ce45061b64a
(cherry picked from commit 34147601d8)
2020-02-11 00:31:54 +00:00
TreeHugger Robot
7d26587263 Merge "Refactor CountryDetectorService" into qt-qpr1-dev 2020-02-10 20:32:35 +00:00
Heemin Seog
72be6295c0 Merge "Fix flaky sysui crash in devicehealthchecks test." into qt-qpr1-dev 2020-02-10 20:21:31 +00:00
Felipe Leme
e8d9d331ae Merge "Disabled some DEBUG constants." into qt-qpr1-dev 2020-02-08 21:12:22 +00:00
Felipe Leme
7082688f29 DO NOT MERGE - Added system user packages blacklist / whitelist to dump()
Test: adb shell dumpsys package | grep -i -A15 isSystemUserPackagesBlacklistSupported

Bug: 145626101

Change-Id: I6523fd209673c3f80a00641dcbf15e54e3d50b4b
(cherry picked from commit b4a35c25f3c1933232ded444974033b5c6e50ad2)
2020-02-08 00:29:48 +00:00
Yan Zhu
81ce02f510 DO NOT MERGE - Add flag to turn on/off the headless user specific blacklist/whitelist
Bug: 145626101
Test: manual: set config_systemUserPackagesBlacklistSupported
build and flash
Verify with: 1. adb shell dumpsys package packages
2. adb logcat | grep "blacklist"

Change-Id: I5b45fc86e4c5008933bf361d5bb32a2c17259655
(cherry picked from commit d1c59ec220e95f881feefb55eb099b6f602d4e05)
2020-02-08 00:29:33 +00:00
Yan Zhu
f8c0b31524 DO NOT MERGE - Enable blacklist for headless system user
- Get all packages for system user
- Reuse split system user's logic to blacklist packages when headless system
user is enabled
- Add new method in UserManager to get headless sytem user mode (same as
in master)

Bug: 145626101
Test: edit device's sysconfig file, use tag: system-user-blacklisted-app to blacklist app
make services && adb sync system && adb reboot
cts test

Change-Id: I98d1bc33e7dd59ffa3ac6426f95af708671138da
(cherry picked from commit 9c4cf4945d57d45e429bc7d33bf6ffa68eb0838c)
2020-02-08 00:29:19 +00:00
Amin Shaikh
a0e531aa71 Fix flaky sysui crash in devicehealthchecks test.
Upgrade tuner on the main thread to avoid
ConcurrentModificationException.

Fixes: 133847620
Bug: 148794872
Test: mp droid
Change-Id: I15ef66a19eeac2c6baf652d83e6a90669834f203
Merged-In: I15ef66a19eeac2c6baf652d83e6a90669834f203
2020-02-07 20:44:06 +00:00
Felipe Leme
85382ce4d2 Disabled some DEBUG constants.
Bug: 138939803
Bug: 142965266
Bug: 148457657

Test: echo 'in TH we trust!'

Change-Id: Ie3112fa1965d9b03bc142924ca17cf27dd6aa44d
(cherry picked from commit e966b8e76d26283163721620528eea0bfd77b43c)
2020-02-07 11:52:28 -08:00
Ryan Mitchell
aff8e2d83d Fix security issue in DynamicRefTable::load.
A crafted resources arsc could cause libandroidfw to read data out of
bounds of the resources arsc. This change updates the logic to calculate
whether the ref table chunk is large enough to hold the number of
entries specified in the header.

Bug: 129475100
Test: adb shell push ResTableTest data
Test: adb shell push poc.arsc data
Test: ./ResTableTest poc.arsc
Change-Id: Ifbaad87bdbcb7eecf554ef362e0118f53532a22a
(cherry picked from commit 8da1c38b69)
2020-02-07 19:26:54 +00:00
Wilson Wu
f656f6d2c1 Use the main thread to update alignment indication
The alignment status is reported from WLC-HAL level and runs
on another thread. It may cause CalledFromWrongThreadException,
if use that thread to update UI directly.

Bug: 146770234
Test: atest SystemUITests:KeyguardIndicationControllerTest
Change-Id: I89bf1c188d6ba094106e059f1590c9eaf3703bb8
(cherry picked from commit 0e72713fdf)
Merged-In: I89bf1c188d6ba094106e059f1590c9eaf3703bb8
2020-02-07 05:59:32 +00:00
Christopher Tate
874c974f73 DO NOT MERGE - Kill apps outright for API contract violations
...rather than relying on in-app code to perform the shutdown.

Backport of security fix.

Bug: 128649910
Bug: 140108616
Test: manual
Test: atest OsHostTests#testForegroundServiceBadNotification
Change-Id: I94d9de50bb03c33666471e3dbd9c721e9278f7cb
Merged-In: I94d9de50bb03c33666471e3dbd9c721e9278f7cb
2020-02-07 01:33:28 +00:00
Heemin Seog
410b9a75d2 Merge "Add null check for handler on Clock view" into qt-qpr1-dev 2020-02-06 23:12:53 +00:00
Dmitry Dementyev
a5fb0829d5 Remove hidden shared account methods from AccountManager.java
Bug: 145207098,145206763,145206842
Test: CTS
Change-Id: I0d07e0e6c4377eff5756ee938c5b43ad632249df
(cherry picked from commit b6907622f7)
2020-02-06 22:18:47 +00:00
Heemin Seog
fb23ff98d9 Add null check for handler on Clock view
On reboot, we've encountered an issue where the handler returns null,
causing a null pointer exception in the broadcast receiver.

In this CL, we add a null check and an error message to prevent a sysui
crash.

Bug: 148869042
Test: build, reboot a few times
Change-Id: Iac7f3a538be9a53d4a76926523aa2a3f4f22723d
Merged-In: Ie8a2627004876cf35291d52bd3686a5014498f52
2020-02-06 21:30:13 +00:00
TreeHugger Robot
4bfd23eb78 Merge changes I99720a37,I99a8f255 into qt-qpr1-dev
* changes:
  Force update uid state when pending uid state is applied
  Notify all packages is uid-mode is changed
2020-02-06 19:30:31 +00:00
Rhed Jao
53a56839b9 Merge "Fixed NPE in package installer session." into qt-qpr1-dev 2020-02-06 05:35:06 +00:00
Aarthi Balachander
c4808d9a4b Make switching dialog full screen and change "Loading" text color.
Bug: 148318514
Bug: 111928877, 112242211
Test: Tested on device
Change-Id: Iaa45b8e7581f2a19106a6e734432fe2cda661a33
(cherry picked from commit 88def57a6d97271013c0ca996950ff33939e7013)
2020-02-05 18:25:54 -08:00
Automerger Merge Worker
74c9ad17c2 Merge "Fix serialization issue of ExternalVibration" into qt-dev am: 02824fc2a9
Change-Id: I196882cf82416b3d4e84c487bd94b925f719dc1d
2020-02-06 00:25:37 +00:00
Chris Ye
02824fc2a9 Merge "Fix serialization issue of ExternalVibration" into qt-dev 2020-02-06 00:12:49 +00:00
Christopher Tate
38567a6051 DO NOT MERGE - Kill apps outright for API contract violations
...rather than relying on in-app code to perform the shutdown.

Bug: 128649910
Bug: 140108616
Test: manual
Test: atest OsHostTests#testForegroundServiceBadNotification
Change-Id: I94d9de50bb03c33666471e3dbd9c721e9278f7cb
Merged-In: I94d9de50bb03c33666471e3dbd9c721e9278f7cb
2020-02-05 12:32:21 -08:00
Tobias Thierer
f35f2913f8 Parcel only the canonical Uri.Part representation, not both.
Before this CL, Uri.AbstractPart's implementation of Parcelable
was parceling and unparceling both the encoded and the decoded
representation. A Uri with inconsistent decoded/encoded
representation of its Parts would have remained inconsistent
across parcel/unparcel cycles. For example, such a Uri's
uri.getDecodedAuthority() might have returned "good.com" while
url.getEncodedAuthority() (used e.g. for toString()) returned
"evil.com".

After this CL, AbstractPart's constructor allows at most one of
the representations to be set (exception: NULL and EMPTY); this
means that no Part instance with inconsistent values can be
constructed via the constructor (e.g. by unparceling parceled
data). The historical parcel representation of a Part with both
values present can no longer be unparceled, which is safe because
Parcel does not guarantee backwards compatibility (the parceled
form must not be persisted across Android version upgrades).

When parceling, only one of the values is now stored, namely
the (canonical) one that was passed to the constructor.

Fixes: 124526860
Test: atest FrameworksCoreTests:android.net.UriTest
Test: Checked that if run before this CL, the added tests
      would fail with a failure along the lines of:
      ComparisonFailure: expected:</foo/[b]> but was:</foo/[a]>
      or (if the first assertion was commented out):
      ComparisonFailure: expected:<[b].com> but was:<[a].com>

Change-Id: I2bc2008e49de5a66641ecdbd8e5354dfa647269d
Merged-In: I2bc2008e49de5a66641ecdbd8e5354dfa647269d
(cherry picked from commit c9afa38f97)
2020-02-05 18:13:24 +00:00
Felipe Leme
ed30689e21 DO NOT MERGE - Use TimingsTraceLog on SystemServiceManager and VoiceInteractionManagerService.
(NOTE: this change is manually cherry-picked from master - master has the same
trace calls, but they were introduced by larger changes)

Bug: 145626101
Bug: 145027829
Test: manual verification

Change-Id: I5cae10c9c7e5ed6f733c72659643708dfa826fc7
2020-02-05 06:21:57 +00:00
Hai Zhang
6b14ea266e Add SafetyNet logging for package names read from config.
Bug: 145981139
Test: manual
Change-Id: I86c6bfc0a6e28e634e0fd201e424b7ee6882ba2c
2020-02-04 18:05:46 -08:00
Christopher Tate
a79b6ba5c5 DO NOT MERGE - Kill apps outright for API contract violations
...rather than relying on in-app code to perform the shutdown.

Backport of security fix.

Bug: 128649910
Bug: 140108616
Test: manual
Test: atest OsHostTests#testForegroundServiceBadNotification
Change-Id: I94d9de50bb03c33666471e3dbd9c721e9278f7cb
Merged-In: I94d9de50bb03c33666471e3dbd9c721e9278f7cb
2020-02-04 16:59:47 -08:00
Philip P. Moltmann
ab9be4fdb6 Force update uid state when pending uid state is applied
Before the state was update lazily when someone interacted with
appopsmanager.

Since Q the the uid state might change depending on the procState
and hence we might need to trigger the opChanged callbacks when the
procState is applied.

Bug: 148180766
Test: (on master) atest CtsAppOpsTestCases:android.app.appops.cts.ForegroundModeTest
Change-Id: I99720a372db6e79eaba30e4563c09e009cffe86f
Merged-In: Id974769a4e9d89c01890b7557dd93f8444a3908f
2020-02-04 13:32:51 -08:00
Philip P. Moltmann
29e092bf29 Notify all packages is uid-mode is changed
Multiple packages might share a UID, but appOpsService might not have
cached the uid->package mapping for those yet. Hence the only way to
list all packages for a uid is to ask package manager.

setUidMode already handled this correctly, hence factor out the code
into notifyOpChangedForAllPkgsInUid and reuse it from
commitUidStatePendingLocked.

Bug: 148180766
Test: (on master) atest CtsAppOpsTestCases:android.app.appops.cts.ForegroundModeTest
Change-Id: I99a8f255a60d3523da7eb36a8f2c9426af1a1fea
Merged-In: I2d5d6c7aa38d201707349a137c9c29b7987775be
2020-02-04 13:32:38 -08:00
Hai Zhang
4bf6bc5d50 DO NOT MERGE Ensure package names read from config are system packages.
Bug: 145981139
Test: manually tested ensureSystemPackageName() returns null for non-system app
Change-Id: I1d23910cbd282f6702785c9dfb059d7be6b0e895
Merged-In: I1d23910cbd282f6702785c9dfb059d7be6b0e895
Merged-In: I86c6bfc0a6e28e634e0fd201e424b7ee6882ba2c
Merged-In: I5883e296a0d753e43075cbf0abc5dc4da91e2fca
(cherry picked from commit 6a56247200)
2020-02-04 12:43:15 -08:00
Hai Zhang
584d73a0b0 DO NOT MERGE Ensure package names read from config are system packages.
Bug: 145981139
Test: manually tested ensureSystemPackageName() returns null for non-system app
Change-Id: I1d23910cbd282f6702785c9dfb059d7be6b0e895
(cherry picked from commit 6a56247200)
2020-02-04 12:40:02 -08:00
Hai Zhang
e693b797bc Call getPackageInfo() with cleared calling identity in ensureSystemPackageName().
Otherwise non-primary users might get a SecurityException.

Bug: 145981139
Bug: 148763415
Test: manual
Change-Id: I5883e296a0d753e43075cbf0abc5dc4da91e2fca
2020-02-04 19:53:59 +00:00
Pavel Grafov
b9c4862b86 Re-activate backup service after cleaning a profile owner
Currently backup service is re-activated unconditionally when clearing
a device owner but not profile owner. With this CL it should be
re-activate in both cases.

NB: there are two bits of state related to backup service:
1. activated or deactivated: This is out of user control, but can be
   changed by the admin via DPM.setBackupServiceEnabled (this name is
   a bit misleading here).
2. enabled or disabled: this is controlled by the user via Settings
   and only available when backup service is activated (see 1.)

Bug: 143274029
Bug: 147997438
Test: atest CtsAdminTestCases && adb shell bmgr enabled
Test: atest com.android.server.devicepolicy.DevicePolicyManagerTest
Merged-In: I6f11642abe544c7df265ed7e2ad466d47796e7f9
Change-Id: I6f11642abe544c7df265ed7e2ad466d47796e7f9
(cherry picked from commit 775b26d884)
2020-02-04 10:54:27 +00:00
TreeHugger Robot
25f9b23c6a Merge "resolve merge conflicts of 01f94b7cc0 to qt-qpr1-dev" into qt-qpr1-dev 2020-02-04 02:03:51 +00:00
Chris.CC Lee
4aced5d906 [DO NOT MERGE] Fix AoD front scrim being opaque at DOZE_PULSING
When doze state changed from DOZE to DOZE_PULSING on devices not
supporting doze_brightness_sensor_type sensor, there would be no
sensor events to update the AoD front scrim. And due to the scrim was
set to opaque at DOZE state, most views on the statusbar will be
invisible. This patch change the scrim to transparent again at leaving
DOZE state.

Bug: 148129743
Test: atest DozeScreenBrightnessTest
Change-Id: I1cf9d02c9e35dcb3e94cbbc24fec483c51e372d9
2020-02-04 09:34:48 +08:00
Lucas Dupin
c93fa740aa resolve merge conflicts of 01f94b7cc0 to qt-qpr1-dev
Bug: None
Test: I solemnly swear I tested this conflict resolution.
Change-Id: I2d15aaa7402e4e08f1630aa29892ad6cd68bd2b1
Merged-In: I34d1d5f9a751c1d7680a5a5941c39b9fe33a473b
2020-02-04 01:12:40 +00:00
Automerger Merge Worker
6c3cdcc7ac [automerger skipped] Merge "Update redaction upon profile changes" into qt-dev am: 01f94b7cc0 -s ours
am skip reason: skipped by user dupin

Change-Id: Iae319dff17a311c919db2f30a194bc9ce737c3eb
2020-02-04 00:34:39 +00:00
Felipe Leme
eeb7039c23 Set a shorter timeout for logging a warn on slow IUserSwitchObservers.
On automotive, it helps identify slow services. For example:

W ActivityManager: User switch delayed: observer #1
  WallpaperManagerService sent result after 1608 ms

Without this change, the WallpaperManagerService wouldn't be logged
because the "give up" timeout is 3000ms.

Bug: 145558164
Bug: 144801993

Test: manual verification (see logcat above)

Change-Id: I68e3b7220bbac25075e4fd4dad83c3a26b88940c
Merged-In: I68e3b7220bbac25075e4fd4dad83c3a26b88940c
(cherry picked from commit 48a75cbd67)
2020-02-03 23:51:14 +00:00
Felipe Leme
715c0180eb Added log statements to some user-switching tasks.
NOTE: as user switch is a very low-frequency operation, these logs statements
don't need to be guard (to avoid spam).

Test: manual verification
Bug: 141502467
Bug: 140999054
Bug: 145027829

Change-Id: I7122e45c45a646419b03242c99d90417a29da92a
Merged-In: I7122e45c45a646419b03242c99d90417a29da92a
(cherry picked from commit ebccffe3b10d8642e7b1d64f183b627f644011a4)
(cherry picked from commit b5f0e74302)
2020-02-03 23:50:32 +00:00
Lucas Dupin
01f94b7cc0 Merge "Update redaction upon profile changes" into qt-dev 2020-02-03 23:37:07 +00:00
Automerger Merge Worker
fcfca21b9f Change coverage dump to specify the output file instead of directory. am: 3f81e072da
Change-Id: I5424f4cc84bb970fa56b232886f14a4045a757af
2020-02-03 19:17:05 +00:00
Automerger Merge Worker
ac8e5e62a2 Merge "Add JVMTI agent to dump/reset JaCoCo coverage information" into qt-dev am: 638e92410c
Change-Id: I37f88d7db1dd8ef6c921223e8b73914e7a07a50d
2020-02-03 19:16:44 +00:00
Oliver Nguyen
3f81e072da Change coverage dump to specify the output file instead of directory.
Bug: 137857876
Test: manual
Change-Id: I2d835856d7a1b6b1ded561eca923f455b39317e4
Merged-In: I2d835856d7a1b6b1ded561eca923f455b39317e4
(cherry picked from commit 05b1c06a91)
2020-02-03 19:08:13 +00:00
Oliver Nguyen
638e92410c Merge "Add JVMTI agent to dump/reset JaCoCo coverage information" into qt-dev 2020-02-03 19:08:06 +00:00
Kavi Gupta
43c9497719 Add JVMTI agent to dump/reset JaCoCo coverage information
This agent can be attached to an arbitrary Android process with
arguments that cause it to either reset or dump the JaCoCo information
to a provided directory.

Bug: 148178774
Test: manual, used examples in README to test whether it works on a
userdebug_coverage build on cuttlefish

Change-Id: If6cee20046f790676b8085e1ca84652c063295fa
Merged-In: If6cee20046f790676b8085e1ca84652c063295fa
(cherry picked from commit 2d84ae7640)
2020-02-03 19:07:56 +00:00
Tomasz Wasilczyk
f83594ce42 Don't crash system process on empty onTuneFailed
This change:
- modifies internal programSelectorFromHal to return null instead of
  throwing NPE on empty input
- throws NPE on two of its usages where null is unexpected
- *does not* throw NPE on one usage where program selector is optional
  (onTuneFailed in RadioModule.java)

Bug: 147522441
Test: boots, but have no quick way to trigger onTuneFailed(Result::error, {})
Change-Id: I6317da3fbde2bce90079b61bb0839e893e1c4712
(cherry picked from commit dc8a5683a149b4f5ce3d9a9f6198fbe310547dbf)
2020-02-03 17:21:39 +00:00
Lucas Dupin
44d1c652ce Update redaction upon profile changes
We can't rely on status bar state changes to update the notification
list. The current user might not be set yet, causing wrong notifications
to become visible.

Fixes: 145135488
Test: manual
Test: atest NotificationStackScrollLayoutTest
Change-Id: I34d1d5f9a751c1d7680a5a5941c39b9fe33a473b
Merged-In: I34d1d5f9a751c1d7680a5a5941c39b9fe33a473b
2020-02-03 16:25:36 +00:00
Rhed Jao
692e120858 Fixed NPE in package installer session.
We updated staged sessions to activation failed state when they
aren't in terminal state, and device received ota and reboot. This
happend before the StagingManager resumes the sessions when
the whole set of parent+child sessions have been restored.
A parent session probably cannot find the child session, and a null
exception could happen.

In this change, we do not destroy child sessions before we destroy
the parent session. We only destroy a child session directly if we
are sure that its parent session doesn't exist.

Bug: 147651771
Test: StagedInstallTest
Change-Id: Iac6489a04df35f851aa18a91e1dde2d73928b8ec
Merged-in: Iac6489a04df35f851aa18a91e1dde2d73928b8ec
(cherry picked from commit 1fc8b36cf3)
2020-02-03 11:19:17 +08:00
Automerger Merge Worker
9b87773b60 [automerger skipped] Merge "Revoke 'always' web handler status when not autoverifying" into oc-dev am: ab012da3a2 am: 0cf31cf467 -s ours am: 41c009d172 -s ours am: 835e3a52bb -s ours am: c321f209c9 -s ours
am skip reason: Change-Id I58502d1b32d793aba9aa772fa2ad5ac38acca48a with SHA-1 a8fb6dc167 is in history

Change-Id: I957e0de935727d4ccb9263f27c123277329072a0
2020-02-01 02:06:17 +00:00
Automerger Merge Worker
c321f209c9 [automerger skipped] Merge "Revoke 'always' web handler status when not autoverifying" into oc-dev am: ab012da3a2 am: 0cf31cf467 -s ours am: 41c009d172 -s ours am: 835e3a52bb -s ours
am skip reason: Change-Id I58502d1b32d793aba9aa772fa2ad5ac38acca48a with SHA-1 a8fb6dc167 is in history

Change-Id: Ia0198d3592672180b0c2f13010d000c9e3c3e058
2020-02-01 01:52:51 +00:00
Automerger Merge Worker
835e3a52bb [automerger skipped] Merge "Revoke 'always' web handler status when not autoverifying" into oc-dev am: ab012da3a2 am: 0cf31cf467 -s ours am: 41c009d172 -s ours
am skip reason: Change-Id I58502d1b32d793aba9aa772fa2ad5ac38acca48a with SHA-1 ef5220e5b2 is in history

Change-Id: I1e39ae47fabb0eb668ac759f1e164771612c582a
2020-02-01 01:39:31 +00:00
Automerger Merge Worker
41c009d172 [automerger skipped] Merge "Revoke 'always' web handler status when not autoverifying" into oc-dev am: ab012da3a2 am: 0cf31cf467 -s ours
am skip reason: Change-Id I58502d1b32d793aba9aa772fa2ad5ac38acca48a with SHA-1 ef5220e5b2 is in history

Change-Id: I80e44d4cb30a8648df50be2f5fc1b0fd084b3815
2020-02-01 01:24:48 +00:00