Merge "Fixes multiuser GNSS Bug." into qt-dev

This commit is contained in:
TreeHugger Robot
2019-05-20 20:19:38 +00:00
committed by Android (Google) Code Review

View File

@@ -966,8 +966,9 @@ public class GnssLocationProvider extends AbstractLocationProvider implements
}
private void updateEnabled() {
// Generally follow location setting
boolean enabled = mContext.getSystemService(LocationManager.class).isLocationEnabled();
// Generally follow location setting for current user
boolean enabled = mContext.getSystemService(LocationManager.class)
.isLocationEnabledForUser(UserHandle.CURRENT);
// ... but disable if PowerManager overrides
enabled &= !mDisableGpsForPowerManager;