Commit Graph

56943 Commits

Author SHA1 Message Date
Vlad Zavidovych
de82ddac5d Add header to DropBox crash reports to indicate instant app crash
Bug: 62372653
Test: runtest -c com.android.server.am.ActivityManagerServiceTest frameworks-services
Change-Id: I5a3d293d4bd7b54b6fcfe26516e51aff15354ded
(cherry picked from commit 9cab935555)
2017-10-10 17:17:28 +00:00
TreeHugger Robot
9bc71c4922 Merge "MediaSessionService: Prevent getActiveSessions() from growing infinitely" into oc-mr1-dev 2017-10-10 05:44:55 +00:00
Makoto Onuki
d4b7862785 Don't take a lock on the UI thread.
Bug 66719356

Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest1 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest2 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest3 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest4 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest5 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest6 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest7 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest8 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest9 -w com.android.frameworks.servicestests
Test: adb shell am instrument -w -e class com.android.server.pm.ShortcutManagerTest10 -w com.android.frameworks.servicestests
Test: cts-tradefed run cts-dev --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -l INFO -m CtsShortcutManagerTestCases
Test: cts-tradefed run cts-dev --skip-device-info --skip-preconditions --skip-system-status-check com.android.compatibility.common.tradefed.targetprep.NetworkConnectivityChecker -a armeabi-v7a -l INFO -m CtsShortcutHostTestCases
Change-Id: I1045eda4910e3c7d3172038a1efd31cdf9346729
2017-10-09 20:48:41 +00:00
Rubin Xu
2257fda563 Always synchronize the OEM unlock allowed bit to the FRP partition
For devices using OEMLock HAL, OEM unlock allowed bit is maintained by the HAL.
However PersistentDataBlockService will only look at the OEM unlock allowed bit
on the pst partition to make sure FRP data is cleared on a unlockable device.
As a short term fix, make sure the OEM unlock allowed bit on both the HAL and pst
partition is always in sync.

Bug: 67043266
Test: On walleye/taimen, add an account, enable OEM unlock, factory reset
      via fastboot, and observe FRP is not enforced.

Change-Id: Id4a0d81d7a424e17c2751e7e65582b51c14bd073
2017-10-09 16:21:41 +00:00
TreeHugger Robot
3f58b239a2 Merge "Add keyguard state as a gate for VR Mode." into oc-mr1-dev 2017-10-07 02:37:06 +00:00
Santos Cordon
b5cbecb16a Add keyguard state as a gate for VR Mode.
Problem: When the user toggles power button while in VR, they will be
taken to a black VR screen that occludes the keyguard.

VRManager previously used wakefulness and screen off as gates for VR Mode. However,
the keyguard state can be on or off when the device is awake so we need
to listen to the keyguard state as well.

Change:
1) Have ActivityManagerService tell VrManagerService about the keyguard
state the same as it does with wakefulness.
2) Stop applying any pending states when the device comes out of
sleep/screen-off/keyguard to force user into putting-headset-on (DON) UX
in those situations.

Bug: 66696304
Test: Manual - toggle device's power button and see logs of keyguard.
Test with all keyguard types.

Change-Id: I4ae03cb1c8c13acdc8cd11839f178bc8d8f6f515
2017-10-06 15:56:56 -07:00
Bryce Lee
fed715e7b5 Merge "Restrict sending new intent to one invocation." into oc-mr1-dev 2017-10-06 21:58:50 +00:00
Bryce Lee
325e096855 Restrict sending new intent to one invocation.
A special condition, where the new intent is delivered outside
the normal logic flow, was extended to included documents as well.
This can lead to any intent marked with the document launch flag
sending the intent in this block as well as the normal flow.

This changelist restricts the number of times the intent can be
sent to once during each activity start.

