A user can be created with an explicitly null name, as happens in tests.
But getUserName claims to never return null. So we must do a null-check
here to prevent it.
Bug: 227624966
Test: atest UserManagerTest
Change-Id: Iea0e7b6292c6dd49df1bebc5467091a82ddaedb5
For multiple log access requests from the same client
(same UID + package name) within a short timeframe, show only one
confirmation prompt to the user.
When access has been approved/denied, further requests will
automatically be approved/denied until another timeout expires, after
which a new request will show a prompt again.
If the prompt is shown but the request isn't approved or denied within a
certain time, the client will automatically be denied access.
Moved the approve/decline methods out of ILogcatManagerService into a
local service, so that they can only be called from within the system
server.
Bug: 229976778
Test: atest FrameworksServicesTests:LogcatManagerServiceTest
Change-Id: I6a3f56bdcbb84e64b1b24e73476bd24f32b75f24
Currently, sandbox cannot call any apis from StorageManager that checks
calling package has same uid as calling uid. This CL fixes that by using
pm.isSameApp() api.
Additionally, since Environment.java fetches the initial application
context, the uid for that does not fall under the sandbox uid range. It
falls under app uid range. We fix the problem by checking for
PROPERTY_NO_APP_DATA_STORAGE flag on the application.
Bug: 228424287
Test: atest CtsSdkSandboxInprocessTests (see ag/17657742)
Change-Id: I8d9fca369cfbed47b40a42a44a40ff73acb712ec
Change the sense of the run-time switches so that ANGLE can be an
optional GLES driver or the default system GLES driver. When ANGLE is
the system GLES driver, also handle the case of there being no legacy
GLES driver.
Test: logcat
Test: atest CtsAngleIntegrationHostTestCases
Test: atest CtsEffectTestCases:android.effect.cts.EffectTest#test5_effectCreate
Bug: 224558229
Change-Id: Ie53f5221d51b62db226c0c634537959612a06655
Revert submission 17653617-DisableANGLE1
Reason for revert: b/230126358: candidate for test breakage on cf_x86_64_phone-userdebug
Reverted Changes:
I2446b18e9:Change Android platform for when ANGLE is default
I83e59002b:Change Android platform for when ANGLE is default
Change-Id: I068de84c6ae38c4f45a2d5a0ceac9bcaeb160ad7
This reverts commit 3a947939dc.
Reason for revert: Allow for revert of "Change Android platform for when ANGLE is default". See: b/230126358: candidate for test breakage on cf_x86_64_phone-userdebug
Reverted Changes:
I2446b18e9:Change Android platform for when ANGLE is default
I83e59002b:Change Android platform for when ANGLE is default
Change-Id: Ib835ee46829a8e9106b183ca32816ca62e306b1c
The new per-application logic resolves "default" to either ANGLE or
legacy, which prevented the game dashboard logic from being
considered. This fixes that.
Test: CtsAngleDeveloperOptionHostTest
Bug: 224558229
Change-Id: I645ab98eb44f33f2f5c4261cb83930d9f8a7ef1d
By default, that mode is set by the OEM and is immutable, but
this change allows developers to change it on non-user builds by
calling `cmd user set-system-user-mode-emulation`.
Notice that changing the headless system user mode is not trivial;
besides the API implementation itself, it's also necessary to:
1. Check if it's possible (for example, user 0 cannot be locked)
2. Change the system user type in the persistent XML
3. Create a full user (when going full -> headless)
4. Re-install apps for system user (when going headless -> full)
(NOTE: steps 1 and 4 will be done in a follow-up CL -
commit 3a029b05d39018ba26f8b218bab968898362138e)
Bug: 226643927
Test: adb shell cmd user set-system-user-mode-emulation full # on automotive
Test: adb shell cmd user set-system-user-mode-emulation headless # on phone
Test: adb shell dumpsys user | grep -A 1 headless
Change-Id: I5ee7d41b5baf5c8a826a1c0b9e599955eb9ad23c
Allow adb commands to select ANGLE vs the legacy GLES driver
regardless of which driver is the system (default) driver, and to
select between different versions of ANGLE if multiple versions are
installed (e.g. the built-in system driver vs. an updated APK).
Test: logcat
Bug: 224558229
Change-Id: I2446b18e96de5e5ed0b5e2ef4d1f933e2315bfe7
- Add API in IUserManager to allow setting ephemeral user flag
- Implement and export this API in UserManagerService and UserManager
- Set guest as ephermal by default when createGuest in UserManager is called
- Handle guest user switching in UserSwitcherController for the case
of dynamic change of ephemeral state
- Add persistant notification when in guest mode to indicate
- if guest session is new or previously used.
- if guest session will be cleared on exit or not
- Add buttons in persistant notification to reset or exit guest
- Add flags to enable/disable this feature
Bug: 214031645
Screenshots: go/ephemeral-guest-b-214031645-ux
Test: Manual test using sunfish, atest SystemUITests, atest SettingsRoboTests
Relands ag/16545010 after resolving post submit issues
Revert "Revert "Guest mode updates to resolve privacy concerns in guest mode""
This reverts commit dd5c440802.
Change-Id: I46b8ab527bab8fe665114ed0fffbb06a59d49a77
Merged-In: I46b8ab527bab8fe665114ed0fffbb06a59d49a77
Bug: 227653108
This adds a helper class that can reduce much of the boilerplate in
code that uses IpcDataCache (or the internal-only variant,
PropertyInvalidatedCache). See the changes to DevicePolicyManager for
example usage.
Two PropertyInvalidatedCaches APIs are exposed for testing. The
method createPropertyName() is changed so that apis like "Foo" are
converted to "foo", not "_foo".
Unit tests for the new behavior are added to IpcDataCacheTest.
This was manually tested by dumping the cache info from builds with
and without this change. Special attention is paid to the
DevicePolicyManager caches. The same caches were found (as identified
by their key and api) and the caches were enabled/disabled the same.
In the course of testing, multiple instances of DevicePolicyManager
caches were observed. Cache performance is better if the caches are
static; making them static will be addressed in b/228452829.
Test:
* atest FrameworksCoreTests:IpcDataCacheTest
* atest FrameworksCoreTests:PropertyInvalidatedCacheTests
* atest FrameworksServicesTests:DevicePolicyConstantsTest
* atest FrameworksServicesTests:DevicePolicyEventLoggerTest
* atest FrameworksServicesTests:DevicePolicyManagerServiceMigrationTest
* atest FrameworksServicesTests:DevicePolicyManagerTest
* atest FrameworksServicesTests:EnterpriseSpecificIdCalculatorTest
* atest FrameworksServicesTests:OverlayPackagesProviderTest
* atest FrameworksServicesTests:OwnersTest
* atest FrameworksServicesTests:PolicyVersionUpgraderTest
* atest FrameworksServicesTests:SecurityEventTest
* atest FrameworksServicesTests:SystemUpdatePolicyTest
* atest FrameworksServicesTests:TransferOwnershipMetadataManagerTest
* atest MixedDeviceOwnerTest#testIsDeviceOrganizationOwnedWithManagedProfile
* atest MixedDeviceOwnerTest#testSetKeyguardDisabledFeatures
* atest MixedManagedProfileOwnerTest#testIsDeviceOrganizationOwnedWithManagedProfile
* atest MixedManagedProfileOwnerTest#testNetworkLoggingDelegate
* atest MixedManagedProfileOwnerTest#testSetKeyguardDisabledFeatures
* atest OrgOwnedProfileOwnerTest#testIsDeviceOrganizationOwnedWithManagedProfile
* atest OrgOwnedProfileOwnerTest#testNetworkLoggingDelegate
* atest OrgOwnedProfileOwnerTest#testSetKeyguardDisabledFeatures
* atest android.devicepolicy.cts.DevicePolicyManagerTest
* atest android.devicepolicy.cts.NetworkLoggingTest
* atest com.android.cts.devicepolicy.DeviceOwnerTest#testAdminActionBookkeeping
Change-Id: I2f4fe4ed25db5fb3100334b9d2ce748ee928c10d
Now that these methods are no longer called, and none of them are a
public API or have @UnsupportedAppUsage, they can be removed.
inCryptKeeperBounce() actually had one known app user via reflection,
despite the method not having @UnsupportedAppUsage. However, that user
only made the call if Build.VERSION.SDK_INT < VERSION_CODES.P, so it is
not being used anymore.
Bug: 208476087
Change-Id: Idc218e5f355bb61257b07cf5b5b6df5f4c6ece11