Stop using framework-private switch asset

BUG: 16467249
Change-Id: I0829c3dea522cf59e0f92046ea7c6092d416ad4c
diff --git a/res/drawable/switch_inner.xml b/res/drawable/switch_inner.xml
deleted file mode 100644
index c6d39ef..0000000
--- a/res/drawable/switch_inner.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2014 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.
--->
-
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:state_enabled="false" android:state_checked="true">
-        <bitmap android:src="@*android:drawable/btn_switch_to_off_mtrl_000"
-                    android:tint="?android:attr/colorControlNormal"
-                    android:alpha="?android:attr/disabledAlpha" />
-    </item>
-    <item android:state_enabled="false">
-        <bitmap android:src="@*android:drawable/btn_switch_to_on_mtrl_000"
-                    android:tint="?android:attr/colorControlNormal"
-                    android:alpha="?android:attr/disabledAlpha" />
-    </item>
-    <item android:state_checked="true">
-        <bitmap android:src="@*android:drawable/btn_switch_to_off_mtrl_000"
-                    android:tint="@color/switch_accent_color" />
-    </item>
-    <item>
-        <bitmap android:src="@*android:drawable/btn_switch_to_on_mtrl_000"
-                    android:tint="?android:attr/colorControlNormal" />
-    </item>
-</selector>
-
diff --git a/res/drawable/switch_track.xml b/res/drawable/switch_track.xml
deleted file mode 100644
index 2655da0..0000000
--- a/res/drawable/switch_track.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2014 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.
--->
-
-<selector xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:state_checked="true">
-        <nine-patch android:src="@*android:drawable/switch_track_mtrl_alpha"
-                    android:tint="@color/switch_accent_color" />
-    </item>
-    <item>
-        <nine-patch android:src="@*android:drawable/switch_track_mtrl_alpha"
-                    android:tint="?android:attr/colorControlNormal" />
-    </item>
-</selector>
diff --git a/res/layout/switch_bar.xml b/res/layout/switch_bar.xml
index 6b37e4c..5dbeb55 100644
--- a/res/layout/switch_bar.xml
+++ b/res/layout/switch_bar.xml
@@ -31,7 +31,8 @@
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_gravity="center_vertical"
-            android:background="@null" />
+            android:background="@null"
+            android:theme="@style/ThemeOverlay.SwitchBar" />
 
 </merge>
 
diff --git a/res/values/themes.xml b/res/values/themes.xml
index d54819d..898274f 100644
--- a/res/values/themes.xml
+++ b/res/values/themes.xml
@@ -204,4 +204,10 @@
         <item name="@android:numbersBackgroundColor">@android:color/white</item>
     </style>
 
+    <!-- Used to color the switch bar controls -->
+    <style name="ThemeOverlay.SwitchBar" parent="@android:style/ThemeOverlay">
+        <!-- Used by controls, e.g. CheckBox, ProgressBar, etc. -->
+        <item name="android:colorAccent">@color/switch_accent_color</item>
+    </style>
+
 </resources>
diff --git a/src/com/android/settings/widget/SwitchBar.java b/src/com/android/settings/widget/SwitchBar.java
index d974a9d..e24d83f 100644
--- a/src/com/android/settings/widget/SwitchBar.java
+++ b/src/com/android/settings/widget/SwitchBar.java
@@ -97,9 +97,6 @@
             }
         });
 
-        mSwitch.setTrackResource(R.drawable.switch_track);
-        mSwitch.setThumbResource(R.drawable.switch_inner);
-
         setOnClickListener(this);
 
         // Default is hide