Fix Usb Restrictor if USB HAL 1.3+ is not present

Change-Id: Ic80f07161b24676e1697d29fea00219267a6fe81
This commit is contained in:
dianlujitao
2022-03-18 19:26:39 +08:00
committed by Łukasz Patron
parent 6528cae926
commit ae4d409d98

View File

@@ -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