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

Commit 4525f57f authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Fix WorkSource clientId detection"

parents 7bf93506 8c7d565a
Loading
Loading
Loading
Loading
+5 −12
Original line number Diff line number Diff line
@@ -479,6 +479,7 @@ public class RIL extends BaseCommands implements CommandsInterface {
        mWakeLockCount = 0;
        mRILDefaultWorkSource = new WorkSource(context.getApplicationInfo().uid,
                context.getPackageName());
        mActiveWakelockWorkSource = new WorkSource();

        TelephonyDevController tdc = TelephonyDevController.getInstance();
        tdc.registerRIL(this);
@@ -4266,11 +4267,7 @@ public class RIL extends BaseCommands implements CommandsInterface {

                        String clientId = rr.getWorkSourceClientId();
                        if (!mClientWakelockTracker.isClientActive(clientId)) {
                            if (mActiveWakelockWorkSource != null) {
                            mActiveWakelockWorkSource.add(rr.mWorkSource);
                            } else {
                                mActiveWakelockWorkSource = rr.mWorkSource;
                            }
                            mWakeLock.setWorkSource(mActiveWakelockWorkSource);
                        }

@@ -4327,12 +4324,8 @@ public class RIL extends BaseCommands implements CommandsInterface {
                                rr.mRequest, rr.mSerial,
                                (mWakeLockCount > 1) ? mWakeLockCount - 1 : 0);
                        String clientId = rr.getWorkSourceClientId();
                        if (!mClientWakelockTracker.isClientActive(clientId)
                                && (mActiveWakelockWorkSource != null)) {
                        if (!mClientWakelockTracker.isClientActive(clientId)) {
                            mActiveWakelockWorkSource.remove(rr.mWorkSource);
                            if (mActiveWakelockWorkSource.size() == 0) {
                                mActiveWakelockWorkSource = null;
                            }
                            mWakeLock.setWorkSource(mActiveWakelockWorkSource);
                        }

@@ -4365,7 +4358,7 @@ public class RIL extends BaseCommands implements CommandsInterface {
                mWakeLockCount = 0;
                mWakeLock.release();
                mClientWakelockTracker.stopTrackingAll();
                mActiveWakelockWorkSource = null;
                mActiveWakelockWorkSource = new WorkSource();
                return true;
            }
        } else {
+1 −2
Original line number Diff line number Diff line
@@ -115,9 +115,8 @@ public class RILRequest {
     */
    // @VisibleForTesting
    public static RILRequest obtain(int request, Message result, WorkSource workSource) {
        RILRequest rr = null;
        RILRequest rr = obtain(request, result);

        rr = obtain(request, result);
        if (workSource != null) {
            rr.mWorkSource = workSource;
            rr.mClientId = rr.getWorkSourceClientId();