From f8faf50234a78756a02000bf40f25ae3c0040712 Mon Sep 17 00:00:00 2001 From: Gaurav Bhola Date: Wed, 28 Jul 2021 09:33:40 +0000 Subject: [PATCH] Add a new boolean resource to reset the AirPlane mode after during boot. - This resource is added specifically to be used for automotive devices where if the device exits from safemode and boots into normal mode, the airplane mode remains enabled. And there is no UI on automotive devices to disable the Airplane mode. - The value will be overlayed to true for automotive devices. Bug: 182523956 Test: Override the config and check if airplane mode is disabled in the normal mode. Change-Id: I829ed8b5aa436a7bc3b75e6308ff507035150586 Merged-In: I829ed8b5aa436a7bc3b75e6308ff507035150586 --- core/res/res/values/config.xml | 6 ++++++ core/res/res/values/symbols.xml | 1 + services/java/com/android/server/SystemServer.java | 3 +++ 3 files changed, 10 insertions(+) diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index 1586f164a0a5d..e7eab52d755bf 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -5123,4 +5123,10 @@ @array/config_mainBuiltInDisplayWaterfallCutout @array/config_secondaryBuiltInDisplayWaterfallCutout + + + false diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index cd590cbbe2b0c..c798730e99f2f 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -2217,6 +2217,7 @@ + diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java index 81995a79d9d8f..4897ca0efedb4 100644 --- a/services/java/com/android/server/SystemServer.java +++ b/services/java/com/android/server/SystemServer.java @@ -1586,6 +1586,9 @@ public final class SystemServer implements Dumpable { // all listeners have the chance to react with special handling. Settings.Global.putInt(context.getContentResolver(), Settings.Global.AIRPLANE_MODE_ON, 1); + } else if (context.getResources().getBoolean(R.bool.config_autoResetAirplaneMode)) { + Settings.Global.putInt(context.getContentResolver(), + Settings.Global.AIRPLANE_MODE_ON, 0); } StatusBarManagerService statusBar = null;