allow locking UI mode and block launching car dock for automotive

- add config to lock UI mode change: When this is enabled,
  request to change car mode will be ignored. Apps can check
  the config using UiModeManager.isUiModeLocked()
- add config to lock day / night mode: When this is enabled,
  apps cannot change day / night mode without having
  MODIFY_DAY_NIGHT_MODE permission.
  Apps can check the config using UiModeManager.isNightModeLocked()
- add config to disable car dock intent launch for home key
  and mode change
- All new configs have default values which keeps the current behavior.
  Car products should override the configs to get desirable behavior.

bug: 22700993
Change-Id: Ic0e58f3428151e0b1c19a2e9a7d6ded32ff962a6
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index 9bbbdca..8a0477f 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -2712,6 +2712,13 @@
     <permission android:name="android.permission.DISPATCH_NFC_MESSAGE"
                 android:protectionLevel="signature|privileged" />
 
+    <!-- @SystemApi Allows changing day / night mode when system is configured with
+         config_lockDayNightMode set to true. If requesting app does not have permission,
+         it will be ignored.
+        @hide -->
+    <permission android:name="android.permission.MODIFY_DAY_NIGHT_MODE"
+                android:protectionLevel="signature|privileged" />
+
     <!-- The system process is explicitly the only one allowed to launch the
          confirmation UI for full backup/restore -->
     <uses-permission android:name="android.permission.CONFIRM_FULL_BACKUP"/>