Android-cuttlefish cvd tool
sup_service.h
Go to the documentation of this file.
1//
2// Copyright (C) 2020 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15
16#pragma once
17
19
20namespace cuttlefish {
21
22class SupService : public ModemService,
23 public std::enable_shared_from_this<SupService> {
24 public:
25 SupService(int32_t service_id, ChannelMonitor* channel_monitor,
26 ThreadLooper* thread_looper);
27 ~SupService() = default;
28
29 SupService(const SupService&) = delete;
30 SupService& operator=(const SupService&) = delete;
31
32 void HandleUSSD(const Client& client, std::string& command);
33 void HandleCLIR(const Client& client, std::string& command);
34 void HandleCallWaiting(const Client& client, std::string& command);
35 void HandleCLIP(const Client& client);
36 void HandleCallForward(const Client& client, std::string& command);
37 void HandleSuppServiceNotifications(const Client& client,
38 std::string& command);
39
40 private:
41 std::vector<CommandHandler> InitializeCommandHandlers();
43
45 enum ClirType {
46 DEFAULT = 0, // "use subscription default value"
47 CLIR_INVOCATION = 1, // restrict CLI presentation
48 CLIR_SUPPRESSION = 2, // allow CLI presentation
49 };
50
57 };
58
61 };
63
67 ENABLE = 1,
71 };
72
73 enum Reason {
74 CFU = 0, // communication forwarding unconditional
75 CFB = 1, // communication forwarding on busy user
76 CFNR = 2, // communication forwarding on no reply
77 CFNRC = 3, // communication forwarding on subscriber not reachable
78 ALL_CF = 4, // all call forwarding
79 ALL_CONDITIONAL_CF = 5, // all conditional call forwarding
80 CD = 6, // communication deflection
81 CFNL = 7, // communication forwarding on not logged-in
82 };
83
86 int number_type; // From 27.007 +CCFC/+CLCK "class"
87 int ton; // "type" from TS 27.007 7.11
88 std::string number; // "number" from TS 27.007 7.11. May be NULL
89 int timeSeconds; // for CF no reply only
90
92 : status(DISABLE),
94 number_type(2),
95 ton(129),
96 number(""),
97 timeSeconds(0) {};
98 };
99 std::vector<CallForwardInfo> call_forward_infos_;
100
102 int presentation_status; // sets / shows the result code presentation
103 // status to the TE, 0: disable; 1: enable
104 int mode; // 0: disable; 1: enable; 2: query status
105 int classx; // a sum of integers each representing a class of information
106 // default 7-voice, data and fax, see FacilityLock::Class
107
109 };
111};
112
113} // namespace cuttlefish
Definition: channel_monitor.h:35
Definition: client.h:48
Definition: modem_service.h:63
Definition: sup_service.h:23
void HandleSuppServiceNotifications(const Client &client, std::string &command)
Definition: sup_service.cpp:180
void HandleCallWaiting(const Client &client, std::string &command)
Definition: sup_service.cpp:305
SupService(const SupService &)=delete
ClirStatusInfo clir_status_
Definition: sup_service.h:62
SupService(int32_t service_id, ChannelMonitor *channel_monitor, ThreadLooper *thread_looper)
Definition: sup_service.cpp:20
void InitializeServiceState()
Definition: sup_service.cpp:55
void HandleCLIR(const Client &client, std::string &command)
Definition: sup_service.cpp:114
std::vector< CallForwardInfo > call_forward_infos_
Definition: sup_service.h:99
SupService & operator=(const SupService &)=delete
void HandleUSSD(const Client &client, std::string &command)
Definition: sup_service.cpp:85
std::vector< CommandHandler > InitializeCommandHandlers()
Definition: sup_service.cpp:27
CallWaitingInfo call_waiting_info_
Definition: sup_service.h:110
void HandleCLIP(const Client &client)
Definition: sup_service.cpp:153
void HandleCallForward(const Client &client, std::string &command)
Definition: sup_service.cpp:203
Definition: thread_looper.h:51
Definition: alloc_driver.h:20
Definition: sup_service.h:64
Reason
Definition: sup_service.h:73
@ CFNR
Definition: sup_service.h:76
@ CFNL
Definition: sup_service.h:81
@ CFU
Definition: sup_service.h:74
@ CFB
Definition: sup_service.h:75
@ ALL_CONDITIONAL_CF
Definition: sup_service.h:79
@ CD
Definition: sup_service.h:80
@ CFNRC
Definition: sup_service.h:77
@ ALL_CF
Definition: sup_service.h:78
int number_type
Definition: sup_service.h:86
Reason reason
Definition: sup_service.h:85
int ton
Definition: sup_service.h:87
std::string number
Definition: sup_service.h:88
CallForwardInfoStatus
Definition: sup_service.h:65
@ DISABLE
Definition: sup_service.h:66
@ ERASURE
Definition: sup_service.h:70
@ ENABLE
Definition: sup_service.h:67
@ INTERROGATE
Definition: sup_service.h:68
@ REGISTRATION
Definition: sup_service.h:69
CallForwardInfoStatus status
Definition: sup_service.h:84
int timeSeconds
Definition: sup_service.h:89
CallForwardInfo(Reason reason)
Definition: sup_service.h:91
Definition: sup_service.h:101
int presentation_status
Definition: sup_service.h:102
CallWaitingInfo()
Definition: sup_service.h:108
int mode
Definition: sup_service.h:104
int classx
Definition: sup_service.h:105
Definition: sup_service.h:44
ClirType
Definition: sup_service.h:45
@ CLIR_INVOCATION
Definition: sup_service.h:47
@ CLIR_SUPPRESSION
Definition: sup_service.h:48
@ DEFAULT
Definition: sup_service.h:46
ClirType type
Definition: sup_service.h:59
ClirStatus
Definition: sup_service.h:51
@ CLIR_NOT_PROVISIONED
Definition: sup_service.h:52
@ UNKNOWN
Definition: sup_service.h:54
@ CLIR_PROVISIONED
Definition: sup_service.h:53
@ CLIR_PRESENTATION_RESTRICTED
Definition: sup_service.h:55
@ CLIR_PRESENTATION_ALLOWED
Definition: sup_service.h:56
ClirStatus status
Definition: sup_service.h:60