Change-Id: If1e62527d260cbe5ff170680695b03d9de532c09
Fixes: 67367621
Test: open Photos link in gmail twice
Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test CtsAppTestCases android.app.cts.NewDocumentTest
2017-10-06 09:34:10 -07:00
Jean-Michel Trivi
5bd051d981 Merge "AudioService: log focus changes and limit focus stack size" into oc-mr1-dev 2017-10-06 15:57:16 +00:00
TreeHugger Robot
27378c64c7 Merge "Add a flag to virtual display to indicates that content on this display need to be destroyed once the display is removed. Then apply this flag to VR virtual display." into oc-mr1-dev 2017-10-06 14:38:42 +00:00
Erik Kline
a5ae9056e7 Log NAT update descriptions when receiving netlink errors
Test: as follows
    - built
    - flashed
    - booted
    - runtest frameworks-net passes
    - new logging messages observed

    2017-10-06T13:15:25.190 - [OffloadController] ERROR Error updating NAT conntrack entry >TCP (192.168.43.222, 58054) -> (198.35.26.112, 443)<: android.system.ErrnoException: NetlinkErrorMessage{...
Bug: 29337859
Bug: 32163131
Bug: 64976634
Bug: 67396342

Change-Id: Ie05d4e6588d75f8a9798f40b68a317e24b3b5050
2017-10-06 13:35:35 +09:00
Jean-Michel Trivi
0b67b9fad6 AudioService: log focus changes and limit focus stack size
Log audio focus request and abandon commands.
Limit the size of the audio focus stack to prevent malicious
  applications trying to run the process out of memory.

Test: use media apps and speech reco, check dumpsys audio
Bug: 67055749
Change-Id: I529529fe40f33a8f67c64c3c61ba22d9530fb4d9
2017-10-05 14:25:52 -07:00
Ruben Brunk
b844956d69 Fix NPE in dumpsys logs.
Bug: 67460310
Bug: 66967700

Test: adb shell dumpsys vrmanager

Change-Id: I008717663dd5ae4fe99ca62f631794a56ca2eb12
2017-10-05 20:39:48 +00:00
Ruben Brunk
d675f51c72 Change recovery logic for services bound by VrManagerService.
- On AIO VR devices (where live VR services are required to render
anything), reconnect to the VrListenerService and VR compositor service
indefinitely and never leave VR + persistent mode.
- On smartphone VR devices, do not reconnect if the VrListenerService
dies for any reason, instead immediately leave VR + persistent mode.  If
the VR compositor dies, reconnect a limited number of times.  The
expectation is that the VrListenerService process will detect the
compositor crashes separately (via a shared service binding), and chose
to either attempt to fall back to a previous render path or simply
propagate the crash and leave VR mode entirely.
- Update dumpsys logging to include lifecycle events from the
VrListenerService and VR compositor service.

Bug: 66967700

Test: Manual test with VrCore APK by logging when the VR services are
connected and killing each VrCore process from ADB shell.

e.g.:
- Repeatedly kill the VrCore main process.
- Repeatedly kill the VrCore compositor process.
- Repeatedly kill both processes.

Change-Id: I8952b872b39102a601f66bc6624fc0ad92ca0f30
2017-10-05 04:47:58 -07:00
TreeHugger Robot
c765c2c448 Merge "Bind VR compositor service from VrManagerService." into oc-mr1-dev 2017-10-05 03:53:44 +00:00
TreeHugger Robot
d947ff602e Merge "Fix race condition when entering low persistence mode" into oc-mr1-dev 2017-10-05 00:51:50 +00:00
rongliu
1e90fc38db Add a flag to virtual display to indicates that content on this
display need to be destroyed once the display is removed.
Then apply this flag to VR virtual display.

Change-Id: Icb5aa1280b6ebac5941afda1cc1b94b258ce44f4
Bug: 67420451
Test: Manually. "adb shell am stack list" does not show contents
from virtual display anymore after it's released.
2017-10-04 17:50:23 -07:00
TreeHugger Robot
406d5dfb12 Merge "Update Settings properly when no Spell Checker is available." into oc-mr1-dev 2017-10-05 00:08:53 +00:00
Calin Juravle
446e8babd6 Merge "[framework] Compile secondary dex files in isolation" into oc-mr1-dev 2017-10-04 23:59:10 +00:00
Karthik Ravi Shankar
6685531585 Fix race condition when entering low persistence mode
The problem is that -

1) When the device enters a VR activity directly from screen off, there
   is a chance the device is not in low persistence mode and ghosting is
   really bad.
2) LocalDisplayAdapter gets to know that the device is in VR mode later
   than PowerManagerService due to scheduling of it's runnable.
3) The call to Lights HAL to change the display mode only is made only
   when there is a brightness change.
4) This opens up a race condition where the PowerManagerService knows device
   is in VR mode and changes the brightness to VR brightness before the
   LocalDisplayAdapter knows about the VR mode change.
5) Since there is no more brightness change to be done, the device is
   not in low persistence mode creating really bad UX.

Fix is to trigger a brightness change call when there is a Display state
change so that LocalDisplayAdapter sets the low persistence mode
correctly always.

