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

Commit cf7dd096 authored by Rubin Xu's avatar Rubin Xu
Browse files

Get HAL services with retry

Fixes IWeaver, IAuthSecret and IOemUnlock.

Bug: 152430250
Bug: 151196299
Test: atest com.android.cts.devicepolicy.MixedDeviceOwnerTest#testResetPasswordWithToken
Test: atest com.google.android.oemlock.gts.OemLockServiceTest
Change-Id: If4daaf0204bce23b8cc83ea15bc4f7eeec316943
parent 0ccefbe9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -824,7 +824,7 @@ public class LockSettingsService extends ILockSettings.Stub {

    private void getAuthSecretHal() {
        try {
            mAuthSecretService = IAuthSecret.getService();
            mAuthSecretService = IAuthSecret.getService(/* retry */ true);
        } catch (NoSuchElementException e) {
            Slog.i(TAG, "Device doesn't implement AuthSecret HAL");
        } catch (RemoteException e) {
+1 −1
Original line number Diff line number Diff line
@@ -383,7 +383,7 @@ public class SyntheticPasswordManager {
    @VisibleForTesting
    protected IWeaver getWeaverService() throws RemoteException {
        try {
            return IWeaver.getService();
            return IWeaver.getService(/* retry */ true);
        } catch (NoSuchElementException e) {
            Slog.i(TAG, "Device does not support weaver");
            return null;
+1 −1
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@ class VendorLock extends OemLock {

    static IOemLock getOemLockHalService() {
        try {
            return IOemLock.getService();
            return IOemLock.getService(/* retry */ true);
        } catch (NoSuchElementException e) {
            Slog.i(TAG, "OemLock HAL not present on device");
            return null;