Commit Graph

5792 Commits

Author SHA1 Message Date
Neil Fuller
f211324bfc Merge "Misc tidy up before adding geolocation classes" 2020-03-20 09:47:19 +00:00
junyulai
b56b6138bf [SM07] Make combine subtype configurable from Settings
Note that enabling/disabling would not take effect until device
reboot. This will be addressed in follow-up patch.

Test: 1. atest NetworkStatsServieTest SettingsBackupTest
      2. adb shell settings put global netstats_combine_subtype_enabled 1|0
Bug: 146415925

Change-Id: Ic94da540afa479ed18f1b6fbda4ae3216c37476b
Merged-In: Ic94da540afa479ed18f1b6fbda4ae3216c37476b
(cherry picked from commit c4f77ac90b and
 fix merge conflict in SettingsBackupTest)
2020-03-19 10:10:07 +08:00
junyulai
fd661f5db8 [SP24] Rename functions that add Entry unconditionally
Currently, in NetworkStats, there are many methods to manipulate
the records. However, some methods are similar and ambiguous,
such as addEntry, addValues, setValues, addIfaceValues,
combineValues and combineAllValues.

Thus, properly grouping and renaming methods are necessary.
In this change, for methods that add one record unconditionally,
name them insertEntry.
  setIfaceValues -> insertEntry
  addEntry -> insertEntry

Test: atest FrameworksNetTests ImsPhoneCallTrackerTest TetheringTests
Test: m doc-comment-check-docs
Bug: 148895143
Change-Id: I801ddc49e283a254b9586700c9b597c0adb0d459
2020-03-16 14:27:45 +08:00
Bill Yi
020c84a136 Merge stage-aosp-master to aosp-master - DO NOT MERGE
Change-Id: I352ed2cba25df69594ee5861f3a64be63bc18c96
2020-03-05 10:20:17 -08:00
Neil Fuller
86fd801bff Merge "Add command line support for testing tz detection" 2020-03-05 18:07:24 +00:00
Neil Fuller
4879487862 Add command line support for testing tz detection
Add support for "adb shell cmd time_zone_detector".

This allows platform developers and future host tests to simulate
clients like telephony / SettingsUI and make changes to the
TimeZoneDetectorService state to mimic various real-world situations.

Example adb shell invocations:

Withdraw a previous telephony suggestion from slot_index=0:

cmd time_zone_detector suggestTelephonyTimeZone --suggestion --slot_index 0 \
    --zone_id "_"

Make a new telephony suggestion from slot_index=0, with a quality of
TelephonyTimeZoneSuggestion.QUALITY_SINGLE_ZONE, and a matchType of
TelephonyTimeZoneSuggestion.MATCH_TYPE_NETWORK_COUNTRY_ONLY:

cmd time_zone_detector suggestTelephonyTimeZone --suggestion --slot_index 0 \
    --zone_id "Europe/London" --quality single --match_type country

Make a manual (user) suggestion as if from SettingsUI:

cmd time_zone_detector suggestManualTimeZone --suggestion --zone_id America/Los_Angeles

Bug: 140712361
Test: Various command line invocations.
Test: atest core/tests/coretests/src/android/app/timezonedetector
Change-Id: I0f16868a526d2ea4b17acbd274cb2359f93166f5
2020-02-25 17:57:42 +00:00
Automerger Merge Worker
bdf898ab9f Merge changes from topic "adbwifi-base" am: 458a9a2561
Change-Id: I03540566fe4eb10926f97c56adf3b0b1449ad89a
2020-02-21 05:24:09 +00:00
Joshua Duong
458a9a2561 Merge changes from topic "adbwifi-base"
* changes:
  Add Settings.Global.ADB_WIFI_ENABLED.
  [adbwifi] SysUI: Add WifiDebuggingActivity.
2020-02-21 05:02:49 +00:00
Joshua Duong
a71c97f440 Add Settings.Global.ADB_WIFI_ENABLED.
ADB_ENABLED historically meant the state for USB debugging. Since
wireless debugging can be enabled separately, define another setting
for it.

BUG: b/111434128

Test: make
Change-Id: If3abca8e77381d6832f55d55a43c52ee1a1267d1
Merged-In: If3abca8e77381d6832f55d55a43c52ee1a1267d1
Exempt-From-Owner-Approval: cherry-pick
2020-02-20 18:42:14 -08:00
Automerger Merge Worker
951e7254cb Merge changes Ie5fa2605,Ia092e896 am: 140049bce8
Change-Id: I20fd969e2124c228506e11540bdea04676684530
2020-02-20 23:03:24 +00:00
Automerger Merge Worker
9e8e0a546c Use bpf data when available for per-UID cpu stats am: 57635c976b
Change-Id: I1cba7c38a846793d2e019a68ea246bdee1f3f36a
2020-02-20 23:03:18 +00:00
Connor O'Brien
140049bce8 Merge changes Ie5fa2605,Ia092e896
* changes:
  Use bpf data when available for single-UID cpu stats
  Use bpf data when available for per-UID cpu stats
