Get state of a button in another button

Hi, I am trying to add local record functionality to the jitsi source, but I want to import the state of “Screen sharing” button, to be able to improve functionality.
Note: Local recording for android and ios. Not web.
By knowing whether the screen sharing is on, I can get to know whether a AndroidDisplayMedia already is in use and hence avoid app crashes.