本文以Content Shell为例,简要分析了Manifest文件的关键元素声明,后续篇章将逐步分析Content Shell的启动过程和内部结构等。
Android Manifest描述了应用程序的基本信息,包括权限,应用程序,Activity,内容提供者,Intent过滤器以及允许的后台service进程名和数量等等诸多信息。Chromium为每个平台都提供了一个外壳程序,Android平台也不例外,它只提供了一个简单的地址输入栏和导航栏,具备最基本的网页渲染功能,主要是为了展示如何通过Content API定制Chromium内核。
以下是用于创建ContentShell应用程序的Manifest文件 (src/content/shell/android/shell_apk/AndroidManifest.xml):
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2012 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.chromium.content_shell_apk">
<permission android:name="org.chromium.content_shell.permission.SANDBOX"
android:protectionLevel="signature" />
<application android:name="ContentShellApplication"
android:icon="@mipmap/app_icon"
android:label="Content Shell">
<activity android:name="ContentShellActivity"
android:launchMode="singleTask"
android:theme="@android:style/Theme.Holo.Light.NoActionBar"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize"
android:hardwareAccelerated="true">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<!-- The following service entries exist in order to allow us to
start mo