2020-02-20 22:45:53 +00:00
Automerger Merge Worker
1f82fbb4ac Merge "Improve BaseBundle#kindofEquals" am: 42ab50d14b
Change-Id: Ic5c2c5bcf979236c77344d0507d071bbb83f624e
2020-02-19 00:33:09 +00:00
Connor O'Brien
cd834de67c Use bpf data when available for single-UID cpu stats
Update KernelSingleUidTimeReader to read BPF data rather than per-UID
proc files when the BPF data is available. This is implemented by
calling libtimeinstate functions via JNI.
Extend KernelSingleUidTimeReaderTest to exercise both the BPF and proc
file code paths.

Bug: 138317993
Test: KernelSingleUidTimerTest passes
Test: no regression in BatteryStatsTests
Change-Id: Ie5fa2605007e8c5f70a0383bf8adbd81d479abfe
Merged-In: Ie962ddd9e30d96aa0fab6104a4164af9ad02f55e
Signed-off-by: Connor O'Brien <connoro@google.com>
2020-02-19 00:22:14 +00:00
Connor O'Brien
57635c976b Use bpf data when available for per-UID cpu stats
Update KernelCpuUidTimeReader and its subclasses to support reading
frequency, active & cluster times from BPF maps rather than proc files
on devices that support this approach. BPF-based accounting offers
improved accuracy as it can detect every context switch, whereas the
proc files attribute a full tick period to whatever happens to be
running when the tick occurs.
Add a KernelCpuUidBpfMapReader class modeled on
KernelCpuProcStringReader, with singletons for reading each distinct
set of data. These follow the locking approach used by
KernelCpuProcStringReader to ensure thread safety, but they collect
data by calling libtimeinstate functions via JNI rather than reading
text from proc files. They also provide a getDataDimensions() function
to retrieve information currently provided by the header rows of the
proc files, such as the list of available freqs or the number of cores
on each cluster.
Extend the KernelCpu*TimeReaderTest classes to exercise the BPF path
for each reader class, and add a KernelCpuUidBpfMapReaderTest modeled
on KernelProcStringReaderTest.

Bug: 138317993
Test: KernelCpu*TimeReaderTests and KernelCpuUidBpfMapReaderTest pass
Test: no regressions in BatteryStatsTests
Change-Id: Ia092e896028e5f647f6c182de05fa76c7e2e3180
Merged-In: Ie7c0b11a47289e16f72fd6868de4185e858c7e4f
Signed-off-by: Connor O'Brien <connoro@google.com>
2020-02-19 00:20:52 +00:00
Treehugger Robot
42ab50d14b Merge "Improve BaseBundle#kindofEquals" 2020-02-18 23:56:30 +00:00
Daniel Colascione
7c9f1499bc Add property-invalidated cache am: 764ff47f87
Change-Id: I49849de310a637d9d407698a4a0120b5b8aa48aa
2020-02-18 17:30:40 +00:00
Suprabh Shukla
3b413dd57e Improve BaseBundle#kindofEquals
If both BaseBundles are empty, we can infer that without needing to
unparcel any of them.

Test: atest FrameworksCoreTests:android.os.BundleTest

Bug: 146037505
Change-Id: I04c28cdd1293227d9887b0c17e178f61328c1959
Merged-In: I04c28cdd1293227d9887b0c17e178f61328c1959
2020-02-14 14:05:00 -08:00
Daniel Colascione
764ff47f87 Add property-invalidated cache
The PropertyInvalidatedCache class provides a framework for caching
frequently-read, seldom-written information between processes.

Test: caching CLs
Test: atest FrameworksCoreSystemPropertiesTests
Bug: 140788621

(cherry picked from commit 06e9a4e01b)
Merged-In: I2d650129389e9567e4982b3a613fb8d1cbc97f4b
Change-Id: Ia03c2e6ab0ba0388ac729e5872795e25d06ee322
2020-02-12 12:28:48 +00:00
Neil Fuller
0813e0e2ca Misc tidy up before adding geolocation classes
Misc tidy up / corrections before adding geolocation time zone detection
classes.

Bug: 149014708
Test: treehugger
Change-Id: Ia25d9f6bbf5c7c03e2cbb570b6b07e61bc0aa1d9
2020-02-11 14:51:42 +00:00
Automerger Merge Worker
f6a2f14eb6 Merge "Remove testTokenize" am: 52c5601801
Change-Id: I9a4b23eef55735801768c750d24b3cee5dd79501
2020-02-10 20:33:29 +00:00
Nick Kralevich
31afcd536a Remove testTokenize
The _tokenize function was deleted in external/sqlite
commit c52a17358593062a7eb75a023c115df9ad89563b

