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

Commit b89b86d4 authored by Eric Laurent's avatar Eric Laurent Committed by Android (Google) Code Review
Browse files

Merge "radio service initial implementation"

parents 0125d057 4e09069a
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -26,7 +26,8 @@ LOCAL_SHARED_LIBRARIES := \
	libutils \
	liblog \
	libbinder \
	libsoundtriggerservice
	libsoundtriggerservice \
	libradioservice

LOCAL_STATIC_LIBRARIES := \
	libregistermsext
@@ -38,7 +39,8 @@ LOCAL_C_INCLUDES := \
    frameworks/av/services/audiopolicy \
    frameworks/av/services/camera/libcameraservice \
    $(call include-path-for, audio-utils) \
    frameworks/av/services/soundtrigger
    frameworks/av/services/soundtrigger \
    frameworks/av/services/radio

LOCAL_MODULE:= mediaserver
LOCAL_32_BIT_ONLY := true
+2 −0
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@
#include "MediaPlayerService.h"
#include "service/AudioPolicyService.h"
#include "SoundTriggerHwService.h"
#include "RadioService.h"

using namespace android;

@@ -130,6 +131,7 @@ int main(int argc __unused, char** argv)
        CameraService::instantiate();
        AudioPolicyService::instantiate();
        SoundTriggerHwService::instantiate();
        RadioService::instantiate();
        registerExtensions();
        ProcessState::self()->startThreadPool();
        IPCThreadState::self()->joinThreadPool();
+35 −0
Original line number Diff line number Diff line
# Copyright 2014 The Android Open Source Project
#
# 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.

LOCAL_PATH:= $(call my-dir)

include $(CLEAR_VARS)


LOCAL_SRC_FILES:=               \
    RadioService.cpp

LOCAL_SHARED_LIBRARIES:= \
    libui \
    liblog \
    libutils \
    libbinder \
    libcutils \
    libhardware \
    libradio \
    libradio_metadata

LOCAL_MODULE:= libradioservice

include $(BUILD_SHARED_LIBRARY)
+225 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2015 The Android Open Source Project
 *
 * 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.
 */

#ifndef ANDROID_HARDWARE_RADIO_REGIONS_H
#define ANDROID_HARDWARE_RADIO_REGIONS_H

