* Binder object may become null between null check and actual invocation
if using a instance private variable assignable by service connection
callbacks
* The solution to this problem without locking is to assign existing
binder variable to a local final variable before the null check
* Any further invocation to a disconnected binder object will result in
RemoteException that is caught by the try-catch block
* Read and write to volatile variable is always atomic and hence thread-safe
* Removed unnecessary synchronization in BluetoothAdapter constructor
* Private mConnection objects should be final
* Simplfied several return statements where booleans can be returned
directly
* Removed unnecessary catches for NPE since there won't be any
Bug: 64724692
Test: make, pair and use devices, no functional change
Change-Id: Ifc9d6337c0d451a01484b61243230725d5314f8e
With change c4a1e1, unfiltered BLE scans are stopped on screen off
and resumed when screen is turned back on. This is done to save power.
This change updates the documentation accordingly.
BUG: 62264269
Test: Documentation update.
Change-Id: I2d8e9f9f122f978c4d4f59d4139cb51cd4e4a123
This patch adds the following wakelock related counters to connectivity
service dumps included in bug reports:
- total number of wakelok acquisitions and releases
- total cumulative wakelock duration
- longest time the lock was held
Bug: 65085354
Test: runtest frameworks-net, also manually dumped connectivity service
and check new logging
Merged-In: I8f67750c2eea73abf3d44f7f6df484427a8ea3f9
Merged-In: I93c0eb7c8add966378647400e11e33765d952345
Merged-In: Iabe99993001e069b8a8077533bca1fa7fb2f59ba
(cherry picked from commit 26bcfa19d01758c86a8f43a5b39673cd5866d2f3)
Change-Id: I4d6bb43110916b440819813b478523546ac5570e
This patch relays the NetworkBaseObserver notifications about nat
464xlat stacked interfaces onto the ConnectivityService handler.
This allows to process interface up and down notifications in the
same thread context and eliminates several races:
- NPE risk due to race between fixupLinkProperties called on
ConnectivityService thread and interfaceRemoved called on
NetworkManagementService thread.
- stale LinkProperties pointer reads in both NetworkBaseObserver
callbacks not called on ConnectivityService handler.
- removes the race between stop() and interfaceRemoved().
- removes superfluous LinkProperties notifications when stop() is
called before the stacked interface goes up.
The teardown procedure logic common to stop() and interfaceRemoved() is
put into enterStoppedState() and enterIdleState().
This allows to distinguish and correctly handle the following teardown
scenarios:
- an IPv4 appears -> ConnectivityService calls Nat464Xlat#stop()
-> Nat464Xlat calls stopClatd
-> clatd stops
-> if the stacked interface was up, it is removed
-> Nat464Xlat#interfaceRemoved() is triggered and
a LinkProperties update is sent.
- network disconnects -> ConnectivityService calls Nat464Xlat#stop()
-> Nat464Xlat calls stopClatd
-> clatd stops
-> if the stacked interface was up, it is removed
-> Nat464Xlat#interfaceRemoved() is triggered and
a LinkProperties update is sent.
- clatd crashes or exit -> Nat464Xlat#interfaceRemoved() is triggered
-> Nat464Xlat unregisters itself as a network
observer
-> ConnectivityService is updated about the
stacked interface missing, and restarts
Nat464Xlat if needed.
Note that the first two scenarios have two cases: stop() can be called
before the notification for the stacked interface going up (STARTED), or
after (RUNNING). In the first case, Nat464Xlat must unregister
immediately as a network observer to avoid leaks.
This patch also:
- removes/simplifies comments related to the threading model which
are no obsolete.
- extract clatd management logic from ConnectivityService into
NetworkAgentInfo
- add new unit tests where there was none before.
Bug: 62918393
Bug: 62997041
Bug: 64571917
Bug: 65225023
Test: runtest frameworks-net
Change-Id: I27221a8a60fd9760b567ed322cc79228df877e56
Exempt-From-Owner-Approval: Android.mk uses per-file permission to let
the build team modify it without dependeing on us. However because this
rule overrides the directory default owners, Android core networking is
not owner anymore. This exemption is necessary to let Android core
networking team fix their build file.
Test: All tests in runtest frameworks-net pass.
Merged-In: Ie0b8baa38ca39e92fbd698ebcead86dac0a67708
(cherry picked from commit 99e8ab6e46eec5dbd1b059b3732672d537b3cf34)
Change-Id: I4471a5cd7f20852645f3d94684cc5aeef3324162
libutils is now depending on libvndksupport. So any client that
statically links to libutils needs to link against libvndksupport as
well.
Bug: 32561414
Test: ApfTest works
Merged-In: Id99792baa1c0a7a61c4056f83f33d25e0bea143e
(cherry picked from commit 9a2041ee836be925e93dd820f11686aa378dd92d)
Change-Id: I8808e668230ff7076403ff29cf48c12cbc36f78a
Like kale, one can never have enough stats. =)
Test: as follows
- built
- flashed
- booted
- runtest frameworks-net passes
Bug: 29337859
Bug: 32163131
Merged-In: I5d40eae488cab685be6a44849181c0286fe28fdb
Merged-In: I759e97f9a72d15a84036c3a56451b872143539c6
Change-Id: Ieb47c3beed50f21c2c858fe57438afd48cfdc662
(cherry picked from commit 1199a352fcb938a8dc7a34a2853c4fde7f5656f1)
Test: as follows
- built
- flashed
- booted
- runtest frameworks-net passes
(except for UidRange and APF tests that are missing libvndk)
- regular WiFi STA mode attach works for IPv4-only, dualstack,
and IPv6-only networks
- tethering works with dualstack upstream and downstream
Bug: 62476366
Change-Id: Id807b3091b0b2935b01aeb3644245034312b4183
There are values used for Bluetooth energy calculations in the
configuration file. The values were set to 1, 2, 3, 4 and ends up giving
some very wrong energy calculations. They are now set to 0 by default.
Bug: 64662990
Test: manual
Change-Id: I2be2a19f50e2e56d7dadb9ff23b9827520d4d1ea
(cherry picked from commit 3e6eb50e35f4d0fb8db774bed17a46effbc65671)
Adds the ERROR return state for bool provisioning values
so that we can throw an Exception in some cases.
Bug: 64540800
Test: Manual
Merged-In: Id412c0be939da6240a66a942730fd18badabb6c6
Change-Id: I0b79837c694d245999031ec65783857e114b7c75
1) If the PIN/PUK keyguard comes up for a locked
SIM, it can not be removed by removing the
affected SIM. It can only be removed by
rebooting the device or entering a bogus PIN.
This change automatically clears the keyguard
when when the locked SIM is removed. It will
be shown again if the locked SIM is re-entered.
2) If the device is PUK locked and the code
**05*PUK*new pin* new Pin# is entered in the
emergency dialer, it will unlock the SIM.
By listening to the READY state, we can remove
the keyguard when the SIM is unlocked by
other means.
Bug: 64469515
Bug: 64044132
Test: Manual
Merged-In: I7b576ee7e38f141075cae094e3d1f74b7145d53f
Change-Id: I9507f80edcd4c04dfa0cc3b48a25e619aafa9eb3
Add a configurable black for protocols which packets are to be dropped
by APF. This enales an OEM to configure the APF to filter out un-needed
packets from reaching the host
Bug: 62415182
Test: runtest frameworks-net
Merged-In: I86335a0f854d5e83a2b2767978cd69b2cc25c2f8
Signed-off-by: Ahmed ElArabawy <arabawy@google.com>
(cherry picked from commit caffbe127726c6a9ab5dd023a9b09cfa43eac617)
Change-Id: I15a758d18464d73d24ba8364a867904bb3cd3b34
The settings button overlaps with the expand indicator
in RTL layout case when rotating the device to landscape mode.
To fix this issue, the animation of settings button
in RTL layout case should be changed.
Fixes: 65228478
Test: manual - set a BiDi language and open Notification panel.
Change-Id: I008b33ebcdf074639a291e7d30d3343654a2ea37
Remove the unused methods
- IdmapManager.isDangerous(PackageInfo, int)
- IdmapManager.isDangerous(String)
The concept of a dangerous overlay is currently not used, so remove any
trace of it.
Test: builds
Change-Id: I79ea00c05c0ee113733c20e982ae8f517bbbbd11
To clear all overlay packages, the caller of
ResourcesManager#applyNewResourceDirsLocked will pass in null as the
second argument. Fix typo where the argument's annotation misspelled
@Nullable as @NonNull.
Change-Id: I7218f17ac8f121924e722d3e00d3ebdc4d6f3382
The OverlayManagerListener connected to the OverlayManagerServiceImpl
should be notified when and only when the overlay settings have been
modified. The pattern used to fulfill this contract as a result of a
change to a target package is as follows:
if (updateAllOverlaysForTarget(...)) {
mListener.onOverlaysChanged(...);
}
Fix two violations of this pattern:
- The listener was always notified
- The listener was never notified
Test: manual
Change-Id: Id24a439e2eaaf976e8c7d650af36d58632cfb4ba
Clean up SystemProperties.java. Add annotations.
Clean up SystemProperties.cpp. Refactor for proper C++11.
Make sure C-string key construction is properly reused. Use
android::base functionality for actual reading.
Fix the test script to refer to the right location. Add some
test coverage.
(cherry picked from commit 2e6b9cb56320a86f0c33da890f667e5c76c8285d)
Test: m
Test: frameworks/base/core/tests/systemproperties/run_core_systemproperties_test.sh --rebuild
Merged-In: I490577370da985f600fb1117e3c818d3f68bad5f
Change-Id: I490577370da985f600fb1117e3c818d3f68bad5f
Add a warning that calling get() is unsafe when the system property
may not contain a valid UTF-encoded string.
(cherry picked from commit 6bf1cff1dd8cad0d2c6eb4f2cef28a97270e46b2)
Bug: 63177684
Test: m
Merged-In: I68e3096d770a32fe204be5c130a3ada9d3db7c0b
Change-Id: I68e3096d770a32fe204be5c130a3ada9d3db7c0b