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

Commit 828bd38a authored by Dianne Hackborn's avatar Dianne Hackborn
Browse files

More debug for issue #17310019: pause when launching settings

Dang, I missed a lot of opportunities to log!

Change-Id: I566597269fe73b0f798df4f00ad26d062021081d
parent 78358b17
Loading
Loading
Loading
Loading
+20 −0
Original line number Original line Diff line number Diff line
@@ -9087,9 +9087,11 @@ public final class ActivityManagerService extends ActivityManagerNative
            boolean singleton;
            boolean singleton;
            if (!providerRunning) {
            if (!providerRunning) {
                try {
                try {
                    checkTime(startTime, "getContentProviderImpl: before resolveContentProvider");
                    cpi = AppGlobals.getPackageManager().
                    cpi = AppGlobals.getPackageManager().
                        resolveContentProvider(name,
                        resolveContentProvider(name,
                            STOCK_PM_FLAGS | PackageManager.GET_URI_PERMISSION_PATTERNS, userId);
                            STOCK_PM_FLAGS | PackageManager.GET_URI_PERMISSION_PATTERNS, userId);
                    checkTime(startTime, "getContentProviderImpl: after resolveContentProvider");
                } catch (RemoteException ex) {
                } catch (RemoteException ex) {
                }
                }
                if (cpi == null) {
                if (cpi == null) {
@@ -9106,12 +9108,15 @@ public final class ActivityManagerService extends ActivityManagerNative
                    userId = UserHandle.USER_OWNER;
                    userId = UserHandle.USER_OWNER;
                }
                }
                cpi.applicationInfo = getAppInfoForUser(cpi.applicationInfo, userId);
                cpi.applicationInfo = getAppInfoForUser(cpi.applicationInfo, userId);
                checkTime(startTime, "getContentProviderImpl: got app info for user");
                String msg;
                String msg;
                checkTime(startTime, "getContentProviderImpl: before checkContentProviderPermission");
                if ((msg = checkContentProviderPermissionLocked(cpi, r, userId, !singleton))
                if ((msg = checkContentProviderPermissionLocked(cpi, r, userId, !singleton))
                        != null) {
                        != null) {
                    throw new SecurityException(msg);
                    throw new SecurityException(msg);
                }
                }
                checkTime(startTime, "getContentProviderImpl: after checkContentProviderPermission");
                if (!mProcessesReady && !mDidUpdate && !mWaitingUpdate
                if (!mProcessesReady && !mDidUpdate && !mWaitingUpdate
                        && !cpi.processName.equals("system")) {
                        && !cpi.processName.equals("system")) {
@@ -9133,15 +9138,19 @@ public final class ActivityManagerService extends ActivityManagerNative
                }
                }
                ComponentName comp = new ComponentName(cpi.packageName, cpi.name);
                ComponentName comp = new ComponentName(cpi.packageName, cpi.name);
                checkTime(startTime, "getContentProviderImpl: before getProviderByClass");
                cpr = mProviderMap.getProviderByClass(comp, userId);
                cpr = mProviderMap.getProviderByClass(comp, userId);
                checkTime(startTime, "getContentProviderImpl: after getProviderByClass");
                final boolean firstClass = cpr == null;
                final boolean firstClass = cpr == null;
                if (firstClass) {
                if (firstClass) {
                    try {
                    try {
                        checkTime(startTime, "getContentProviderImpl: before getApplicationInfo");
                        ApplicationInfo ai =
                        ApplicationInfo ai =
                            AppGlobals.getPackageManager().
                            AppGlobals.getPackageManager().
                                getApplicationInfo(
                                getApplicationInfo(
                                        cpi.applicationInfo.packageName,
                                        cpi.applicationInfo.packageName,
                                        STOCK_PM_FLAGS, userId);
                                        STOCK_PM_FLAGS, userId);
                        checkTime(startTime, "getContentProviderImpl: after getApplicationInfo");
                        if (ai == null) {
                        if (ai == null) {
                            Slog.w(TAG, "No package info for content provider "
                            Slog.w(TAG, "No package info for content provider "
                                    + cpi.name);
                                    + cpi.name);
@@ -9154,6 +9163,8 @@ public final class ActivityManagerService extends ActivityManagerNative
                    }
                    }
                }
                }
                checkTime(startTime, "getContentProviderImpl: now have ContentProviderRecord");
                if (r != null && cpr.canRunHere(r)) {
                if (r != null && cpr.canRunHere(r)) {
                    // If this is a multiprocess provider, then just return its
                    // If this is a multiprocess provider, then just return its
                    // info and allow the caller to instantiate it.  Only do
                    // info and allow the caller to instantiate it.  Only do
@@ -9187,8 +9198,10 @@ public final class ActivityManagerService extends ActivityManagerNative
                    try {
                    try {
                        // Content provider is now in use, its package can't be stopped.
                        // Content provider is now in use, its package can't be stopped.
                        try {
                        try {
                            checkTime(startTime, "getContentProviderImpl: before set stopped state");
                            AppGlobals.getPackageManager().setPackageStoppedState(
                            AppGlobals.getPackageManager().setPackageStoppedState(
                                    cpr.appInfo.packageName, false, userId);
                                    cpr.appInfo.packageName, false, userId);
                            checkTime(startTime, "getContentProviderImpl: after set stopped state");
                        } catch (RemoteException e) {
                        } catch (RemoteException e) {
                        } catch (IllegalArgumentException e) {
                        } catch (IllegalArgumentException e) {
                            Slog.w(TAG, "Failed trying to unstop package "
                            Slog.w(TAG, "Failed trying to unstop package "
@@ -9196,22 +9209,26 @@ public final class ActivityManagerService extends ActivityManagerNative
                        }
                        }
                        // Use existing process if already started
                        // Use existing process if already started
                        checkTime(startTime, "getContentProviderImpl: looking for process record");
                        ProcessRecord proc = getProcessRecordLocked(
                        ProcessRecord proc = getProcessRecordLocked(
                                cpi.processName, cpr.appInfo.uid, false);
                                cpi.processName, cpr.appInfo.uid, false);
                        if (proc != null && proc.thread != null) {
                        if (proc != null && proc.thread != null) {
                            if (DEBUG_PROVIDER) {
                            if (DEBUG_PROVIDER) {
                                Slog.d(TAG, "Installing in existing process " + proc);
                                Slog.d(TAG, "Installing in existing process " + proc);
                            }
                            }
                            checkTime(startTime, "getContentProviderImpl: scheduling install");
                            proc.pubProviders.put(cpi.name, cpr);
                            proc.pubProviders.put(cpi.name, cpr);
                            try {
                            try {
                                proc.thread.scheduleInstallProvider(cpi);
                                proc.thread.scheduleInstallProvider(cpi);
                            } catch (RemoteException e) {
                            } catch (RemoteException e) {
                            }
                            }
                        } else {
                        } else {
                            checkTime(startTime, "getContentProviderImpl: before start process");
                            proc = startProcessLocked(cpi.processName,
                            proc = startProcessLocked(cpi.processName,
                                    cpr.appInfo, false, 0, "content provider",
                                    cpr.appInfo, false, 0, "content provider",
                                    new ComponentName(cpi.applicationInfo.packageName,
                                    new ComponentName(cpi.applicationInfo.packageName,
                                            cpi.name), false, false, false);
                                            cpi.name), false, false, false);
                            checkTime(startTime, "getContentProviderImpl: after start process");
                            if (proc == null) {
                            if (proc == null) {
                                Slog.w(TAG, "Unable to launch app "
                                Slog.w(TAG, "Unable to launch app "
                                        + cpi.applicationInfo.packageName + "/"
                                        + cpi.applicationInfo.packageName + "/"
@@ -9227,6 +9244,8 @@ public final class ActivityManagerService extends ActivityManagerNative
                    }
                    }
                }
                }
                checkTime(startTime, "getContentProviderImpl: updating data structures");
                // Make sure the provider is published (the same provider class
                // Make sure the provider is published (the same provider class
                // may be published under multiple names).
                // may be published under multiple names).
                if (firstClass) {
                if (firstClass) {
@@ -9239,6 +9258,7 @@ public final class ActivityManagerService extends ActivityManagerNative
                    conn.waiting = true;
                    conn.waiting = true;
                }
                }
            }
            }
            checkTime(startTime, "getContentProviderImpl: done!");
        }
        }
        // Wait for the provider to be published...
        // Wait for the provider to be published...