Bug: 67114120
Test:

1) Lock and unlock to VR puts the device in low persistence mode
   correctly always.
2) Lock and unlock in normal mode changes brightness correctly.
3) Even with lockscreen, all of the use cases above work correctly.

Change-Id: Ic0e6d92ba145aaa94f86e6d53ab5aa08cbbae10c
Signed-off-by: Karthik Ravi Shankar <karthikrs@google.com>
2017-10-04 15:18:55 -07:00
Robert Carr
0e00727faa Disable seamless-rotation when other windows are visible.
Was never supported but has gotten more horrific for whatever reason.

Bug: 65612427
Change-Id: I25758f40876c76a6daaf6330ed7cfa84c759fc0f
2017-10-04 21:13:35 +00:00
Calin Juravle
27f9262124 [framework] Compile secondary dex files in isolation
The class loader context adds the overhead of extracting in-memory and
possibly extra verification which is being frowned upon when the loading
happens on the UI thread. Revert the correct fix of compiling secondary
dex files with their loading context until b/64530081 is done.

Partial revert of commit f1ff36f0f9.

Test: adb shell cmd package compile -m quicken -f --secondary-dex
com.google.android.gms
Bug: 64530081
Bug: 66984396
Change-Id: Ib2815ce67b224883fe95c28d1424103e56342c6e
2017-10-04 13:57:56 -07:00
Yohei Yukawa
f93ca9fb89 Merge "Select only preinstalled Spell Checker Services" into oc-mr1-dev 2017-10-04 19:39:53 +00:00
Jean-Michel Trivi
df3e2be715 Merge "AudioService: log ducking and incall muting of audio players" into oc-mr1-dev 2017-10-04 18:33:42 +00:00
Guliz Tuncay
34a04e40bd Update Settings properly when no Spell Checker is available.
Currently, Settings is not being updated properly when the current spell
checker service is removed or disabled and there is no other spell
checker service available. The correct behavior is that Secure.Settings
should be updated with empty string to indicate there is no selected
spell checker service.

Bug: 64812014
Fixes: 67412078
Test: Manually as follows:
  0. Make sure AOSP keyboard is installed.
  1. adb shell settings put --user 0 secure selected_spell_checker com.android.inputmethod.latin/.spellcheck.AndroidSpellCheckerService
  2. tapas SampleSpellCheckerService
  3. make -j
  4. adb install --user 0  -r out/target/product/generic/system/app/SampleSpellCheckerService/SampleSpellCheckerService.apk
  5. adb shell pm disable com.android.inputmethod.latin
  6. adb shell settings get --user 0 secure selected_spell_checker
      -> com.example.android.samplespellcheckerservice/.SampleSpellCheckerService
  7. adb uninstall com.example.android.samplespellcheckerservice
  8. adb shell settings get --user 0 secure selected_spell_checker
      -> empty
  9. adb root
  10. adb shell settings get --user 0 secure selected_spell_checker
      -> empty
  11. adb shell pm enable com.android.inputmethod.latin
  12. adb shell settings get --user 0 secure selected_spell_checker
Change-Id: I30902a3d94f2ddef33f4a8067799e98322ae3a03
Merged-In: I30902a3d94f2ddef33f4a8067799e98322ae3a03
(manual cherrypick of 83a7330bbe)
2017-10-04 09:37:38 -07:00
Guliz Tuncay
b119a0853b Select only preinstalled Spell Checker Services
When we are setting a new spell checker as the default one in
Secure.Settings, TSMS#findAvailSpellCheckerLocked can pick up
any available spell checker service. This violates the principle
that user should be warned whenever we are setting an untrusted
spell checker service as the default service, since the warning
dialog is never shown.

Bug: 64764051
Fixes: 67410643
Test: Manually as follows:
0. Make sure AOSP keyboard is pre-installed.
1. adb shell settings put --user 0 secure selected_spell_checker com.android.inputmethod.latin/.spellcheck.AndroidSpellCheckerService
2. tapas SampleSpellCheckerService
3. make -j
4. adb install --user 0  -r out/target/product/generic/system/app/SampleSpellCheckerService/SampleSpellCheckerService.apk
5. adb shell pm disable com.android.inputmethod.latin
6. adb shell settings get --user 0 secure selected_spell_checker
    -> com.android.inputmethod.latin/.spellcheck.AndroidSpellCheckerService
