1
我想更好地瞭解GPS在Android中的工作方式,並且希望包含一些跟蹤來跟蹤它並修改其行爲。在GpsLocationProvider.java我找到了方法:Android中的GPS
private native boolean native_init();
private native void native_disable();
private native void native_cleanup();
private native boolean native_start(int positionMode, boolean singleFix, int fixInterval);
private native boolean native_stop();
private native void native_set_fix_frequency(int fixFrequency);
private native void native_delete_aiding_data(int flags);
private native void native_wait_for_event();
// returns number of SVs
// mask[0] is ephemeris mask and mask[1] is almanac mask
private native int native_read_sv_status(int[] svs, float[] snrs,
float[] elevations, float[] azimuths, int[] masks);
private native int native_read_nmea(int index, byte[] buffer, int bufferSize);
private native void native_inject_location(double latitude, double longitude, float accuracy);
// XTRA Support
private native void native_inject_time(long time, long timeReference, int uncertainty);
private native boolean native_supports_xtra();
private native boolean native_inject_xtra_data(byte[] data, int length);
// DEBUG Support
private native String native_get_internal_state();
// AGPS Support
private native void native_agps_data_conn_open(String apn);
private native void native_agps_data_conn_closed();
private native void native_agps_data_conn_failed();
private native void native_set_agps_server(int type, String hostname, int port);
// Network-initiated (NI) Support
private native void native_send_ni_response(int notificationId, int userResponse);
不過,我想看看他們具體做什麼。他們在哪裏實施?我已經找到了GPS的高質量驅動程序,但我猜想在抽象出硬件問題(HAL層?)之間存在缺失層。
非常感謝