Honestly I doubt it will be able to do the activities you seek.
For example the IR grid sensor on Project Tango which does the depth sensing:
https://www.ifixit.com/Teardown/Project+Tango+Tablet+Teardown/28148#s68068
Quoting IFixit:
From Google: "The IR projector is from Mantis Vision, and designed specific to our specs for field of view and resolution. It is custom designed to work in partnership with the 4MP RGB-IR camera on the other side."
iFixit looks like there were able to independently run the IR projector to show off the field of dots:
https://www.ifixit.com/Teardown/Project+Tango+Teardown/23835#s62129
While the teardown for a Samsung Galaxy S8+
https://www.ifixit.com/Teardown/Samsung+Galaxy+S8%2B+Teardown/87086#s164374
[right most photo] notes an IR emitter, I'm incline to say that it would be tuned for iris scanning or other declared feature and work more like a IR flashlight than a grid.
For comparison iFixit shows off the front facing hardware of a Samsung Galaxy S9+ compared with a iPhone X:
https://www.ifixit.com/Teardown/Samsung+Galaxy+S9%2B+Teardown/104308#s195687
And you can note that the depth sensor assembly on the iPhone X is similar to the Project Tango tablet as a single assembly rather than a collection of separate cameras/projectors (probably for tolerance reasons during assembly).