Loading core/java/android/content/pm/PackageInstaller.java +2 −0 Original line number Diff line number Diff line Loading @@ -1571,6 +1571,7 @@ public class PackageInstaller { /** * Get the value set in {@link SessionParams#setOriginatingUri(Uri)}. * Note: This value will only be non-null for the owner of the session. */ public @Nullable Uri getOriginatingUri() { return originatingUri; Loading @@ -1585,6 +1586,7 @@ public class PackageInstaller { /** * Get the value set in {@link SessionParams#setReferrerUri(Uri)} * Note: This value will only be non-null for the owner of the session. */ public @Nullable Uri getReferrerUri() { return referrerUri; Loading location/java/com/android/internal/location/GpsNetInitiatedHandler.java +1 −6 Original line number Diff line number Diff line Loading @@ -21,7 +21,6 @@ import java.util.concurrent.TimeUnit; import android.app.Notification; import android.app.NotificationManager; import android.app.PendingIntent; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; Loading Loading @@ -402,13 +401,9 @@ public class GpsNetInitiatedHandler { mNiNotificationBuilder.setDefaults(0); } // if not to popup dialog immediately, pending intent will open the dialog Intent intent = !mPopupImmediately ? getDlgIntent(notif) : new Intent(); PendingIntent pi = PendingIntent.getBroadcast(mContext, 0, intent, 0); mNiNotificationBuilder.setTicker(getNotifTicker(notif, mContext)) .setContentTitle(title) .setContentText(message) .setContentIntent(pi); .setContentText(message); notificationManager.notifyAsUser(null, notif.notificationId, mNiNotificationBuilder.build(), UserHandle.ALL); Loading packages/SystemUI/src/com/android/systemui/util/leak/LeakReporter.java +6 −2 Original line number Diff line number Diff line Loading @@ -93,9 +93,13 @@ public class LeakReporter { .setContentText(String.format( "SystemUI has detected %d leaked objects. Tap to send", garbageCount)) .setSmallIcon(com.android.internal.R.drawable.stat_sys_adb) .setContentIntent(PendingIntent.getActivityAsUser(mContext, 0, .setContentIntent(PendingIntent.getActivityAsUser( mContext, 0, getIntent(hprofFile, dumpFile), PendingIntent.FLAG_UPDATE_CURRENT, null, UserHandle.CURRENT)); PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE, null, UserHandle.CURRENT)); notiMan.notify(TAG, 0, builder.build()); } catch (IOException e) { Log.e(TAG, "Couldn't dump heap for leak", e); Loading services/core/java/com/android/server/am/ActivityManagerService.java +9 −0 Original line number Diff line number Diff line Loading @@ -4331,9 +4331,18 @@ public class ActivityManagerService extends IActivityManager.Stub return procState; } private boolean isCallerShell() { final int callingUid = Binder.getCallingUid(); return callingUid == SHELL_UID || callingUid == ROOT_UID; } @Override public boolean setProcessMemoryTrimLevel(String process, int userId, int level) throws RemoteException { if (!isCallerShell()) { EventLog.writeEvent(0x534e4554, 160390416, Binder.getCallingUid(), ""); throw new SecurityException("Only shell can call it"); } synchronized (this) { final ProcessRecord app = findProcessLocked(process, userId, "setProcessMemoryTrimLevel"); if (app == null) { services/core/java/com/android/server/pm/PackageInstallerService.java +9 −4 Original line number Diff line number Diff line Loading @@ -683,20 +683,24 @@ public class PackageInstallerService extends IPackageInstaller.Stub { public SessionInfo getSessionInfo(int sessionId) { synchronized (mSessions) { final PackageInstallerSession session = mSessions.get(sessionId); return session != null ? session.generateInfo() : null; return session != null ? session.generateInfoForCaller(true /*withIcon*/, Binder.getCallingUid()) : null; } } @Override public ParceledListSlice<SessionInfo> getAllSessions(int userId) { mPm.enforceCrossUserPermission(Binder.getCallingUid(), userId, true, false, "getAllSessions"); final int callingUid = Binder.getCallingUid(); mPm.enforceCrossUserPermission(callingUid, userId, true, false, "getAllSessions"); final List<SessionInfo> result = new ArrayList<>(); synchronized (mSessions) { for (int i = 0; i < mSessions.size(); i++) { final PackageInstallerSession session = mSessions.valueAt(i); if (session.userId == userId) { result.add(session.generateInfo(false)); result.add(session.generateInfoForCaller(false, callingUid)); } } } Loading @@ -713,7 +717,8 @@ public class PackageInstallerService extends IPackageInstaller.Stub { for (int i = 0; i < mSessions.size(); i++) { final PackageInstallerSession session = mSessions.valueAt(i); SessionInfo info = session.generateInfo(false); SessionInfo info = session.generateInfoForCaller(false /*withIcon*/, Process.SYSTEM_UID); if (Objects.equals(info.getInstallerPackageName(), installerPackageName) && session.userId == userId) { result.add(info); Loading Loading
core/java/android/content/pm/PackageInstaller.java +2 −0 Original line number Diff line number Diff line Loading @@ -1571,6 +1571,7 @@ public class PackageInstaller { /** * Get the value set in {@link SessionParams#setOriginatingUri(Uri)}. * Note: This value will only be non-null for the owner of the session. */ public @Nullable Uri getOriginatingUri() { return originatingUri; Loading @@ -1585,6 +1586,7 @@ public class PackageInstaller { /** * Get the value set in {@link SessionParams#setReferrerUri(Uri)} * Note: This value will only be non-null for the owner of the session. */ public @Nullable Uri getReferrerUri() { return referrerUri; Loading
location/java/com/android/internal/location/GpsNetInitiatedHandler.java +1 −6 Original line number Diff line number Diff line Loading @@ -21,7 +21,6 @@ import java.util.concurrent.TimeUnit; import android.app.Notification; import android.app.NotificationManager; import android.app.PendingIntent; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; Loading Loading @@ -402,13 +401,9 @@ public class GpsNetInitiatedHandler { mNiNotificationBuilder.setDefaults(0); } // if not to popup dialog immediately, pending intent will open the dialog Intent intent = !mPopupImmediately ? getDlgIntent(notif) : new Intent(); PendingIntent pi = PendingIntent.getBroadcast(mContext, 0, intent, 0); mNiNotificationBuilder.setTicker(getNotifTicker(notif, mContext)) .setContentTitle(title) .setContentText(message) .setContentIntent(pi); .setContentText(message); notificationManager.notifyAsUser(null, notif.notificationId, mNiNotificationBuilder.build(), UserHandle.ALL); Loading
packages/SystemUI/src/com/android/systemui/util/leak/LeakReporter.java +6 −2 Original line number Diff line number Diff line Loading @@ -93,9 +93,13 @@ public class LeakReporter { .setContentText(String.format( "SystemUI has detected %d leaked objects. Tap to send", garbageCount)) .setSmallIcon(com.android.internal.R.drawable.stat_sys_adb) .setContentIntent(PendingIntent.getActivityAsUser(mContext, 0, .setContentIntent(PendingIntent.getActivityAsUser( mContext, 0, getIntent(hprofFile, dumpFile), PendingIntent.FLAG_UPDATE_CURRENT, null, UserHandle.CURRENT)); PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE, null, UserHandle.CURRENT)); notiMan.notify(TAG, 0, builder.build()); } catch (IOException e) { Log.e(TAG, "Couldn't dump heap for leak", e); Loading
services/core/java/com/android/server/am/ActivityManagerService.java +9 −0 Original line number Diff line number Diff line Loading @@ -4331,9 +4331,18 @@ public class ActivityManagerService extends IActivityManager.Stub return procState; } private boolean isCallerShell() { final int callingUid = Binder.getCallingUid(); return callingUid == SHELL_UID || callingUid == ROOT_UID; } @Override public boolean setProcessMemoryTrimLevel(String process, int userId, int level) throws RemoteException { if (!isCallerShell()) { EventLog.writeEvent(0x534e4554, 160390416, Binder.getCallingUid(), ""); throw new SecurityException("Only shell can call it"); } synchronized (this) { final ProcessRecord app = findProcessLocked(process, userId, "setProcessMemoryTrimLevel"); if (app == null) {
services/core/java/com/android/server/pm/PackageInstallerService.java +9 −4 Original line number Diff line number Diff line Loading @@ -683,20 +683,24 @@ public class PackageInstallerService extends IPackageInstaller.Stub { public SessionInfo getSessionInfo(int sessionId) { synchronized (mSessions) { final PackageInstallerSession session = mSessions.get(sessionId); return session != null ? session.generateInfo() : null; return session != null ? session.generateInfoForCaller(true /*withIcon*/, Binder.getCallingUid()) : null; } } @Override public ParceledListSlice<SessionInfo> getAllSessions(int userId) { mPm.enforceCrossUserPermission(Binder.getCallingUid(), userId, true, false, "getAllSessions"); final int callingUid = Binder.getCallingUid(); mPm.enforceCrossUserPermission(callingUid, userId, true, false, "getAllSessions"); final List<SessionInfo> result = new ArrayList<>(); synchronized (mSessions) { for (int i = 0; i < mSessions.size(); i++) { final PackageInstallerSession session = mSessions.valueAt(i); if (session.userId == userId) { result.add(session.generateInfo(false)); result.add(session.generateInfoForCaller(false, callingUid)); } } } Loading @@ -713,7 +717,8 @@ public class PackageInstallerService extends IPackageInstaller.Stub { for (int i = 0; i < mSessions.size(); i++) { final PackageInstallerSession session = mSessions.valueAt(i); SessionInfo info = session.generateInfo(false); SessionInfo info = session.generateInfoForCaller(false /*withIcon*/, Process.SYSTEM_UID); if (Objects.equals(info.getInstallerPackageName(), installerPackageName) && session.userId == userId) { result.add(info); Loading