Loading packages/SettingsProvider/res/values/lineage_defaults.xml 0 → 100644 +25 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- /** * Copyright (c) 2016, The Linux Foundation. All rights reserved. * * Not a Contribution * * Copyright (c) 2017-2019, The LineageOS Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ --> <resources> <string name="def_tv_user_setup_complete" translatable="false"></string> </resources> packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java +13 −0 Original line number Diff line number Diff line Loading @@ -226,6 +226,7 @@ public class SettingsProvider extends ContentProvider { private static final Set<String> CRITICAL_SECURE_SETTINGS = new ArraySet<>(); static { CRITICAL_SECURE_SETTINGS.add(Settings.Secure.USER_SETUP_COMPLETE); CRITICAL_SECURE_SETTINGS.add(Settings.Secure.TV_USER_SETUP_COMPLETE); } // Per user secure settings that moved to the for all users global settings. Loading Loading @@ -3739,6 +3740,18 @@ public class SettingsProvider extends ContentProvider { if (currentVersion == 144) { // Version 145: Removed // Repurpose for AndroidTV devices coming from N final SettingsState secureSettings = getSecureSettingsLocked(userId); String defaultTvSetupSetting = (getContext().getResources().getString( R.string.def_tv_user_setup_complete)); String currentUserSetupSetting = secureSettings.getSettingLocked( Settings.Secure.USER_SETUP_COMPLETE).getValue(); if (defaultTvSetupSetting != null && !defaultTvSetupSetting.isEmpty() && currentUserSetupSetting == "1") { secureSettings.insertSettingLocked( Settings.Secure.TV_USER_SETUP_COMPLETE, "1", null, true, SettingsState.SYSTEM_PACKAGE_NAME); } currentVersion = 145; } Loading Loading
packages/SettingsProvider/res/values/lineage_defaults.xml 0 → 100644 +25 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- /** * Copyright (c) 2016, The Linux Foundation. All rights reserved. * * Not a Contribution * * Copyright (c) 2017-2019, The LineageOS Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ --> <resources> <string name="def_tv_user_setup_complete" translatable="false"></string> </resources>
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java +13 −0 Original line number Diff line number Diff line Loading @@ -226,6 +226,7 @@ public class SettingsProvider extends ContentProvider { private static final Set<String> CRITICAL_SECURE_SETTINGS = new ArraySet<>(); static { CRITICAL_SECURE_SETTINGS.add(Settings.Secure.USER_SETUP_COMPLETE); CRITICAL_SECURE_SETTINGS.add(Settings.Secure.TV_USER_SETUP_COMPLETE); } // Per user secure settings that moved to the for all users global settings. Loading Loading @@ -3739,6 +3740,18 @@ public class SettingsProvider extends ContentProvider { if (currentVersion == 144) { // Version 145: Removed // Repurpose for AndroidTV devices coming from N final SettingsState secureSettings = getSecureSettingsLocked(userId); String defaultTvSetupSetting = (getContext().getResources().getString( R.string.def_tv_user_setup_complete)); String currentUserSetupSetting = secureSettings.getSettingLocked( Settings.Secure.USER_SETUP_COMPLETE).getValue(); if (defaultTvSetupSetting != null && !defaultTvSetupSetting.isEmpty() && currentUserSetupSetting == "1") { secureSettings.insertSettingLocked( Settings.Secure.TV_USER_SETUP_COMPLETE, "1", null, true, SettingsState.SYSTEM_PACKAGE_NAME); } currentVersion = 145; } Loading