namespace android {

#define RADIO_BAND_LOWER_FM_ITU1    87500
#define RADIO_BAND_UPPER_FM_ITU1    108000
#define RADIO_BAND_SPACING_FM_ITU1  100

#define RADIO_BAND_LOWER_FM_ITU2    87900
#define RADIO_BAND_UPPER_FM_ITU2    107900
#define RADIO_BAND_SPACING_FM_ITU2  200

#define RADIO_BAND_LOWER_FM_JAPAN    76000
#define RADIO_BAND_UPPER_FM_JAPAN    90000
#define RADIO_BAND_SPACING_FM_JAPAN  100

#define RADIO_BAND_LOWER_FM_OIRT    65800
#define RADIO_BAND_UPPER_FM_OIRT    74000
#define RADIO_BAND_SPACING_FM_OIRT  10

#define RADIO_BAND_LOWER_LW         153
#define RADIO_BAND_UPPER_LW         279
#define RADIO_BAND_SPACING_LW       9

#define RADIO_BAND_LOWER_MW_IUT1    531
#define RADIO_BAND_UPPER_MW_ITU1    1611
#define RADIO_BAND_SPACING_MW_ITU1  9

#define RADIO_BAND_LOWER_MW_IUT2    540
#define RADIO_BAND_UPPER_MW_ITU2    1610
#define RADIO_BAND_SPACING_MW_ITU2  10

#define RADIO_BAND_LOWER_SW         2300
#define RADIO_BAND_UPPER_SW         26100
#define RADIO_BAND_SPACING_SW       5


#ifndef ARRAY_SIZE
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
#endif

const radio_band_config_t sKnownRegionConfigs[] = {
    {   // FM ITU 1
        RADIO_REGION_ITU_1,
        {
        RADIO_BAND_FM,
            false,
            RADIO_BAND_LOWER_FM_ITU1,
            RADIO_BAND_UPPER_FM_ITU1,
            1,
            {RADIO_BAND_SPACING_FM_ITU1},
            {
            RADIO_DEEMPHASIS_50,
            true,
            RADIO_RDS_WORLD,
            true,
            true,
            }
        }
    },
    {   // FM Americas
        RADIO_REGION_ITU_2,
        {
        RADIO_BAND_FM,
            false,
            RADIO_BAND_LOWER_FM_ITU2,
            RADIO_BAND_UPPER_FM_ITU2,
            1,
            {RADIO_BAND_SPACING_FM_ITU2},
            {
            RADIO_DEEMPHASIS_75,
            true,
            RADIO_RDS_US,
            true,
            true,
            }
        }
    },
    {   // FM Japan
        RADIO_REGION_JAPAN,
        {
        RADIO_BAND_FM,
            false,
            RADIO_BAND_LOWER_FM_JAPAN,
            RADIO_BAND_UPPER_FM_JAPAN,
            1,
            {RADIO_BAND_SPACING_FM_JAPAN},
            {
            RADIO_DEEMPHASIS_50,
            true,
            RADIO_RDS_WORLD,
            true,
            true,
            }
        }
    },
    {   // FM Korea
        RADIO_REGION_KOREA,
        {
        RADIO_BAND_FM,
            false,
            RADIO_BAND_LOWER_FM_ITU1,
            RADIO_BAND_UPPER_FM_ITU1,
            1,
            {RADIO_BAND_SPACING_FM_ITU1},
            {
            RADIO_DEEMPHASIS_75,
            true,
            RADIO_RDS_WORLD,
            true,
            true,
            }
        }
    },
    {   // FM OIRT
        RADIO_REGION_OIRT,
        {
        RADIO_BAND_FM,
            false,
            RADIO_BAND_LOWER_FM_OIRT,
            RADIO_BAND_UPPER_FM_OIRT,
            1,
            {RADIO_BAND_SPACING_FM_OIRT},
            {
            RADIO_DEEMPHASIS_50,
            true,
            RADIO_RDS_WORLD,
            true,
            true,
            }
        }
    },
    {   // FM US HD radio
        RADIO_REGION_ITU_2,
        {
            RADIO_BAND_FM_HD,
            false,
            RADIO_BAND_LOWER_FM_ITU2,
            RADIO_BAND_UPPER_FM_ITU2,
            1,
            {RADIO_BAND_SPACING_FM_ITU2},
            {
            RADIO_DEEMPHASIS_75,
            true,
            RADIO_RDS_US,
            true,
            true,
            }
        }
    },
    {   // AM LW
        RADIO_REGION_ITU_1,
        {
            RADIO_BAND_AM,
            false,
            RADIO_BAND_LOWER_LW,
            RADIO_BAND_UPPER_LW,
            1,
            {RADIO_BAND_SPACING_LW},
            {
            }
        }
    },
    {   // AM SW
        RADIO_REGION_ITU_1,
        {
            RADIO_BAND_AM,
            false,
            RADIO_BAND_LOWER_SW,
            RADIO_BAND_UPPER_SW,
            1,
            {RADIO_BAND_SPACING_SW},
            {
            }
        }
    },
    {   // AM MW ITU1
        RADIO_REGION_ITU_1,
        {
            RADIO_BAND_AM,
            false,
            RADIO_BAND_LOWER_MW_IUT1,
            RADIO_BAND_UPPER_MW_ITU1,
            1,
            {RADIO_BAND_SPACING_MW_ITU1},
            {
            }
        }
    },
    {   // AM MW ITU2
        RADIO_REGION_ITU_2,
        {
            RADIO_BAND_AM,
            false,
            RADIO_BAND_LOWER_MW_IUT2,
            RADIO_BAND_UPPER_MW_ITU2,
            1,
            {RADIO_BAND_SPACING_MW_ITU2},
            {
            }
        }
    }
};


} // namespace android

#endif // ANDROID_HARDWARE_RADIO_REGIONS_H
+845 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading