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
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
Reference to createFixedArray shoudl be escaped. Otherwise resulting
html renders as <s>(strikethrough) tag.
Bug: 227007069
Test: m online-sdk-docs
and see if ./reference/android/os/Parcel.html works ok
Change-Id: I7a3b447cbeddd8d66ca1733dc8d115c61ece2509
It's value is equal to the TRACE_TAG_PACKAGE_MANAGER, and it is only
used in the single place in ApexManager.java, while the rest of
ApexManager.java is using a correct TRACE_TAG_PACKAGE_MANAGER tag.
Bug: 191178460
Test: m
Test: presubmit
Change-Id: Icb2d5d0db0a33c73e6d7d28f352e66b3d5782eab
Add hidden flag to VibrationAttributes that enforces the service to
refresh the cached user settings values before vibrating with the given
effect. This allows user settings to apply this to vibratins played as
preview of new intensities set by the slider.
This solution still requires the Settings to update the user intensity
before playing the preview, but it doesn't bypass any user settings or
policies in order to play the preview, avoiding a shortcut that could be
used to enforce vibrations without user control.
This setting is also applied to external vibrations, which could be used
to preview haptics instead if a prebaked effect. It also applies to
ringer mode, that is now cached by the service instead of queried on
each vibrate call.
Fix: 219693646
Fix: 219695212
Fix: 157533521
Test: VibrationSettingsTest & VibratorManagerServiceTest
Change-Id: I605ccd2a4a3b89f1ba5bc86d8f3f64dd6d2714eb
IVold.ENCRYPTION_STATE_* and IVold.PASSWORD_TYPE_* are values returned
by or accepted by FDE-specific vold methods, which are no longer used.
Stop using these constants so that we can remove them from IVold.aidl.
Notes on specific constants:
- Some constants have @UnsupportedAppUsage. There is no reason why a
non-system app should have been using these. However, to avoid
possibly breaking apps I just left these with hardcoded values.
- StorageManager.CRYPT_TYPE_* are used by
LockscreenCredential.getStorageCryptType(). However, the caller of
this method was removed by an earlier CL, so just remove this method.
- StorageManager.CRYPT_TYPE_* also have a user in
packages/apps/Settings, but it is obsolete code that I'm removing in
another CL.
Bug: 208476087
Change-Id: I41c684b69a97dbafac65d8f55db2c284d7a8dd70
* changes:
RESTRICT AUTOMERGE Refactor device policy resource APIs to a separate class
RESTRICT AUTOMERGE move device policy resource APIs to a separate class
RESTRICT AUTOMERGE hide device policy resources constants