Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e10eee81 authored by George Chan's avatar George Chan Committed by Android (Google) Code Review
Browse files

Merge "Adding null check and optionalBackgroundInstallControl flag check....

Merge "Adding null check and optionalBackgroundInstallControl flag check. Dependency service (Background Install Control) is disabled for wear devices as mentioned in: b/340928990" into main
parents 28ece688 84e0ec2e
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -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));