[GH-ISSUE #946] startLocalOnlyHotspot closed by system #799

Closed
opened 2026-02-28 01:27:06 +03:00 by kerem · 3 comments
Owner

Originally created by @iadeelzafar on GitHub (Sep 22, 2019).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/946

I'm using startLocalOnlyHotspot in a project of mine that is similar to this project.

Hotspot is turned off by the system after a few minutes and I see this in the Logs.

2019-09-05 11:12:42.087 759-3392/? I/WifiService: stopLocalOnlyHotspot uid=10184 pid=16049

Digging more, here's what this method that is being called by the system itself does.

 /**
     *  Method used to inform WifiService that the LocalOnlyHotspot is no longer needed.  This
     *  method is used by WifiManager to release LocalOnlyHotspotReservations held by calling
     *  applications and removes the internal tracking for the hotspot request.  When all requesting
     *  applications are finished using the hotspot, it will be stopped and WiFi will return to the
     *  previous operational mode.
     *
     *  This method should not be called by applications.  Instead, they should call the close()
     *  method on their LocalOnlyHotspotReservation.
     */
    private void stopLocalOnlyHotspot() {

So, my question is how the system decides that LocalOnlyHotspot is no longer needed? My other devices are connected to the local hotspot and a server is hosted on it. But it still gets turned off.

Please enlighten me.

Thanks!

Originally created by @iadeelzafar on GitHub (Sep 22, 2019). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/946 I'm using [startLocalOnlyHotspot](https://developer.android.com/reference/android/net/wifi/WifiManager#startLocalOnlyHotspot(android.net.wifi.WifiManager.LocalOnlyHotspotCallback,%20android.os.Handler)) in a project of mine that is similar to this project. Hotspot is turned off by the system after a few minutes and I see this in the Logs. ```2019-09-05 11:12:42.087 759-3392/? I/WifiService: stopLocalOnlyHotspot uid=10184 pid=16049``` Digging more, here's what this method that is being called by the system itself does. ``` /** * Method used to inform WifiService that the LocalOnlyHotspot is no longer needed. This * method is used by WifiManager to release LocalOnlyHotspotReservations held by calling * applications and removes the internal tracking for the hotspot request. When all requesting * applications are finished using the hotspot, it will be stopped and WiFi will return to the * previous operational mode. * * This method should not be called by applications. Instead, they should call the close() * method on their LocalOnlyHotspotReservation. */ private void stopLocalOnlyHotspot() { ``` **So, my question is how the system decides that LocalOnlyHotspot is no longer needed? My other devices are connected to the local hotspot and a server is hosted on it. But it still gets turned off.** Please enlighten me. Thanks!
kerem closed this issue 2026-02-28 01:27:07 +03:00
Author
Owner

@iadeelzafar commented on GitHub (Sep 22, 2019):

P.S: I'm using the startLocalOnlyHotspot on a foreground service but the hotspot is closed by the system while the service is still running.

<!-- gh-comment-id:533913517 --> @iadeelzafar commented on GitHub (Sep 22, 2019): P.S: I'm using the `startLocalOnlyHotspot` on a foreground service but the hotspot is closed by the system while the service is still running.
Author
Owner

@tablatronix commented on GitHub (Sep 22, 2019):

I have no idea what this is

<!-- gh-comment-id:533919094 --> @tablatronix commented on GitHub (Sep 22, 2019): I have no idea what this is
Author
Owner

@tablatronix commented on GitHub (Sep 22, 2019):

This is arduino esp wifimanager not android

<!-- gh-comment-id:533919224 --> @tablatronix commented on GitHub (Sep 22, 2019): This is arduino esp wifimanager not android
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/WiFiManager#799
No description provided.