Bug: 148829241
Bug: 139186193
Test: atest DatabaseGeneralTest
Change-Id: I37993fcda22736582375e13f093bd4a81aa8b1a4
2020-02-10 10:52:50 -08:00
Automerger Merge Worker
9f9657ee5e Merge "Add CompatChanges API." am: 54036c0525
Change-Id: Ieade8f2b33423bad4219ab2982b876b06e355e84
2020-02-06 17:43:00 +00:00
Andrei-Valentin Onea
54036c0525 Merge "Add CompatChanges API." 2020-02-06 17:31:15 +00:00
Automerger Merge Worker
02e64e352c Merge "More renames for API council" am: b03661f5d8
Change-Id: I1bd4db67106f8e885ca8449103af569ab100c361
2020-02-06 17:22:28 +00:00
Neil Fuller
b03661f5d8 Merge "More renames for API council" 2020-02-06 17:05:02 +00:00
atrost
8a3cd58882 Add CompatChanges API.
This wraps our existing APIs for isChangeEnabled, and is exposed for
mainline modules to use.
Also upgrading PlatformCompatChangeRule to androidx to match with
frameworks coretests.

Test: http://aosp/1203413
Test: atest android.app.compat.CompatChangesTest
Test: atest com.android.tests.gating.PlatformCompatGatingTest
Bug: 142650523
Change-Id: I12b9436c2ea955e9b74228f150b872d6eb3a1081
2020-02-06 14:42:31 +00:00
Automerger Merge Worker
69ca2fcfa0 Merge "Add permissions for using PlatformCompat methods" am: 7202e904c9
Change-Id: Iffdf7ffc1265fce941eb4cd519031da4575ac53a
2020-02-06 13:51:30 +00:00
Andrei-Valentin Onea
7202e904c9 Merge "Add permissions for using PlatformCompat methods" 2020-02-06 13:40:34 +00:00
Andrei Onea
26559bcb40 Add permissions for using PlatformCompat methods
- READ_COMPAT_CHANGE_CONFIG is required to read the current state of the
config
- LOG_COMPAT_CHANGE is required to log the status of a compat change for
a package and/or uid to statsd
- OVERRIDE_COMPAT_CHANGE_CONFIG is required to add overrides

The permissions must be signature|privileged, as there are already
examples of code which this would not be sufficient (e.g.
MediaProvider).

This is a re-landing of https://r.android.com/1209240, which was
reverted due to http://b/142942524. The actual fix was done in
http://ag/10234812.


Bug: 142650523
Test: atest PlatformCompatTest
Test: atest PlatformCompatPermissionsTest
Change-Id: Ie9429477c9a1725b5cb67756787bf742038e5d2b
2020-02-06 12:22:42 +00:00
Neil Fuller
c0d59e39d7 More renames for API council
Renames PhoneTime[|Zone]Suggestion to TelephonyTime[|Zone]Suggestion.
Makes changes to generally avoid PHONE and use SLOT_INDEX or telephony
as appropriate for the usage. Removes telephony / phone from a few
variable names where it doesn't add value.

This commit also renames some remaining phoneId instances to slotIndex
which were missed when that rename happened.

Bug: 148842434
Test: treehugger
Change-Id: I4302e68082b802b75b53c02a9c9b1ae39dff6085
2020-02-06 08:41:26 +00:00
Automerger Merge Worker
84642d37d5 Merge "Add getExtension to android.os.IBinder interface" am: 935dfd2ce9
Change-Id: I0379693d0c87e77eaed7dd133edb00c410d2dfd5
2020-02-04 22:28:29 +00:00
Yo Chiang
935dfd2ce9 Merge "Add getExtension to android.os.IBinder interface" 2020-02-04 22:17:24 +00:00
Automerger Merge Worker
a8116d930c Merge "Minor refactor of ChangeReporter and PlatformCompat" am: 55d16fac97
Change-Id: I691696fa0ffa50c87bb3afb26173f4cc595453a2
2020-02-03 12:46:12 +00:00
Treehugger Robot
55d16fac97 Merge "Minor refactor of ChangeReporter and PlatformCompat" 2020-02-03 12:37:48 +00:00
Automerger Merge Worker
d0045fbffd Merge "Rename phoneId to slotIndex" am: 4e540a1c59
Change-Id: If220028441547c85c3540c52af9f714a15853b3a
2020-02-03 12:09:10 +00:00
Neil Fuller
4e540a1c59 Merge "Rename phoneId to slotIndex" 2020-02-03 11:55:39 +00:00
Yo Chiang
b031685032 Add getExtension to android.os.IBinder interface
Provide a mechanism to extend and customize a binder interface without
having to modify the original (base) interface.
See the full motivation here: aosp/1099664

