Commit Graph

63891 Commits

Author SHA1 Message Date
TreeHugger Robot
ce4cd092d9 Merge "MediaRouter: don't scanPackages if unnecessary" into rvc-dev 2020-04-10 15:43:14 +00:00
Kyunglyul Hyun
89e2ee9bc7 MediaRouter: don't scanPackages if unnecessary
scanPackages was called whenever it receives a broadcast,
which could be duplicated.
This CL adds a boolean variable (mScanPackagesScheduled) not
to scan packages if it is scheduled.

Bug: 153527463
Test: cts test, atest mediarouertest and check
MediaRouteProvider#onBind, #onUnbind are called
when a new provider is installed.
Confirm # of calls is reduced (3 -> 1).

Change-Id: Iaa423b7d1b2b2a97aebed0001b4077bdf95b1d54
2020-04-10 22:07:54 +09:00
Raff Tsai
5962269af8 Merge "Add SettingsStats puller in StatsPullAtomService" into rvc-dev 2020-04-10 10:08:30 +00:00
Wei Sheng Shih
1a46294fdb Merge "Support addWindow as other user" into rvc-dev 2020-04-10 08:33:12 +00:00
Ming-Shin Lu
1c92e1f789 Merge "Trigger onTaskAppeared when a task started from recents becomes ready." into rvc-dev 2020-04-10 05:46:13 +00:00
TreeHugger Robot
b4d5aef6b0 Merge "Determine if the activity is the topmost one" into rvc-dev 2020-04-10 04:07:28 +00:00
Winson Chung
cb437ade00 Merge changes I7d2ca2a2,I9f1fc593 into rvc-dev
* changes:
  Fix a couple issues with previous CL (keeping tasks hidden)
  Keep task hidden until task appeared
2020-04-10 03:03:21 +00:00
Eric Laurent
9454e04c8c Merge "AudioService: fix audio mode not reset to MODE_NORMAL" into rvc-dev 2020-04-10 02:31:52 +00:00
Louis Chang
d398485d3f Merge "Compute configuration overrides for tasks created by organizer" into rvc-dev 2020-04-10 01:29:44 +00:00
Calin Juravle
fe92847793 Merge "Enable dexopt for system server dex files" into rvc-dev 2020-04-10 01:02:16 +00:00
Calin Juravle
4fdf8271ce Enable dexopt for system server dex files
Add logic for dexopt-ing system server dex files. The files
are managed by the DexManager and need special dexopt
arguments.

