views:

62

answers:

1

Thanks Google released 2.2 source code.

In this code-InstalledAppDetails.java

It shows how android 2.2 does the "force close" function.

private void forceStopPackage(String pkgName) {
    ActivityManager am = (ActivityManager)getSystemService(
            Context.ACTIVITY_SERVICE);
    am.forceStopPackage(pkgName);
    checkForceStop();
}

However "forceStopPackage" method is not in ActivityManager class. http://developer.android.com/reference/android/app/ActivityManager.html

Is it a interneal API? Thanks.

A: 

The android source does not exclusively use available API's. The function you are reference probably is just not available in the SDK.

That said, this internal API looks like it performs identically to the killBackgroundProcesses() in 2.2, or restartPackage() pre-2.2, methods in the ActivityManager class.

jqpubliq