Use new settings preference theme in sysui tuner
- Also removed deprecated activity manifest entry for tuneractivity
Change-Id: Id3a8d25cd9e2bf18c999e273714a2b82fd14ffe8
Fix: 36663882
Test: visual
diff --git a/packages/SystemUI/AndroidManifest.xml b/packages/SystemUI/AndroidManifest.xml
index b14a17e..edd0d0d 100644
--- a/packages/SystemUI/AndroidManifest.xml
+++ b/packages/SystemUI/AndroidManifest.xml
@@ -271,21 +271,9 @@
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<meta-data android:name="com.android.settings.category"
- android:value="com.android.settings.category.system" />
+ android:value="com.android.settings.category.ia.system" />
</activity>
- <activity-alias android:name=".tuner.TunerSettingLink"
- android:targetActivity=".tuner.TunerActivity"
- android:enabled="false"
- android:process=":tuner">
- <intent-filter android:priority="1">
- <action android:name="com.android.settings.action.EXTRA_SETTINGS" />
- <category android:name="android.intent.category.DEFAULT" />
- </intent-filter>
- <meta-data android:name="com.android.settings.category"
- android:value="com.android.settings.category.ia.system" />
- </activity-alias>
-
<activity-alias android:name=".DemoMode"
android:targetActivity=".tuner.TunerActivity"
android:icon="@drawable/tuner"
diff --git a/packages/SystemUI/res/layout/preference_widget_switch.xml b/packages/SystemUI/res/layout/preference_widget_switch.xml
deleted file mode 100644
index 49610de..0000000
--- a/packages/SystemUI/res/layout/preference_widget_switch.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2015 The Android Open Source 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.
--->
-
-<LinearLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_height="wrap_content"
- android:layout_width="wrap_content">
-
- <RadioButton
- android:id="@+id/radio_button"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:clickable="false"
- android:focusable="false"
- android:layout_marginEnd="4dp" />
-
- <View
- android:layout_width="1dp"
- android:layout_height="match_parent"
- android:background="?android:attr/listDivider" />
-
- <Switch
- android:id="@*android:id/switch_widget"
- android:layout_width="50dp"
- android:layout_height="wrap_content"
- android:focusable="false"
- android:clickable="false"
- android:background="@null" />
-
-</LinearLayout>
diff --git a/packages/SystemUI/res/values/styles.xml b/packages/SystemUI/res/values/styles.xml
index e375a21..e9dd7e6 100644
--- a/packages/SystemUI/res/values/styles.xml
+++ b/packages/SystemUI/res/values/styles.xml
@@ -435,8 +435,7 @@
<item name="preferenceTheme">@style/TunerPreferenceTheme</item>
</style>
- <style name="TunerPreferenceTheme" parent="@android:style/Theme.DeviceDefault.Settings">
- <item name="dropdownPreferenceStyle">@style/Preference.DropDown.Material</item>
+ <style name="TunerPreferenceTheme" parent="@style/PreferenceThemeOverlay.SettingsBase">
</style>
<style name="TextAppearance.NotificationInfo">
diff --git a/packages/SystemUI/src/com/android/systemui/tuner/TunerActivity.java b/packages/SystemUI/src/com/android/systemui/tuner/TunerActivity.java
index 9c69b98..474a9a4 100644
--- a/packages/SystemUI/src/com/android/systemui/tuner/TunerActivity.java
+++ b/packages/SystemUI/src/com/android/systemui/tuner/TunerActivity.java
@@ -33,8 +33,6 @@
PreferenceFragment.OnPreferenceStartFragmentCallback,
PreferenceFragment.OnPreferenceStartScreenCallback {
- static final String ACTIVITY_ALIAS_NAME = "com.android.systemui.tuner.TunerSettingLink";
-
private static final String TAG_TUNER = "tuner";
protected void onCreate(Bundle savedInstanceState) {
diff --git a/packages/SystemUI/src/com/android/systemui/tuner/TunerService.java b/packages/SystemUI/src/com/android/systemui/tuner/TunerService.java
index 369ce69..3a9d1c7 100644
--- a/packages/SystemUI/src/com/android/systemui/tuner/TunerService.java
+++ b/packages/SystemUI/src/com/android/systemui/tuner/TunerService.java
@@ -68,12 +68,6 @@
enabled ? PackageManager.COMPONENT_ENABLED_STATE_ENABLED
: PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
PackageManager.DONT_KILL_APP);
-
- userContext(context).getPackageManager().setComponentEnabledSetting(
- new ComponentName(context, TunerActivity.ACTIVITY_ALIAS_NAME),
- enabled ? PackageManager.COMPONENT_ENABLED_STATE_ENABLED
- : PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
- PackageManager.DONT_KILL_APP);
}
public static final boolean isTunerEnabled(Context context) {