PackageInstallerSession

源码位置:PackageInstallerSession.java

commit

{% include_code lang:java from:689 to:750 aosp/8.1/frameworks/base/services/core/java/com/android/server/pm/PackageInstallerSession.java %} 该方法主要发送了一个MSG_COMMIT消息。下面看Handler如何处理这个消息。

Handler.Callback

{% include_code lang:java from:275 to:303 aosp/8.1/frameworks/base/services/core/java/com/android/server …

基于AOSP 8.0.1源码分析force-stop的实现细节。

使用 force-stop

am force-stop com.example

com.example 是应用程序包名。

am命令

cat /system/bin/am
#!/system/bin/sh
if [ "$1" != "instrument" ] ; then
    cmd activity "$@"
else
    base=/system
    export CLASSPATH=$base/framework/am.jar
    exec app_process $base/bin com.android.commands.am.Am "$@"
fi

am 是一个shell脚本。如果第一 …