Remove obsolete debugging code

Change-Id: I522a5a67ac0f4cf54834e03fd1ff1fe7f580c943
This commit is contained in:
Tony Mantler 2014-01-17 14:59:33 -08:00
parent 7e4daecc9a
commit 5bbbe11596
7 changed files with 14 additions and 151 deletions

View File

@ -43,12 +43,6 @@
android:layout_height="wrap_content"
android:text="@string/debug_clear_webview_cache"
/>
<CheckBox
android:id="@+id/debug_disable_graphics_acceleration"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/debug_disable_graphics_acceleration_label"
/>
<CheckBox
android:id="@+id/debug_force_one_minute_refresh"
android:layout_width="wrap_content"

View File

@ -1,102 +0,0 @@
/*
* Copyright (C) 2010 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.email.activity;
import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.net.Uri;
import android.provider.Browser;
import android.view.WindowManager;
import com.android.email.activity.setup.AccountSecurity;
import com.android.email2.ui.MailActivityEmail;
import com.android.emailcommon.provider.Account;
/**
* Various methods that are used by both 1-pane and 2-pane activities.
*
* Common code used by the activities and the fragments.
*/
@Deprecated
public final class ActivityHelper {
private ActivityHelper() {
}
/**
* Open an URL in a message.
*
* This is intended to mirror the operation of the original
* (see android.webkit.CallbackProxy) with one addition of intent flags
* "FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET". This improves behavior when sublaunching
* other apps via embedded URI's.
*
* We also use this hook to catch "mailto:" links and handle them locally.
*
* @param activity parent activity
* @param url URL to open
* @param senderAccountId if the URL is mailto:, we use this account as the sender.
* TODO When MessageCompose implements the account selector, this won't be necessary.
* Pass {@link Account#NO_ACCOUNT} to use the default account.
* @return true if the URI has successfully been opened.
*/
public static boolean openUrlInMessage(Activity activity, String url, long senderAccountId) {
// hijack mailto: uri's and handle locally
//***
//if (url != null && url.toLowerCase().startsWith("mailto:")) {
// return MessageCompose.actionCompose(activity, url, senderAccountId);
//}
// Handle most uri's via intent launch
boolean result = false;
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
intent.addCategory(Intent.CATEGORY_BROWSABLE);
intent.putExtra(Browser.EXTRA_APPLICATION_ID, activity.getPackageName());
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
try {
activity.startActivity(intent);
result = true;
} catch (ActivityNotFoundException ex) {
// No applications can handle it. Ignore.
}
return result;
}
/**
* If configured via debug flags, inhibit hardware graphics acceleration. Must be called
* early in onCreate().
*
* NOTE: Currently, this only works if HW accel is *not* enabled via the manifest.
*/
public static void debugSetWindowFlags(Activity activity) {
if (MailActivityEmail.sDebugInhibitGraphicsAcceleration) {
// Clear the flag in the activity's window
activity.getWindow().setFlags(0,
WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED);
} else {
// Set the flag in the activity's window
activity.getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED,
WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED);
}
}
public static void showSecurityHoldDialog(Activity callerActivity, long accountId) {
callerActivity.startActivity(
AccountSecurity.actionUpdateSecurityIntent(callerActivity, accountId, true));
}
}

View File

@ -34,7 +34,6 @@ import android.os.Handler;
import com.android.email.R;
import com.android.email.SecurityPolicy;
import com.android.email.activity.ActivityHelper;
import com.android.email2.ui.MailActivityEmail;
import com.android.emailcommon.provider.Account;
import com.android.emailcommon.provider.HostAuth;
@ -123,7 +122,6 @@ public class AccountSecurity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ActivityHelper.debugSetWindowFlags(this);
mHandler = new Handler();

View File

