Commit Graph

206 Commits

Author SHA1 Message Date
Taesu Lee
b40a55ccc9 Use TelephonyManager#isEmergencyNumber() instead
Replace deprecated PhoneNumberUtils#isLocalEmergencyNumber() and
isEmergencyNumber() with TelephonyManager#isEmergencyNumber().

Test: Build
Bug: 132703886

Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
Change-Id: I232d7f7d23efd963b6d30938f0fa304c90fca8a8
Merged-In: I232d7f7d23efd963b6d30938f0fa304c90fca8a8
2020-10-14 02:31:14 +00:00
TreeHugger Robot
e93814953c Merge "Remove unused intent in NiNotification" into rvc-dev 2020-06-09 22:26:42 +00:00
Yu-Han Yang
50bf07e963 Remove unused intent in NiNotification
Bug: 154319182
Test: manual
Change-Id: I5958a8fb442cf4506e1824243493f91aea34a7cc
2020-06-08 14:59:23 -07:00
Ruchir Rastogi
ef0904eac0 Move GnssStats puller to binder thread
Pass direct executor to setPullAtomCallback. This causes the puller to
run directly on the binder thread, as opposed to the Background thread,
which could be busy with other work.

This change means that the puller can be executed concurrently. To
properly handle that, the Statistics class is made thread-safe.

Test: adb shell cmd stats pull-source 10074
Bug: 157186182
Change-Id: I6c0940fd4ed231f9d962981cc1f9e8c983c48f7f
2020-06-05 14:08:37 -07:00
Ruchir Rastogi
5ea18c9036 Partial CP of ag/10846962
CP to rvc-dev to avoid automerger conflicts for ag/11727208.

Test: m
Bug: 157186182
Change-Id: I1b2dc636b90e6a643a2d5722022671563955f96a
Merged-In: I1eb1dfb68190c68e896e87c5bea1f2ec44065e80
2020-06-05 14:05:01 -07:00
Soonil Nagarkar
c4f8716720 Fix up LocationRequest and ProviderRequest
-Use more idiomatic and efficient parceling
-Cleanup LocationRequest a bit

Bug: 151026407
Test: presubmits
Change-Id: I3865421a128417a5096e39ee110139a13ab9ab3b
2020-04-01 11:06:12 -07:00
Tej Singh
72a70a8a3c Address Puller API Feedback
1. Rename registerPullAtomCallback to setPullAtomCallback
2. Rename unregisterPullAtomCallback to clearPullAtomCallback
3. Add getters to PullAtomMetadata
4. Change Ns to Millis (when I tried to make it Nanos, I received a
built time error saying to prefer millis unless we need the precision.
We do not need the precision, so I changed it).
5. Fix out of order params.

I did not change usePooledBuffer to setPooledBuffer because I think use
is more appropriate for our use case.

Test: make
Test: atest PullAtomMetadataTest
Test: atest GtsStatsdHostTestCases
Bug: 149475498

Change-Id: Ib07aa57a6e02c77917fe0e65a3d4a77c00ce8565
2020-03-05 16:43:02 -08:00
Blake Kragten
e4383d8999 Merge "GnssMetrics" 2020-02-21 22:15:29 +00:00
Blake Kragten
6ce382a372 GnssMetrics
These metrics will pull different metrics that tell the performance of the gnss subsystem.

Metrics include:
Location reports
% of location failure
Num times GPS had to first fix
Mean time to first fix on signal
Num position accuracy logs
Mean position accuracy in meters
Num top 4 Cn0 messages
Mean top 4 average Cn0 (signal quality)
Num L5 top 4 Cn0 messages
Mean L5 top 4 average Cn0 (signal quality)
Num Satellite status messages received
Num of Satellites used in fix
L5 Satellite status messages received
L5 of Satellites used in fix

metric_id: 1111
gauge_metrics {
  data {
    bucket_info {
      atom {
        gnss_stats {
          location_reports: 12
          location_failure_reports: 3
          time_to_first_fix_reports: 2
          time_to_first_fix_milli_s: 43588
          position_accuracy_reports: 9
          position_accuracy_meters: 112
          top_four_average_cn0_reports: 31
          top_four_average_cn0_db_mhz: 734711
          l5_top_four_average_cn0_reports: 1
          l5_top_four_average_cn0_db_mhz: 21500
          sv_status_reports: 1015
          sv_status_reports_used_in_fix: 100
          l5_sv_status_reports: 7
          l5_sv_status_reports_used_in_fix: 0
        }
      }
      elapsed_timestamp_nanos: 537249375445
      start_bucket_elapsed_millis: 522186
      end_bucket_elapsed_millis: 549283
    }
  }
}
time_base_elapsed_nano_seconds: 9283624934
bucket_size_nano_seconds: 60000000000
is_active: true

