19 |
19 |
20 import java.security.Permission; |
20 import java.security.Permission; |
21 import java.security.PermissionCollection; |
21 import java.security.PermissionCollection; |
22 import com.nokia.mj.impl.security.common.PermissionBase; |
22 import com.nokia.mj.impl.security.common.PermissionBase; |
23 import com.nokia.mj.impl.security.utils.SecurityPromptMessage; |
23 import com.nokia.mj.impl.security.utils.SecurityPromptMessage; |
|
24 import com.nokia.mj.impl.utils.Formatter; |
24 |
25 |
25 public class SMSPermissionImpl extends PermissionBase |
26 public class SMSPermissionImpl extends PermissionBase |
26 { |
27 { |
27 public String iAction = null; |
28 public String iAction = null; |
28 |
29 |
74 return (SecurityPromptMessage.getInstance()).getText( |
75 return (SecurityPromptMessage.getInstance()).getText( |
75 SecurityPromptMessage.QUESTION_ID_SMS_OPENING_CONN, null); |
76 SecurityPromptMessage.QUESTION_ID_SMS_OPENING_CONN, null); |
76 } |
77 } |
77 else if (iAction.compareTo("send") == 0) |
78 else if (iAction.compareTo("send") == 0) |
78 { |
79 { |
|
80 String prefix = ""; |
|
81 String formattedDestination = iDestination; |
|
82 if (formattedDestination.startsWith("+")) |
|
83 { |
|
84 formattedDestination = iDestination.substring(1); |
|
85 prefix = "+"; |
|
86 } |
|
87 formattedDestination = prefix + Formatter.formatDigits(formattedDestination); |
79 if (iNumberOfSegments > 1) |
88 if (iNumberOfSegments > 1) |
80 { |
89 { |
81 return (SecurityPromptMessage.getInstance()).getText( |
90 return (SecurityPromptMessage.getInstance()).getText( |
82 SecurityPromptMessage.QUESTION_ID_SMS_SENDING, |
91 SecurityPromptMessage.QUESTION_ID_SMS_SENDING, |
83 new Object[] {new Integer(iNumberOfSegments),iDestination}); |
92 new Object[] {new Integer(iNumberOfSegments), |
|
93 formattedDestination}); |
84 } |
94 } |
85 return (SecurityPromptMessage.getInstance()).getText( |
95 return (SecurityPromptMessage.getInstance()).getText( |
86 SecurityPromptMessage.QUESTION_ID_SMS_SINGLE_SENDING, |
96 SecurityPromptMessage.QUESTION_ID_SMS_SINGLE_SENDING, |
87 new Object[] {iDestination}); |
97 new Object[] {formattedDestination}); |
88 } |
98 } |
89 return null; |
99 return null; |
90 } |
100 } |
91 |
101 |
92 public String toString() |
102 public String toString() |