diff --git a/Android.mk b/Android.mk
index 610a65092f3..7a276a6cf59 100644
--- a/Android.mk
+++ b/Android.mk
@@ -10,17 +10,14 @@ LOCAL_SRC_FILES := \
$(call all-java-files-under, src) \
src/com/android/settings/EventLogTags.logtags
LOCAL_SRC_FILES += $(call all-java-files-under, ../PerformanceControl/src)
-LOCAL_SRC_FILES += $(call all-java-files-under, ../OmniGears/src)
LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res
LOCAL_RESOURCE_DIR += packages/apps/PerformanceControl/res
-LOCAL_RESOURCE_DIR += packages/apps/OmniGears/res
LOCAL_ASSET_DIR += packages/apps/PerformanceControl/assets
LOCAL_AAPT_FLAGS := --auto-add-overlay \
- --extra-packages com.brewcrewfoo.performance \
- --extra-packages org.omnirom.omnigears
+ --extra-packages com.brewcrewfoo.performance
LOCAL_PACKAGE_NAME := Settings
LOCAL_CERTIFICATE := platform
@@ -28,6 +25,12 @@ LOCAL_PRIVILEGED_MODULE := true
LOCAL_PROGUARD_FLAG_FILES := proguard.flags
+LOCAL_AAPT_INCLUDE_ALL_RESOURCES := true
+LOCAL_AAPT_FLAGS += --extra-packages com.koushikdutta.superuser:com.koushikdutta.widgets --auto-add-overlay
+
+LOCAL_SRC_FILES += $(call all-java-files-under,../../../external/koush/Superuser/Superuser/src) $(call all-java-files-under,../../../external/koush/Widgets/Widgets/src)
+LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res $(LOCAL_PATH)/../../../external/koush/Widgets/Widgets/res $(LOCAL_PATH)/../../../external/koush/Superuser/Superuser/res
+
include frameworks/opt/setupwizard/navigationbar/common.mk
include $(BUILD_PACKAGE)
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 383dc6ef638..280e7e37145 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -70,6 +70,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- Omni version
+ ErcOne version
Unknown
diff --git a/res/values/enhancement_vars.xml b/res/values/enhancement_vars.xml
new file mode 100644
index 00000000000..fd01aa8584a
--- /dev/null
+++ b/res/values/enhancement_vars.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+ Device hostname
+
diff --git a/res/xml/dashboard_categories.xml b/res/xml/dashboard_categories.xml
index c338978615e..604b2f3433d 100644
--- a/res/xml/dashboard_categories.xml
+++ b/res/xml/dashboard_categories.xml
@@ -244,6 +244,14 @@
android:icon="@drawable/ic_settings_print"
/>
+
+
+
-
+ android:dialogTitle="@*android:string/bugreport_title" />
+
+
+
0) {
- for (int i=1; i 0) {
+ DEFAULT_HOSTNAME = "android-".concat(id);
+ } else {
+ DEFAULT_HOSTNAME = "";
+ }
+
+ setSummary(getText());
+ getEditText().setFilters(new InputFilter[] { mHostnameInputFilter });
+ getEditText().setHint(DEFAULT_HOSTNAME);
+ }
+
+ public HostnamePreference(Context context, AttributeSet attrs) {
+ this(context, attrs, com.android.internal.R.attr.editTextPreferenceStyle);
+ }
+
+ public HostnamePreference(Context context) {
+ this(context, null);
+ }
+
+ @Override
+ protected void onDialogClosed(boolean positiveResult) {
+ if (positiveResult) {
+ String hostname = getEditText().getText().toString();
+
+ // remove any preceding or succeeding periods or hyphens
+ hostname = hostname.replaceAll("(?:\\.|-)+$", "");
+ hostname = hostname.replaceAll("^(?:\\.|-)+", "");
+
+ if (hostname.length() == 0) {
+ if (DEFAULT_HOSTNAME.length() != 0) {
+ // if no hostname is given, use the default
+ hostname = DEFAULT_HOSTNAME;
+ } else {
+ // if no other name can be determined
+ // fall back on the current hostname
+ hostname = getText();
+ }
+ }
+ setText(hostname);
+ }
+ }
+
+ @Override
+ public void setText(String text) {
+ if (text == null) {
+ Log.e(TAG, "tried to set null hostname, request ignored");
+ return;
+ } else if (text.length() == 0) {
+ Log.w(TAG, "setting empty hostname");
+ } else {
+ Log.i(TAG, "hostname has been set: " + text);
+ }
+ SystemProperties.set(PROP_HOSTNAME, text);
+ persistHostname(text);
+ setSummary(text);
+ }
+
+ @Override
+ public String getText() {
+ return SystemProperties.get(PROP_HOSTNAME);
+ }
+
+ @Override
+ public void onSetInitialValue(boolean restoreValue, Object defaultValue) {
+ String hostname = getText();
+ persistHostname(hostname);
+ }
+
+ public void persistHostname(String hostname) {
+ Settings.Secure.putString(getContext().getContentResolver(),
+ Settings.Secure.DEVICE_HOSTNAME, hostname);
+ }
+}
diff --git a/src/com/android/settings/MultitaskSuRequestActivity.java b/src/com/android/settings/MultitaskSuRequestActivity.java
new file mode 100644
index 00000000000..01030763684
--- /dev/null
+++ b/src/com/android/settings/MultitaskSuRequestActivity.java
@@ -0,0 +1,4 @@
+package com.android.settings.cyanogenmod.superuser;
+
+public class MultitaskSuRequestActivity extends com.koushikdutta.superuser.MultitaskSuRequestActivity {
+}
\ No newline at end of file
diff --git a/src/com/android/settings/NotifyActivity.java b/src/com/android/settings/NotifyActivity.java
new file mode 100644
index 00000000000..23aa6a720d0
--- /dev/null
+++ b/src/com/android/settings/NotifyActivity.java
@@ -0,0 +1,4 @@
+package com.android.settings.cyanogenmod.superuser;
+
+public class NotifyActivity extends com.koushikdutta.superuser.NotifyActivity {
+}
\ No newline at end of file
diff --git a/src/com/android/settings/PolicyNativeFragment.java b/src/com/android/settings/PolicyNativeFragment.java
new file mode 100644
index 00000000000..1c74543bfcf
--- /dev/null
+++ b/src/com/android/settings/PolicyNativeFragment.java
@@ -0,0 +1,4 @@
+package com.android.settings.cyanogenmod.superuser;
+
+public class PolicyNativeFragment extends com.koushikdutta.superuser.PolicyNativeFragment {
+}
\ No newline at end of file
diff --git a/src/com/android/settings/RequestActivity.java b/src/com/android/settings/RequestActivity.java
new file mode 100644
index 00000000000..e6deca49cd6
--- /dev/null
+++ b/src/com/android/settings/RequestActivity.java
@@ -0,0 +1,4 @@
+package com.android.settings.cyanogenmod.superuser;
+
+public class RequestActivity extends com.koushikdutta.superuser.RequestActivity {
+}
\ No newline at end of file
diff --git a/src/com/android/settings/SuReceiver.java b/src/com/android/settings/SuReceiver.java
new file mode 100644
index 00000000000..c4f9174b04f
--- /dev/null
+++ b/src/com/android/settings/SuReceiver.java
@@ -0,0 +1,4 @@
+package com.android.settings.cyanogenmod.superuser;
+
+public class SuReceiver extends com.koushikdutta.superuser.SuReceiver {
+}
\ No newline at end of file