Bug: 147910698
Test: On Device using test script and gnsslogger.apk
>  make statsd_testdrive
>  ./out/host/linux-x86/bin/statsd_testdrive <ATOM_ID>

Change-Id: I92461eb8533ec810bb67d76a25931295cfa1efbd
2020-02-19 17:07:11 -08:00
Soonil Nagarkar
3819f972df Revert requestSetProviderEnabled API
Bug: 144955780
Test: presubmits
Change-Id: Iec8520acfd98b9d9d92a4876ebfa899ac2a0731e
2020-02-19 14:39:58 -08:00
Muhammad Qureshi
e2b2432bc6 Use FrameworkStatsLog instead of StatsLog
As part of statsd becoming a Mainline module in R, autogenerated
StatsLog.write() calls are going away and replaced by
*StatsLog.java
that is autogenerated for each module.
This CL replaces some usages of StatsLog with
FrameworkStatsLog.

Bug: 145952197
Test: m
Change-Id: Iaa2db34a7be4c3215f62cc36661ba8ac81656baa
2020-02-03 09:17:40 -08:00
Soonil Nagarkar
980ce6a741 Add DPM API to request location provider enable
DPM can currently control the master location toggle, but cannot
influence the behavior of individual providers. This adds an API for
DPM (or other privileged entities) to request a provider to turn itself
on.

Practically, this is necessary to allow DPM to control network location,
which may be gated by additional consents. This change also renames some
internal location code to make clearer the distinction between provider
enabled and provider allowed: enabled = location on && allowed

Bug: 136219903
Test: CTS tests to be added
Change-Id: I05f03c976428f0f5a8a2cf627a84dc9e2baf3e67
2020-01-23 18:06:31 -08:00
Soonil Nagarkar
c3107caf22 Fix parceling bug in ProviderRequest
Forgot to add worksource write in addition to worksource read.

Bug: 148129736
Test: manual
Change-Id: Idac06b9191ada54bed0c79e9c799d8cd1ab0ebac
2020-01-22 14:58:16 -08:00
Soonil Nagarkar
4c0b85ba06 Overhaul FusedLocationProvider
Fix some minor bugs and ensure fused location provider correctly
supports location bypass. This is especially important for when
location bypass is invoked in direct boot.

The added UPDATE_DEVICE_STATS permission is necessary for FusedLocation
to correctly update WorkSources. FusedLocation receives work from LMS and
then further delegates that work to other location providers. The other
location providers should be informed of the correct applications for
battery blame, and should not be blaming the FusedLocation package.
1) This is the minimally scoped permission necessary to battery blame
correctly.
2) There is no way to attribute battery blame without this permission.
3) This is the correct permission - as required by LocationManager, and
this permission will likely never be removed (FusedLocation will always
need to battery blame).

Test: atest FusedLocationTests
Change-Id: If7126fffaae5577ddf8e366a0b5c17b3e5286582
2020-01-22 17:22:54 +00:00
Blake Kragten
439408699d Merge "Revert "GPS Atoms Addition"" 2020-01-16 17:18:11 +00:00
Blake Kragten
c7bdb71cc7 Revert "GPS Atoms Addition"
Revert "CTS GPS test"

Revert submission 9726785-1574459091307-c480d999

Reason for revert: Pushed atoms will be integrated into the new pulled atom.
Reverted Changes:
I9cbc8e41e: CTS GPS test
If8aed8f47: GPS Atoms Addition

Change-Id: I8d0a0b73d870a8d9fb02975df70f662de4fd1690
2020-01-15 18:57:33 -08:00
Soonil Nagarkar
8df02f452c Refactor providers/managers
Refactor how providers/managers are implemented in LMS, substantially
simplifying code, and opening up further simplification around
permissions in the next change.

Also, limit the number of additional packages providers can have, and
merge WorkSource into ProviderRequest so that providers can pass just
ProviderRequests around, not both.

