Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 87db8348 authored by Xin Li's avatar Xin Li
Browse files

Merge Android 12

Bug: 202323961
Merged-In: I90187609ee9ba51bca7036a89ce46f1c08bbf1b3
Change-Id: I8fc8724cd6a74ff828fcc1b46c9916b9f5a93d03
parents 9f16f416 4cd48dfc
Loading
Loading
Loading
Loading

Android.bp

0 → 100644
+101 −0
Original line number Diff line number Diff line
//
// Copyright (C) 2021 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//


package {
    default_applicable_licenses: ["Android-Apache-2.0"],
}

filegroup {
    name: "ThemePicker_srcs",
    srcs: [
        "src/**/*.java",
        "src/**/*.kt",
        // Min requirement for CustomizationInjector and StatsLogUserEventLogger to build without Clock and Theme feature.
        "src/com/android/customization/model/clock/BaseClockManager.java",
        "src/com/android/customization/model/clock/Clockface.java",
        "src/com/android/customization/model/clock/ClockManager.java",
        "src/com/android/customization/model/clock/ClockProvider.java",
        "src/com/android/customization/model/theme/OverlayManagerCompat.java",
        "src/com/android/customization/model/theme/ThemeBundleProvider.java",
        "src/com/android/customization/model/theme/ThemeManager.java",
        "src/com/android/customization/model/theme/ThemeBundle.java",
        "src/com/android/customization/model/theme/custom/CustomTheme.java",
    ],
    exclude_srcs: [
        "src/com/android/customization/model/clock/**/*.java",
        "src/com/android/customization/model/theme/**/*.java",
        "src/com/android/customization/picker/clock/**/*.java",
        "src/com/android/customization/picker/theme/**/*.java",
    ],
}

filegroup {
    name: "ThemePicker_Manifest",
    srcs: [
        "AndroidManifest.xml",
    ],
}

genrule {
    name: "ThemePicker_res",
    tools: ["soong_zip"],
    srcs: [
        "res/**/*"
    ],
    out: ["ThemePicker_res.zip"],
    cmd: "INPUTS=($(in)) && "
        + "RES_DIR=$$(dirname $$(dirname $${INPUTS[0]})) && "
        + "$(location soong_zip) -o $(out) -C $$RES_DIR -D $$RES_DIR"
}

//
// Build app code.
//
android_app {
    name: "ThemePicker",

    static_libs: [
        "wallpaper-common-deps",
        "SettingsLibSettingsTheme",
        "SystemUI-statsd",
        "styleprotoslite",
    ],

    srcs: [
        ":WallpaperPicker2_srcs",
        ":ThemePicker_srcs",
        "src_override/**/*.java",
        "src_override/**/*.kt",
    ],

    use_embedded_native_libs: true,

    resource_zips: [":WallpaperPicker2_res", ":ThemePicker_res"],

    optimize: {
        enabled: false,
    },
    kotlincflags: ["-Xjvm-default=enable"],
    certificate: "",

    privileged: true,
    system_ext_specific: true,
    platform_apis: true,
    manifest: "AndroidManifest.xml",
    additional_manifests: [":WallpaperPicker2_Manifest"],
    overrides: ["WallpaperPicker2"],
}

Android.mk

deleted100644 → 0
+0 −58
Original line number Diff line number Diff line
#
# Copyright (C) 2018 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#


LOCAL_PATH := $(call my-dir)
WALLPAPER_PATH := ../WallpaperPicker2

#
# Build rule for ThemePicker app.
#
include $(CLEAR_VARS)
LOCAL_USE_AAPT2 := true
LOCAL_MODULE_TAGS := optional

LOCAL_STATIC_ANDROID_LIBRARIES := WallpaperPicker2CommonDepsLib
LOCAL_STATIC_JAVA_LIBRARIES := styleprotosnano SystemUI-statsd SystemUISharedLib
LOCAL_PROGUARD_ENABLED := disabled

LOCAL_PACKAGE_NAME := ThemePicker
LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
LOCAL_LICENSE_CONDITIONS := notice
LOCAL_PRIVILEGED_MODULE := true
LOCAL_SYSTEM_EXT_MODULE := true
LOCAL_OVERRIDES_PACKAGES := WallpaperPicker2

ifneq (,$(wildcard frameworks/base))
  LOCAL_PRIVATE_PLATFORM_APIS := true
