Unregister transport when user disables corresponding package.
Register transport when user puts package in default enable state. This change is an extension of ag/17072365. TransportManager#onPackageChanged is not correctly handling these 2 cases - 1. When a package is disabled by user. Meaning, the state 'COMPONENT_ENABLED_STATE_DISABLED_USER' was being ignored. 2. When a package is default-enabled. Meaning, the state 'COMPONENT_ENABLED_STATE_DEFAULT' was being ignored. If the package in question contains backup transports, they should be registered or unregistered depending on the state. For state 'COMPONENT_ENABLED_STATE_DEFAULT', I'm considering it as if package is enabled. The only situation where package is in disabled state in default state is when it is explicitly specified in Manifest at an application level. Bug: 162725876, 237049952 Fixes: 162725876, 237049952 Test: 1. atest -v BackupFrameworksServicesRoboTests:TransportManagerTest 2. Manual test on device (Oriole) - List transports - Disable package via Settings -> Apps - List transports and verify disabled transports are not present. - Enable package via Settings -> Apps - List transports and verify default-enabled transports are present. - Verify logs via logcat to ensure correct switch codepaths was taken in TransportManager Change-Id: I1d5e9f8bf5625257bd01a910d29b4dbcb68f3ab4
Loading
Please register or sign in to comment