Loading services/java/com/android/server/am/ActivityManagerService.java +1 −1 Original line number Diff line number Diff line Loading @@ -8486,7 +8486,7 @@ public final class ActivityManagerService extends ActivityManagerNative Iterator<ActivityRecord> it = mHomeProcess.activities.iterator(); while (it.hasNext()) { ActivityRecord r = it.next(); if (r.isHomeActivity) { if (r.isHomeActivity()) { Log.i(TAG, "Clearing package preferred activities from " + r.packageName); try { ActivityThread.getPackageManager() Loading services/java/com/android/server/am/ActivityRecord.java +33 −11 Original line number Diff line number Diff line Loading @@ -74,7 +74,12 @@ final class ActivityRecord { final boolean fullscreen; // covers the full screen? final boolean noDisplay; // activity is not displayed? final boolean componentSpecified; // did caller specifiy an explicit component? final boolean isHomeActivity; // do we consider this to be a home activity? static final int APPLICATION_ACTIVITY_TYPE = 0; static final int HOME_ACTIVITY_TYPE = 1; static final int RECENTS_ACTIVITY_TYPE = 2; final int mActivityType; final String baseDir; // where activity source (resources etc) located final String resDir; // where public activity source (public resources etc) located final String dataDir; // where activity data should go Loading Loading @@ -158,7 +163,7 @@ final class ActivityRecord { pw.print(prefix); pw.print("dataDir="); pw.println(dataDir); pw.print(prefix); pw.print("stateNotNeeded="); pw.print(stateNotNeeded); pw.print(" componentSpecified="); pw.print(componentSpecified); pw.print(" isHomeActivity="); pw.println(isHomeActivity); pw.print(" mActivityType="); pw.println(mActivityType); pw.print(prefix); pw.print("compat="); pw.print(compat); pw.print(" labelRes=0x"); pw.print(Integer.toHexString(labelRes)); pw.print(" icon=0x"); pw.print(Integer.toHexString(icon)); Loading Loading @@ -436,8 +441,7 @@ final class ActivityRecord { // activity as being home... really, we don't care about // doing anything special with something that comes from // the core framework package. isHomeActivity = (!_componentSpecified || _launchedFromUid == Process.myUid() if ((!_componentSpecified || _launchedFromUid == Process.myUid() || _launchedFromUid == 0) && Intent.ACTION_MAIN.equals(_intent.getAction()) && _intent.hasCategory(Intent.CATEGORY_HOME) && Loading @@ -445,8 +449,14 @@ final class ActivityRecord { _intent.getData() == null && _intent.getType() == null && (intent.getFlags()&Intent.FLAG_ACTIVITY_NEW_TASK) != 0 && !ResolverActivity.class.getName().equals(realActivity.getClassName()); !ResolverActivity.class.getName().equals(realActivity.getClassName())) { // This sure looks like a home activity! mActivityType = HOME_ACTIVITY_TYPE; } else if (realActivity.getClassName().contains("com.android.systemui.recent")) { mActivityType = RECENTS_ACTIVITY_TYPE; } else { mActivityType = APPLICATION_ACTIVITY_TYPE; } immersive = (aInfo.flags & ActivityInfo.FLAG_IMMERSIVE) != 0; } else { Loading @@ -460,7 +470,7 @@ final class ActivityRecord { packageName = null; fullscreen = true; noDisplay = false; isHomeActivity = false; mActivityType = APPLICATION_ACTIVITY_TYPE; immersive = false; } } Loading Loading @@ -515,6 +525,18 @@ final class ActivityRecord { return inHistory; } boolean isHomeActivity() { return mActivityType == HOME_ACTIVITY_TYPE; } boolean isRecentsActivity() { return mActivityType == RECENTS_ACTIVITY_TYPE; } boolean isApplicationActivity() { return mActivityType == APPLICATION_ACTIVITY_TYPE; } void makeFinishing() { if (!finishing) { finishing = true; Loading Loading @@ -580,7 +602,6 @@ final class ActivityRecord { * method will be called at the proper time. */ final void deliverNewIntentLocked(int callingUid, Intent intent) { boolean sent = false; // The activity now gets access to the data associated with this Intent. service.grantUriPermissionFromIntentLocked(callingUid, packageName, intent, getUriPermissionsLocked()); Loading @@ -589,6 +610,7 @@ final class ActivityRecord { // device is sleeping, then all activities are stopped, so in that // case we will deliver it if this is the current top activity on its // stack. boolean unsent = true; if ((state == ActivityState.RESUMED || (service.mSleeping && task.stack.topRunningActivityLocked(null) == this)) && app != null && app.thread != null) { Loading @@ -597,7 +619,7 @@ final class ActivityRecord { intent = new Intent(intent); ar.add(intent); app.thread.scheduleNewIntent(ar, appToken); sent = true; unsent = false; } catch (RemoteException e) { Slog.w(ActivityManagerService.TAG, "Exception thrown sending new intent to " + this, e); Loading @@ -606,7 +628,7 @@ final class ActivityRecord { "Exception thrown sending new intent to " + this, e); } } if (!sent) { if (unsent) { addNewIntentLocked(new Intent(intent)); } } Loading services/java/com/android/server/am/ActivityStack.java +4 −2 Original line number Diff line number Diff line Loading @@ -2251,7 +2251,7 @@ final class ActivityStack { if (r.state == ActivityState.RESUMED || r.state == ActivityState.PAUSING || r.state == ActivityState.PAUSED) { if (!r.isHomeActivity || mService.mHomeProcess != r.app) { if (!r.isHomeActivity() || mService.mHomeProcess != r.app) { Slog.w(TAG, " Force finishing activity " + r.intent.getComponent().flattenToShortString()); finishActivityLocked(r, Activity.RESULT_CANCELED, null, "crashed", false); Loading Loading @@ -2932,7 +2932,7 @@ final class ActivityStack { final int numTasks = mTaskHistory.size(); final int index = mTaskHistory.indexOf(tr); if (numTasks == 0 || index < 0 || index == numTasks - 1) { if (numTasks == 0 || index < 0) { // nothing to do! if (reason != null && (reason.intent.getFlags()&Intent.FLAG_ACTIVITY_NO_ANIMATION) != 0) { Loading @@ -2943,6 +2943,8 @@ final class ActivityStack { return; } mStackSupervisor.moveHomeStack(isHomeStack()); // Shift all activities with this task up to the top // of the stack, keeping them in the same internal order. mTaskHistory.remove(tr); Loading services/java/com/android/server/am/ActivityStackSupervisor.java +5 −5 Original line number Diff line number Diff line Loading @@ -251,11 +251,11 @@ public class ActivityStackSupervisor { return; } if ((sourceRecord == null && getLastStack() == mHomeStack) || (sourceRecord != null && sourceRecord.isHomeActivity)) { (sourceRecord != null && sourceRecord.isHomeActivity())) { if (r == null) { r = stack.topRunningActivityLocked(null); } if (r != null && !r.isHomeActivity && r.isRootActivity()) { if (r != null && !r.isHomeActivity() && r.isRootActivity()) { r.mLaunchHomeTaskNext = true; } } Loading Loading @@ -839,7 +839,7 @@ public class ActivityStackSupervisor { r.userId, System.identityHashCode(r), r.task.taskId, r.shortComponentName); } if (r.isHomeActivity) { if (r.isHomeActivity()) { mService.mHomeProcess = app; } mService.ensurePackageDexOpt(r.intent.getComponent().getPackageName()); Loading Loading @@ -1160,7 +1160,7 @@ public class ActivityStackSupervisor { } ActivityStack getCorrectStack(ActivityRecord r) { if (!r.isHomeActivity || (r.task != null && !r.task.isHomeTask())) { if (r.isApplicationActivity() || (r.task != null && r.task.isApplicationTask())) { int stackNdx; for (stackNdx = mStacks.size() - 1; stackNdx > 0; --stackNdx) { if (mStacks.get(stackNdx).mCurrentUser == mCurrentUser) { Loading @@ -1182,7 +1182,7 @@ public class ActivityStackSupervisor { if (r == null) { return; } if (r.isHomeActivity || (r.task != null && r.task.isHomeTask())) { if (!r.isApplicationActivity() || (r.task != null && !r.task.isApplicationTask())) { if (mStackState != STACK_STATE_HOME_IN_FRONT) { mStackState = STACK_STATE_HOME_TO_FRONT; } Loading services/java/com/android/server/am/TaskRecord.java +4 −4 Original line number Diff line number Diff line Loading @@ -57,7 +57,7 @@ class TaskRecord extends ThumbnailHolder { /** Current stack */ ActivityStack stack; private boolean mHomeTask; private boolean mApplicationTask; TaskRecord(int _taskId, ActivityInfo info, Intent _intent, ActivityStack _stack) { taskId = _taskId; Loading Loading @@ -164,7 +164,7 @@ class TaskRecord extends ThumbnailHolder { // Was not previously in list. numFullscreen++; } mHomeTask = r.isHomeActivity; mApplicationTask = r.isApplicationActivity(); mActivities.add(index, r); } Loading Loading @@ -316,8 +316,8 @@ class TaskRecord extends ThumbnailHolder { return subtask.activity; } boolean isHomeTask() { return mHomeTask; boolean isApplicationTask() { return mApplicationTask; } public TaskAccessInfo getTaskAccessInfoLocked(boolean inclThumbs) { Loading Loading
services/java/com/android/server/am/ActivityManagerService.java +1 −1 Original line number Diff line number Diff line Loading @@ -8486,7 +8486,7 @@ public final class ActivityManagerService extends ActivityManagerNative Iterator<ActivityRecord> it = mHomeProcess.activities.iterator(); while (it.hasNext()) { ActivityRecord r = it.next(); if (r.isHomeActivity) { if (r.isHomeActivity()) { Log.i(TAG, "Clearing package preferred activities from " + r.packageName); try { ActivityThread.getPackageManager() Loading
services/java/com/android/server/am/ActivityRecord.java +33 −11 Original line number Diff line number Diff line Loading @@ -74,7 +74,12 @@ final class ActivityRecord { final boolean fullscreen; // covers the full screen? final boolean noDisplay; // activity is not displayed? final boolean componentSpecified; // did caller specifiy an explicit component? final boolean isHomeActivity; // do we consider this to be a home activity? static final int APPLICATION_ACTIVITY_TYPE = 0; static final int HOME_ACTIVITY_TYPE = 1; static final int RECENTS_ACTIVITY_TYPE = 2; final int mActivityType; final String baseDir; // where activity source (resources etc) located final String resDir; // where public activity source (public resources etc) located final String dataDir; // where activity data should go Loading Loading @@ -158,7 +163,7 @@ final class ActivityRecord { pw.print(prefix); pw.print("dataDir="); pw.println(dataDir); pw.print(prefix); pw.print("stateNotNeeded="); pw.print(stateNotNeeded); pw.print(" componentSpecified="); pw.print(componentSpecified); pw.print(" isHomeActivity="); pw.println(isHomeActivity); pw.print(" mActivityType="); pw.println(mActivityType); pw.print(prefix); pw.print("compat="); pw.print(compat); pw.print(" labelRes=0x"); pw.print(Integer.toHexString(labelRes)); pw.print(" icon=0x"); pw.print(Integer.toHexString(icon)); Loading Loading @@ -436,8 +441,7 @@ final class ActivityRecord { // activity as being home... really, we don't care about // doing anything special with something that comes from // the core framework package. isHomeActivity = (!_componentSpecified || _launchedFromUid == Process.myUid() if ((!_componentSpecified || _launchedFromUid == Process.myUid() || _launchedFromUid == 0) && Intent.ACTION_MAIN.equals(_intent.getAction()) && _intent.hasCategory(Intent.CATEGORY_HOME) && Loading @@ -445,8 +449,14 @@ final class ActivityRecord { _intent.getData() == null && _intent.getType() == null && (intent.getFlags()&Intent.FLAG_ACTIVITY_NEW_TASK) != 0 && !ResolverActivity.class.getName().equals(realActivity.getClassName()); !ResolverActivity.class.getName().equals(realActivity.getClassName())) { // This sure looks like a home activity! mActivityType = HOME_ACTIVITY_TYPE; } else if (realActivity.getClassName().contains("com.android.systemui.recent")) { mActivityType = RECENTS_ACTIVITY_TYPE; } else { mActivityType = APPLICATION_ACTIVITY_TYPE; } immersive = (aInfo.flags & ActivityInfo.FLAG_IMMERSIVE) != 0; } else { Loading @@ -460,7 +470,7 @@ final class ActivityRecord { packageName = null; fullscreen = true; noDisplay = false; isHomeActivity = false; mActivityType = APPLICATION_ACTIVITY_TYPE; immersive = false; } } Loading Loading @@ -515,6 +525,18 @@ final class ActivityRecord { return inHistory; } boolean isHomeActivity() { return mActivityType == HOME_ACTIVITY_TYPE; } boolean isRecentsActivity() { return mActivityType == RECENTS_ACTIVITY_TYPE; } boolean isApplicationActivity() { return mActivityType == APPLICATION_ACTIVITY_TYPE; } void makeFinishing() { if (!finishing) { finishing = true; Loading Loading @@ -580,7 +602,6 @@ final class ActivityRecord { * method will be called at the proper time. */ final void deliverNewIntentLocked(int callingUid, Intent intent) { boolean sent = false; // The activity now gets access to the data associated with this Intent. service.grantUriPermissionFromIntentLocked(callingUid, packageName, intent, getUriPermissionsLocked()); Loading @@ -589,6 +610,7 @@ final class ActivityRecord { // device is sleeping, then all activities are stopped, so in that // case we will deliver it if this is the current top activity on its // stack. boolean unsent = true; if ((state == ActivityState.RESUMED || (service.mSleeping && task.stack.topRunningActivityLocked(null) == this)) && app != null && app.thread != null) { Loading @@ -597,7 +619,7 @@ final class ActivityRecord { intent = new Intent(intent); ar.add(intent); app.thread.scheduleNewIntent(ar, appToken); sent = true; unsent = false; } catch (RemoteException e) { Slog.w(ActivityManagerService.TAG, "Exception thrown sending new intent to " + this, e); Loading @@ -606,7 +628,7 @@ final class ActivityRecord { "Exception thrown sending new intent to " + this, e); } } if (!sent) { if (unsent) { addNewIntentLocked(new Intent(intent)); } } Loading
services/java/com/android/server/am/ActivityStack.java +4 −2 Original line number Diff line number Diff line Loading @@ -2251,7 +2251,7 @@ final class ActivityStack { if (r.state == ActivityState.RESUMED || r.state == ActivityState.PAUSING || r.state == ActivityState.PAUSED) { if (!r.isHomeActivity || mService.mHomeProcess != r.app) { if (!r.isHomeActivity() || mService.mHomeProcess != r.app) { Slog.w(TAG, " Force finishing activity " + r.intent.getComponent().flattenToShortString()); finishActivityLocked(r, Activity.RESULT_CANCELED, null, "crashed", false); Loading Loading @@ -2932,7 +2932,7 @@ final class ActivityStack { final int numTasks = mTaskHistory.size(); final int index = mTaskHistory.indexOf(tr); if (numTasks == 0 || index < 0 || index == numTasks - 1) { if (numTasks == 0 || index < 0) { // nothing to do! if (reason != null && (reason.intent.getFlags()&Intent.FLAG_ACTIVITY_NO_ANIMATION) != 0) { Loading @@ -2943,6 +2943,8 @@ final class ActivityStack { return; } mStackSupervisor.moveHomeStack(isHomeStack()); // Shift all activities with this task up to the top // of the stack, keeping them in the same internal order. mTaskHistory.remove(tr); Loading
services/java/com/android/server/am/ActivityStackSupervisor.java +5 −5 Original line number Diff line number Diff line Loading @@ -251,11 +251,11 @@ public class ActivityStackSupervisor { return; } if ((sourceRecord == null && getLastStack() == mHomeStack) || (sourceRecord != null && sourceRecord.isHomeActivity)) { (sourceRecord != null && sourceRecord.isHomeActivity())) { if (r == null) { r = stack.topRunningActivityLocked(null); } if (r != null && !r.isHomeActivity && r.isRootActivity()) { if (r != null && !r.isHomeActivity() && r.isRootActivity()) { r.mLaunchHomeTaskNext = true; } } Loading Loading @@ -839,7 +839,7 @@ public class ActivityStackSupervisor { r.userId, System.identityHashCode(r), r.task.taskId, r.shortComponentName); } if (r.isHomeActivity) { if (r.isHomeActivity()) { mService.mHomeProcess = app; } mService.ensurePackageDexOpt(r.intent.getComponent().getPackageName()); Loading Loading @@ -1160,7 +1160,7 @@ public class ActivityStackSupervisor { } ActivityStack getCorrectStack(ActivityRecord r) { if (!r.isHomeActivity || (r.task != null && !r.task.isHomeTask())) { if (r.isApplicationActivity() || (r.task != null && r.task.isApplicationTask())) { int stackNdx; for (stackNdx = mStacks.size() - 1; stackNdx > 0; --stackNdx) { if (mStacks.get(stackNdx).mCurrentUser == mCurrentUser) { Loading @@ -1182,7 +1182,7 @@ public class ActivityStackSupervisor { if (r == null) { return; } if (r.isHomeActivity || (r.task != null && r.task.isHomeTask())) { if (!r.isApplicationActivity() || (r.task != null && !r.task.isApplicationTask())) { if (mStackState != STACK_STATE_HOME_IN_FRONT) { mStackState = STACK_STATE_HOME_TO_FRONT; } Loading
services/java/com/android/server/am/TaskRecord.java +4 −4 Original line number Diff line number Diff line Loading @@ -57,7 +57,7 @@ class TaskRecord extends ThumbnailHolder { /** Current stack */ ActivityStack stack; private boolean mHomeTask; private boolean mApplicationTask; TaskRecord(int _taskId, ActivityInfo info, Intent _intent, ActivityStack _stack) { taskId = _taskId; Loading Loading @@ -164,7 +164,7 @@ class TaskRecord extends ThumbnailHolder { // Was not previously in list. numFullscreen++; } mHomeTask = r.isHomeActivity; mApplicationTask = r.isApplicationActivity(); mActivities.add(index, r); } Loading Loading @@ -316,8 +316,8 @@ class TaskRecord extends ThumbnailHolder { return subtask.activity; } boolean isHomeTask() { return mHomeTask; boolean isApplicationTask() { return mApplicationTask; } public TaskAccessInfo getTaskAccessInfoLocked(boolean inclThumbs) { Loading