Commit Graph

1505 Commits

Author SHA1 Message Date
Shafik Nassar
f59cdcf6dc Merge "Allow MediaProvider to request REGISTER_STATS_PULL_ATOM" into rvc-dev 2020-06-18 12:25:55 +00:00
shafik
44f3ca5679 Allow MediaProvider to request REGISTER_STATS_PULL_ATOM
MediaProvider needs the permission to register a StatsPullCallback in
statsd to pull the external storage metrics.

Test: build
Bug: 149669087
Change-Id: I4f7e09c2e514e2290d1cd5ac765bb115e7ade9ef
2020-06-17 11:34:01 +01:00
Hao Chen
8de2ca3e5c Move car companion device support app perms to framework
Test: build and flash the trout PDK, boot to the UI
Bug: 158483244
Change-Id: Ic8cd135cde2d616e5a8d36b71de56acba4dab261
2020-06-16 21:30:12 +00:00
Yan Zhu
b6ac0061fa Merge "Install auto-generrate overlay packages even when not included in whitelist" into rvc-dev 2020-06-10 04:23:30 +00:00
Yan Zhu
31b01e4bc5 Install auto-generrate overlay packages even when not included in whitelist
Detect auto-generated overlay packages according to the suffix
(.auto_generated_rro_vendor_ OR .auto_generated_rro_product_)

Bug: 156668533
Bug: 140120696
Test: logcat: set DEBUG=true
adb logcat UserManagerService | grep overlay
atest
FrameworksServicesTests:com.android.server.pm.UserSystemPackageInstallerTest
-c

Change-Id: I1835eb923bf2421b2e171be0ac0fa400b6fd38f7
2020-06-08 16:34:34 -07:00
Zhomart Mukhamejanov
9fd6408edd Move car bugreport app perms to framework.
Change-Id: I5e541138c35cdf67d18ce5475221baeb3e7faef4
Test: emulator
Bug: 158151004
2020-06-07 18:04:19 -07:00
Dimuthu Gamage
8589197fb5 Adding incremental related peremissions to Shell
This is expected to be used with adoptShellPermission in the Incremental
CTS tests.

Test: atest android.content.pm.cts.PackageManagerShellCommandTest
(There will be future tests relying on this)

Bug: 158024822
Change-Id: I46674498783c5323668ff775c76ff31a304aeadb
2020-06-04 17:04:44 +00:00
Sung Min Lee
5bafce8420 Merge "Add CAPTURE_AUDIO_OUTPUT permission required for GTS test" into rvc-dev 2020-06-04 01:07:27 +00:00
TreeHugger Robot
f7deec1444 Merge "Add keylayout for Xbox controller over USB" into rvc-dev 2020-06-03 23:40:37 +00:00
Siarhei Vishniakou
4647f1866c Add keylayout for Xbox controller over USB
Without a custom layout, this controller has incorrect mappings for the
right stick and gas/break axes.
Add a custom layout to ensure all axes and keys are mapped properly.

Bug: 157852643
Test: connected controller to the phone and verified mappings using the
controllerTester app

Change-Id: I1f65fe973652e25fab5e6e29ab598eee54e33e06
2020-06-03 12:35:19 -07:00
Sung Min Lee
a90b1fcaca Add CAPTURE_AUDIO_OUTPUT permission required for GTS test
GtsDialerAudioTestCases require this privileged permission for testing in GTS.

Bug: 157243201
Test: run gts -m GtsDialerAudioTestCases
Change-Id: I32516e5dcf966b05cfb8ab4956a0cdb183298f2a
2020-06-02 21:24:59 -07:00
Mina Granic
3420744449 Merge "Whitelist READ_PRIVILEGED_PHONE_STATE permission needed by Build.getSerial()." into rvc-dev 2020-05-29 16:43:43 +00:00
Wei Wang
96f7636149 Add LOCATION_HARDWARE permission to shell.
A few location System APIs require LOCATION_HARDWARE permssion. Adding
this permission to shell so CTS tests can adopt this permission.

