解锁"/>
FBE 解锁
见
1、frameworks\base\services\core\java\com\android\server\am\UserController.java
STATE_RUNNING_UNLOCKING->STATE_RUNNING_UNLOCKED
finishUserUnlocked() 发送 ACTION_USER_UNLOCKED 广播
ActivityManager: User 0 state changed from RUNNING_LOCKED to RUNNING_UNLOCKING
状态为 STATE_RUNNING_UNLOCKED 说明解锁完成。
finishUserUnlocked()-->
finishUserUnlockedCompleted(uss){
ActivityManager: Sending BOOT_COMPLETE user #0 打印信息
ACTION_BOOT_COMPLETED 发送广播
}
2、FallbackHome
<activity android:name=".FallbackHome"
android:excludeFromRecents="true"
android:label=""
android:screenOrientation="nosensor"
android:theme="@style/FallbackHome">
<intent-filter android:priority="-1000">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
FallbackHome 启动后,会注册监听 ACTION_USER_UNLOCKED
收到解锁完成广播,会finish FallbackHome
private void maybeFinish() {
if (getSystemService(UserManager.class).isUserUnlocked()) {
final Intent homeIntent = new Intent(Intent.ACTION_MAIN)
.addCategory(Intent.CATEGORY_HOME);
final ResolveInfo homeInfo = getPackageManager().resolveActivity(homeIntent, 0);
if (Objects.equals(getPackageName(), homeInfo.activityInfo.packageName)) {
if (UserManager.isSplitSystemUser()
&& UserHandle.myUserId() == UserHandle.USER_SYSTEM) {
// This avoids the situation where the system user has no home activity after
// SUW and this activity continues to throw out warnings. See b/28870689.
return;
}
Log.d(TAG, "User unlocked but no home; let's hope someone enables one soon?");
mHandler.sendEmptyMessageDelayed(0, 500);
} else {
Log.d(TAG, "User unlocked and real home found; let's go!");
getSystemService(PowerManager.class).userActivity(
SystemClock.uptimeMillis(), false);
finish();
}
}
}
3、
06-17 13:43:27.177 1045 1045 I KeyguardAbsKeyInputView: mOkButton onClick
06-17 13:43:28.284 757 772 I ActivityManager: Sending BOOT_COMPLETE user #0
06-17 13:43:28.345 757 1341 I ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10000100 cmp=com.android.launcher3/.Launcher} from uid 0, pid 0
更多推荐
FBE 解锁
发布评论