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

Commit ae54865e authored by Luis GarciaCalderon's avatar Luis GarciaCalderon Committed by Giulio Cervera
Browse files

MediaRecorder: Remove creation of new thread when voting for io_is_busy

Change-Id: I682b91be2a001f19eb4b8c90a4d0e450bbbe1f71
CRs-Fixed: 339691
parent 0d210d8b
Loading
Loading
Loading
Loading
+14 −10
Original line number Diff line number Diff line
@@ -678,11 +678,13 @@ public class MediaRecorder

    public void start() throws IllegalStateException {
        try {
            Application application = ActivityThread.systemMain().getApplication();
            Application application = ActivityThread.currentApplication();
            if (application != null) {
                Intent ioBusyVoteIntent = new Intent(IOBUSY_VOTE);
                // Vote for io_is_busy to be turned off.
                ioBusyVoteIntent.putExtra("com.android.server.CpuGovernorService.voteType", 0);
                application.sendBroadcast(ioBusyVoteIntent);
            }
        } catch (Exception exception) {
            Log.e(TAG, "Unable to vote to turn io_is_busy off.");
        }
@@ -692,11 +694,13 @@ public class MediaRecorder

    public void stop() throws IllegalStateException {
        try {
            Application application = ActivityThread.systemMain().getApplication();
            Application application = ActivityThread.currentApplication();
            if (application != null) {
                Intent ioBusyUnVoteIntent = new Intent(IOBUSY_UNVOTE);
                // Remove vote for io_is_busy to be turned off.
                ioBusyUnVoteIntent.putExtra("com.android.server.CpuGovernorService.voteType", 0);
                application.sendBroadcast(ioBusyUnVoteIntent);
            }
        } catch (Exception exception) {
            Log.e(TAG, "Unable to withdraw io_is_busy off vote.");
        }