blob: 2fce7c43937cf244ea035d28aa7a1dee6adbce38 [file] [log] [blame]
programminghoch10d2a71982021-08-04 02:09:40 +02001#
2# Copyright (C) 2021 The LineageOS Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
17LOCAL_PATH := $(call my-dir)
18
19# Set lineage_charger_density to the density bucket of the device.
20lineage_charger_density := mdpi
21ifneq (,$(TARGET_SCREEN_DENSITY))
22lineage_charger_density := $(strip \
23 $(or $(if $(filter $(shell echo $$(($(TARGET_SCREEN_DENSITY) >= 560))),1),xxxhdpi),\
24 $(if $(filter $(shell echo $$(($(TARGET_SCREEN_DENSITY) >= 400))),1),xxhdpi),\
25 $(if $(filter $(shell echo $$(($(TARGET_SCREEN_DENSITY) >= 280))),1),xhdpi),\
26 $(if $(filter $(shell echo $$(($(TARGET_SCREEN_DENSITY) >= 200))),1),hdpi,mdpi)))
27else ifneq (,$(filter mdpi hdpi xhdpi xxhdpi xxxhdpi,$(PRODUCT_AAPT_PREF_CONFIG)))
28# If PRODUCT_AAPT_PREF_CONFIG includes a dpi bucket, then use that value.
29lineage_charger_density := $(PRODUCT_AAPT_PREF_CONFIG)
30endif
31
32include $(CLEAR_VARS)
33LOCAL_MODULE := lineage_charger_battery_scale
34LOCAL_MODULE_STEM := battery_scale.png
35LOCAL_SRC_FILES := $(lineage_charger_density)/battery_scale.png
36LOCAL_MODULE_TAGS := optional
37LOCAL_MODULE_CLASS := ETC
38LOCAL_MODULE_PATH := $(TARGET_OUT_PRODUCT_ETC)/res/images/charger
39include $(BUILD_PREBUILT)
40
41include $(CLEAR_VARS)
42LOCAL_MODULE := lineage_charger_battery_fail
43LOCAL_MODULE_STEM := battery_fail.png
44LOCAL_SRC_FILES := $(lineage_charger_density)/battery_fail.png
45LOCAL_MODULE_TAGS := optional
46LOCAL_MODULE_CLASS := ETC
47LOCAL_MODULE_PATH := $(TARGET_OUT_PRODUCT_ETC)/res/images/charger
48include $(BUILD_PREBUILT)
49
50include $(CLEAR_VARS)
51LOCAL_MODULE := lineage_charger_animation
52LOCAL_MODULE_STEM := animation.txt
53LOCAL_SRC_FILES := animation.txt
54LOCAL_MODULE_TAGS := optional
55LOCAL_MODULE_CLASS := ETC
56LOCAL_MODULE_PATH := $(TARGET_OUT_PRODUCT_ETC)/res/values/charger
57LOCAL_REQUIRED_MODULES := lineage_charger_battery_scale lineage_charger_battery_fail
58include $(BUILD_PREBUILT)