Add null check before trying to give appOps to package.

Test: none
Bug: 164209140
Change-Id: I64184e9d035be538684c42c85c869f09b048069f
This commit is contained in:
Amit Mahajan 2021-04-15 16:47:10 -07:00
parent ac6f5ee927
commit fc8f430092

View File

@ -760,6 +760,7 @@ public final class SmsApplication {
private static void assignExclusiveSmsPermissionsToSystemApp(Context context,
PackageManager packageManager, AppOpsManager appOps, String packageName,
boolean sigatureMatch) {
if (packageName == null) return;
// First check package signature matches the caller's package signature.
// Since this class is only used internally by the system, this check makes sure
// the package signature matches system signature.