Not log error when isPackageEnabled = false

Which is expected when package is not installed or not enabled.

Bug: 369427597
Flag: EXEMPT log only
Test: manual - on sub pages of Settings
Change-Id: Ic8bcf0df8b91d50215be2df8eba20eb447258d1e
This commit is contained in:
Chaohui Wang
2024-10-11 11:41:44 +08:00
parent f7d9c87ac7
commit fa5b1a2329

View File

@@ -1180,9 +1180,9 @@ public final class Utils extends com.android.settingslib.Utils {
try {
return context.getPackageManager().getApplicationInfo(packageName, 0).enabled;
} catch (Exception e) {
Log.e(TAG, "Error while retrieving application info for package " + packageName, e);
// Expected, package is not installed or not enabled.
return false;
}
return false;
}
/** Get {@link Resources} by subscription id if subscription id is valid. */