Add placeholders for IrisManager/Service

With the system services in place, we can add SELinux policies

Bug: 116530289

Test: Builds
Change-Id: I0fd0dfbbbf258eb4a0ef9019247baaf323578959
This commit is contained in:
Kevin Chyn
2018-11-05 18:00:43 -08:00
parent 353eab924f
commit 51676d293a
9 changed files with 227 additions and 3 deletions

View File

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

View File

@@ -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<IrisManager>() {
@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<BiometricManager>() {
@Override

View File

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

View File

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

View File

@@ -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) {
}
}

View File

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

View File

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

View File

@@ -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.
* <p>
* Subclasses must define a single argument constructor that accepts the context
* and passes it to super.
* </p>
*
* @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;
}
}

View File

@@ -68,6 +68,7 @@ import com.android.server.am.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);