LineageParts: Adapt changes for LineagePreferenceLib
Change-Id: I30c418687d17866835c37614886f1e8c8c195756
diff --git a/Android.bp b/Android.bp
index dd35ae9..5db4ff2 100644
--- a/Android.bp
+++ b/Android.bp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2019-2021 The LineageOS Project
+ * Copyright (C) 2019-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.
@@ -42,6 +42,7 @@
"jsr305",
"org.lineageos.platform.internal",
"SystemUISharedLib",
+ "LineagePreferenceLib",
],
required: [
diff --git a/res/xml/button_settings.xml b/res/xml/button_settings.xml
index 2c1f967..2b492b3 100644
--- a/res/xml/button_settings.xml
+++ b/res/xml/button_settings.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2016 The CyanogenMod Project
- 2017-2021 The LineageOS Project
+ 2017-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.
@@ -17,7 +17,7 @@
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:lineage="http://schemas.android.com/apk/res/lineageos.platform"
+ xmlns:lineage="http://schemas.android.com/apk/res-auto"
android:key="button_settings"
android:title="@string/button_pref_title">
diff --git a/res/xml/charging_sounds_settings.xml b/res/xml/charging_sounds_settings.xml
index 361f0e6..1a6daec 100644
--- a/res/xml/charging_sounds_settings.xml
+++ b/res/xml/charging_sounds_settings.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2016 The CyanogenMod Project
- 2017-2018,2021 The LineageOS Project
+ 2017-2018,2021-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.
@@ -17,7 +17,7 @@
-->
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:lineage="http://schemas.android.com/apk/res/lineageos.platform"
+ xmlns:lineage="http://schemas.android.com/apk/res-auto"
android:key="charging_sounds_settings"
android:title="@string/charging_sounds_settings_title">
diff --git a/res/xml/display_rotation.xml b/res/xml/display_rotation.xml
index a5783e3..1f81c99 100644
--- a/res/xml/display_rotation.xml
+++ b/res/xml/display_rotation.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2016 The CyanogenMod Project
- 2017,2021 The LineageOS Project
+ 2017,2021-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.
@@ -18,7 +18,7 @@
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:lineage="http://schemas.android.com/apk/res/lineageos.platform"
+ xmlns:lineage="http://schemas.android.com/apk/res-auto"
android:key="rotation"
android:title="@string/display_rotation_title">
diff --git a/res/xml/parts_catalog.xml b/res/xml/parts_catalog.xml
index 803b214..9711b21 100644
--- a/res/xml/parts_catalog.xml
+++ b/res/xml/parts_catalog.xml
@@ -27,7 +27,7 @@
the Searchable interface.
-->
<parts-catalog xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:lineage="http://schemas.android.com/apk/res/lineageos.platform">
+ xmlns:lineage="http://schemas.android.com/apk/res-auto">
<part android:key="battery_lights"
android:title="@string/battery_light_title"
diff --git a/res/xml/status_bar_settings.xml b/res/xml/status_bar_settings.xml
index e67eb42..895d403 100644
--- a/res/xml/status_bar_settings.xml
+++ b/res/xml/status_bar_settings.xml
@@ -17,7 +17,7 @@
-->
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:lineage="http://schemas.android.com/apk/res/lineageos.platform"
+ xmlns:lineage="http://schemas.android.com/apk/res-auto"
android:key="status_bar_settings"
android:title="@string/status_bar_title">
diff --git a/res/xml/trust_preferences.xml b/res/xml/trust_preferences.xml
index 108371c..7cebff4 100644
--- a/res/xml/trust_preferences.xml
+++ b/res/xml/trust_preferences.xml
@@ -47,7 +47,7 @@
android:entryValues="@array/trust_restrict_usb_values"
android:defaultValue="0" />
- <org.lineageos.internal.lineageparts.LineagePartsPreference
+ <lineageos.preference.LineagePartsPreference
android:key="lineagestats" />
<ListPreference
diff --git a/src/org/lineageos/lineageparts/PartsActivity.java b/src/org/lineageos/lineageparts/PartsActivity.java
index 311aba9..d7e24bb 100644
--- a/src/org/lineageos/lineageparts/PartsActivity.java
+++ b/src/org/lineageos/lineageparts/PartsActivity.java
@@ -37,9 +37,10 @@
import com.android.settingslib.collapsingtoolbar.CollapsingToolbarBaseActivity;
import com.android.settingslib.widget.MainSwitchBar;
+import lineageos.preference.PartInfo;
+import lineageos.preference.PartsList;
+
import org.lineageos.lineageparts.profiles.NFCProfileTagCallback;
-import org.lineageos.internal.lineageparts.PartInfo;
-import org.lineageos.internal.lineageparts.PartsList;
public class PartsActivity extends CollapsingToolbarBaseActivity implements
PreferenceFragment.OnPreferenceStartFragmentCallback,
diff --git a/src/org/lineageos/lineageparts/PartsUpdater.java b/src/org/lineageos/lineageparts/PartsUpdater.java
index 76ea305..f4a94eb 100644
--- a/src/org/lineageos/lineageparts/PartsUpdater.java
+++ b/src/org/lineageos/lineageparts/PartsUpdater.java
@@ -20,17 +20,17 @@
import android.os.Bundle;
import android.util.Log;
-import org.lineageos.internal.lineageparts.PartInfo;
-import org.lineageos.internal.lineageparts.PartsList;
+import lineageos.preference.PartInfo;
+import lineageos.preference.PartsList;
import java.lang.reflect.Field;
import lineageos.preference.RemotePreferenceUpdater;
import lineageos.preference.SettingsHelper;
+import static lineageos.preference.PartsList.EXTRA_PART;
import static lineageos.preference.RemotePreference.EXTRA_KEY;
import static lineageos.preference.RemotePreference.EXTRA_SUMMARY;
-import static org.lineageos.internal.lineageparts.PartsList.EXTRA_PART;
/**
* PartsRefresher keeps remote UI clients up to date with any changes in the
diff --git a/src/org/lineageos/lineageparts/search/LineagePartsSearchIndexablesProvider.java b/src/org/lineageos/lineageparts/search/LineagePartsSearchIndexablesProvider.java
index 0c191a7..615b0f5 100644
--- a/src/org/lineageos/lineageparts/search/LineagePartsSearchIndexablesProvider.java
+++ b/src/org/lineageos/lineageparts/search/LineagePartsSearchIndexablesProvider.java
@@ -22,9 +22,10 @@
import android.util.ArraySet;
import android.util.Log;
+import lineageos.preference.PartInfo;
+import lineageos.preference.PartsList;
+
import org.lineageos.lineageparts.search.Searchable.SearchIndexProvider;
-import org.lineageos.internal.lineageparts.PartInfo;
-import org.lineageos.internal.lineageparts.PartsList;
import org.lineageos.platform.internal.R;
import java.lang.reflect.Field;
@@ -59,7 +60,8 @@
import static android.provider.SearchIndexablesContract.INDEXABLES_RAW_COLUMNS;
import static android.provider.SearchIndexablesContract.INDEXABLES_XML_RES_COLUMNS;
import static android.provider.SearchIndexablesContract.NON_INDEXABLES_KEYS_COLUMNS;
-import static org.lineageos.internal.lineageparts.PartsList.LINEAGEPARTS_ACTIVITY;
+
+import static lineageos.preference.PartsList.LINEAGEPARTS_ACTIVITY;
/**
* Provides search metadata to the Settings app