Fixes & updates to preference support lib

a) Make PreferenceManager.getContext() public, so that callers
   that instantiate Preference instances manually can pass the
   right context
b) Use the internal android id for the widget frame, since
   otherwise, callers that specify a custom preference layout
   will have no way of referencing the right widget_frame id
   in their layout XML

b/22043727
b/22045650
b/22044940

Change-Id: Ib4919e8da01b27bd9c76fcde554d60ab311d7444
diff --git a/v7/preference/api/current.txt b/v7/preference/api/current.txt
index a432b43..3ccae31 100644
--- a/v7/preference/api/current.txt
+++ b/v7/preference/api/current.txt
@@ -243,6 +243,7 @@
   public class PreferenceManager {
     method public android.support.v7.preference.PreferenceScreen createPreferenceScreen(android.content.Context);
     method public android.support.v7.preference.Preference findPreference(java.lang.CharSequence);
+    method public android.content.Context getContext();
     method public static android.content.SharedPreferences getDefaultSharedPreferences(android.content.Context);
     method public android.support.v7.preference.PreferenceManager.OnDisplayPreferenceDialogListener getOnDisplayPreferenceDialogListener();
     method public android.support.v7.preference.PreferenceManager.OnNavigateToScreenListener getOnNavigateToScreenListener();
diff --git a/v7/preference/res/layout-v11/preference.xml b/v7/preference/res/layout-v11/preference.xml
index dbf6210..22ede16 100644
--- a/v7/preference/res/layout-v11/preference.xml
+++ b/v7/preference/res/layout-v11/preference.xml
@@ -66,7 +66,7 @@
     </RelativeLayout>
 
     <!-- Preference should place its actual preference widget here. -->
-    <LinearLayout android:id="@+id/widget_frame"
+    <LinearLayout android:id="@android:id/widget_frame"
         android:layout_width="wrap_content"
         android:layout_height="match_parent"
         android:gravity="center_vertical"
diff --git a/v7/preference/res/layout/preference.xml b/v7/preference/res/layout/preference.xml
index 9f610a3..f75bc68 100644
--- a/v7/preference/res/layout/preference.xml
+++ b/v7/preference/res/layout/preference.xml
@@ -66,7 +66,7 @@
     </RelativeLayout>
 
     <!-- Preference should place its actual preference widget here. -->
-    <LinearLayout android:id="@+id/widget_frame"
+    <LinearLayout android:id="@android:id/widget_frame"
         android:layout_width="wrap_content"
         android:layout_height="match_parent"
         android:gravity="center_vertical"
diff --git a/v7/preference/src/android/support/v7/preference/PreferenceGroupAdapter.java b/v7/preference/src/android/support/v7/preference/PreferenceGroupAdapter.java
index 5ba0f90..3820cb9 100644
--- a/v7/preference/src/android/support/v7/preference/PreferenceGroupAdapter.java
+++ b/v7/preference/src/android/support/v7/preference/PreferenceGroupAdapter.java
@@ -259,7 +259,7 @@
 
         final ViewGroup view = (ViewGroup) inflater.inflate(pl.resId, parent, false);
 
-        final ViewGroup widgetFrame = (ViewGroup) view.findViewById(R.id.widget_frame);
+        final ViewGroup widgetFrame = (ViewGroup) view.findViewById(android.R.id.widget_frame);
         if (widgetFrame != null) {
             if (pl.widgetResId != 0) {
                 inflater.inflate(pl.widgetResId, widgetFrame);
diff --git a/v7/preference/src/android/support/v7/preference/PreferenceManager.java b/v7/preference/src/android/support/v7/preference/PreferenceManager.java
index 7e8c5d1..1af8198 100644
--- a/v7/preference/src/android/support/v7/preference/PreferenceManager.java
+++ b/v7/preference/src/android/support/v7/preference/PreferenceManager.java
@@ -378,7 +378,7 @@
      *
      * @return The context.
      */
-    Context getContext() {
+    public Context getContext() {
         return mContext;
     }