Merge cherrypicks of [2467803, 2467786, 2467717, 2467598, 2467823, 2467734, 2467671, 2467718, 2467599, 2467753, 2467672, 2467600, 2467735, 2467841, 2467638, 2467824, 2467736, 2467754, 2467737, 2467674] into oc-release

Change-Id: If445beea9307efe739164791ba361a7fdbabcd64
diff --git a/apps/SdkSetup/Android.mk b/apps/SdkSetup/Android.mk
index 16a6e94..c8b11f6 100644
--- a/apps/SdkSetup/Android.mk
+++ b/apps/SdkSetup/Android.mk
@@ -10,7 +10,4 @@
 
 LOCAL_PROGUARD_ENABLED := disabled
 
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    gsf-client
-
 include $(BUILD_PACKAGE)
diff --git a/apps/SdkSetup/AndroidManifest.xml b/apps/SdkSetup/AndroidManifest.xml
index 4ead2d6..8f72684 100644
--- a/apps/SdkSetup/AndroidManifest.xml
+++ b/apps/SdkSetup/AndroidManifest.xml
@@ -18,7 +18,6 @@
         package="com.android.sdksetup">
 
     <!-- For miscellaneous settings -->
-    <uses-permission android:name="com.google.android.providers.settings.permission.WRITE_GSETTINGS" />
     <uses-permission android:name="android.permission.WRITE_SETTINGS" />
     <uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS" />
 
diff --git a/apps/SdkSetup/src/com/android/sdksetup/DefaultActivity.java b/apps/SdkSetup/src/com/android/sdksetup/DefaultActivity.java
index 101b3f6..505a353 100644
--- a/apps/SdkSetup/src/com/android/sdksetup/DefaultActivity.java
+++ b/apps/SdkSetup/src/com/android/sdksetup/DefaultActivity.java
@@ -25,9 +25,7 @@
 import android.os.Bundle;
 import android.os.RemoteException;
 import android.os.ServiceManager;
-import android.os.SystemProperties;
 import android.provider.Settings;
-import com.google.android.gsf.UseLocationForServices;
 
 /**
  * Entry point for SDK SetupWizard.
@@ -48,10 +46,6 @@
         // Not needed since this SDK will contain the Settings app.
         Settings.Secure.putString(getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED,
                 LocationManager.GPS_PROVIDER);
-        // Allow google apps to have access to (emulated) location services in emulator
-        if (SystemProperties.getBoolean("ro.kernel.qemu", false)) {
-            UseLocationForServices.forceSetUseLocationForServices(this, true);
-        }
 
         // enable install from non market
         Settings.Global.putInt(getContentResolver(), Settings.Global.INSTALL_NON_MARKET_APPS, 1);