system crash when enable mock location on My Samsung i9000 2.2(ZSJPE)

by Evan » Tue, 09 Nov 2010 02:54:34 GMT


Sponsored Links
 Dear all
I got a crash from logcat when I enable mock location in my program.
when I call enableMockLocation(true) but no update,the system is crash
and reboot.
the same program is working on 2.1(ZSJG4)

Exeception:

11-08 15:57:23.474: ERROR/AndroidRuntime(7336): *** FATAL EXCEPTION IN
SYSTEM PROCESS: GpsLocationProvider
11-08 15:57:23.474: ERROR/AndroidRuntime(7336):
java.lang.NullPointerException
11-08 15:57:23.474: ERROR/AndroidRuntime(7336):     at
com.android.internal.location.GpsLocationProvider$HybridGps.access
$900(GpsLocationProvider.java:1676)
11-08 15:57:23.474: ERROR/AndroidRuntime(7336):     at
com.android.internal.location.GpsLocationProvider.stopNavigating(GpsLocationProvider.java:
1227)
11-08 15:57:23.474: ERROR/AndroidRuntime(7336):     at
com.android.internal.location.GpsLocationProvider.handleEnableLocationTracking(GpsLocationProvider.java:
968)
11-08 15:57:23.474: ERROR/AndroidRuntime(7336):     at
com.android.internal.location.GpsLocationProvider.access
$7600(GpsLocationProvider.java:116)
11-08 15:57:23.474: ERROR/AndroidRuntime(7336):     at
com.android.internal.location.GpsLocationProvider
$ProviderHandler.handleMessage(GpsLocationProvider.java:2224)
11-08 15:57:23.474: ERROR/AndroidRuntime(7336):     at
android.os.Handler.dispatchMessage(Handler.java:99)
11-08 15:57:23.474: ERROR/AndroidRuntime(7336):     at
android.os.Looper.loop(Looper.java:123)
11-08 15:57:23.474: ERROR/AndroidRuntime(7336):     at
com.android.internal.location.GpsLocationProvider
$GpsLocationProviderThread.run(GpsLocationProvider.java:2263)

