2

7I am unable to access the GPS using the following permissions

<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />

When I open the app, it will die on the following:

locationMangaer.requestLocationUpdates(LocationManager.GPS_PROVIDER, 5000, 10, locationListener);

Logcat is shown below. I googled "java.lang.SecurityException: invalid package name" and got 7 results, so I hope I'm not in trouble :( Anyway, if anyone can point me in the right direction, that would be helpful. Also, a little background info, this is a AOSP rom, but I did verify from GPS Test app that the GPS is able to get a lock.

E/AndroidRuntime(  836): FATAL EXCEPTION: main
E/AndroidRuntime(  836): java.lang.SecurityException: invalid package name
E/AndroidRuntime(  836):    at android.os.Parcel.readException(Parcel.java:1425)
E/AndroidRuntime(  836):    at android.os.Parcel.readException(Parcel.java:1379)
E/AndroidRuntime(  836):    at android.location.ILocationManager$Stub$Proxy.getLastKnownLocation(ILocationManager.java:923)
E/AndroidRuntime(  836):    at android.location.LocationManager.getLastKnownLocation(LocationManager.java:1171)
E/AndroidRuntime(  836):    at com.derrick.rfsuite.MainActivity.processGPS(MainActivity.java:557)
E/AndroidRuntime(  836):    at com.derrick.rfsuite.MainActivity.access$12(MainActivity.java:525)
E/AndroidRuntime(  836):    at com.derrick.rfsuite.MainActivity$2.handleMessage(MainActivity.java:214)
E/AndroidRuntime(  836):    at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(  836):    at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime(  836):    at android.app.ActivityThread.main(ActivityThread.java:4929)
E/AndroidRuntime(  836):    at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(  836):    at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime(  836):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
E/AndroidRuntime(  836):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:558)
E/AndroidRuntime(  836):    at dalvik.system.NativeStart.main(Native Method)

I have pinpointed the following as this line in the Manifest, but I don't understand what is happening

android:sharedUserId="android.uid.system"
4

0 回答 0