1package {
2    // See: http://go/android-license-faq
3    // A large-scale-change added 'default_applicable_licenses' to import
4    // all of the 'license_kinds' from "frameworks_base_license"
5    // to get the below license kinds:
6    //   SPDX-license-identifier-Apache-2.0
7    default_applicable_licenses: ["frameworks_base_license"],
8}
9
10android_library {
11    name: "SettingsLib",
12    defaults: [
13        "SettingsLintDefaults",
14        "SettingsLibAvatarPickerDefaults",
15    ],
16
17    static_libs: [
18        "androidx.localbroadcastmanager_localbroadcastmanager",
19        "androidx.room_room-runtime",
20        "androidx.sqlite_sqlite",
21        "zxing-core",
22        "guava",
23
24        "WifiTrackerLibRes",
25        "//frameworks/libs/systemui:iconloader",
26        "setupdesign",
27
28        "SettingsLibActionBarShadow",
29        "SettingsLibActionButtonsPreference",
30        "SettingsLibAdaptiveIcon",
31        "SettingsLibAppPreference",
32        "SettingsLibBannerMessagePreference",
33        "SettingsLibBarChartPreference",
34        "SettingsLibButtonPreference",
35        "SettingsLibCollapsingToolbarBaseActivity",
36        "SettingsLibDeviceStateRotationLock",
37        "SettingsLibDisplayUtils",
38        "SettingsLibEmergencyNumber",
39        "SettingsLibEntityHeaderWidgets",
40        "SettingsLibFooterPreference",
41        "SettingsLibHelpUtils",
42        "SettingsLibIllustrationPreference",
43        "SettingsLibLayoutPreference",
44        "SettingsLibMainSwitchPreference",
45        "SettingsLibProfileSelector",
46        "SettingsLibProgressBar",
47        "SettingsLibRestrictedLockUtils",
48        "SettingsLibSearchWidget",
49        "SettingsLibSelectorWithWidgetPreference",
50        "SettingsLibSettingsSpinner",
51        "SettingsLibSettingsTransition",
52        "SettingsLibTopIntroPreference",
53        "SettingsLibTwoTargetPreference",
54        "SettingsLibUsageProgressBarPreference",
55        "SettingsLibUtils",
56        "settingslib_media_flags_lib",
57        "settingslib_flags_lib",
58    ],
59
60    plugins: ["androidx.room_room-compiler-plugin"],
61    use_resource_processor: true,
62    resource_dirs: ["res"],
63
64    srcs: [
65        "src/**/*.java",
66        "src/**/*.kt",
67    ],
68}
69
70// defaults for lint option
71java_defaults {
72    name: "SettingsLintDefaults",
73    lint: {
74        extra_check_modules: [
75            "SettingsLibLintChecker",
76        ],
77    },
78}
79
80// NOTE: Keep this module in sync with ./common.mk
81java_defaults {
82    name: "SettingsLibDefaults",
83    static_libs: [
84        "SettingsLib",
85    ],
86}
87
88aconfig_declarations {
89    name: "settingslib_media_flags",
90    package: "com.android.settingslib.media.flags",
91    container: "system",
92    srcs: [
93        "aconfig/settingslib_media_flag_declarations.aconfig",
94    ],
95}
96
97java_aconfig_library {
98    name: "settingslib_media_flags_lib",
99    aconfig_declarations: "settingslib_media_flags",
100}
101
102aconfig_declarations {
103    name: "settingslib_flags",
104    package: "com.android.settingslib.flags",
105    container: "system",
106    srcs: [
107        "aconfig/settingslib.aconfig",
108    ],
109}
110
111java_aconfig_library {
112    name: "settingslib_flags_lib",
113    aconfig_declarations: "settingslib_flags",
114}
115
116soong_config_module_type {
117    name: "avatar_picker_java_defaults",
118    module_type: "java_defaults",
119    config_namespace: "SettingsLib",
120    bool_variables: [
121        "legacy_avatar_picker_app_enabled",
122    ],
123    properties: [
124        "static_libs",
125        "manifest",
126    ],
127}
128
129soong_config_bool_variable {
130    name: "legacy_avatar_picker_app_enabled",
131}
132
133avatar_picker_java_defaults {
134    name: "SettingsLibAvatarPickerDefaults",
135    soong_config_variables: {
136        // If flag is enabled, add the library
137        legacy_avatar_picker_app_enabled: {
138            static_libs: [
139                "SettingsLibAvatarPicker",
140            ],
141        },
142    },
143}
144