android core aula 5 - ril (radio interface layer)

29
Android Core Felipe Silveira felipesilveira.com.br Aula 5

Upload: felipe-silveira

Post on 24-May-2015

359 views

Category:

Technology


9 download

DESCRIPTION

Quinta Aula do curso "Android Core". Nesta aula veremos detalhes do RIL, o componente Android responsável por comunicação de voz.

TRANSCRIPT

Page 1: Android Core Aula 5 -  RIL (Radio Interface Layer)

Android Core

Felipe Silveirafelipesilveira.com.br Aula 5

Page 2: Android Core Aula 5 -  RIL (Radio Interface Layer)

RIL (Radio Interface Layer)

Page 3: Android Core Aula 5 -  RIL (Radio Interface Layer)

RIL: Radio Interface LayerO que é RIL?

● Camada de abstração entre os serviços de telefonia de android (android.telephony) e o hardware de rádio.

● 2 principais componentes:- RIL Daemon (rild)- Vendor RIL

Page 4: Android Core Aula 5 -  RIL (Radio Interface Layer)

RIL: Radio Interface LayerApplications (Phone, Messaging, Contacts, etc.)

Page 5: Android Core Aula 5 -  RIL (Radio Interface Layer)

RIL: Radio Interface Layer

Packet DriverPPP, for exampleLinux IP stack

Vendor RILsystem/libs/libril-vendor.so

Radio Daemon (rild)commands/rild

Phoneandroid.telephony.*

Applications (Phone, Messaging, Contacts, etc.)

RIL API (RILJ)android.telephony.gsm.*

Baseband

Page 6: Android Core Aula 5 -  RIL (Radio Interface Layer)

RIL: Radio Interface Layer

Packet DriverPPP, for exampleLinux IP stack

Vendor RILsystem/libs/libril-vendor.so

Radio Daemon (rild)commands/rild

Phoneandroid.telephony.*

Applications (Phone, Messaging, Contacts, etc.)

RIL API (RILJ)android.telephony.gsm.*

Baseband

Page 7: Android Core Aula 5 -  RIL (Radio Interface Layer)

RIL: Radio Interface Layer

Packet DriverPPP, for exampleLinux IP stack

Vendor RILsystem/libs/libril-vendor.so

Radio Daemon (rild)commands/rild

Phoneandroid.telephony.*

Applications (Phone, Messaging, Contacts, etc.)

RIL API (RILJ)android.telephony.gsm.*

Baseband

Page 8: Android Core Aula 5 -  RIL (Radio Interface Layer)

RIL: Radio Interface Layer

Packet DriverPPP, for exampleLinux IP stack

Vendor RILsystem/libs/libril-vendor.so

Radio Daemon (rild)commands/rild

Phoneandroid.telephony.*

Applications (Phone, Messaging, Contacts, etc.)

RIL API (RILJ)android.telephony.gsm.*

Baseband

Page 9: Android Core Aula 5 -  RIL (Radio Interface Layer)

RIL: Radio Interface Layer

Packet DriverPPP, for exampleLinux IP stack

Vendor RILsystem/libs/libril-vendor.so

Radio Daemon (rild)commands/rild

Phoneandroid.telephony.*

Applications (Phone, Messaging, Contacts, etc.)

RIL API (RILJ)android.telephony.gsm.*

Baseband

Page 10: Android Core Aula 5 -  RIL (Radio Interface Layer)

RIL: Radio Interface Layer

Packet DriverPPP, for exampleLinux IP stack

Vendor RILsystem/libs/libril-vendor.so

Radio Daemon (rild)commands/rild

Phoneandroid.telephony.*

Applications (Phone, Messaging, Contacts, etc.)

RIL API (RILJ)android.telephony.gsm.*

Baseband

RIL

Page 11: Android Core Aula 5 -  RIL (Radio Interface Layer)

RILD - Radio Interface Layer DaemonO termo RILD se refere ao componente responsável por controlar as tarefas de telefonia.

A abreviação terminada em D indica que ele é um daemon, componente comum em sistemas linux.

Page 12: Android Core Aula 5 -  RIL (Radio Interface Layer)

RILD - Radio Interface Layer DaemonEm linux, daemons são softwares responsáveis por receber comandos que serão executados em background.

