Fix always return first package for mock location app in developer options.

The mock location app should be OP_MOCK_LOCATION allowed app, the packageOps.get(0).getPackageName()
is the first app that used the OP_MOCK_LOCATION in history, but maybe rejected.

Change-Id: I0158436dd7d2790f4e9640075bc9c8bd3422f467
This commit is contained in:
张倞诚
2022-06-22 08:42:07 +00:00
parent e27d1790f8
commit d8d0cb3532

View File

@@ -165,7 +165,7 @@ public class MockLocationAppPreferenceController extends DeveloperOptionsPrefere
if (packageOps != null) {
for (AppOpsManager.PackageOps packageOp : packageOps) {
if (packageOp.getOps().get(0).getMode() == AppOpsManager.MODE_ALLOWED) {
return packageOps.get(0).getPackageName();
return packageOp.getPackageName();
}
}
}