Merge "StatementService is not an Android system module" into main
diff --git a/service/src/com/android/car/pm/VendorServiceController.java b/service/src/com/android/car/pm/VendorServiceController.java
index 312ca5a..ccffa0c 100644
--- a/service/src/com/android/car/pm/VendorServiceController.java
+++ b/service/src/com/android/car/pm/VendorServiceController.java
@@ -567,10 +567,20 @@
                 }
                 return canBind;
             } else if (mVendorServiceInfo.shouldBeStartedInForeground()) {
-                mStarted = mUserContext.startForegroundService(intent) != null;
+                try {
+                    mStarted = mUserContext.startForegroundService(intent) != null;
+                } catch (SecurityException e) {
+                    Slogf.e(TAG, "ERROR: Failed to start fg service : " + e);
+                    mStarted = false;
+                }
                 return mStarted;
             } else {
-                mStarted = mUserContext.startService(intent) != null;
+                try {
+                    mStarted = mUserContext.startService(intent) != null;
+                } catch (SecurityException e) {
+                    Slogf.e(TAG, "ERROR: Failed to start service : " + e);
+                    mStarted = false;
+                }
                 return mStarted;
             }
         }