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

Commit 781a7fd3 authored by Eric Laurent's avatar Eric Laurent
Browse files

NuPlayer: use acquireWakeLockAsync in AWakeLock

It appears the IPowerManager::acquireWakeLock() does not transport the
Display ID properly causing a failure to acquire a wakelock from native
code.
Use acquireWakeLockAsync until the problem is root caused.

Bug: 234429395
Test: repro steps in bug
Change-Id: Ice44a818c8c18e42008eb5271d37d263fee57484
parent 1ccce7e1
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -59,11 +59,10 @@ bool AWakeLock::acquire() {
        if (mPowerManager != NULL) {
            sp<IBinder> binder = new BBinder();
            int64_t token = IPCThreadState::self()->clearCallingIdentity();
            binder::Status status = mPowerManager->acquireWakeLock(
            binder::Status status = mPowerManager->acquireWakeLockAsync(
                    binder, POWERMANAGER_PARTIAL_WAKE_LOCK,
                    String16("AWakeLock"), String16("media"),
                    {} /* workSource */, {} /* historyTag */, -1 /* displayId */,
                    nullptr /* callback */);
                    {} /* workSource */, {} /* historyTag */);
            IPCThreadState::self()->restoreCallingIdentity(token);
            if (status.isOk()) {
                mWakeLockToken = binder;