Este software é executado em um processo que nunca é terminado.

Exemplos: sshd, ftpd, httpd, etc

Em android o conceito é o mesmo.

Page 13: Android Core Aula 5 -  RIL (Radio Interface Layer)

RILD - Radio Interface layer daemon

● Responsável por inicializar o Vendor RIL

● Faz o processamento de toda comunicação entre os serviços de telefonia android e dispara chamadas para o Vendor RIL através dos Solicited Commands. Por exemplo: send SMS, dial, etc.

Page 14: Android Core Aula 5 -  RIL (Radio Interface Layer)

Estrutura interna do RILD

Page 15: Android Core Aula 5 -  RIL (Radio Interface Layer)

RILC

● Escrito em C● hardware/lib/ril● Event Scheduler

responsável por processar as requisições solicitadas e não-solicitadas.

Page 16: Android Core Aula 5 -  RIL (Radio Interface Layer)

Vendor RIL

● hardware/ril/reference-ril

● Lib proprietária, responsável por acessar o BP para serviços de voz/mensagens/controle e a IP stack para dados

Page 17: Android Core Aula 5 -  RIL (Radio Interface Layer)

RILD StartupInicialização do RIL daemon é feita pelo init.rc:

Page 18: Android Core Aula 5 -  RIL (Radio Interface Layer)

RILD StartupApós a inicialização do rild, este executa a seguinte sequência para inicializar toda a stack de telefonia e o Vendor RIL:

1) O rild lê as system properties rild.libpath e rild.libargspara determinar qual será o Vendor RIL utilizado e quais são os parâmetros necessários. Por exemplo:

Page 19: Android Core Aula 5 -  RIL (Radio Interface Layer)

RILD Startup

2) O rild então carrega o Vendor RIL e invoca o seu método RIL_Init para obter uma referência para as funções da interface do RIL.

Page 20: Android Core Aula 5 -  RIL (Radio Interface Layer)

RILD Startup

3) O rild invoca o método RIL_register para obter uma referência para as funções da interface do Vendor RIL.

Page 21: Android Core Aula 5 -  RIL (Radio Interface Layer)

Interações com o RILO RIL interage com os outros componentes de um telefone android através de dois mecanismos:

● Comandos solicitadosComandos originados da RIL lib (RILJ)

● Comandos não solicitadosComandos originados da camada Baseband

Page 22: Android Core Aula 5 -  RIL (Radio Interface Layer)

Comandos SolicitadosRequisições solicitadas são aquelas que se originam da RIL API, na maioria das vezes a partir de alguma ação do usuário.

Exemplos:

Page 23: Android Core Aula 5 -  RIL (Radio Interface Layer)

Comandos SolicitadosInterface de tratamento de requisições solicitadas:

Page 24: Android Core Aula 5 -  RIL (Radio Interface Layer)

Comandos SolicitadosMais de 60 comandos disponíveis, divididos nos seguintes grupos:

SIM PIN, IO, and IMSI/IMEI (11)

Call status and handling (dial, answer, mute…) (16)

Network status query (4)

Network setting (barring, forwarding, selection…) (12)

SMS (3)

PDP connection (4)

Power and reset (2)

Supplementary Services (5)

Vendor defined and support (4)

Page 25: Android Core Aula 5 -  RIL (Radio Interface Layer)

Comandos Solicitados

Page 26: Android Core Aula 5 -  RIL (Radio Interface Layer)

Comandos Não Solicitados

As requisições não solicitadas, por sua vez, são aquelas que ocorrem a partir de um evento na camada de Baseband.

Exemplos:

Page 27: Android Core Aula 5 -  RIL (Radio Interface Layer)

Comandos Não Solicitados

Interface de tratamento de requisições não solicitadas:

Page 28: Android Core Aula 5 -  RIL (Radio Interface Layer)

Comandos Não SolicitadosMais de 10 comandos disponíveis, divididos nos seguintes

grupos:

Network status changed (4)

New SMS notify (3)

New USSD notify (2)

Signal strength or time changed (2)

Page 29: Android Core Aula 5 -  RIL (Radio Interface Layer)

Comandos Não Solicitados