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

Commit 738afe67 authored by Ricardo Cerqueira's avatar Ricardo Cerqueira
Browse files

FmService: Make usage of audiopatch a build-time option

Change Ib732c8e8328035d2b3e60b7823446d1d75b3c107 assumes all devices
have issues with direct volume configuration and require audiopatching
to be disabled in favor of soft rendering. Don't do that, make it
configurable.

Change-Id: Ia334052043a292d37b44e727769232e55a673d35
parent 33885741
Loading
Loading
Loading
Loading

res/values/config.xml

0 → 100644
+19 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2016 CyanogenMod

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
    <bool name="config_useSoftwareRenderingForAudio" translatable="false">true</bool>
</resources>
+23 −21
Original line number Diff line number Diff line
@@ -1683,9 +1683,13 @@ public class FmService extends Service implements FmRecorder.OnRecorderStateChan

    // Make sure patches count will not be 0
    private boolean isPatchMixerToEarphone(ArrayList<AudioPatch> patches) {
    /*
        int deviceCount = 0;
        int deviceEarphoneCount = 0;
        if (mContext.getResources().getBoolean(R.bool.config_useSoftwareRenderingForAudio)) {
            Log.w(TAG, "FIXME: forcing isPatchMixerToEarphone to return false. "
                    + "Software rendering will be used.");
            return false;
        } else {
            for (AudioPatch patch : patches) {
                AudioPortConfig[] sources = patch.sources();
                AudioPortConfig[] sinks = patch.sinks();
@@ -1706,9 +1710,7 @@ public class FmService extends Service implements FmRecorder.OnRecorderStateChan
            if (deviceEarphoneCount == 1 && deviceCount == deviceEarphoneCount) {
                return true;
            }
    */
        Log.w(TAG, "FIXME: forcing isPatchMixerToEarphone to return false. "
                 + "Software rendering will be used.");
        }
        return false;
    }