• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2016 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 package com.android.phone.vvm.omtp.sms;
17 
18 import android.annotation.Nullable;
19 import android.app.PendingIntent;
20 import android.telephony.SmsManager;
21 
22 public class Vvm3MessageSender extends OmtpMessageSender {
23 
24     /**
25      * Creates a new instance of Vvm3MessageSender.
26      *
27      * @param smsManager SMS sending library. There is a different SmsManager for each SIM.
28      * @param applicationPort If set to a value > 0 then a binary sms is sent to this port number.
29      * Otherwise, a standard text SMS is sent.
30      */
Vvm3MessageSender(SmsManager smsManager, short applicationPort, String destinationNumber)31     public Vvm3MessageSender(SmsManager smsManager, short applicationPort,
32             String destinationNumber) {
33         super(smsManager, applicationPort, destinationNumber);
34     }
35 
36     @Override
requestVvmActivation(@ullable PendingIntent sentIntent)37     public void requestVvmActivation(@Nullable PendingIntent sentIntent) {
38         // Activation not supported for VVM3, send a status request instead.
39         requestVvmStatus(sentIntent);
40     }
41 
42     @Override
requestVvmDeactivation(@ullable PendingIntent sentIntent)43     public void requestVvmDeactivation(@Nullable PendingIntent sentIntent) {
44         // Deactivation not supported for VVM3, do nothing
45     }
46 
47 
48     @Override
requestVvmStatus(@ullable PendingIntent sentIntent)49     public void requestVvmStatus(@Nullable PendingIntent sentIntent) {
50         // Status message:
51         // STATUS
52         StringBuilder sb = new StringBuilder().append("STATUS");
53         sendSms(sb.toString(), sentIntent);
54     }
55 }
56