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
- 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
Before, it was like getting a used pan with food stuck on it. We run
a clean ship here. You want a Parcel? You get a fresh Parcel. When
we recycle a Parcel, we do a real clean-up job. Air freshener. All
bits brushed over. These Parcel objects are clean as heck now!
(specifically cleans mClassCookies)
Bug: 208279300
Test: build
Merged-In: I250872f5c6796bb64e2dc68008154c0e90feb218
Change-Id: I250872f5c6796bb64e2dc68008154c0e90feb218
Log a specialized error message if installation task
failed due to insufficient storage space.
This helps the user to disgnose the source of error.
Bug: 200002443
Test: start DSU task and check logcat
Change-Id: Iabb3e0325ae99c343978ca6c35ab8378f20e0527
Before, it was like getting a used pan with food stuck on it. We run
a clean ship here. You want a Parcel? You get a fresh Parcel. When
we recycle a Parcel, we do a real clean-up job. Air freshener. All
bits brushed over. These Parcel objects are clean as heck now!
(specifically cleans mClassCookies)
Bug: 208279300
Test: build
Change-Id: I250872f5c6796bb64e2dc68008154c0e90feb218
The dream may end for various reasons, including some that do not
represent user activity, such as app crashes or the app being updated.
In these cases, the user activity should not be poked, as this would
reset the inattentive sleep timer.
Bug: 215559033
Test: atest PowerManagerServiceTest
Test: Kill dream app, observe `dumpsys power` lastUserActivityTime
Test: Kill dream app, verify inattentive sleep timer not affected
Change-Id: If9b61cab3d5e21b89f3c0ab7fe541d46bc865f97
Merged-In: If9b61cab3d5e21b89f3c0ab7fe541d46bc865f97