From ae4d409d98d6962886dc41c2fbb7f6771f3b6074 Mon Sep 17 00:00:00 2001 From: dianlujitao Date: Fri, 18 Mar 2022 19:26:39 +0800 Subject: [PATCH] Fix Usb Restrictor if USB HAL 1.3+ is not present Change-Id: Ic80f07161b24676e1697d29fea00219267a6fe81 --- .../lineageos/platform/internal/TrustInterfaceService.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lineage/lib/main/java/org/lineageos/platform/internal/TrustInterfaceService.java b/lineage/lib/main/java/org/lineageos/platform/internal/TrustInterfaceService.java index 961a49c5..5a7475b9 100644 --- a/lineage/lib/main/java/org/lineageos/platform/internal/TrustInterfaceService.java +++ b/lineage/lib/main/java/org/lineageos/platform/internal/TrustInterfaceService.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 The LineageOS Project + * Copyright (C) 2018-2022 The LineageOS Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -95,6 +95,11 @@ public class TrustInterfaceService extends LineageSystemService { try { mUsb = IUsb.getService(); + } catch (NoSuchElementException | RemoteException e) { + // ignore, the hal is not available + } + + try { mUsbRestrictor = IUsbRestrict.getService(); } catch (NoSuchElementException | RemoteException e) { // ignore, the hal is not available