Merge "[AAPM] Return null service for unsupported form factors." into main
diff --git a/core/java/android/app/SystemServiceRegistry.java b/core/java/android/app/SystemServiceRegistry.java
index bd26db5..c6b8f3b 100644
--- a/core/java/android/app/SystemServiceRegistry.java
+++ b/core/java/android/app/SystemServiceRegistry.java
@@ -1750,10 +1750,13 @@
                         @Override
                         public AdvancedProtectionManager createService(ContextImpl ctx)
                                 throws ServiceNotFoundException {
-                            IBinder iBinder = ServiceManager.getServiceOrThrow(
+                            IBinder iBinder = ServiceManager.getService(
                                     Context.ADVANCED_PROTECTION_SERVICE);
                             IAdvancedProtectionService service =
                                     IAdvancedProtectionService.Stub.asInterface(iBinder);
+                            if (service == null) {
+                                return null;
+                            }
                             return new AdvancedProtectionManager(service);
                         }
                     });