As such, they have a dedicated dexopt path, that can be
initiated from DexManager. (The arguments are what we currently
use in ZygoteInit#performSystemServerDexOpt)

Test: adb shell cmd package dexopt android
      presubmits
Bug: 148774920
Change-Id: If0c0457f8045e8f475815136fb5ae2f340eb6661
2020-04-10 01:01:50 +00:00
wumin3
13821952ef AudioService: fix audio mode not reset to MODE_NORMAL
when a app call setMode to set mode to non MODE_NORMAL modes many times with different audio managers in the same process, in this case the "pid" parameters are the same and the "cb" parameters are not the same, then the parameter "cb" registered and the "mCb" in hdlr are not the same, then NoSuchElementException will happen, and when the app was cleared in recent tasks the audio mode will not be reseted to MODE_NORMAL by expected flow.

Bug: 153649105
Test: AudioManagerTest#testAccessMode, CallDetailsTest#testSetVoipAudioMode
Test: manual cell and voip call
Signed-off-by: wumin3 <wumin3@xiaomi.com>
Change-Id: Ifb8c66372a8e994edcea628cad7dc2a7ee4763a6
Merged-In: Ifb8c66372a8e994edcea628cad7dc2a7ee4763a6
2020-04-10 00:37:43 +00:00
Raff Tsai
87cefd4f28 Add SettingsStats puller in StatsPullAtomService
1. Add typed_features.proto contain StringListParam proto
2. Add SettingsStatsUtil to parse DeviceConfig whitelist and
create log
3. Add test case in SettingsStatsUtilTest

Test: atest FrameworksServicesTests:SettingsStatsUtilTest
      adb shell cmd stats pull-source 10080
Bug: 142941011
Change-Id: I5a161cf12dd6d52ae80813e6d1fe10ecbc5d05cd
2020-04-10 08:37:17 +08:00
Winson Chung
8b5d23ab10 Fix a couple issues with previous CL (keeping tasks hidden)
- Attempting to set the visiblity when the task org is set can happen too
  early and cause the app to not draw and preventing taskAppeared().
  Instead, move this to setHasBeenVisible() to be in line with other
  cases in the system where we defer setting visibility until the apps
  are good to go.  However, if we do this, we also need the first draw
  (including the starting window) to trigger setHasBeenVisible() to
  ensure the task org can hide it in time (the task org will also want
  to receive the task as soon as possible). As a result of moving it out
  of when the task org is set on the task the PIP transition then also
  has to defer setting the visibility of the activity until the first
  draw.
- Also fix a case where we are dispatching task info change before
  taskAppeared().  There's a brief period where the task has an organizer
  set, but the task org state has not added that task yet or sent
  taskAppeared() because it has not yet drawn.  But in that state, config
  changes still happen causing a task info changed call to the task org.

Bug: 152809695
Bug: 152134460
Test: Open a bubble, ensure that we don't see the task in fullscreen
      first.  Enter pip, ensure that we don't see flash of the task
      before SysUI can fade it in.
Test: atest PipAnimationControllerTest
Test: atest TaskOrganizerTests
Test: atest SplitScreenTests

Change-Id: I7d2ca2a2e538f07c73fff79686e040c159c1dce3
2020-04-09 15:56:00 -07:00
Winson Chung
1b5d055f2e Keep task hidden until task appeared
- If the task is previously not visible or has no visible children at
  the point when we start controlling it in the task org, hide the task
  until we send taskAppeared to ensure that the task org can reparent
  and show it otherwise we could see a flash of the task.

  This happens mainly from two cases:
  - when starting a new task with a given win mode, we show it and wait
    for first draw before notifying the task org
  - when transitioning into pip from swipe up, the activity is hidden
    and when it requests to enter pip is made visible again

  Since we are hiding the task w/ the pending transaction, we also need
  to defer all task org callbacks until that's applied to ensure proper
  lifecycle of the calls.
- Also skip app transitions for task org tasks for now

This reverts commit d2fb07e4f6.

Bug: 152809695
Bug: 152134460
Test: Open a bubble, ensure that we don't see the task in fullscreen
      first.  Enter pip, ensure that we don't see flash of the task
      before SysUI can fade it in.
Test: atest PipAnimationControllerTest
Test: atest TaskOrganizerTests
Test: atest SplitScreenTests
Change-Id: I9f1fc5931df1d69a7086c02b633347162cda94bf
2020-04-09 15:55:03 -07:00
TreeHugger Robot
d11054d31f Merge "[stats] add metrics for package installer v2" into rvc-dev 2020-04-09 21:22:09 +00:00
Jing Ji
a550eec209 Merge "Add Embedded docs for the OomAdjuster" into rvc-dev 2020-04-09 20:38:21 +00:00
Rob Carr
0a57530be1 Merge "ViewRootImpl: Pass buffer to finishDrawing when requested" into rvc-dev 2020-04-09 20:26:43 +00:00
lumark
04bceb99f1 Trigger onTaskAppeared when a task started from recents becomes ready.
In quick switch flows, launcher will first swipe task snapshot
through recents animation, and then start new task with custom animation
options through startActivityFromRecents after gesture finish detected,
and then finish recents animation finally.

But that way user may experience flickering before the new task launch
and recents animation finish.

To improve quick switch flickering, we ignore the new task's custom
animation from recents and generate task remote animation target,
and then trigger a callback for launcher to control/animate this
task surface, more like a part of RecentsAnimation,

Also, adding removeTask method for launcher can flexibility remove the
new task animation target once no need to animate, so that launcher
can decide when to finish recents animation.

Bug: 152480470
Test: manual as below steps:
  1) Doing quick switch task.
  2) Make sure launcher can receive onTaskAppeared callback.
  3) Make sure launcher calls removeTask successfully.
  4) Make sure launcher can finish recents animation after 3).
Change-Id: I0692a280a49719229fa8871509bad37a1343a00f
2020-04-10 02:20:03 +08:00
TreeHugger Robot
bcc707d44c Merge "Check if fuse enabled before mounting storage data and obb dirs" into rvc-dev 2020-04-09 17:11:55 +00:00
Abodunrinwa Toki
33e891d1a2 Merge "Introduce an IconsContentProvider." into rvc-dev 2020-04-09 17:06:38 +00:00
Nikita Ioffe
e9ed63aa92 Merge "Introduce static @hide PowerManager.isRebootingUserspaceSupportedImpl()" into rvc-dev 2020-04-09 16:39:54 +00:00
Songchun Fan
c296cf746a [stats] add metrics for package installer v2
// Successful installation:
$ out/host/linux-x86/bin/statsd_testdrive -s 98141FFBA005QD 263
...
event_metrics {
  data {
    elapsed_timestamp_nanos: 147291968369
    atom {
      package_installer_v2_reported {
        is_incremental: true
        package_name: "com.unity.megacity"
        duration_millis: 1379
        return_code: 1
      }
    }
  }
}
...

