summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src/com/android/systemui/tuner
diff options
context:
space:
mode:
authorJason Monk <jmonk@google.com>2015-05-11 16:57:15 -0400
committerJason Monk <jmonk@google.com>2015-05-12 11:01:02 -0400
commit295a337781d81d746a36259ec6c7cc443967dcca (patch)
treea81c102fd3479b11cc967f6d12319404d395bfb4 /packages/SystemUI/src/com/android/systemui/tuner
parentbb9d9278aa6fe3ba3d4c21b03d3e3da4543a974c (diff)
downloadframeworks_base-295a337781d81d746a36259ec6c7cc443967dcca.zip
frameworks_base-295a337781d81d746a36259ec6c7cc443967dcca.tar.gz
frameworks_base-295a337781d81d746a36259ec6c7cc443967dcca.tar.bz2
Add SysUI Tuner
Change-Id: I9b0fabbe913b8297d8c668b6416a7be856adb9d5
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/tuner')
-rw-r--r--packages/SystemUI/src/com/android/systemui/tuner/TunerActivity.java30
-rw-r--r--packages/SystemUI/src/com/android/systemui/tuner/TunerFragment.java44
2 files changed, 74 insertions, 0 deletions
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);
+ }
+
+}