77a9227b19
There were a couple problems with work profile state in location. First, we assumed that notifications sent to parent users would also be sent to profiles but this is not true. Second we had assumed location status in profiles was always identical to the parent user, but work profiles may have user restrictions applied which are not present on the parent user. The easiest way to handle these issues seems to be to expand LMS user handling to deal with all users, rather than making various assumptions which may or may not be true. This also means we need to store last locations on a per profile basis. Since we're refactoring how last location works completely, we also removed the special NO_GPS handling for last locations. With the new permission strings we now no longer have to exclude gnss based location from coarsening. This lets us: 1) deprecate and remove various constants and methods use for storing coarse locations tied to fine locations 2) substantially simplify code that calculated coarse location This also exposed numerous bugs in the location service where we were using the current user's state instead of the calling user's state, which could have exposed the current user's location to other users inappropriately. Bug: 148798374 Bug: 146071833 Test: presubmits + manual Change-Id: I2d3216a9fb58b73d0124d563b05de8870b70b716
54 lines
1.4 KiB
Plaintext
54 lines
1.4 KiB
Plaintext
// Copyright (C) 2018 The Android Open Source Project
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
// you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at
|
|
//
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
// See the License for the specific language governing permissions and
|
|
// limitations under the License.
|
|
|
|
android_test {
|
|
name: "FrameworksMockingServicesTests",
|
|
|
|
srcs: ["src/**/*.java"],
|
|
|
|
static_libs: [
|
|
"services.core",
|
|
"services.net",
|
|
"service-jobscheduler",
|
|
"service-permission",
|
|
"service-blobstore",
|
|
"androidx.test.runner",
|
|
"androidx.test.ext.truth",
|
|
"mockito-target-extended-minus-junit4",
|
|
"platform-test-annotations",
|
|
"truth-prebuilt",
|
|
"testables",
|
|
],
|
|
|
|
libs: [
|
|
"android.test.mock",
|
|
"android.test.base",
|
|
"android.test.runner",
|
|
],
|
|
|
|
jni_libs: [
|
|
"libdexmakerjvmtiagent",
|
|
"libpsi",
|
|
"libstaticjvmtiagent",
|
|
],
|
|
|
|
certificate: "platform",
|
|
platform_apis: true,
|
|
test_suites: ["device-tests"],
|
|
|
|
optimize: {
|
|
enabled: false,
|
|
},
|
|
}
|