diff --git a/packages/SystemUI/res/layout/power_notification_controls_settings.xml b/packages/SystemUI/res/layout/power_notification_controls_settings.xml deleted file mode 100644 index 83c8a51f63305defecd6bb982cef2364e0db0550..0000000000000000000000000000000000000000 --- a/packages/SystemUI/res/layout/power_notification_controls_settings.xml +++ /dev/null @@ -1,30 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2016 The Android Open Source 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. ---> - -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:orientation="vertical"> - - <include layout="@layout/switch_bar" /> - - <TextView - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:padding="16dp" - android:text="@string/power_notification_controls_description"/> - -</LinearLayout> diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml index 9a3c6d5b322f28b91acc5178ebcaadc9d7d23515..bbb0a9c65e8b19db82a64baeafc31f27170736fc 100644 --- a/packages/SystemUI/res/values/strings.xml +++ b/packages/SystemUI/res/values/strings.xml @@ -1569,37 +1569,9 @@ <!-- Bluetooth enablement ok text [CHAR LIMIT=40] --> <string name="enable_bluetooth_confirmation_ok">Turn on</string> - <!-- [CHAR LIMIT=NONE] Importance Tuner setting title --> - <string name="tuner_full_importance_settings">Power notification controls</string> - <!-- [CHAR LIMIT=NONE] Notification camera based rotation enabled description --> <string name="rotation_lock_camera_rotation_on">On - Face-based</string> - <string name="power_notification_controls_description">With power notification controls, you can set an importance level from 0 to 5 for an app\'s notifications. - \n\n<b>Level 5</b> - \n- Show at the top of the notification list - \n- Allow full screen interruption - \n- Always peek - \n\n<b>Level 4</b> - \n- Prevent full screen interruption - \n- Always peek - \n\n<b>Level 3</b> - \n- Prevent full screen interruption - \n- Never peek - \n\n<b>Level 2</b> - \n- Prevent full screen interruption - \n- Never peek - \n- Never make sound and vibration - \n\n<b>Level 1</b> - \n- Prevent full screen interruption - \n- Never peek - \n- Never make sound or vibrate - \n- Hide from lock screen and status bar - \n- Show at the bottom of the notification list - \n\n<b>Level 0</b> - \n- Block all notifications from the app - </string> - <!-- Notification Inline controls: button to dismiss the blocking helper [CHAR_LIMIT=20] --> <string name="inline_done_button">Done</string> diff --git a/packages/SystemUI/res/xml/other_settings.xml b/packages/SystemUI/res/xml/other_settings.xml deleted file mode 100644 index 7719d5e03df0f7b5d9b1a1a80e8cb586c275088b..0000000000000000000000000000000000000000 --- a/packages/SystemUI/res/xml/other_settings.xml +++ /dev/null @@ -1,27 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2016 The Android Open Source 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. ---> - -<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:sysui="http://schemas.android.com/apk/res-auto" - android:title="@string/other"> - - <!-- importance --> - <Preference - android:key="power_notification_controls" - android:title="@string/tuner_full_importance_settings" - android:fragment="com.android.systemui.tuner.PowerNotificationControlsFragment"/> - -</PreferenceScreen> diff --git a/packages/SystemUI/src/com/android/systemui/tuner/OtherPrefs.java b/packages/SystemUI/src/com/android/systemui/tuner/OtherPrefs.java deleted file mode 100644 index 8d8599900530c76141893aeb4a7a8b2892f3a56a..0000000000000000000000000000000000000000 --- a/packages/SystemUI/src/com/android/systemui/tuner/OtherPrefs.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2016 The Android Open Source 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. - */ - -package com.android.systemui.tuner; - -import android.os.Bundle; - -import androidx.preference.PreferenceFragment; - -import com.android.systemui.res.R; -import com.android.tools.r8.keepanno.annotations.KeepTarget; -import com.android.tools.r8.keepanno.annotations.UsesReflection; - -public class OtherPrefs extends PreferenceFragment { - // aapt doesn't generate keep rules for android:fragment references in <Preference> tags, so - // explicitly declare references per usage in `R.xml.other_settings`. See b/120445169. - @UsesReflection(@KeepTarget(classConstant = PowerNotificationControlsFragment.class)) - @Override - public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { - addPreferencesFromResource(R.xml.other_settings); - } -} diff --git a/packages/SystemUI/src/com/android/systemui/tuner/PowerNotificationControlsFragment.java b/packages/SystemUI/src/com/android/systemui/tuner/PowerNotificationControlsFragment.java deleted file mode 100644 index ce1a2e9b329c6fa68fe59d2a7ae2c50dfc2d2fa2..0000000000000000000000000000000000000000 --- a/packages/SystemUI/src/com/android/systemui/tuner/PowerNotificationControlsFragment.java +++ /dev/null @@ -1,93 +0,0 @@ -/** - * Copyright (c) 2016, The Android Open Source 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. - */ -package com.android.systemui.tuner; - -import android.annotation.Nullable; -import android.app.Fragment; -import android.os.Bundle; -import android.provider.Settings; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.Switch; -import android.widget.TextView; - -import com.android.internal.logging.MetricsLogger; -import com.android.internal.logging.nano.MetricsProto.MetricsEvent; -import com.android.systemui.res.R; - -public class PowerNotificationControlsFragment extends Fragment { - - private static final String KEY_SHOW_PNC = "show_importance_slider"; - - @Override - public void onCreate(@Nullable Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - } - - @Override - public View onCreateView(LayoutInflater inflater, ViewGroup container, - Bundle savedInstanceState) { - return inflater.inflate(R.layout.power_notification_controls_settings, container, false); - } - - @Override - public void onViewCreated(View view, Bundle savedInstanceState) { - super.onViewCreated(view, savedInstanceState); - final View switchBar = view.findViewById(R.id.switch_bar); - final Switch switchWidget = (Switch) switchBar.findViewById(android.R.id.switch_widget); - final TextView switchText = (TextView) switchBar.findViewById(R.id.switch_text); - switchWidget.setChecked(isEnabled()); - switchText.setText(isEnabled() - ? getString(R.string.switch_bar_on) - : getString(R.string.switch_bar_off)); - - switchWidget.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - boolean newState = !isEnabled(); - MetricsLogger.action(getContext(), - MetricsEvent.ACTION_TUNER_POWER_NOTIFICATION_CONTROLS, newState); - Settings.Secure.putInt(getContext().getContentResolver(), - KEY_SHOW_PNC, newState ? 1 : 0); - switchWidget.setChecked(newState); - switchText.setText(newState - ? getString(R.string.switch_bar_on) - : getString(R.string.switch_bar_off)); - } - }); - } - - @Override - public void onResume() { - super.onResume(); - MetricsLogger.visibility( - getContext(), MetricsEvent.TUNER_POWER_NOTIFICATION_CONTROLS, true); - } - - @Override - public void onPause() { - super.onPause(); - MetricsLogger.visibility( - getContext(), MetricsEvent.TUNER_POWER_NOTIFICATION_CONTROLS, false); - } - - private boolean isEnabled() { - int setting = Settings.Secure.getInt(getContext().getContentResolver(), KEY_SHOW_PNC, 0); - return setting == 1; - } - -}