Bug:154347471

Test: atest PrivilegedLocationPermissionTest
Change-Id: I4abe4dc044ec4a3ab62352cc0f4a1726bebac633
2020-05-27 17:53:31 -07:00
Chen Xu
ef0740e227 Merge "support cellbroadcast data migration by dafault" into rvc-dev 2020-05-28 00:24:30 +00:00
Chen Xu
1d4939fff2 support cellbroadcast data migration by dafault
As part of mainline effort, cellbroadcastreceiver package name has been
renamed. Now its a completely new apk with different uid. That said all
user data e.g, cellbroadcast history and user preference from legacy app
com.android.cellbroadcastreceiver are gone. This change is to support
preserve user data when devices upgrate to R and take cellbraodcast.
mainline module.
1. create legacy cellbroadcast app with old pakcage name
com.android.cellbroadcastreceiver. this app only surface the old data
and should not contains any activities/services to handle emergecy apert
2. legacy cellbroadcast app will be included to the system image by
default. OEMs are free to remove it if they don't care data loss or
after R data migration is done. leagcy app will not be part of
com.android.cellbroadcast apex.
3. the real mainline module rename to com.android.cellbroadcast.module

Bug: 155844209

Change-Id: I5e61c7e777526e038cd8d9971a2c5b87c00eaacb
Merged-in: I5e61c7e777526e038cd8d9971a2c5b87c00eaacb
2020-05-27 20:25:10 +00:00
Robin Lee
3bf241ba1c Add Effect_Tick.ogg back to Android TV devices
Change-Id: I61039a9f3bae072cbf059c784b579ca3aa7f77be
Test: adb shell input keyevent DPAD_RIGHT
Test: ls $OUT/product/media/audio/ui
Bug: 157310189
Bug: 132316308
2020-05-27 18:14:35 +00:00
minagranic
f750a61838 Whitelist READ_PRIVILEGED_PHONE_STATE permission needed by Build.getSerial().
Bug: 144779107
Test: Plugged the phone, no SecurityException, started Phantoscope.
Change-Id: I2af21c1318fabb4d9a8b9bc6808dc163a3e353b5
2020-05-27 17:40:41 +00:00
Taran Singh
e20c25ddc6 Merge "Add Insets dumps and IME debug logs" into rvc-dev 2020-05-27 15:12:30 +00:00
Taran Singh
85661e3f9e Add Insets dumps and IME debug logs
Add more dumps and logs to better help debug IME insets better
Logging can be enabled by setting InsetsController.DEBUG to true.

Bug: 154348613
Test: manually build and flash.
      Verify showing and hiding IME shows logs.
      verify adb shell dumpsys window windows has new dumps

Change-Id: Iad0a21d81a22d6acfaaf5c5ca8b5131eec411e79
2020-05-27 15:12:07 +00:00
TreeHugger Robot
f49fa1a9ea Merge "Add support for TvInputManager.acquireTvInputHardware CTS" into rvc-dev 2020-05-27 04:39:45 +00:00
Ming-Shin Lu
aa9376bc4f Fix black screen during Quick switch
When quick switch a delayed task, before onTaskAppeared called,
if the user holds gesture on nav bar, TRANSIT_WALLPAPER_OPEN from closing
app happens will cancel recents animation when
WC#applyAnimationUnchecked, and that will cause the black screen if the
delayed task not yet drawn and there is no recents task snapshot on top.

Since cancelling recents animation during quick switching doesn't make
sense, to fix that, we should check the animation task target if is
still controlled by recents animation, if so, we should not cancel it.

Also, make sure if the appeared task has already been in task target list,
(i.e. task A appreared, quick switch to task B, before task B appeared,
quick switch back to task A) if so, we don't need to callback task
appeared again.

