自己在ActivityManagerService里添加一个函数,只finish对应activity:
        long callingId = Binder.clearCallingIdentity();
        ArrayList history = mHistory;
        try {
            synchronized (this) {
                for (int i = history.size() - 1; i >= 0; --i) {
                    HistoryRecord r = (HistoryRecord) history.get(i);
                    if (r.packageName.equals(packageName)) {
                        if (Config.LOGD)
                            Log.d(TAG, "  Force finishing activity "
                                    + r.intent.getComponent().flattenToShortString());
                        if (null != r.app) {
                            r.app.removed = true;
                        }
                        r.app = null;
                        finishActivityLocked(r, i, Activity.RESULT_CANCELED, null, "uninstall");
                    }
                }
            }
        } finally {
            Binder.restoreCallingIdentity(callingId);
        }