New System Api: getGroupIdLevel2
- add new flag
Bug: b/381171540
Test: atest
FLAG: com.android.internal.telephony.flags.get_group_id_level2
Change-Id: Ie49c055747f6e5e9f676ba0afe9f31700868b8ba
diff --git a/flags/uicc.aconfig b/flags/uicc.aconfig
index aed4bff..d97f397 100644
--- a/flags/uicc.aconfig
+++ b/flags/uicc.aconfig
@@ -107,3 +107,11 @@
purpose: PURPOSE_BUGFIX
}
}
+
+# OWNER=jinjeong TARGET=25Q2
+flag {
+ name: "get_group_id_level2"
+ namespace: "telephony"
+ description: "This flag controls to get a group id level2."
+ bug:"381171540"
+}
diff --git a/src/java/com/android/internal/telephony/PhoneSubInfoController.java b/src/java/com/android/internal/telephony/PhoneSubInfoController.java
index c40193e..9801542 100644
--- a/src/java/com/android/internal/telephony/PhoneSubInfoController.java
+++ b/src/java/com/android/internal/telephony/PhoneSubInfoController.java
@@ -659,6 +659,20 @@
});
}
+ /**
+ * Return GroupIdLevel2 for the subscriber
+ */
+ public String getGroupIdLevel2ForSubscriber(int subId, String callingPackage,
+ String callingFeatureId) {
+ return callPhoneMethodForSubIdWithPrivilegedCheck(subId,
+ "getGroupIdLevel2", (phone)-> {
+ enforceTelephonyFeatureWithException(callingPackage,
+ PackageManager.FEATURE_TELEPHONY_SUBSCRIPTION,
+ "getGroupIdLevel2ForSubscriber");
+ return phone.getGroupIdLevel2();
+ });
+ }
+
/** Below are utility methods that abstracts the flow that many public methods use:
* 1. Check permission: pass, throw exception, or fails (returns false).
* 2. clearCallingIdentity.