7. adb reboot
8. adb shell settings get --user 0 secure selected_spell_checker
    -> com.android.inputmethod.latin/.spellcheck.AndroidSpellCheckerService
Change-Id: I298ffbcfa5e32f43753f54fbebc40a414a5c0f9e
Merged-In: I298ffbcfa5e32f43753f54fbebc40a414a5c0f9e
(manual cherrypick of 0f0a37ba7d)
2017-10-04 08:57:49 -07:00
Eric Laurent
77ee4f2ff2 Merge "Fix Cell broadcast sound in total silence" into oc-mr1-dev 2017-10-04 14:45:01 +00:00
Sudheer Shanka
7a349d7288 Merge "Update NPMS to inform NMS of the changes in fw rules synchronously." into oc-mr1-dev 2017-10-04 06:47:13 +00:00
Ruben Brunk
52ea662280 Bind VR compositor service from VrManagerService.
- Allow VR system application to have VR manager service bind a
compositor process so that oom scoring for the compositor process can be
adjusted.

Bug: 38390640

Test: Check that the VrCore compositor process is -700 on AIO devices with:

  adb shell procrank -o

Change-Id: I7b5bce5eb87bd5ed0fdeadf4ec7bdd2b361ab875
2017-10-03 20:58:30 -07:00
Sudheer Shanka
addebccc56 Update NPMS to inform NMS of the changes in fw rules synchronously.
Currently, NPMS informs NMS synchronously at some events and
asynchronously at some others. If these sync and async calls get
interleaved, then NMS will end up in an inconsistent state.

In N-MR1, NPMS was updated to inform NMS asynchronously to avoid some
lock contentions during screen unlock. This shouldn't be a problem any more
since NPMS no longer updates its internal state on ui thread and also
netd calls have been optimized from ~50ms to ~7ms since then.

Bug: 66015813
Test: cts-tradefed run singleCommand cts-dev -m CtsHostsideNetworkTests -t \
      com.android.cts.net.HostsideRestrictBackgroundNetworkTests

Change-Id: I24ccb5819430f19014630e7b90cba1f0b993e430
2017-10-03 16:37:07 -07:00
TreeHugger Robot
f2c00946e0 Merge "Foreground service notis must be correctly formed." into oc-mr1-dev 2017-10-03 20:23:32 +00:00
Chris Wren
72826c99fa Merge "measure snooze UI use more precisely" into oc-mr1-dev 2017-10-03 20:16:58 +00:00
Jean-Michel Trivi
74a5596a8a AudioService: log ducking and incall muting of audio players
Event logger: add support for logging the text of the event in
  the logcat at the same time to avoid having the duplicate the
  logcat entry and the logger event. See printLog() method.
AudioPlaybackMonitor: log ducking and incall muting.

Test: play media and notification, verify logs appear in logcat and dumpsys audio
Bug:65363602
Change-Id: I2af0c2bbd2fde428f07761ca45e7950a16843604
2017-10-03 17:11:55 +00:00
Chris Wren
21a2e72655 measure snooze UI use more precisely
Bug: 67003813
Test: runtest systemui
Change-Id: Id7ba68c8308e911cd506943f84c034ade21d1514
2017-10-03 13:01:15 -04:00
Eric Laurent
0f6e9b5a79 Merge "AudioService: do not unmute media on headset plug in total silence mode" into oc-mr1-dev 2017-10-03 15:32:56 +00:00
Jaewan Kim
da74a15313 MediaSessionService: Prevent getActiveSessions() from growing infinitely
Bug: 67358262
Change-Id: I1c25a456ff4f2b16fee3098ac8f14d2899fb1ca5
Test: Run CtsMediaHostTest
2017-10-04 00:11:55 +09:00
TreeHugger Robot
96b9ddbcb2 Merge "Reduce lock interactions in backup transport management" into oc-mr1-dev 2017-10-02 22:43:48 +00:00
Christopher Tate
2f87cb2d4a Reduce lock interactions in backup transport management
1. process package update broadcasts on our background thread rather
   than on the main looper thread

2. don't synchronize unnecessarily around access to simple
   transport metadata

We mustn't block the main looper thread for anything that might wind
up interlocked with calls to the transport, because those might take
arbitrary amounts of time.  We were previously entering such an
implicitly interlocked code path during package-changed broadcast
handling, and in pathological cases were causing the watchdog to
restart the system.  This situation is addressed in a couple of ways:
first, by no longer performing package-update work on the main looper
thread at all; and second, by eliminating lock reliance entirely from
data-access paths that don't actually need it.

