Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit db9b4500 authored by Rubin Xu's avatar Rubin Xu
Browse files

Suppress error message during getPermissionGrantState()

If called on a non-existent package, simply return
PERMISSION_GRANT_STATE_DEFAULT and suppress the error
message.

Bug: 233826864
Test: builds
Change-Id: I6d3074b026415ac39c4f3b9e266b358b65166fe8
parent ae0e10e1
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -13940,8 +13940,8 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
                            granted = PackageManager.PERMISSION_GRANTED;
                        }
                    } catch (NameNotFoundException e) {
                        throw new RemoteException("Cannot check if " + permission
                                + "is a runtime permission", e, false, true);
                        // Package does not exit
                        return DevicePolicyManager.PERMISSION_GRANT_STATE_DEFAULT;
                    }
                }
                int permFlags = mInjector.getPackageManager().getPermissionFlags(