Merge change 22611 into eclair

* changes:
  Hide the "Enable Assisted GPS" checkbox in security & location settings.
diff --git a/res/xml/security_settings.xml b/res/xml/security_settings.xml
index 5b90dba..1322eaf 100644
--- a/res/xml/security_settings.xml
+++ b/res/xml/security_settings.xml
@@ -32,12 +32,14 @@
             android:summaryOn="@string/location_street_level"
             android:summaryOff="@string/location_gps_disabled"/>
 
+<!-- Disabled to avoid confusion on devices with no AGPS
+     For Google experience devices we want AGPS on by default (if supported) so we don't really need this.
         <CheckBoxPreference
             android:key="assisted_gps"
             android:title="@string/assisted_gps"
             android:summaryOn="@string/assisted_gps_enabled"
             android:summaryOff="@string/assisted_gps_disabled"/>
-
+-->
         <CheckBoxPreference
             android:key="use_location"
             android:title="@string/use_location_title"
diff --git a/src/com/android/settings/SecuritySettings.java b/src/com/android/settings/SecuritySettings.java
index e181e6e..c8933dc 100644
--- a/src/com/android/settings/SecuritySettings.java
+++ b/src/com/android/settings/SecuritySettings.java
@@ -305,7 +305,9 @@
             boolean enabled = mGps.isChecked();
             Settings.Secure.setLocationProviderEnabled(getContentResolver(),
                     LocationManager.GPS_PROVIDER, enabled);
-            mAssistedGps.setEnabled(enabled);
+            if (mAssistedGps != null) {
+                mAssistedGps.setEnabled(enabled);
+            }
         } else if (preference == mAssistedGps) {
             Settings.Secure.putInt(getContentResolver(), Settings.Secure.ASSISTED_GPS_ENABLED,
                     mAssistedGps.isChecked() ? 1 : 0);
@@ -355,9 +357,11 @@
         mNetwork.setChecked(Settings.Secure.isLocationProviderEnabled(
                 res, LocationManager.NETWORK_PROVIDER));
         mGps.setChecked(gpsEnabled);
-        mAssistedGps.setChecked(Settings.Secure.getInt(res,
-                Settings.Secure.ASSISTED_GPS_ENABLED, 2) == 1);
-        mAssistedGps.setEnabled(gpsEnabled);
+        if (mAssistedGps != null) {
+            mAssistedGps.setChecked(Settings.Secure.getInt(res,
+                    Settings.Secure.ASSISTED_GPS_ENABLED, 2) == 1);
+            mAssistedGps.setEnabled(gpsEnabled);
+        }
         mUseLocation.setChecked(Settings.Secure.getInt(res,
                 Settings.Secure.USE_LOCATION_FOR_SERVICES, 2) == 1);
     }