am e74d5d09: Merge "Add SysUI Tuner" into mnc-dev

* commit 'e74d5d09e1749b128437ff340b43278857139338':
  Add SysUI Tuner
This commit is contained in:
Jason Monk
2015-05-12 15:14:30 +00:00
committed by Android Git Automerger
5 changed files with 113 additions and 0 deletions

View File

@@ -182,6 +182,20 @@
android:excludeFromRecents="true"> android:excludeFromRecents="true">
</activity> </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 --> <!-- Alternate Recents -->
<activity android:name=".recents.RecentsActivity" <activity android:name=".recents.RecentsActivity"
android:label="@string/accessibility_desc_recent_apps" android:label="@string/accessibility_desc_recent_apps"

View File

@@ -1021,4 +1021,7 @@
<string name="volume_stream_muted_dnd" translatable="false">%s silent — Total silence</string> <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_limited_dnd" translatable="false">%s — Priority only</string>
<string name="volume_stream_vibrate_dnd" translatable="false">%s vibrate — 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> </resources>

View File

@@ -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>

View File

@@ -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();
}
}

View File

@@ -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);
}
}