AI 144395: am: CL 144257 am: CL 144256 Need to show opt-in screen for location collection.
  Added a screen to the setup wizard, after login, to ask user to
  opt-in for location collection.
  Added a dialog to Settings when user turns on Network location.
  Fixed a security permission issue in LocationManagerService related
  to this change.
  Original author: yamasani
  Merged from: //branches/cupcake/...
  Original author: android-build

Automated import of CL 144395
diff --git a/services/java/com/android/server/LocationManagerService.java b/services/java/com/android/server/LocationManagerService.java
index 630c84b..edee5f8 100644
--- a/services/java/com/android/server/LocationManagerService.java
+++ b/services/java/com/android/server/LocationManagerService.java
@@ -2059,6 +2059,8 @@
     private void updateWakelockStatusLocked(boolean screenOn) {
         log("updateWakelockStatus(): " + screenOn);
 
+        long callerId = Binder.clearCallingIdentity();
+        
         boolean needsLock = false;
         long minTime = Integer.MAX_VALUE;
 
@@ -2102,6 +2104,7 @@
             mLocationHandler.removeMessages(MESSAGE_RELEASE_WAKE_LOCK);
             releaseWakeLockLocked();
         }
+        Binder.restoreCallingIdentity(callerId);
     }
 
     private void acquireWakeLockLocked() {