Skip to content

Commit

Permalink
Add toggle for Kineto application.
Browse files Browse the repository at this point in the history
Change-Id: Ifcb1af6c05a91d01b9c1470ec11e5690437cb3a1

Conflicts:

	DefyParts/res/values-de/strings.xml
	DefyParts/res/values-fr/strings.xml
	DefyParts/res/values/strings.xml
	DefyParts/src/com/cyanogenmod/defyparts/SettingsActivity.java
	jordan-blobs.mk

Conflicts:

	DefyParts/res/values-de/strings.xml
	DefyParts/res/values/strings.xml
  • Loading branch information
maniac103 authored and Quarx2k committed Apr 2, 2012
1 parent a7d8d86 commit 9848f16
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 4 deletions.
2 changes: 2 additions & 0 deletions DefyParts/AndroidManifest.xml
Expand Up @@ -5,6 +5,8 @@
android:versionCode="1"
android:versionName="1.0" >

<uses-permission android:name="android.permission.REBOOT" />

<application
android:label="@string/app_name" >
<activity
Expand Down
4 changes: 4 additions & 0 deletions DefyParts/res/values-de/strings.xml
Expand Up @@ -32,5 +32,9 @@
<string name="baseband_switcher">Baseband-Auswahl</string>
<string name="kineto_support">Kineto-Unterstützung</string>
<string name="kineto_support_summary">Kineto-Anwendung (\'Wifi Calling\') aktivieren</string>
<string name="kineto_reboot_prompt_title">Neustart nötig</string>
<string name="kineto_reboot_prompt_message">Um die Änderung des Anwendungszustandes abzuschließen, muss das Telefon neu gestartet werden.\n\nMöchten Sie jetzt neu starten?</string>
<string name="yes">Ja</string>
<string name="no">Nein</string>

</resources>
9 changes: 7 additions & 2 deletions DefyParts/res/values-fr/strings.xml
Expand Up @@ -19,7 +19,7 @@
<string name="touch_point_entry_2points">2 points (normal)</string>

<string name="touch_point_warning_title">Attention</string>
<string name="touch_point_warning_message">Augmenter le nombre de contacts peut réduire la réactivité de l\'écran au démarrage du téléphone.\n\nEtes-vous certain de vouloir activer cette fonction ?</string>
<string name="touch_point_warning_message">Augmenter le nombre de contacts peut réduire la réactivité de l\'écran au démarrage du téléphone.\n\nEtes-vous certain de vouloir activer cette fonction?</string>

<string name="audio_settings_title">Paramètres Audio</string>
<string name="audio_effects">Filtres Audio et DSP</string>
Expand All @@ -28,6 +28,11 @@
<string name="compass_calibrate">Calibration boussole</string>
<string name="baseband_switcher">Fréquences GSM (Baseband)</string>
<string name="kineto_support">Support des appels Wifi</string>
<string name="kineto_support_summary">Activer l\'application T-Mobile pour les appels téléphoniques via Wifi.\n(Nécessite un redémarrage)</string>

<string name="kineto_support_summary">Activer l\'application T-Mobile pour les appels téléphoniques via Wifi.</string>
<string name="kineto_reboot_prompt_title">Nécessite un redémarrage</string>
<string name="kineto_reboot_prompt_message">Pour activer ou désactiver l\'application, un redémarrage est nécessaire.\n\nRedémarrer maintenant?</string>
<string name="yes">Oui</string>
<string name="no">Non</string>

</resources>
8 changes: 8 additions & 0 deletions DefyParts/res/values-ru/strings.xml
Expand Up @@ -28,4 +28,12 @@
<string name="other_settings_title">Другие настройки</string>
<string name="compass_calibrate">Калибровка компаса</string>

<string name="kineto_support">Звонки через WiFi</string>
<string name="kineto_support_summary">Активировать приложение для звонков через WiFi</string>

<string name="kineto_reboot_prompt_title">Требуется перезагрузка</string>
<string name="kineto_reboot_prompt_message">Для применения параметров необходимо перезагрузить устройство.\n\nВыполнить перезагрузку?</string>
<string name="yes">Да</string>
<string name="no">Нет</string>

</resources>
6 changes: 6 additions & 0 deletions DefyParts/res/values/strings.xml
Expand Up @@ -31,7 +31,13 @@
<string name="other_settings_title">Other settings</string>
<string name="compass_calibrate">Compass calibrator</string>
<string name="baseband_switcher">Baseband selection</string>

<string name="kineto_support">Wifi calling support</string>
<string name="kineto_support_summary">Enable the T-Mobile Wifi calling application</string>
<string name="kineto_reboot_prompt_title">Reboot required</string>
<string name="kineto_reboot_prompt_message">In order to fully apply the changed application state, a reboot is required.\n\nDo you want to reboot now?</string>
<string name="yes">Yes</string>
<string name="no">No</string>


</resources>
21 changes: 19 additions & 2 deletions DefyParts/src/com/cyanogenmod/defyparts/SettingsActivity.java
@@ -1,10 +1,12 @@

package com.cyanogenmod.defyparts;

import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.os.PowerManager;
import android.os.SystemProperties;
import android.preference.CheckBoxPreference;
import android.preference.ListPreference;
Expand Down Expand Up @@ -88,14 +90,14 @@ public boolean onPreferenceChange(Preference preference, Object newValue) {
AlertDialog dialog = new AlertDialog.Builder(this)
.setTitle(R.string.touch_point_warning_title)
.setMessage(R.string.touch_point_warning_message)
.setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() {
.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
setTouchPointSetting(value);
touchPointsPref.setValue(value);
}
})
.setNegativeButton(android.R.string.no, null)
.setNegativeButton(R.string.no, null)
.create();

dialog.show();
Expand All @@ -108,6 +110,21 @@ public void onClick(DialogInterface dialog, int which) {

mPm.setApplicationEnabledSetting(KINETO_PACKAGE, setting, 0);
SystemProperties.set(PROP_KINETO_ENABLED, value ? "1" : "0");

AlertDialog dialog = new AlertDialog.Builder(this)
.setTitle(R.string.kineto_reboot_prompt_title)
.setMessage(R.string.kineto_reboot_prompt_message)
.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
PowerManager pm = (PowerManager) getSystemService(POWER_SERVICE);
pm.reboot(null);
}
})
.setNegativeButton(R.string.no, null)
.create();

dialog.show();
}

return true;
Expand Down

0 comments on commit 9848f16

Please sign in to comment.