Commit Graph

52850 Commits

Author SHA1 Message Date
Yu-Han Yang
97e162d605 Allow settingIgnored for DBH request if inEmergency
Bug: 150232136

Test: on device
Change-Id: Ia987418a591d716b787d406d725338a8563a55dd
2020-02-26 23:09:55 +00:00
Youngjun Kwak
5a846ed237 Merge "Add vertical type check to prevent non-Automotive Androids from force displaying system bars." into qt-qpr1-dev 2020-02-19 16:19:48 +00:00
TreeHugger Robot
928add13d4 Merge "Set a shorter timeout for logging a warn on slow IUserSwitchObservers." into qt-qpr1-dev 2020-02-18 18:08:42 +00:00
kwaky
c26e4fa64f Add vertical type check to prevent non-Automotive Androids from force displaying system bars.
Force displaying system bars can cause app screen compatibility issues
in non-Automotive Android.

Bug: 148407132
Test: CTS Test + Unit Tests
Change-Id: Ia433572650760e3b85954724c63084dca769eaa0
Merged-In: Ia433572650760e3b85954724c63084dca769eaa0
2020-02-18 09:15:54 -08:00
TreeHugger Robot
2c4c1f1e6d Merge "Added log statements to some user-switching tasks." into qt-qpr1-dev 2020-02-14 18:46:51 +00:00
Michael Groover
b6f974b26b Merge "Ensure adb key store is instantiated before revoking grants" into qt-qpr1-dev 2020-02-13 23:18:35 +00:00
Dmitry Dementyev
eab74f8e20 Merge "Remove hidden shared account methods from AccountManager.java" into qt-qpr1-dev 2020-02-13 23:01:31 +00:00
TreeHugger Robot
c2daf3cbb2 Merge "Make switching dialog full screen and change "Loading" text color." into qt-qpr1-dev 2020-02-12 21:14:21 +00:00
TreeHugger Robot
7b19135cc5 Merge "Don't crash system process on empty onTuneFailed" into qt-qpr1-dev 2020-02-12 14:00:20 +00:00
TreeHugger Robot
6ac8c0d096 Merge "CountryDetector: Enable detector class override for automotive" into qt-qpr1-dev 2020-02-11 23:02:07 +00:00
TreeHugger Robot
bace1cd5a4 Merge "DO NOT MERGE - Use TimingsTraceLog on SystemServiceManager and VoiceInteractionManagerService." into qt-qpr1-dev 2020-02-11 22:39:07 +00:00
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
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
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
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
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
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
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
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
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
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
Chris Tate
fd3ce4f71e Merge "Revoke 'always' web handler status when not autoverifying" into qt-qpr1-dev 2020-02-01 01:01:42 +00:00
Heemin Seog
347c14cb47 Merge "DO NOT MERGE Only set the LAYOUT flags if the window is fullscreen" into qt-qpr1-dev 2020-01-31 20:38:37 +00:00
TreeHugger Robot
f2a1775a86 Merge "DO NOT MERGE Ensure package names read from config are system packages." into qt-qpr1-dev 2020-01-31 00:36:50 +00:00
Hai Zhang
6a56247200 DO NOT MERGE Ensure package names read from config are system packages.
Fixes: 145981139
Test: manually tested ensureSystemPackageName() returns null for non-system app
Change-Id: I1d23910cbd282f6702785c9dfb059d7be6b0e895
2020-01-31 00:20:45 +00:00
Heemin Seog
5c31a5c18d DO NOT MERGE Only set the LAYOUT flags if the window is fullscreen
This addresses an issue where toasts will be hidden due to the setting
of the LAYOUT_HIDE_NAVIGATION flag.

Bug: 148180738
Test: manual (adb shell settings put global policy_control "immersive.navigation=*" then try to show a toast with gravity top)
Change-Id: Ic47edc5423c4daf373fc3a8bfc30af15cadd6d90
2020-01-29 12:35:57 -08:00
Mayank Garg
a9feb4602f Adding option in global setting to control the display message during user switch
Bug: 145915635
Bug: 145132885
Test: adb shell settings put global android.car.ENABLE_USER_SWITCH_DEVELOPER_MESSAGE true
Merged-In: I70c72d7d74c72a78d919ae34906b6f7b96466ad1
Change-Id: I70c72d7d74c72a78d919ae34906b6f7b96466ad1
(cherry picked from commit e12de0beb4)
2020-01-29 07:11:22 +00:00
Automerger Merge Worker
895d932835 DO NOT MERGE: Adds artificial package handler latency am: de626c28d7
Change-Id: I5303926e34c973ca9e4a7d12d0f4cd46e2fbcde8
2020-01-27 20:14:59 +00:00
Michael Groover
c718e54c27 Ensure adb key store is instantiated before revoking grants
If adb is not enabled on a device then the adb key store is not
instantiated when the AdbDebuggingManager's handler is started as
in most cases it will not be needed. However if the user attempts
to revoke any previous adb grants when a device is booted with adb
disabled it will result in a NPE. This commit ensures the key store
is instantiated before attempting to revoke authorizations.

Test: atest AdbDebuggingManagerTest
Test: Manually invoked 'Revoke USB debugging authorizations' after
      a boot with adb disabled.
Fixes: 145790817

Change-Id: Id00e531c18412be009a211eec80a72867659608f
Merged-In: Id00e531c18412be009a211eec80a72867659608f
2020-01-23 13:37:15 -08:00
Mohammad Samiul Islam
67c89f3e5f Handle ParcelableException instead of crashing system server
Unhandled exception is causing system server to crash.

