Loading core/java/android/content/pm/IPackageInstallerSession.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -46,4 +46,5 @@ interface IPackageInstallerSession { int getParentSessionId(); boolean isStaged(); int getInstallFlags(); } core/java/android/content/pm/PackageInstaller.java +12 −0 Original line number Diff line number Diff line Loading @@ -1175,6 +1175,18 @@ public class PackageInstaller { } } /** * @return Session's {@link SessionParams#installFlags}. * @hide */ public int getInstallFlags() { try { return mSession.getInstallFlags(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * @return the session ID of the multi-package session that this belongs to or * {@link SessionInfo#INVALID_ID} if it does not belong to a multi-package session. Loading core/java/com/android/internal/policy/IKeyguardStateCallback.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ package com.android.internal.policy; interface IKeyguardStateCallback { void onShowingStateChanged(boolean showing); void onShowingStateChanged(boolean showing, int userId); void onSimSecureStateChanged(boolean simSecure); void onInputRestrictedStateChanged(boolean inputRestricted); void onTrustedChanged(boolean trusted); Loading packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +11 −5 Original line number Diff line number Diff line Loading @@ -1269,7 +1269,9 @@ public class KeyguardViewMediator extends SystemUI { public void doKeyguardTimeout(Bundle options) { mHandler.removeMessages(KEYGUARD_TIMEOUT); Message msg = mHandler.obtainMessage(KEYGUARD_TIMEOUT, options); mHandler.sendMessage(msg); // Treat these messages with priority - A call to timeout means the device should lock // as soon as possible and not wait for other messages on the thread to process first. mHandler.sendMessageAtFrontOfQueue(msg); } /** Loading Loading @@ -1458,12 +1460,15 @@ public class KeyguardViewMediator extends SystemUI { * @see #handleShow */ private void showLocked(Bundle options) { Trace.beginSection("KeyguardViewMediator#showLocked aqcuiring mShowKeyguardWakeLock"); Trace.beginSection("KeyguardViewMediator#showLocked acquiring mShowKeyguardWakeLock"); if (DEBUG) Log.d(TAG, "showLocked"); // ensure we stay awake until we are finished displaying the keyguard mShowKeyguardWakeLock.acquire(); Message msg = mHandler.obtainMessage(SHOW, options); mHandler.sendMessage(msg); // Treat these messages with priority - This call can originate from #doKeyguardTimeout, // meaning the device should lock as soon as possible and not wait for other messages on // the thread to process first. mHandler.sendMessageAtFrontOfQueue(msg); Trace.endSection(); } Loading Loading @@ -1622,6 +1627,7 @@ public class KeyguardViewMediator extends SystemUI { case KEYGUARD_TIMEOUT: synchronized (KeyguardViewMediator.this) { doKeyguardLocked((Bundle) msg.obj); notifyDefaultDisplayCallbacks(mShowing); } break; case DISMISS: Loading Loading @@ -2209,7 +2215,7 @@ public class KeyguardViewMediator extends SystemUI { for (int i = size - 1; i >= 0; i--) { IKeyguardStateCallback callback = mKeyguardStateCallbacks.get(i); try { callback.onShowingStateChanged(showing); callback.onShowingStateChanged(showing, KeyguardUpdateMonitor.getCurrentUser()); } catch (RemoteException e) { Slog.w(TAG, "Failed to call onShowingStateChanged", e); if (e instanceof DeadObjectException) { Loading Loading @@ -2257,7 +2263,7 @@ public class KeyguardViewMediator extends SystemUI { mKeyguardStateCallbacks.add(callback); try { callback.onSimSecureStateChanged(mUpdateMonitor.isSimPinSecure()); callback.onShowingStateChanged(mShowing); callback.onShowingStateChanged(mShowing, KeyguardUpdateMonitor.getCurrentUser()); callback.onInputRestrictedStateChanged(mInputRestricted); callback.onTrustedChanged(mUpdateMonitor.getUserHasTrust( KeyguardUpdateMonitor.getCurrentUser())); Loading services/core/java/com/android/server/notification/NotificationManagerService.java +32 −11 Original line number Diff line number Diff line Loading @@ -521,16 +521,27 @@ public class NotificationManagerService extends SystemService { return mBuffer.descendingIterator(); } public StatusBarNotification[] getArray(int count) { public StatusBarNotification[] getArray(UserManager um, int count) { ArrayList<Integer> currentUsers = new ArrayList<>(); currentUsers.add(UserHandle.USER_ALL); Binder.withCleanCallingIdentity(() -> { for (int user : um.getProfileIds(ActivityManager.getCurrentUser(), false)) { currentUsers.add(user); } }); if (count == 0) count = mBufferSize; final StatusBarNotification[] a = new StatusBarNotification[Math.min(count, mBuffer.size())]; List<StatusBarNotification> a = new ArrayList(); Iterator<StatusBarNotification> iter = descendingIterator(); int i=0; while (iter.hasNext() && i < count) { a[i++] = iter.next(); StatusBarNotification sbn = iter.next(); if (currentUsers.contains(sbn.getUserId())) { i++; a.add(sbn); } } return a; return a.toArray(new StatusBarNotification[a.size()]); } } Loading Loading @@ -3087,21 +3098,31 @@ public class NotificationManagerService extends SystemService { android.Manifest.permission.ACCESS_NOTIFICATIONS, "NotificationManagerService.getActiveNotifications"); StatusBarNotification[] tmp = null; ArrayList<StatusBarNotification> tmp = new ArrayList<>(); int uid = Binder.getCallingUid(); ArrayList<Integer> currentUsers = new ArrayList<>(); currentUsers.add(UserHandle.USER_ALL); Binder.withCleanCallingIdentity(() -> { for (int user : mUm.getProfileIds(ActivityManager.getCurrentUser(), false)) { currentUsers.add(user); } }); // noteOp will check to make sure the callingPkg matches the uid if (mAppOps.noteOpNoThrow(AppOpsManager.OP_ACCESS_NOTIFICATIONS, uid, callingPkg) == AppOpsManager.MODE_ALLOWED) { synchronized (mNotificationLock) { tmp = new StatusBarNotification[mNotificationList.size()]; final int N = mNotificationList.size(); for (int i = 0; i < N; i++) { tmp[i] = mNotificationList.get(i).sbn; final StatusBarNotification sbn = mNotificationList.get(i).sbn; if (currentUsers.contains(sbn.getUserId())) { tmp.add(sbn); } } } return tmp; } return tmp.toArray(new StatusBarNotification[tmp.size()]); } /** Loading Loading @@ -3197,7 +3218,7 @@ public class NotificationManagerService extends SystemService { if (mAppOps.noteOpNoThrow(AppOpsManager.OP_ACCESS_NOTIFICATIONS, uid, callingPkg) == AppOpsManager.MODE_ALLOWED) { synchronized (mArchive) { tmp = mArchive.getArray(count); tmp = mArchive.getArray(mUm, count); } } return tmp; Loading Loading
core/java/android/content/pm/IPackageInstallerSession.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -46,4 +46,5 @@ interface IPackageInstallerSession { int getParentSessionId(); boolean isStaged(); int getInstallFlags(); }
core/java/android/content/pm/PackageInstaller.java +12 −0 Original line number Diff line number Diff line Loading @@ -1175,6 +1175,18 @@ public class PackageInstaller { } } /** * @return Session's {@link SessionParams#installFlags}. * @hide */ public int getInstallFlags() { try { return mSession.getInstallFlags(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * @return the session ID of the multi-package session that this belongs to or * {@link SessionInfo#INVALID_ID} if it does not belong to a multi-package session. Loading
core/java/com/android/internal/policy/IKeyguardStateCallback.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ package com.android.internal.policy; interface IKeyguardStateCallback { void onShowingStateChanged(boolean showing); void onShowingStateChanged(boolean showing, int userId); void onSimSecureStateChanged(boolean simSecure); void onInputRestrictedStateChanged(boolean inputRestricted); void onTrustedChanged(boolean trusted); Loading
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +11 −5 Original line number Diff line number Diff line Loading @@ -1269,7 +1269,9 @@ public class KeyguardViewMediator extends SystemUI { public void doKeyguardTimeout(Bundle options) { mHandler.removeMessages(KEYGUARD_TIMEOUT); Message msg = mHandler.obtainMessage(KEYGUARD_TIMEOUT, options); mHandler.sendMessage(msg); // Treat these messages with priority - A call to timeout means the device should lock // as soon as possible and not wait for other messages on the thread to process first. mHandler.sendMessageAtFrontOfQueue(msg); } /** Loading Loading @@ -1458,12 +1460,15 @@ public class KeyguardViewMediator extends SystemUI { * @see #handleShow */ private void showLocked(Bundle options) { Trace.beginSection("KeyguardViewMediator#showLocked aqcuiring mShowKeyguardWakeLock"); Trace.beginSection("KeyguardViewMediator#showLocked acquiring mShowKeyguardWakeLock"); if (DEBUG) Log.d(TAG, "showLocked"); // ensure we stay awake until we are finished displaying the keyguard mShowKeyguardWakeLock.acquire(); Message msg = mHandler.obtainMessage(SHOW, options); mHandler.sendMessage(msg); // Treat these messages with priority - This call can originate from #doKeyguardTimeout, // meaning the device should lock as soon as possible and not wait for other messages on // the thread to process first. mHandler.sendMessageAtFrontOfQueue(msg); Trace.endSection(); } Loading Loading @@ -1622,6 +1627,7 @@ public class KeyguardViewMediator extends SystemUI { case KEYGUARD_TIMEOUT: synchronized (KeyguardViewMediator.this) { doKeyguardLocked((Bundle) msg.obj); notifyDefaultDisplayCallbacks(mShowing); } break; case DISMISS: Loading Loading @@ -2209,7 +2215,7 @@ public class KeyguardViewMediator extends SystemUI { for (int i = size - 1; i >= 0; i--) { IKeyguardStateCallback callback = mKeyguardStateCallbacks.get(i); try { callback.onShowingStateChanged(showing); callback.onShowingStateChanged(showing, KeyguardUpdateMonitor.getCurrentUser()); } catch (RemoteException e) { Slog.w(TAG, "Failed to call onShowingStateChanged", e); if (e instanceof DeadObjectException) { Loading Loading @@ -2257,7 +2263,7 @@ public class KeyguardViewMediator extends SystemUI { mKeyguardStateCallbacks.add(callback); try { callback.onSimSecureStateChanged(mUpdateMonitor.isSimPinSecure()); callback.onShowingStateChanged(mShowing); callback.onShowingStateChanged(mShowing, KeyguardUpdateMonitor.getCurrentUser()); callback.onInputRestrictedStateChanged(mInputRestricted); callback.onTrustedChanged(mUpdateMonitor.getUserHasTrust( KeyguardUpdateMonitor.getCurrentUser())); Loading
services/core/java/com/android/server/notification/NotificationManagerService.java +32 −11 Original line number Diff line number Diff line Loading @@ -521,16 +521,27 @@ public class NotificationManagerService extends SystemService { return mBuffer.descendingIterator(); } public StatusBarNotification[] getArray(int count) { public StatusBarNotification[] getArray(UserManager um, int count) { ArrayList<Integer> currentUsers = new ArrayList<>(); currentUsers.add(UserHandle.USER_ALL); Binder.withCleanCallingIdentity(() -> { for (int user : um.getProfileIds(ActivityManager.getCurrentUser(), false)) { currentUsers.add(user); } }); if (count == 0) count = mBufferSize; final StatusBarNotification[] a = new StatusBarNotification[Math.min(count, mBuffer.size())]; List<StatusBarNotification> a = new ArrayList(); Iterator<StatusBarNotification> iter = descendingIterator(); int i=0; while (iter.hasNext() && i < count) { a[i++] = iter.next(); StatusBarNotification sbn = iter.next(); if (currentUsers.contains(sbn.getUserId())) { i++; a.add(sbn); } } return a; return a.toArray(new StatusBarNotification[a.size()]); } } Loading Loading @@ -3087,21 +3098,31 @@ public class NotificationManagerService extends SystemService { android.Manifest.permission.ACCESS_NOTIFICATIONS, "NotificationManagerService.getActiveNotifications"); StatusBarNotification[] tmp = null; ArrayList<StatusBarNotification> tmp = new ArrayList<>(); int uid = Binder.getCallingUid(); ArrayList<Integer> currentUsers = new ArrayList<>(); currentUsers.add(UserHandle.USER_ALL); Binder.withCleanCallingIdentity(() -> { for (int user : mUm.getProfileIds(ActivityManager.getCurrentUser(), false)) { currentUsers.add(user); } }); // noteOp will check to make sure the callingPkg matches the uid if (mAppOps.noteOpNoThrow(AppOpsManager.OP_ACCESS_NOTIFICATIONS, uid, callingPkg) == AppOpsManager.MODE_ALLOWED) { synchronized (mNotificationLock) { tmp = new StatusBarNotification[mNotificationList.size()]; final int N = mNotificationList.size(); for (int i = 0; i < N; i++) { tmp[i] = mNotificationList.get(i).sbn; final StatusBarNotification sbn = mNotificationList.get(i).sbn; if (currentUsers.contains(sbn.getUserId())) { tmp.add(sbn); } } } return tmp; } return tmp.toArray(new StatusBarNotification[tmp.size()]); } /** Loading Loading @@ -3197,7 +3218,7 @@ public class NotificationManagerService extends SystemService { if (mAppOps.noteOpNoThrow(AppOpsManager.OP_ACCESS_NOTIFICATIONS, uid, callingPkg) == AppOpsManager.MODE_ALLOWED) { synchronized (mArchive) { tmp = mArchive.getArray(count); tmp = mArchive.getArray(mUm, count); } } return tmp; Loading