Use "*#*#36245#*#*" to activate the debug screen.
Dial *#*#36245#*#* on the dialer to activate the debug screen. "36245" = "email" It's useful when - There's no keyboard. - There's no account set up yet. (You can do it by entering the special username/password on new account screen, but that's a bit of a pain.) It's also easier to tell to people. Also, removed "sensitive logging", which should never be used. Change-Id: Id692f8b216f2d85abe1880c452d2067f170dac83
This commit is contained in:
parent
75f9fab0c7
commit
42e3f10a95
|
@ -233,6 +233,12 @@
|
||||||
<action android:name="android.intent.action.DEVICE_STORAGE_LOW" />
|
<action android:name="android.intent.action.DEVICE_STORAGE_LOW" />
|
||||||
<action android:name="android.intent.action.DEVICE_STORAGE_OK" />
|
<action android:name="android.intent.action.DEVICE_STORAGE_OK" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
<!-- To handle secret code to activate the debug screen. -->
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.provider.Telephony.SECRET_CODE" />
|
||||||
|
<!-- "36245" = "email" -->
|
||||||
|
<data android:scheme="android_secret_code" android:host="36245" />
|
||||||
|
</intent-filter>
|
||||||
</receiver>
|
</receiver>
|
||||||
<service android:name=".service.EmailBroadcastProcessorService" />
|
<service android:name=".service.EmailBroadcastProcessorService" />
|
||||||
|
|
||||||
|
|
|
@ -31,12 +31,6 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/debug_enable_debug_logging_label"
|
android:text="@string/debug_enable_debug_logging_label"
|
||||||
/>
|
/>
|
||||||
<CheckBox
|
|
||||||
android:id="@+id/sensitive_logging"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/debug_enable_sensitive_logging_label"
|
|
||||||
/>
|
|
||||||
<!-- EXCHANGE-REMOVE-SECTION-START -->
|
<!-- EXCHANGE-REMOVE-SECTION-START -->
|
||||||
<CheckBox
|
<CheckBox
|
||||||
android:id="@+id/exchange_logging"
|
android:id="@+id/exchange_logging"
|
||||||
|
|
|
@ -54,7 +54,7 @@ public class Email extends Application {
|
||||||
* If this is enabled than logging that normally hides sensitive information
|
* If this is enabled than logging that normally hides sensitive information
|
||||||
* like passwords will show that information.
|
* like passwords will show that information.
|
||||||
*/
|
*/
|
||||||
public static boolean DEBUG_SENSITIVE = false;
|
public static final boolean DEBUG_SENSITIVE = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set this to 'true' to enable as much Email logging as possible.
|
* Set this to 'true' to enable as much Email logging as possible.
|
||||||
|
@ -263,7 +263,6 @@ public class Email extends Application {
|
||||||
super.onCreate();
|
super.onCreate();
|
||||||
Preferences prefs = Preferences.getPreferences(this);
|
Preferences prefs = Preferences.getPreferences(this);
|
||||||
DEBUG = prefs.getEnableDebugLogging();
|
DEBUG = prefs.getEnableDebugLogging();
|
||||||
DEBUG_SENSITIVE = prefs.getEnableSensitiveLogging();
|
|
||||||
setTempDirectory(this);
|
setTempDirectory(this);
|
||||||
|
|
||||||
// Reset all accounts to default visible window
|
// Reset all accounts to default visible window
|
||||||
|
|
|
@ -32,7 +32,6 @@ public class Preferences {
|
||||||
private static final String ACCOUNT_UUIDS = "accountUuids";
|
private static final String ACCOUNT_UUIDS = "accountUuids";
|
||||||
private static final String DEFAULT_ACCOUNT_UUID = "defaultAccountUuid";
|
private static final String DEFAULT_ACCOUNT_UUID = "defaultAccountUuid";
|
||||||
private static final String ENABLE_DEBUG_LOGGING = "enableDebugLogging";
|
private static final String ENABLE_DEBUG_LOGGING = "enableDebugLogging";
|
||||||
private static final String ENABLE_SENSITIVE_LOGGING = "enableSensitiveLogging";
|
|
||||||
private static final String ENABLE_EXCHANGE_LOGGING = "enableExchangeLogging";
|
private static final String ENABLE_EXCHANGE_LOGGING = "enableExchangeLogging";
|
||||||
private static final String ENABLE_EXCHANGE_FILE_LOGGING = "enableExchangeFileLogging";
|
private static final String ENABLE_EXCHANGE_FILE_LOGGING = "enableExchangeFileLogging";
|
||||||
private static final String DEVICE_UID = "deviceUID";
|
private static final String DEVICE_UID = "deviceUID";
|
||||||
|
@ -141,14 +140,6 @@ public class Preferences {
|
||||||
return mSharedPreferences.getBoolean(ENABLE_DEBUG_LOGGING, false);
|
return mSharedPreferences.getBoolean(ENABLE_DEBUG_LOGGING, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setEnableSensitiveLogging(boolean value) {
|
|
||||||
mSharedPreferences.edit().putBoolean(ENABLE_SENSITIVE_LOGGING, value).commit();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean getEnableSensitiveLogging() {
|
|
||||||
return mSharedPreferences.getBoolean(ENABLE_SENSITIVE_LOGGING, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setEnableExchangeLogging(boolean value) {
|
public void setEnableExchangeLogging(boolean value) {
|
||||||
mSharedPreferences.edit().putBoolean(ENABLE_EXCHANGE_LOGGING, value).commit();
|
mSharedPreferences.edit().putBoolean(ENABLE_EXCHANGE_LOGGING, value).commit();
|
||||||
}
|
}
|
||||||
|
|
|
@ -292,7 +292,7 @@ public class AccountFolderList extends Activity implements AccountFolderListFrag
|
||||||
mSecretKeyCodeIndex++;
|
mSecretKeyCodeIndex++;
|
||||||
if (mSecretKeyCodeIndex == SECRET_KEY_CODES.length) {
|
if (mSecretKeyCodeIndex == SECRET_KEY_CODES.length) {
|
||||||
mSecretKeyCodeIndex = 0;
|
mSecretKeyCodeIndex = 0;
|
||||||
startActivity(new Intent(this, Debug.class));
|
Debug.actionShow(this);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
mSecretKeyCodeIndex = 0;
|
mSecretKeyCodeIndex = 0;
|
||||||
|
|
|
@ -25,6 +25,7 @@ import com.android.exchange.utility.FileLogger;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
|
@ -36,12 +37,17 @@ import android.widget.CompoundButton.OnCheckedChangeListener;
|
||||||
public class Debug extends Activity implements OnCheckedChangeListener {
|
public class Debug extends Activity implements OnCheckedChangeListener {
|
||||||
private TextView mVersionView;
|
private TextView mVersionView;
|
||||||
private CheckBox mEnableDebugLoggingView;
|
private CheckBox mEnableDebugLoggingView;
|
||||||
private CheckBox mEnableSensitiveLoggingView;
|
|
||||||
private CheckBox mEnableExchangeLoggingView;
|
private CheckBox mEnableExchangeLoggingView;
|
||||||
private CheckBox mEnableExchangeFileLoggingView;
|
private CheckBox mEnableExchangeFileLoggingView;
|
||||||
|
|
||||||
private Preferences mPreferences;
|
private Preferences mPreferences;
|
||||||
|
|
||||||
|
public static void actionShow(Context context) {
|
||||||
|
Intent i = new Intent(context, Debug.class);
|
||||||
|
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
|
context.startActivity(i);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
@ -52,16 +58,13 @@ public class Debug extends Activity implements OnCheckedChangeListener {
|
||||||
|
|
||||||
mVersionView = (TextView)findViewById(R.id.version);
|
mVersionView = (TextView)findViewById(R.id.version);
|
||||||
mEnableDebugLoggingView = (CheckBox)findViewById(R.id.debug_logging);
|
mEnableDebugLoggingView = (CheckBox)findViewById(R.id.debug_logging);
|
||||||
mEnableSensitiveLoggingView = (CheckBox)findViewById(R.id.sensitive_logging);
|
|
||||||
|
|
||||||
mEnableDebugLoggingView.setOnCheckedChangeListener(this);
|
mEnableDebugLoggingView.setOnCheckedChangeListener(this);
|
||||||
mEnableSensitiveLoggingView.setOnCheckedChangeListener(this);
|
|
||||||
|
|
||||||
mVersionView.setText(String.format(getString(R.string.debug_version_fmt).toString(),
|
mVersionView.setText(String.format(getString(R.string.debug_version_fmt).toString(),
|
||||||
getString(R.string.build_number)));
|
getString(R.string.build_number)));
|
||||||
|
|
||||||
mEnableDebugLoggingView.setChecked(Email.DEBUG);
|
mEnableDebugLoggingView.setChecked(Email.DEBUG);
|
||||||
mEnableSensitiveLoggingView.setChecked(Email.DEBUG_SENSITIVE);
|
|
||||||
|
|
||||||
//EXCHANGE-REMOVE-SECTION-START
|
//EXCHANGE-REMOVE-SECTION-START
|
||||||
mEnableExchangeLoggingView = (CheckBox)findViewById(R.id.exchange_logging);
|
mEnableExchangeLoggingView = (CheckBox)findViewById(R.id.exchange_logging);
|
||||||
|
@ -79,10 +82,6 @@ public class Debug extends Activity implements OnCheckedChangeListener {
|
||||||
Email.DEBUG = isChecked;
|
Email.DEBUG = isChecked;
|
||||||
mPreferences.setEnableDebugLogging(Email.DEBUG);
|
mPreferences.setEnableDebugLogging(Email.DEBUG);
|
||||||
break;
|
break;
|
||||||
case R.id.sensitive_logging:
|
|
||||||
Email.DEBUG_SENSITIVE = isChecked;
|
|
||||||
mPreferences.setEnableSensitiveLogging(Email.DEBUG_SENSITIVE);
|
|
||||||
break;
|
|
||||||
//EXCHANGE-REMOVE-SECTION-START
|
//EXCHANGE-REMOVE-SECTION-START
|
||||||
case R.id.exchange_logging:
|
case R.id.exchange_logging:
|
||||||
mPreferences.setEnableExchangeLogging(isChecked);
|
mPreferences.setEnableExchangeLogging(isChecked);
|
||||||
|
|
|
@ -480,7 +480,7 @@ public class AccountSetupBasics extends Activity
|
||||||
if (ENTER_DEBUG_SCREEN && "d@d.d".equals(email) && "debug".equals(password)) {
|
if (ENTER_DEBUG_SCREEN && "d@d.d".equals(email) && "debug".equals(password)) {
|
||||||
mEmailView.setText("");
|
mEmailView.setText("");
|
||||||
mPasswordView.setText("");
|
mPasswordView.setText("");
|
||||||
startActivity(new Intent(this, Debug.class));
|
Debug.actionShow(this);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,7 @@ import com.android.email.Email;
|
||||||
import com.android.email.ExchangeUtils;
|
import com.android.email.ExchangeUtils;
|
||||||
import com.android.email.Preferences;
|
import com.android.email.Preferences;
|
||||||
import com.android.email.VendorPolicyLoader;
|
import com.android.email.VendorPolicyLoader;
|
||||||
|
import com.android.email.activity.Debug;
|
||||||
|
|
||||||
import android.app.IntentService;
|
import android.app.IntentService;
|
||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
|
@ -40,6 +41,10 @@ import android.util.Log;
|
||||||
* </ul>
|
* </ul>
|
||||||
*/
|
*/
|
||||||
public class EmailBroadcastProcessorService extends IntentService {
|
public class EmailBroadcastProcessorService extends IntentService {
|
||||||
|
// Dialing "*#*#36245#*#*" to open the debug screen. "36245" = "email"
|
||||||
|
private static final String SECRET_CODE_ACTION = "android.provider.Telephony.SECRET_CODE";
|
||||||
|
private static final String SECRET_CODE_HOST_DEBUG_SCREEN = "36245";
|
||||||
|
|
||||||
public EmailBroadcastProcessorService() {
|
public EmailBroadcastProcessorService() {
|
||||||
// Class name will be the thread name.
|
// Class name will be the thread name.
|
||||||
super(EmailBroadcastProcessorService.class.getName());
|
super(EmailBroadcastProcessorService.class.getName());
|
||||||
|
@ -74,6 +79,9 @@ public class EmailBroadcastProcessorService extends IntentService {
|
||||||
MailService.actionCancel(this);
|
MailService.actionCancel(this);
|
||||||
} else if (Intent.ACTION_DEVICE_STORAGE_OK.equals(action)) {
|
} else if (Intent.ACTION_DEVICE_STORAGE_OK.equals(action)) {
|
||||||
enableComponentsIfNecessary();
|
enableComponentsIfNecessary();
|
||||||
|
} else if (SECRET_CODE_ACTION.equals(action)
|
||||||
|
&& SECRET_CODE_HOST_DEBUG_SCREEN.equals(original.getData().getHost())) {
|
||||||
|
Debug.actionShow(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue