Skip to content

Commit 310e9a1

Browse files
committed
更新master分支,基于Android P
1 parent 803ef1d commit 310e9a1

File tree

984 files changed

+121125
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

984 files changed

+121125
-0
lines changed

AndroidManifest-common.xml

+122
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
/*
4+
**
5+
** Copyright 2016, The Android Open Source Project
6+
**
7+
** Licensed under the Apache License, Version 2.0 (the "License");
8+
** you may not use this file except in compliance with the License.
9+
** You may obtain a copy of the License at
10+
**
11+
** http://www.apache.org/licenses/LICENSE-2.0
12+
**
13+
** Unless required by applicable law or agreed to in writing, software
14+
** distributed under the License is distributed on an "AS IS" BASIS,
15+
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
** See the License for the specific language governing permissions and
17+
** limitations under the License.
18+
*/
19+
-->
20+
<manifest
21+
xmlns:android="http://schemas.android.com/apk/res/android"
22+
package="com.android.launcher3">
23+
24+
<!--
25+
The manifest defines the common entries that should be present in any derivative of Launcher3.
26+
The components should generally not require any changes.
27+
28+
Rest of the components are defined in AndroidManifest.xml which is merged with this manifest
29+
at compile time. Note that the components defined in AndroidManifest.xml are also required,
30+
with some minor changed based on the derivative app.
31+
-->
32+
<permission
33+
android:name="com.android.launcher.permission.INSTALL_SHORTCUT"
34+
android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
35+
android:protectionLevel="dangerous"
36+
android:label="@string/permlab_install_shortcut"
37+
android:description="@string/permdesc_install_shortcut" />
38+
39+
<uses-permission android:name="android.permission.CALL_PHONE" />
40+
<uses-permission android:name="android.permission.SET_WALLPAPER" />
41+
<uses-permission android:name="android.permission.SET_WALLPAPER_HINTS" />
42+
<uses-permission android:name="android.permission.BIND_APPWIDGET" />
43+
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
44+
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
45+
<uses-permission android:name="android.permission.REQUEST_DELETE_PACKAGES" />
46+
47+
<application
48+
android:backupAgent="com.android.launcher3.LauncherBackupAgent"
49+
android:fullBackupOnly="true"
50+
android:fullBackupContent="@xml/backupscheme"
51+
android:hardwareAccelerated="true"
52+
android:icon="@drawable/ic_launcher_home"
53+
android:label="@string/derived_app_name"
54+
android:largeHeap="@bool/config_largeHeap"
55+
android:restoreAnyVersion="true"
56+
android:supportsRtl="true" >
57+
58+
<!-- Intent received used to install shortcuts from other applications -->
59+
<receiver
60+
android:name="com.android.launcher3.InstallShortcutReceiver"
61+
android:permission="com.android.launcher.permission.INSTALL_SHORTCUT"
62+
android:enabled="@bool/enable_install_shortcut_api" >
63+
<intent-filter>
64+
<action android:name="com.android.launcher.action.INSTALL_SHORTCUT" />
65+
</intent-filter>
66+
</receiver>
67+
68+
<!-- Intent received when a session is committed -->
69+
<receiver
70+
android:name="com.android.launcher3.SessionCommitReceiver" >
71+
<intent-filter>
72+
<action android:name="android.content.pm.action.SESSION_COMMITTED" />
73+
</intent-filter>
74+
</receiver>
75+
76+
<!-- Intent received used to initialize a restored widget -->
77+
<receiver android:name="com.android.launcher3.AppWidgetsRestoredReceiver" >
78+
<intent-filter>
79+
<action android:name="android.appwidget.action.APPWIDGET_HOST_RESTORED"/>
80+
</intent-filter>
81+
</receiver>
82+
83+
<service
84+
android:name="com.android.launcher3.uioverrides.dynamicui.WallpaperManagerCompatVL$ColorExtractionService"
85+
android:exported="false"
86+
android:process=":wallpaper_chooser"
87+
android:permission="android.permission.BIND_JOB_SERVICE" />
88+
89+
<service
90+
android:name="com.android.launcher3.notification.NotificationListener"
91+
android:label="@string/icon_badging_service_title"
92+
android:enabled="@bool/notification_badging_enabled"
93+
android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE">
94+
<intent-filter>
95+
<action android:name="android.service.notification.NotificationListenerService" />
96+
</intent-filter>
97+
</service>
98+
99+
<meta-data android:name="android.nfc.disable_beam_default"
100+
android:value="true" />
101+
102+
<activity android:name="com.android.launcher3.dragndrop.AddItemActivity"
103+
android:theme="@android:style/Theme.DeviceDefault.Light.Dialog.Alert"
104+
android:excludeFromRecents="true"
105+
android:autoRemoveFromRecents="true"
106+
android:label="@string/action_add_to_workspace" >
107+
<intent-filter>
108+
<action android:name="android.content.pm.action.CONFIRM_PIN_SHORTCUT" />
109+
<action android:name="android.content.pm.action.CONFIRM_PIN_APPWIDGET" />
110+
</intent-filter>
111+
</activity>
112+
113+
<!--
114+
Should point to the content provider which can be used to dump Launcher3 compatible
115+
worspace configuration to the dump's file descriptor by using launcher_dump.proto
116+
-->
117+
<meta-data
118+
android:name="com.android.launcher3.launcher_dump_provider"
119+
android:value="com.android.launcher3.LauncherProvider" />
120+
121+
</application>
122+
</manifest>

AndroidManifest.xml

+118
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
/*
4+
**
5+
** Copyright 2008, The Android Open Source Project
6+
**
7+
** Licensed under the Apache License, Version 2.0 (the "License");
8+
** you may not use this file except in compliance with the License.
9+
** You may obtain a copy of the License at
10+
**
11+
** http://www.apache.org/licenses/LICENSE-2.0
12+
**
13+
** Unless required by applicable law or agreed to in writing, software
14+
** distributed under the License is distributed on an "AS IS" BASIS,
15+
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
** See the License for the specific language governing permissions and
17+
** limitations under the License.
18+
*/
19+
-->
20+
<manifest
21+
xmlns:android="http://schemas.android.com/apk/res/android"
22+
package="com.android.launcher3">
23+
<uses-sdk android:targetSdkVersion="23" android:minSdkVersion="21"/>
24+
<!--
25+
Manifest entries specific to Launcher3. This is merged with AndroidManifest-common.xml.
26+
Refer comments around specific entries on how to extend individual components.
27+
-->
28+
29+
<!--
30+
Permissions required for read/write access to the workspace data. These permission name
31+
should not conflict with that defined in other apps, as such an app should embed its package
32+
name in the permissions. eq com.mypackage.permission.READ_SETTINGS
33+
-->
34+
<permission
35+
android:name="com.android.launcher3.permission.READ_SETTINGS"
36+
android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
37+
android:protectionLevel="signatureOrSystem"
38+
android:label="@string/permlab_read_settings"
39+
android:description="@string/permdesc_read_settings"/>
40+
<permission
41+
android:name="com.android.launcher3.permission.WRITE_SETTINGS"
42+
android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
43+
android:protectionLevel="signatureOrSystem"
44+
android:label="@string/permlab_write_settings"
45+
android:description="@string/permdesc_write_settings"/>
46+
47+
<uses-permission android:name="com.android.launcher.permission.READ_SETTINGS" />
48+
<uses-permission android:name="com.android.launcher.permission.WRITE_SETTINGS" />
49+
<uses-permission android:name="com.android.launcher3.permission.READ_SETTINGS" />
50+
<uses-permission android:name="com.android.launcher3.permission.WRITE_SETTINGS" />
51+
52+
<application
53+
android:backupAgent="com.android.launcher3.LauncherBackupAgent"
54+
android:fullBackupOnly="true"
55+
android:fullBackupContent="@xml/backupscheme"
56+
android:hardwareAccelerated="true"
57+
android:icon="@drawable/ic_launcher_home"
58+
android:label="@string/derived_app_name"
59+
android:theme="@style/LauncherTheme"
60+
android:largeHeap="@bool/config_largeHeap"
61+
android:restoreAnyVersion="true"
62+
android:supportsRtl="true" >
63+
64+
<!--
65+
Main launcher activity. When extending only change the name, and keep all the
66+
attributes and intent filters the same
67+
-->
68+
<activity
69+
android:name="com.android.launcher3.Launcher"
70+
android:launchMode="singleTask"
71+
android:clearTaskOnLaunch="true"
72+
android:stateNotNeeded="true"
73+
android:windowSoftInputMode="adjustPan"
74+
android:screenOrientation="unspecified"
75+
android:configChanges="keyboard|keyboardHidden|mcc|mnc|navigation|orientation|screenSize|screenLayout|smallestScreenSize"
76+
android:resizeableActivity="true"
77+
android:resumeWhilePausing="true"
78+
android:taskAffinity=""
79+
android:enabled="true">
80+
<intent-filter>
81+
<action android:name="android.intent.action.MAIN" />
82+
<action android:name="android.intent.action.VIEW" />
83+
<category android:name="android.intent.category.HOME" />
84+
<category android:name="android.intent.category.DEFAULT" />
85+
<category android:name="android.intent.category.MONKEY"/>
86+
<category android:name="android.intent.category.LAUNCHER" />
87+
<category android:name="android.intent.category.LAUNCHER_APP" />
88+
</intent-filter>
89+
</activity>
90+
91+
<!--
92+
The settings activity. When extending keep the intent filter present
93+
-->
94+
<activity
95+
android:name="com.android.launcher3.SettingsActivity"
96+
android:label="@string/settings_button_text"
97+
android:theme="@android:style/Theme.DeviceDefault.Settings"
98+
android:autoRemoveFromRecents="true">
99+
<intent-filter>
100+
<action android:name="android.intent.action.APPLICATION_PREFERENCES" />
101+
<category android:name="android.intent.category.DEFAULT" />
102+
</intent-filter>
103+
</activity>
104+
105+
<!--
106+
The settings provider contains Home's data, like the workspace favorites. The permissions
107+
should be changed to what is defined above. The authorities should also be changed to
108+
represent the package name.
109+
-->
110+
<provider
111+
android:name="com.android.launcher3.LauncherProvider"
112+
android:authorities="com.android.launcher3.settings"
113+
android:exported="true"
114+
android:writePermission="com.android.launcher3.permission.WRITE_SETTINGS"
115+
android:readPermission="com.android.launcher3.permission.READ_SETTINGS" />
116+
117+
</application>
118+
</manifest>

