Remove debug prefs checkboxes for ignoring gcm and using the udp relay

mechanism.  Replace with static finals with shipping settings.
This commit is contained in:
Eric House 2013-09-01 09:40:08 -07:00
parent 0003065571
commit 23bdec0ea1
8 changed files with 10 additions and 33 deletions

View file

@ -38,8 +38,6 @@
<string name="key_sms_port">key_sms_port</string> <string name="key_sms_port">key_sms_port</string>
<string name="key_dict_host">key_dict_host3</string> <string name="key_dict_host">key_dict_host3</string>
<string name="key_logging_on">key_logging_on</string> <string name="key_logging_on">key_logging_on</string>
<string name="key_udp_relay">key_udp_relay</string>
<string name="key_drop_gcm">key_drop_gcm</string>
<string name="key_show_sms">key_show_sms</string> <string name="key_show_sms">key_show_sms</string>
<string name="key_init_hintsallowed">key_init_hintsallowed</string> <string name="key_init_hintsallowed">key_init_hintsallowed</string>
<string name="key_init_nethintsallowed">key_init_nethintsallowed</string> <string name="key_init_nethintsallowed">key_init_nethintsallowed</string>

View file

@ -295,15 +295,6 @@
android:summary="@string/git_rev" android:summary="@string/git_rev"
android:enabled="false" android:enabled="false"
/> />
<CheckBoxPreference android:key="@string/key_udp_relay"
android:title="@string/udp_relay"
android:defaultValue="true"
/>
<CheckBoxPreference android:key="@string/key_drop_gcm"
android:title="@string/drop_gcm_title"
android:summary="@string/drop_gcm_summary"
android:defaultValue="false"
/>
<CheckBoxPreference android:key="@string/key_logging_on" <CheckBoxPreference android:key="@string/key_logging_on"
android:title="@string/logging_on" android:title="@string/logging_on"
android:defaultValue="false" android:defaultValue="false"

View file