Test: presubmits
Change-Id: Ic6fab46883cf53eb26368b54a824feac39c57a32
2020-01-09 14:52:50 -08:00
Artur Satayev
53fe96661b Use new UnsupportedAppUsage annotation.
Existing annotations in libcore/ and frameworks/ will deleted after the migration. This also means that any java library that compiles @UnsupportedAppUsage requires a direct dependency on "unsupportedappusage" java_library.

Bug: 145132366
Test: m && diff unsupportedappusage_index.csv
Change-Id: I4bc8c9482e4bb1af21363f951affff7ee3fefeab
2019-12-18 15:42:06 +00:00
Blake Kragten
0ce12c26c4 Merge "L5 metrics are not getting reset" 2019-12-06 22:40:37 +00:00
Blake Kragten
ccb7ad664d L5 metrics are not getting reset
Bug: 145769788
Test: On Device
Change-Id: If12dba3a75176ccb4c2bc25bbbbd003b19d92fb1
2019-12-06 09:47:31 -08:00
Blake Kragten
212edc735b GPS Atoms Addition
Porting gps location status (success/failure) logging to atom
GpsLocationStatusReported will be used by 2 count metrics to
determine the location failure rate.

Porting gps time to first fix seconds logging to atom
GPsTimeToFirstFixReported will be used by a value metric to determine
the average time to first fix on a GPS signal.

CTS tests will be added for these atoms in subsequent CL

Test: On Device using test script and gnsslogger.apk
>  make statsd_testdrive
>  ./out/host/linux-x86/bin/statsd_testdrive <ATOM_ID>

Bug: 141631388
Bug: 142740230
Change-Id: If8aed8f475078b05b977a73b4bba91c85af7716a
2019-11-19 10:56:59 -08:00
Artur Satayev
751e55114c Add @UnsupportedAppUsage annotations for greylist.
go/cleanup-greylist-txt

These have already been greylisted, however due to bugs/omissions in the tooling have been kept in go/greylist-txt instead of being annotated in the code.

This is partial merge of aosp/Id6c1f5e403a0e66edb1102ee45f3bf19f244fb09. Telephony greylist cleanup has been done separately. Note that annotations outside of frameworks/base/ have been merged from AOSP.

Bug: 137350495
Test: m
Exempt-From-Owner-Approval: merge
Change-Id: I015c466e8b69cc0fed5e9d394ba865aad11d8ba6
2019-11-19 15:05:35 +00:00
Soonil Nagarkar
0d1890b0e0 Make GnssStatus and GpsStatus testable
Allow clients to create GnssStatus and GpsStatus objects for test.

Bug: 144027538
Test: na
Change-Id: Ice3eb966a88e6de5bc8834b60b54bcac31bf31db
2019-11-14 10:26:41 -08:00
Soonil Nagarkar
fc9c7f8532 Remove all code dealing with obsolete location status
Test: manual
Change-Id: I0fde3dd9bdd418ab63c61c5afc093d8eef72e600
2019-09-13 13:03:14 -07:00
Blake Kragten
bb613600fc L5 Metrics Addition:
Added L5 metrics to determine if L5 should be enabled or not.

Test: On device

adb shell dumpsys location

Output:
  Number of CN0 reports: 149
  Top 4 Avg CN0 mean (dB-Hz): 26.100838872410307
  Top 4 Avg CN0 standard deviation (dB-Hz): 1.7702387090734562
  Total number of sv status messages processed: 4202
  Total number of L5 sv status messages processed: 703
  Total number of sv status messages processed, where sv is used in fix: 1979
  Total number of L5 sv status messages processed, where sv is used in fix: 46
  Number of L5 CN0 reports: 97
  L5 Top 4 Avg CN0 mean (dB-Hz): 20.273711379041377
  L5 Top 4 Avg CN0 standard deviation (dB-Hz): 2.632911219511556
  Used-in-fix constellation types: GPS GLONASS GALILEO

Output Logs: https://drive.google.com/drive/folders/1tGEolHWtF92UkJ8lxgFihIzfWLl8ChZK?usp=sharing
Bug: 137575988
Change-Id: Id306d7cc27c9410a5ad73f5a0940c25f8d795686
2019-09-12 11:02:38 -07:00
Artur Satayev
fa05ca260a Add @UnsupportedAppUsage annotations.
This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.

Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@

Bug: 137350495
Test: m
Change-Id: I55c7845cb7c22808a85dd5185eccfe93c2064b76
2019-08-01 13:44:37 +01:00
Soonil Nagarkar
1c572559c6 Improve dumpsys formatting
Make dumpsys readable.

