diff --git a/Android.bp b/Android.bp index e669307833c29..e7815eeffc60a 100644 --- a/Android.bp +++ b/Android.bp @@ -181,6 +181,7 @@ java_defaults { "core/java/android/hardware/input/IInputManager.aidl", "core/java/android/hardware/input/IInputDevicesChangedListener.aidl", "core/java/android/hardware/input/ITabletModeChangedListener.aidl", + "core/java/android/hardware/iris/IIrisService.aidl", "core/java/android/hardware/location/IActivityRecognitionHardware.aidl", "core/java/android/hardware/location/IActivityRecognitionHardwareClient.aidl", "core/java/android/hardware/location/IActivityRecognitionHardwareSink.aidl", diff --git a/core/java/android/app/SystemServiceRegistry.java b/core/java/android/app/SystemServiceRegistry.java index 508ea3b40cceb..f26716987d4a7 100644 --- a/core/java/android/app/SystemServiceRegistry.java +++ b/core/java/android/app/SystemServiceRegistry.java @@ -66,6 +66,8 @@ import android.hardware.fingerprint.IFingerprintService; import android.hardware.hdmi.HdmiControlManager; import android.hardware.hdmi.IHdmiControlService; import android.hardware.input.InputManager; +import android.hardware.iris.IrisManager; +import android.hardware.iris.IIrisService; import android.hardware.location.ContextHubManager; import android.hardware.radio.RadioManager; import android.hardware.usb.IUsbManager; @@ -836,6 +838,18 @@ final class SystemServiceRegistry { } }); + registerService(Context.IRIS_SERVICE, IrisManager.class, + new CachedServiceFetcher() { + @Override + public IrisManager createService(ContextImpl ctx) + throws ServiceNotFoundException { + final IBinder binder = + ServiceManager.getServiceOrThrow(Context.IRIS_SERVICE); + IIrisService service = IIrisService.Stub.asInterface(binder); + return new IrisManager(ctx.getOuterContext(), service); + } + }); + registerService(Context.BIOMETRIC_SERVICE, BiometricManager.class, new CachedServiceFetcher() { @Override diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java index e3788004cf5ad..6a7829b9aa61b 100644 --- a/core/java/android/content/Context.java +++ b/core/java/android/content/Context.java @@ -3704,6 +3704,17 @@ public abstract class Context { */ public static final String FACE_SERVICE = "face"; + /** + * Use with {@link #getSystemService(String)} to retrieve a + * {@link android.hardware.iris.IrisManager} for handling management + * of iris authentication. + * + * @hide + * @see #getSystemService + * @see android.hardware.iris.IrisManager + */ + public static final String IRIS_SERVICE = "iris"; + /** * Use with {@link #getSystemService(String)} to retrieve a * {@link android.hardware.biometrics.BiometricManager} for handling management diff --git a/core/java/android/hardware/iris/IIrisService.aidl b/core/java/android/hardware/iris/IIrisService.aidl new file mode 100644 index 0000000000000..8cf3c13b14650 --- /dev/null +++ b/core/java/android/hardware/iris/IIrisService.aidl @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2018 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package android.hardware.iris; + +/** + * Communication channel from client to the iris service. These methods are all require the + * MANAGE_BIOMETRIC signature permission. + * @hide + */ +interface IIrisService { +} \ No newline at end of file diff --git a/core/java/android/hardware/iris/IrisManager.java b/core/java/android/hardware/iris/IrisManager.java new file mode 100644 index 0000000000000..281ac4769a8de --- /dev/null +++ b/core/java/android/hardware/iris/IrisManager.java @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2018 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License + */ + +package android.hardware.iris; + +import android.annotation.SystemService; +import android.content.Context; + +/** + * A class that coordinates access to the iris authentication hardware. + * @hide + */ +@SystemService(Context.IRIS_SERVICE) +public class IrisManager { + + /** + * @hide + */ + public IrisManager(Context context, IIrisService service) { + } +} diff --git a/packages/SystemUI/README.md b/packages/SystemUI/README.md index 33c5551605c07..a8ce196cc359c 100644 --- a/packages/SystemUI/README.md +++ b/packages/SystemUI/README.md @@ -164,7 +164,7 @@ Draws decorations about the screen in software (e.g. rounded corners, cutouts). ### [com.android.systemui.biometrics.BiometricDialogImpl](/packages/SystemUI/src/com/android/systemui/biometrics/BiometricDialogImpl.java) -Fingerprint UI. +Biometric UI. --- diff --git a/services/core/java/com/android/server/biometrics/face/FaceService.java b/services/core/java/com/android/server/biometrics/face/FaceService.java index 5d4263b139034..bc3cc3bd383c4 100644 --- a/services/core/java/com/android/server/biometrics/face/FaceService.java +++ b/services/core/java/com/android/server/biometrics/face/FaceService.java @@ -70,7 +70,7 @@ import java.util.List; /** * A service to manage multiple clients that want to access the face HAL API. * The service is responsible for maintaining a list of clients and dispatching all - * face -related events. + * face-related events. * * @hide */ diff --git a/services/core/java/com/android/server/biometrics/iris/IrisService.java b/services/core/java/com/android/server/biometrics/iris/IrisService.java new file mode 100644 index 0000000000000..37cdc2a4f07af --- /dev/null +++ b/services/core/java/com/android/server/biometrics/iris/IrisService.java @@ -0,0 +1,131 @@ +/* + * Copyright (C) 2018 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License + */ + +package com.android.server.biometrics.iris; + +import android.content.Context; + +import com.android.server.biometrics.BiometricServiceBase; +import com.android.server.biometrics.BiometricUtils; +import com.android.server.biometrics.Metrics; + +/** + * A service to manage multiple clients that want to access the Iris HAL API. + * The service is responsible for maintaining a list of clients and dispatching all + * iris-related events. + * + * TODO: The vendor is expected to fill in the service. See + * {@link com.android.server.biometrics.fingerprint.FingerprintService} + * + * @hide + */ +public class IrisService extends BiometricServiceBase { + + private static final String TAG = "IrisService"; + + /** + * Initializes the system service. + *

+ * Subclasses must define a single argument constructor that accepts the context + * and passes it to super. + *

+ * + * @param context The system server context. + */ + public IrisService(Context context) { + super(context); + } + + @Override + public void onStart() { + super.onStart(); + } + + @Override + protected String getTag() { + return TAG; + } + + @Override + protected BiometricUtils getBiometricUtils() { + return null; + } + + @Override + protected int getFailedAttemptsLockoutTimed() { + return 0; + } + + @Override + protected int getFailedAttemptsLockoutPermanent() { + return 0; + } + + @Override + protected Metrics getMetrics() { + return null; + } + + @Override + protected boolean hasReachedEnrollmentLimit(int userId) { + return false; + } + + @Override + protected void updateActiveGroup(int userId, String clientPackage) { + + } + + @Override + protected String getLockoutResetIntent() { + return null; + } + + @Override + protected String getLockoutBroadcastPermission() { + return null; + } + + @Override + protected long getHalDeviceId() { + return 0; + } + + @Override + protected void handleUserSwitching(int userId) { + + } + + @Override + protected boolean hasEnrolledBiometrics(int userId) { + return false; + } + + @Override + protected String getManageBiometricPermission() { + return null; + } + + @Override + protected void checkUseBiometricPermission() { + + } + + @Override + protected boolean checkAppOps(int uid, String opPackageName) { + return false; + } +} diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java index 49f410d982893..f432c8d8046ea 100644 --- a/services/java/com/android/server/SystemServer.java +++ b/services/java/com/android/server/SystemServer.java @@ -68,6 +68,7 @@ import com.android.server.wm.ActivityTaskManagerService; import com.android.server.appbinding.AppBindingService; import com.android.server.audio.AudioService; import com.android.server.biometrics.BiometricService; +import com.android.server.biometrics.iris.IrisService; import com.android.server.broadcastradio.BroadcastRadioService; import com.android.server.camera.CameraServiceProxy; import com.android.server.clipboard.ClipboardService; @@ -1589,6 +1590,8 @@ public final class SystemServer { final boolean hasFeatureFace = mPackageManager.hasSystemFeature(PackageManager.FEATURE_FACE); + final boolean hasFeatureIris + = mPackageManager.hasSystemFeature(PackageManager.FEATURE_IRIS); final boolean hasFeatureFingerprint = mPackageManager.hasSystemFeature(PackageManager.FEATURE_FINGERPRINT); @@ -1598,13 +1601,19 @@ public final class SystemServer { traceEnd(); } + if (hasFeatureIris) { + traceBeginAndSlog("StartIrisSensor"); + mSystemServiceManager.startService(IrisService.class); + traceEnd(); + } + if (hasFeatureFingerprint) { traceBeginAndSlog("StartFingerprintSensor"); mSystemServiceManager.startService(FingerprintService.class); traceEnd(); } - if (hasFeatureFace || hasFeatureFingerprint) { + if (hasFeatureFace || hasFeatureIris || hasFeatureFingerprint) { // Start this service after all biometric services. traceBeginAndSlog("StartBiometricPromptService"); mSystemServiceManager.startService(BiometricService.class);