Check dir path before updating permissions.

Bug: 240685104
Test: atest android.telephonyprovider.cts.MmsPartTest
      atest CtsTelephonyTestCases
      Sanity check - sending and receiving sms and mms manually
Change-Id: I2c60cc2cf8f1f6890678d3cd8c6cfdf31356349f
1 file changed