From fe1251795d26ac81fc5b88a7ff445f7944ab0567 Mon Sep 17 00:00:00 2001 From: Michael Bestas Date: Sun, 10 Mar 2024 11:28:21 +0200 Subject: [PATCH 1/6] aidl: Update dependencies for QPR2 Change-Id: I1f3b159166b21ead595dc3e006d2d340b3ba2015 --- aidl/fingerprint/Android.bp | 4 ++-- aidl/thermal/Android.bp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/aidl/fingerprint/Android.bp b/aidl/fingerprint/Android.bp index e67e23a0..7565911c 100644 --- a/aidl/fingerprint/Android.bp +++ b/aidl/fingerprint/Android.bp @@ -21,8 +21,8 @@ cc_binary { "libbase", "libbinder_ndk", "libhardware", - "android.hardware.biometrics.fingerprint-V3-ndk", - "android.hardware.biometrics.common-V3-ndk", + "android.hardware.biometrics.fingerprint-V4-ndk", + "android.hardware.biometrics.common-V4-ndk", "android.hardware.biometrics.common.util", ], static_libs: ["libandroid.hardware.biometrics.fingerprint.SamsungProps"], diff --git a/aidl/thermal/Android.bp b/aidl/thermal/Android.bp index d2c03c5e..f3987696 100644 --- a/aidl/thermal/Android.bp +++ b/aidl/thermal/Android.bp @@ -27,7 +27,7 @@ cc_binary { "libutils", "libnl", "libbinder_ndk", - "android.frameworks.stats-V1-ndk", + "android.frameworks.stats-V2-ndk", "android.hardware.power-V1-ndk", "android.hardware.thermal-V1-ndk", "pixel-power-ext-V1-ndk", @@ -37,7 +37,7 @@ cc_binary { "libpixelstats", ], export_shared_lib_headers: [ - "android.frameworks.stats-V1-ndk", + "android.frameworks.stats-V2-ndk", "pixelatoms-cpp", ], cflags: [ From 1548ce2f61c27ef9e327187d9e28403909403e8a Mon Sep 17 00:00:00 2001 From: Bruno Martins Date: Mon, 11 Mar 2024 17:10:34 +0000 Subject: [PATCH 2/6] hidl: camera: Update dependencies for U QPR2 Change-Id: I7b2d1b75c7064ce1684c98cde703eca74a8e4cbc --- hidl/camera/default/Android.bp | 5 ++--- hidl/camera/device/3.2/default/Android.bp | 1 + hidl/camera/device/3.4/default/Android.bp | 1 + hidl/camera/device/3.5/default/Android.bp | 1 + 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/hidl/camera/default/Android.bp b/hidl/camera/default/Android.bp index 6d7dcdd9..3a7c2543 100644 --- a/hidl/camera/default/Android.bp +++ b/hidl/camera/default/Android.bp @@ -24,14 +24,13 @@ cc_library_static { "libgralloctypes", "libhardware", "libcamera_metadata", - "android.hardware.graphics.mapper@2.0", - "android.hardware.graphics.mapper@3.0", - "android.hardware.graphics.mapper@4.0", "libexif", + "libui", ], include_dirs: ["system/media/private/camera/include"], header_libs: ["libhardware_headers.camera3_samsung"], export_include_dirs: ["include"], + export_shared_lib_headers: ["libui"], } // NOTE: Deprecated module kept for compatibility reasons. diff --git a/hidl/camera/device/3.2/default/Android.bp b/hidl/camera/device/3.2/default/Android.bp index 14488dd6..a61f429b 100644 --- a/hidl/camera/device/3.2/default/Android.bp +++ b/hidl/camera/device/3.2/default/Android.bp @@ -24,6 +24,7 @@ cc_library_shared { "libhardware", "libcamera_metadata", "libfmq", + "libui", ], static_libs: [ "android.hardware.camera.common@1.0-helper.samsung", diff --git a/hidl/camera/device/3.4/default/Android.bp b/hidl/camera/device/3.4/default/Android.bp index 3941536c..24672d27 100644 --- a/hidl/camera/device/3.4/default/Android.bp +++ b/hidl/camera/device/3.4/default/Android.bp @@ -45,6 +45,7 @@ cc_library_shared { "libhardware", "libcamera_metadata", "libfmq", + "libui", ], static_libs: [ "android.hardware.camera.common@1.0-helper.samsung", diff --git a/hidl/camera/device/3.5/default/Android.bp b/hidl/camera/device/3.5/default/Android.bp index 120f9957..3f65dce3 100644 --- a/hidl/camera/device/3.5/default/Android.bp +++ b/hidl/camera/device/3.5/default/Android.bp @@ -28,6 +28,7 @@ cc_library_shared { ], shared_libs: [ "libhidlbase", + "libui", "libutils", "libcutils", "camera.device@3.2-impl.samsung", From 8b14999cd08fa50eec36e0fb84662469bcf6b510 Mon Sep 17 00:00:00 2001 From: Peter Kalauskas Date: Fri, 8 Mar 2024 14:52:16 +0530 Subject: [PATCH 3/6] samsung: Enable use_resource_processor for all sysui deps This will make the build faster Test: m checkbuild Bug: 295208392 Signed-off-by: RisenID Change-Id: I0c1bd901429bbe3bf81c1530e156735f8637a96e --- .../lineageos/settings/device/AdvancedDisplayActivity.java | 4 ++-- dap/src/org/lineageos/dap/DolbyActivity.kt | 3 +-- doze/src/org/lineageos/settings/doze/SamsungDozeActivity.java | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/AdvancedDisplay/src/org/lineageos/settings/device/AdvancedDisplayActivity.java b/AdvancedDisplay/src/org/lineageos/settings/device/AdvancedDisplayActivity.java index 774919e7..29dfc735 100644 --- a/AdvancedDisplay/src/org/lineageos/settings/device/AdvancedDisplayActivity.java +++ b/AdvancedDisplay/src/org/lineageos/settings/device/AdvancedDisplayActivity.java @@ -19,14 +19,14 @@ package org.lineageos.settings.device; import android.os.Bundle; import com.android.settingslib.collapsingtoolbar.CollapsingToolbarBaseActivity; -import com.android.settingslib.widget.R; public class AdvancedDisplayActivity extends CollapsingToolbarBaseActivity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - getFragmentManager().beginTransaction().replace(R.id.content_frame, + getFragmentManager().beginTransaction().replace( + com.android.settingslib.collapsingtoolbar.R.id.content_frame, new AdvancedDisplayFragment()).commit(); } } diff --git a/dap/src/org/lineageos/dap/DolbyActivity.kt b/dap/src/org/lineageos/dap/DolbyActivity.kt index f12a30f6..4c437c40 100644 --- a/dap/src/org/lineageos/dap/DolbyActivity.kt +++ b/dap/src/org/lineageos/dap/DolbyActivity.kt @@ -19,13 +19,12 @@ package org.lineageos.dap import android.os.Bundle import com.android.settingslib.collapsingtoolbar.CollapsingToolbarBaseActivity -import com.android.settingslib.widget.R class DolbyActivity : CollapsingToolbarBaseActivity() { public override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) fragmentManager.beginTransaction().replace( - R.id.content_frame, + com.android.settingslib.collapsingtoolbar.R.id.content_frame, DolbyFragment() ).commit() } diff --git a/doze/src/org/lineageos/settings/doze/SamsungDozeActivity.java b/doze/src/org/lineageos/settings/doze/SamsungDozeActivity.java index ba8459de..992c357a 100644 --- a/doze/src/org/lineageos/settings/doze/SamsungDozeActivity.java +++ b/doze/src/org/lineageos/settings/doze/SamsungDozeActivity.java @@ -18,7 +18,6 @@ package org.lineageos.settings.doze; import android.os.Bundle; import com.android.settingslib.collapsingtoolbar.CollapsingToolbarBaseActivity; -import com.android.settingslib.widget.R; public class SamsungDozeActivity extends CollapsingToolbarBaseActivity { @@ -27,7 +26,8 @@ public class SamsungDozeActivity extends CollapsingToolbarBaseActivity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - getFragmentManager().beginTransaction().replace(R.id.content_frame, + getFragmentManager().beginTransaction().replace( + com.android.settingslib.collapsingtoolbar.R.id.content_frame, new SamsungDozeSettings(), TAG).commit(); } } From 8fd19f2d7c9b4bc6242fb4e47aace82cf9a8bc27 Mon Sep 17 00:00:00 2001 From: Chaohui Wang Date: Fri, 8 Mar 2024 15:24:40 +0530 Subject: [PATCH 4/6] samsung: Migrate to CompoundButton.OnCheckedChangeListener Switch and SwitchCompat are both CompoundButton. Using CompoundButton in Java will helps migration in the future. Bug: 306658427 | AOSP Test: manual - check Settings pages Test: m RunSettingsLibRoboTests Signed-off-by: RisenID Change-Id: I85a70d4c504d8584030ea4a058f30d74206ab835 --- dap/src/org/lineageos/dap/DolbyFragment.kt | 8 ++++---- .../org/lineageos/settings/doze/SamsungDozeSettings.java | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dap/src/org/lineageos/dap/DolbyFragment.kt b/dap/src/org/lineageos/dap/DolbyFragment.kt index 2331b65f..29834343 100644 --- a/dap/src/org/lineageos/dap/DolbyFragment.kt +++ b/dap/src/org/lineageos/dap/DolbyFragment.kt @@ -17,17 +17,17 @@ package org.lineageos.dap import android.os.Bundle -import android.widget.Switch +import android.widget.CompoundButton +import android.widget.CompoundButton.OnCheckedChangeListener import androidx.preference.PreferenceFragment import com.android.settingslib.widget.MainSwitchPreference -import com.android.settingslib.widget.OnMainSwitchChangeListener import com.android.settingslib.widget.RadioButtonPreference import org.lineageos.dap.R -class DolbyFragment : PreferenceFragment(), OnMainSwitchChangeListener { +class DolbyFragment : PreferenceFragment(), OnCheckedChangeListener { private lateinit var switchBar: MainSwitchPreference @@ -47,7 +47,7 @@ class DolbyFragment : PreferenceFragment(), OnMainSwitchChangeListener { } } - override fun onSwitchChanged(switchView: Switch, isChecked: Boolean) { + override fun onCheckedChanged(buttonView: CompoundButton, isChecked: Boolean) { DolbyCore.setEnabled(isChecked) } diff --git a/doze/src/org/lineageos/settings/doze/SamsungDozeSettings.java b/doze/src/org/lineageos/settings/doze/SamsungDozeSettings.java index f0f9b525..0bc7fb84 100644 --- a/doze/src/org/lineageos/settings/doze/SamsungDozeSettings.java +++ b/doze/src/org/lineageos/settings/doze/SamsungDozeSettings.java @@ -19,7 +19,8 @@ package org.lineageos.settings.doze; import android.os.Bundle; import android.os.Handler; -import android.widget.Switch; +import android.widget.CompoundButton; +import android.widget.CompoundButton.OnCheckedChangeListener; import androidx.preference.Preference; import androidx.preference.Preference.OnPreferenceChangeListener; @@ -27,12 +28,11 @@ import androidx.preference.PreferenceFragment; import androidx.preference.SwitchPreference; import com.android.settingslib.widget.MainSwitchPreference; -import com.android.settingslib.widget.OnMainSwitchChangeListener; import org.lineageos.internal.util.ScreenType; public class SamsungDozeSettings extends PreferenceFragment - implements OnPreferenceChangeListener, OnMainSwitchChangeListener { + implements OnPreferenceChangeListener, OnCheckedChangeListener { private MainSwitchPreference mSwitchBar; @@ -108,7 +108,7 @@ public class SamsungDozeSettings extends PreferenceFragment } @Override - public void onSwitchChanged(Switch switchView, boolean isChecked) { + public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { Utils.enableDoze(getActivity(), isChecked); Utils.checkDozeService(getActivity()); From 219ef4583218b0403445a6dbb8a638143dc4c78c Mon Sep 17 00:00:00 2001 From: LuK1337 Date: Wed, 20 Mar 2024 09:21:59 +0100 Subject: [PATCH 5/6] dap: Migrate to SelectorWithWidgetPreference Change-Id: Ie4aaa1fff836a407c1d8f5b919b7b0051748f5d3 --- dap/res/xml/dolby_settings.xml | 18 +++++++++--------- dap/src/org/lineageos/dap/DolbyFragment.kt | 8 ++++---- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/dap/res/xml/dolby_settings.xml b/dap/res/xml/dolby_settings.xml index a494eb6f..94f829c2 100644 --- a/dap/res/xml/dolby_settings.xml +++ b/dap/res/xml/dolby_settings.xml @@ -12,40 +12,40 @@ android:key="dolby_top_intro" android:title="@string/dolby_top_intro_summary" /> - - - - - - - - - diff --git a/dap/src/org/lineageos/dap/DolbyFragment.kt b/dap/src/org/lineageos/dap/DolbyFragment.kt index 29834343..ff68a90a 100644 --- a/dap/src/org/lineageos/dap/DolbyFragment.kt +++ b/dap/src/org/lineageos/dap/DolbyFragment.kt @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022 The LineageOS Project + * Copyright (C) 2022-2024 The LineageOS Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,7 +23,7 @@ import android.widget.CompoundButton.OnCheckedChangeListener import androidx.preference.PreferenceFragment import com.android.settingslib.widget.MainSwitchPreference -import com.android.settingslib.widget.RadioButtonPreference +import com.android.settingslib.widget.SelectorWithWidgetPreference import org.lineageos.dap.R @@ -39,7 +39,7 @@ class DolbyFragment : PreferenceFragment(), OnCheckedChangeListener { switchBar.isChecked = DolbyCore.isEnabled() for ((key, value) in PREF_DOLBY_MODES) { - val preference = findPreference(key)!! + val preference = findPreference(key)!! preference.setOnPreferenceClickListener { setProfile(value) true @@ -55,7 +55,7 @@ class DolbyFragment : PreferenceFragment(), OnCheckedChangeListener { DolbyCore.setProfile(profile) for ((key, value) in PREF_DOLBY_MODES) { - val preference = findPreference(key)!! + val preference = findPreference(key)!! preference.isChecked = value == profile } } From 5ac489cda9ad2f8f9c2978b8307bba7744c3d831 Mon Sep 17 00:00:00 2001 From: Ruchit Date: Tue, 12 Mar 2024 21:13:48 +0530 Subject: [PATCH 6/6] doze: mk->bp Fixes FAILED: /home/risen/android/builds/pe/a52q/target/product/a52q/obj/APPS/SamsungDoze_intermediates/dexpreopt.sh /bin/bash -c "/home/risen/android/builds/pe/a52q/host/linux-x86/bin/dexpreopt_gen -global_soong /home/risen/android/builds/pe/a52q/soong/dexpreopt_soong.config -global /home/risen/android/builds/pe/a52q/soong/dexpreopt_arm64/dexpreopt.config -module /home/risen/android/builds/pe/a52q/target/product/a52q/obj/APPS/SamsungDoze_intermediates/dexpreopt.config -dexpreopt_script /home/risen/android/builds/pe/a52q/target/product/a52q/obj/APPS/SamsungDoze_intermediates/dexpreopt.sh -out_dir /home/risen/android/builds/pe/a52q -product_packages /home/risen/android/builds/pe/a52q/target/product/a52q/obj/APPS/SamsungDoze_intermediates/product_packages.txt" error: Path is outside directory: /home/risen/android/builds/pe/a52q/target/product/a52q/obj/APPS/SamsungDoze_intermediates/product_packages.txt Change-Id: I503a688658a2879fc72180f370717f2d835c1efe --- Android.mk | 1 - doze/Android.bp | 28 ++++++++++++++++++++++++++++ doze/Android.mk | 36 ------------------------------------ 3 files changed, 28 insertions(+), 37 deletions(-) create mode 100644 doze/Android.bp delete mode 100644 doze/Android.mk diff --git a/Android.mk b/Android.mk index fc3385bf..9a975153 100644 --- a/Android.mk +++ b/Android.mk @@ -37,7 +37,6 @@ endif ifeq ($(BOARD_VENDOR),samsung) include $(SAM_ROOT)/audio/Android.mk -include $(SAM_ROOT)/doze/Android.mk include $(SAM_ROOT)/hidl/Android.mk include $(SAM_ROOT)/modemloader/Android.mk include $(SAM_ROOT)/ril/Android.mk diff --git a/doze/Android.bp b/doze/Android.bp new file mode 100644 index 00000000..a719893d --- /dev/null +++ b/doze/Android.bp @@ -0,0 +1,28 @@ +// +// Copyright (C) 2024 The Pixel Experience Project +// +// SPDX-License-Identifier: Apache-2.0 +// + +android_app { + name: "SamsungDoze", + defaults: ["SettingsLibDefaults"], + + srcs: ["src/**/*.java"], + resource_dirs: ["res"], + + certificate: "platform", + platform_apis: true, + system_ext_specific: true, + + static_libs: [ + "androidx.window.extensions", + "androidx.window.sidecar", + "org.lineageos.platform.internal", + "org.lineageos.settings.resources", + ], + + optimize: { + proguard_flags_files: ["proguard.flags"], + }, +} diff --git a/doze/Android.mk b/doze/Android.mk deleted file mode 100644 index f5f9abc1..00000000 --- a/doze/Android.mk +++ /dev/null @@ -1,36 +0,0 @@ -LOCAL_PATH:= $(call my-dir) -include $(CLEAR_VARS) - -LOCAL_MODULE_TAGS := optional - -LOCAL_SRC_FILES := $(call all-java-files-under, src) - -LOCAL_PACKAGE_NAME := SamsungDoze -LOCAL_CERTIFICATE := platform -LOCAL_PRIVATE_PLATFORM_APIS := true -LOCAL_PRIVILEGED_MODULE := true - -LOCAL_USE_AAPT2 := true - -LOCAL_STATIC_ANDROID_LIBRARIES := \ - SettingsLib - -LOCAL_STATIC_JAVA_LIBRARIES := \ - org.lineageos.platform.internal - -LOCAL_OPTIONAL_USES_LIBRARIES := \ - androidx.window.extensions \ - androidx.window.sidecar - -LOCAL_PROGUARD_FLAG_FILES := proguard.flags - -LOCAL_RESOURCE_DIR := \ - $(LOCAL_PATH)/res \ - $(TOP)/packages/resources/devicesettings/res - -ifneq ($(INCREMENTAL_BUILDS),) - LOCAL_PROGUARD_ENABLED := disabled - LOCAL_JACK_ENABLED := incremental -endif - -include $(BUILD_PACKAGE)