Thank you for your inquiry. From what we gather from the question, you were asking about the risk of acquiring HIV through masturbation. From the information given, this scenario is determined to be No Risk (transmission of HIV is not possible in the given scenario).
In order for transmission to occur, a number of requirements must be met (see below).
HIV transmission requires the presence of HIV positive fluid (such as semen, vaginal fluid, pre-cum, rectal fluid, breastmilk, etc), coupled with a High, Low, or Negligible Risk activity, that provides the virus direct access to the bloodstream.
The activity you described above is of No Risk as the transmission equation is not satisfied. This is due to the fact that "HIV does not survive long outside the human body (such as on surfaces), and it cannot reproduce outside a human host" (1). HIV undergoes a rapid reduction in concentration once it is exposed to oxygen. Therefore, even in the event that there was HIV positive fluid present on your phone that was then transferred to your hands, the virus would be rendered inactive following exposure to oxygen and would be considered intransmissible.
Recommendation: No need for HIV testing with the scenario provided. Refer to a healthcare professional for other health related questions.
AIDS Vancouver Helpline/Online, Ashley
If you are satisfied with the Helpline service, please consider donating
HIV inactive CDC (1)