NullPointerException in WindowManagerImpl on Android OS 3.2
<p>I got an null pointer exception on Android 3.2 emulator  on a simple Android project created by Wizerd with a service in separated process, when I switch between "Stretch to fill screen" to "Zoom to fill screen". This crash will <em>not</em> happen if the service is put into the same process with main activity, namely "android:process" attribute not specified. While it only happens when I add "android:process" to manifest file for my test service.</p>

<p>The exception is:</p>

<pre><code>FATAL EXCEPTION: main

    java.lang.NullPointerException
      at android.view.WindowManagerImpl.reportNewConfiguration(WindowManagerImpl.java:427)
      at android.app.ActivityThread.handleUpdatePackageCompatibilityInfo(ActivityThread.java:2801)
      at android.app.ActivityThread.access$2700(ActivityThread.java:122)
      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1151)
      at android.os.Handler.dispatchMessage(Handler.java:99)
      at android.os.Looper.loop(Looper.java:132)
      at android.app.ActivityThread.main(ActivityThread.java:4123)
      at java.lang.reflect.Method.invokeNative(Native Method)
      at java.lang.reflect.Method.invoke(Method.java:491)
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
      at dalvik.system.NativeStart.main(Native Method)
</code></pre>

<p>My test code:</p>

<h1>TestActivity.java (Generated by Wizerd)</h1>

<pre><code>package com.test;

import android.app.Activity;

public class TestActivity extends Activity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        Intent intent = new Intent(this, TestService.class);
        startService(intent);
    }
}
</code></pre>

<h1>TestService.java (Most of the functions are empty)</h1>

<pre><code>Package com.test;

import android.content.ComponentName;

public class TestService extends Service {
    private boolean m_connected = false;

    private ServiceConnection m_connInitService = new ServiceConnection() {
        public void onServiceConnection(ComponentName className, IBinder service) {
            m_connected = true;
        }

        public void onServiceDisconnected(ComponentName className) {
        }
    };

    public static class TestServiceBinder extends Binder {
    }

    public IBinder onBind(Intent intent) {
        return new TestServiceBinder();
    }

    public void onDestroy() {
        super.onDestroy();
    }

    public int onStartCommand(Intent intent, int flags, int startId) {
        return 1;
    }
}
</code></pre>

<p>If I run the test app without service or with service in the same process the screen compatibility switch will not cause any problem. However, I do not understand why service can cause system exception during screen compatibility switch. Is this because service process is a non-UI process? Which could potentially triggers a bug inside the Android core code?</p>
