Bug 709230 - Part 3: Mark classes final and reduce class visibility public->package->private to aid ProGuard optimizations. r=blassey

This commit is contained in:
Chris Peterson 2012-07-15 13:20:43 -07:00
parent 97edd595af
commit 215e80e667
120 changed files with 301 additions and 345 deletions

View File

@ -59,7 +59,7 @@ import android.widget.SimpleCursorAdapter;
import android.widget.TextView;
import android.text.TextUtils;
public class AboutHomeContent extends ScrollView
final class AboutHomeContent extends ScrollView
implements TabsAccessor.OnQueryTabsCompleteListener {
private static final String LOGTAG = "GeckoAboutHome";
@ -626,7 +626,7 @@ public class AboutHomeContent extends ScrollView
mRemoteTabs.show();
}
public static class TopSitesGridView extends GridView {
private static final class TopSitesGridView extends GridView {
/** From layout xml:
* 80dip image height
* + 2dip image paddingTop
@ -676,7 +676,7 @@ public class AboutHomeContent extends ScrollView
}
}
public class TopSitesCursorAdapter extends SimpleCursorAdapter {
private final class TopSitesCursorAdapter extends SimpleCursorAdapter {
public TopSitesCursorAdapter(Context context, int layout, Cursor c,
String[] from, int[] to) {
super(context, layout, c, from, to);
@ -695,7 +695,7 @@ public class AboutHomeContent extends ScrollView
}
}
class TopSitesViewBinder implements SimpleCursorAdapter.ViewBinder {
private static final class TopSitesViewBinder implements SimpleCursorAdapter.ViewBinder {
private boolean updateThumbnail(View view, Cursor cursor, int thumbIndex) {
byte[] b = cursor.getBlob(thumbIndex);
ImageView thumbnail = (ImageView) view;

View File

@ -14,7 +14,7 @@ import android.widget.LinearLayout;
import android.widget.TextView;
import android.text.TextUtils;
public class AboutHomeSection extends LinearLayout {
final class AboutHomeSection extends LinearLayout {
private static final String LOGTAG = "GeckoAboutHomeSection";
private TitleView mTitle;
@ -100,7 +100,7 @@ public class AboutHomeSection extends LinearLayout {
mMoreText.setVisibility(View.GONE);
}
public static class TitleView extends LinearLayout {
private static final class TitleView extends LinearLayout {
private TextView mText;
public TitleView(Context context, AttributeSet attrs) {
@ -117,7 +117,7 @@ public class AboutHomeSection extends LinearLayout {
}
}
public static class SubTitleView extends LinearLayout {
private static final class SubTitleView extends LinearLayout {
private TextView mText;
public SubTitleView(Context context, AttributeSet attrs) {
@ -134,7 +134,7 @@ public class AboutHomeSection extends LinearLayout {
}
}
public static class MoreTextView extends LinearLayout {
private static final class MoreTextView extends LinearLayout {
private TextView mText;
public MoreTextView(Context context, AttributeSet attrs) {

View File

@ -22,7 +22,7 @@ import android.os.Environment;
import android.provider.MediaStore;
import android.util.Log;
class ActivityHandlerHelper {
final class ActivityHandlerHelper {
private static final String LOGTAG = "GeckoActivityHandlerHelper";
private final SynchronousQueue<String> mFilePickerResult;
@ -222,7 +222,7 @@ class ActivityHandlerHelper {
* The FilePickerPromptRunnable has to be called to show an intent-like
* context menu UI using the PromptService.
*/
private static class FilePickerPromptRunnable implements Runnable {
private static final class FilePickerPromptRunnable implements Runnable {
private final String mTitle;
private final PromptService.PromptListItem[] mItems;

View File

@ -7,7 +7,7 @@ package org.mozilla.gecko;
import java.util.HashMap;
import java.util.Map;
class ActivityResultHandlerMap {
final class ActivityResultHandlerMap {
private Map<Integer, ActivityResultHandler> mMap = new HashMap<Integer, ActivityResultHandler>();
private int mCounter = 0;

View File

@ -15,8 +15,7 @@ import android.widget.RemoteViews;
import java.net.*;
import java.text.NumberFormat;
public class AlertNotification
extends Notification
final class AlertNotification extends Notification
{
private static final String LOGTAG = "GeckoAlertNotification";

View File

@ -28,7 +28,7 @@ import android.util.Log;
import java.util.ArrayList;
import java.util.Collections;
class AndroidImport implements Runnable {
final class AndroidImport implements Runnable {
static final private String LOGTAG = "AndroidImport";
private Context mContext;
private Runnable mOnDoneRunnable;

View File

@ -21,8 +21,8 @@ import android.util.SparseBooleanArray;
import org.mozilla.gecko.R;
class AndroidImportPreference extends MultiChoicePreference {
static final private String LOGTAG = "AndroidImport";
final class AndroidImportPreference extends MultiChoicePreference {
private static final String LOGTAG = "AndroidImport";
private static final String PREF_KEY_PREFIX = "import_android.data.";
private Context mContext;

View File

@ -41,7 +41,7 @@ import java.net.URLEncoder;
import org.mozilla.gecko.db.BrowserDB;
public class AwesomeBar extends GeckoActivity {
public final class AwesomeBar extends GeckoActivity {
private static final String LOGTAG = "GeckoAwesomeBar";
static final String URL_KEY = "url";
@ -385,7 +385,7 @@ public class AwesomeBar extends GeckoActivity {
cancelAndFinish();
}
static public class ContextMenuSubject {
static final class ContextMenuSubject {
public int id;
public String url;
public byte[] favicon;

View File

@ -35,7 +35,7 @@ import org.mozilla.gecko.db.BrowserContract.Combined;
import org.mozilla.gecko.db.BrowserDB;
import org.mozilla.gecko.db.BrowserDB.URLColumns;
public class AwesomeBarTabs extends TabHost {
final class AwesomeBarTabs extends TabHost {
private static final String LOGTAG = "GeckoAwesomeBarTabs";
private Context mContext;

View File

@ -7,7 +7,7 @@ package org.mozilla.gecko;
import java.util.concurrent.SynchronousQueue;
import android.content.Intent;
class AwesomebarResultHandler implements ActivityResultHandler {
final class AwesomebarResultHandler implements ActivityResultHandler {
private static final String LOGTAG = "GeckoAwesomebarResultHandler";
public void onActivityResult(int resultCode, Intent data) {

View File

@ -61,7 +61,7 @@ import android.content.pm.*;
import android.content.pm.PackageManager.*;
import dalvik.system.*;
abstract public class BrowserApp extends GeckoApp
public abstract class BrowserApp extends GeckoApp
implements TabsPanel.TabsLayoutChangeListener,
PropertyAnimator.PropertyAnimationListener {
private static final String LOGTAG = "GeckoBrowserApp";
@ -509,7 +509,7 @@ abstract public class BrowserApp extends GeckoApp
mMainHandler.postAtFrontOfQueue(r);
}
public class AboutHomeRunnable implements Runnable {
private final class AboutHomeRunnable implements Runnable {
boolean mShow;
AboutHomeRunnable(boolean show) {
mShow = show;

View File

@ -48,7 +48,7 @@ import android.widget.TextSwitcher;
import android.widget.Toast;
import android.widget.ViewSwitcher;
public class BrowserToolbar implements ViewSwitcher.ViewFactory,
final class BrowserToolbar implements ViewSwitcher.ViewFactory,
Tabs.OnTabsChangedListener,
GeckoMenu.ActionItemBarPresenter {
private static final String LOGTAG = "GeckoToolbar";
@ -589,7 +589,7 @@ public class BrowserToolbar implements ViewSwitcher.ViewFactory,
}
// MenuPopup holds the MenuPanel in Honeycomb/ICS devices with no hardware key
public class MenuPopup extends PopupWindow {
private static final class MenuPopup extends PopupWindow {
private RelativeLayout mPanel;
public MenuPopup(Context context) {

View File

@ -12,7 +12,7 @@ import android.os.Environment;
import android.text.format.Time;
import android.util.Log;
class CameraImageResultHandler implements ActivityResultHandler {
final class CameraImageResultHandler implements ActivityResultHandler {
private static final String LOGTAG = "GeckoCameraImageResultHandler";
private final SynchronousQueue<String> mFilePickerResult;

View File

@ -11,7 +11,7 @@ import android.database.Cursor;
import android.provider.MediaStore;
import android.util.Log;
class CameraVideoResultHandler implements ActivityResultHandler {
final class CameraVideoResultHandler implements ActivityResultHandler {
private static final String LOGTAG = "GeckoCameraVideoResultHandler";
private final SynchronousQueue<String> mFilePickerResult;

View File

@ -34,8 +34,7 @@ import android.widget.CheckBox;
import org.mozilla.gecko.R;
public class CrashReporter extends Activity
{
public final class CrashReporter extends Activity {
private static final String LOGTAG = "GeckoCrashReporter";
private static final String PASSED_MINI_DUMP_KEY = "minidumpPath";

View File

@ -11,7 +11,7 @@ import android.view.KeyEvent;
import android.view.View;
import android.widget.EditText;
public class CustomEditText extends EditText {
final class CustomEditText extends EditText {
public CustomEditText(Context context, AttributeSet attrs) {
super(context, attrs);
mOnKeyPreImeListener = null;

View File

@ -21,7 +21,7 @@ import android.widget.TextView;
import org.json.JSONObject;
import org.json.JSONException;
public class DoorHanger extends LinearLayout implements Button.OnClickListener {
final class DoorHanger extends LinearLayout implements Button.OnClickListener {
private static final String LOGTAG = "DoorHanger";
private Context mContext;

View File

@ -24,7 +24,7 @@ import org.json.JSONArray;
import org.json.JSONObject;
import org.json.JSONException;
public class DoorHangerPopup extends PopupWindow {
final class DoorHangerPopup extends PopupWindow {
private static final String LOGTAG = "GeckoDoorHangerPopup";
private Context mContext;

View File

@ -36,7 +36,7 @@ import org.apache.http.HttpEntity;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.entity.BufferedHttpEntity;
public class Favicons {
final class Favicons {
private static final String LOGTAG = "GeckoFavicons";
public static final long NOT_LOADING = 0;
@ -50,10 +50,10 @@ public class Favicons {
private AndroidHttpClient mHttpClient;
public interface OnFaviconLoadedListener {
public void onFaviconLoaded(String url, Drawable favicon);
void onFaviconLoaded(String url, Drawable favicon);
}
private class DatabaseHelper extends SQLiteOpenHelper {
private final class DatabaseHelper extends SQLiteOpenHelper {
private static final String DATABASE_NAME = "favicon_urls.db";
private static final String TABLE_NAME = "favicon_urls";
private static final int DATABASE_VERSION = 1;
@ -213,7 +213,7 @@ public class Favicons {
mHttpClient.close();
}
private class LoadFaviconTask extends AsyncTask<Void, Void, BitmapDrawable> {
private final class LoadFaviconTask extends AsyncTask<Void, Void, BitmapDrawable> {
private long mId;
private String mPageUrl;
private String mFaviconUrl;

View File

@ -8,7 +8,7 @@ import java.util.concurrent.SynchronousQueue;
import android.content.Intent;
import android.util.Log;
class FilePickerResultHandlerSync extends FilePickerResultHandler {
final class FilePickerResultHandlerSync extends FilePickerResultHandler {
private static final String LOGTAG = "GeckoFilePickerResultHandlerSync";
FilePickerResultHandlerSync(SynchronousQueue<String> resultQueue) {

View File

@ -17,7 +17,7 @@ import android.view.inputmethod.InputMethodManager;
import android.widget.RelativeLayout;
import android.widget.RelativeLayout.LayoutParams;
public class FindInPageBar extends RelativeLayout implements TextWatcher, View.OnClickListener {
final class FindInPageBar extends RelativeLayout implements TextWatcher, View.OnClickListener {
private static final String LOGTAG = "GeckoFindInPagePopup";
private final Context mContext;

View File

@ -9,6 +9,8 @@ import java.lang.Math;
import android.graphics.PointF;
public final class FloatUtils {
private FloatUtils() {}
public static boolean fuzzyEquals(float a, float b) {
return (Math.abs(a - b) < 1e-6);
}

View File

@ -10,7 +10,7 @@ import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
public class FlowLayout extends ViewGroup {
final class FlowLayout extends ViewGroup {
private int mSpacing;
public FlowLayout(Context context) {

View File

@ -30,7 +30,7 @@ import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
public class FormAssistPopup extends RelativeLayout implements GeckoEventListener {
public final class FormAssistPopup extends RelativeLayout implements GeckoEventListener {
private Context mContext;
private Animation mAnimation;
@ -297,7 +297,7 @@ public class FormAssistPopup extends RelativeLayout implements GeckoEventListene
}
}
private class AutoCompleteListAdapter extends ArrayAdapter<Pair<String, String>> {
private final class AutoCompleteListAdapter extends ArrayAdapter<Pair<String, String>> {
private LayoutInflater mInflater;
private int mTextViewResourceId;

View File

@ -522,7 +522,7 @@ abstract public class GeckoApp
}
// MenuPanel holds the scrollable Menu
public static class MenuPanel extends ScrollView {
public static final class MenuPanel extends ScrollView {
public MenuPanel(Context context, AttributeSet attrs) {
super(context, attrs);
setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
@ -2063,7 +2063,7 @@ abstract public class GeckoApp
abstract public String getDefaultUAString();
abstract public String getUAStringForHost(String host);
class RedirectorRunnable implements Runnable {
private final class RedirectorRunnable implements Runnable {
Intent mIntent;
RedirectorRunnable(Intent intent) {
mIntent = intent;
@ -2867,8 +2867,7 @@ abstract public class GeckoApp
return false;
}
private class FullScreenHolder extends FrameLayout {
private final class FullScreenHolder extends FrameLayout {
public FullScreenHolder(Context ctx) {
super(ctx);
}
@ -3000,7 +2999,7 @@ abstract public class GeckoApp
}
// SDK version 15 accessibility methods retrieved through reflection.
private static class AccessibilityCompat {
private static final class AccessibilityCompat {
private static boolean mInitialized = false;
private static Method mAccessibilityEvent_setMaxScrollX = null;
private static Method mAccessibilityEvent_setMaxScrollY = null;

View File

@ -52,8 +52,7 @@ import android.graphics.drawable.*;
import org.json.JSONObject;
public class GeckoAppShell
{
public final class GeckoAppShell {
private static final String LOGTAG = "GeckoAppShell";
// static members only
@ -204,7 +203,7 @@ public class GeckoAppShell
public static native void onFullScreenPluginHidden(View view);
private static class GeckoMediaScannerClient implements MediaScannerConnectionClient {
private static final class GeckoMediaScannerClient implements MediaScannerConnectionClient {
private String mFile = "";
private String mMimeType = "";
private MediaScannerConnection mScanner = null;

View File

@ -9,8 +9,7 @@ import java.util.ArrayList;
import android.app.Activity;
import android.app.Application;
public class GeckoApplication extends Application {
public final class GeckoApplication extends Application {
private boolean mInBackground = false;
private ArrayList<ApplicationLifecycleCallbacks> mListeners;

View File

@ -8,7 +8,7 @@ package org.mozilla.gecko;
// AsyncTask runs onPostExecute on the thread it is constructed on
// We construct these off of the main thread, and we want that to run
// on the main UI thread, so this is a convenience class to do that
public abstract class GeckoAsyncTask<Params, Progress, Result> {
abstract class GeckoAsyncTask<Params, Progress, Result> {
public static final int PRIORITY_NORMAL = 0;
public static final int PRIORITY_HIGH = 1;
@ -18,7 +18,7 @@ public abstract class GeckoAsyncTask<Params, Progress, Result> {
mPriority = PRIORITY_NORMAL;
}
private class BackgroundTaskRunnable implements Runnable {
private final class BackgroundTaskRunnable implements Runnable {
private Params[] mParams;
public BackgroundTaskRunnable(Params... params) {

View File

@ -9,7 +9,7 @@ import android.os.Looper;
import java.util.concurrent.SynchronousQueue;
public class GeckoBackgroundThread extends Thread {
public final class GeckoBackgroundThread extends Thread {
private static final String LOOPER_NAME = "GeckoBackgroundThread";
// Guarded by 'this'.

View File

@ -18,9 +18,7 @@ import android.os.Build;
import android.os.SystemClock;
import android.util.Log;
public class GeckoBatteryManager
extends BroadcastReceiver
{
final class GeckoBatteryManager extends BroadcastReceiver {
private static final String LOGTAG = "GeckoBatteryManager";
// Those constants should be keep in sync with the ones in:

View File

@ -14,7 +14,7 @@ import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.util.Log;
public class GeckoConnectivityReceiver extends BroadcastReceiver {
final class GeckoConnectivityReceiver extends BroadcastReceiver {
/*
* Keep the below constants in sync with
* http://mxr.mozilla.org/mozilla-central/source/netwerk/base/public/nsINetworkLinkService.idl

View File

@ -35,7 +35,7 @@ import android.util.Log;
/* This class is referenced by Robocop via reflection; use care when
* modifying the signature.
*/
public class GeckoEvent {
public final class GeckoEvent {
private static final String LOGTAG = "GeckoEvent";
private static final int INVALID = -1;

View File

@ -5,8 +5,9 @@
package org.mozilla.gecko;
public class GeckoHalDefines
{
final class GeckoHalDefines {
private GeckoHalDefines() {}
/*
* Keep these values consistent with |SensorType| in Hal.h
*/
@ -22,4 +23,4 @@ public class GeckoHalDefines
public static final int SENSOR_ACCURACY_LOW = 1;
public static final int SENSOR_ACCURACY_MED = 2;
public static final int SENSOR_ACCURACY_HIGH = 3;
};
}

View File

@ -20,8 +20,8 @@ import android.util.Log;
/* Reads out of a multiple level deep jar file such as
* jar:jar:file:///data/app/org.mozilla.fennec.apk!/omni.ja!/chrome/chrome/content/branding/favicon32.png
*/
public class GeckoJarReader {
private static String LOGTAG = "GeckoJarReader";
final class GeckoJarReader {
private static final String LOGTAG = "GeckoJarReader";
public static BitmapDrawable getBitmapDrawable(String url) {
Stack<String> jarUrls = parseUrl(url);

View File

@ -21,13 +21,13 @@ import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
public class GeckoMenu extends LinearLayout
final class GeckoMenu extends LinearLayout
implements Menu, GeckoMenuItem.OnShowAsActionChangedListener {
private static final String LOGTAG = "GeckoMenu";
private Context mContext;
public static interface ActionItemBarPresenter {
public interface ActionItemBarPresenter {
public void addActionItem(View actionItem);
public void removeActionItem(int index);
public int getActionItemsCount();

View File

@ -23,7 +23,7 @@ import android.view.MenuItem;
import android.view.SubMenu;
import android.view.View;
public class GeckoMenuInflater extends MenuInflater
final class GeckoMenuInflater extends MenuInflater
implements MenuItem.OnMenuItemClickListener {
private static final String LOGTAG = "GeckoMenuInflater";
@ -33,7 +33,7 @@ public class GeckoMenuInflater extends MenuInflater
private Context mContext;
// Private class to hold the parsed menu item.
private class ParsedItem {
private static final class ParsedItem {
public int id;
public int order;
public CharSequence title;

View File

@ -16,10 +16,10 @@ import android.view.MenuItem;
import android.view.SubMenu;
import android.view.View;
public class GeckoMenuItem implements MenuItem, View.OnClickListener {
final class GeckoMenuItem implements MenuItem, View.OnClickListener {
private static final String LOGTAG = "GeckoMenuItem";
public static interface Layout {
public interface Layout {
public void setId(int id);
public void setIcon(Drawable icon);
public void setIcon(int iconRes);
@ -32,7 +32,7 @@ public class GeckoMenuItem implements MenuItem, View.OnClickListener {
public View getLayout();
}
public static interface OnShowAsActionChangedListener {
public interface OnShowAsActionChangedListener {
public boolean hasActionItemBar();
public void onShowAsActionChanged(GeckoMenuItem item, boolean isActionItem);
}

View File

@ -9,7 +9,7 @@ import android.content.Context;
import android.content.Intent;
import android.util.Log;
public class GeckoMessageReceiver extends BroadcastReceiver {
final class GeckoMessageReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
final String action = intent.getAction();

View File

@ -62,9 +62,7 @@ import android.telephony.TelephonyManager;
* int NETWORK_TYPE_LTE Current network is LTE
*/
public class GeckoNetworkManager
extends BroadcastReceiver
{
final class GeckoNetworkManager extends BroadcastReceiver {
static private final GeckoNetworkManager sInstance = new GeckoNetworkManager();
static private final double kDefaultBandwidth = -1.0;

View File

@ -34,7 +34,7 @@ import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
public class GeckoPreferences
public final class GeckoPreferences
extends PreferenceActivity
implements OnPreferenceChangeListener, GeckoEventListener
{
@ -181,7 +181,7 @@ public class GeckoPreferences
return input;
}
private class PasswordTextWatcher implements TextWatcher {
private static final class PasswordTextWatcher implements TextWatcher {
EditText input1 = null;
EditText input2 = null;
AlertDialog dialog = null;

View File

@ -10,11 +10,10 @@ import android.view.OrientationEventListener;
import android.view.Surface;
import android.content.pm.ActivityInfo;
public class GeckoScreenOrientationListener
{
final class GeckoScreenOrientationListener {
private static final String LOGTAG = "GeckoScreenOrientationListener";
static class OrientationEventListenerImpl extends OrientationEventListener {
private static final class OrientationEventListenerImpl extends OrientationEventListener {
public OrientationEventListenerImpl(Context c) {
super(c);
}

View File

@ -37,8 +37,7 @@ import android.telephony.SmsMessage;
* There are only |Integer.MAX_VALUE - Integer.MIN_VALUE| unique IDs available,
* and they wrap around.
*/
class PendingIntentUID
{
final class PendingIntentUID {
static private int sUID = Integer.MIN_VALUE;
static public int generate() { return sUID++; }
@ -48,8 +47,7 @@ class PendingIntentUID
* The envelope class contains all information that are needed to keep track of
* a sent SMS.
*/
class Envelope
{
final class Envelope {
enum SubParts {
SENT_PART,
DELIVERED_PART
@ -141,8 +139,7 @@ class Envelope
/**
* Postman class is a singleton that manages Envelope instances.
*/
class Postman
{
final class Postman {
public static final int kUnknownEnvelopeId = -1;
private static final Postman sInstance = new Postman();
@ -199,7 +196,7 @@ class Postman
}
}
class SmsIOThread extends Thread {
final class SmsIOThread extends Thread {
private final static SmsIOThread sInstance = new SmsIOThread();
private Handler mHandler;
@ -221,8 +218,7 @@ class SmsIOThread extends Thread {
}
}
class MessagesListManager
{
final class MessagesListManager {
private static final MessagesListManager sInstance = new MessagesListManager();
public static MessagesListManager getInstance() {
@ -286,7 +282,7 @@ class MessagesListManager
}
}
public class GeckoSmsManager
final class GeckoSmsManager
extends BroadcastReceiver
implements ISmsManager
{

View File

@ -22,7 +22,7 @@ import java.util.concurrent.CountDownLatch;
import org.mozilla.gecko.gfx.GfxInfoThread;
public class GeckoThread extends Thread {
final class GeckoThread extends Thread {
private static final String LOGTAG = "GeckoThread";
Intent mIntent;

View File

@ -11,7 +11,7 @@ import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
public final class GeckoViewsFactory implements LayoutInflater.Factory {
final class GeckoViewsFactory implements LayoutInflater.Factory {
private static final String LOGTAG = "GeckoViewsFactory";
private static final String GECKO_VIEW_IDENTIFIER = "org.mozilla.gecko.";

View File

@ -19,7 +19,7 @@ import android.util.Log;
import org.mozilla.gecko.db.BrowserDB;
class GlobalHistory {
final class GlobalHistory {
private static final String LOGTAG = "GeckoGlobalHistory";
private static GlobalHistory sInstance = new GlobalHistory();

View File

@ -17,7 +17,7 @@ import java.io.IOException;
import java.util.Enumeration;
import java.util.Hashtable;
public class INIParser extends INISection {
final class INIParser extends INISection {
// default file to read and write to
private File mFile = null;

View File

@ -26,9 +26,7 @@ import android.view.*;
import android.net.Uri;
import android.graphics.*;
public class LauncherShortcuts extends Activity {
public final class LauncherShortcuts extends Activity {
private ArrayList <HashMap<String, String>> mWebappsList;
private File mWebappsFolder;
@ -109,7 +107,7 @@ public class LauncherShortcuts extends Activity {
finish();
}
private class FetchWebApps extends AsyncTask<Void, Void, Void> {
private final class FetchWebApps extends AsyncTask<Void, Void, Void> {
@Override
protected Void doInBackground(Void... unused) {

View File

@ -9,7 +9,7 @@ import android.content.Context;
import android.preference.Preference;
import android.util.AttributeSet;
class LinkPreference extends Preference {
final class LinkPreference extends Preference {
private String mUrl = null;
public LinkPreference(Context context, AttributeSet attrs) {

View File

@ -10,7 +10,7 @@ import android.text.SpannableString;
import android.text.style.UnderlineSpan;
import android.widget.TextView;
public class LinkTextView extends TextView {
final class LinkTextView extends TextView {
public LinkTextView(Context context, AttributeSet attrs) {
super(context, attrs);
}

View File

@ -16,7 +16,7 @@ import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.ImageButton;
public class MenuItemActionBar extends ImageButton
final class MenuItemActionBar extends ImageButton
implements GeckoMenuItem.Layout {
private static final String LOGTAG = "GeckoMenuItemActionBar";

View File

@ -18,7 +18,7 @@ import android.widget.LinearLayout.LayoutParams;
import android.widget.TextView;
import android.widget.ImageView;
public class MenuItemDefault extends LinearLayout
final class MenuItemDefault extends LinearLayout
implements GeckoMenuItem.Layout {
private static final String LOGTAG = "GeckoMenuItemDefault";

View File

@ -15,8 +15,7 @@ import android.os.Bundle;
import android.util.Log;
import android.net.Uri;
public class NotificationHandler
extends BroadcastReceiver
final class NotificationHandler extends BroadcastReceiver
{
private static final String LOGTAG = "GeckoNotificationHandler";

View File

@ -18,7 +18,7 @@ import android.content.DialogInterface;
import android.util.AttributeSet;
import android.util.Log;
class PrivateDataPreference extends MultiChoicePreference {
final class PrivateDataPreference extends MultiChoicePreference {
private static final String LOGTAG = "GeckoPrivateDataPreference";
private static final String PREF_KEY_PREFIX = "private.data.";

View File

@ -65,7 +65,7 @@ import org.json.JSONArray;
import org.json.JSONObject;
import org.json.JSONException;
public class ProfileMigrator {
public final class ProfileMigrator {
private static final String LOGTAG = "ProfileMigrator";
private static final String PREFS_NAME = "ProfileMigrator";
private ContentResolver mCr;
@ -432,8 +432,7 @@ public class ProfileMigrator {
setBooleanPrefTrue(PREFS_MIGRATE_MOVE_PROFILE_DONE);
}
private class MoveProfileTask implements Runnable {
private final class MoveProfileTask implements Runnable {
protected void moveProfilesToAppInstallLocation() {
if (Build.VERSION.SDK_INT >= 8) {
// if we're on API >= 8, it's possible that
@ -544,7 +543,7 @@ public class ProfileMigrator {
}
}
private class SyncTask implements Runnable, GeckoEventListener {
private final class SyncTask implements Runnable, GeckoEventListener {
private List<String> mSyncSettingsList;
private Map<String, String> mSyncSettingsMap;
@ -734,7 +733,7 @@ public class ProfileMigrator {
}
}
private class MiscTask implements Runnable {
private final class MiscTask implements Runnable {
protected void cleanupXULLibCache() {
File cacheFile = GeckoAppShell.getCacheDir(mContext);
File[] files = cacheFile.listFiles();
@ -756,7 +755,7 @@ public class ProfileMigrator {
}
}
private class PlacesRunnable implements Runnable {
private final class PlacesRunnable implements Runnable {
private File mProfileDir;
private Map<Long, Long> mRerootMap;
private Long mTagsPlacesFolderId;

View File

@ -41,7 +41,7 @@ import org.json.JSONArray;
import org.json.JSONObject;
import android.text.InputType;
public class PromptService implements OnClickListener, OnCancelListener, OnItemClickListener, GeckoEventResponder {
final class PromptService implements OnClickListener, OnCancelListener, OnItemClickListener, GeckoEventResponder {
private static final String LOGTAG = "GeckoPromptService";
private PromptInput[] mInputs;
@ -89,7 +89,7 @@ public class PromptService implements OnClickListener, OnCancelListener, OnItemC
GeckoAppShell.unregisterGeckoEventListener("Prompt:Show", this);
}
private class PromptButton {
private static final class PromptButton {
public String label = "";
PromptButton(JSONObject aJSONButton) {
try {
@ -98,7 +98,7 @@ public class PromptService implements OnClickListener, OnCancelListener, OnItemC
}
}
private class PromptInput {
private final class PromptInput {
private String label = "";
private String type = "";
private String hint = "";
@ -434,7 +434,7 @@ public class PromptService implements OnClickListener, OnCancelListener, OnItemC
return list;
}
static public class PromptListItem {
public static final class PromptListItem {
public String label = "";
public boolean isGroup = false;
public boolean inGroup = false;
@ -457,7 +457,7 @@ public class PromptService implements OnClickListener, OnCancelListener, OnItemC
}
}
public class PromptListAdapter extends ArrayAdapter<PromptListItem> {
public final class PromptListAdapter extends ArrayAdapter<PromptListItem> {
private static final int VIEW_TYPE_ITEM = 0;
private static final int VIEW_TYPE_GROUP = 1;
private static final int VIEW_TYPE_COUNT = 2;
@ -576,7 +576,7 @@ public class PromptService implements OnClickListener, OnCancelListener, OnItemC
return convertView;
}
private class ViewHolder {
private final class ViewHolder {
public TextView textView;
public int paddingLeft;
public int paddingRight;

View File

@ -17,7 +17,7 @@ import android.view.View;
import android.view.ViewGroup;
import android.util.Log;
public class PropertyAnimator extends TimerTask {
final class PropertyAnimator extends TimerTask {
private static final String LOGTAG = "GeckoPropertyAnimator";
private Timer mTimer;
@ -30,14 +30,14 @@ public class PropertyAnimator extends TimerTask {
SLIDE_LEFT
}
private class ElementHolder {
private static final class ElementHolder {
View view;
Property property;
int from;
int to;
}
public static interface PropertyAnimationListener {
public interface PropertyAnimationListener {
public void onPropertyAnimationStart();
public void onPropertyAnimationEnd();
}

View File

@ -22,7 +22,7 @@ import android.widget.ExpandableListView;
import android.widget.SimpleExpandableListAdapter;
import android.text.TextUtils;
public class RemoteTabs extends LinearLayout
final class RemoteTabs extends LinearLayout
implements TabsPanel.PanelView,
ExpandableListView.OnGroupClickListener,
ExpandableListView.OnChildClickListener,

View File

@ -13,7 +13,7 @@ import android.os.*;
import java.io.*;
import org.mozilla.gecko.GeckoAppShell;
public class Restarter extends Activity {
public final class Restarter extends Activity {
private static final String LOGTAG = "GeckoRestarter";
@Override
@ -63,4 +63,4 @@ public class Restarter extends Activity {
GeckoAppShell.waitForAnotherGeckoProc();
System.exit(0);
}
};
}

View File

@ -15,8 +15,7 @@ import android.widget.ImageView;
import org.mozilla.gecko.R;
public class SetupScreen extends Dialog
{
final class SetupScreen extends Dialog {
private static final String LOGTAG = "SetupScreen";
private AnimationDrawable mProgressSpinner;

View File

@ -24,7 +24,7 @@ import org.json.JSONException;
* SiteIdentityPopup is a singleton class that displays site identity data in
* an arrow panel popup hanging from the lock icon in the browser toolbar.
*/
public class SiteIdentityPopup extends PopupWindow {
final class SiteIdentityPopup extends PopupWindow {
private static final String LOGTAG = "GeckoSiteIdentityPopup";
public static final String UNKNOWN = "unknown";
@ -50,7 +50,7 @@ public class SiteIdentityPopup extends PopupWindow {
mInflated = false;
}
private static class InstanceHolder {
private static final class InstanceHolder {
private static final SiteIdentityPopup INSTANCE = new SiteIdentityPopup();
}

View File

@ -9,8 +9,7 @@ package org.mozilla.gecko;
import org.mozilla.gecko.GeckoSmsManager;
#endif
class SmsManager
{
final class SmsManager {
static private ISmsManager sInstance = null;
static public ISmsManager getInstance() {

View File

@ -24,7 +24,7 @@ import java.util.ArrayList;
/**
* Use network-based search suggestions.
*/
public class SuggestClient {
final class SuggestClient {
private static final String LOGTAG = "GeckoSuggestClient";
private static final String USER_AGENT = GeckoApp.mAppContext.getDefaultUAString();

View File

@ -6,7 +6,7 @@ package org.mozilla.gecko;
import java.nio.ByteBuffer;
public class SurfaceBits {
public final class SurfaceBits {
public int width;
public int height;
public int format;

View File

@ -17,7 +17,7 @@ import android.util.Log;
import org.mozilla.gecko.sync.setup.activities.SetupSyncActivity;
import org.mozilla.gecko.sync.setup.SyncAccounts;
class SyncPreference extends Preference {
final class SyncPreference extends Preference {
private Context mContext;
public SyncPreference(Context context, AttributeSet attrs) {

View File

@ -366,5 +366,4 @@ public class Tabs implements GeckoEventListener {
items.next().onTabChanged(tab, msg, data);
}
}
}

View File

@ -29,13 +29,13 @@ public class TabsPanel extends LinearLayout {
REMOTE_TABS
}
public static interface PanelView {
public interface PanelView {
public ViewGroup getLayout();
public void show();
public void hide();
}
public static interface TabsLayoutChangeListener {
public interface TabsLayoutChangeListener {
public void onTabsLayoutChange(int width, int height);
}

View File

@ -92,5 +92,4 @@ public class WebApp extends GeckoApp {
return true;
}
#endif
};
}

View File

@ -12,7 +12,7 @@ import android.content.SharedPreferences;
import org.json.JSONObject;
import org.json.JSONException;
public class WebAppAllocator {
public final class WebAppAllocator {
// The number of WebApp# and WEBAPP# activites/apps/intents
private final static int MAX_WEB_APPS = 100;

View File

@ -53,8 +53,8 @@ import org.mozilla.gecko.db.BrowserDB;
import org.mozilla.gecko.db.BrowserDB.URLColumns;
import org.mozilla.gecko.db.BrowserContract.Combined;
public class AllPagesTab extends AwesomeBarTab implements GeckoEventListener {
public static final String LOGTAG = "ALL_PAGES";
final class AllPagesTab extends AwesomeBarTab implements GeckoEventListener {
private static final String LOGTAG = "ALL_PAGES";
private static final String TAG = "allPages";
private static final int SUGGESTION_TIMEOUT = 3000;
@ -67,7 +67,7 @@ public class AllPagesTab extends AwesomeBarTab implements GeckoEventListener {
private ListView mView = null;
private AwesomeBarCursorAdapter mCursorAdapter = null;
private class SearchEntryViewHolder {
private static final class SearchEntryViewHolder {
public FlowLayout suggestionView;
public ImageView iconView;
public LinearLayout userEnteredView;
@ -178,10 +178,10 @@ public class AllPagesTab extends AwesomeBarTab implements GeckoEventListener {
}
private interface AwesomeBarItem {
public void onClick();
void onClick();
}
private class AwesomeBarCursorItem implements AwesomeBarItem {
private final class AwesomeBarCursorItem implements AwesomeBarItem {
private Cursor mCursor;
public AwesomeBarCursorItem(Cursor cursor) {
@ -207,7 +207,7 @@ public class AllPagesTab extends AwesomeBarTab implements GeckoEventListener {
}
}
private class AwesomeBarSearchEngineItem implements AwesomeBarItem {
private final class AwesomeBarSearchEngineItem implements AwesomeBarItem {
private String mSearchEngine;
public AwesomeBarSearchEngineItem(String searchEngine) {
@ -221,7 +221,7 @@ public class AllPagesTab extends AwesomeBarTab implements GeckoEventListener {
}
}
private class AwesomeBarCursorAdapter extends SimpleCursorAdapter {
private final class AwesomeBarCursorAdapter extends SimpleCursorAdapter {
private static final int ROW_SEARCH = 0;
private static final int ROW_STANDARD = 1;
@ -420,7 +420,7 @@ public class AllPagesTab extends AwesomeBarTab implements GeckoEventListener {
}
};
private class SearchEngine {
private static final class SearchEngine {
public String name;
public Drawable icon;
public ArrayList<String> suggestions;

View File

@ -28,7 +28,7 @@ import org.mozilla.gecko.db.BrowserContract.Combined;
import org.mozilla.gecko.db.BrowserDB.URLColumns;
import org.mozilla.gecko.AwesomeBar.ContextMenuSubject;
abstract public class AwesomeBarTab {
abstract class AwesomeBarTab {
abstract public String getTag();
abstract public int getTitleStringId();
abstract public void destroy();
@ -53,7 +53,7 @@ abstract public class AwesomeBarTab {
mListListener = listener;
}
protected class AwesomeEntryViewHolder {
protected static final class AwesomeEntryViewHolder {
public TextView titleView;
public TextView urlView;
public ImageView faviconView;

View File

@ -38,9 +38,9 @@ import org.mozilla.gecko.db.BrowserContract.Bookmarks;
import org.mozilla.gecko.db.BrowserDB;
import org.mozilla.gecko.db.BrowserDB.URLColumns;
public class BookmarksTab extends AwesomeBarTab {
public static final String LOGTAG = "BOOKMARKS_TAB";
public static final String TAG = "bookmarks";
final class BookmarksTab extends AwesomeBarTab {
private static final String LOGTAG = "BOOKMARKS_TAB";
private static final String TAG = "bookmarks";
private boolean mInReadingList = false;
private int mFolderId;
private String mFolderTitle;
@ -204,7 +204,7 @@ public class BookmarksTab extends AwesomeBarTab {
listener.onUrlOpen(url);
}
private class BookmarksListAdapter extends SimpleCursorAdapter {
private final class BookmarksListAdapter extends SimpleCursorAdapter {
private static final int VIEW_TYPE_ITEM = 0;
private static final int VIEW_TYPE_FOLDER = 1;
private static final int VIEW_TYPE_COUNT = 2;
@ -344,7 +344,7 @@ public class BookmarksTab extends AwesomeBarTab {
}
}
private class BookmarksQueryTask extends AsyncTask<Void, Void, Cursor> {
private final class BookmarksQueryTask extends AsyncTask<Void, Void, Cursor> {
public BookmarksQueryTask() {
mFolderId = Bookmarks.FIXED_ROOT_ID;
mFolderTitle = "";

View File

@ -43,9 +43,9 @@ import org.mozilla.gecko.db.BrowserContract.Combined;
import org.mozilla.gecko.db.BrowserDB;
import org.mozilla.gecko.db.BrowserDB.URLColumns;
public class HistoryTab extends AwesomeBarTab {
public static final String LOGTAG = "HISTORY_TAB";
public static final String TAG = "history";
final class HistoryTab extends AwesomeBarTab {
private static final String LOGTAG = "HISTORY_TAB";
private static final String TAG = "history";
private static enum HistorySection { TODAY, YESTERDAY, WEEK, OLDER };
private ContentObserver mContentObserver;
private ContentResolver mContentResolver;
@ -125,7 +125,7 @@ public class HistoryTab extends AwesomeBarTab {
return mCursorAdapter;
}
private class HistoryListAdapter extends SimpleExpandableListAdapter {
private final class HistoryListAdapter extends SimpleExpandableListAdapter {
public HistoryListAdapter(Context context, List<? extends Map<String, ?>> groupData,
int groupLayout, String[] groupFrom, int[] groupTo,
List<? extends List<? extends Map<String, ?>>> childData) {
@ -157,10 +157,7 @@ public class HistoryTab extends AwesomeBarTab {
if (adapter == null)
return null;
@SuppressWarnings("unchecked")
Map<String,Object> historyItem =
(Map<String,Object>) adapter.getChild(groupPosition, childPosition);
Map historyItem = (Map) adapter.getChild(groupPosition, childPosition);
String title = (String) historyItem.get(URLColumns.TITLE);
String url = (String) historyItem.get(URLColumns.URL);
@ -197,15 +194,16 @@ public class HistoryTab extends AwesomeBarTab {
}
}
private static class GroupList extends LinkedList<Map<String,String>> {
private static final class GroupList extends LinkedList<Map<String,String>> {
private static final long serialVersionUID = 0L;
}
private static class ChildrenList extends LinkedList<Map<String,Object>> {
private static final class ChildrenList extends LinkedList<Map<String,Object>> {
private static final long serialVersionUID = 0L;
}
private class HistoryQueryTask extends AsyncTask<Void, Void, Pair<GroupList,List<ChildrenList>>> {
private final class HistoryQueryTask extends AsyncTask<Void, Void,
Pair<GroupList, List<ChildrenList>>> {
private static final long MS_PER_DAY = 86400000;
private static final long MS_PER_WEEK = MS_PER_DAY * 7;
@ -398,9 +396,7 @@ public class HistoryTab extends AwesomeBarTab {
if (adapter == null)
return false;
@SuppressWarnings("unchecked")
Map<String,Object> historyItem = (Map<String,Object>) adapter.getChild(groupPosition, childPosition);
Map historyItem = (Map) adapter.getChild(groupPosition, childPosition);
String url = (String) historyItem.get(URLColumns.URL);
AwesomeBarTabs.OnUrlOpenListener listener = getUrlListener();
if (!TextUtils.isEmpty(url) && listener != null)
@ -428,7 +424,6 @@ public class HistoryTab extends AwesomeBarTab {
ExpandableListView exList = (ExpandableListView) view;
// The history list is backed by a SimpleExpandableListAdapter
@SuppressWarnings("rawtypes")
Map map = (Map) exList.getExpandableListAdapter().getChild(groupPosition, childPosition);
subject = new AwesomeBar.ContextMenuSubject((Integer) map.get(Combined.HISTORY_ID),
(String) map.get(URLColumns.URL),

View File

@ -22,7 +22,7 @@ import android.provider.Browser;
import android.provider.Browser.BookmarkColumns;
import android.util.Log;
public class AndroidBrowserDB implements BrowserDB.BrowserDBIface {
final class AndroidBrowserDB implements BrowserDB.BrowserDBIface {
private static final String LOGTAG = "AndroidBrowserDB";
private static final String URL_COLUMN_ID = "_id";
private static final String URL_COLUMN_THUMBNAIL = "thumbnail";
@ -392,7 +392,7 @@ public class AndroidBrowserDB implements BrowserDB.BrowserDBIface {
return b;
}
private static class AndroidDBCursor extends CursorWrapper {
private static final class AndroidDBCursor extends CursorWrapper {
public AndroidDBCursor(Cursor c) {
super(c);
}

View File

@ -15,14 +15,14 @@ import org.mozilla.gecko.GeckoProfile;
public class BrowserDB {
public static String ABOUT_PAGES_URL_FILTER = "about:%";
public static interface URLColumns {
public static String URL = "url";
public static String TITLE = "title";
public static String FAVICON = "favicon";
public static String THUMBNAIL = "thumbnail";
public static String DATE_LAST_VISITED = "date-last-visited";
public static String VISITS = "visits";
public static String KEYWORD = "keyword";
public interface URLColumns {
static final String URL = "url";
static final String TITLE = "title";
static final String FAVICON = "favicon";
static final String THUMBNAIL = "thumbnail";
static final String DATE_LAST_VISITED = "date-last-visited";
static final String VISITS = "visits";
static final String KEYWORD = "keyword";
}
private static BrowserDBIface sDb = null;

View File

@ -61,83 +61,83 @@ import android.os.Build;
import android.text.TextUtils;
import android.util.Log;
public class BrowserProvider extends ContentProvider {
public final class BrowserProvider extends ContentProvider {
private static final String LOGTAG = "GeckoBrowserProvider";
private Context mContext;
static final String DATABASE_NAME = "browser.db";
private static final String DATABASE_NAME = "browser.db";
static final int DATABASE_VERSION = 10;
private static final int DATABASE_VERSION = 10;
// Maximum age of deleted records to be cleaned up (20 days in ms)
static final long MAX_AGE_OF_DELETED_RECORDS = 86400000 * 20;
private static final long MAX_AGE_OF_DELETED_RECORDS = 86400000 * 20;
// Number of records marked as deleted to be removed
static final long DELETED_RECORDS_PURGE_LIMIT = 5;
private static final long DELETED_RECORDS_PURGE_LIMIT = 5;
// How many records to reposition in a single query.
// This should be less than the SQLite maximum number of query variables
// (currently 999) divided by the number of variables used per positioning
// query (currently 3).
static final int MAX_POSITION_UPDATES_PER_QUERY = 100;
private static final int MAX_POSITION_UPDATES_PER_QUERY = 100;
static final String TABLE_BOOKMARKS = "bookmarks";
static final String TABLE_HISTORY = "history";
static final String TABLE_IMAGES = "images";
private static final String TABLE_BOOKMARKS = "bookmarks";
private static final String TABLE_HISTORY = "history";
private static final String TABLE_IMAGES = "images";
static final String TABLE_BOOKMARKS_TMP = TABLE_BOOKMARKS + "_tmp";
static final String TABLE_HISTORY_TMP = TABLE_HISTORY + "_tmp";
static final String TABLE_IMAGES_TMP = TABLE_IMAGES + "_tmp";
private static final String TABLE_BOOKMARKS_TMP = TABLE_BOOKMARKS + "_tmp";
private static final String TABLE_HISTORY_TMP = TABLE_HISTORY + "_tmp";
private static final String TABLE_IMAGES_TMP = TABLE_IMAGES + "_tmp";
static final String VIEW_BOOKMARKS_WITH_IMAGES = "bookmarks_with_images";
static final String VIEW_HISTORY_WITH_IMAGES = "history_with_images";
static final String VIEW_COMBINED_WITH_IMAGES = "combined_with_images";
private static final String VIEW_BOOKMARKS_WITH_IMAGES = "bookmarks_with_images";
private static final String VIEW_HISTORY_WITH_IMAGES = "history_with_images";
private static final String VIEW_COMBINED_WITH_IMAGES = "combined_with_images";
// Bookmark matches
static final int BOOKMARKS = 100;
static final int BOOKMARKS_ID = 101;
static final int BOOKMARKS_FOLDER_ID = 102;
static final int BOOKMARKS_PARENT = 103;
static final int BOOKMARKS_POSITIONS = 104;
private static final int BOOKMARKS = 100;
private static final int BOOKMARKS_ID = 101;
private static final int BOOKMARKS_FOLDER_ID = 102;
private static final int BOOKMARKS_PARENT = 103;
private static final int BOOKMARKS_POSITIONS = 104;
// History matches
static final int HISTORY = 200;
static final int HISTORY_ID = 201;
private static final int HISTORY = 200;
private static final int HISTORY_ID = 201;
// Image matches
static final int IMAGES = 300;
static final int IMAGES_ID = 301;
private static final int IMAGES = 300;
private static final int IMAGES_ID = 301;
// Schema matches
static final int SCHEMA = 400;
private static final int SCHEMA = 400;
// Combined bookmarks and history matches
static final int COMBINED = 500;
private static final int COMBINED = 500;
// Control matches
static final int CONTROL = 600;
private static final int CONTROL = 600;
static final String DEFAULT_BOOKMARKS_SORT_ORDER = Bookmarks.TYPE
private static final String DEFAULT_BOOKMARKS_SORT_ORDER = Bookmarks.TYPE
+ " ASC, " + Bookmarks.POSITION + " ASC, " + Bookmarks._ID
+ " ASC";
static final String DEFAULT_HISTORY_SORT_ORDER = History.DATE_LAST_VISITED + " DESC";
private static final String DEFAULT_HISTORY_SORT_ORDER = History.DATE_LAST_VISITED + " DESC";
static final String TABLE_BOOKMARKS_JOIN_IMAGES = TABLE_BOOKMARKS + " LEFT OUTER JOIN " +
private static final String TABLE_BOOKMARKS_JOIN_IMAGES = TABLE_BOOKMARKS + " LEFT OUTER JOIN " +
TABLE_IMAGES + " ON " + qualifyColumn(TABLE_BOOKMARKS, Bookmarks.URL) + " = " +
qualifyColumn(TABLE_IMAGES, Images.URL);
static final String TABLE_HISTORY_JOIN_IMAGES = TABLE_HISTORY + " LEFT OUTER JOIN " +
private static final String TABLE_HISTORY_JOIN_IMAGES = TABLE_HISTORY + " LEFT OUTER JOIN " +
TABLE_IMAGES + " ON " + qualifyColumn(TABLE_HISTORY, History.URL) + " = " +
qualifyColumn(TABLE_IMAGES, Images.URL);
static final UriMatcher URI_MATCHER = new UriMatcher(UriMatcher.NO_MATCH);
private static final UriMatcher URI_MATCHER = new UriMatcher(UriMatcher.NO_MATCH);
static final Map<String, String> BOOKMARKS_PROJECTION_MAP;
static final Map<String, String> HISTORY_PROJECTION_MAP;
static final Map<String, String> IMAGES_PROJECTION_MAP;
static final Map<String, String> COMBINED_PROJECTION_MAP;
static final Map<String, String> SCHEMA_PROJECTION_MAP;
private static final Map<String, String> BOOKMARKS_PROJECTION_MAP;
private static final Map<String, String> HISTORY_PROJECTION_MAP;
private static final Map<String, String> IMAGES_PROJECTION_MAP;
private static final Map<String, String> COMBINED_PROJECTION_MAP;
private static final Map<String, String> SCHEMA_PROJECTION_MAP;
static {
// We will reuse this.
@ -236,7 +236,7 @@ public class BrowserProvider extends ContentProvider {
public void updateForNewTable(ContentValues bookmark);
}
private class BookmarkMigrator3to4 implements BookmarkMigrator {
private static final class BookmarkMigrator3to4 implements BookmarkMigrator {
public void updateForNewTable(ContentValues bookmark) {
Integer isFolder = bookmark.getAsInteger("folder");
if (isFolder == null || isFolder != 1) {
@ -280,7 +280,7 @@ public class BrowserProvider extends ContentProvider {
}
}
final class DatabaseHelper extends SQLiteOpenHelper {
private final class DatabaseHelper extends SQLiteOpenHelper {
public DatabaseHelper(Context context, String databasePath) {
super(context, databasePath, null, DATABASE_VERSION);
}
@ -1327,7 +1327,6 @@ public class BrowserProvider extends ContentProvider {
return deleted;
}
@SuppressWarnings("fallthrough")
public int deleteInTransaction(Uri uri, String selection, String[] selectionArgs) {
trace("Calling delete in transaction on URI: " + uri);
@ -1494,7 +1493,6 @@ public class BrowserProvider extends ContentProvider {
return updated;
}
@SuppressWarnings("fallthrough")
public int updateInTransaction(Uri uri, ContentValues values, String selection,
String[] selectionArgs) {
trace("Calling update in transaction on URI: " + uri);

View File

@ -19,10 +19,10 @@ import java.util.UUID;
import java.util.Random;
public class DBUtils {
public final class DBUtils {
private static final String LOGTAG = "GeckoDBUtils";
public static final String qualifyColumn(String table, String column) {
public static String qualifyColumn(String table, String column) {
return table + "." + column;
}

View File

@ -38,9 +38,9 @@ import android.os.Build;
import android.text.TextUtils;
import android.util.Log;
public class FormHistoryProvider extends GeckoProvider {
static final String TABLE_FORM_HISTORY = "moz_formhistory";
static final String TABLE_DELETED_FORM_HISTORY = "moz_deleted_formhistory";
public final class FormHistoryProvider extends GeckoProvider {
private static final String TABLE_FORM_HISTORY = "moz_formhistory";
private static final String TABLE_DELETED_FORM_HISTORY = "moz_deleted_formhistory";
private static final int FORM_HISTORY = 100;
private static final int DELETED_FORM_HISTORY = 101;

View File

@ -33,7 +33,7 @@ import android.net.Uri;
import android.provider.Browser;
import android.util.Log;
public class LocalBrowserDB implements BrowserDB.BrowserDBIface {
public final class LocalBrowserDB implements BrowserDB.BrowserDBIface {
// Calculate these once, at initialization. isLoggable is too expensive to
// have in-line in each log call.
private static final String LOGTAG = "GeckoLocalBrowserDB";
@ -853,7 +853,7 @@ public class LocalBrowserDB implements BrowserDB.BrowserDBIface {
// This wrapper adds a fake "Desktop Bookmarks" folder entry to the
// beginning of the cursor's data set.
private class SpecialFoldersCursorWrapper extends CursorWrapper {
private static final class SpecialFoldersCursorWrapper extends CursorWrapper {
private int mIndexOffset;
private int mDesktopBookmarksIndex = -1;
@ -942,7 +942,7 @@ public class LocalBrowserDB implements BrowserDB.BrowserDBIface {
}
}
private static class LocalDBCursor extends CursorWrapper {
private static final class LocalDBCursor extends CursorWrapper {
public LocalDBCursor(Cursor c) {
super(c);
}

View File

@ -40,15 +40,15 @@ import android.os.Build;
import android.text.TextUtils;
import android.util.Log;
public class PasswordsProvider extends GeckoProvider {
static final String TABLE_PASSWORDS = "moz_logins";
static final String TABLE_DELETED_PASSWORDS = "moz_deleted_logins";
public final class PasswordsProvider extends GeckoProvider {
private static final String TABLE_PASSWORDS = "moz_logins";
private static final String TABLE_DELETED_PASSWORDS = "moz_deleted_logins";
private static final int PASSWORDS = 100;
private static final int DELETED_PASSWORDS = 101;
static final String DEFAULT_PASSWORDS_SORT_ORDER = Passwords.HOSTNAME + " ASC";
static final String DEFAULT_DELETED_PASSWORDS_SORT_ORDER = DeletedPasswords.TIME_DELETED + " ASC";
private static final String DEFAULT_PASSWORDS_SORT_ORDER = Passwords.HOSTNAME + " ASC";
private static final String DEFAULT_DELETED_PASSWORDS_SORT_ORDER = DeletedPasswords.TIME_DELETED + " ASC";
private static final UriMatcher URI_MATCHER;

View File

@ -36,33 +36,33 @@ import android.os.Build;
import android.text.TextUtils;
import android.util.Log;
public class TabsProvider extends ContentProvider {
public final class TabsProvider extends ContentProvider {
private static final String LOGTAG = "GeckoTabsProvider";
private Context mContext;
static final String DATABASE_NAME = "tabs.db";
private static final String DATABASE_NAME = "tabs.db";
static final int DATABASE_VERSION = 1;
private static final int DATABASE_VERSION = 1;
static final String TABLE_TABS = "tabs";
static final String TABLE_CLIENTS = "clients";
private static final String TABLE_TABS = "tabs";
private static final String TABLE_CLIENTS = "clients";
static final int TABS = 600;
static final int TABS_ID = 601;
static final int CLIENTS = 602;
static final int CLIENTS_ID = 603;
private static final int TABS = 600;
private static final int TABS_ID = 601;
private static final int CLIENTS = 602;
private static final int CLIENTS_ID = 603;
static final String DEFAULT_TABS_SORT_ORDER = Clients.LAST_MODIFIED + " DESC, " + Tabs.LAST_USED + " DESC";
static final String DEFAULT_CLIENTS_SORT_ORDER = Clients.LAST_MODIFIED + " DESC";
private static final String DEFAULT_TABS_SORT_ORDER = Clients.LAST_MODIFIED + " DESC, " + Tabs.LAST_USED + " DESC";
private static final String DEFAULT_CLIENTS_SORT_ORDER = Clients.LAST_MODIFIED + " DESC";
static final String INDEX_TABS_GUID = "tabs_guid_index";
static final String INDEX_TABS_POSITION = "tabs_position_index";
static final String INDEX_CLIENTS_GUID = "clients_guid_index";
private static final String INDEX_TABS_GUID = "tabs_guid_index";
private static final String INDEX_TABS_POSITION = "tabs_position_index";
private static final String INDEX_CLIENTS_GUID = "clients_guid_index";
static final UriMatcher URI_MATCHER = new UriMatcher(UriMatcher.NO_MATCH);
private static final UriMatcher URI_MATCHER = new UriMatcher(UriMatcher.NO_MATCH);
static final Map<String, String> TABS_PROJECTION_MAP;
static final Map<String, String> CLIENTS_PROJECTION_MAP;
private static final Map<String, String> TABS_PROJECTION_MAP;
private static final Map<String, String> CLIENTS_PROJECTION_MAP;
static {
URI_MATCHER.addURI(BrowserContract.TABS_AUTHORITY, "tabs", TABS);
@ -94,7 +94,7 @@ public class TabsProvider extends ContentProvider {
private HashMap<String, DatabaseHelper> mDatabasePerProfile;
static final String selectColumn(String table, String column) {
private static final String selectColumn(String table, String column) {
return table + "." + column + " = ?";
}
@ -114,7 +114,7 @@ public class TabsProvider extends ContentProvider {
}
}
final class DatabaseHelper extends SQLiteOpenHelper {
private static final class DatabaseHelper extends SQLiteOpenHelper {
public DatabaseHelper(Context context, String databasePath) {
super(context, databasePath, null, DATABASE_VERSION);
}
@ -348,7 +348,6 @@ public class TabsProvider extends ContentProvider {
return deleted;
}
@SuppressWarnings("fallthrough")
public int deleteInTransaction(Uri uri, String selection, String[] selectionArgs) {
trace("Calling delete in transaction on URI: " + uri);
@ -516,7 +515,6 @@ public class TabsProvider extends ContentProvider {
}
@Override
@SuppressWarnings("fallthrough")
public Cursor query(Uri uri, String[] projection, String selection,
String[] selectionArgs, String sortOrder) {
SQLiteDatabase db = getReadableDatabase(uri);

View File

@ -11,6 +11,8 @@ import java.lang.Math;
import android.util.Log;
public final class BitmapUtils {
private BitmapUtils() {}
public static int getDominantColor(Bitmap source) {
int[] colors = new int[37];
int[] sat = new int[11];
@ -55,4 +57,3 @@ public final class BitmapUtils {
return Color.HSVToColor(hsv);
}
}

View File

@ -12,7 +12,7 @@ import android.graphics.Bitmap;
import java.nio.ByteBuffer;
/** A Cairo image that simply saves a buffer of pixel data. */
public class BufferedCairoImage extends CairoImage {
public final class BufferedCairoImage extends CairoImage {
private ByteBuffer mBuffer;
private IntSize mSize;
private int mFormat;
@ -68,4 +68,3 @@ public class BufferedCairoImage extends CairoImage {
bitmap.copyPixelsToBuffer(mBuffer.asIntBuffer());
}
}

View File

@ -8,7 +8,7 @@ package org.mozilla.gecko.gfx;
import javax.microedition.khronos.opengles.GL10;
/** Information needed to render Cairo bitmaps using OpenGL ES. */
public class CairoGLInfo {
final class CairoGLInfo {
public final int internalFormat;
public final int format;
public final int type;
@ -32,4 +32,3 @@ public class CairoGLInfo {
}
}
}

View File

@ -23,4 +23,3 @@ public abstract class CairoImage {
public static final int FORMAT_A1 = 3;
public static final int FORMAT_RGB16_565 = 4;
}

View File

@ -12,7 +12,7 @@ import javax.microedition.khronos.opengles.GL10;
/**
* Utility methods useful when displaying Cairo bitmaps using OpenGL ES.
*/
public class CairoUtils {
final class CairoUtils {
private CairoUtils() { /* Don't call me. */ }
public static int bitsPerPixelForCairoFormat(int cairoFormat) {
@ -50,4 +50,3 @@ public class CairoUtils {
}
}
}

View File

@ -12,7 +12,7 @@ import java.nio.ShortBuffer;
import java.util.Arrays;
/** A Cairo image that displays a tinted checkerboard. */
public class CheckerboardImage extends CairoImage {
final class CheckerboardImage extends CairoImage {
// The width and height of the checkerboard tile.
private static final int SIZE = 16;
// The pixel format of the checkerboard tile.
@ -136,4 +136,3 @@ public class CheckerboardImage extends CairoImage {
return FORMAT;
}
}

View File

@ -221,7 +221,7 @@ final class DisplayPortCalculator {
/**
* This class implements the variation where we basically don't bother with a a display port.
*/
private static class NoMarginStrategy extends DisplayPortStrategy {
private static final class NoMarginStrategy extends DisplayPortStrategy {
NoMarginStrategy(Map<String, Integer> prefs) {
// no prefs in this strategy
}
@ -252,7 +252,7 @@ final class DisplayPortCalculator {
* and/or (b) increasing the buffer on the other axis to compensate for the reduced buffer on
* one axis.
*/
private static class FixedMarginStrategy extends DisplayPortStrategy {
private static final class FixedMarginStrategy extends DisplayPortStrategy {
// The length of each axis of the display port will be the corresponding view length
// multiplied by this factor.
private final float SIZE_MULTIPLIER;
@ -318,7 +318,7 @@ final class DisplayPortCalculator {
* so that it is almost entirely in the direction of the pan, with a little bit in the
* reverse direction.
*/
private static class VelocityBiasStrategy extends DisplayPortStrategy {
private static final class VelocityBiasStrategy extends DisplayPortStrategy {
// The length of each axis of the display port will be the corresponding view length
// multiplied by this factor.
private final float SIZE_MULTIPLIER;
@ -444,7 +444,7 @@ final class DisplayPortCalculator {
* looks blurry. The assumption is that drawing extra that we never display is better than checkerboarding,
* where we draw less but never even show it on the screen.
*/
private static class DynamicResolutionStrategy extends DisplayPortStrategy {
private static final class DynamicResolutionStrategy extends DisplayPortStrategy {
// The length of each axis of the display port will be the corresponding view length
// multiplied by this factor.
private static final float SIZE_MULTIPLIER = 1.5f;
@ -644,7 +644,7 @@ final class DisplayPortCalculator {
* the panning velocity; unexpected changes in either of these values will cause the heuristic to
* fail and show checkerboard.
*/
private static class PredictionBiasStrategy extends DisplayPortStrategy {
private static final class PredictionBiasStrategy extends DisplayPortStrategy {
private static float VELOCITY_THRESHOLD;
private int mPixelArea; // area of the viewport, used in draw time calculations

View File

@ -9,7 +9,7 @@ import org.mozilla.gecko.FloatUtils;
import org.json.JSONException;
import org.json.JSONObject;
public class FloatSize {
public final class FloatSize {
public final float width, height;
public FloatSize(FloatSize size) { width = size.width; height = size.height; }

View File

@ -14,7 +14,7 @@ import javax.microedition.khronos.egl.EGLContext;
import javax.microedition.khronos.egl.EGLDisplay;
import javax.microedition.khronos.egl.EGLSurface;
public class GLController {
public final class GLController {
private static final int EGL_CONTEXT_CLIENT_VERSION = 0x3098;
private static final String LOGTAG = "GeckoGLController";
@ -191,4 +191,3 @@ public class GLController {
}
}
}

View File

@ -28,7 +28,7 @@ import android.view.View;
import java.util.Map;
import java.util.HashMap;
public class GeckoLayerClient implements GeckoEventResponder,
public final class GeckoLayerClient implements GeckoEventResponder,
LayerView.Listener {
private static final String LOGTAG = "GeckoLayerClient";
@ -501,4 +501,3 @@ public class GeckoLayerClient implements GeckoEventResponder,
public void drawFinished();
}
}

View File

@ -15,7 +15,7 @@ import javax.microedition.khronos.egl.EGLDisplay;
import javax.microedition.khronos.egl.EGLSurface;
import android.opengl.GLES20;
public class GfxInfoThread extends Thread {
public final class GfxInfoThread extends Thread {
private static final String LOGTAG = "GfxInfoThread";

View File

@ -13,7 +13,7 @@ import android.graphics.RectF;
* in way that we can access a version of them from multiple threads
* without having to take a lock
*/
public class ImmutableViewportMetrics {
public final class ImmutableViewportMetrics {
// We need to flatten the RectF and FloatSize structures
// because Java doesn't have the concept of const classes

View File

@ -10,7 +10,7 @@ import org.json.JSONException;
import org.json.JSONObject;
import java.lang.Math;
public class IntSize {
public final class IntSize {
public final int width, height;
public IntSize(IntSize size) { width = size.width; height = size.height; }
@ -78,4 +78,3 @@ public class IntSize {
return (value & (value - 1)) == 0;
}
}

View File

@ -153,7 +153,7 @@ public abstract class Layer {
}
}
public static class RenderContext {
public static final class RenderContext {
public final RectF viewport;
public final RectF pageRect;
public final float zoomFactor;
@ -181,4 +181,3 @@ public abstract class Layer {
}
}
}

View File

@ -26,7 +26,7 @@ import android.view.View.OnTouchListener;
*
* Many methods require that the monitor be held, with a synchronized (controller) { ... } block.
*/
public class LayerController {
public final class LayerController {
private static final String LOGTAG = "GeckoLayerController";
private Layer mRootLayer; /* The root layer. */

View File

@ -42,7 +42,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
/**
* The layer renderer implements the rendering logic for a layer view.
*/
public class LayerRenderer {
public final class LayerRenderer {
private static final String LOGTAG = "GeckoLayerRenderer";
private static final String PROFTAG = "GeckoLayerRendererProf";
@ -380,7 +380,7 @@ public class LayerRenderer {
return new Frame(metrics);
}
class FadeRunnable implements Runnable {
private final class FadeRunnable implements Runnable {
private boolean mStarted;
private long mRunAt;
@ -416,7 +416,7 @@ public class LayerRenderer {
}
}
public class Frame {
public final class Frame {
// The timestamp recording the start of this frame.
private long mFrameStartTime;
// A fixed snapshot of the viewport metrics that this frame is using to render content.

View File

@ -39,8 +39,8 @@ import javax.microedition.khronos.opengles.GL10;
*
* Note that LayerView is accessed by Robocop via reflection.
*/
public class LayerView extends SurfaceView implements SurfaceHolder.Callback {
private static String LOGTAG = "GeckoLayerView";
public final class LayerView extends SurfaceView implements SurfaceHolder.Callback {
private static final String LOGTAG = "GeckoLayerView";
private Context mContext;
private LayerController mController;
@ -254,6 +254,4 @@ public class LayerView extends SurfaceView implements SurfaceHolder.Callback {
void compositionResumeRequested(int width, int height);
void surfaceChanged(int width, int height);
}
}

View File

@ -19,7 +19,7 @@ import android.opengl.GLES20;
* For more information on nine-patch bitmaps, see the following document:
* http://developer.android.com/guide/topics/graphics/2d-graphics.html#nine-patch
*/
public class NinePatchTileLayer extends TileLayer {
final class NinePatchTileLayer extends TileLayer {
private static final int PATCH_SIZE = 16;
private static final int TEXTURE_SIZE = 64;

View File

@ -10,7 +10,7 @@ import java.util.List;
import android.os.SystemClock;
import android.util.Log;
public class PanningPerfAPI {
final class PanningPerfAPI {
private static final String LOGTAG = "GeckoPanningPerfAPI";
// make this large enough to avoid having to resize the frame time

View File

@ -24,7 +24,7 @@ import org.mozilla.gecko.SurfaceBits;
import org.mozilla.gecko.GeckoApp;
import org.mozilla.gecko.GeckoAppShell;
public class PluginLayer extends TileLayer
public final class PluginLayer extends TileLayer
{
private static final String LOGTAG = "PluginLayer";
private static final String PREF_PLUGIN_USE_PLACEHOLDER = "plugins.use_placeholder";
@ -270,7 +270,7 @@ public class PluginLayer extends TileLayer
GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, 0, 4);
}
class PluginLayoutParams extends AbsoluteLayout.LayoutParams
private static final class PluginLayoutParams extends AbsoluteLayout.LayoutParams
{
private static final String LOGTAG = "GeckoApp.PluginLayoutParams";
@ -318,7 +318,7 @@ public class PluginLayer extends TileLayer
}
}
class ShowViewRunnable implements Runnable {
private static final class ShowViewRunnable implements Runnable {
private PluginLayer mLayer;

Some files were not shown because too many files have changed in this diff Show More