Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
halo
packages_apps_Bluetooth
Commits
5730ef9c
Commit
5730ef9c
authored
8 years ago
by
TreeHugger Robot
Committed by
Android (Google) Code Review
8 years ago
Browse files
Options
Download
Plain Diff
Merge "Do not downgrade filtered scans to opportunistic" into nyc-mr1-dev
parents
0ecd8a91
8d6abb0a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
src/com/android/bluetooth/gatt/ScanManager.java
src/com/android/bluetooth/gatt/ScanManager.java
+10
-3
No files found.
src/com/android/bluetooth/gatt/ScanManager.java
View file @
5730ef9c
...
...
@@ -230,7 +230,7 @@ public class ScanManager {
if
(!
mScanNative
.
isOpportunisticScanClient
(
client
))
{
mScanNative
.
configureRegularScanParams
();
if
(!
mScanNative
.
is
FirstMatchScanClient
(
client
))
{
if
(!
mScanNative
.
is
ExemptFromScanDowngrade
(
client
))
{
Message
msg
=
mHandler
.
obtainMessage
(
MSG_SCAN_TIMEOUT
);
msg
.
obj
=
client
;
// Only one timeout message should exist at any time
...
...
@@ -526,6 +526,12 @@ public class ScanManager {
}
}
private
boolean
isExemptFromScanDowngrade
(
ScanClient
client
)
{
return
isOpportunisticScanClient
(
client
)
||
isFirstMatchScanClient
(
client
)
||
!
shouldUseAllPassFilter
(
client
);
}
private
boolean
isOpportunisticScanClient
(
ScanClient
client
)
{
return
client
.
settings
.
getScanMode
()
==
ScanSettings
.
SCAN_MODE_OPPORTUNISTIC
;
}
...
...
@@ -675,8 +681,9 @@ public class ScanManager {
void
regularScanTimeout
()
{
for
(
ScanClient
client
:
mRegularScanClients
)
{
if
(!
isOpportunisticScanClient
(
client
)
&&
!
isFirstMatchScanClient
(
client
))
{
logd
(
"clientIf set to scan opportunisticly: "
+
client
.
clientIf
);
if
(!
isExemptFromScanDowngrade
(
client
))
{
Log
.
w
(
TAG
,
"Moving scan client to opportunistic (clientIf "
+
client
.
clientIf
+
")"
);
setOpportunisticScanClient
(
client
);
client
.
stats
.
setScanTimeout
();
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment