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

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

Merge "resolved conflicts for merge of 2ecce34f to master"

parents 5c6d6d5d 5c83a5f2
Loading
Loading
Loading
Loading
+39 −28
Original line number Diff line number Diff line
@@ -3516,7 +3516,7 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
            if (DEBUG_TASKS) Slog.v(TAG, "Starting new activity " + r
                    + " in new task " + r.task);
            newTask = true;
            addRecentTask(r.task);
            addRecentTaskLocked(r.task);
            
        } else if (sourceRecord != null) {
            if (!addingToTask &&
@@ -3891,7 +3891,7 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
        }
    }
    private final void addRecentTask(TaskRecord task) {
    private final void addRecentTaskLocked(TaskRecord task) {
        // Remove any existing entries that are the same kind of task.
        int N = mRecentTasks.size();
        for (int i=0; i<N; i++) {
@@ -4939,9 +4939,11 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
                Intent intent = new Intent(Intent.ACTION_PACKAGE_DATA_CLEARED,
                        Uri.fromParts("package", packageName, null));
                intent.putExtra(Intent.EXTRA_UID, pkgUid);
                synchronized (this) {
                    broadcastIntentLocked(null, null, intent,
                            null, null, 0, null, null, null,
                            false, false, MY_PID, Process.SYSTEM_UID);
                }
            } catch (RemoteException e) {
            }
        } finally {
@@ -7001,7 +7003,7 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
                            taskTopI = -1;
                        }
                        replyChainEnd = -1;
                        addRecentTask(target.task);
                        addRecentTaskLocked(target.task);
                    } else if (forceReset || finishOnTaskLaunch
                            || clearWhenTaskReset) {
                        // If the activity should just be removed -- either
@@ -7223,7 +7225,7 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
                moved.add(0, r);
                top--;
                if (first) {
                    addRecentTask(r.task);
                    addRecentTaskLocked(r.task);
                    first = false;
                }
            }
@@ -7248,11 +7250,11 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
            mWindowManager.validateAppTokens(mHistory);
        }
        finishTaskMove(task);
        finishTaskMoveLocked(task);
        EventLog.writeEvent(EventLogTags.AM_TASK_TO_FRONT, task);
    }
    private final void finishTaskMove(int task) {
    private final void finishTaskMoveLocked(int task) {
        resumeTopActivityLocked(null);
    }
@@ -7370,7 +7372,7 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
            mWindowManager.validateAppTokens(mHistory);
        }
        finishTaskMove(task);
        finishTaskMoveLocked(task);
        return true;
    }
@@ -8002,8 +8004,10 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
    }
    public static final void installSystemProviders() {
        List providers;
        synchronized (mSelf) {
            ProcessRecord app = mSelf.mProcessNames.get("system", Process.SYSTEM_UID);
        List providers = mSelf.generateApplicationProvidersLocked(app);
            providers = mSelf.generateApplicationProvidersLocked(app);
            if (providers != null) {
                for (int i=providers.size()-1; i>=0; i--) {
                    ProviderInfo pi = (ProviderInfo)providers.get(i);
@@ -8014,8 +8018,11 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
                    }
                }
            }
        }
        if (providers != null) {
            mSystemThread.installSystemProviders(providers);
        }
    }
    // =========================================================
    // GLOBAL MANAGEMENT
@@ -8297,12 +8304,16 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
    }
    
    public void registerActivityWatcher(IActivityWatcher watcher) {
        synchronized (this) {
            mWatchers.register(watcher);
        }
    }
    public void unregisterActivityWatcher(IActivityWatcher watcher) {
        synchronized (this) {
            mWatchers.unregister(watcher);
        }
    }
    public final void enterSafeMode() {
        synchronized(this) {
@@ -11937,7 +11948,7 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
    // BROADCASTS
    // =========================================================
    private final List getStickies(String action, IntentFilter filter,
    private final List getStickiesLocked(String action, IntentFilter filter,
            List cur) {
        final ContentResolver resolver = mContext.getContentResolver();
        final ArrayList<Intent> list = mStickyBroadcasts.get(action);
@@ -11989,10 +12000,10 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
            if (actions != null) {
                while (actions.hasNext()) {
                    String action = (String)actions.next();
                    allSticky = getStickies(action, filter, allSticky);
                    allSticky = getStickiesLocked(action, filter, allSticky);
                }
            } else {
                allSticky = getStickies(null, filter, allSticky);
                allSticky = getStickiesLocked(null, filter, allSticky);
            }
            // The first sticky in the list is returned directly back to
@@ -13840,7 +13851,7 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
    /**
     * Returns true if things are idle enough to perform GCs.
     */
    private final boolean canGcNow() {
    private final boolean canGcNowLocked() {
        return mParallelBroadcasts.size() == 0
                && mOrderedBroadcasts.size() == 0
                && (mSleeping || (mResumedActivity != null &&
@@ -13856,7 +13867,7 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
        if (N <= 0) {
            return;
        }
        if (canGcNow()) {
        if (canGcNowLocked()) {
            while (mProcessesToGc.size() > 0) {
                ProcessRecord proc = mProcessesToGc.remove(0);
                if (proc.curRawAdj > VISIBLE_APP_ADJ || proc.reportLowMemory) {
@@ -13884,7 +13895,7 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
     * If all looks good, perform GCs on all processes waiting for them.
     */
    final void performAppGcsIfAppropriateLocked() {
        if (canGcNow()) {
        if (canGcNowLocked()) {
            performAppGcsLocked();
            return;
        }