FBE 解锁

编程入门 行业动态 更新时间:2024-10-08 20:34:30

FBE <a href=https://www.elefans.com/category/jswz/34/1771119.html style=解锁"/>

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 解锁

本文发布于:2024-03-12 14:18:52,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1731697.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:解锁   FBE

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!