// Failed installation:
$ out/host/linux-x86/bin/statsd_testdrive -s 98141FFBA005QD 263
...
event_metrics {
  data {
    elapsed_timestamp_nanos: 94418812060
    atom {
      package_installer_v2_reported {
        is_incremental: true
        package_name: ""
        duration_millis: 37
        return_code: -20
      }
    }
  }
}
...

Test: manual
BUG: 152913040
Change-Id: Ibb02122e7007f8e3afd65cbb98236bc37c0d24db
2020-04-09 09:33:34 -07:00
TreeHugger Robot
9f990dedb3 Merge "Add an API to set layer trace flags" into rvc-dev 2020-04-09 16:26:21 +00:00
TreeHugger Robot
1f1b416da9 Merge "ApexManager: Allow blocking Binder calls" into rvc-dev 2020-04-09 15:20:04 +00:00
Ricky Wai
6416747830 Check if fuse enabled before mounting storage data and obb dirs
Also, do not bind mount storage obb and data dirs if mount external is
in pass_through mode.

Fix: 151219235
Fix: 152395018
Fix: 152490627
Test: atest AdoptableHostTest
Change-Id: I77a86be5582ded0915b0a8a49d2b2a8c17fe58b7
2020-04-09 13:33:52 +00:00
Nikita Ioffe
57300d9057 Introduce static @hide PowerManager.isRebootingUserspaceSupportedImpl()
This method consolidates logic of testing whenever rebooting userspace
is supported in a place that can be used both from
PowerMager.isRebootingUserspaceSupported() API and from
PowerManagerService.reboot() implementation.

Consequently, this makes `adb shell svc power reboot userspace` also
benefit from that check, and fail userspace reboot on devices that don't
support it.

Also tweaked logic of ignoring RemoteException to take into account
userspace reboot.

Test: adb root
Test: adb shell setprop init.userspace_reboot.is_supported 0
Test: adb shell svc power reboot userspace & verified error message
Test: adb shell setprop init.userspace_reboot.is_supported 1
Test: adb shell svc power reboot userspace & verified no error message
Test: atest PowerManagerTest
Test: atest CtsUserspaceRebootHostSideTestCases
Bug: 152803929
Change-Id: I2d3a8e0ae1320c408a838c5c5fdf4cd977b167b3
2020-04-09 14:07:22 +01:00
Louis Chang
dff902bc7c Compute configuration overrides for tasks created by organizer
The config overrides were only computed for leaf tasks. So, the
config of the organized tasks were inherited from the display,
which was still fullscreen size. This was not right especially
for split-screen organizer tasks because the configuration could
be used by the organizers.

Also remove requesting override windowing mode as fullscreen for
home tasks, the config was updated to fullscreen or
split-screen-secondary while resolving override config instead.

Bug: 152408408
Test: Enter split-screen and show IME
Change-Id: Ie6737cb5e9655c57724fc140c6b6fde3a96be6ab
2020-04-09 18:05:07 +08:00
Charles Chen
5c082c998f Merge "Fix WindowContext leak" into rvc-dev 2020-04-09 07:39:29 +00:00
TreeHugger Robot
aa63edd33f Merge "Fix inverted ANR log message" into rvc-dev 2020-04-09 05:27:42 +00:00
TreeHugger Robot
0350a0c4ec Merge "Use full bounds if fixed aspect ratio does not apply" into rvc-dev 2020-04-09 05:25:53 +00:00
Louis Chang
d73abe2bbf Determine if the activity is the topmost one
ActivityStack#mTopActivityOccludesKeyguard may be
incorrectly updated by a non-top activity.

Bug: 149837574
Test: start emergency dialer from lockscreen
Change-Id: I830e572f008cbebb95f0d76416c70d948063dd97
2020-04-09 05:20:58 +00:00
Vishnu Nair
9eb672e5a9 Add an API to set layer trace flags
This will be used by FlickerTests to capture composition state
in SurfaceFlinger trace.

Test: atest FlickerLibTest:LayersTraceMonitorTest
Fixes: 153563549

