Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b7142ec7 authored by ghepeu's avatar ghepeu Committed by Steve Kondik
Browse files

Add support for Samsung extended AGPS

The AGPS implementation in the GPS chipset used in some Samsung devices
(i9100, i9300) can make use of the Psc field. Adapt the relevant
functions hiding the changes incompatible with other devices under the
AGPS_USE_PSC #define.

Credit to Qaweck from xda-developers forum for finding the meaning
of the field.

This commit also squashes the following build fixes from CM 13:
88d7eb00 location: Fix building under 64bit
0e63b4d3 location: Fix incorrect unused argument workaround

Change-Id: Ie4691c79ca379a1f5c0a87500c1b06b56ae7ac0d
parent aea3fa79
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2030,7 +2030,7 @@ public class GnssLocationProvider implements LocationProviderInterface {
                    type = AGPS_REF_LOCATION_TYPE_GSM_CELLID;
                }
                native_agps_set_ref_location_cellid(type, mcc, mnc,
                        gsm_cell.getLac(), gsm_cell.getCid());
                        gsm_cell.getLac(), gsm_cell.getCid(), gsm_cell.getPsc());
            } else {
                Log.e(TAG,"Error getting cell location info.");
            }
@@ -2456,7 +2456,7 @@ public class GnssLocationProvider implements LocationProviderInterface {

    // AGPS ril suport
    private native void native_agps_set_ref_location_cellid(int type, int mcc, int mnc,
            int lac, int cid);
            int lac, int cid, int psc);
    private native void native_agps_set_id(int type, String setid);

    private native void native_update_network_state(boolean connected, int type,
+7 −2
Original line number Diff line number Diff line
@@ -756,7 +756,7 @@ static jint android_location_GnssLocationProvider_read_sv_status(JNIEnv* env, jo
}

static void android_location_GnssLocationProvider_agps_set_reference_location_cellid(
        JNIEnv* /* env */, jobject /* obj */, jint type, jint mcc, jint mnc, jint lac, jint cid)
        JNIEnv* /* env */, jobject /* obj */, jint type, jint mcc, jint mnc, jint lac, jint cid, jint psc)
{
    AGpsRefLocation location;

@@ -772,6 +772,11 @@ static void android_location_GnssLocationProvider_agps_set_reference_location_ce
            location.u.cellID.mcc = mcc;
            location.u.cellID.mnc = mnc;
            location.u.cellID.lac = lac;
#ifdef AGPS_USE_PSC
            location.u.cellID.psc = psc;
#else
            (void)psc;
#endif
            location.u.cellID.cid = cid;
            break;
        default:
@@ -1652,7 +1657,7 @@ static const JNINativeMethod sMethods[] = {
            "(ILjava/lang/String;)V",
            (void*)android_location_GnssLocationProvider_agps_set_id},
    {"native_agps_set_ref_location_cellid",
            "(IIIII)V",
            "(IIIIII)V",
            (void*)android_location_GnssLocationProvider_agps_set_reference_location_cellid},
    {"native_set_agps_server",
            "(ILjava/lang/String;I)V",