diff options
| author | 2024-11-22 17:36:59 +0000 | |
|---|---|---|
| committer | 2024-11-22 17:53:03 +0000 | |
| commit | 84e0ec2e469dc7a3a13c60061719ea2da2f7ca99 (patch) | |
| tree | b5a6a11a60b265af1c5c1c3f678a10e980827ff2 | |
| parent | d5eaee401fcccbd7c92beaae0b4654ca6cd962b3 (diff) | |
Adding null check and optionalBackgroundInstallControl flag check. Dependency service (Background Install Control) is disabled for wear devices as mentioned in: b/340928990
Change-Id: I9c263fd6e67bb3ad56b7099cd44b1f4408878e05
Flag: android.app.background_install_control_callback_api
Bug: 369382811
Test: atest
| -rw-r--r-- | services/core/java/com/android/server/BinaryTransparencyService.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/BinaryTransparencyService.java b/services/core/java/com/android/server/BinaryTransparencyService.java index aabbd3bf49ae..0286f7b0b73d 100644 --- a/services/core/java/com/android/server/BinaryTransparencyService.java +++ b/services/core/java/com/android/server/BinaryTransparencyService.java @@ -1580,10 +1580,20 @@ public class BinaryTransparencyService extends SystemService { } private void registerBicCallback() { + if(!com.android.server.flags.Flags.optionalBackgroundInstallControl()) { + Slog.d(TAG, "BICS is disabled for this device, skipping registration."); + return; + } IBackgroundInstallControlService iBics = IBackgroundInstallControlService.Stub.asInterface( ServiceManager.getService( Context.BACKGROUND_INSTALL_CONTROL_SERVICE)); + if(iBics == null) { + Slog.e(TAG, "Failed to register BackgroundInstallControl callback, either " + + "background install control service does not exist or disabled on this " + + "build."); + return; + } try { iBics.registerBackgroundInstallCallback( new BicCallbackHandler(mServiceImpl)); |