FBE中的Home界面FallbackHome

编程入门 行业动态 更新时间:2024-10-09 01:14:06

FBE中的Home<a href=https://www.elefans.com/category/jswz/34/1769995.html style=界面FallbackHome"/>

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。

<applicationandroid: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。

更多推荐

FBE中的Home界面FallbackHome

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

发布评论

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

>www.elefans.com

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