@ -42,7 +42,6 @@ import android.view.MenuItem;
import android.widget.TextView;
import com.android.email.R;
import com.android.email.activity.ActivityHelper;
import com.android.email.provider.EmailProvider;
import com.android.emailcommon.Logging;
import com.android.emailcommon.provider.Account;
@ -192,7 +191,6 @@ public class AccountSettings extends PreferenceActivity implements FeedbackEnabl
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ActivityHelper.debugSetWindowFlags(this);
final Intent i = getIntent();
if (savedInstanceState == null) {

View File

@ -29,7 +29,6 @@ import android.widget.RelativeLayout;
import android.widget.RelativeLayout.LayoutParams;
import com.android.email.R;
import com.android.email.activity.ActivityHelper;
import com.android.email.activity.UiUtilities;
import com.android.email.service.EmailServiceUtils;
import com.android.email.service.EmailServiceUtils.EmailServiceInfo;
@ -56,7 +55,6 @@ public class AccountSetupType extends AccountSetupActivity implements OnClickLis
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ActivityHelper.debugSetWindowFlags(this);
final String accountType = mSetupData.getFlowAccountType();
// If we're in account setup flow mode, see if there's just one protocol that matches

View File

@ -37,12 +37,6 @@ import com.android.mail.utils.LogUtils;
public class DebugFragment extends Fragment implements OnCheckedChangeListener,
View.OnClickListener {
private CheckBox mEnableDebugLoggingView;
private CheckBox mEnableVerboseLoggingView;
private CheckBox mEnableFileLoggingView;
private CheckBox mInhibitGraphicsAccelerationView;
private CheckBox mEnableStrictModeView;
private Preferences mPreferences;
// Public no-args constructor needed for fragment re-instantiation
@ -59,38 +53,31 @@ public class DebugFragment extends Fragment implements OnCheckedChangeListener,
Context context = getActivity();
mPreferences = Preferences.getPreferences(context);
mEnableDebugLoggingView = (CheckBox) UiUtilities.getView(view, R.id.debug_logging);
mEnableDebugLoggingView.setChecked(MailActivityEmail.DEBUG);
final CheckBox enableDebugLoggingView = UiUtilities.getView(view, R.id.debug_logging);
enableDebugLoggingView.setChecked(MailActivityEmail.DEBUG);
mEnableVerboseLoggingView = (CheckBox) UiUtilities.getView(view, R.id.verbose_logging);
mEnableFileLoggingView =
(CheckBox) UiUtilities.getView(view, R.id.file_logging);
final CheckBox enableVerboseLoggingView = UiUtilities.getView(view, R.id.verbose_logging);
final CheckBox enableFileLoggingView = UiUtilities.getView(view, R.id.file_logging);
// Note: To prevent recursion while presetting checkboxes, assign all listeners last
mEnableDebugLoggingView.setOnCheckedChangeListener(this);
enableDebugLoggingView.setOnCheckedChangeListener(this);
if (EmailServiceUtils.areRemoteServicesInstalled(context)) {
mEnableVerboseLoggingView.setChecked(MailActivityEmail.DEBUG_VERBOSE);
mEnableFileLoggingView.setChecked(MailActivityEmail.DEBUG_FILE);
mEnableVerboseLoggingView.setOnCheckedChangeListener(this);
mEnableFileLoggingView.setOnCheckedChangeListener(this);
enableVerboseLoggingView.setChecked(MailActivityEmail.DEBUG_VERBOSE);
enableFileLoggingView.setChecked(MailActivityEmail.DEBUG_FILE);
enableVerboseLoggingView.setOnCheckedChangeListener(this);
enableFileLoggingView.setOnCheckedChangeListener(this);
} else {
mEnableVerboseLoggingView.setVisibility(View.GONE);
mEnableFileLoggingView.setVisibility(View.GONE);
enableVerboseLoggingView.setVisibility(View.GONE);
enableFileLoggingView.setVisibility(View.GONE);
}
UiUtilities.getView(view, R.id.clear_webview_cache).setOnClickListener(this);
mInhibitGraphicsAccelerationView = (CheckBox)
UiUtilities.getView(view, R.id.debug_disable_graphics_acceleration);
mInhibitGraphicsAccelerationView.setChecked(
MailActivityEmail.sDebugInhibitGraphicsAcceleration);
mInhibitGraphicsAccelerationView.setOnCheckedChangeListener(this);
mEnableStrictModeView = (CheckBox)
final CheckBox enableStrictModeView =
UiUtilities.getView(view, R.id.debug_enable_strict_mode);
mEnableStrictModeView.setChecked(mPreferences.getEnableStrictMode());
mEnableStrictModeView.setOnCheckedChangeListener(this);
enableStrictModeView.setChecked(mPreferences.getEnableStrictMode());
enableStrictModeView.setOnCheckedChangeListener(this);
return view;
}
@ -111,10 +98,6 @@ public class DebugFragment extends Fragment implements OnCheckedChangeListener,
mPreferences.setEnableExchangeFileLogging(isChecked);
MailActivityEmail.DEBUG_FILE = isChecked;
break;
case R.id.debug_disable_graphics_acceleration:
MailActivityEmail.sDebugInhibitGraphicsAcceleration = isChecked;
mPreferences.setInhibitGraphicsAcceleration(isChecked);
break;
case R.id.debug_enable_strict_mode:
mPreferences.setEnableStrictMode(isChecked);
MailActivityEmail.enableStrictMode(isChecked);

View File

@ -68,11 +68,6 @@ public class MailActivityEmail extends com.android.mail.ui.MailActivity {
public static boolean DEBUG_VERBOSE;
public static boolean DEBUG_FILE;
/**
* If true, inhibit hardware graphics acceleration in UI (for a/b testing)
*/
public static boolean sDebugInhibitGraphicsAcceleration = false;
private static final int MATCH_LEGACY_SHORTCUT_INTENT = 1;
/**
* A matcher for data URI's that specify conversation list info.
@ -179,7 +174,6 @@ public class MailActivityEmail extends com.android.mail.ui.MailActivity {
super.onCreate(bundle);
final Preferences prefs = Preferences.getPreferences(this);
DEBUG = prefs.getEnableDebugLogging();
sDebugInhibitGraphicsAcceleration = prefs.getInhibitGraphicsAcceleration();
enableStrictMode(prefs.getEnableStrictMode());
TempDirectory.setTempDirectory(this);