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

Commit e436b298 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Annotate KeyStore service as never null"

parents 06652ca6 5ead731c
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -32,6 +32,7 @@ import android.system.keystore2.ResponseCode;
import android.util.Log;
import android.util.Log;


import java.util.Calendar;
import java.util.Calendar;
import java.util.Objects;


/**
/**
 * @hide This should not be made public in its present form because it
 * @hide This should not be made public in its present form because it
@@ -137,13 +138,13 @@ public class KeyStore2 {
        return new KeyStore2();
        return new KeyStore2();
    }
    }


    private synchronized IKeystoreService getService(boolean retryLookup) {
    @NonNull private synchronized IKeystoreService getService(boolean retryLookup) {
        if (mBinder == null || retryLookup) {
        if (mBinder == null || retryLookup) {
            mBinder = IKeystoreService.Stub.asInterface(ServiceManager
            mBinder = IKeystoreService.Stub.asInterface(ServiceManager
                    .getService(KEYSTORE2_SERVICE_NAME));
                    .getService(KEYSTORE2_SERVICE_NAME));
            Binder.allowBlocking(mBinder.asBinder());
            Binder.allowBlocking(mBinder.asBinder());
        }
        }
        return mBinder;
        return Objects.requireNonNull(mBinder);
    }
    }


    void delete(KeyDescriptor descriptor) throws KeyStoreException {
    void delete(KeyDescriptor descriptor) throws KeyStoreException {