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

Commit 514848cd authored by LuK1337's avatar LuK1337
Browse files

sdk: Introduce LineagePreferenceLib

Because of some nested dependency breakage, we can no longer include
Android libraries in main SDK lib, therefore we are moving all
preference related code to a separate package that Settings/LineageParts
will depend on.

Change-Id: Iea379a580a08ea13f71e3503aa096ba0ed7e7cef
parent c2c42fe8
Loading
Loading
Loading
Loading
+4 −10
Original line number Diff line number Diff line
//
// Copyright (C) 2018-2021 The LineageOS Project
// Copyright (C) 2018-2022 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.
@@ -51,7 +51,6 @@ android_app {

    resource_dirs: [
        "lineage/res/res",
        "sdk/res/res",
    ],

    // Create package-export.apk, which other packages can use to get
@@ -66,11 +65,6 @@ lineage_sdk_src = "sdk/src/java/lineageos"
lineage_sdk_internal_src = "sdk/src/java/org/lineageos/internal"
library_src = "lineage/lib/main/java"

lineage_sdk_LOCAL_STATIC_ANDROID_LIBRARIES = [
    "androidx.preference_preference",
    "SettingsLibMainSwitchPreference",
]

lineage_sdk_LOCAL_STATIC_JAVA_LIBRARIES = [
    "android.hardware.usb-V1.3-java",
    "vendor.lineage.livedisplay-V2.0-java",
@@ -94,7 +88,7 @@ java_library {
    name: "org.lineageos.platform",
    installable: true,
    sdk_version: "core_platform",
    static_libs: lineage_sdk_LOCAL_STATIC_ANDROID_LIBRARIES + lineage_sdk_LOCAL_STATIC_JAVA_LIBRARIES,
    static_libs: lineage_sdk_LOCAL_STATIC_JAVA_LIBRARIES,

    libs: [
        "framework",
@@ -124,7 +118,7 @@ java_library {
java_library {
    name: "org.lineageos.platform.internal",
    required: ["services"],
    static_libs: lineage_sdk_LOCAL_STATIC_ANDROID_LIBRARIES + lineage_sdk_LOCAL_STATIC_JAVA_LIBRARIES,
    static_libs: lineage_sdk_LOCAL_STATIC_JAVA_LIBRARIES,

    srcs: [
        lineage_sdk_src + "/**/*.java",
@@ -149,7 +143,7 @@ java_library {
java_library {
    name: "org.lineageos.platform.sdk",
    required: ["services"],
    static_libs: lineage_sdk_LOCAL_STATIC_ANDROID_LIBRARIES + lineage_sdk_LOCAL_STATIC_JAVA_LIBRARIES,
    static_libs: lineage_sdk_LOCAL_STATIC_JAVA_LIBRARIES,

    srcs: [
        lineage_sdk_src + "/**/*.java",
+32 −0
Original line number Diff line number Diff line
//
// Copyright (C) 2022 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.
// 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.
//

android_library {
    name: "LineagePreferenceLib",
    min_sdk_version: "30",
    static_libs: [
        "androidx.preference_preference",
        "SettingsLibMainSwitchPreference",
        "org.lineageos.platform",
    ],

    srcs: ["java/**/*.java"],
    resource_dirs: ["res"],

    aidl: {
        local_include_dirs: ["java"],
    },
}
+2 −0
Original line number Diff line number Diff line
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="lineageos.preference" />
+4 −3
Original line number Diff line number Diff line
@@ -43,7 +43,8 @@ import java.util.Objects;
import java.util.Set;

import lineageos.hardware.LineageHardwareManager;
import lineageos.platform.R;
import static lineageos.preference.R.styleable.lineage_SelfRemovingPreference_minSummaryLines;
import static lineageos.preference.R.styleable.lineage_SelfRemovingPreference_replacesKey;


/**
@@ -78,8 +79,8 @@ public class ConstraintsHelper {

        TypedArray a = context.getResources().obtainAttributes(attrs,
                R.styleable.lineage_SelfRemovingPreference);
        mSummaryMinLines = a.getInteger(R.styleable.lineage_SelfRemovingPreference_minSummaryLines, -1);
        String replacesKey = a.getString(R.styleable.lineage_SelfRemovingPreference_replacesKey);
        mSummaryMinLines = a.getInteger(lineage_SelfRemovingPreference_minSummaryLines, -1);
        String replacesKey = a.getString(lineage_SelfRemovingPreference_replacesKey);
        if (replacesKey != null) {
            mReplacesKey = replacesKey.split("\\|");
        }
+0 −0

File moved.

Loading