Move files internal to LocationManagerService from framework.jar to services.jar
Change-Id: Iebbfc49b8300ab59730733efdf489ec87ea45a25 Signed-off-by: Mike Lockwood <lockwood@android.com>
This commit is contained in:
@ -121,7 +121,6 @@ LOCAL_SRC_FILES:= \
|
||||
android_server_BluetoothA2dpService.cpp \
|
||||
android_message_digest_sha1.cpp \
|
||||
android_ddm_DdmHandleNativeHeap.cpp \
|
||||
android_location_GpsLocationProvider.cpp \
|
||||
com_android_internal_os_ZygoteInit.cpp \
|
||||
com_android_internal_graphics_NativeUtils.cpp \
|
||||
android_backup_BackupDataInput.cpp \
|
||||
|
@ -154,7 +154,6 @@ extern int register_android_server_BluetoothEventLoop(JNIEnv *env);
|
||||
extern int register_android_server_BluetoothA2dpService(JNIEnv* env);
|
||||
extern int register_android_ddm_DdmHandleNativeHeap(JNIEnv *env);
|
||||
extern int register_com_android_internal_os_ZygoteInit(JNIEnv* env);
|
||||
extern int register_android_location_GpsLocationProvider(JNIEnv* env);
|
||||
extern int register_android_backup_BackupDataInput(JNIEnv *env);
|
||||
extern int register_android_backup_BackupDataOutput(JNIEnv *env);
|
||||
extern int register_android_backup_FileBackupHelperBase(JNIEnv *env);
|
||||
@ -1267,7 +1266,6 @@ static const RegJNIRec gRegJNI[] = {
|
||||
REG_JNI(register_android_server_BluetoothA2dpService),
|
||||
REG_JNI(register_android_message_digest_sha1),
|
||||
REG_JNI(register_android_ddm_DdmHandleNativeHeap),
|
||||
REG_JNI(register_android_location_GpsLocationProvider),
|
||||
REG_JNI(register_android_backup_BackupDataInput),
|
||||
REG_JNI(register_android_backup_BackupDataOutput),
|
||||
REG_JNI(register_android_backup_FileBackupHelperBase),
|
||||
|
@ -117,6 +117,37 @@ public class LocationManager {
|
||||
*/
|
||||
public static final String KEY_LOCATION_CHANGED = "location";
|
||||
|
||||
/**
|
||||
* Broadcast intent action indicating that the GPS has either been
|
||||
* enabled or disabled. An intent extra provides this state as a boolean,
|
||||
* where {@code true} means enabled.
|
||||
* @see #EXTRA_GPS_ENABLED
|
||||
*
|
||||
* {@hide}
|
||||
*/
|
||||
public static final String GPS_ENABLED_CHANGE_ACTION =
|
||||
"android.location.GPS_ENABLED_CHANGE";
|
||||
|
||||
/**
|
||||
* Broadcast intent action indicating that the GPS has either started or
|
||||
* stopped receiving GPS fixes. An intent extra provides this state as a
|
||||
* boolean, where {@code true} means that the GPS is actively receiving fixes.
|
||||
* @see #EXTRA_GPS_ENABLED
|
||||
*
|
||||
* {@hide}
|
||||
*/
|
||||
public static final String GPS_FIX_CHANGE_ACTION =
|
||||
"android.location.GPS_FIX_CHANGE";
|
||||
|
||||
/**
|
||||
* The lookup key for a boolean that indicates whether GPS is enabled or
|
||||
* disabled. {@code true} means GPS is enabled. Retrieve it with
|
||||
* {@link android.content.Intent#getBooleanExtra(String,boolean)}.
|
||||
*
|
||||
* {@hide}
|
||||
*/
|
||||
public static final String EXTRA_GPS_ENABLED = "enabled";
|
||||
|
||||
// Map from LocationListeners to their associated ListenerTransport objects
|
||||
private HashMap<LocationListener,ListenerTransport> mListeners =
|
||||
new HashMap<LocationListener,ListenerTransport>();
|
||||
|
@ -94,18 +94,18 @@ public class GpsNetInitiatedHandler {
|
||||
|
||||
public static class GpsNiNotification
|
||||
{
|
||||
int notificationId;
|
||||
int niType;
|
||||
boolean needNotify;
|
||||
boolean needVerify;
|
||||
boolean privacyOverride;
|
||||
int timeout;
|
||||
int defaultResponse;
|
||||
String requestorId;
|
||||
String text;
|
||||
int requestorIdEncoding;
|
||||
int textEncoding;
|
||||
Bundle extras;
|
||||
public int notificationId;
|
||||
public int niType;
|
||||
public boolean needNotify;
|
||||
public boolean needVerify;
|
||||
public boolean privacyOverride;
|
||||
public int timeout;
|
||||
public int defaultResponse;
|
||||
public String requestorId;
|
||||
public String text;
|
||||
public int requestorIdEncoding;
|
||||
public int textEncoding;
|
||||
public Bundle extras;
|
||||
};
|
||||
|
||||
public static class GpsNiResponse {
|
||||
|
@ -269,7 +269,6 @@ android.location.ILocationManager$Stub
|
||||
android.location.ILocationManager$Stub$Proxy
|
||||
android.location.Location
|
||||
android.location.LocationManager
|
||||
android.location.LocationProviderInterface
|
||||
android.media.AudioFormat
|
||||
android.media.AudioManager
|
||||
android.media.AudioRecord
|
||||
@ -633,7 +632,6 @@ com.android.internal.appwidget.IAppWidgetService$Stub
|
||||
com.android.internal.content.SyncStateContentProviderHelper
|
||||
com.android.internal.graphics.NativeUtils
|
||||
com.android.internal.location.DummyLocationProvider
|
||||
com.android.internal.location.GpsLocationProvider
|
||||
com.android.internal.logging.AndroidHandler
|
||||
com.android.internal.os.AndroidPrintStream
|
||||
com.android.internal.os.BinderInternal
|
||||
|
@ -16,17 +16,6 @@
|
||||
|
||||
package com.android.server;
|
||||
|
||||
import java.io.FileDescriptor;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Observable;
|
||||
import java.util.Observer;
|
||||
import java.util.Set;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.BroadcastReceiver;
|
||||
@ -50,7 +39,6 @@ import android.location.INetInitiatedListener;
|
||||
import android.location.Location;
|
||||
import android.location.LocationManager;
|
||||
import android.location.LocationProvider;
|
||||
import android.location.LocationProviderInterface;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.net.NetworkInfo;
|
||||
import android.net.Uri;
|
||||
@ -68,12 +56,25 @@ import android.util.Log;
|
||||
import android.util.Slog;
|
||||
import android.util.PrintWriterPrinter;
|
||||
|
||||
import com.android.internal.location.GeocoderProxy;
|
||||
import com.android.internal.location.GpsLocationProvider;
|
||||
import com.android.internal.location.GpsNetInitiatedHandler;
|
||||
import com.android.internal.location.LocationProviderProxy;
|
||||
import com.android.internal.location.MockProvider;
|
||||
import com.android.internal.location.PassiveProvider;
|
||||
|
||||
import com.android.server.location.GeocoderProxy;
|
||||
import com.android.server.location.GpsLocationProvider;
|
||||
import com.android.server.location.LocationProviderInterface;
|
||||
import com.android.server.location.LocationProviderProxy;
|
||||
import com.android.server.location.MockProvider;
|
||||
import com.android.server.location.PassiveProvider;
|
||||
|
||||
import java.io.FileDescriptor;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Observable;
|
||||
import java.util.Observer;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* The service class that manages LocationProviders and issues location
|
||||
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.internal.location;
|
||||
package com.android.server.location;
|
||||
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.internal.location;
|
||||
package com.android.server.location;
|
||||
|
||||
import android.app.AlarmManager;
|
||||
import android.app.PendingIntent;
|
||||
@ -30,7 +30,6 @@ import android.location.INetInitiatedListener;
|
||||
import android.location.Location;
|
||||
import android.location.LocationManager;
|
||||
import android.location.LocationProvider;
|
||||
import android.location.LocationProviderInterface;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.net.NetworkInfo;
|
||||
import android.net.SntpClient;
|
||||
@ -77,37 +76,6 @@ public class GpsLocationProvider implements LocationProviderInterface {
|
||||
private static final boolean DEBUG = false;
|
||||
private static final boolean VERBOSE = false;
|
||||
|
||||
/**
|
||||
* Broadcast intent action indicating that the GPS has either been
|
||||
* enabled or disabled. An intent extra provides this state as a boolean,
|
||||
* where {@code true} means enabled.
|
||||
* @see #EXTRA_ENABLED
|
||||
*
|
||||
* {@hide}
|
||||
*/
|
||||
public static final String GPS_ENABLED_CHANGE_ACTION =
|
||||
"android.location.GPS_ENABLED_CHANGE";
|
||||
|
||||
/**
|
||||
* Broadcast intent action indicating that the GPS has either started or
|
||||
* stopped receiving GPS fixes. An intent extra provides this state as a
|
||||
* boolean, where {@code true} means that the GPS is actively receiving fixes.
|
||||
* @see #EXTRA_ENABLED
|
||||
*
|
||||
* {@hide}
|
||||
*/
|
||||
public static final String GPS_FIX_CHANGE_ACTION =
|
||||
"android.location.GPS_FIX_CHANGE";
|
||||
|
||||
/**
|
||||
* The lookup key for a boolean that indicates whether GPS is enabled or
|
||||
* disabled. {@code true} means GPS is enabled. Retrieve it with
|
||||
* {@link android.content.Intent#getBooleanExtra(String,boolean)}.
|
||||
*
|
||||
* {@hide}
|
||||
*/
|
||||
public static final String EXTRA_ENABLED = "enabled";
|
||||
|
||||
// these need to match GpsPositionMode enum in gps.h
|
||||
private static final int GPS_POSITION_MODE_STANDALONE = 0;
|
||||
private static final int GPS_POSITION_MODE_MS_BASED = 1;
|
||||
@ -1031,8 +999,8 @@ public class GpsLocationProvider implements LocationProviderInterface {
|
||||
}
|
||||
|
||||
// send an intent to notify that the GPS is receiving fixes.
|
||||
Intent intent = new Intent(GPS_FIX_CHANGE_ACTION);
|
||||
intent.putExtra(EXTRA_ENABLED, true);
|
||||
Intent intent = new Intent(LocationManager.GPS_FIX_CHANGE_ACTION);
|
||||
intent.putExtra(LocationManager.EXTRA_GPS_ENABLED, true);
|
||||
mContext.sendBroadcast(intent);
|
||||
updateStatus(LocationProvider.AVAILABLE, mSvCount);
|
||||
}
|
||||
@ -1108,8 +1076,8 @@ public class GpsLocationProvider implements LocationProviderInterface {
|
||||
}
|
||||
|
||||
// send an intent to notify that the GPS has been enabled or disabled.
|
||||
Intent intent = new Intent(GPS_ENABLED_CHANGE_ACTION);
|
||||
intent.putExtra(EXTRA_ENABLED, mNavigating);
|
||||
Intent intent = new Intent(LocationManager.GPS_ENABLED_CHANGE_ACTION);
|
||||
intent.putExtra(LocationManager.EXTRA_GPS_ENABLED, mNavigating);
|
||||
mContext.sendBroadcast(intent);
|
||||
}
|
||||
|
||||
@ -1165,8 +1133,8 @@ public class GpsLocationProvider implements LocationProviderInterface {
|
||||
if (mNavigating && mStatus == LocationProvider.AVAILABLE && mLastFixTime > 0 &&
|
||||
System.currentTimeMillis() - mLastFixTime > RECENT_FIX_TIMEOUT * 1000) {
|
||||
// send an intent to notify that the GPS is no longer receiving fixes.
|
||||
Intent intent = new Intent(GPS_FIX_CHANGE_ACTION);
|
||||
intent.putExtra(EXTRA_ENABLED, false);
|
||||
Intent intent = new Intent(LocationManager.GPS_FIX_CHANGE_ACTION);
|
||||
intent.putExtra(LocationManager.EXTRA_GPS_ENABLED, false);
|
||||
mContext.sendBroadcast(intent);
|
||||
updateStatus(LocationProvider.TEMPORARILY_UNAVAILABLE, mSvCount);
|
||||
}
|
@ -14,7 +14,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.internal.location;
|
||||
package com.android.server.location;
|
||||
|
||||
import android.content.Context;
|
||||
import android.net.Proxy;
|
||||
import android.net.http.AndroidHttpClient;
|
||||
import android.util.Config;
|
||||
import android.util.Log;
|
||||
|
||||
import org.apache.http.HttpEntity;
|
||||
import org.apache.http.HttpHost;
|
||||
@ -30,14 +36,6 @@ import java.io.IOException;
|
||||
import java.util.Properties;
|
||||
import java.util.Random;
|
||||
|
||||
import android.content.Context;
|
||||
import android.net.Proxy;
|
||||
import android.net.http.AndroidHttpClient;
|
||||
import android.util.Config;
|
||||
import android.util.Log;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* A class for downloading GPS XTRA data.
|
||||
*
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.location;
|
||||
package com.android.server.location;
|
||||
|
||||
import android.location.Location;
|
||||
import android.net.NetworkInfo;
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.internal.location;
|
||||
package com.android.server.location;
|
||||
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
@ -22,7 +22,6 @@ import android.content.Intent;
|
||||
import android.content.ServiceConnection;
|
||||
import android.location.ILocationProvider;
|
||||
import android.location.Location;
|
||||
import android.location.LocationProviderInterface;
|
||||
import android.net.NetworkInfo;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
@ -31,6 +30,8 @@ import android.os.RemoteException;
|
||||
import android.os.SystemClock;
|
||||
import android.util.Log;
|
||||
|
||||
import com.android.internal.location.DummyLocationProvider;
|
||||
|
||||
/**
|
||||
* A class for proxying location providers implemented as services.
|
||||
*
|
@ -14,12 +14,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.internal.location;
|
||||
package com.android.server.location;
|
||||
|
||||
import android.location.ILocationManager;
|
||||
import android.location.Location;
|
||||
import android.location.LocationProvider;
|
||||
import android.location.LocationProviderInterface;
|
||||
import android.net.NetworkInfo;
|
||||
import android.os.Bundle;
|
||||
import android.os.RemoteException;
|
@ -14,13 +14,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.internal.location;
|
||||
package com.android.server.location;
|
||||
|
||||
import android.location.ILocationManager;
|
||||
import android.location.Location;
|
||||
import android.location.LocationManager;
|
||||
import android.location.LocationProvider;
|
||||
import android.location.LocationProviderInterface;
|
||||
import android.net.NetworkInfo;
|
||||
import android.os.Bundle;
|
||||
import android.os.RemoteException;
|
@ -30,6 +30,7 @@ import android.content.IntentFilter;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.PixelFormat;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.location.LocationManager;
|
||||
import android.media.AudioManager;
|
||||
import android.media.Ringtone;
|
||||
import android.media.RingtoneManager;
|
||||
@ -62,7 +63,6 @@ import android.widget.TextView;
|
||||
|
||||
import com.android.internal.R;
|
||||
import com.android.internal.app.IBatteryStats;
|
||||
import com.android.internal.location.GpsLocationProvider;
|
||||
import com.android.internal.telephony.IccCard;
|
||||
import com.android.internal.telephony.TelephonyIntents;
|
||||
import com.android.internal.telephony.cdma.EriInfo;
|
||||
@ -387,8 +387,8 @@ public class StatusBarPolicy {
|
||||
action.equals(WifiManager.RSSI_CHANGED_ACTION)) {
|
||||
updateWifi(intent);
|
||||
}
|
||||
else if (action.equals(GpsLocationProvider.GPS_ENABLED_CHANGE_ACTION) ||
|
||||
action.equals(GpsLocationProvider.GPS_FIX_CHANGE_ACTION)) {
|
||||
else if (action.equals(LocationManager.GPS_ENABLED_CHANGE_ACTION) ||
|
||||
action.equals(LocationManager.GPS_FIX_CHANGE_ACTION)) {
|
||||
updateGps(intent);
|
||||
}
|
||||
else if (action.equals(AudioManager.RINGER_MODE_CHANGED_ACTION) ||
|
||||
@ -533,8 +533,8 @@ public class StatusBarPolicy {
|
||||
filter.addAction(WifiManager.SUPPLICANT_CONNECTION_CHANGE_ACTION);
|
||||
filter.addAction(WifiManager.NETWORK_STATE_CHANGED_ACTION);
|
||||
filter.addAction(WifiManager.RSSI_CHANGED_ACTION);
|
||||
filter.addAction(GpsLocationProvider.GPS_ENABLED_CHANGE_ACTION);
|
||||
filter.addAction(GpsLocationProvider.GPS_FIX_CHANGE_ACTION);
|
||||
filter.addAction(LocationManager.GPS_ENABLED_CHANGE_ACTION);
|
||||
filter.addAction(LocationManager.GPS_FIX_CHANGE_ACTION);
|
||||
filter.addAction(TelephonyIntents.ACTION_SIM_STATE_CHANGED);
|
||||
filter.addAction(TtyIntent.TTY_ENABLED_CHANGE_ACTION);
|
||||
mContext.registerReceiver(mIntentReceiver, filter, null, mHandler);
|
||||
@ -1286,13 +1286,13 @@ public class StatusBarPolicy {
|
||||
|
||||
private final void updateGps(Intent intent) {
|
||||
final String action = intent.getAction();
|
||||
final boolean enabled = intent.getBooleanExtra(GpsLocationProvider.EXTRA_ENABLED, false);
|
||||
final boolean enabled = intent.getBooleanExtra(LocationManager.EXTRA_GPS_ENABLED, false);
|
||||
|
||||
if (action.equals(GpsLocationProvider.GPS_FIX_CHANGE_ACTION) && enabled) {
|
||||
if (action.equals(LocationManager.GPS_FIX_CHANGE_ACTION) && enabled) {
|
||||
// GPS is getting fixes
|
||||
mService.updateIcon(mGpsIcon, mGpsFixIconData, null);
|
||||
mService.setIconVisibility(mGpsIcon, true);
|
||||
} else if (action.equals(GpsLocationProvider.GPS_ENABLED_CHANGE_ACTION) && !enabled) {
|
||||
} else if (action.equals(LocationManager.GPS_ENABLED_CHANGE_ACTION) && !enabled) {
|
||||
// GPS is off
|
||||
mService.setIconVisibility(mGpsIcon, false);
|
||||
} else {
|
||||
|
@ -9,6 +9,7 @@ LOCAL_SRC_FILES:= \
|
||||
com_android_server_SensorService.cpp \
|
||||
com_android_server_SystemServer.cpp \
|
||||
com_android_server_VibratorService.cpp \
|
||||
com_android_server_location_GpsLocationProvider.cpp \
|
||||
onload.cpp
|
||||
|
||||
LOCAL_C_INCLUDES += \
|
||||
|
@ -523,9 +523,9 @@ static JNINativeMethod sMethods[] = {
|
||||
{"native_get_internal_state", "()Ljava/lang/String;", (void*)android_location_GpsLocationProvider_get_internal_state},
|
||||
};
|
||||
|
||||
int register_android_location_GpsLocationProvider(JNIEnv* env)
|
||||
int register_android_server_location_GpsLocationProvider(JNIEnv* env)
|
||||
{
|
||||
return jniRegisterNativeMethods(env, "com/android/internal/location/GpsLocationProvider", sMethods, NELEM(sMethods));
|
||||
return jniRegisterNativeMethods(env, "com/android/server/location/GpsLocationProvider", sMethods, NELEM(sMethods));
|
||||
}
|
||||
|
||||
} /* namespace android */
|
@ -11,6 +11,7 @@ int register_android_server_LightsService(JNIEnv* env);
|
||||
int register_android_server_SensorService(JNIEnv* env);
|
||||
int register_android_server_VibratorService(JNIEnv* env);
|
||||
int register_android_server_SystemServer(JNIEnv* env);
|
||||
int register_android_server_location_GpsLocationProvider(JNIEnv* env);
|
||||
};
|
||||
|
||||
using namespace android;
|
||||
@ -33,6 +34,7 @@ extern "C" jint JNI_OnLoad(JavaVM* vm, void* reserved)
|
||||
register_android_server_SensorService(env);
|
||||
register_android_server_VibratorService(env);
|
||||
register_android_server_SystemServer(env);
|
||||
register_android_server_location_GpsLocationProvider(env);
|
||||
|
||||
return JNI_VERSION_1_4;
|
||||
}
|
||||
|
Reference in New Issue
Block a user