Bug: 65438129
Bug: 64133971
Test: manual + CTS
Change-Id: I361ad4a0729f319db7339bd341a6d33aa3b64fed
Merged-In: I361ad4a0729f319db7339bd341a6d33aa3b64fed
2017-10-02 20:15:18 +00:00
TreeHugger Robot
488665d9e3 Merge "Fix launch of activities into VR Virtual display" into oc-mr1-dev 2017-10-02 18:13:04 +00:00
TreeHugger Robot
3e038bd4d6 Merge "AudioService: more logs for audio mode changes" into oc-mr1-dev 2017-10-02 15:34:47 +00:00
Julia Reynolds
f3de8aa2cd Foreground service notis must be correctly formed.
If an app targets api 26, it needs a notification channel, even for
foreground service notifications.

Change-Id: Id3131d4bb2748e9d23f66dd4f5570842bc50a44f
Fixes: 66905243
Test: manual
2017-09-29 15:52:37 -04:00
Bryce Lee
1ced4b7b70 Update configuration whenever the visible window is laid out.
The configuration update during layout is currently restricted to
whether the client is hidden. This does not cover all the conditions
where the window can be laid out, such as if it is the starting
window.

This changelist makes sure the same condition is used in both cases.

Change-Id: I64a2f70718b949f3803e8cafcdabd2be5b5885e6
Fixes: 67027059
Test: Repeatedly open Gmail and ensure no jump-cut occurs.
2017-09-29 08:52:09 -07:00
Bryce Lee
9b6ef6a8f6 Merge "Reduce synchronized lock scope." into oc-mr1-dev 2017-09-29 14:18:12 +00:00
Hyundo Moon
ec0fc85a90 Merge "Prevent system crash when adjusting volume with illegal direction" into oc-mr1-dev 2017-09-29 05:12:43 +00:00
Jaewan Kim
e98975db32 Merge "Add multiuser support for enabling notification listener" into oc-mr1-dev 2017-09-29 02:28:49 +00:00
Eric Laurent
e5a351cb92 Fix Cell broadcast sound in total silence
PlayerBase:
 Update player volume when the audio attributes are updated in case
we need to unmute
PlaybackActivityMonitor:
 Unmute alarm stream if needed when an alarm with flag
 FLAG_BYPASS_INTERRUPTION_POLICY starts from an app with
 privileged permission MODIFY_PHONE_STATE.

Bug: 63617557
Test: check sound with cell broadcast in total silence
Change-Id: Ifacb1d96a2d8d44047d9f9642d1e672fcf756cda
2017-09-28 18:00:01 -07:00
TreeHugger Robot
4de7ab5cb1 Merge "Don't clobber shared libs when updating app info" into oc-mr1-dev 2017-09-28 22:22:56 +00:00
Eric Laurent
6afa65008d AudioService: more logs for audio mode changes
Added more logs to audio mode changes to track both the requested mode
and the actually selected mode.

Bug: 65513486
Test: Verify logs after various voice and VoIP scenarii
Change-Id: I486f091803ef7776ff325db908e8e462852ea3c1
2017-09-28 15:18:19 -07:00
Karthik Ravi Shankar
4c65738895 Fix launch of activities into VR Virtual display
When launching a 2D activity in VR mode by the VR app, we want to launch
it in the virtual display created by VR. But, this fails since the
virtual display owner is system and the calling UID doesn't have
ACTIVITY_EMBED permission.

We address this by making the virtual display public since it's lifetime
is only VR mode and we want to allow all apps to launch 2D activities
and route them to the vr virtual display.

Bug: 66475142
Test: Launch VrSettingsActivity by clicking on gear and check "adb shell
am stack list" to verify it launched on the virtual display

Change-Id: Idde63ea63c953c6cf3d4ea46989a963a5651ce8a
Signed-off-by: Karthik Ravi Shankar <karthikrs@google.com>
2017-09-28 11:11:49 -07:00
Bryce Lee
69ad818375 Reduce synchronized lock scope.
The lock was introduced earlier to prevent race conditions between
setting the visibility and configuration. However, holding the lock
for the entire method leads to an increase in the frame time.

This changelist reduces the scope of the lock to cover the core
logic where this condition applies.

Change-Id: Ia97b3680f730264c10ff5067e4f21180cfb2202e
Fixes: 67010772
Test: go/wm-smoke
2017-09-28 10:08:43 -07:00