Fix: 156670249
Test: manual as issue test steps.
Change-Id: I303403d63c91c08fabcb8c5b1b1aac42c4ec65db
2020-05-25 21:20:33 +08:00
TreeHugger Robot
3ccf874dca Merge "Screen recording doesnt record internal audio" into rvc-dev 2020-05-18 16:37:11 +00:00
Jay Aliomer
c2094aedcc Screen recording doesnt record internal audio
Fixes: 156645454
Test: manual
Change-Id: I3be1df0e6261750b2fe923650ee3359414fce642
2020-05-16 17:58:25 -04:00
Siarhei Vishniakou
2abc5d2823 Add keylayout for Steam controller (USB)
In the USB mode, Steam controller needs a key layout, because most of
the buttons and axes are incorrectly mapped.

The wireless dongle has not been tested.

The controller also support BLE, but currently goes into lizard mode by
default (only mouse and 2 buttons: left/right clicks work). So a driver
is likely necessary to go into the normal mode over BT, and hid-steam
doesn't help with that currently.

On BT, the controller has product id of 0x1106.

Bug: 147434575
Test: use the "gamepad tester" app and connect joystick over the USB.
Ensure that all mappings work
Test: CTS test will not be done at this time because it requires
supporting SET_REPORT in the hid command.

Change-Id: Ic0c50695338f98dcaeaaa7b3417fde702563d205
2020-05-15 07:38:14 -07:00
Amy Zhang
5f8498bcf1 Add support for TvInputManager.acquireTvInputHardware CTS
1. Add a test api in TvInputManager to add hardware device for testing
2. Add Shell permission for TV_INPUT_HARDWARE
3. Add TUNER_RESOURCE_ACCESS permission for TvInput Framework.

Test: atest android.media.tv.cts
Bug: 155114656
Change-Id: I227f13cbf14532d8732729412ae9c2518755ef02
2020-05-14 17:37:52 -07:00
TreeHugger Robot
021ceaecf2 Merge "Add day-night-mode permission to Shell." into rvc-dev 2020-05-13 19:41:38 +00:00
Treehugger Robot
fbd4a6f80a Add day-night-mode permission to Shell.
Without the permission "adb shell cmd uimode night <mode>" doesn't work.
Adding the permission to the AndroidManifest file so the shell command
will work.

Bug: 155584597
Test: run `adb shell cmd uimode night <no|yes|auto>`
Change-Id: Ic444f3351cb130d24a2794284c6bf8709c80712c
(cherry picked from commit a85cc22044)
2020-05-12 15:13:26 +00:00
Yuncheol Heo
561f67eb72 Includes SecondaryHome into the priv app whitelist.
- Add android.permission.INTERACT_ACROSS_USERS for the CarNotificationLib.

Bug: 156114875
Test: check if SecondayHome is shown (in gcar_hl_md_emu_x86).
Change-Id: I79ae64b90a52235876a6e51ad01ae70def1bf1fa
2020-05-11 19:52:01 -07:00
Hall Liu
45066127b3 Convert Telephony broadcasts to be non-sticky
Convert ACTION_SERVICE_STATE_CHANGED and
ACTION_ANY_DATA_CONNECTION_CHANGED to be non-sticky broadcasts that
require the READ_PHONE_STATE permission to receive. As part of this,
declare READ_PHONE_STATE to be split from READ_PRIVILEGED_PHONE_STATE,
so that system apps holding READ_PRIVILEGED_PHONE_STATE can also receive
these broadcasts.

Also modify affected users to fetch the current value of the broadcast
upon registration instead of relying on the sticky nature of the
broadcast.

Bug: 150155839
Test: manual
Test: atest KeyguardUpdateMonitorTest
Change-Id: I020b1554c4fc59c138d015e787526b4a66c74853
2020-05-06 18:11:50 -07:00
Joseph Pirozzo
928d88431a Merge "EmbeddedKitchenSinkApp BLUETOOTH_PRIVILEGED" into rvc-dev 2020-05-04 23:30:55 +00:00
Siarhei Vishniakou
0a19f87982 Merge "Add layout for xbox 360 wireless controller" into rvc-dev 2020-05-04 22:13:49 +00:00
Joseph Pirozzo
5212738a84 EmbeddedKitchenSinkApp BLUETOOTH_PRIVILEGED
Grant BLUETOOTH_PRIVILEGED permission to test app for Bluetooth testing.

