Loading services/core/java/com/android/server/notification/NotificationRecord.java +1 −1 Original line number Diff line number Diff line Loading @@ -153,7 +153,7 @@ public final class NotificationRecord { final ApplicationInfo applicationInfo = mContext.getPackageManager().getApplicationInfoAsUser(sbn.getPackageName(), 0, UserHandle.getUserId(sbn.getUid())); if (applicationInfo.targetSdkVersion <= Build.VERSION_CODES.N_MR1) { if (applicationInfo.targetSdkVersion < Build.VERSION_CODES.O) { return true; } } Loading services/core/java/com/android/server/notification/RankingHelper.java +1 −1 Original line number Diff line number Diff line Loading @@ -286,7 +286,7 @@ public class RankingHelper implements RankingConfig { private boolean shouldHaveDefaultChannel(Record r) throws NameNotFoundException { final int userId = UserHandle.getUserId(r.uid); final ApplicationInfo applicationInfo = mPm.getApplicationInfoAsUser(r.pkg, 0, userId); if (applicationInfo.targetSdkVersion > Build.VERSION_CODES.N_MR1) { if (applicationInfo.targetSdkVersion >= Build.VERSION_CODES.O) { // O apps should not have the default channel. return false; } Loading services/tests/notification/src/com/android/server/notification/NotificationRecordTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -99,7 +99,7 @@ public class NotificationRecordTest extends NotificationTestCase { when(mMockContext.getPackageManager()).thenReturn(mPm); legacy.targetSdkVersion = Build.VERSION_CODES.N_MR1; upgrade.targetSdkVersion = Build.VERSION_CODES.N_MR1 + 1; upgrade.targetSdkVersion = Build.VERSION_CODES.O; try { when(mPm.getApplicationInfoAsUser(eq(pkg), anyInt(), anyInt())).thenReturn(legacy); when(mPm.getApplicationInfoAsUser(eq(pkg2), anyInt(), anyInt())).thenReturn(upgrade); Loading services/tests/notification/src/com/android/server/notification/RankingHelperTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -119,7 +119,7 @@ public class RankingHelperTest extends NotificationTestCase { final ApplicationInfo legacy = new ApplicationInfo(); legacy.targetSdkVersion = Build.VERSION_CODES.N_MR1; final ApplicationInfo upgrade = new ApplicationInfo(); upgrade.targetSdkVersion = Build.VERSION_CODES.N_MR1 + 1; upgrade.targetSdkVersion = Build.VERSION_CODES.O; when(mPm.getApplicationInfoAsUser(eq(PKG), anyInt(), anyInt())).thenReturn(legacy); when(mPm.getApplicationInfoAsUser(eq(UPDATED_PKG), anyInt(), anyInt())).thenReturn(upgrade); when(mPm.getPackageUidAsUser(eq(PKG), anyInt())).thenReturn(UID); Loading Loading
services/core/java/com/android/server/notification/NotificationRecord.java +1 −1 Original line number Diff line number Diff line Loading @@ -153,7 +153,7 @@ public final class NotificationRecord { final ApplicationInfo applicationInfo = mContext.getPackageManager().getApplicationInfoAsUser(sbn.getPackageName(), 0, UserHandle.getUserId(sbn.getUid())); if (applicationInfo.targetSdkVersion <= Build.VERSION_CODES.N_MR1) { if (applicationInfo.targetSdkVersion < Build.VERSION_CODES.O) { return true; } } Loading
services/core/java/com/android/server/notification/RankingHelper.java +1 −1 Original line number Diff line number Diff line Loading @@ -286,7 +286,7 @@ public class RankingHelper implements RankingConfig { private boolean shouldHaveDefaultChannel(Record r) throws NameNotFoundException { final int userId = UserHandle.getUserId(r.uid); final ApplicationInfo applicationInfo = mPm.getApplicationInfoAsUser(r.pkg, 0, userId); if (applicationInfo.targetSdkVersion > Build.VERSION_CODES.N_MR1) { if (applicationInfo.targetSdkVersion >= Build.VERSION_CODES.O) { // O apps should not have the default channel. return false; } Loading
services/tests/notification/src/com/android/server/notification/NotificationRecordTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -99,7 +99,7 @@ public class NotificationRecordTest extends NotificationTestCase { when(mMockContext.getPackageManager()).thenReturn(mPm); legacy.targetSdkVersion = Build.VERSION_CODES.N_MR1; upgrade.targetSdkVersion = Build.VERSION_CODES.N_MR1 + 1; upgrade.targetSdkVersion = Build.VERSION_CODES.O; try { when(mPm.getApplicationInfoAsUser(eq(pkg), anyInt(), anyInt())).thenReturn(legacy); when(mPm.getApplicationInfoAsUser(eq(pkg2), anyInt(), anyInt())).thenReturn(upgrade); Loading
services/tests/notification/src/com/android/server/notification/RankingHelperTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -119,7 +119,7 @@ public class RankingHelperTest extends NotificationTestCase { final ApplicationInfo legacy = new ApplicationInfo(); legacy.targetSdkVersion = Build.VERSION_CODES.N_MR1; final ApplicationInfo upgrade = new ApplicationInfo(); upgrade.targetSdkVersion = Build.VERSION_CODES.N_MR1 + 1; upgrade.targetSdkVersion = Build.VERSION_CODES.O; when(mPm.getApplicationInfoAsUser(eq(PKG), anyInt(), anyInt())).thenReturn(legacy); when(mPm.getApplicationInfoAsUser(eq(UPDATED_PKG), anyInt(), anyInt())).thenReturn(upgrade); when(mPm.getPackageUidAsUser(eq(PKG), anyInt())).thenReturn(UID); Loading