the partial code is:
    public void enableMockLocation(boolean bEnable) {

        m_bMockLocation = bEnable;
        if(m_bMockLocation)
        {
            Log.e(LOG_TAG, "enableMockLocation 01");
            m_Handler.obtainMessage(MSG_TOAST,"Mock location
enable.").sendToTarget();
            m_LocationManager.addTestProvider(m_szMockProvider,
                    false,    // requiresNetwork
                    true,    // requiresSatellite
                    false,    // requiresCell
                    false,    // hasMonetaryCost
                    false,    // supportsAltitude
                    false,    // supportsSpeed
                    false,    // supportsBearing
                    0,        // powerRequirement
                    5);       // accuracy
            Log.e(LOG_TAG, "enableMockLocation 03" +
m_szMockProvider);
            m_LocationManager.setTestProviderEnabled(m_szMockProvider,
true);
            Log.e(LOG_TAG, "enableMockLocation 04" +
m_szMockProvider);

        }else
        {
            m_Handler.obtainMessage(MSG_TOAST,"Mock location
disable.").sendToTarget();
            m_LocationManager.setTestProviderEnabled(m_szMockProvider,
false);
 
m_LocationManager.clearTestProviderEnabled(m_szMockProvider);
 
m_LocationManager.clearTestProviderLocation(m_szMockProvider);
 
m_LocationManager.clearTestProviderStatus(m_szMockProvider);
            m_LocationManager.removeTestProvider(m_szMockProvider);

        }
    }



any suggestion?
thanks

--



Other Threads

1. Android Eclair GPS and AGPS

Dear all~~

    I am porting GPS in android 2.0.
    I have encountered a problem about GPS fix mode.
    In the code

    public void startNavigating() {
        if (!mStarted) {
            if (DEBUG) Log.d(TAG, "startNavigating");
            mStarted = true;
            int positionMode;
            if (Settings.Secure.getInt(mContext.getContentResolver(),
                    Settings.Secure.ASSISTED_GPS_ENABLED, 1) != 0) {
                positionMode = GPS_POSITION_MODE_MS_BASED;
            } else {
                positionMode = GPS_POSITION_MODE_STANDALONE;
            }

            if (!native_start(positionMode, false, mFixInterval)) {
                mStarted = false;
                Log.e(TAG, "native_start failed in startNavigating
()");
                return;
            }

            // reset SV count to zero
            updateStatus(LocationProvider.TEMPORARILY_UNAVAILABLE, 0);
            mFixCount = 0;
            mFixRequestTime = System.currentTimeMillis();
            // set timer to give up if we do not receive a fix within
NO_FIX_TIMEOUT
            // and our fix interval is not short
            if (mFixInterval >= NO_FIX_TIMEOUT) {
                mAlarmManager.set
(AlarmManager.ELAPSED_REALTIME_WAKEUP,
                        SystemClock.elapsedRealtime() + NO_FIX_TIMEOUT
* 1000, mTimeoutIntent);
            }
        }
    }


    it always run positionMode = GPS_POSITION_MODE_MS_BASED;

    but if I want to run positionMode = GPS_POSITION_MODE_STANDALONE;
    How/Where do I configure the settings about GPS fix mode.

    I use sqlite command to check /data/data/
com.android.providers.settings/databases/settings.db, it shows message
below

1|bluetooth_on|0
2|data_roaming|0
5|assisted_gps_enabled|1
6|network_preference|1
7|usb_mass_storage_enabled|1
8|wifi_on|0
9|wifi_networks_available_notification_on|1
10|preferred_network_mode|0
11|cdma_cell_broadcast_sms|1
12|preferred_cdma_subscription|1
15|backup_transport|
21|device_provisioned|1
23|install_non_market_apps|1
108|enabled_accessibility_services|
127|backup_enabled|0
128|adb_enabled|1
161|enabled_input_methods|com.android.inputmethod.latin/.LatinIME
162|default_input_method|com.android.inputmethod.latin/.LatinIME
164|mock_location|1
167|location_providers_allowed|gps,network


    The assisted_gps_enabled always set to 1. How do I set it to 0 to
use GPS fix mode to standalong;


Best Regard

-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

2. Stopped during boot up on x86 virtualbox with cupcake

Hello.

I have reached the android logo image.
But I'm facing below error at the around of end of the below log from
logcat.

It seem that failure occured from somewhere which forked by
SurfaceFlinger.
Could you pls share some idea on this?

--------------------------------------------
Log begin.

D/AndroidRuntime( 1762): --- registering native functions ---
I/Zygote  ( 1762): Preloading classes...
D/dalvikvm( 1762): GC freed 764 objects / 40664 bytes in 0ms
D/dalvikvm( 1762): GC freed 290 objects / 17288 bytes in 0ms
D/dalvikvm( 1762): GC freed 234 objects / 13984 bytes in 0ms
D/dalvikvm( 1762): Trying to load lib /system/lib/libmedia_jni.so 0x0
D/dalvikvm( 1762): Added shared lib /system/lib/libmedia_jni.so 0x0
D/dalvikvm( 1762): Trying to load lib /system/lib/libmedia_jni.so 0x0
D/dalvikvm( 1762): Shared lib '/system/lib/libmedia_jni.so' already
loaded in same CL 0x0
D/dalvikvm( 1762): Trying to load lib /system/lib/libmedia_jni.so 0x0
D/dalvikvm( 1762): Shared lib '/system/lib/libmedia_jni.so' already
loaded in same CL 0x0
D/dalvikvm( 1762): Trying to load lib /system/lib/libmedia_jni.so 0x0
D/dalvikvm( 1762): Shared lib '/system/lib/libmedia_jni.so' already
loaded in same CL 0x0
D/dalvikvm( 1762): GC freed 424 objects / 25664 bytes in 1ms
D/dalvikvm( 1762): GC freed 3636 objects / 172320 bytes in 2ms
D/dalvikvm( 1762): GC freed 12039 objects / 411128 bytes in 3ms
D/dalvikvm( 1762): GC freed 11081 objects / 448136 bytes in 3ms
D/dalvikvm( 1762): GC freed 9604 objects / 391016 bytes in 4ms
D/dalvikvm( 1762): GC freed 15134 objects / 518008 bytes in 4ms
D/dalvikvm( 1762): GC freed 11933 objects / 489136 bytes in 4ms
D/dalvikvm( 1762): GC freed 4547 objects / 184672 bytes in 4ms
D/dalvikvm( 1762): GC freed 349 objects / 36456 bytes in 3ms
D/dalvikvm( 1762): GC freed 778 objects / 46688 bytes in 5ms
D/dalvikvm( 1762): GC freed 321 objects / 36536 bytes in 4ms
D/dalvikvm( 1762): GC freed 486 objects / 29328 bytes in 4ms
D/dalvikvm( 1762): Trying to load lib /system/lib/libwebcore.so 0x0
D/dalvikvm( 1762): Added shared lib /system/lib/libwebcore.so 0x0
D/dalvikvm( 1762): GC freed 459 objects / 26256 bytes in 4ms
D/dalvikvm( 1762): GC freed 480 objects / 39096 bytes in 5ms
D/dalvikvm( 1762): GC freed 544 objects / 37184 bytes in 5ms
D/dalvikvm( 1762): GC freed 298 objects / 19432 bytes in 5ms
D/dalvikvm( 1762): GC freed 339 objects / 18048 bytes in 6ms
D/dalvikvm( 1762): GC freed 642 objects / 31984 bytes in 5ms
D/dalvikvm( 1762): GC freed 15483 objects / 523824 bytes in 7ms
D/dalvikvm( 1762): GC freed 10785 objects / 439360 bytes in 7ms
D/dalvikvm( 1762): GC freed 6270 objects / 265400 bytes in 6ms
D/dalvikvm( 1762): GC freed 752 objects / 41920 bytes in 6ms
D/dalvikvm( 1762): GC freed 604 objects / 31064 bytes in 7ms
D/dalvikvm( 1762): GC freed 442 objects / 27856 bytes in 6ms
I/Zygote  ( 1762): ...preloaded 1158 classes in 947ms.
D/dalvikvm( 1762): GC freed 280 objects / 17072 bytes in 10ms
I/Zygote  ( 1762): Preloading resources...
D/dalvikvm( 1762): GC freed 54 objects / 11160 bytes in 8ms
D/dalvikvm( 1762): GC freed 337 objects / 14680 bytes in 8ms
D/dalvikvm( 1762): GC freed 280 objects / 11528 bytes in 6ms
I/Zygote  ( 1762): ...preloaded 48 resources in 92ms.
I/Zygote  ( 1762): ...preloaded 15 resources in 4ms.
D/dalvikvm( 1762): GC freed 116 objects / 7808 bytes in 11ms
D/dalvikvm( 1762): GC freed 205 objects / 7720 bytes in 9ms
D/dalvikvm( 1762): GC freed 36 objects / 1336 bytes in 9ms
I/dalvikvm( 1762): Splitting out new zygote heap
I/dalvikvm( 1762): System server process 1768 has been created
I/Zygote  ( 1762): Accepting command socket connections
D/dalvikvm( 1768): Trying to load lib /system/lib/
libandroid_servers.so 0x0
D/dalvikvm( 1768): Added shared lib /system/lib/libandroid_servers.so
0x0
I/sysproc ( 1768): Entered system_init()
I/sysproc ( 1768): ServiceManager: 0x8174138
I/SurfaceFlinger( 1768): SurfaceFlinger is starting
I/SurfaceFlinger( 1768): SurfaceFlinger's main thread ready to run.
Initializing graphics H/W...
E/MemoryHeapBase( 1768): error opening /dev/pmem: No such file or
directory
E/SurfaceFlinger( 1768): Couldn't open /sys/power/wait_for_fb_sleep
or /sys/power/wait_for_fb_wake
E/GLLogger( 1768): couldn't load <libhgl.so> library (Cannot find
library)
I/SurfaceFlinger( 1768): EGL informations:
I/SurfaceFlinger( 1768): # of configs : 6
I/SurfaceFlinger( 1768): vendor    : Android
I/SurfaceFlinger( 1768): version   : 1.31 Android META-EGL
I/SurfaceFlinger( 1768): extensions:
I/SurfaceFlinger( 1768): Client API: OpenGL ES
W/EGLDisplaySurface( 1768): page flipping not supported
(yres_virtual=600, requested=1200)
I/EGLDisplaySurface( 1768): using (fd=21)
I/EGLDisplaySurface( 1768): id           = VESA VGA
I/EGLDisplaySurface( 1768): xres         = 800 px
I/EGLDisplaySurface( 1768): yres         = 600 px
I/EGLDisplaySurface( 1768): xres_virtual = 800 px
I/EGLDisplaySurface( 1768): yres_virtual = 600 px
I/EGLDisplaySurface( 1768): bpp          = 16
I/EGLDisplaySurface( 1768): r            = 11:5
I/EGLDisplaySurface( 1768): g            =  5:6
I/EGLDisplaySurface( 1768): b            =  0:5
I/EGLDisplaySurface( 1768): width        = 127 mm (159.999998 dpi)
I/EGLDisplaySurface( 1768): height       = 95 mm (160.421050 dpi)
I/EGLDisplaySurface( 1768): refresh rate = 83.43 Hz
W/HAL     ( 1768): load: module=/system/lib/hw/copybit.eee_701.so
error=Cannot find library
W/HAL     ( 1768): load: module=/system/lib/hw/copybit.default.so
error=Cannot find library
W/SurfaceFlinger( 1768): ro.sf.lcd_density not defined, using 160 dpi
by default.
I/SurfaceFlinger( 1768): OpenGL informations:
I/SurfaceFlinger( 1768): vendor    : Android
I/SurfaceFlinger( 1768): renderer  : Android PixelFlinger 1.0
I/SurfaceFlinger( 1768): version   : OpenGL ES-CM 1.0
I/SurfaceFlinger( 1768): extensions: GL_OES_byte_coordinates
GL_OES_fixed_point
GL_OES_single_precision GL_OES_read_format
GL_OES_compressed_paletted_texture GL
_OES_draw_texture GL_OES_matrix_get GL_OES_query_matrix
GL_ARB_texture_compressi
on GL_ARB_texture_non_power_of_two GL_ANDROID_direct_texture
GL_ANDROID_user_clip_plane GL_ANDROID_vertex_buffer_object
GL_ANDROID_generate_mipmap
W/HAL     ( 1768): load: module=/system/lib/hw/copybit.eee_701.so
error=Cannot find library
W/HAL     ( 1768): load: module=/system/lib/hw/copybit.default.so
error=Cannot find library
W/HAL     ( 1768): load: module=/system/lib/hw/overlay.eee_701.so
error=Cannot find library
W/HAL     ( 1768): load: module=/system/lib/hw/overlay.default.so
error=Cannot find library
I/sysproc ( 1768): System server: starting Android runtime.
I/sysproc ( 1768): System server: starting Android services.
I/SystemServer( 1768): Entered the Android system server!
I/sysproc ( 1768): System server: entering thread pool.
I/SystemServer( 1768): Starting Power Manager.
I/SystemServer( 1768): Starting Activity Manager.
D/        ( 1768): unable to unlink '/data/system/
batterystats.bin.bak': No such file or directory (errno=2)
E/GLLogger( 1768): couldn't load <libhgl.so> library (Cannot find
library)
W/dalvikvm( 1768): threadid=19: thread exiting with uncaught exception
(group=0xb00ecdf8)
E/AndroidRuntime( 1768): Uncaught handler: thread ActivityManager
exiting due to uncaught exception
E/AndroidRuntime( 1768): *** EXCEPTION IN SYSTEM PROCESS.  System will
crash.
E/AndroidRuntime( 1768): java.lang.NumberFormatException: unable to
parse '' asinteger
E/AndroidRuntime( 1768):        at
java.lang.Integer.parseInt(Integer.java:364)
E/AndroidRuntime( 1768):        at
java.lang.Integer.parseInt(Integer.java:333)
E/AndroidRuntime( 1768):        at
java.lang.Integer.valueOf(Integer.java:590)
E/AndroidRuntime( 1768):        at
com.android.server.am.ActivityManagerService.<init>(ActivityManagerService.java:
1303)
E/AndroidRuntime( 1768):        at
com.android.server.am.ActivityManagerService.<init>(ActivityManagerService.java:
110)
E/AndroidRuntime( 1768):        at
com.android.server.am.ActivityManagerService
$AThread.run(ActivityManagerService.java:1130)
E/AndroidRuntime( 1768): Crash logging skipped, no checkin service
I/Process ( 1768): Sending signal. PID: 1768 SIG: 9
I/ServiceManager( 1740): service 'SurfaceFlinger' died
I/ServiceManager( 1740): service 'power' died
I/Zygote  ( 1762): Exit zygote because system server (1768) has
terminated

-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

3. Android on MSM7225 Processor

4. Dose Froyo support multi framebuffer?

5. SurfaceFlinger receive wrong parameters while pressing power button for a while

6. An Error on Cupcake + kernel 29 for x86 + virtualbox

7. What am I looking for