FBE 解锁

见 https://mp.csdn.net/postedit/87458471

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

 

 

 

 

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值