* changes:
[IT06]Move INetworkActivityListener into connectivity module
[IT05] Remove the unused network activity logic out from NMS
[IT4.7] Add network activity info into dumpsys for debugging
[IT4.6] Unbundle NMS out from ConnectivityManager
[IT4.5] Update radio power from CS directly
If the device doesn't have a pin, the current RoR preparation will
go through; but the lskf capture event won't happen. In order not
to confuse the caller, throw an exception instead in the no-pin
case.
Bug: 170664917
Test: remove pin, request RoR with adb shell
Change-Id: Ib04c629234b71e3f6cb36bdfe47759a715a69146
- Expand BugreportManager class javadoc
- Explain what "privileged" means
- Highlight only one-BR-at-a-time behavior
- Add more detail to BugreportCallback javadocs
- Explain standard callback invocation flow
- More detail on when BUGREPORT_ERROR_INVALID_INPUT is used
- Add @WorkerThread to {start{,Connectivity},cancel}Bugreport
Bug: 180015324
Test: make
Change-Id: Id3400b1cdd271f47bdeaf8cdc1a0dea61aafc933
INetworkActivityListener is hidden and the only usage is inside
the connectivity module. Thus, move this into module scope.
Bug: 170598012
Test: atest FrameworksNetTests
Change-Id: I0a75c440c1daa773217bbd362b212fda4d07ec64
The network activity logic is moved to ConnectivityService.
CS is no longer setting the idle timer via NMS to netd. The
idle timer should only set from CS, so remove the network
activity logic out from NMS.
Bug: 170598012
Test: atest FrameworksNetTests
Change-Id: Ief9e892586aaee8e9542b9313088fa50d1d411e5
This patch adds the total size of DMA-BUFs exported from the DMA-BUF
heaps framework to dumpsys meminfo.
Bug: 167709539
Test: adb shell dumpsys meminfo
Change-Id: I153721a0dc91ee5084a446ba1ce4f8ec9c51c4f0
Merged-In: I153721a0dc91ee5084a446ba1ce4f8ec9c51c4f0
The DMA buffers mapped by GPU device(s) are already accounted for
in the total exported dmabuf size (ionHeap) size.
To remove GPU memory from lost RAM, provide an API to get only the
DMA buf memory mapped by the GPU device(s).
Bug: 176477627
Test: adb shell dumpsys meminfo
Change-Id: Ie72f46c8de026b143629406714f413677ce6693b
Merged-In: Ie72f46c8de026b143629406714f413677ce6693b
Currently getPssPid includes memtrack HAL reported values in the pss
calculation. This makes it impossible to get these values separately.
Extend this interface to include itemized memtrack values.
Bug: 165832481
Test: dumpsys meminfo
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: Ieb7e1b79ad8ecae6023338d9992467952558e2bd
* changes:
Add total DMA-BUF heap pool size information to dumpsys meminfo
Add total size of DMA-BUFs exported to 'dumpsys meminfo'
Rename getIonMappedSizeKb to getDmabufMappedSizeKb
Some DMA-BUF heaps maintain pools of pre-zeroed memory for faster
allocations. Print the total size of all DMA-BUF heap pools as part of
dumpsys meminfo and use the same in LostRam calculation.
Test: dumpsys meminfo
Bug: 167709539
Change-Id: Ifb61fe596c1a8fab1bd536ec904285e532629b71
Merged-In: Ifb61fe596c1a8fab1bd536ec904285e532629b71
When ION support is not detected, print the total size of DMA-BUFs
exported as part of dumpsys meminfo.
Bug: 167709539
Test: dumpsys meminfo
Change-Id: I3439a8f00cf1aef37e5043b505ed53d47a8a4756
Merged-In: I3439a8f00cf1aef37e5043b505ed53d47a8a4756
The function is actually calculating the total mapped DMA-BUF memory.
Test: dumpsys meminfo
Bug: 167709539
Change-Id: I5c19dc604cf48c3d7ccbfd2d9a83ddd7b35f20d5
Merged-In: I5c19dc604cf48c3d7ccbfd2d9a83ddd7b35f20d5
SysetmConfig is internal service for frameworks only which cannot
use by Connectivity mainline module, but PermissionMonitor which
is part of the module needs to get uids that have been granted
INTERNET/UPDATE_DEVICE_STATS permission from SystemConfig.
Therefore, add a new API to SystemConfigManager that can get
these uids from SysetmConfig.
Bug: 177188455
Test: atest SystemConfigTest
Change-Id: I62bdd969b1b813631ed6223df97bda21a39aec2c
For the incoming connectivity mainline, it need to compute the
intersection of a set of uids and appIds for the permission
control. As @UserIdInt values are internal implementation details
of the OS, any mainline modules should use strongly-typed
UserHandle arguments. Thus, create a new API that accepts
UserHandle and appId to get the computed uid.
Bug: 170598012
Test: atest FrameworksNetTests
Change-Id: I046546d2c5c76eac7a251e63e4234776975bf2bc
Similar to how HIDL HALs are here, we don't know the commandline of the
service, so we can dump them based on service name prefixes.
Power stats and lights are added here, for parity w/ HIDL since these
hvae been converted to AIDL.
Fixes: 175322136
Test: after `adb shell am hang`, we can verify the light service is
dumped, when it wasn't before:
vsoc_x86_64:/data/anr # cat anr_2021-01-28-22-42-44-969 | grep light
Cmd line: /vendor/bin/hw/android.hardware.lights-service.example
Change-Id: I8c8b0cff0c102221875114015a5524c03cfb5b5c
Root cause:
1) a client thread calls "transact", and then, reads a java binder object from the java parcel object
2) the java binder object sends BC_ACQUIRE/BC_INCREFS, but still in the queue, not yet flushed to driver
3) the java parcel object is garbage-collect-ed, and, its finalize method may possibly sends BC_FREE_BUFFER
Because "BC_FREE_BUFFER" is from the java finalize thread, which is different from the "client thread", so, it is possible that "BC_FREE_BUFFER" will be flushed to driver before "BC_ACQUIRE/BC_INCREFS", which makes driver destroy the related "binder_ref" object prematurely.
Consequences of the issue:
The user space process might always hold the above java binder object, whose "handle value" is indeed invalid because the related "binder_ref" in driver is destroyed. This causes a lot of chaos inside the process:
<a> any binder call on the java binder object will be a failure, with kernel log complain: ...got transaction to invalid handle...
<b> afterward, any new bind object passed to this process will NOT create a brand new one for it, instead, it will be simply and incorrectly mapped to the above old biner object, because the new incoming one will use the same "handle value" as the old one. This will make a mess and many weird bugs.
First, it may break "binder object identity" compare based functionality. For example, after registering a listener to a service, all following registering may fail because the latter new listener object is mapped to the old one incorrectly. The service will reject them as "already registered".
Second, binder call on the old binder object is actually dispatched to the new remote binder object, it might even be a success if they are of the same class/interface, which is actually not we expected; and on the other hand, the new binder object may even be of different class/interface, and of course, the binder call may be a failure due to "interface descriptor check".
<c> the user space process cannot recover from the bug automatically unless restart.
Solution:
Hold a temporary reference to the parcel object until "BC_ACQUIRE/BC_INCREFS" flushed to driver.
Bug: 139327211
Test: monkey test for one day and one night
Co-authored-by: Steven Moreland <smoreland@google.com>
Signed-off-by: Jintao Zhu <zhujtcsieee@gmail.com>
Change-Id: I9345f443996b0bdef9d57ddaad119b86205e817f
Connectivity service is going to become a mainline module which
will not be able to access hidden APIs. But PermissionMonitor
needs know Build.VERSION.FIRST_SDK_INT for granting network
restricted permission to system packages. Thus, expose the value
as module-lib API to support the usage.
Bug: 170598012
Test: make update-api
Change-Id: Id0ae42120f69faee43eeb7ebd35cae9e26cb7561
The visibility setting of a removable device shared with Chrome OS is
passed via Disk flags. When a device (stub volume) is marked as visible,
we should set the MOUNT_FLAG_VISIBLE flag to it.
Bug: 123377807
Bug: 142684891
Bug: 132796154
Test: Toggle the visibility setting of a removable device in the Chrome
Test: OS Settings app > Confirm that the device is visible to Android
Test: apps only when it is marked as visible.
Test: Tested in R
Change-Id: I19289596345690b1802738122fe274eeb41f9361
This permission model is only allowed for BUGREPORT_MODE_TELEPHONY to
let carrier apps (even from the Play Store / not pre-loaded) access
BugreportManager to trigger connectivity bugreports.
This also requires SELinux policy changes to allow non-system apps to
get an instance through Context#getSystemService, and then dumpstate
also needs permissions to write public apps' files.
Minor documentation and formatting fixes as well.
BYPASS_INCLUSIVE_LANGUAGE_REASON=leaving variable name derived from
"bugreport-whitelisted" sysconfig alone for now
Bug: 161393541
Test: atest CtsCarrierApiTestCases:BugreportManagerTest
Change-Id: I5a38e7a040fa23146fa6c1e785db102b066ad167
Merged-In: I5a38e7a040fa23146fa6c1e785db102b066ad167
(cherry picked from commit 57fd3440be)
In preparation for a broader set of apps using BugreportManager, we
enforce that only the app which started a bugreport is allowed to cancel
it.
Bug: 161393541
Test: atest BugreportManagerTestCases
Test: manual with two apps triggering/cancelling BRs
Change-Id: I430d856014a226ef345bd2349f0601062dcaa8c7
Merged-In: I430d856014a226ef345bd2349f0601062dcaa8c7
(cherry picked from commit 4a1b9e949d)
This command will be used in tests so tests won't mount data and obb
dirs anymore so won't be killed by system when volume is unmounted.
Bug: 148049767
Test: Enable storage app visibility flag, then run "sm unmount-app-data-dirs PKG PID USER_ID", data and obb are not mounted in /proc/$PID anymore.
Change-Id: Ie5ddf55471f59c61e1906664b87a9bf889702536
Makes two new SystemApis:
getRestrictedProfileParent()
canHaveRestrictedProfile()
Temporarily disables VPN Tests that rely on the old APIs until those
tests are updated (b/175883995).
Bug: 171529940
Test: atest FrameworksNetTests:com.android.server.connectivity.VpnTest
Test: Tests for UserManager SystemApis are TODO awaiting completion of new user test infrastructure (b/163890431)
(cherry picked from commit 20ba13f5bc)
Change-Id: I28e39400039631e7d391dc7b0d003e8a38d1f06a
Expand the "DynSystem" abbreviation to "DynamicSystem".
For simpler log grepping.
Bug: 165471299
Test: No
Change-Id: Ibec692ae45539dacd55e13ffaa903b58f3bf0417
* Remove calls to featureFlagEnabled() as they are causing avc denials,
plus the feature flag is already deprecated.
* Add Intent flag FLAG_ACTIVITY_NEW_TASK to fix the
AndroidRuntimeException, as the Context object used to startActivity()
may not be an Activity object instance.
* Check the nullness of mListener before using it to fix the
NullPointerException.
Bug: 176795908
Test: atest \
cts/tests/tests/os/src/android/os/image/cts/DynamicSystemClientTest.java
Change-Id: I265d9912e76c39406e0adeacd2490b62873c94e4
DSU service would try to install a DSU scratch partition if host system
is debuggable.
If the scratch partition failed to install, then skip installing
scratch, as remount support should be optional.
Otherwise if the guest system is non-debuggable, then the scratch
partition would be ignored by guest, which is harmless.
Otherwise the guest system is debuggable, which means the guest system
would be able to do adb remount.
Relax partition allocation status polling rate from 10ms -> 100ms,
because there's no point polling faster than the screen framerate.
Bug: 165925766
Test: TH
Test: Install a DSU system on a debuggable host, reboot into the guest
system, and guest system can remount.
Change-Id: I9a8255483cc963ebcf7a2909e68ac69371cb369f
- buffer is in bytes, not bits (1MB vs 1Mb)
- this exception is actually a heuristic currently, pending b/28321379
Fixes: 149869862
Test: N/A
Change-Id: Id409a1ce7348666ec9ad6437acf67382be0a0a1f