Fixed the incorrect uid check for HSUM mode
In the HSUM mode, the uid is pre-fixed with user id. Fixed by
using the correct method to check uid.
Fix: 367402314
Flag: EXEMPT bug fix
Test: Basic telephony functionality tests
Test: atest FrameworksTelephonyTests TeleServicesTest
Change-Id: I1ecf9c7ac6bf3515b15f7ba7bcc23b603608f19a
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index ae0cc3f..d5ae671 100644
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -9597,7 +9597,7 @@
private WorkSource getWorkSource(int uid) {
String packageName = mApp.getPackageManager().getNameForUid(uid);
- if (uid == Process.ROOT_UID && packageName == null) {
+ if (UserHandle.isSameApp(uid, Process.ROOT_UID) && packageName == null) {
// Downstream WorkSource attribution inside the RIL requires both a UID and package name
// to be set for wakelock tracking, otherwise RIL requests fail with a runtime
// exception. ROOT_UID seems not to have a valid package name returned by
@@ -11319,7 +11319,7 @@
// In fact, the current code acquires way too many,
// and probably has lurking deadlocks.
- if (Binder.getCallingUid() != Process.SYSTEM_UID) {
+ if (!UserHandle.isSameApp(Binder.getCallingUid(), Process.SYSTEM_UID)) {
throw new SecurityException("Only the OS may call notifyUserActivity()");
}