Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 295a3377 authored by Jason Monk's avatar Jason Monk
Browse files

Add SysUI Tuner

Change-Id: I9b0fabbe913b8297d8c668b6416a7be856adb9d5
parent bb9d9278
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -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"
+3 −0
Original line number Diff line number Diff line
@@ -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>
+22 −0
Original line number Diff line number Diff line
<?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>
+30 −0
Original line number Diff line number Diff line
/*
 * 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();
    }

}
+44 −0
Original line number Diff line number Diff line
/*
 * 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);
    }

}