Merge "Handle USER_ALL in instant apps call" into qt-dev am: 58b7cf731d am: c0030892d8
am: a508243ca3
Change-Id: I726a1ede4650b60ace04dabed2e2d3bf05047ac3
This commit is contained in:
@@ -7200,6 +7200,10 @@ public class NotificationManagerService extends SystemService {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (userId == UserHandle.USER_ALL) {
|
||||
userId = USER_SYSTEM;
|
||||
}
|
||||
|
||||
try {
|
||||
final String[] pkgs = mPackageManager.getPackagesForUid(callingUid);
|
||||
if (pkgs == null) {
|
||||
|
||||
@@ -3814,6 +3814,20 @@ public class NotificationManagerServiceTest extends UiServiceTestCase {
|
||||
assertTrue(mService.isCallerInstantApp(68638450, 10));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIsCallerInstantApp_userAllNotification() throws Exception {
|
||||
ApplicationInfo info = new ApplicationInfo();
|
||||
info.privateFlags = ApplicationInfo.PRIVATE_FLAG_INSTANT;
|
||||
when(mPackageManager.getApplicationInfo(anyString(), anyInt(), eq(UserHandle.USER_SYSTEM)))
|
||||
.thenReturn(info);
|
||||
when(mPackageManager.getPackagesForUid(anyInt())).thenReturn(new String[]{"any"});
|
||||
|
||||
assertTrue(mService.isCallerInstantApp(45770, UserHandle.USER_ALL));
|
||||
|
||||
info.privateFlags = 0;
|
||||
assertFalse(mService.isCallerInstantApp(575370, UserHandle.USER_ALL ));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testResolveNotificationUid_sameApp_nonSystemUser() throws Exception {
|
||||
ApplicationInfo info = new ApplicationInfo();
|
||||
|
||||
Reference in New Issue
Block a user