Loading core/java/android/app/ForegroundServiceTypePolicy.java +7 −0 Original line number Original line Diff line number Diff line Loading @@ -1328,6 +1328,13 @@ public abstract class ForegroundServiceTypePolicy { if (!android.app.Flags.systemDialerPhoneCallFgsGrant()) { if (!android.app.Flags.systemDialerPhoneCallFgsGrant()) { return PERMISSION_DENIED; return PERMISSION_DENIED; } } final RoleManager roleManager = context.getSystemService(RoleManager.class); if (!roleManager.isRoleAvailable(RoleManager.ROLE_DIALER)) { // If the Dialer role does not exist on the device, then there will not be a system // dialer which can use the phone call FGS type. return PERMISSION_DENIED; } final TelecomManager tm = context.getSystemService(TelecomManager.class); final TelecomManager tm = context.getSystemService(TelecomManager.class); final String systemDialerPackage = tm.getSystemDialerPackage(); final String systemDialerPackage = tm.getSystemDialerPackage(); return systemDialerPackage != null && systemDialerPackage.equals(packageName) return systemDialerPackage != null && systemDialerPackage.equals(packageName) Loading Loading
core/java/android/app/ForegroundServiceTypePolicy.java +7 −0 Original line number Original line Diff line number Diff line Loading @@ -1328,6 +1328,13 @@ public abstract class ForegroundServiceTypePolicy { if (!android.app.Flags.systemDialerPhoneCallFgsGrant()) { if (!android.app.Flags.systemDialerPhoneCallFgsGrant()) { return PERMISSION_DENIED; return PERMISSION_DENIED; } } final RoleManager roleManager = context.getSystemService(RoleManager.class); if (!roleManager.isRoleAvailable(RoleManager.ROLE_DIALER)) { // If the Dialer role does not exist on the device, then there will not be a system // dialer which can use the phone call FGS type. return PERMISSION_DENIED; } final TelecomManager tm = context.getSystemService(TelecomManager.class); final TelecomManager tm = context.getSystemService(TelecomManager.class); final String systemDialerPackage = tm.getSystemDialerPackage(); final String systemDialerPackage = tm.getSystemDialerPackage(); return systemDialerPackage != null && systemDialerPackage.equals(packageName) return systemDialerPackage != null && systemDialerPackage.equals(packageName) Loading