diff options
Diffstat (limited to 'packages')
-rw-r--r-- | packages/SystemUI/AndroidManifest.xml | 14 | ||||
-rw-r--r-- | packages/SystemUI/res/values/strings.xml | 3 | ||||
-rw-r--r-- | packages/SystemUI/res/xml/tuner_prefs.xml | 22 | ||||
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/tuner/TunerActivity.java | 30 | ||||
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/tuner/TunerFragment.java | 44 |
5 files changed, 113 insertions, 0 deletions
diff --git a/packages/SystemUI/AndroidManifest.xml b/packages/SystemUI/AndroidManifest.xml index 24f6931..209a233 100644 --- a/packages/SystemUI/AndroidManifest.xml +++ b/packages/SystemUI/AndroidManifest.xml @@ -182,6 +182,20 @@ android:excludeFromRecents="true"> </activity> + <activity android:name=".tuner.TunerActivity" + android:enabled="false" + android:icon="@drawable/icon" + android:theme="@android:style/Theme.Material.Settings" + android:label="@string/system_ui_tuner" + android:exported="true"> + <intent-filter> + <action android:name="com.android.settings.action.EXTRA_SETTINGS" /> + <category android:name="android.intent.category.DEFAULT" /> + </intent-filter> + <meta-data android:name="com.android.settings.category" + android:value="com.android.settings.category.device" /> + </activity> + <!-- Alternate Recents --> <activity android:name=".recents.RecentsActivity" android:label="@string/accessibility_desc_recent_apps" diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml index a0b9b65..c74633c 100644 --- a/packages/SystemUI/res/values/strings.xml +++ b/packages/SystemUI/res/values/strings.xml @@ -1021,4 +1021,7 @@ <string name="volume_stream_muted_dnd" translatable="false">%s silent — Total silence</string> <string name="volume_stream_limited_dnd" translatable="false">%s — Priority only</string> <string name="volume_stream_vibrate_dnd" translatable="false">%s vibrate — Priority only</string> + + <!-- Name of special SystemUI debug settings --> + <string name="system_ui_tuner">SystemUI Tuner</string> </resources> diff --git a/packages/SystemUI/res/xml/tuner_prefs.xml b/packages/SystemUI/res/xml/tuner_prefs.xml new file mode 100644 index 0000000..263260e --- /dev/null +++ b/packages/SystemUI/res/xml/tuner_prefs.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2015 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" + android:title="@string/system_ui_tuner"> + + <!-- Tuner prefs go here --> + +</PreferenceScreen> diff --git a/packages/SystemUI/src/com/android/systemui/tuner/TunerActivity.java b/packages/SystemUI/src/com/android/systemui/tuner/TunerActivity.java new file mode 100644 index 0000000..c84f618 --- /dev/null +++ b/packages/SystemUI/src/com/android/systemui/tuner/TunerActivity.java @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2015 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.app.Activity; +import android.os.Bundle; + +public class TunerActivity extends Activity { + + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + getFragmentManager().beginTransaction().replace(android.R.id.content, new TunerFragment()) + .commit(); + } + +} diff --git a/packages/SystemUI/src/com/android/systemui/tuner/TunerFragment.java b/packages/SystemUI/src/com/android/systemui/tuner/TunerFragment.java new file mode 100644 index 0000000..df1b0d0 --- /dev/null +++ b/packages/SystemUI/src/com/android/systemui/tuner/TunerFragment.java @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2015 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 android.preference.PreferenceFragment; +import android.view.MenuItem; + +import com.android.systemui.R; + +public class TunerFragment extends PreferenceFragment { + + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + addPreferencesFromResource(R.xml.tuner_prefs); + getActivity().getActionBar().setDisplayHomeAsUpEnabled(true); + setHasOptionsMenu(true); + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + switch (item.getItemId()) { + case android.R.id.home: + getActivity().finish(); + return true; + } + return super.onOptionsItemSelected(item); + } + +} |