Skip to content

Commit

Permalink
NetworkScannerServiceVideo: try to avoid Exceeded maximum number of w…
Browse files Browse the repository at this point in the history
  • Loading branch information
courville committed Dec 15, 2024
1 parent 43090b9 commit 8594a37
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -426,9 +426,11 @@ private void doScan(Uri what) {
ContentResolver cr = getContentResolver();
WifiManager wifiManager = (WifiManager) getApplicationContext().getSystemService(WIFI_SERVICE);
wifiLock = wifiManager.createWifiLock(WIFI_MODE_FULL_HIGH_PERF, "ArchosNetworkIndexer");
wifiLock.acquire();

try {
if (!wifiLock.isHeld()) { // Check if the lock is already held
wifiLock.acquire();
}
// send out a sticky broadcast telling the world that we started scanning
Intent scannerIntent = new Intent(ArchosMediaIntent.ACTION_VIDEO_SCANNER_SCAN_STARTED, what);
scannerIntent.setPackage(ArchosUtils.getGlobalContext().getPackageName());
Expand Down

0 comments on commit 8594a37

Please sign in to comment.