基于Dragonboard 410c的指纹锁(七)
2017-12-21 14:40
337 查看
继续研究fingerprint在Android中的添加。上篇中HAL层的实现算是找到了,但是不知道是不是真的是这个,也不知道有没有被应用,既然驱动没有,那就往上看吧。
开机时会开启各种服务,我们从开始启动指纹识别的service开始。
路径:
framework/base/services/java/com/android/server/SystemServer.java
private void run() {
........
startOtherServices();
..........
}
private void startOtherServices() {
..............
//这部分代码在Android M上是没有的,但是Android N上有,所以就加在这了。
if (mPackageManager.hasSystemFeature(PackageManager.FEATURE_FINGERPRINT)) {
mSystemServiceManager.startService(FingerprintService.class);
}
............
}
这里调用SystemServiceManager的startService来启动指纹识别服务。
路径:
frameworks/base/services/core/java/com/android/server/SystemServiceManager.java
public <T extends SystemService> T startService(Class<T> serviceClass) {
..............
try {
service.onStart();
} catch (RuntimeException ex) {
throw new RuntimeException("Failed to start service " + name
+ ": onStart threw an exception", ex);
}
return service;
}
在FingerprintService.java中调用了onStart()
路径:
frameworks/base/services/core/java/com/android/server/fingerprint/FingerprintService.java
public void onStart() {
publishBinderService(Context.FINGERPRINT_SERVICE, new FingerprintServiceWrapper());
IFingerprintDaemon daemon = getFingerprintDaemon();
if (DEBUG) Slog.v(TAG, "Fingerprint HAL id: " + mHalDeviceId);
listenForUserSwitches();
}
接下来,先看看publishBinderService的实现,
路径:
frameworks/base/services/core/java/com/android/server/SystemService.java
protected final void publishBinderService(String name, IBinder service) {
publishBinderService(name, service, false);
}
protected final void publishBinderService(String name, IBinder service,
boolean allowIsolated) {
ServiceManager.addService(name, service, allowIsolated);
}
可以看到在ServiceManager.java中调用了addService
路径:
frameworks/base/core/java/android/os/ServiceManager.java
public static void addService(String name, IBinder service, boolean allowIsolated) {
try {
getIServiceManager().addService(name, service, allowIsolated);
} catch (RemoteException e) {
Log.e(TAG, "error in addService", e);
}
}
可以看到到这里真正的将指纹识别的服务加进去了,今天先到这,后面在继续。
开机时会开启各种服务,我们从开始启动指纹识别的service开始。
路径:
framework/base/services/java/com/android/server/SystemServer.java
private void run() {
........
startOtherServices();
..........
}
private void startOtherServices() {
..............
//这部分代码在Android M上是没有的,但是Android N上有,所以就加在这了。
if (mPackageManager.hasSystemFeature(PackageManager.FEATURE_FINGERPRINT)) {
mSystemServiceManager.startService(FingerprintService.class);
}
............
}
这里调用SystemServiceManager的startService来启动指纹识别服务。
路径:
frameworks/base/services/core/java/com/android/server/SystemServiceManager.java
public <T extends SystemService> T startService(Class<T> serviceClass) {
..............
try {
service.onStart();
} catch (RuntimeException ex) {
throw new RuntimeException("Failed to start service " + name
+ ": onStart threw an exception", ex);
}
return service;
}
在FingerprintService.java中调用了onStart()
路径:
frameworks/base/services/core/java/com/android/server/fingerprint/FingerprintService.java
public void onStart() {
publishBinderService(Context.FINGERPRINT_SERVICE, new FingerprintServiceWrapper());
IFingerprintDaemon daemon = getFingerprintDaemon();
if (DEBUG) Slog.v(TAG, "Fingerprint HAL id: " + mHalDeviceId);
listenForUserSwitches();
}
接下来,先看看publishBinderService的实现,
路径:
frameworks/base/services/core/java/com/android/server/SystemService.java
protected final void publishBinderService(String name, IBinder service) {
publishBinderService(name, service, false);
}
protected final void publishBinderService(String name, IBinder service,
boolean allowIsolated) {
ServiceManager.addService(name, service, allowIsolated);
}
可以看到在ServiceManager.java中调用了addService
路径:
frameworks/base/core/java/android/os/ServiceManager.java
public static void addService(String name, IBinder service, boolean allowIsolated) {
try {
getIServiceManager().addService(name, service, allowIsolated);
} catch (RemoteException e) {
Log.e(TAG, "error in addService", e);
}
}
可以看到到这里真正的将指纹识别的服务加进去了,今天先到这,后面在继续。
相关文章推荐
- 基于Dragonboard 410c的指纹锁(二)
- 基于Dragonboard 410c的指纹锁(一)
- 基于DragonBoard 410c的家庭智能环保卫士——(10)数据库python代码实现
- 基于Dragonboard 410c的自动感应调色灯软件方案设计
- 基于Dragonboard 410c的自动感应调色灯软件编码实现
- 基于DragonBoard 410c android系统实现红外遥控功能
- 基于DragonBoard 410c平台的移动图像监测系统
- 湘潭大学-基于Dragonboard 410c教室资源管理与信息查询系统(一)
- 基于dragonboard 410c的智能魔镜设计(4)——视频消息检索及自动播放
- 基于dragonboard 410c的机械手臂(三)
- 基于Dragonboard 410c的智能照明系统(三)
- 基于Dragonboard 410c的总线控制之UART(一)
- 湘潭大学-基于Dragonboard 410c的实时公交站牌系统设计(二)
- 基于DragonBoard 410c的家庭智能环保卫士——(8)室内栅格定位
- 基于dragonboard 410c的智能魔镜设计(5)——基于人脸的用户身份识别
- 基于Dragonboard 410c的家庭智能环保卫士——(3)室内路径规划
- 基于DragonBoard 410c的家庭智能环保卫士——(4)A*路径搜索算法
- 基于DragonBoard 410c之按键添加
- 基于DragonBoard 410c的家庭智能环保卫士——(6)kobuki位置信息传输及显示
- 基于Dragonboard 410c的燃气烟雾检测器(一)