@ -379,7 +379,7 @@ public class CommsTransport implements TransportProcs,
switch ( addr.conType ) { switch ( addr.conType ) {
case COMMS_CONN_RELAY: case COMMS_CONN_RELAY:
if ( XWPrefs.getUDPEnabled( m_context ) ) { if ( XWApp.UDP_ENABLED ) {
nSent = RelayService.sendPacket( m_context, m_rowid, buf ); nSent = RelayService.sendPacket( m_context, m_rowid, buf );
} else { } else {
if ( NetStateCache.netAvail( m_context ) ) { if ( NetStateCache.netAvail( m_context ) ) {

View file

@ -63,7 +63,7 @@ public class GCMIntentService extends GCMBaseIntentService {
notifyRelayService( true ); notifyRelayService( true );
String value; String value;
boolean ignoreIt = XWPrefs.getGCMIgnored( this ); boolean ignoreIt = XWApp.GCM_IGNORED;
if ( ignoreIt ) { if ( ignoreIt ) {
DbgUtils.logf( "received GCM but ignoring it" ); DbgUtils.logf( "received GCM but ignoring it" );
} else { } else {
@ -129,7 +129,7 @@ public class GCMIntentService extends GCMBaseIntentService {
private void notifyRelayService( boolean working ) private void notifyRelayService( boolean working )
{ {
if ( working && XWPrefs.getGCMIgnored( this ) ) { if ( working && XWApp.GCM_IGNORED ) {
working = false; working = false;
} }
RelayService.gcmConfirmed( working ); RelayService.gcmConfirmed( working );

View file

@ -41,7 +41,6 @@ public class PrefsActivity extends PreferenceActivity
private String m_keyLogging; private String m_keyLogging;
private String m_smsToasting; private String m_smsToasting;
private String m_smsEnable; private String m_smsEnable;
private String m_udpEnabled;
private String m_downloadPath; private String m_downloadPath;
@Override @Override
@ -123,7 +122,6 @@ public class PrefsActivity extends PreferenceActivity
m_keyLogging = getString( R.string.key_logging_on ); m_keyLogging = getString( R.string.key_logging_on );
m_smsToasting = getString( R.string.key_show_sms ); m_smsToasting = getString( R.string.key_show_sms );
m_smsEnable = getString( R.string.key_enable_sms ); m_smsEnable = getString( R.string.key_enable_sms );
m_udpEnabled = getString( R.string.key_udp_relay );
m_downloadPath = getString( R.string.key_download_path ); m_downloadPath = getString( R.string.key_download_path );
Button button = (Button)findViewById( R.id.revert_colors ); Button button = (Button)findViewById( R.id.revert_colors );
@ -163,8 +161,6 @@ public class PrefsActivity extends PreferenceActivity
DbgUtils.logEnable( sp.getBoolean( key, false ) ); DbgUtils.logEnable( sp.getBoolean( key, false ) );
} else if ( key.equals( m_smsToasting ) ) { } else if ( key.equals( m_smsToasting ) ) {
SMSService.smsToastEnable( sp.getBoolean( key, false ) ); SMSService.smsToastEnable( sp.getBoolean( key, false ) );
} else if ( key.equals( m_udpEnabled ) ) {
RelayService.udpChanged( this );
} else if ( key.equals( m_smsEnable ) ) { } else if ( key.equals( m_smsEnable ) ) {
if ( sp.getBoolean( key, true ) ) { if ( sp.getBoolean( key, true ) ) {
SMSService.checkForInvites( this ); SMSService.checkForInvites( this );

View file

@ -341,7 +341,7 @@ public class RelayService extends XWService
private boolean startFetchThreadIf() private boolean startFetchThreadIf()
{ {
DbgUtils.logf( "startFetchThreadIf()" ); DbgUtils.logf( "startFetchThreadIf()" );
boolean handled = !XWPrefs.getUDPEnabled( this ); boolean handled = !XWApp.UDP_ENABLED;
if ( handled && null == m_fetchThread ) { if ( handled && null == m_fetchThread ) {
m_fetchThread = new Thread( null, new Runnable() { m_fetchThread = new Thread( null, new Runnable() {
public void run() { public void run() {
@ -370,7 +370,7 @@ public class RelayService extends XWService
private void startUDPThreadsIfNot() private void startUDPThreadsIfNot()
{ {
DbgUtils.logf( "RelayService.startUDPThreadsIfNot()" ); DbgUtils.logf( "RelayService.startUDPThreadsIfNot()" );
if ( XWPrefs.getUDPEnabled( this ) ) { if ( XWApp.UDP_ENABLED ) {
if ( null == m_UDPReadThread ) { if ( null == m_UDPReadThread ) {
m_UDPReadThread = new Thread( null, new Runnable() { m_UDPReadThread = new Thread( null, new Runnable() {
@ -997,7 +997,7 @@ public class RelayService extends XWService
DbgUtils.logf( "RelayService.startThreads()" ); DbgUtils.logf( "RelayService.startThreads()" );
if ( !NetStateCache.netAvail( this ) ) { if ( !NetStateCache.netAvail( this ) ) {
stopThreads(); stopThreads();
} else if ( XWPrefs.getUDPEnabled( this ) ) { } else if ( XWApp.UDP_ENABLED ) {
stopFetchThreadIf(); stopFetchThreadIf();
startUDPThreadsIfNot(); startUDPThreadsIfNot();
registerWithRelay(); registerWithRelay();
@ -1111,7 +1111,7 @@ public class RelayService extends XWService
private boolean shouldMaintainConnection() private boolean shouldMaintainConnection()
{ {
boolean result = XWPrefs.getGCMIgnored( this ) || !s_gcmWorking; boolean result = XWApp.GCM_IGNORED || !s_gcmWorking;
if ( result ) { if ( result ) {
long interval = Utils.getCurSeconds() - m_lastGamePacketReceived; long interval = Utils.getCurSeconds() - m_lastGamePacketReceived;
result = interval < MAX_KEEPALIVE_SECS; result = interval < MAX_KEEPALIVE_SECS;

View file

@ -36,7 +36,9 @@ public class XWApp extends Application {
public static final boolean DEBUG = false; public static final boolean DEBUG = false;
public static final boolean DEBUG_LOCKS = false && DEBUG; public static final boolean DEBUG_LOCKS = false && DEBUG;
public static final boolean DEBUG_EXP_TIMERS = false && DEBUG; public static final boolean DEBUG_EXP_TIMERS = false && DEBUG;
public static final boolean GCM_IGNORED = false;
public static final boolean UDP_ENABLED = true;
public static final String SMS_PUBLIC_HEADER = "-XW4"; public static final String SMS_PUBLIC_HEADER = "-XW4";
private static UUID s_UUID = null; private static UUID s_UUID = null;

View file

@ -34,16 +34,6 @@ public class XWPrefs {
return getPrefsBoolean( context, R.string.key_enable_sms, false ); return getPrefsBoolean( context, R.string.key_enable_sms, false );
} }
public static boolean getUDPEnabled( Context context )
{
return getPrefsBoolean( context, R.string.key_udp_relay, false );
}
public static boolean getGCMIgnored( Context context )
{
return getPrefsBoolean( context, R.string.key_drop_gcm, false );
}
public static boolean getDebugEnabled( Context context ) public static boolean getDebugEnabled( Context context )
{ {
return getPrefsBoolean( context, R.string.key_enable_debug, false ); return getPrefsBoolean( context, R.string.key_enable_debug, false );