Test: n/a
Change-Id: Ie1701227b8dddaee7636c37f97c9469729e499c3
2019-07-10 14:27:50 -07:00
Anil Admal
61da5f06ad Update non-framework emergency location request notification
- Incorporate notification text feedback in b/116328114 so that
  it translates well in different locales.
- Implement PWG recommendation to always notify user of non-framework
  location requests and not make it configurable. Remove es_notify_int
  configuration parameter.

Bug: 116328114
Bug: 130892418
Test: Manual plus existing tests pass.
Change-Id: Iad972eb1a6fe6c6ed5646edb00c1ea483a077553
2019-05-20 16:33:09 -07:00
Anil Admal
8a246a2bce User notification of NFW emergency requests similar to IGnssNi.hal
Fixes: 130892418
Test: Manual
Change-Id: Ie505f4c08ffbabfaba3a072c5e14cf8a732c6860
2019-05-07 17:51:21 -07:00
Yu-Han Yang
284234ea8c Log constellation types in GnssMetrics
Bug: 121157068
Test: on device
Change-Id: I9e2c1238e46422f9c11b748567c2741ed95aeaa0
2019-04-12 18:22:05 +00:00
Brad Ebinger
8a838a991d Merge "Query isEmergencySmsMode API when checking if emergency for GPS" am: dedc27142d am: 3b176bc1de
am: 6862694d61

Change-Id: Id37265bae6fc641b77073c16b5a1b9a54a49b750
2019-03-22 10:59:52 -07:00
Brad Ebinger
6862694d61 Merge "Query isEmergencySmsMode API when checking if emergency for GPS" am: dedc27142d
am: 3b176bc1de

Change-Id: I26112e78477a755fe0fd373a8fdbdceb864fcea0
2019-03-22 10:48:18 -07:00
Brad Ebinger
5eeb79d4b5 Query isEmergencySmsMode API when checking if emergency for GPS
When location SUPL request comes in for GPS NI handler,
also check emergency SMS mode in telephony, which
is true for a carrier defined amount of time after an
emergency SMS is sent.

Bug: 126091115
Test: manual - send fake emergency sms, check api is true.
Change-Id: I34d26d2940af5b0c412e20ce3668344da8656339
2019-03-20 11:11:10 -07:00
Xin Li
3e112d56a4 DO NOT MERGE - Merge PPRL.190305.001 into master
Bug: 127812889
Change-Id: I7c5ada5c5afe38848be733616cbb1568440ab1c5
2019-03-12 00:17:37 -07:00
Andrei-Valentin Onea
438ec44268 Merge "Add @UnsupportedAppUsage annotations" am: 842e3aa420
am: 20ebeb61a9

Change-Id: Ibcbbe37ffd476ea414a1041c015b8267a46a5402
2019-03-06 10:07:46 -08:00
Andrei-Valentin Onea
20ebeb61a9 Merge "Add @UnsupportedAppUsage annotations"
am: 842e3aa420

Change-Id: Ie3bc96e663223de383be59cb764f139f459c5a67
2019-03-06 09:46:00 -08:00
Wyatt Riley
17bf9f9e42 Merge "DO NOT MERGE - SUPL ES Extension - Safer Init and Not After Boot" into pi-dev
am: 598118ffe1

Change-Id: Ia1899036cb0c1f0f63b7f1cd97d6f1418c0e5614
2019-03-04 06:51:01 -08:00
Wyatt Riley
4891313d16 Merge "SUPL ES Extension - Safer Init and Not After Boot" 2019-03-04 14:29:06 +00:00
Kweku Adams
f6410681b9 Merge "Adding new Battery Saver location mode." 2019-03-01 22:17:29 +00:00
WyattRiley
d130931b0b SUPL ES Extension - Safer Init and Not After Boot
Safe order of pointer setting and background thread start
Verifying mCallEndElapsedRealtimeMillis is not the initial value

Bug: 112159033
Bug: 115361555
Bug: 125124724
Test: Verified not-after-boot with test code b/115361555#comment14
Test: Reproed NPE with test thread sleep and verify fix
Change-Id: Ic01a5d35d919ccea7934c8384253311261cd0167
2019-03-01 21:13:09 +00:00
WyattRiley
fbcb41f9fb DO NOT MERGE - SUPL ES Extension - Safer Init and Not After Boot
Safe order of pointer setting and background thread start
Verifying mCallEndElapsedRealtimeMillis is not the initial value