else
  LOCAL_SDK_VERSION := system_current
  LOCAL_STATIC_JAVA_LIBRARIES += libSharedWallpaper
endif

LOCAL_SRC_FILES := $(call all-java-files-under, $(WALLPAPER_PATH)/src) \
    $(call all-java-files-under, src) \
    $(call all-java-files-under, src_override)

LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res

LOCAL_MANIFEST_FILE := AndroidManifest.xml

include $(BUILD_PACKAGE)


# ==================================================
include $(call all-makefiles-under,$(LOCAL_PATH))
+41 −16
Original line number Diff line number Diff line
@@ -8,7 +8,33 @@
    <uses-permission android:name="android.permission.CHANGE_OVERLAY_PACKAGES"/>
    <uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS"/>
    <uses-permission android:name="android.permission.SET_WALLPAPER_COMPONENT" />
    <uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />

    <uses-permission android:name="android.permission.MODIFY_DAY_NIGHT_MODE" />

    <queries>
        <!-- Specific intents Wallpaper picker query for -->
        <!-- Intent filter with action SET_WALLPAPER -->
        <intent>
            <action android:name="android.intent.action.SET_WALLPAPER" />
        </intent>
        <!-- Intent filter with action GET_CONTENT and data's mimeType as "image/*" -->
        <intent>
            <action android:name="android.intent.action.GET_CONTENT" />
            <data android:mimeType="image/*" />
        </intent>
        <!-- Intent filter with action VIEW -->
        <intent>
            <action android:name="android.intent.action.VIEW" />
        </intent>
        <!-- Intent filter with action WallpaperService (live wallpaper interface) -->
        <intent>
            <action android:name="android.service.wallpaper.WallpaperService" />
        </intent>
        <!-- Intent filter with action used to discover partner -->
        <intent>
            <action android:name="com.android.launcher3.action.PARTNER_CUSTOMIZATION" />
        </intent>
    </queries>

    <application
        tools:replace="android:icon,android:name"
@@ -22,24 +48,23 @@
        android:name="com.android.customization.picker.CustomizationPickerApplication"
        android:theme="@style/CustomizationTheme">
        <activity
            android:name="com.android.customization.picker.CustomizationPickerActivity"
            tools:node="replace"
            android:name="com.android.wallpaper.picker.CustomizationPickerActivity"
            android:label="@string/app_name"
            android:resizeableActivity="false"
            android:exported="true"
            android:theme="@style/CustomizationTheme.NoActionBar">
            android:theme="@style/CustomizationTheme.NoActionBar"
            android:exported="false"/>

        <activity-alias
            android:name="com.android.customization.picker.CustomizationPickerActivity"
            android:targetActivity="com.android.wallpaper.picker.CustomizationPickerActivity"
            android:label="@string/app_name"
            android:exported="true">
             <intent-filter>
                 <action android:name="android.intent.action.SET_WALLPAPER"/>

                 <category android:name="android.intent.category.DEFAULT"/>
             </intent-filter>
        </activity>
        <activity android:name="com.android.customization.picker.theme.CustomThemeActivity"
                  android:resizeableActivity="false"
                  android:theme="@style/CustomizationTheme.NoActionBar"/>
        </activity-alias>

        <activity android:name="com.android.customization.picker.ViewOnlyFullPreviewActivity"
            android:resizeableActivity="false"
            android:theme="@style/CustomizationTheme.NoActionBar"/>
    </application>

</manifest>
+1 −1
Original line number Diff line number Diff line
@@ -20,5 +20,5 @@
        android:color="?android:colorAccent" />
    <item
        android:state_checked="false"
        android:color="@color/bottom_bar_icon_unchecked_color" />
        android:color="?android:textColorTertiary" />
</selector>
 No newline at end of file
+7 −3
Original line number Diff line number Diff line
@@ -15,7 +15,11 @@
     limitations under the License.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:alpha="0.16" android:color="@color/edit_background_base" android:state_hovered="true"/>
    <item android:alpha="0.04" android:color="@color/edit_background_base" android:state_enabled="false"/>
    <item android:alpha="0.05" android:color="@color/edit_background_base"/>
    <item android:alpha="0.16"
        android:color="?android:textColorTertiary"
        android:state_hovered="true"/>
    <item android:alpha="0.04"
        android:color="?android:textColorTertiary"
        android:state_enabled="false"/>
    <item android:alpha="0.05" android:color="?android:textColorTertiary"/>
</selector>
 No newline at end of file
Loading