Adding nullptr check for some framework components

Summary: Some framework components do not check
whether the system service being called is null or not
causing "FATAL EXCEPTION" in zygote system process.
Adding nullptr or NULL obj check before calling.

Test: m
flash the device
verify the zygote is running stable and not hitting
FATAL EXECEPTION.

Change-Id: Icd504fb529716ff0870d0d911b1cd8b356bf9bb7
Signed-off-by: Abdelrahman Daim <adaim@meta.com>
1 file changed