build.gradle

+157
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
buildscript {
2+
repositories {
3+
mavenCentral()
4+
google()
5+
}
6+
dependencies {
7+
classpath 'com.android.tools.build:gradle:3.2.1'
8+
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.6'
9+
}
10+
}
11+
12+
final String SUPPORT_LIBS_VERSION = '28.0.0'
13+
14+
apply plugin: 'com.android.application'
15+
apply plugin: 'com.google.protobuf'
16+
17+
android {
18+
compileSdkVersion 28
19+
buildToolsVersion '28.0.3'
20+
21+
defaultConfig {
22+
minSdkVersion 21
23+
targetSdkVersion 28
24+
versionCode 1
25+
versionName "1.0"
26+
27+
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
28+
vectorDrawables.useSupportLibrary = true
29+
}
30+
buildTypes {
31+
debug {
32+
minifyEnabled false
33+
}
34+
}
35+
36+
compileOptions {
37+
sourceCompatibility JavaVersion.VERSION_1_8
38+
targetCompatibility JavaVersion.VERSION_1_8
39+
}
40+
41+
flavorDimensions "default"
42+
43+
productFlavors {
44+
aosp {
45+
dimension "default"
46+
applicationId 'com.android.launcher3'
47+
testApplicationId 'com.android.launcher3.tests'
48+
}
49+
50+
l3go {
51+
dimension "default"
52+
applicationId 'com.android.launcher3'
53+
testApplicationId 'com.android.launcher3.tests'
54+
}
55+
56+
quickstep {
57+
dimension "default"
58+
applicationId 'com.android.launcher3'
59+
testApplicationId 'com.android.launcher3.tests'
60+
}
61+
}
62+
63+
// Disable release builds for now
64+
android.variantFilter { variant ->
65+
if (variant.buildType.name.endsWith('release')) {
66+
variant.setIgnore(true);
67+
}
68+
}
69+
70+
sourceSets {
71+
main {
72+
res.srcDirs = ['res']
73+
java.srcDirs = ['src']
74+
manifest.srcFile 'AndroidManifest-common.xml'
75+
proto {
76+
srcDir 'protos/'
77+
srcDir 'proto_overrides/'
78+
}
79+
}
80+
81+
debug {
82+
manifest.srcFile "AndroidManifest.xml"
83+
}
84+
85+
androidTest {
86+
res.srcDirs = ['tests/res']
87+
java.srcDirs = ['tests/src']
88+
manifest.srcFile "tests/AndroidManifest-common.xml"
89+
}
90+
91+
androidTestDebug {
92+
manifest.srcFile "tests/AndroidManifest.xml"
93+
}
94+
95+
aosp {
96+
java.srcDirs = ['src_flags', "src_ui_overrides"]
97+
}
98+
99+
l3go {
100+
res.srcDirs = ['go/res']
101+
java.srcDirs = ['go/src_flags', "src_ui_overrides"]
102+
manifest.srcFile "go/AndroidManifest.xml"
103+
}
104+
105+
quickstep {
106+
res.srcDirs = ['quickstep/res']
107+
java.srcDirs = ['src_flags', 'quickstep/src']
108+
manifest.srcFile "quickstep/AndroidManifest.xml"
109+
}
110+
}
111+
}
112+
113+
repositories {
114+
maven { url "../../../prebuilts/fullsdk-darwin/extras/android/m2repository" }
115+
maven { url "../../../prebuilts/fullsdk-linux/extras/android/m2repository" }
116+
mavenCentral()
117+
google()
118+
}
119+
120+
dependencies {
121+
implementation "com.android.support:support-v4:${SUPPORT_LIBS_VERSION}"
122+
implementation "com.android.support:support-dynamic-animation:${SUPPORT_LIBS_VERSION}"
123+
implementation "com.android.support:recyclerview-v7:${SUPPORT_LIBS_VERSION}"
124+
implementation 'com.google.protobuf.nano:protobuf-javanano:3.2.0rc2'
125+
126+
quickstepImplementation fileTree(dir: "quickstep/libs", include: 'sysui_shared.jar')
127+
128+
testImplementation 'junit:junit:4.12'
129+
androidTestImplementation "org.mockito:mockito-core:2.15.0"
130+
androidTestImplementation 'com.google.dexmaker:dexmaker:1.2'
131+
androidTestImplementation 'com.google.dexmaker:dexmaker-mockito:1.2'
132+
androidTestImplementation 'com.android.support.test:runner:1.0.2'
133+
androidTestImplementation 'com.android.support.test:rules:1.0.2'
134+
androidTestImplementation 'com.android.support.test.uiautomator:uiautomator-v18:2.1.3'
135+
androidTestImplementation "com.android.support:support-annotations:${SUPPORT_LIBS_VERSION}"
136+
}
137+
138+
protobuf {
139+
// Configure the protoc executable
140+
protoc {
141+
artifact = 'com.google.protobuf:protoc:3.0.0-alpha-3'
142+
143+
generateProtoTasks {
144+
all().each { task ->
145+
task.builtins {
146+
remove java
147+
javanano {
148+
option "java_package=launcher_log_extension.proto|com.android.launcher3.userevent.nano"
149+
option "java_package=launcher_log.proto|com.android.launcher3.userevent.nano"
150+
option "java_package=launcher_dump.proto|com.android.launcher3.model.nano"
151+
option "enum_style=java"
152+
}
153+
}
154+
}
155+
}
156+
}
157+
}

0 commit comments

Comments
 (0)