Merge "Add Device Lock service to system server."

This commit is contained in:
Amos Bianchi
2022-10-21 17:47:30 +00:00
committed by Android (Google) Code Review
8 changed files with 37 additions and 0 deletions

View File

@@ -98,6 +98,7 @@ combined_apis {
"framework-configinfrastructure",
"framework-connectivity",
"framework-connectivity-t",
"framework-devicelock",
"framework-federatedcompute",
"framework-graphics",
"framework-healthconnect",

View File

@@ -71,6 +71,10 @@ platform_bootclasspath {
apex: "com.android.conscrypt",
module: "com.android.conscrypt-bootclasspath-fragment",
},
{
apex: "com.android.devicelock",
module: "com.android.devicelock-bootclasspath-fragment",
},
{
apex: "com.android.federatedcompute",
module: "com.android.federatedcompute-bootclasspath-fragment",

View File

@@ -107,6 +107,7 @@ package android {
field public static final String LAUNCH_MULTI_PANE_SETTINGS_DEEP_LINK = "android.permission.LAUNCH_MULTI_PANE_SETTINGS_DEEP_LINK";
field public static final String LOADER_USAGE_STATS = "android.permission.LOADER_USAGE_STATS";
field public static final String LOCATION_HARDWARE = "android.permission.LOCATION_HARDWARE";
field public static final String MANAGE_DEVICE_LOCK_STATE = "android.permission.MANAGE_DEVICE_LOCK_STATE";
field public static final String MANAGE_DOCUMENTS = "android.permission.MANAGE_DOCUMENTS";
field public static final String MANAGE_EXTERNAL_STORAGE = "android.permission.MANAGE_EXTERNAL_STORAGE";
field public static final String MANAGE_MEDIA = "android.permission.MANAGE_MEDIA";
@@ -9845,6 +9846,7 @@ package android.content {
field public static final int CONTEXT_RESTRICTED = 4; // 0x4
field public static final String CREDENTIAL_SERVICE = "credential";
field public static final String CROSS_PROFILE_APPS_SERVICE = "crossprofileapps";
field public static final String DEVICE_LOCK_SERVICE = "device_lock";
field public static final String DEVICE_POLICY_SERVICE = "device_policy";
field public static final String DISPLAY_HASH_SERVICE = "display_hash";
field public static final String DISPLAY_SERVICE = "display";
@@ -11991,6 +11993,7 @@ package android.content.pm {
field public static final String FEATURE_CONTROLS = "android.software.controls";
field public static final String FEATURE_CREDENTIALS = "android.software.credentials";
field public static final String FEATURE_DEVICE_ADMIN = "android.software.device_admin";
field public static final String FEATURE_DEVICE_LOCK = "android.software.device_lock";
field public static final String FEATURE_EMBEDDED = "android.hardware.type.embedded";
field public static final String FEATURE_ETHERNET = "android.hardware.ethernet";
field public static final String FEATURE_EXPANDED_PICTURE_IN_PICTURE = "android.software.expanded_picture_in_picture";

View File

@@ -85,6 +85,7 @@ import android.credentials.CredentialManager;
import android.credentials.ICredentialManager;
import android.debug.AdbManager;
import android.debug.IAdbManager;
import android.devicelock.DeviceLockFrameworkInitializer;
import android.graphics.fonts.FontManager;
import android.hardware.ConsumerIrManager;
import android.hardware.ISerialManager;
@@ -1555,6 +1556,7 @@ public final class SystemServiceRegistry {
ConnectivityFrameworkInitializerTiramisu.registerServiceWrappers();
NearbyFrameworkInitializer.registerServiceWrappers();
OnDevicePersonalizationFrameworkInitializer.registerServiceWrappers();
DeviceLockFrameworkInitializer.registerServiceWrappers();
} finally {
// If any of the above code throws, we're in a pretty bad shape and the process
// will likely crash, but we'll reset it just in case there's an exception handler...

View File

@@ -3938,6 +3938,7 @@ public abstract class Context {
//@hide: SAFETY_CENTER_SERVICE,
DISPLAY_HASH_SERVICE,
CREDENTIAL_SERVICE,
DEVICE_LOCK_SERVICE,
})
@Retention(RetentionPolicy.SOURCE)
public @interface ServiceName {}
@@ -6072,6 +6073,14 @@ public abstract class Context {
*/
public static final String CREDENTIAL_SERVICE = "credential";
/**
* Use with {@link #getSystemService(String)} to retrieve a
* {@link android.devicelock.DeviceLockManager}.
*
* @see #getSystemService(String)
*/
public static final String DEVICE_LOCK_SERVICE = "device_lock";
/**
* Determine whether the given permission is allowed for a particular
* process and user ID running in the system.

View File

@@ -4194,6 +4194,14 @@ public abstract class PackageManager {
@SdkConstant(SdkConstantType.FEATURE)
public static final String FEATURE_CREDENTIALS = "android.software.credentials";
/**
* Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}:
* The device supports locking (for example, by a financing provider in case of a missed
* payment).
*/
@SdkConstant(SdkConstantType.FEATURE)
public static final String FEATURE_DEVICE_LOCK = "android.software.device_lock";
/** @hide */
public static final boolean APP_ENUMERATION_ENABLED_BY_DEFAULT = true;

View File

@@ -6577,6 +6577,13 @@
android:protectionLevel="signature" />
<uses-permission android:name="android.permission.HANDLE_QUERY_PACKAGE_RESTART" />
<!-- Allows financed device kiosk apps to perform actions on the Device Lock service
<p>Protection level: internal|role
<p>Intended for use by the FINANCED_DEVICE_KIOSK role only.
-->
<permission android:name="android.permission.MANAGE_DEVICE_LOCK_STATE"
android:protectionLevel="internal|role" />
<!-- Attribution for Geofencing service. -->
<attribution android:tag="GeofencingService" android:label="@string/geofencing_service"/>
<!-- Attribution for Country Detector. -->

View File

@@ -715,6 +715,9 @@
<!-- Permission required for CTS test - ActivityPermissionRationaleTest -->
<uses-permission android:name="android.permission.ADJUST_RUNTIME_PERMISSIONS_POLICY" />
<!-- Permission required for CTS test - CtsDeviceLockTestCases -->
<uses-permission android:name="android.permission.MANAGE_DEVICE_LOCK_STATE" />
<application android:label="@string/app_label"
android:theme="@android:style/Theme.DeviceDefault.DayNight"
android:defaultToDeviceProtectedStorage="true"