Bug: 146790672
Test: builds successfully
Change-Id: Ibfe53ee0309dcec6fd3b24f8b67fcb78f5ce7fd5
Merged-In: Ibfe53ee0309dcec6fd3b24f8b67fcb78f5ce7fd5
2020-01-22 08:24:26 +00:00
Martijn Coenen
074d6fbd3f Merge "Fix IsolatedUidAllocator for non-primary users." into qt-qpr1-dev 2020-01-17 14:39:49 +00:00
Philip P. Moltmann
05024a1523 DO NOT MERGE Fix AppOpsServiceTest
- Mock LocalService dependency
- Always assume calling app has appropriate permissions

Test: atest atest FrameworksMockingServicesTests:com.android.server.appop
Fixes: 132274015
Fixes: 147778434
Bug: 146463528
Bug: 146590200
Merged-In: Ie816e0c6c81ecf25d37f05187591ca0d1edf0bc2
Change-Id: Ie816e0c6c81ecf25d37f05187591ca0d1edf0bc2
2020-01-16 11:15:42 -08:00
Martijn Coenen
c6a61a6b0c Fix IsolatedUidAllocator for non-primary users.
The UID allocator stores complete UIDs, not app IDs. When removing a UID
from the range, we should therefore also use the UID, not the app ID.

Also added a test to cover this scenario, which passes with this change.

Bug: 146313311
Test: atest ActivityManagerTest
Change-Id: I1118ec73dcee5987e12f35aabce5cfa8cbe407a1
(cherry picked from commit c9a0df2d88)
2020-01-15 18:25:51 +00:00
TreeHugger Robot
c1b47d49c7 Merge changes from topic "SetModeNoEntanglement-qt-qpr1-dev" into qt-qpr1-dev
* changes:
  DO NOT MERGE Don't throw exception in AppOpsManager.checkOp
  DO NOT MERGE Remove unnecessary internal APIs.
  DO NOT MERGE SetMode: Don't call into PM with AppOps lock held
2020-01-14 19:43:27 +00:00
Philip P. Moltmann
892ded1e8a DO NOT MERGE Don't throw exception in AppOpsManager.checkOp
In Q we handled the case where the op does not match the package name by
returning the default state. NoteOp and StartOp returned errored.

Fix up these scenarios.

Test: - atest CtsAppOpsTestCases
      - backported new test to Q to verify the behavior is the same in Q
        and master
Bug: 132885449
Bug: 146463528
Bug: 146590200
Bug: 147649036
Change-Id: I5b94e92af759580f2d2644ece49f159bd006b31c
2020-01-14 19:43:02 +00:00
Philip P. Moltmann
73e2690ede DO NOT MERGE Remove unnecessary internal APIs.
Test: Built
Bug: 146463528
Bug: 146590200
Bug: 147649036
Change-Id: I5391ac4989d7d5712982f5608f9fc28cf7935b00
2020-01-14 19:42:44 +00:00
Philip P. Moltmann
0bba8d5ff9 DO NOT MERGE SetMode: Don't call into PM with AppOps lock held
In the setmode paths do not call into package manager with the app-ops
lock held. Otherwise we might get dead-locks then someone calls into
app-ops manager with the package manager lock held.

Test: Booted and saw no errors from the changed code
Bug: 124731615
Bug: 146463528
Bug: 146590200
Bug: 147649036
Change-Id: If074bed1bd246a81791a7d9fd656f42f1a755495
(cherry picked from commit ec142a52fe)
2020-01-14 09:47:32 +00:00
Jim Kaye
d763ea1f09 Merge "[DO NOT MERGE] Add a configuration to allow disabling auto-suspend" into qt-qpr1-dev 2020-01-13 18:08:48 +00:00
Christophe Koessler
611bad9556 Refactor CountryDetectorService
Clean-up the test to use Mockito instead of the deprecated
AndroidTestCase, also getting rid of 1.5s of Thread.sleep.
No logic change.

Bug: 141626568
Test: atest CountryDetectorServiceTest
Merged-in: Ic0782b1ffcd1dcb30b9f1d91b37521d1f9887f03
Change-Id: Ic0782b1ffcd1dcb30b9f1d91b37521d1f9887f03
(cherry picked from commit 50361687ba)
2020-01-10 00:12:11 +00:00
Christopher Tate
d2a71cc4b8 Revoke 'always' web handler status when not autoverifying
If an app has previously used autoVerify to make claims about its status
re handling web navigation intents, but is updated such that it no
longer makes those claims, step down its "official handler" status as
though it had never invoked autoVerify in the first place.

Bug: 146204120
Test: manual: as described in bug; observe policy before/after via
      'adb shell dumpsys package d'
Test: atest CtsOsHostTestCases
Change-Id: I58502d1b32d793aba9aa772fa2ad5ac38acca48a
Merged-In: I58502d1b32d793aba9aa772fa2ad5ac38acca48a
2020-01-09 13:56:51 -08:00
Automerger Merge Worker
cd35d79a7c Merge "Fix PermissionMonitor issues" into qt-dev am: 97baed2635
Change-Id: Ia955c4304c2e623b291c111615c65f012b7c3028
2020-01-09 05:59:27 +00:00
TreeHugger Robot
af229217da Merge "Fix system service crash on radio session death. DO NOT MERGE" into qt-qpr1-dev 2019-12-21 00:38:00 +00:00
TreeHugger Robot
23e867d5de Merge "Re-register SMD after motion detected." into qt-qpr1-dev 2019-12-20 18:37:49 +00:00