diff options
| -rw-r--r-- | core/api/system-current.txt | 1 | ||||
| -rw-r--r-- | core/java/android/app/SystemServiceRegistry.java | 2 | ||||
| -rw-r--r-- | core/java/android/content/Context.java | 15 |
3 files changed, 18 insertions, 0 deletions
diff --git a/core/api/system-current.txt b/core/api/system-current.txt index fe66952ab3f9..ec2689960a0f 100644 --- a/core/api/system-current.txt +++ b/core/api/system-current.txt @@ -3146,6 +3146,7 @@ package android.content { field public static final String TRANSLATION_MANAGER_SERVICE = "translation"; field public static final String UI_TRANSLATION_SERVICE = "ui_translation"; field public static final String UWB_SERVICE = "uwb"; + field public static final String VIRTUALIZATION_SERVICE = "virtualization"; field public static final String VR_SERVICE = "vrmanager"; field public static final String WALLPAPER_EFFECTS_GENERATION_SERVICE = "wallpaper_effects_generation"; field public static final String WEARABLE_SENSING_SERVICE = "wearable_sensing"; diff --git a/core/java/android/app/SystemServiceRegistry.java b/core/java/android/app/SystemServiceRegistry.java index 68579840d339..e54a0841dd26 100644 --- a/core/java/android/app/SystemServiceRegistry.java +++ b/core/java/android/app/SystemServiceRegistry.java @@ -210,6 +210,7 @@ import android.service.oemlock.OemLockManager; import android.service.persistentdata.IPersistentDataBlockService; import android.service.persistentdata.PersistentDataBlockManager; import android.service.vr.IVrManager; +import android.system.virtualmachine.VirtualizationFrameworkInitializer; import android.telecom.TelecomManager; import android.telephony.MmsManager; import android.telephony.TelephonyFrameworkInitializer; @@ -1566,6 +1567,7 @@ public final class SystemServiceRegistry { NearbyFrameworkInitializer.registerServiceWrappers(); OnDevicePersonalizationFrameworkInitializer.registerServiceWrappers(); DeviceLockFrameworkInitializer.registerServiceWrappers(); + VirtualizationFrameworkInitializer.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... diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java index 0b20078bdb5f..fcdf4403902d 100644 --- a/core/java/android/content/Context.java +++ b/core/java/android/content/Context.java @@ -3939,6 +3939,7 @@ public abstract class Context { DISPLAY_HASH_SERVICE, CREDENTIAL_SERVICE, DEVICE_LOCK_SERVICE, + VIRTUALIZATION_SERVICE, }) @Retention(RetentionPolicy.SOURCE) public @interface ServiceName {} @@ -6114,6 +6115,20 @@ public abstract class Context { public static final String DEVICE_LOCK_SERVICE = "device_lock"; /** + * Use with {@link #getSystemService(String)} to retrieve a + * {@link android.system.virtualmachine.VirtualMachineManager}. + * + * <p>On devices without {@link PackageManager#FEATURE_VIRTUALIZATION_FRAMEWORK} system feature + * the {@link #getSystemService(String)} will return {@code null}. + * + * @see #getSystemService(String) + * @see android.system.virtualmachine.VirtualMachineManager + * @hide + */ + @SystemApi + public static final String VIRTUALIZATION_SERVICE = "virtualization"; + + /** * Determine whether the given permission is allowed for a particular * process and user ID running in the system. * |