He concealed the drugs by inserting them in his rectum, the court heard.
His mother, Victoria Davis, says prison staff failed in their duty of care, and let her son die in an at-risk cell with no medical help. She began a crusade to get what she says is justice for her son, with the inquiry the result.
Mr Davis entered the prison as a remand prisoner on February 11, and died on February 14.
In court yesterday, Corrections officer Mark Duncan, a member of what was in 2011 called the tactical response team, told the court he had monitored telephone calls as part of his role at the facility.
On February 8 and 9, he monitored calls between Mr Davis and a man in the prison connected to the Mongrel Mob gang.
All telephones at the prison had a notice and recorded message saying they were recorded.
The calls indicated Mr Davis planned to bring drugs into the prison.
There was discussion between the men of "candy", which Mr Duncan said he understood to be slang for prescription medication.
Transcripts of the recordings read in court heard discussion of Davis "getting sussed", which Mr Duncan said he would interpret as finding a source for drugs.
"When I'm on to it, I'll hand myself in," Mr Davis said in the recording.
Davis family counsel Anne Stevens asked if there was any doubt in his mind Mr Davis planned to take drugs into the prison.
Mr Duncan said that was what he believed would happen.
Mr Crerar said he was surprised the conversations took place from the prison, when it was "pretty obvious what they were talking about".
Corrections intelligence officer Neil Jones-Sexton said he had spoken to police about the plan to take drugs into the prison.
He had spoken to Detective Sergeant John Hedges, and others, about the issue.
On February 8, he had notified police with information on where Mr Davis had telephoned from, and about the drugs issue.
He had more than one telephone call with police, and was "100 per cent certain those who needed to know knew".
He could not remember which officers he talked to, and said he did not keep records of every conversation.
He said he also sent an email to Detective Sergeant Hedges.
Mr Crerar said he was "surprised and astonished" to hear Mr Jones-Sexton did not keep notes on his communications.
It was "hugely important to have information recorded".
Detective Sergeant Hedges said he routinely received communications from many sources, and the prison was one of those.
He did not recall opening Mr Jones-Sexton's email about the Mongrel Mob planning to bring drugs into the prison, did not recall opening or replying to it, and did not recall any telephone conversations with him, if they occurred.
Detective Sergeant Hedges said he was about to start "a big job" on higher level criminals who were "hard to catch".
He would not have dealt with an issue like the Davis drugs matter.
Mr Crerar challenged Detective Sergeant Hedges on note keeping. He had told Mr Jones-Sexton police kept good notes, and he had not kept notes of his conversations. That was in a situation where Mr Jones-Sexton had said he talked to him, but Detective Sergeant Hedges said he had not.
"One or other of you is wrong, or mistaken."
Detective Sergeant Hedges said it was not possible to keep notes of every conversation.
The hearing continues today.