Bug: 155672526
Test: In Kitchen Sink, connect on MAP profile.
Change-Id: I736f5a46e2f198947d7077a5542cf986aea7355c
2020-05-04 13:46:51 -07:00
Siarhei Vishniakou
046e478fd9 Add layout for xbox 360 wireless controller
We are currently missing a layout for the xbox 360 wireless controller,
with product id 02a1.

Bug: 144469012

Test: copied from Vendor_045e_Product_028e.kl
Change-Id: Ib0286d126273619352e9834e669413ecd699b1d9
2020-05-04 19:38:40 +00:00
Mark Renouf
03f9a814a5 Merge "Scroll Capture Framework" into rvc-dev 2020-04-20 19:20:13 +00:00
Mark Renouf
a927929d99 Scroll Capture Framework
This is an implementation of long screenshots supporting
interactive, incremental capture of scrolling content using
a cooperative API between the app process and the system.

Design goals:

 - Provide for tile based incremental screenshots of scrolling content
 - Support existing apps without developer action
 - Provide support for non View-based Apps & UI toolkits

Bug: 148131831
Test: atest \
      FrameworksCoreTests:android.view.ScrollCaptureClientTest \
      FrameworksCoreTests:android.view.ScrollCaptureTargetResolverTest \
      FrameworksCoreTests:com.android.internal.view.ViewGroupScrollCaptureTest \
      FrameworksCoreTests:android.view.ScrollViewCaptureHelperTest \
      WmTests:com.android.server.wm.DisplayContentTest

Merged-In: I6c66a623faba274c35b8fa857d3a72030a763aea
Change-Id: I6c66a623faba274c35b8fa857d3a72030a763aea
2020-04-20 15:07:59 +00:00
Andrei Litvin
3b92b9682d Add support for GamePad api in ITvRemoteServiceInput.
Gamepad-specific API is a separtate input path from standard "remote"
service. Specifically it adds:
  - openGamepad that creates a virtual input device with
  gamepad-specific suport
  - send gamepad keys
  - send gamepad axis updates, which support joysticks, analog triggers
  and HAT axis (as an alternative to DPAD buttons).

Bug: 150764186

Test: atest media/lib/tvremote/tests/src/com/android/media/tv/remoteprovider/TvRemoteProviderTest.java

Test: flashed a ADT-3 device after the changes. Android TV Remote
      on my phone still worked in controlling the UI.

Merged-In: I49612fce5e74c4e00ca60c715c6c72954e73b7a3
Change-Id: I49612fce5e74c4e00ca60c715c6c72954e73b7a3
(cherry picked from commit 9b9f556af1)
2020-04-20 10:42:58 -04: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
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
Charles Chen
5c082c998f Merge "Fix WindowContext leak" into rvc-dev 2020-04-09 07:39:29 +00:00
Charles Chen
4bff5be1a9 Fix WindowContext leak
The root causes of this issue are:
  1. WindowTokenClient#attachContext makes WindowTokenClient has strong
     reference to WindowContext, which leads to WindowContext cannot be
     GC'd.
  2. WMS#removeWindowToken needs MANAGE_APP_TOKEN permission which
     normal apps don't hold.

This CL does following things:
  1. Use weak reference instead on WindowTokenClient#mContext.
  2. Relax WMS#removeWindowToken to check callingUid if
     MANAGE_WINDOW_TOKEN permission is not held
  3. Deliver config changes to the client side in
     WMS#addWindowTokenWithOption
  4. Some minor fixes

