forked from Andromadus/android_frameworks_base
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pff: add PFFInfoDatabase to make spoofed informations persistant and …
…setable - expose functions in Package Manager to get and set the spoofed location Change-Id: Iaf93189db1413fdf13e3a38d9e408ba524cd2391 Conflicts: api/current.txt services/java/com/android/server/LocationManagerService.java
- Loading branch information
Showing
11 changed files
with
467 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package android.content.pff; | ||
|
||
parcelable LocationBean; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
package android.content.pff; | ||
|
||
import android.content.ContentValues; | ||
import android.os.Parcel; | ||
import android.os.Parcelable; | ||
|
||
public class LocationBean implements Parcelable { | ||
private long id = -1; | ||
private String description; | ||
private double latitude; | ||
private double longitude; | ||
private double altitude; | ||
|
||
public static final Parcelable.Creator<LocationBean> CREATOR = new Parcelable.Creator<LocationBean>() { | ||
|
||
public LocationBean createFromParcel(Parcel in) { | ||
return new LocationBean(in); | ||
} | ||
|
||
public LocationBean[] newArray(int size) { | ||
return null; | ||
} | ||
|
||
}; | ||
|
||
|
||
public LocationBean() { | ||
} | ||
|
||
public LocationBean(Parcel in) { | ||
readFromParcel(in); | ||
} | ||
|
||
public LocationBean(String Description, double Longitude, double Latitude, double Altitude){ | ||
this.description = Description; | ||
this.longitude = Longitude; | ||
this.latitude = Latitude; | ||
this.altitude = Altitude; | ||
} | ||
|
||
public void setId(long id) { | ||
this.id = id; | ||
} | ||
public long getId() { | ||
return id; | ||
} | ||
|
||
public String getDescription() { | ||
return this.description; | ||
} | ||
public void setDescription(String description) { | ||
this.description = description; | ||
} | ||
|
||
public Double getLatitude() { | ||
return this.latitude; | ||
} | ||
public void setLatitude(Double latitude) { | ||
this.latitude = latitude; | ||
} | ||
|
||
public Double getLongitude() { | ||
return this.longitude; | ||
} | ||
public void setLongitude(Double longitude) { | ||
this.longitude = longitude; | ||
} | ||
|
||
public Double getAltitude() { | ||
return this.altitude; | ||
} | ||
public void setAltitude(Double altitude) { | ||
this.altitude = altitude; | ||
} | ||
|
||
public ContentValues getValues() { | ||
ContentValues values = new ContentValues(); | ||
|
||
values.put(PFFInfoDatabase.FIELD_LOCATION_DESCRIPTION, description); | ||
values.put(PFFInfoDatabase.FIELD_LOCATION_LONGITUDE, longitude); | ||
values.put(PFFInfoDatabase.FIELD_LOCATION_LATITUDE, latitude); | ||
values.put(PFFInfoDatabase.FIELD_LOCATION_ALTITUDE, altitude); | ||
|
||
return values; | ||
} | ||
|
||
public boolean equals(Object o) { | ||
if (!(o instanceof LocationBean)) | ||
return false; | ||
|
||
LocationBean loaction = (LocationBean)o; | ||
|
||
if (loaction.getDescription().equals(description) | ||
&& loaction.getLatitude() == latitude | ||
&& loaction.getLongitude() == longitude) | ||
return true; | ||
|
||
return false; | ||
} | ||
|
||
public int describeContents() { | ||
return 0; | ||
} | ||
|
||
public void writeToParcel(Parcel out, int flags) { | ||
out.writeLong(id); | ||
out.writeString(description); | ||
out.writeDouble(latitude); | ||
out.writeDouble(longitude); | ||
out.writeDouble(altitude); | ||
} | ||
public void readFromParcel(Parcel in) { | ||
id = in.readLong(); | ||
description = in.readString(); | ||
latitude = in.readDouble(); | ||
longitude = in.readDouble(); | ||
altitude = in.readDouble(); | ||
} | ||
} | ||
|
Oops, something went wrong.