android2.2 how implements lock srceen？ who has carhome.apk source? please give me ones
<p>I reading frameworks/base/core/java/com/android/internal/app/ResolverActivity.java</p>

<p>System code:getPackageManager().addPreferredActivity(filter, bestMatch, set,
                        intent.getComponent());</p>

<p>My code:    not work！ why？</p>

<pre><code>private void addPreferredActivity() {
    PackageManager packages = getPackageManager();

    IntentFilter filter = new IntentFilter("android.intent.action.MAIN");
    filter.addCategory("android.intent.category.HOME");
    filter.addCategory("android.intent.category.DEFAULT");

    ComponentName[] components =
        new ComponentName[] {
            new ComponentName("com.android.launcher", ".launcher"),
            new ComponentName("com.saaa", ".saaa")
        };

    ComponentName activity = new ComponentName("com.saaa", ".saaa");
    packages.clearPackagePreferredActivities("com.saaa");
    packages.addPreferredActivity(filter, 0, components, activity);
}
</code></pre>

<p>My english very bad! please everyone help!.</p>
