• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

frameworks/base


Commit MetaInfo

Revisión530518de4f7b0e82dfb34a6ebc5979d8da0701b4 (tree)
Tiempo2019-04-16 04:15:59
AutorJulia Reynolds <juliacr@goog...>
CommiterGreg Wroblewski

Log Message

[RESTRICT AUTOMERGE]: Add cross user permission check - areNotificationsEnabledForPackage

Test: atest
Fixes: 128599467
Change-Id: I13a0ca7590f8c4b44379730e0ee2088aba400c2a
(cherry picked from commit 657d164136199126ae241848887de0230699cea0)
(cherry picked from commit a2b2e377a0a63cbe9c8bfdfcab1167e55f36a59b)

Cambiar Resumen

Diferencia incremental

--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -1432,6 +1432,12 @@ public class NotificationManagerService extends SystemService {
14321432 @Override
14331433 public boolean areNotificationsEnabledForPackage(String pkg, int uid) {
14341434 checkCallerIsSystemOrSameApp(pkg);
1435+ if (UserHandle.getCallingUserId() != UserHandle.getUserId(uid)) {
1436+ getContext().enforceCallingPermission(
1437+ android.Manifest.permission.INTERACT_ACROSS_USERS,
1438+ "canNotifyAsPackage for uid " + uid);
1439+ }
1440+
14351441 return (mAppOps.checkOpNoThrow(AppOpsManager.OP_POST_NOTIFICATION, uid, pkg)
14361442 == AppOpsManager.MODE_ALLOWED) && !isPackageSuspendedForUser(pkg, uid);
14371443 }