Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 67c5b125 authored by Dianne Hackborn's avatar Dianne Hackborn Committed by Android (Google) Code Review
Browse files

Merge "Fix issue #5321282: Force Stop Button in Battery Screen Not disabled correctly"

parents 3f816086 80a7ac10
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -3334,6 +3334,11 @@ public final class ActivityManagerService extends ActivityManagerNative
            if ((samePackage || r.task == lastTask)
            if ((samePackage || r.task == lastTask)
                    && (r.app == null || evenPersistent || !r.app.persistent)) {
                    && (r.app == null || evenPersistent || !r.app.persistent)) {
                if (!doit) {
                if (!doit) {
                    if (r.finishing) {
                        // If this activity is just finishing, then it is not
                        // interesting as far as something to stop.
                        continue;
                    }
                    return true;
                    return true;
                }
                }
                didSomething = true;
                didSomething = true;
@@ -3399,6 +3404,7 @@ public final class ActivityManagerService extends ActivityManagerNative
                }
                }
            }
            }
            mMainStack.resumeTopActivityLocked(null);
            mMainStack.resumeTopActivityLocked(null);
            mMainStack.scheduleIdleLocked();
        }
        }
        
        
        return didSomething;
        return didSomething;
+9 −9
Original line number Original line Diff line number Diff line
@@ -765,9 +765,7 @@ final class ActivityStack {
                // Still need to tell some activities to stop; can't sleep yet.
                // Still need to tell some activities to stop; can't sleep yet.
                if (DEBUG_PAUSE) Slog.v(TAG, "Sleep still need to stop "
                if (DEBUG_PAUSE) Slog.v(TAG, "Sleep still need to stop "
                        + mStoppingActivities.size() + " activities");
                        + mStoppingActivities.size() + " activities");
                Message msg = Message.obtain();
                scheduleIdleLocked();
                msg.what = IDLE_NOW_MSG;
                mHandler.sendMessage(msg);
                return;
                return;
            }
            }


@@ -978,9 +976,7 @@ final class ActivityStack {
                        // then give up on things going idle and start clearing
                        // then give up on things going idle and start clearing
                        // them out.
                        // them out.
                        if (DEBUG_PAUSE) Slog.v(TAG, "To many pending stops, forcing idle");
                        if (DEBUG_PAUSE) Slog.v(TAG, "To many pending stops, forcing idle");
                        Message msg = Message.obtain();
                        scheduleIdleLocked();
                        msg.what = IDLE_NOW_MSG;
                        mHandler.sendMessage(msg);
                    } else {
                    } else {
                        checkReadyForSleepLocked();
                        checkReadyForSleepLocked();
                    }
                    }
@@ -3103,6 +3099,12 @@ final class ActivityStack {
        return stops;
        return stops;
    }
    }


    final void scheduleIdleLocked() {
        Message msg = Message.obtain();
        msg.what = IDLE_NOW_MSG;
        mHandler.sendMessage(msg);
    }

    final ActivityRecord activityIdleInternal(IBinder token, boolean fromTimeout,
    final ActivityRecord activityIdleInternal(IBinder token, boolean fromTimeout,
            Configuration config) {
            Configuration config) {
        if (localLOGV) Slog.v(TAG, "Activity idle: " + token);
        if (localLOGV) Slog.v(TAG, "Activity idle: " + token);
@@ -3413,9 +3415,7 @@ final class ActivityStack {
                    // If we already have a few activities waiting to stop,
                    // If we already have a few activities waiting to stop,
                    // then give up on things going idle and start clearing
                    // then give up on things going idle and start clearing
                    // them out.
                    // them out.
                    Message msg = Message.obtain();
                    scheduleIdleLocked();
                    msg.what = IDLE_NOW_MSG;
                    mHandler.sendMessage(msg);
                } else {
                } else {
                    checkReadyForSleepLocked();
                    checkReadyForSleepLocked();
                }
                }
+8 −2
Original line number Original line Diff line number Diff line
@@ -4352,7 +4352,10 @@ public class PackageManagerService extends IPackageManager.Stub {
            if (p != null) {
            if (p != null) {
                PackageSetting ps = (PackageSetting)p.mExtras;
                PackageSetting ps = (PackageSetting)p.mExtras;
                if (ps != null) {
                if (ps != null) {
                    return ps.stopped;
                    // System apps are never considered stopped for purposes of
                    // filtering, because there may be no way for the user to
                    // actually re-launch them.
                    return ps.stopped && (ps.pkgFlags&ApplicationInfo.FLAG_SYSTEM) == 0;
                }
                }
            }
            }
            return false;
            return false;
@@ -4524,7 +4527,10 @@ public class PackageManagerService extends IPackageManager.Stub {
            if (p != null) {
            if (p != null) {
                PackageSetting ps = (PackageSetting)p.mExtras;
                PackageSetting ps = (PackageSetting)p.mExtras;
                if (ps != null) {
                if (ps != null) {
                    return ps.stopped;
                    // System apps are never considered stopped for purposes of
                    // filtering, because there may be no way for the user to
                    // actually re-launch them.
                    return ps.stopped && (ps.pkgFlags&ApplicationInfo.FLAG_SYSTEM) == 0;
                }
                }
            }
            }
            return false;
            return false;