MediaRouterService maintained bindings to provider services
once those are established.
With this CL, it only binds services when there is a non-empty
discovery preference set by a foreground app or an app is casting.
This change may break output switcher, which enables transfer media
of background apps.
To alleviate that MediaRouter2Manager#startScan and #stopScan are added
so that system UI can force the service bind to the services and find
remote devices to cast.
Bug: 169575701
Bug: 172920557
Test: manually and CTS
Change-Id: I4a47fdb1c9fe05a04d26950485833c9cbfb91a69
(cherry picked from commit 9f889ca4e6)
(cherry picked from commit 602b168f99)
Add a new intent to wake up carrier provisioning apps to handle
the refreshing request on user switching.
Bug: 156751190
Test: manual test, both SIM card changing and 'reset wifi' in multiple
users case.
Change-Id: I6591a4b5636c0464b4177af175d7cfdc5918010d
The package name is useful for permission validation. Currently, package
name is required when starting external vibration so that the vibrator
service can verify if the app has the permission to start vibration.
Bug: 175595599
Test: SoundPool tests in cts
Test: play audio-coupled-haptic file using SoundPool.
Change-Id: Ibfe414063a303118a5bb393d65ea5dc2323bf722
Merged-In: Ibfe414063a303118a5bb393d65ea5dc2323bf722
(cherry picked from commit de9005bab1)
Delegate the resetting of the INTERACT_ACROSS_PROFILES app-op to
DevicePolicyManager, which knows whether it should be pre-granted and
knows to apply it equally across all users in the profile group.
Further unit tests for DevicePolicyManagerInternal will be added in
b/175440570 when we have the better infra for that.
The CrossProfileAppsServiceImpl changes look more complex than they are.
They consist of the following:
- Inclusive language changes to 'allowlist'
- Static imports of permissions to improve readability
- Previously, the setInteractAcrossProfilesAppOp method would set the
app-op for every user within the profile group of the 'calling user'.
However, given that we are now exposing this as a server-side internal
API where we need to pass in a user ID (from AppOpsService), we don't
necessarily have the guarantee that the 'calling user' is in the same
profile group. So we split it up: the client-side API and AIDL API still
set the app-op for the calling profile group, whereas the internal API
sets the app-op for every user within the profile group of the provided
user. The changes simply abstract away references to the 'calling user
ID'.
Fixes: 166561076
Bug: 175440570
Test: atest services/robotests/src/com/android/server/pm/CrossProfileAppsServiceImplRoboTest.java --verbose -c
Test: manual
Change-Id: I2181fe66022aaf6c3e6d784c0569d2f41ab66537
(cherry picked from commit d004f41188)
Slice uses internal permission control, either the provider app can
specify a list of auto-grant permission, or the host app can request
user's consent on presenting slices from the provider app. In both cases
the invokation of checkUriPermission is non-neccessary.
Bug: 140727941
Test: atest SliceManagerServiceTest
Change-Id: Iac808eda08ac188185cd27f7ab8ce13accf7fce4
Merged-In: Iac808eda08ac188185cd27f7ab8ce13accf7fce4
(cherry picked from commit ab9a91fb69)
Malicious apps, especially NotificationListeners can hijack such
intents and grant themselves access to sensitive URIs by relying on
the OS URI granting mechanism. This change mitigates the security
issue and also adheres to the new enforcement requiring Android S+
targeting apps to explicitly specifiy a mutability flag.
Test: Manual
Bug: 153466381
Change-Id: If478386d68cf25c8f93c2685824700679e6b9ea9
(cherry picked from commit df9a44e1fb)
Use mState instead of mEnable to check Bluetooth server status.
mEnable is used to indicate whether the next action is enabling or
disabling the Bluetooth stack, whereas mState indicates the current
state.
Test: atest FrameworksServicesTests
Bug: 173941366
Change-Id: I335f1e33fe84a9dd7e9227dd55d54fcae7c0ec4b
Currently when debug layer apk is not installed, GraphicsEnvironment
logs the message and proceeds, which results in null pointer access
crash when later trying to access primaryAbi. Avoid null access by an
early return statement.
Bug: b/175699044
Test: specify not installed debug layer apk and no crash
Change-Id: I4f3b86b0a8cfff4fc608b3a59ebf0872db0465ff
Merged-In: I4f3b86b0a8cfff4fc608b3a59ebf0872db0465ff
(cherry picked from commit c5c17e66ba)
If recents animation is active, the transition is controlled by it.
There won't be a transition finish event after recents animation.
For example, if an activity finishes during swiping-up gesture,
the recents activity in rotated state won't be restored. So this
change checks whether recents become the top activity, then continue
the orientation update procedure to clear fixed rotation state and
let display orientation follow the current top.
Bug: 173143462
Test: atest RecentsAnimationControllerTest# \
testClearFixedRotationLaunchingAppAfterCleanupAnimation
Change-Id: If82744bb846ac823c8fdd76bbf23b584b63776d4
(cherry picked from commit 498b87a347)
Previously, the phone ID was appended to the broadcast in DCT and sent
to ConnectivityManager. Instead of sending both as an action, send the
phone ID as an extra instead to make the action a protected broadcast.
Test: manually verify a SecurityException when action provision is sent
Test: atest DcTrackerTest
Bug: 172459128
Change-Id: Ic4129def86949d7191d15056852718dadbd72fba
Merged-In: Ic4129def86949d7191d15056852718dadbd72fba