Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +41 −0 Original line number Diff line number Diff line Loading @@ -137,6 +137,8 @@ import com.android.systemui.statusbar.phone.ShadeController; import com.android.systemui.statusbar.phone.StatusBar; import com.android.systemui.statusbar.policy.ConfigurationController; import com.android.systemui.statusbar.policy.ConfigurationController.ConfigurationListener; import com.android.systemui.statusbar.policy.DeviceProvisionedController; import com.android.systemui.statusbar.policy.DeviceProvisionedController.DeviceProvisionedListener; import com.android.systemui.statusbar.policy.HeadsUpUtil; import com.android.systemui.statusbar.policy.ScrollAdapter; import com.android.systemui.tuner.TunerService; Loading Loading @@ -284,6 +286,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd private boolean mExpandedInThisMotion; private boolean mShouldShowShelfOnly; protected boolean mScrollingEnabled; private boolean mIsCurrentUserSetup; protected FooterView mFooterView; protected EmptyShadeView mEmptyShadeView; private boolean mDismissAllInProgress; Loading Loading @@ -484,6 +487,8 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd private final Rect mTmpRect = new Rect(); private final NotificationEntryManager mEntryManager = Dependency.get(NotificationEntryManager.class); private final DeviceProvisionedController mDeviceProvisionedController = Dependency.get(DeviceProvisionedController.class); private final IStatusBarService mBarService = IStatusBarService.Stub.asInterface( ServiceManager.getService(Context.STATUS_BAR_SERVICE)); @VisibleForTesting Loading Loading @@ -605,6 +610,28 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd }, HIGH_PRIORITY, Settings.Secure.NOTIFICATION_DISMISS_RTL, LOCKSCREEN_TRANSLUCENT_NOTIFICATIONS_BG_ENABLED); mDeviceProvisionedController.addCallback( new DeviceProvisionedListener() { @Override public void onDeviceProvisionedChanged() { updateCurrentUserIsSetup(); } @Override public void onUserSwitched() { updateCurrentUserIsSetup(); } @Override public void onUserSetupChanged() { updateCurrentUserIsSetup(); } private void updateCurrentUserIsSetup() { setCurrentUserSetup(mDeviceProvisionedController.isCurrentUserSetup()); } }); mEntryManager.addNotificationEntryListener(new NotificationEntryListener() { @Override public void onPostEntryUpdated(NotificationEntry entry) { Loading Loading @@ -694,9 +721,13 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd @VisibleForTesting @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) public void updateFooter() { if (mFooterView == null) { return; } boolean showDismissView = mClearAllEnabled && hasActiveClearableNotifications(ROWS_ALL); boolean showFooterView = (showDismissView || mEntryManager.getNotificationData().getActiveNotifications().size() != 0) && mIsCurrentUserSetup // see: b/193149550 && mStatusBarState != StatusBarState.KEYGUARD && !mRemoteInputManager.getController().isRemoteInputActive(); Loading Loading @@ -5746,6 +5777,16 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd return MathUtils.smoothStep(0, totalDistance, dragDownAmount); } /** * Sets whether the current user is set up, which is required to show the footer (b/193149550) */ public void setCurrentUserSetup(boolean isCurrentUserSetup) { if (mIsCurrentUserSetup != isCurrentUserSetup) { mIsCurrentUserSetup = isCurrentUserSetup; updateFooter(); } } /** * A listener that is notified when the empty space below the notifications is clicked on */ Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java +27 −0 Original line number Diff line number Diff line Loading @@ -299,6 +299,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { @Test public void testUpdateFooter_noNotifications() { setBarStateForTest(StatusBarState.SHADE); mStackScroller.setCurrentUserSetup(true); assertEquals(0, mNotificationData.getActiveNotifications().size()); mStackScroller.updateFooter(); Loading @@ -308,6 +309,8 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { @Test public void testUpdateFooter_remoteInput() { setBarStateForTest(StatusBarState.SHADE); mStackScroller.setCurrentUserSetup(true); ArrayList<NotificationEntry> entries = new ArrayList<>(); entries.add(mock(NotificationEntry.class)); when(mNotificationData.getActiveNotifications()).thenReturn(entries); Loading @@ -325,6 +328,8 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { @Test public void testUpdateFooter_oneClearableNotification() { setBarStateForTest(StatusBarState.SHADE); mStackScroller.setCurrentUserSetup(true); ArrayList<NotificationEntry> entries = new ArrayList<>(); entries.add(mock(NotificationEntry.class)); when(mNotificationData.getActiveNotifications()).thenReturn(entries); Loading @@ -338,9 +343,29 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { verify(mStackScroller).updateFooterView(true, true); } @Test public void testUpdateFooter_oneClearableNotification_beforeUserSetup() { setBarStateForTest(StatusBarState.SHADE); mStackScroller.setCurrentUserSetup(false); ArrayList<NotificationEntry> entries = new ArrayList<>(); entries.add(mock(NotificationEntry.class)); when(mNotificationData.getActiveNotifications()).thenReturn(entries); ExpandableNotificationRow row = mock(ExpandableNotificationRow.class); when(row.canViewBeDismissed()).thenReturn(true); when(mStackScroller.getChildCount()).thenReturn(1); when(mStackScroller.getChildAt(anyInt())).thenReturn(row); mStackScroller.updateFooter(); verify(mStackScroller).updateFooterView(false, true); } @Test public void testUpdateFooter_oneNonClearableNotification() { setBarStateForTest(StatusBarState.SHADE); mStackScroller.setCurrentUserSetup(true); ArrayList<NotificationEntry> entries = new ArrayList<>(); entries.add(mock(NotificationEntry.class)); when(mEntryManager.getNotificationData().getActiveNotifications()).thenReturn(entries); Loading @@ -352,6 +377,8 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { @Test public void testUpdateFooter_atEnd() { mStackScroller.setCurrentUserSetup(true); // add footer mStackScroller.inflateFooterView(); Loading services/core/java/com/android/server/notification/NotificationManagerService.java +3 −2 Original line number Diff line number Diff line Loading @@ -2087,7 +2087,7 @@ public class NotificationManagerService extends SystemService { } } private void createNotificationChannelGroup(String pkg, int uid, NotificationChannelGroup group, void createNotificationChannelGroup(String pkg, int uid, NotificationChannelGroup group, boolean fromApp, boolean fromListener) { Preconditions.checkNotNull(group); Preconditions.checkNotNull(pkg); Loading Loading @@ -2881,7 +2881,8 @@ public class NotificationManagerService extends SystemService { final int callingUid = Binder.getCallingUid(); NotificationChannelGroup groupToDelete = mPreferencesHelper.getNotificationChannelGroup(groupId, pkg, callingUid); mPreferencesHelper.getNotificationChannelGroupWithChannels( pkg, callingUid, groupId, false); if (groupToDelete != null) { // Preflight for allowability final int userId = UserHandle.getUserId(callingUid); Loading services/core/java/com/android/server/pm/PackageInstallerService.java +11 −4 Original line number Diff line number Diff line Loading @@ -337,7 +337,13 @@ public class PackageInstallerService extends IPackageInstaller.Stub implements if (age >= MAX_SESSION_AGE_ON_LOW_STORAGE_MILLIS) { // Aggressively close old sessions because we are running low on storage // Their staging dirs will be removed too session.abandon(); PackageInstallerSession root = !session.hasParentSessionId() ? session : mSessions.get(session.getParentSessionId()); if (!root.isDestroyed() && (!root.isStaged() || (root.isStaged() && root.isStagedSessionReady()))) { root.abandon(); } } else { // Session is new enough, so it deserves to be kept even on low storage unclaimedStagingDirsOnVolume.remove(session.stageDir); Loading Loading @@ -660,7 +666,7 @@ public class PackageInstallerService extends IPackageInstaller.Stub implements session = new PackageInstallerSession(mInternalCallback, mContext, mPm, this, mInstallThread.getLooper(), mStagingManager, sessionId, userId, installerPackageName, callingUid, params, createdMillis, stageDir, stageCid, false, false, false, null, SessionInfo.INVALID_ID, false, false, false, false, false, false, null, SessionInfo.INVALID_ID, false, false, false, SessionInfo.STAGED_SESSION_NO_ERROR, ""); synchronized (mSessions) { Loading Loading @@ -810,7 +816,7 @@ public class PackageInstallerService extends IPackageInstaller.Stub implements synchronized (mSessions) { final PackageInstallerSession session = mSessions.get(sessionId); return session != null return (session != null && !(session.isStaged() && session.isDestroyed())) ? session.generateInfoForCaller(true /*withIcon*/, Binder.getCallingUid()) : null; } Loading @@ -831,7 +837,8 @@ public class PackageInstallerService extends IPackageInstaller.Stub implements synchronized (mSessions) { for (int i = 0; i < mSessions.size(); i++) { final PackageInstallerSession session = mSessions.valueAt(i); if (session.userId == userId && !session.hasParentSessionId()) { if (session.userId == userId && !session.hasParentSessionId() && !(session.isStaged() && session.isDestroyed())) { result.add(session.generateInfoForCaller(false, callingUid)); } } Loading services/core/java/com/android/server/pm/PackageInstallerSession.java +16 −5 Original line number Diff line number Diff line Loading @@ -151,6 +151,7 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub { private static final String ATTR_SESSION_STAGE_CID = "sessionStageCid"; private static final String ATTR_PREPARED = "prepared"; private static final String ATTR_COMMITTED = "committed"; private static final String ATTR_DESTROYED = "destroyed"; private static final String ATTR_SEALED = "sealed"; private static final String ATTR_MULTI_PACKAGE = "multiPackage"; private static final String ATTR_PARENT_SESSION_ID = "parentSessionId"; Loading Loading @@ -413,8 +414,8 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub { PackageSessionProvider sessionProvider, Looper looper, StagingManager stagingManager, int sessionId, int userId, String installerPackageName, int installerUid, SessionParams params, long createdMillis, File stageDir, String stageCid, boolean prepared, boolean committed, boolean sealed, @Nullable int[] childSessionIds, int parentSessionId, boolean isReady, File stageDir, String stageCid, boolean prepared, boolean committed, boolean destroyed, boolean sealed, @Nullable int[] childSessionIds, int parentSessionId, boolean isReady, boolean isFailed, boolean isApplied, int stagedSessionErrorCode, String stagedSessionErrorMessage) { mCallback = callback; Loading Loading @@ -449,6 +450,7 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub { mPrepared = prepared; mCommitted = committed; mDestroyed = destroyed; mStagedSessionReady = isReady; mStagedSessionFailed = isFailed; mStagedSessionApplied = isApplied; Loading Loading @@ -559,6 +561,13 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub { } } /** {@hide} */ boolean isDestroyed() { synchronized (mLock) { return mDestroyed; } } /** Returns true if a staged session has reached a final state and can be forgotten about */ public boolean isStagedAndInTerminalState() { synchronized (mLock) { Loading Loading @@ -2423,7 +2432,7 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub { */ void write(@NonNull XmlSerializer out, @NonNull File sessionsDir) throws IOException { synchronized (mLock) { if (mDestroyed) { if (mDestroyed && !params.isStaged) { return; } Loading @@ -2445,6 +2454,7 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub { } writeBooleanAttribute(out, ATTR_PREPARED, isPrepared()); writeBooleanAttribute(out, ATTR_COMMITTED, isCommitted()); writeBooleanAttribute(out, ATTR_DESTROYED, isDestroyed()); writeBooleanAttribute(out, ATTR_SEALED, isSealed()); writeBooleanAttribute(out, ATTR_MULTI_PACKAGE, params.isMultiPackage); Loading Loading @@ -2546,6 +2556,7 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub { final String stageCid = readStringAttribute(in, ATTR_SESSION_STAGE_CID); final boolean prepared = readBooleanAttribute(in, ATTR_PREPARED, true); final boolean committed = readBooleanAttribute(in, ATTR_COMMITTED); final boolean destroyed = readBooleanAttribute(in, ATTR_DESTROYED); final boolean sealed = readBooleanAttribute(in, ATTR_SEALED); final int parentSessionId = readIntAttribute(in, ATTR_PARENT_SESSION_ID, SessionInfo.INVALID_ID); Loading Loading @@ -2633,8 +2644,8 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub { return new PackageInstallerSession(callback, context, pm, sessionProvider, installerThread, stagingManager, sessionId, userId, installerPackageName, installerUid, params, createdMillis, stageDir, stageCid, prepared, committed, sealed, childSessionIdsArray, parentSessionId, isReady, isFailed, isApplied, stagedSessionErrorCode, stagedSessionErrorMessage); destroyed, sealed, childSessionIdsArray, parentSessionId, isReady, isFailed, isApplied, stagedSessionErrorCode, stagedSessionErrorMessage); } /** Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +41 −0 Original line number Diff line number Diff line Loading @@ -137,6 +137,8 @@ import com.android.systemui.statusbar.phone.ShadeController; import com.android.systemui.statusbar.phone.StatusBar; import com.android.systemui.statusbar.policy.ConfigurationController; import com.android.systemui.statusbar.policy.ConfigurationController.ConfigurationListener; import com.android.systemui.statusbar.policy.DeviceProvisionedController; import com.android.systemui.statusbar.policy.DeviceProvisionedController.DeviceProvisionedListener; import com.android.systemui.statusbar.policy.HeadsUpUtil; import com.android.systemui.statusbar.policy.ScrollAdapter; import com.android.systemui.tuner.TunerService; Loading Loading @@ -284,6 +286,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd private boolean mExpandedInThisMotion; private boolean mShouldShowShelfOnly; protected boolean mScrollingEnabled; private boolean mIsCurrentUserSetup; protected FooterView mFooterView; protected EmptyShadeView mEmptyShadeView; private boolean mDismissAllInProgress; Loading Loading @@ -484,6 +487,8 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd private final Rect mTmpRect = new Rect(); private final NotificationEntryManager mEntryManager = Dependency.get(NotificationEntryManager.class); private final DeviceProvisionedController mDeviceProvisionedController = Dependency.get(DeviceProvisionedController.class); private final IStatusBarService mBarService = IStatusBarService.Stub.asInterface( ServiceManager.getService(Context.STATUS_BAR_SERVICE)); @VisibleForTesting Loading Loading @@ -605,6 +610,28 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd }, HIGH_PRIORITY, Settings.Secure.NOTIFICATION_DISMISS_RTL, LOCKSCREEN_TRANSLUCENT_NOTIFICATIONS_BG_ENABLED); mDeviceProvisionedController.addCallback( new DeviceProvisionedListener() { @Override public void onDeviceProvisionedChanged() { updateCurrentUserIsSetup(); } @Override public void onUserSwitched() { updateCurrentUserIsSetup(); } @Override public void onUserSetupChanged() { updateCurrentUserIsSetup(); } private void updateCurrentUserIsSetup() { setCurrentUserSetup(mDeviceProvisionedController.isCurrentUserSetup()); } }); mEntryManager.addNotificationEntryListener(new NotificationEntryListener() { @Override public void onPostEntryUpdated(NotificationEntry entry) { Loading Loading @@ -694,9 +721,13 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd @VisibleForTesting @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) public void updateFooter() { if (mFooterView == null) { return; } boolean showDismissView = mClearAllEnabled && hasActiveClearableNotifications(ROWS_ALL); boolean showFooterView = (showDismissView || mEntryManager.getNotificationData().getActiveNotifications().size() != 0) && mIsCurrentUserSetup // see: b/193149550 && mStatusBarState != StatusBarState.KEYGUARD && !mRemoteInputManager.getController().isRemoteInputActive(); Loading Loading @@ -5746,6 +5777,16 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd return MathUtils.smoothStep(0, totalDistance, dragDownAmount); } /** * Sets whether the current user is set up, which is required to show the footer (b/193149550) */ public void setCurrentUserSetup(boolean isCurrentUserSetup) { if (mIsCurrentUserSetup != isCurrentUserSetup) { mIsCurrentUserSetup = isCurrentUserSetup; updateFooter(); } } /** * A listener that is notified when the empty space below the notifications is clicked on */ Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java +27 −0 Original line number Diff line number Diff line Loading @@ -299,6 +299,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { @Test public void testUpdateFooter_noNotifications() { setBarStateForTest(StatusBarState.SHADE); mStackScroller.setCurrentUserSetup(true); assertEquals(0, mNotificationData.getActiveNotifications().size()); mStackScroller.updateFooter(); Loading @@ -308,6 +309,8 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { @Test public void testUpdateFooter_remoteInput() { setBarStateForTest(StatusBarState.SHADE); mStackScroller.setCurrentUserSetup(true); ArrayList<NotificationEntry> entries = new ArrayList<>(); entries.add(mock(NotificationEntry.class)); when(mNotificationData.getActiveNotifications()).thenReturn(entries); Loading @@ -325,6 +328,8 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { @Test public void testUpdateFooter_oneClearableNotification() { setBarStateForTest(StatusBarState.SHADE); mStackScroller.setCurrentUserSetup(true); ArrayList<NotificationEntry> entries = new ArrayList<>(); entries.add(mock(NotificationEntry.class)); when(mNotificationData.getActiveNotifications()).thenReturn(entries); Loading @@ -338,9 +343,29 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { verify(mStackScroller).updateFooterView(true, true); } @Test public void testUpdateFooter_oneClearableNotification_beforeUserSetup() { setBarStateForTest(StatusBarState.SHADE); mStackScroller.setCurrentUserSetup(false); ArrayList<NotificationEntry> entries = new ArrayList<>(); entries.add(mock(NotificationEntry.class)); when(mNotificationData.getActiveNotifications()).thenReturn(entries); ExpandableNotificationRow row = mock(ExpandableNotificationRow.class); when(row.canViewBeDismissed()).thenReturn(true); when(mStackScroller.getChildCount()).thenReturn(1); when(mStackScroller.getChildAt(anyInt())).thenReturn(row); mStackScroller.updateFooter(); verify(mStackScroller).updateFooterView(false, true); } @Test public void testUpdateFooter_oneNonClearableNotification() { setBarStateForTest(StatusBarState.SHADE); mStackScroller.setCurrentUserSetup(true); ArrayList<NotificationEntry> entries = new ArrayList<>(); entries.add(mock(NotificationEntry.class)); when(mEntryManager.getNotificationData().getActiveNotifications()).thenReturn(entries); Loading @@ -352,6 +377,8 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { @Test public void testUpdateFooter_atEnd() { mStackScroller.setCurrentUserSetup(true); // add footer mStackScroller.inflateFooterView(); Loading
services/core/java/com/android/server/notification/NotificationManagerService.java +3 −2 Original line number Diff line number Diff line Loading @@ -2087,7 +2087,7 @@ public class NotificationManagerService extends SystemService { } } private void createNotificationChannelGroup(String pkg, int uid, NotificationChannelGroup group, void createNotificationChannelGroup(String pkg, int uid, NotificationChannelGroup group, boolean fromApp, boolean fromListener) { Preconditions.checkNotNull(group); Preconditions.checkNotNull(pkg); Loading Loading @@ -2881,7 +2881,8 @@ public class NotificationManagerService extends SystemService { final int callingUid = Binder.getCallingUid(); NotificationChannelGroup groupToDelete = mPreferencesHelper.getNotificationChannelGroup(groupId, pkg, callingUid); mPreferencesHelper.getNotificationChannelGroupWithChannels( pkg, callingUid, groupId, false); if (groupToDelete != null) { // Preflight for allowability final int userId = UserHandle.getUserId(callingUid); Loading
services/core/java/com/android/server/pm/PackageInstallerService.java +11 −4 Original line number Diff line number Diff line Loading @@ -337,7 +337,13 @@ public class PackageInstallerService extends IPackageInstaller.Stub implements if (age >= MAX_SESSION_AGE_ON_LOW_STORAGE_MILLIS) { // Aggressively close old sessions because we are running low on storage // Their staging dirs will be removed too session.abandon(); PackageInstallerSession root = !session.hasParentSessionId() ? session : mSessions.get(session.getParentSessionId()); if (!root.isDestroyed() && (!root.isStaged() || (root.isStaged() && root.isStagedSessionReady()))) { root.abandon(); } } else { // Session is new enough, so it deserves to be kept even on low storage unclaimedStagingDirsOnVolume.remove(session.stageDir); Loading Loading @@ -660,7 +666,7 @@ public class PackageInstallerService extends IPackageInstaller.Stub implements session = new PackageInstallerSession(mInternalCallback, mContext, mPm, this, mInstallThread.getLooper(), mStagingManager, sessionId, userId, installerPackageName, callingUid, params, createdMillis, stageDir, stageCid, false, false, false, null, SessionInfo.INVALID_ID, false, false, false, false, false, false, null, SessionInfo.INVALID_ID, false, false, false, SessionInfo.STAGED_SESSION_NO_ERROR, ""); synchronized (mSessions) { Loading Loading @@ -810,7 +816,7 @@ public class PackageInstallerService extends IPackageInstaller.Stub implements synchronized (mSessions) { final PackageInstallerSession session = mSessions.get(sessionId); return session != null return (session != null && !(session.isStaged() && session.isDestroyed())) ? session.generateInfoForCaller(true /*withIcon*/, Binder.getCallingUid()) : null; } Loading @@ -831,7 +837,8 @@ public class PackageInstallerService extends IPackageInstaller.Stub implements synchronized (mSessions) { for (int i = 0; i < mSessions.size(); i++) { final PackageInstallerSession session = mSessions.valueAt(i); if (session.userId == userId && !session.hasParentSessionId()) { if (session.userId == userId && !session.hasParentSessionId() && !(session.isStaged() && session.isDestroyed())) { result.add(session.generateInfoForCaller(false, callingUid)); } } Loading
services/core/java/com/android/server/pm/PackageInstallerSession.java +16 −5 Original line number Diff line number Diff line Loading @@ -151,6 +151,7 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub { private static final String ATTR_SESSION_STAGE_CID = "sessionStageCid"; private static final String ATTR_PREPARED = "prepared"; private static final String ATTR_COMMITTED = "committed"; private static final String ATTR_DESTROYED = "destroyed"; private static final String ATTR_SEALED = "sealed"; private static final String ATTR_MULTI_PACKAGE = "multiPackage"; private static final String ATTR_PARENT_SESSION_ID = "parentSessionId"; Loading Loading @@ -413,8 +414,8 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub { PackageSessionProvider sessionProvider, Looper looper, StagingManager stagingManager, int sessionId, int userId, String installerPackageName, int installerUid, SessionParams params, long createdMillis, File stageDir, String stageCid, boolean prepared, boolean committed, boolean sealed, @Nullable int[] childSessionIds, int parentSessionId, boolean isReady, File stageDir, String stageCid, boolean prepared, boolean committed, boolean destroyed, boolean sealed, @Nullable int[] childSessionIds, int parentSessionId, boolean isReady, boolean isFailed, boolean isApplied, int stagedSessionErrorCode, String stagedSessionErrorMessage) { mCallback = callback; Loading Loading @@ -449,6 +450,7 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub { mPrepared = prepared; mCommitted = committed; mDestroyed = destroyed; mStagedSessionReady = isReady; mStagedSessionFailed = isFailed; mStagedSessionApplied = isApplied; Loading Loading @@ -559,6 +561,13 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub { } } /** {@hide} */ boolean isDestroyed() { synchronized (mLock) { return mDestroyed; } } /** Returns true if a staged session has reached a final state and can be forgotten about */ public boolean isStagedAndInTerminalState() { synchronized (mLock) { Loading Loading @@ -2423,7 +2432,7 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub { */ void write(@NonNull XmlSerializer out, @NonNull File sessionsDir) throws IOException { synchronized (mLock) { if (mDestroyed) { if (mDestroyed && !params.isStaged) { return; } Loading @@ -2445,6 +2454,7 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub { } writeBooleanAttribute(out, ATTR_PREPARED, isPrepared()); writeBooleanAttribute(out, ATTR_COMMITTED, isCommitted()); writeBooleanAttribute(out, ATTR_DESTROYED, isDestroyed()); writeBooleanAttribute(out, ATTR_SEALED, isSealed()); writeBooleanAttribute(out, ATTR_MULTI_PACKAGE, params.isMultiPackage); Loading Loading @@ -2546,6 +2556,7 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub { final String stageCid = readStringAttribute(in, ATTR_SESSION_STAGE_CID); final boolean prepared = readBooleanAttribute(in, ATTR_PREPARED, true); final boolean committed = readBooleanAttribute(in, ATTR_COMMITTED); final boolean destroyed = readBooleanAttribute(in, ATTR_DESTROYED); final boolean sealed = readBooleanAttribute(in, ATTR_SEALED); final int parentSessionId = readIntAttribute(in, ATTR_PARENT_SESSION_ID, SessionInfo.INVALID_ID); Loading Loading @@ -2633,8 +2644,8 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub { return new PackageInstallerSession(callback, context, pm, sessionProvider, installerThread, stagingManager, sessionId, userId, installerPackageName, installerUid, params, createdMillis, stageDir, stageCid, prepared, committed, sealed, childSessionIdsArray, parentSessionId, isReady, isFailed, isApplied, stagedSessionErrorCode, stagedSessionErrorMessage); destroyed, sealed, childSessionIdsArray, parentSessionId, isReady, isFailed, isApplied, stagedSessionErrorCode, stagedSessionErrorMessage); } /** Loading