Bug: 112159033
Bug: 115361555
Bug: 125124724
Test: Verified not-after-boot with test code b/115361555#comment14
Test: Reproed NPE with test thread sleep and verify fix
Change-Id: I25dcd5a5b36c218ea8b7ab88d6909382709fd7ab
2019-03-01 21:13:02 +00:00
Kweku Adams
4fb074e7f4 Adding new Battery Saver location mode.
When this new mode (LOCATION_MODE_THROTTLE_REQUESTS_WHEN_SCREEN_OFF) is
enabled, LocationManagerService will avoid sending almost all
LocationRequests to providers. The only requests that will continue to
be sent will be providers are the requests that ignore location
settings.

Bug: 121256487
Bug: 122849003
Bug: 119261320
Test: atest android.os.cts.batterysaving.BatterySaverLocationTest
Change-Id: Iee95a6fb5ca11d4db7a0f0661bf3cb1051a5d710
2019-02-28 14:55:39 -08:00
Andrei Onea
cf1a82953b Add @UnsupportedAppUsage annotations
For packages:
  com.android.internal.app
  com.android.internal.appwidget
  com.android.internal.location
  com.android.internal.os
  com.android.internal.policy
  com.android.internal.statusbar
  com.android.internal.telecom
  com.android.internal.telephony
  com.android.internal.widget

This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.

Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@

Bug: 110868826
Test: m
Merged-In: I6eba34467b2492047e5264684312adfa029eb317
Change-Id: I413c4b6dd12bcf40b69423718ed278cbefe82087
2019-02-28 17:01:29 +00:00
Andrei Onea
fa152f9517 Add @UnsupportedAppUsage annotations
For packages:
  com.android.internal.app
  com.android.internal.appwidget
  com.android.internal.location
  com.android.internal.os
  com.android.internal.policy
  com.android.internal.statusbar
  com.android.internal.telecom
  com.android.internal.telephony
  com.android.internal.widget

This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.

Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@

Bug: 110868826
Test: m
Change-Id: I6eba34467b2492047e5264684312adfa029eb317
2019-02-27 16:42:54 +00:00
Soonil Nagarkar
509580fbdf Refactor API naming and add unbundled support
Rename APIs while there are no clients. Also prevent throttling when
location settings are being ignored.

Bug: 118883513
Test: manual
Change-Id: I225c50b152e77ab181c959ecd9dc652333f59d5e
2019-02-13 13:34:45 -08:00
Soonil Nagarkar
0d77ea6893 Change provider packages API to test all providers
This will replace the LocationManager.getNetworkProviderPackage() API
with LocationManager.isProviderPackage(). The network provider should
not be considered special.

In addition, providers now have the ability to specify additional
packages that may make location requests on their behalf, so that those
packages can be considered location providers as well.

Bug: 117177078
Test: manually
Change-Id: I204b56e7bb40874ac3347988474fb8afa787feb8
2019-02-04 10:58:24 -08:00
WyattRiley
e385b32862 Adding SUPL NI Emergency Extension Time
Configurable by carrier config.xml resource

Bug: 118839234
Bug: 115361555
Bug: 112159033
Test: On device, see b/115361555#comment14
Change-Id: I52e61656cca8b6fa6468d32d2e69bf60f4c83c61
(cherry picked from commit a725dd6650)
2019-01-16 18:56:10 +00:00
Anil Admal
d71cf1499b Add emergency session extension duration (framework)
Add new method in IGnssConfiguration.hal to pass emergency
session extension duration to GNSS HAL implemenation so that
network initiated emergency location requests can be served
for this extra duration post emergency call.

Bug: 121204694
Test: GNSS HAL implementation not ready. So, tested with code
      instrumentation that this configuration parameter is
      called only for GNSS HAL 2.0 implementation.

Change-Id: I845cc13412d9027b7924bfcffecbf6438f2e4be7
2019-01-09 12:16:31 -08:00
WyattRiley
a828d1d606 Merge "Adding SUPL NI Emergency Extension Time" into pi-dev am: 73c242793f
am: ac488cd7c5

Change-Id: I9f43a4bfc4f22229b10fbc8bc061d31fc8284904
2018-12-20 11:50:50 -08:00
WyattRiley
ac488cd7c5 Merge "Adding SUPL NI Emergency Extension Time" into pi-dev
am: 73c242793f

Change-Id: I2b2c76c98ba4460fff8ccba57e7b86acc3ec6575
2018-12-20 11:42:50 -08:00