diff options
author | Sarah Chin <sarahchin@google.com> | 2024-01-18 13:25:40 -0800 |
---|---|---|
committer | Sarah Chin <sarahchin@google.com> | 2024-01-18 13:25:43 -0800 |
commit | 591fa7e87b3c45c224e315bbbc23f7ae988bcd4c (patch) | |
tree | 4e18362b98cbee6266375db8b10dde0fe8de5733 /ts43authentication/src/com/android | |
parent | ad6737024bddd19b4712645eba6a32bd04fd8ca6 (diff) | |
download | gsma_services-591fa7e87b3c45c224e315bbbc23f7ae988bcd4c.tar.gz |
Add SDK check for T+ API
Test: build
Bug: 320750914
Change-Id: I61766e4c416722847d7dec144ce92f7d1026f0f9
Diffstat (limited to 'ts43authentication/src/com/android')
-rw-r--r-- | ts43authentication/src/com/android/libraries/ts43authentication/Ts43AuthenticationLibrary.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/ts43authentication/src/com/android/libraries/ts43authentication/Ts43AuthenticationLibrary.java b/ts43authentication/src/com/android/libraries/ts43authentication/Ts43AuthenticationLibrary.java index be3931d..ea8e80c 100644 --- a/ts43authentication/src/com/android/libraries/ts43authentication/Ts43AuthenticationLibrary.java +++ b/ts43authentication/src/com/android/libraries/ts43authentication/Ts43AuthenticationLibrary.java @@ -22,6 +22,7 @@ import android.content.pm.PackageManager; import android.content.pm.Signature; import android.content.pm.SigningInfo; import android.os.Binder; +import android.os.Build; import android.os.Handler; import android.os.Looper; import android.os.Message; @@ -412,8 +413,14 @@ public class Ts43AuthenticationLibrary extends Handler { @Nullable private Signature[] getMainPackageSignatures(String packageName) { PackageInfo packageInfo; try { - packageInfo = mPackageManager.getPackageInfo(packageName, - PackageManager.PackageInfoFlags.of(PackageManager.GET_SIGNING_CERTIFICATES)); + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) { + packageInfo = mPackageManager.getPackageInfo(packageName, + PackageManager.GET_SIGNING_CERTIFICATES); + } else { + packageInfo = mPackageManager.getPackageInfo(packageName, + PackageManager.PackageInfoFlags.of( + PackageManager.GET_SIGNING_CERTIFICATES)); + } } catch (PackageManager.NameNotFoundException e) { Log.e(TAG, "Unable to find package name: " + packageName); return null; |