Simplify permission checks in ime shell command

To verify WRITE_SECURE_SETTINGS for ime shell commands,
Context#enforceCallingPermission() would be much simpler and better
because those methods should never be called outside IPCs.

If components inside the system server process need those
functionality, InputMethodManagerInternal should be used instead.

Bug: 34886274
Test: Manually tested as follows.
  1. make -j SoftKeyboard
  2. adb install -r $OUT/system/app/SoftKeyboard/SoftKeyboard.apk
  3. adb shell ime enable com.example.android.softkeyboard/.SoftKeyboard
  4. adb shell ime set com.example.android.softkeyboard/.SoftKeyboard
  5. Make sure that SoftKeyboard is enabled and selected
  6. adb shell ime reset
  7. Make sure that SoftKeyboard is no longer enabled and selected
Change-Id: I556ad844b9f7d62dda40fc18b3ca7d8736660898
1 file changed