summaryrefslogtreecommitdiff
path: root/tests/permission/src
AgeCommit message (Collapse)Author
2020-04-09Merge "Fix WindowContext leak" into rvc-devCharles Chen
2020-04-08Fix WindowContext leakCharles Chen
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-03-31PmPermissionsTest: Update test expectations for getPackageSizeInfoNarayan Kamath
Now unconditionally throws for apps targeting > 0. Test: atest PmPermissionsTests Bug: 148316352 Change-Id: Ia24d501257743db22d2f850a5fca933669f0a5ae
2020-01-06Add VibrationAttributesAlexey Kuzmin
Added a class for attributes of vibrations, to gradually replace usage of AudioAttributes in haptics context. Refactored VibrationService and related classes to use VibrationAttributes, converting AudioAttributes to VibrationAttributes and back as necessary Test: manual. Since it's a refacroring, everything should work as before Bug: 136810264 Change-Id: I82c04bc6f6fb723ee390e3b86a4a371564ab28d4
2019-08-30Change CellBroadcast APIs to SystemApiJordan Liu
Bug: 135956699 Test: atest SmsManagerPermissionTest Change-Id: Ibbb22505a80567d1c08cffe9b7a7fdbd10890abe
2019-06-25Merge "Ignore DND when FLAG_BYPASS_INTERRUPTION_POLICY is set." into qt-r1-devMichael Wright
am: 3af0a7b5e5 Change-Id: I4942abf90c783c67f0a32dbbc018a6a3e4d1c76e
2019-06-25Ignore DND when FLAG_BYPASS_INTERRUPTION_POLICY is set.Michael Wright
When DND is on, it sets AppOps to return MODE_IGNORED for any non-touch vibrations. Unfortunately, this means it blocks critical vibrations as well, like emergency alerts. In order to avoid this, we need to respect FLAG_BYPASS_INTERRUPTION_POLICY when set on the vibration attributes. Bug: 132112663 Bug: 135686242 Test: Manual Change-Id: I59465eed057b077a4c0548af162e0fec1c29afdc
2019-06-24Merge changes Ic2e27f56,Ie19e0995 am: 95f507f80dSteven Moreland
am: 6245e7efe6 Change-Id: Ic44dfe2b3defa6f60bee6062c049ff189223cb50
2019-06-21Remove references to setPermissionController.Steven Moreland
This method isn't implemented/used/etc.. Bug: 135768100 Test: TH Change-Id: Ic2e27f5685cc16562815fcaf1226bc7789f8d882
2019-04-10Do not allow moveToFront() and moveTaskToFront() when app is in backgroundRicky Wai
Bug: 129063631 Test: Unable to start activity / move task in background Change-Id: Icb5ebad3567b911719341f221483df1a1512109b
2018-12-20Move orientation request into hierarchy.Garfield Tan
This CL also removes a hidden method in IWindowManager that's only used inside of WM right now. Also wire up Task level logic. Bug: 113252523 Test: Manual test that app requested orientation still rotates the display and WmTests. Change-Id: I7c5046e9beaea79de4ec471eabc792e3593583a2
2018-11-29KeyguardDisableHandler: make properly user awareAdrian Roos
Also fixes an issue where the disable handler was not properly updated after adding a secure lockscreen. Also fixes an issue where the disable handler was not properly updated after the device policy changes for users other than USER_SYSTEM. Also prevents adding new privileged usages of the API. Also removes a workaround that prevented Keyguard from re-engaging if it timed out while the it was disabled. The workaround is no longer necessary because the in-call UI is now using the SHOW_WHEN_LOCKED API instead of disabling the keyguard. Change-Id: Ib2644252b3806de4cb09f03991d789b83e924a11 Fixes: 119322269 Test: atest KeyguardDisableHandlerTest CtsActivityManagerDeviceTestCases:KeyguardTests
2018-10-04Track focus changes on external displays (2/4)Tiger Huang
Let each DisplayContent has its own focused window and focused app. This change also moves the last tapped display to the top. Test: atest ActivityManagerMultiDisplayTests ActivityStackSupervisorTests ActivityStackTests CtsWindowManagerDeviceTestCases DisplayContentTests PointerCaptureTest Bug: 111361570 Change-Id: I776cabaeaf41ff4240f504fb1430d3e40892023d
2018-07-27Add an optional reason field to vibrator serviceAlexey Kuzmin
Test: Run vibration test, see reason written to log and trace. Bug: 109654229 Change-Id: I13db6968c125e7c2b2483a14faad5b6ea9b4cda6
2018-06-12Moved some activities implementation to ActivityTaskManagerService (2/n)Wale Ogunwale
Second step in unifying the window hierarchy that is currently split within AM and WM packages. We move some of the API implementation for activities from ActivityManagerService.java to ActivityTaskManagerService.java. Test: Existing tests pass Test: go/wm-smoke-auto Bug: 80414790 Change-Id: I23dcd924493d8ad1e0b6e3a55386fd72b0146605
2018-04-16Protect usage data with OP_GET_USAGE_STATS.Jeff Sharkey
APIs that return package usage data (such as the new StatsManager) must ensure that callers hold both the PACKAGE_USAGE_STATS permission and the OP_GET_USAGE_STATS app-op. Add noteOp() method that can be called from native code. Also add missing security checks on command interface. Bug: 77662908, 78121728 Test: builds, boots Change-Id: Ie0d51e4baaacd9d7d36ba0c587ec91a870b9df17
2018-01-16No sensor access to idle UIDs - frameworkSvet Ganov
Idle UIDs are ones that were in the background for long enough time. Currently such apps can access sensor data even though they have no user perceptible components running. This affects the user's privacy since an app in the background can use sensor data to infer location, activity, habbits, etc. The goal is to restrict sensor access for all apps in the ecosystem regardless of target SDK which means the solution should be backwards compatible. At the high level the sesnor service observes UID state changes and applies policy like this: Continuous sensors: for sensros in this reporting mode when the UID goes in the background we will stop dispatching events. Once the UID goes active we will start reporting the events. While this is an app visible behavior change we would rather do that vs delivering fake events. Flush events: there is no change in behavior based on the UID state. Hence, idle apps can request a flush and would get the completion callback. From an app perspective flushing works at any point. Trigger events: for sensors in this reporting mode when the UID goes in the background we will not report any trigger events. From an app perspective the sensor just did not pick up any events. On-change events: for sensors in this reporting mode when the UID goes in the background we will not report any change events. From an app perspective the sensor just did not pick up any events. Wake locks: since UIDs in idle state cannot acquire wakelocks we will not be grabbing a wakelock on behalf of apps in that state. Test: Added - SensorTest#testSanitizedContinuousEventsUidIdle Added - SensorTest#testBatchAndFlushUidIdle Pass - cts-tradefed run cts-dev -m CtsSensorTestCases bug:63938985 Change-Id: Iee73dc034f5fe7fbea789a3b60db4290757c5052
2018-01-04Use modern install method in backup servicePhilip P. Moltmann
Test: adb backup -apk myApp -f backup ; adb restore backup Change-Id: I2bbcb0487ecc525a6dc8a2693b15ce624db275b0
2017-10-11Removed remaining use of static stack ids.Wale Ogunwale
Replace by windowingMode and activityType. Test: Existing tests pass. Test: go/wm-smoke Bug: 64146578 Change-Id: I2ff026de3ead1a3e7136df17c68ed37d7aae5495
2017-03-20BZZZZZZT! BZZZZZT! New Vibrator APIsMichael Wright
Replace the existing Vibrator APIs with a new class to encapsulate the haptic effect information, and add the ability to control the vibration strength. Test: cts-tradefed run commandAndExit cts-dev -m CtsOsTestCases -t android.os.cts.VibratorTest cts-tradefed run commandAndExit cts-dev -m CtsOsTestCases -t android.os.cts.VibrationEffectTest runtest systemui-notification Manual testing with $T/google_experimental/users/michaelwr/Vibrator Bug: 30961353 Change-Id: Idbb9864a7b084c85e7b7de3257a0e6b40d9d91d6
2017-01-06Support for WindowContainer controllers and listenersWale Ogunwale
- WindowContainerController class allows a component outside window manager to create a window container and communicate directly with it to make changes. For example, the ActivityRecord class in activity manager uses the AppWindowContainerController class to create and communicate with AppWindowToken window container class which is its counterpart on the window manager side. - WindowContainerListener interface allows a component outside WM to get notified of changes to a window container. For example, the ActivityRecord class in AM implements the AppWindowContainerListener interface to get notified of changes to the AppWindowToken container. Bug: 30060889 Test: Existing tests pass and manual testing. Test: bit FrameworksServicesTests:com.android.server.wm.WindowContainerControllerTests Test: bit FrameworksServicesTests:com.android.server.wm.WindowContainerTests Change-Id: I2896bfa46a80b227052528c7da8cf4e56beab4bc
2016-12-12Untangle creation of Task from addition of AppToken in WM.Wale Ogunwale
Makes it easier to follow what is going on and also clean-up in preparation of stand way for AM to interact with containers in WM. Test: Existing tests pass and manual testing Change-Id: I91754b6d974dce2f696453cdaed175efb0f10c73
2016-11-14Update usage of ActivityManagerNative.Sudheer Shanka
- Remove references to ActivityManagerProxy. - Add isSystemReady to ActivityManager. Bug: 30977067 Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test android.server.cts adb shell am instrument -e class com.android.server.am.ActivityManagerTest,com.android.server.am.TaskStackChangedListenerTest \ -w com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner Change-Id: I07390b6124fb1515821f5c0b37baf6ae74adc8fa
2016-11-02Make window token add/remove APIs require displayIdWale Ogunwale
Window tokens can now only be on one display, so we now require clients that want to add/remove window tokens to specify the display they would like the token to be created on. This simplifies the token handling code in WM and will be useful moving forward for clients that want to add windows to external displays. Test: Existing tests pass Change-Id: I6b2d8d58a913b3624f1a9a7bebbb99315613f103
2016-10-25Apply display override config for secondary displaysAndrii Kulian
Now display-specific settings, such as dimensions and orientation, are stored in display override config. For default display it is mirroring the global config. Each time when global config is updated, override of the default display should be updated too and vice versa. Test: Existing and manual tests still pass. Change-Id: Ic6c2190092d328820f314a05bed43c875db18170
2016-07-27Add more onTopLauncher support.Jiaquan He
- Add onTopLauncher checking for TaskRecord. - Add onTopLauncher to the window manager. Bug: 28425537 Change-Id: Ic9e53db891dc42463a1a77b106ba93438a052181
2016-07-01Force CROSSFADE rotation when launching from double tap gesture.Robert Carr
When activity transition triggers a rotation change, the starting window will normally be the top window at the time we try to select the window animation. However, these layout params won't have the apps rotation animation set (as the client code will set that on the real window, not the starting window). Eventually we would like to add API to specify rotation animation via manifest to solve this problem cleanly. In the mean time, we can force a specific rotation animation from the double tap gesture, and clean up some camera ugliness. We accomplish this by attaching an animation hint to ActivityOptions. Bug: 28838855 Change-Id: If052cd8cbae76651da43f3b4c590cd9dcc1afc0f
2016-06-16Limit global drags to apps targeting SDK 24 and aboveYorke Lee
Bug: 29127791 Change-Id: Ib5f85a207bdb79eeac0418fda78e452d225761bc
2016-02-29Fix issue #27385109: control activity behavior without triggering...Dianne Hackborn
...isUserAMonkey for testing purpose Add an argument for the caller to specify if they are a poo flinging monkey. Change-Id: I0e149a8d78776abaf07517bd4ae886047b7f4252
2016-01-29Use resizeMode integer instead of resizeable boolean.Wale Ogunwale
Changes activity manager and window manager to use resizeMode as defined by ActivityInfo#resizeMode instead of a boolean. Bug: 26774816 Change-Id: I8cef46d9fba6bfdd21df7da63ed5d5330ad03d4b
2016-01-04Added support for android.R.attr#alwaysFocusableWale Ogunwale
Allows an activity to always be focusable regardless of if it is in a stack whose activities are normally not focusable. For example, activities in pinned stack aren't focusable. This flag allows them to be focusable. Also, changed ActivityInfo.#{resizeable, supportsPip} to use flags. Bug: 26273032 Bug: 26034613 Change-Id: I8c63e6d3256757e2e6931e08b8a65269f5169d35
2015-12-03Set proper stack in WM when activity is moved to stack in AMWale Ogunwale
When an activity is moved to a stack using the ActivityStack#moveActivityToStack API a new task is created to hold the activity in the stack. However, when the new task is created in the window manager side it uses the stack id of the previous stack the activity was in. We now pass the stack to use from activity manager to window manager. Bug: 25987309 Bug: 25961636 Change-Id: Iecc71f6d9b3e70a8d88e134b42f7532ba5327bad
2015-09-27Merge "Refactoring: Delete AppWindowToken.willBeHidden field."Filip Gruszczynski
2015-09-26Refactoring: Delete AppWindowToken.willBeHidden field.Filip Gruszczynski
The only time AppWindowToken.willBeHidden is used is for determining if the app should contribute to calculating orientation. In the same check AppWindowToken.hiddenRequested will be or-ed with willBeHiden, so it's enough that hiddenRequested to be set. The only place where willBeHidden is set, is right before WMS.setAppVisibility is called, which will set hiddenRequested. Because of this willBeHidden is unnecessary. Change-Id: Iea35f39f72e7f0dcd76205ef580f3a74cac72d08
2015-09-16Don't crop home activity windows to stack bounds.Wale Ogunwale
We crop windows to their stack bounds when the docked stack exists. We don't want to do this for the home activity since the docked stack isn't visible when the home activity is visible. Change-Id: Ibb3157dabbb6c979358ddc2098a01c6ddf6540e8
2015-09-01Move Configuration creation from Window Manager to Activity Manager.Filip Gruszczynski
Currently the construction of configuration is split between thease two entities. This poses two problems: it's harder to follow the construction logic and more importantly we can't determine if configuration changes significantly before delegating work to the Window Manager. This CL moves the configuration override logic to the Activity Manager, since it both detects configuration changes and informs clients about them. Window Manager becomes purely a recipient of the information. Change-Id: I075570ee055cce9c5665772fa8d4fe8ccb5c6313
2015-08-06Support creating/launching a task with non-fullscreen boundsWale Ogunwale
Change-Id: Icc6d6b25b5f6f236030e654a3eb3ec7f00287d2f
2015-05-01Add body sensors app op - framework baseSvet Ganov
Change-Id: Idd5cd573fab3405e5b2a6e51d2d9d115650826e9
2015-04-28Respect the record audio app op - frameworkSvet Ganov
Change-Id: I5696d2ef22738ccffaf8bd7a0ee68cbc3dea3bf1
2015-01-27Eliminate groupId and add task to AppWindowTokenCraig Mautner
Simplifies access by eliminating indirect referencing. Fixes bug 18088522 item #15. Change-Id: I9049192a7f3e1028d60c4f2d4d4a0d4aad590aa4
2015-01-15Remove unused method moveTaskToBack.Craig Mautner
Everyone uses moveActivityTaskToBack() instead. Fixes item #3 of bug 18088522. Change-Id: I16028335fe1eef8a2aa47804f46536e395a16d8c
2014-07-15Fix buildCraig Mautner
Add parameter to WindowManagerPermissionTests. Fixes build. Change-Id: Iecf064ee0be612e59aa1b7f0a42807be1bc59e78
2014-05-28Add system layer for voice interaction services.Dianne Hackborn
New window layer that voice interaction service windows go in to. Includes a new voice-specific content rectangle that voice activities are placed in to. Add specific animations for this layer, sliding down from the top (though this can be customized by the voice interaction service). Also add the concept of activities running for voice interaction services for purposes of adjusting the animation used for them, again sliding from the top, but not (yet?) customizable by the voice interaction service. Change-Id: Ic9e0e8c843c2e2972d6abb4087dce0019326155d
2014-03-27Expand install observer semanticsChristopher Tate
...and now fail conservatively when two apps both attempt to define the same permission. Apps signed with the same certificate are permitted to redefine permissions. We also finally have a (hidden) interface class for observing package installation so that we can now rev the interface without breaking existing callers. Bug 13551375 Change-Id: Ifa4e59154dcccbb286ee46a35a6f25e4ad0f0f01
2014-03-19Fix broken tests to fix buildJohn Spurlock
Change-Id: I6bb9d178a9f1b09c1b247ec9cbdd57507295c4bf
2014-02-25Tabs -> spaces in frameworks/base.John Spurlock
Change-Id: I5a84e8e93ac99b5ed0212b37bf66efa5e53864be
2013-11-12Relayout windows that handle their own config change.Craig Mautner
If a window claims to handle its own configuration change then we won't destroy and recreate its window on a configuration change. Normally that recreation triggers the first layout following orientation change because mHaveFrame is false. Windows that handle their own configuration changes never got a relayout pass following a change in orientation. This change passes the configuration changes that an application handles into the AppWindowToken. If the app says it handles orientation or screen size changes then a relayout will occur when the configuration has changed. Fixes bug 11647107. Change-Id: Ie8d49fd050442ebbdcf0b805087894e3a2fc4be9
2013-07-19Fix FrameworkPermissionTests buildColin Cross
Change-Id: I516e333ca85c0e3c08c8fffc157a9e0360af02e5
2013-05-31Fix build; update framework tests for WindowManager API changeAdam Powell
Change-Id: I801c455184f2a6771f50e29dc147402db48f9fb7
2013-03-18Fix test that uses new APICraig Mautner
Change-Id: Ib463dbece44ef1ec9842e3766c2c133b46ca63a5