{
}
+SimInfo::SimInfo(const SimInfo& rhs)
+ : __pSimInfoImpl(null)
+{
+ __pSimInfoImpl = new (std::nothrow)_SimInfoImpl(*rhs.__pSimInfoImpl);
+ SysTryReturnVoidResult(NID_TEL, __pSimInfoImpl, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+}
+
SimInfo::~SimInfo(void)
{
delete __pSimInfoImpl;
}
+
result
SimInfo::Construct(void)
{
ClearLastResult();
int mnc = -1;
- result r = _AccessController::CheckUserPrivilege(_PRV_SYSTEMINFO);
+ result r = _AccessController::CheckUserPrivilege(_PRV_SYSTEMINFO, _PRV_TELEPHONY);
SysTryReturn(NID_TEL, r == E_SUCCESS, mnc, E_PRIVILEGE_DENIED,
"[%s] The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED));
ClearLastResult();
int mcc = -1;
- result r = _AccessController::CheckUserPrivilege(_PRV_SYSTEMINFO);
+ result r = _AccessController::CheckUserPrivilege(_PRV_SYSTEMINFO, _PRV_TELEPHONY);
SysTryReturn(NID_TEL, r == E_SUCCESS, mcc, E_PRIVILEGE_DENIED,
"[%s] The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED));
ClearLastResult();
String spn;
- result r = _AccessController::CheckUserPrivilege(_PRV_SYSTEMINFO);
+ result r = _AccessController::CheckUserPrivilege(_PRV_SYSTEMINFO, _PRV_TELEPHONY);
SysTryReturn(NID_TEL, r == E_SUCCESS, spn, E_PRIVILEGE_DENIED,
"[%s] The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED));
ClearLastResult();
String iccId;
- result r = _AccessController::CheckUserPrivilege(_PRV_SYSTEMINFO);
+ result r = _AccessController::CheckUserPrivilege(_PRV_SYSTEMINFO, _PRV_TELEPHONY);
SysTryReturn(NID_TEL, r == E_SUCCESS, iccId, E_PRIVILEGE_DENIED,
"[%s] The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED));
ClearLastResult();
String operatorName;
- result r = _AccessController::CheckUserPrivilege(_PRV_SYSTEMINFO);
+ result r = _AccessController::CheckUserPrivilege(_PRV_SYSTEMINFO, _PRV_TELEPHONY);
SysTryReturn(NID_TEL, r == E_SUCCESS, operatorName, E_PRIVILEGE_DENIED,
"[%s] The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED));
ClearLastResult();
String phoneNumber;
- result r = _AccessController::CheckUserPrivilege(_PRV_SYSTEMINFO);
+ result r = _AccessController::CheckUserPrivilege(_PRV_SYSTEMINFO, _PRV_TELEPHONY);
SysTryReturn(NID_TEL, r == E_SUCCESS, phoneNumber, E_PRIVILEGE_DENIED,
"[%s] The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED));
return imsi;
}
+SimType
+SimInfo::GetSimType(void) const
+{
+ SysAssertf(__pSimInfoImpl != null, "Not yet constructed. Construct() should be called before use.");
+
+ ClearLastResult();
+
+ result r = _AccessController::CheckUserPrivilege(_PRV_TELEPHONY);
+ SysTryReturn(NID_TEL, r == E_SUCCESS, SIM_TYPE_UNKNOWN, E_PRIVILEGE_DENIED,
+ "[%s] The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED));
+
+ return __pSimInfoImpl->GetSimType();
+}
+
bool
SimInfo::IsAvailable(void) const
{
ClearLastResult();
bool isAvailable = false;
- result r = _AccessController::CheckUserPrivilege(_PRV_SYSTEMINFO);
+ result r = _AccessController::CheckUserPrivilege(_PRV_SYSTEMINFO, _PRV_TELEPHONY);
SysTryReturn(NID_TEL, r == E_SUCCESS, isAvailable, E_PRIVILEGE_DENIED,
"[%s] The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED));
return isAvailable;
}
+SimInfo&
+SimInfo::operator =(const SimInfo& rhs)
+{
+ if (this != &rhs)
+ {
+ *__pSimInfoImpl = *rhs.__pSimInfoImpl;
+ }
+
+ return *this;
+}
+
+bool
+SimInfo::Equals(const Object& rhs) const
+{
+ const SimInfo* pRhs = dynamic_cast<const SimInfo*>(&rhs);
+
+ if (pRhs == null)
+ {
+ return false;
+ }
+
+ const _SimInfoImpl* pRhsImpl = _SimInfoImpl::GetInstance(*pRhs);
+
+ if (pRhsImpl == null)
+ {
+ return false;
+ }
+
+ return __pSimInfoImpl->Equals(*pRhsImpl);
+}
+
+int
+SimInfo::GetHashCode(void) const
+{
+ return __pSimInfoImpl->GetHashCode();
+}
+
} } // Tizen::Telephony