fixes: 150812449
Bug: 150715095
Test: atest WindowContextTest
Test: atest WindowManagerServiceTests
Test: atest WindowTokenTests
Test: atest WindowManagerPermissionTests#testMANAGE_APP_TOKENS
Test: atest
WindowManagerPermissionTests#testADD_WINDOW_TOKEN_WITH_OPTIONS

Change-Id: I9f1d73af2abb78fc9844e6d9eb25e9f0293514e7
2020-04-08 21:30:24 +08:00
wilsonshih
d0fc2ca51f Support addWindow as other user
Support addWindow with the other userId which can be different from Uid.

This can be used when client want to addView for secondary user.
Example:
1. Create context with createContextAsUser or similar method.
2. Get WindowManager with this context.
3. WindowManager#addView

Bug: 151414297
Test: atest WmTests WindowAddRemovePerfTest AddWindowAsUserTest
Change-Id: I13e58d76b1f056f3829bc984c2b61496c8f8d535
2020-04-08 15:15:01 +08:00
Nate Myren
068b2b0df2 Add enable/disable permission to permissioncontroller
Ensure the permission controller can enable and disable apps

Bug: 146513245
Test: Manual
Change-Id: I185335bd729c8fa94b150d3b3adb95b89013aa16
2020-04-07 12:07:54 -07:00
TreeHugger Robot
6bb03f2447 Merge "Do not remove window if IWindow#resized is failed" into rvc-dev 2020-04-06 04:15:49 +00:00
Riddle Hsu
839b5f55f9 Do not remove window if IWindow#resized is failed
Even DeadObjectException is thrown, it is not equivalent to the
window is died (transaction failed by small size data will be
DeadObjectException). Sometimes it may be caused by the binder
buffer of process is temporarily full. If the window is removed
directly but the process is still alive, the application client
and window manager are out of sync. Especially if the window is
important system window, e.g. status bar, notification shade,
navigation bar, which might need to reboot to recover. Ideally,
if the process is really dead, there should be a binderDied
callback that also removes the window.

The original purpose of the removal is to avoid display frozen
(e.g. rotation) always timeout which is caused by resetting
WindowState#mOrientationChanging in each layout traversal. Now
the window states are still updated as "resized" has reported,
so it won't block unfreeze display.

Bug: 151814107
Bug: 147448299
Test: atest WindowStateTests#testReportResizedWithRemoteException
Test: Hard code to throw RemoteException for a specified window
      and rotate the display.

Change-Id: Id295456cc99ab9af30aa5fad2eedada6afb862a2
2020-04-03 14:59:12 +00:00
Ytai Ben-Tsvi
152e25b804 Remove obsolete permission
Bug: 146157104
Merged-In: I95aafe0e41977ca2656163fce9796abc6127c202
Change-Id: Ia528e3017d25625931a84249872f699659ae6b9a
2020-04-01 10:00:25 -07:00
Andrii Kulian
86d676c81f 3/n Refactor TaskContainers to TaskDisplayArea
Renamed TaskContainers to TaskDisplayArea and added getDisplayArea()
method to WindowContainer that finds the first display area in the
hierarchy above the node. ActivityRecord and Task override it to
return the TaskDisplayArea class.

Bug: 152116619
Test: WM CTS and unit tests
Change-Id: I4525afbcd794848e1020213cdca04d89a646dd55
2020-03-31 12:15:57 -07:00
Xiangyu/Malcolm Chen
0c654b66f9 Merge "Allow implicit broadcast of multi SIM config change." into rvc-dev 2020-03-31 01:16:00 +00:00
Malcolm Chen
2b93ea07f7 Allow implicit broadcast of multi SIM config change.
This is a important broadcast that needs to be picked by multiple
components and apps.

Bug: 152655546
Test: build and sanity
Change-Id: I17befbb8814c09c24498b4e534e04f0fbce24c2f
2020-03-30 16:02:09 -07:00
Adam Bookatz
9968525afb Merge "UserSystemPackageInstaller only (un)installs when appropriate" into rvc-dev 2020-03-30 18:09:25 +00:00