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, public std::enable_shared_from_this<SupService> {
23 public:
24 SupService(int32_t service_id, ChannelMonitor* channel_monitor,
25 ThreadLooper* thread_looper);
26 ~SupService() = default;
27
28 SupService(const SupService &) = delete;
29 SupService &operator=(const SupService &) = delete;
30
31 void HandleUSSD(const Client& client, std::string& command);
32 void HandleCLIR(const Client& client, std::string& command);
33 void HandleCallWaiting(const Client& client, std::string& command);
34 void HandleCLIP(const Client& client);
35 void HandleCallForward(const Client& client, std::string& command);
36 void HandleSuppServiceNotifications(const Client& client, std::string& command);
37
38 private:
39 std::vector<CommandHandler> InitializeCommandHandlers();
41
43 enum ClirType {
44 DEFAULT = 0, // "use subscription default value"
45 CLIR_INVOCATION = 1, // restrict CLI presentation
46 CLIR_SUPPRESSION = 2, // allow CLI presentation
47 };
48
55 };
56
59 };
61
65 ENABLE = 1,
69 };
70
71 enum Reason {
72 CFU = 0, // communication forwarding unconditional
73 CFB = 1, //communication forwarding on busy user
74 CFNR = 2, // communication forwarding on no reply
75 CFNRC = 3, // communication forwarding on subscriber not reachable
76 ALL_CF = 4, // all call forwarding
77 ALL_CONDITIONAL_CF = 5, //all conditional call forwarding
78 CD = 6, // communication deflection
79 CFNL = 7, // communication forwarding on not logged-in
80 };
81
84 int number_type; // From 27.007 +CCFC/+CLCK "class"
85 int ton; // "type" from TS 27.007 7.11
86 std::string number; // "number" from TS 27.007 7.11. May be NULL
87 int timeSeconds; // for CF no reply only
88
91 timeSeconds(0){};
92 };
93 std::vector<CallForwardInfo> call_forward_infos_;
94
96 int presentation_status; // sets / shows the result code presentation status to the TE,
97 // 0: disable; 1: enable
98 int mode; // 0: disable; 1: enable; 2: query status
99 int classx; // a sum of integers each representing a class of information
100 // default 7-voice, data and fax, see FacilityLock::Class
101
103 presentation_status(1), mode(0), classx(7) {};
104 };
106};
107
108} // namespace cuttlefish
Definition: channel_monitor.h:35
Definition: client.h:47
Definition: modem_service.h:63
Definition: sup_service.h:22
void HandleSuppServiceNotifications(const Client &client, std::string &command)
Definition: sup_service.cpp:174
void HandleCallWaiting(const Client &client, std::string &command)
Definition: sup_service.cpp:293
SupService(const SupService &)=delete
ClirStatusInfo clir_status_
Definition: sup_service.h:60
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:112
std::vector< CallForwardInfo > call_forward_infos_
Definition: sup_service.h:93
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:105
void HandleCLIP(const Client &client)
Definition: sup_service.cpp:149
void HandleCallForward(const Client &client, std::string &command)
Definition: sup_service.cpp:194
Definition: thread_looper.h:51
Definition: alloc_utils.cpp:23
Definition: sup_service.h:62
Reason
Definition: sup_service.h:71
@ CFNR
Definition: sup_service.h:74
@ CFNL
Definition: sup_service.h:79
@ CFU
Definition: sup_service.h:72
@ CFB
Definition: sup_service.h:73
@ ALL_CONDITIONAL_CF
Definition: sup_service.h:77
@ CD
Definition: sup_service.h:78
@ CFNRC
Definition: sup_service.h:75
@ ALL_CF
Definition: sup_service.h:76
int number_type
Definition: sup_service.h:84
Reason reason
Definition: sup_service.h:83
int ton
Definition: sup_service.h:85
std::string number
Definition: sup_service.h:86
CallForwardInfoStatus
Definition: sup_service.h:63
@ DISABLE
Definition: sup_service.h:64
@ ERASURE
Definition: sup_service.h:68
@ ENABLE
Definition: sup_service.h:65
@ INTERROGATE
Definition: sup_service.h:66
@ REGISTRATION
Definition: sup_service.h:67
CallForwardInfoStatus status
Definition: sup_service.h:82
int timeSeconds
Definition: sup_service.h:87
CallForwardInfo(Reason reason)
Definition: sup_service.h:89
Definition: sup_service.h:95
int presentation_status
Definition: sup_service.h:96
CallWaitingInfo()
Definition: sup_service.h:102
int mode
Definition: sup_service.h:98
int classx
Definition: sup_service.h:99
Definition: sup_service.h:42
ClirType
Definition: sup_service.h:43
@ CLIR_INVOCATION
Definition: sup_service.h:45
@ CLIR_SUPPRESSION
Definition: sup_service.h:46
@ DEFAULT
Definition: sup_service.h:44
ClirType type
Definition: sup_service.h:57
ClirStatus
Definition: sup_service.h:49
@ CLIR_NOT_PROVISIONED
Definition: sup_service.h:50
@ UNKNOWN
Definition: sup_service.h:52
@ CLIR_PROVISIONED
Definition: sup_service.h:51
@ CLIR_PRESENTATION_RESTRICTED
Definition: sup_service.h:53
@ CLIR_PRESENTATION_ALLOWED
Definition: sup_service.h:54
ClirStatus status
Definition: sup_service.h:58