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:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user