Restore security context after sns_reg_init process interrupted

To prevent temp.json with incorrect security context when the
sns_reg_init process interrupted by some abnormal cases,
we need to add restorecon command to set with correct context.

Bug: 168362637
Test: Push abnormal_persist.img and reboot with init rc file.
Test: Security context restore successfully
Test: Sensor registry process work
Change-Id: I1d029111c5d75b135e9947adfd2cf54f588c5f94
Signed-off-by: emilchung <emilchung@google.com>
diff --git a/init.hardware.rc b/init.hardware.rc
index 246fd40..9d15f38 100644
--- a/init.hardware.rc
+++ b/init.hardware.rc
@@ -319,6 +319,10 @@
     mkdir /data/vendor/sensors/log 0770
     chown system system /data/vendor/sensors/log
 
+    # Restore SeLinux Context for preventing temp.json with
+    # incorrect security context
+    restorecon /mnt/vendor/persist/sensors/registry/temp.json
+
     chmod 770 /mnt/vendor/persist/audio
     chmod 660 /mnt/vendor/persist/audio/audio.cal
     chown media audio /mnt/vendor/persist/audio