Change-Id: I3d09196ced43a1b0bac811e8f458c28be4e44992
2020-04-09 04:04:46 +00:00
Jeff Sharkey
de7f060772 Merge "Offer a NOTIFY_NO_DELAY flag for notifications." into rvc-dev 2020-04-09 03:14:42 +00:00
Jon Spivack
0d106018db ApexManager: Allow blocking Binder calls
When ApexManager switched from using ServiceManager.getService to using Binder.waitForService to retrieve apexservice, it lost the call to Binder.allowBlocking that was inside getService. Since ApexManager currently makes several synchronous binder calls, this call is needed to avoid Log.wtf()s.

Bug: 153360345
Test: atest ApexManagerTest
Change-Id: I6016477b20754a6dc0f31588bae4e679f08a1ba2
2020-04-08 16:17:28 -07:00
Sungsoo Lim
1be609a3a8 Merge "Require permission for changing system routes" into rvc-dev 2020-04-08 22:55:26 +00:00
Jeff Sharkey
9d475e958d Offer a NOTIFY_NO_DELAY flag for notifications.
We've heard reports that some ContentProviders are sensitive to their
notifications being delayed, so this change adds a NOTIFY_NO_DELAY
flag that they can use to bypass any background delays.

Bug: 149370968
Test: none
Change-Id: I0465c8dee92cd5708c04035bc0396ce2d1083f67
2020-04-08 16:32:41 -06:00
Tiger Huang
b7dda7d9d5 Merge "Only use the IME target from IMMS to update the IME control target" into rvc-dev 2020-04-08 20:45:59 +00:00
Joshua Mccloskey
a0222398c5 Merge "Set pending client to null after timeout resumes" into rvc-dev 2020-04-08 19:58:19 +00:00
TreeHugger Robot
9b2931e973 Merge "dexopt: Add listeners when packages are updated by bg-dexopt" into rvc-dev 2020-04-08 19:48:41 +00:00
TreeHugger Robot
53566da190 Merge "DO NOT MERGE Add listener ids for location listening operations" into rvc-dev 2020-04-08 18:45:19 +00:00
Riddle Hsu
4cd3e2f25f Fix inverted ANR log message
To avoid misunderstanding while checking the log.

Bug: 143573504
Test: CtsAppTestCases:ActivityManagerTest#testAppNotResponding
Change-Id: I162aab785cd83db5db6cb33279f0b4ab0a458e94
2020-04-09 02:26:58 +08:00
Robert Carr
6cc720b70a ViewRootImpl: Pass buffer to finishDrawing when requested
As the final enabler for the BLASTSyncEngine, we add a new relayout
result BLAST_SYNC. If the WindowState is participating in a BLAST sync
during relayout we return it to the client. If we return it to the
client the client will direct it's next draw in to a BLAST transaction
and report that transaction via finishDrawing. You can now observe
the BLASTSyncEngine working end to end in TaskOrganizerMultiWindowTests.
We do a few small clean-ups in TaskOrganizerMultiWindowTest while we
are there.

Bug: 153561718
Test: TaskOrganizerMultiWindowTests
Change-Id: I719b731350b942aafa444a33972aaef8973422ea
2020-04-08 11:18:09 -07:00
Riddle Hsu
89e8206393 Use full bounds if fixed aspect ratio does not apply
If a non-resizable activity can fill the non-decor space,
its bounds should not exclude decor bounds because the
activity and decor can show as a continuous area. otherwise
unexpected letterbox may be created and IME cannot attach
to it due to the activity doesn't match parent's bounds.

Fix: 152197007
Test: SizeCompatTests#testAspectRatioMatchParentBoundsAndImeAttachable

Change-Id: I61d2c99702fb8642a3bf5728949489b6b98eb508
2020-04-09 02:16:37 +08:00
TreeHugger Robot
2a6add988c Merge "Fix race condition in OomAdjuster." into rvc-dev 2020-04-08 18:01:36 +00:00
Andrii Kulian
ac4b972e7a Merge "6/n Manage multiple task display area in the policy" into rvc-dev 2020-04-08 17:35:42 +00:00
Christine Franks
be3b2304d2 Merge "Differentiate per-layer saturation levels" into rvc-dev 2020-04-08 17:16:00 +00:00
TreeHugger Robot
04b2ace944 Merge "Synchronize adapter registration with mCallbacks" into rvc-dev 2020-04-08 17:13:15 +00:00
TreeHugger Robot
afef06a0f6 Merge "Revert "Revert "Do not mount whitelisted package in storage data and obb dirs""" into rvc-dev 2020-04-08 14:48:39 +00:00
TreeHugger Robot
6acebc809a Merge "Don't ask libc for PT feature w/o kernel support." into rvc-dev 2020-04-08 14:15:23 +00:00