FBE中的Home界面FallbackHome

FallbackHome

FallbackHome继承Activity,是安卓系统启动后未解锁时的home界面。

在这里插入图片描述

Settings程序AndroidManifest.xml中定义了FallbackHome的intent-filter,可以看到Action:“android.intent.category.HOME”。

        <!-- Triggered when user-selected home app isn't encryption aware -->
        <activity android:name=".FallbackHome"
                  android:excludeFromRecents="true"
                  android:label=""
                  android:screenOrientation="nosensor"
                  android:taskAffinity="com.android.settings.FallbackHome"
                  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>

FBE (File-Based Encryption)

安卓7.0后开始支持FBE,安卓10后FBE必须被支持。

FEB定义了两个存储位置供应用程序使用:

  • Credential Encrypted (CE) storage, which is the default storage location and only available after the user has unlocked the device.
  • Device Encrypted (DE) storage, which is a storage location available both during Direct Boot mode and after the user has unlocked the device.

Direct Boot

因为许多应用程序需要在为解锁的状态下使用,比如闹钟,电话,SystemUI,Settings等,这些程序就需要Direct Boot特性,在AndroidManifest.xml的application标签中添加如下属性以支持Direct Boot。

<application
    android:directBootAware="true"
    android:defaultToDeviceProtectedStorage="true">

defaultToDeviceProtectedStorage仅对system app可用,使其数据存储到Device Encrypted (DE) storage,而不是Credential Encrypted (CE) storage。

directBootAware对所有app都可用,使其所有组件都标记为加密感知。

The directBootAware attribute at the application level is shorthand for marking all components in the app as being encryption aware.

The defaultToDeviceProtectedStorage attribute redirects the default app storage location to point at DE storage instead of pointing at CE storage.

系统中存在2个接收"android.intent.category.HOME"的Activity,启动时处于加密状态,只能启动支持Direct Boot的FallbackHome,而不是熟悉的Launcher界面,FallbackHome判断用户是否解锁:

if (getSystemService(UserManager.class).isUserUnlocked()) {
	...
    getSystemService(PowerManager.class).userActivity(
                        SystemClock.uptimeMillis(), false);
    finish();
}

如果解锁,通过PowerManagerService.userActivity()重置timeout时间,关闭当前FallbackHome。

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值