After reading LOCATION_PROVIDERS_ALLOWED value from settings provider,
check for null first.
Bug: 72711160
Bug: 72732478
Test: Manual
Change-Id: I813e40f11f078d80c4cc20986f030fdadfe433c6
This is not a defined function, and there are no aidl files under these
directories anyways.
Bug: 72661763
Test: find location/lib -name '*.aidl'
Test: find media/lib -name '*.aidl'
Change-Id: I000d8febd54a50d4c07b910fa374ac8019f696be
These first-party only methods can only be called by privileged
packages, and Settings.Secure already applies strict permission check to
them. Therefore moving the code into client library can save us from
unnecessary binder calls, and can also make checking the caller package
name much easier.
Test: Manual
Change-Id: I76a939a660357f87b01ff4ac07ec3f17093d3c41
1. Mark public fields as deprecated: LOCATION_MODE, LOCATION_MODE_HIGH_ACCURACY, LOCATION_MODE_SENSORS_ONLY,
LOCATION_MODE_BATTERY_SAVING, LOCATION_MODE_OFF.
2. Add new public methods to LocationManager:
setLocationEnabled(boolean)
isLocationEnabled()
setLocationProviderEnabled(String, boolean)
3. Remove LOCATION_PREVIOUS_MODE and constant
LOCATION_MODE_PREVIOUS. Refactor code that references
LOCATION_MODE_PREVIOUS to use LocationManager.setLocationEnabled or
LOCATION_MODE_HIGH_ACCURACY.
4. Mark deprecated fields and methods as removed: LOCATION_PROVIDERS_ALLOWED, setLocationProviderEnabled(), isLocationProviderEnabled()
5. Refactor logic in Settings app and Quick Settings to call
LocationManager.setLocationEnabled() instead of setting location mode.
Bug: 70990911
Test: Manual
Change-Id: Ia49b385f8b6a358b62291983eb0146af0ecf8e02
New API allows system clients with LOCATION_HARDWARE and
ACCESS_FINE_LOCATION to inject a location to the Location Manager. This
is useful in products like Auto, where the location needs to be cached
across reboots.
Bug: b/64125396
Test: Foll. were tested:
1. location can be injected when lastLocation is not available
2. location cannot be injected when lastLocation is already available
Also, tested location availability on different devices for sanity.
Change-Id: I1fd060caafed0431074ae64439ac52e99e0d6032
GNSS Model Year moves from a TestApi to public
GNSS Model Name is connected from a new .hal to public
Bug: 38003769
Test: Builds, works with CTS & Test App on Pixel 2
Change-Id: I3e0a56c60e1a4d298e120df11ffd37b06ecea050
Implementaion of 2 GNSS Android-P features:
- The Duty Cycling API to enable high accuracy applications development
- The Low Power Mode GNSS API to save power when indoor
Bug: 64009176
Test: Existing unit tests still pass.
Change-Id: I3ba3b86a635a54927c694fdd66a038757e843937
When location mode is about to change in Settings app, send
MODE_CHANGING broadcast.
Fixes: 28057031
Test: manual
Test: robotests
Change-Id: Id26325520211a8934c1670dfcd12e8d339766308
Previous changes statically included legacy-android-test in preparation
for removing android.test.* and junit.* classes from the android.jar.
Unfortunately, that lead to duplicate classes between APKs and the
bootclasspath which caused build problems (Proguard) and also runtime
problems (when targeting and running on older releases).
Switching from statically including the classes to using the runtime
libraries cannot be done in one step because legacy-android-test is
statically included in libraries which are used in many APKs and so
removing it from those libraries requires that all APKs be updated at
once. Doing that atomically across dozens of projects is not practical.
This change modifies APKS that statically include the
legacy-android-test library indirectly.
* If the APK manifest uses the android.test.runner library then the APK
is modified to stop statically including legacy-android-test and
instead build against android.test.base/mock/runner libraries instead.
* Otherwise, the APK statically includes legacy-android-test.
Also, any libraries that statically include are modified to stop
statically including it and if it has source dependencies on the classes
is changed to build against the android.test.base/mock/runner libraries.
The following change descriptions were generated automatically and so
may be a little repetitive. They are provided to give the reviewer
enough information to check the comments match what has actually been
changed and check the reasoning behind the changes.
* cmds/uiautomator/instrumentation/Android.mk
Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
because uiautomator-instrumentation is not a package so does not
need to statically include the classes
* cmds/uiautomator/library/Android.mk
Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
uiautomator.core has a source dependency on its classes
Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
because uiautomator.core is not a package so does not need to
statically include the classes
* core/tests/BroadcastRadioTests/Android.mk
Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
BroadcastRadioTests's source depends on its classes and because of
these changes they are no longer present on the compilation path.
The classes do not need to be statically included because the
classes will be provided by the runtime, either from the default
bootclasspath or from the android.test.runner library that
BroadcastRadioTests specifies in its manifest.
* core/tests/coretests/Android.mk
Added 'android.test.base' and 'android.test.mock' to
LOCAL_JAVA_LIBRARIES because FrameworksCoreTests's source depends
on their classes and because of these changes they are no longer
present on the compilation path. The classes do not need to be
statically included because the classes will be provided by the
runtime, either from the default bootclasspath or from the
android.test.runner library that FrameworksCoreTests specifies in
its manifest.
* core/tests/featureflagtests/Android.mk
Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
FrameworksCoreFeatureFlagTests's source depends on its classes and
because of these changes they are no longer present on the
compilation path. The classes do not need to be statically included
because the classes will be provided by the runtime, either from
the default bootclasspath or from the android.test.runner library
that FrameworksCoreFeatureFlagTests specifies in its manifest.
* core/tests/systemproperties/Android.mk
Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
FrameworksCoreSystemPropertiesTests's source depends on its classes
and because of these changes they are no longer present on the
compilation path. The classes do not need to be statically included
because the classes will be provided by the runtime, either from
the default bootclasspath or from the android.test.runner library
that FrameworksCoreSystemPropertiesTests specifies in its manifest.
* core/tests/utillib/Android.mk
Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
because frameworks-core-util-lib is not a package so does not need
to statically include the classes
Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
frameworks-core-util-lib has a source dependency on its classes
* core/tests/utiltests/Android.mk
Added 'android.test.base' and 'android.test.mock' to
LOCAL_JAVA_LIBRARIES because FrameworksUtilTests's source depends
on their classes and because of these changes they are no longer
present on the compilation path. The classes do not need to be
statically included because the classes will be provided by the
runtime, either from the default bootclasspath or from the
android.test.runner library that FrameworksUtilTests specifies in
its manifest.
* location/tests/locationtests/Android.mk
Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
FrameworksLocationTests's source depends on its classes and because
of these changes they are no longer present on the compilation
path. The classes do not need to be statically included because the
classes will be provided by the runtime, either from the default
bootclasspath or from the android.test.runner library that
FrameworksLocationTests specifies in its manifest.
* lowpan/tests/Android.mk
Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
FrameworksLowpanApiTests's source depends on its classes and
because of these changes they are no longer present on the
compilation path. The classes do not need to be statically included
because the classes will be provided by the runtime, either from
the default bootclasspath or from the android.test.runner library
that FrameworksLowpanApiTests specifies in its manifest.
* packages/Osu2/tests/Android.mk
Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
OsuTests's source depends on its classes and because of these
changes they are no longer present on the compilation path. The
classes do not need to be statically included because the classes
will be provided by the runtime, either from the default
bootclasspath or from the android.test.runner library that OsuTests
specifies in its manifest.
* packages/SettingsProvider/test/Android.mk
Replaced 'legacy-android-test' with 'android.test.base' in
LOCAL_JAVA_LIBRARIES because SettingsProviderTest's source depends
on its classes. The classes do not need to be statically included
because the classes will be provided by the runtime, either from
the default bootclasspath or from the android.test.runner library
that SettingsProviderTest specifies in its manifest.
* services/tests/notification/Android.mk
Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
FrameworksNotificationTests's source depends on its classes and
because of these changes they are no longer present on the
compilation path. The classes do not need to be statically included
because the classes will be provided by the runtime, either from
the default bootclasspath or from the android.test.runner library
that FrameworksNotificationTests specifies in its manifest.
* services/tests/servicestests/Android.mk
Replaced 'legacy-android-test' with 'android.test.base' and
'android.test.runner' in LOCAL_JAVA_LIBRARIES because
FrameworksServicesTests's source depends on their classes. The
classes do not need to be statically included because the classes
will be provided by the runtime, either from the default
bootclasspath or from the android.test.runner library that
FrameworksServicesTests specifies in its manifest.
* services/tests/shortcutmanagerutils/Android.mk
Added 'android.test.runner.stubs' to LOCAL_JAVA_LIBRARIES because
ShortcutManagerTestUtils has a source dependency on its classes
* tests/AppLaunch/Android.mk
Replaced 'legacy-android-test' with 'android.test.base' and
'android.test.runner' in LOCAL_JAVA_LIBRARIES because AppLaunch's
source depends on their classes. The classes do not need to be
statically included because the classes will be provided by the
runtime, either from the default bootclasspath or from the
android.test.runner library that AppLaunch specifies in its
manifest.
* tests/Camera2Tests/SmartCamera/SimpleCamera/tests/Android.mk
Replaced 'legacy-android-test' with 'android.test.base' in
LOCAL_JAVA_LIBRARIES because SmartCamera-tests's source depends on
its classes. The classes do not need to be statically included
because the classes will be provided by the runtime, either from
the default bootclasspath or from the android.test.runner library
that SmartCamera-tests specifies in its manifest.
* tests/ServiceCrashTest/Android.mk
Replaced 'legacy-android-test' with 'android.test.base' in
LOCAL_JAVA_LIBRARIES because ServiceCrashTest's source depends on
its classes. The classes do not need to be statically included
because the classes will be provided by the runtime, either from
the default bootclasspath or from the android.test.runner library
that ServiceCrashTest specifies in its manifest.
* tests/net/Android.mk
Added 'android.test.base' and 'android.test.mock' to
LOCAL_JAVA_LIBRARIES because FrameworksNetTests's source depends on
their classes and because of these changes they are no longer
present on the compilation path. The classes do not need to be
statically included because the classes will be provided by the
runtime, either from the default bootclasspath or from the
android.test.runner library that FrameworksNetTests specifies in
its manifest.
* tests/testables/Android.mk
Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
because testables is not a package so does not need to statically
include the classes
Added 'android.test.mock' to LOCAL_JAVA_LIBRARIES because testables
has a source dependency on its classes
* tests/utils/testutils/Android.mk
Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
because frameworks-base-testutils is not a package so does not need
to statically include the classes
Added 'android.test.base' and 'android.test.mock' to
LOCAL_JAVA_LIBRARIES because frameworks-base-testutils has a source
dependency on their classes
* wifi/tests/Android.mk
Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
FrameworksWifiApiTests's source depends on its classes and because
of these changes they are no longer present on the compilation
path. The classes do not need to be statically included because the
classes will be provided by the runtime, either from the default
bootclasspath or from the android.test.runner library that
FrameworksWifiApiTests specifies in its manifest.
Bug: 30188076
Test: make checkbuild
Change-Id: Ia6a48234f28e7e1789049cf4b37cd7fe0bc8251c
make -j32 FrameworksLocationTests can not find the location module
Added one extra make file to help the ninja find the current make file.
To run the tests, use any of this:
1. runtest frameworks-location
2. forrest test FrameworksLocationTests
Bug: 69375757
Test: make -j32 FrameworksLocationTests
Change-Id: I7572cc494f1851ea6167e99c91af8244efaf15b5
- Added the GnssStatus unit test
- Upgraded the runner to AndroidJunitRunner
- Removed the old non-working unit tests.
To run the tests, use any of this:
1. runtest frameworks-location
2. forrest test FrameworksLocationTests
Bug: 69375757
Test: runtest frameworks-location
Change-Id: Ia52a8ce51ab9334ad1b8dd1686303270ceca270b
Using volatile reference & final member pattern.
Bug: 37517406
Test: basic GNSS & GPS Status output works
Change-Id: I5650149e0a3f63a52734c8f044d38f3956819921
We've seen some @SystemApi methods protected with non-system
permissions, so give Doclava the platform AndroidManifest.xml so it
can parse the actual permission protection levels to look for APIs
that are letting in non-system apps.
Also document more @SystemApi permissions.
This is purely a docs change; no logic changes are being made.
Test: make -j32 update-api
Bug: 62263906
Change-Id: Ie0f0a5fb0033817bcc95060f2183a52ae4ae7b06
Most @SystemApi methods should be protected with system (or higher)
permissions, so annotate common methods with @RequiresPermission to
make automatic verification easier.
Verification is really only relevant when calling into system
services (where permissions checking can happen on the other side of
a Binder call), so annotate managers with the new @SystemService
annotation, which is now automatically documented.
This is purely a docs change; no logic changes are being made.
Test: make -j32 update-api && make -j32 offline-sdk-docs
Bug: 62263906
Change-Id: I2554227202d84465676aa4ab0dd336b5c45fc651
Bug: 37757180
Fixes: 37757180
Test: 1. built img locally and flash the device
make -j 40
vendor/google/tools/flashall
2. run cts
cts-tradefed run cts -m CtsLocationTestCases --test
android.location.cts.GnssStatusTest
Change-Id: I5046dbe28518812192de20daca91a8511a1558c0
- Add getEmergencyCallbackMode() method in the TelephonyManager.java
to get the boolean value for ECBM callback mode from the phone through
ITelephony.aidl/java interface
- Use the added TelephonyManager Api to replace the 'get' of
PROPERTY_INECM_MODE system property in the framework/base
Change-Id: I83fbdeef5c0b43a8fc16ece044c9e191e9922bce
Test: manual
Bug: 30361624
- Add getEmergencyCallbackMode() method in the TelephonyManager.java
to get the boolean value for ECBM callback mode from the phone through
ITelephony.aidl/java interface
- Use the added TelephonyManager Api to replace the 'get' of
PROPERTY_INECM_MODE system property in the framework/base
Test: manual
Bug: 30361624
Change-Id: I355d69820b157f23e077a95a13f8509ee0fa5874
Connections from .hal layer, through to
Location Manager System APIs
Bug: 31974439
Test: builds, boots, ordinary GNSS & new GNSS batching
basic functional checks on Marlin
Change-Id: If75118c27b5ed34cfc16c9f817b60a3be5485095