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

Commit 7b10d5b2 authored by Kunhung Li's avatar Kunhung Li Committed by Santiago Etchebehere
Browse files

Enable color functions for ThemePicker

- Add color section for ThemePicker.
- Define theme stub apk with rainbow colors.
- Video:
  https://drive.google.com/file/d/1s_cpn1OegbD1Lof2PxaUVV08BTwpzimp/view

Flag: No impact to existing product: just moves code to AOSP for reference
Bug: 218396282
Test: Push apks with paths below & test.
 /system_ext/priv-app/ThemePicker/ThemePicker.apk
 /product/app/ThemesStub/ThemesStub.apk
Change-Id: I25130573ffb37075b4b71c6b83b7b903b6421ce3
parent f4b41c4a
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -13,6 +13,8 @@

    <queries>
        <!-- Specific intents Wallpaper picker query for -->
        <!-- Package for theme stub -->
        <package android:name="com.android.customization.themes" />
        <!-- Intent filter with action SET_WALLPAPER -->
        <intent>
            <action android:name="android.intent.action.SET_WALLPAPER" />
+4 −1
Original line number Diff line number Diff line
@@ -16,7 +16,10 @@
     limitations under the License.
-->
<resources>
    <string name="themes_stub_package" translatable="false"/>
    <!-- Package of the stub apk containing the themes descriptions -->
    <string name="themes_stub_package" translatable="false">com.android.customization.themes
    </string>

    <string name="clocks_stub_package" translatable="false"/>
    <!-- Authority of a provider in System UI that will provide preview info for available clockfaces. -->
    <string name="clocks_provider_authority" translatable="false">com.android.keyguard.clock</string>
+5 −0
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@ import android.os.Bundle;
import androidx.annotation.Nullable;
import androidx.lifecycle.LifecycleOwner;

import com.android.customization.model.color.ColorSectionController;
import com.android.customization.model.grid.GridOptionsManager;
import com.android.customization.model.grid.GridSectionController;
import com.android.customization.model.mode.DarkModeSectionController;
@@ -41,6 +42,10 @@ public final class DefaultCustomizationSections implements CustomizationSections
                workspaceViewModel, sectionNavigationController, wallpaperPreviewNavigator,
                savedInstanceState));

        // Theme color section.
        sectionControllers.add(new ColorSectionController(
                activity, wallpaperColorsViewModel, lifecycleOwner, savedInstanceState));

        // Dark/Light theme section.
        sectionControllers.add(new DarkModeSectionController(activity,
                lifecycleOwner.getLifecycle()));

themes/Android.bp

0 → 100644
+38 −0
Original line number Diff line number Diff line
// Copyright (C) 2022 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 {
    // See: http://go/android-license-faq
    default_applicable_licenses: [
        "Android-Apache-2.0",
    ],
}

android_app {

    name: "ThemesStub",
    optimize: {
        enabled: false,
    },

    aaptflags: ["--auto-add-overlay"],

    sdk_version: "current",

    product_specific: true,

}

// ==================================================
+14 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.android.customization.themes"
    android:versionCode="1">

    <uses-sdk
      android:minSdkVersion="31"
      android:targetSdkVersion="31"/>

    <application
        android:hasCode="false"
        android:label="@string/app_name"/>

</manifest>
Loading