clear calling identity in GpsLocationProvider.sendExtraCommand().
This fixes problems with wakelock permissions introduced in an earlier change. Change-Id: If0f4761ac27525d1eece0613c96be62f9e370a14 Signed-off-by: Mike Lockwood <lockwood@android.com>
This commit is contained in:
@ -33,6 +33,7 @@ import android.location.LocationProvider;
|
|||||||
import android.net.ConnectivityManager;
|
import android.net.ConnectivityManager;
|
||||||
import android.net.NetworkInfo;
|
import android.net.NetworkInfo;
|
||||||
import android.net.SntpClient;
|
import android.net.SntpClient;
|
||||||
|
import android.os.Binder;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
@ -839,23 +840,25 @@ public class GpsLocationProvider implements LocationProviderInterface {
|
|||||||
|
|
||||||
public boolean sendExtraCommand(String command, Bundle extras) {
|
public boolean sendExtraCommand(String command, Bundle extras) {
|
||||||
|
|
||||||
|
long identity = Binder.clearCallingIdentity();
|
||||||
|
boolean result = false;
|
||||||
|
|
||||||
if ("delete_aiding_data".equals(command)) {
|
if ("delete_aiding_data".equals(command)) {
|
||||||
return deleteAidingData(extras);
|
result = deleteAidingData(extras);
|
||||||
}
|
} else if ("force_time_injection".equals(command)) {
|
||||||
if ("force_time_injection".equals(command)) {
|
|
||||||
sendMessage(INJECT_NTP_TIME, 0, null);
|
sendMessage(INJECT_NTP_TIME, 0, null);
|
||||||
return true;
|
result = true;
|
||||||
}
|
} else if ("force_xtra_injection".equals(command)) {
|
||||||
if ("force_xtra_injection".equals(command)) {
|
|
||||||
if (native_supports_xtra()) {
|
if (native_supports_xtra()) {
|
||||||
xtraDownloadRequest();
|
xtraDownloadRequest();
|
||||||
return true;
|
result = true;
|
||||||
}
|
}
|
||||||
return false;
|
} else {
|
||||||
|
Log.w(TAG, "sendExtraCommand: unknown command " + command);
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.w(TAG, "sendExtraCommand: unknown command " + command);
|
Binder.restoreCallingIdentity(identity);
|
||||||
return false;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean deleteAidingData(Bundle extras) {
|
private boolean deleteAidingData(Bundle extras) {
|
||||||
|
Reference in New Issue
Block a user