Bug: 147834064
Test: atest FrameworksCoreTests:BinderTest FrameworksCoreTests:BinderProxyTest
Change-Id: Idd3595b1302cf7ac0590d064e795ba0b75811af6
2020-02-03 16:07:35 +08:00
Neil Fuller
d8da3387c4 Rename phoneId to slotIndex
Rename phoneId to slotIndex. Some of the classes are being put in an API
surface and phoneId is an internal concept. slotIndex is its replacement
and should be identical.

Bug: 148403082
Test: treehugger build only
Change-Id: Iecbf347c9d13877f2e3f74b6daa22661bade257a
2020-01-31 17:06:33 +00:00
Automerger Merge Worker
892e354de9 Merge "Remove try-catch from LocationPermissionChecker" am: 497afcff0c
Change-Id: Iba17dc925db09447e71e766c5fac254128f820d1
2020-01-31 16:43:37 +00:00
Andrei Onea
1220afbd75 Minor refactor of ChangeReporter and PlatformCompat
Move all StatsLog generated constants into ChangeReporter, to make
re-submitting http://ag/10194708 easier.

Bug: 145952197
Test: atest PlatformCompatTest ChangeReporterTest
Change-Id: Iccff9582099c58f070a6b6aeb1d2588b0fafa90a
2020-01-31 14:30:28 +00:00
Qingxi Li
0b61b3d716 Remove try-catch from LocationPermissionChecker
Since LocationPermissionChecker#checkLocationPermission will be
used in ConnectivityService and the try-catch style will end up
in unwinding the stack. This CL remove the try-catch block from
this check function.

Bug: 148460709
Test: atest LocationPermissionCheckerTest
Change-Id: Ia97b3d8b1a96aca10fd87876969c290818e7e758
Merged-In: Ia97b3d8b1a96aca10fd87876969c290818e7e758
2020-01-31 01:06:17 +00:00
Qingxi Li
df40c6dd2f Merge "Update location permission check for ConnectivityUtil"
am: 1e5d7a9020

Change-Id: Ic9a61ab57335f778c856ec226ded08a86dc22fc0
2020-01-27 15:21:59 -08:00
Qingxi Li
545a87c852 Update location permission check for ConnectivityUtil
This CL does following updates for the ConnectivityUtil class:
1. Remove the current profile check from location permission
check since it's not related to location permission check.
2. Makes all the checking functions to static to avoid memory
allocation
3. Rename the class from util to checker.

Bug: 148180968
Bug: 148232681
Bug: 148233000
Test: atest FrameworksNetTest
Change-Id: Ibf8879fe7dbcecdf766b959cb052d4d825b9b24c
Merged-In: Ibf8879fe7dbcecdf766b959cb052d4d825b9b24c
2020-01-27 14:11:15 -08:00
Dan Willemsen
621c06bd7d Merge "Convert OverlayHostTests to Android.bp"
am: 482b636291

Change-Id: I9b49f8df85597665c0dee0576c0d156b0211f31a
2020-01-21 10:57:46 -08:00
Dan Willemsen
74fdedcc4c Convert OverlayHostTests to Android.bp
Bug: 130723131
Test: m OverlayHostTests
Change-Id: If6c68abb0b591b196725b396bcbfe198d14b60c7
2020-01-20 22:46:18 -08:00
TreeHugger Robot
8da97bddbd Merge "DO NOT MERGE - Merge qt-qpr1-dev-plus-aosp-without-vendor (6129114) into stage-aosp-master" into stage-aosp-master 2020-01-16 18:29:18 +00:00
Treehugger Robot
948c4086af Merge "Create an until function to check location permission" 2020-01-16 00:30:39 +00:00
Qingxi Li
cd4a08fb4a Create an until function to check location permission
This util function will check whether the app has location permission
and whether the location mode is enabled for the users. This function
will be used by both connectivity service and wifi networks.

Bug: 142072839
Test: atest ConnectivityUtilTest
Change-Id: I5558ed04e5ef28033a1c649f5491f2f15aa63557
Merged-In: I5558ed04e5ef28033a1c649f5491f2f15aa63557
2020-01-15 15:24:01 -08:00
Automerger Merge Worker
00f335412b Merge changes I978ac321,I5675a80c,I56ef3cc4,I1cdaf002 am: 2ff0a7bd58 am: 3bb4823ce5
Change-Id: Iccbb591430093ac42fa813648fa4ece4b17a0ea3
2020-01-11 01:17:27 +00:00