Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit ba4fc03f authored by Michael Bestas's avatar Michael Bestas
Browse files

Merge tag 'LA.UM.9.12.r1-15100-SMxx50.QSSI13.0' into...

Merge tag 'LA.UM.9.12.r1-15100-SMxx50.QSSI13.0' into staging/lineage-20.0_merge-LA.UM.9.12.r1-15100-SMxx50.QSSI13.0

"LA.UM.9.12.r1-15100-SMxx50.QSSI13.0"

# By Zhenlin Lian
# Via Gerrit - the friendly Code Review server (1) and Linux Build Service Account (1)
* tag 'LA.UM.9.12.r1-15100-SMxx50.QSSI13.0':
  hal: Initialize keep alive list before clearing if wrong state

Change-Id: I0dea3e9fef7e1e114eba456a09e993bf7c4798ad
parents 45ceff8b b2aea03f
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -25,6 +25,11 @@
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Changes from Qualcomm Innovation Center are provided under the following license:
*
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause-Clear
*/

#define LOG_TAG "keep_alive"
@@ -198,13 +203,14 @@ void keep_alive_start(ka_mode_t ka_mode)
    struct listnode out_devices;

    pthread_mutex_lock(&ka.lock);
    list_init(&out_devices);

    ALOGV("%s: mode %x", __func__, ka_mode);
    if ((ka.state == STATE_DISABLED)||(ka.state == STATE_DEINIT)) {
        ALOGE(" %s : Unexpected state %x",__func__, ka.state);
        goto exit;
    }

    list_init(&out_devices);
    get_device_id_from_mode(ka_mode, &out_devices);
    if (compare_devices(&out_devices, &ka.active_devices) &&
            (ka.state == STATE_ACTIVE)) {