mirror of
https://gitee.com/openharmony/applications_call
synced 2024-11-23 06:19:44 +00:00
commit
d940951d5e
@ -35,20 +35,21 @@ export default class ContactManager {
|
|||||||
*
|
*
|
||||||
* @param { Object } callData -Object
|
* @param { Object } callData -Object
|
||||||
*/
|
*/
|
||||||
async getContactInfo(callData) {
|
async getContactInfo(callData) {
|
||||||
try {
|
try {
|
||||||
const columns = ['id', 'display_name', 'detail_info'];
|
const columns = ['id', 'display_name', 'detail_info'];
|
||||||
const predicates = new dataAbility.DataAbilityPredicates();
|
const predicates = new dataAbility.DataAbilityPredicates();
|
||||||
predicates.equalTo('detail_info', callData.accountNumber);
|
predicates.equalTo('detail_info', callData.accountNumber);
|
||||||
const dataAbilityHelper = await featureAbility.acquireDataAbilityHelper(DBbaseUri);
|
predicates.equalTo('is_deleted', 0);
|
||||||
const resSet = await dataAbilityHelper.query(DBUri, columns, predicates);
|
const dataAbilityHelper = await featureAbility.acquireDataAbilityHelper(DBbaseUri);
|
||||||
HiLog.i(TAG, "getContactInfo resSet : %s" + JSON.stringify(resSet))
|
const resSet = await dataAbilityHelper.query(DBUri, columns, predicates);
|
||||||
if (resSet.rowCount > 0) {
|
HiLog.i(TAG, "getContactInfo resSet : %s" + JSON.stringify(resSet))
|
||||||
resSet.goToFirstRow();
|
if (resSet.rowCount > 0) {
|
||||||
callData.contactName = resSet.getString(resSet.getColumnIndex('display_name'));
|
resSet.goToFirstRow();
|
||||||
}
|
callData.contactName = resSet.getString(resSet.getColumnIndex('display_name'));
|
||||||
} catch (err) {
|
}
|
||||||
HiLog.i(TAG, "getContactInfo catch err : %s" + JSON.stringify(err))
|
} catch (err) {
|
||||||
}
|
HiLog.i(TAG, "getContactInfo catch err : %s" + JSON.stringify(err))
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user