зеркало из https://github.com/mozilla/gecko-dev.git
Bug 703059 - Fixup log tag strings [r=mfinkle]
Standardize on "Gecko" + filename as the log tag for each file. Strip "Gecko" from the front of the filename if it already starts with "Gecko". This allows grepping for either the filename or Gecko in logcat output.
This commit is contained in:
Родитель
5e053ea2f7
Коммит
7938926a66
|
@ -50,6 +50,8 @@ import java.text.NumberFormat;
|
|||
public class AlertNotification
|
||||
extends Notification
|
||||
{
|
||||
private static final String LOGTAG = "GeckoAlertNotification";
|
||||
|
||||
private final int mId;
|
||||
private final int mIcon;
|
||||
private final String mTitle;
|
||||
|
@ -101,7 +103,7 @@ public class AlertNotification
|
|||
contentView = view;
|
||||
mNotificationManager.notify(mId, this);
|
||||
} catch(Exception ex) {
|
||||
Log.e("GeckoAlert", "failed to create bitmap", ex);
|
||||
Log.e(LOGTAG, "failed to create bitmap", ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -57,14 +57,14 @@ import android.view.inputmethod.InputMethodManager;
|
|||
import android.widget.EditText;
|
||||
|
||||
public class AwesomeBar extends Activity {
|
||||
private static final String LOGTAG = "GeckoAwesomeBar";
|
||||
|
||||
static final String URL_KEY = "url";
|
||||
static final String TITLE_KEY = "title";
|
||||
static final String CURRENT_URL_KEY = "currenturl";
|
||||
static final String TYPE_KEY = "type";
|
||||
static enum Type { ADD, EDIT };
|
||||
|
||||
private static final String LOG_NAME = "AwesomeBar";
|
||||
|
||||
private String mType;
|
||||
private AwesomeBarTabs mAwesomeTabs;
|
||||
private EditText mText;
|
||||
|
@ -73,7 +73,7 @@ public class AwesomeBar extends Activity {
|
|||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
Log.d(LOG_NAME, "creating awesomebar");
|
||||
Log.d(LOGTAG, "creating awesomebar");
|
||||
|
||||
requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
setContentView(R.layout.awesomebar_search);
|
||||
|
|
|
@ -75,14 +75,14 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
|
||||
public class AwesomeBarTabs extends TabHost {
|
||||
private static final String LOGTAG = "GeckoAwesomeBarTabs";
|
||||
|
||||
private static final String ALL_PAGES_TAB = "all";
|
||||
private static final String BOOKMARKS_TAB = "bookmarks";
|
||||
private static final String HISTORY_TAB = "history";
|
||||
|
||||
private static enum HistorySection { TODAY, YESTERDAY, WEEK, OLDER };
|
||||
|
||||
private static final String LOG_NAME = "AwesomeBarTabs";
|
||||
|
||||
private Context mContext;
|
||||
private OnUrlOpenListener mUrlOpenListener;
|
||||
private View.OnTouchListener mListTouchListener;
|
||||
|
@ -416,7 +416,7 @@ public class AwesomeBarTabs extends TabHost {
|
|||
public AwesomeBarTabs(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
|
||||
Log.d(LOG_NAME, "Creating AwesomeBarTabs");
|
||||
Log.d(LOGTAG, "Creating AwesomeBarTabs");
|
||||
|
||||
mContext = context;
|
||||
|
||||
|
@ -484,7 +484,7 @@ public class AwesomeBarTabs extends TabHost {
|
|||
}
|
||||
|
||||
private void addAllPagesTab() {
|
||||
Log.d(LOG_NAME, "Creating All Pages tab");
|
||||
Log.d(LOGTAG, "Creating All Pages tab");
|
||||
|
||||
addAwesomeTab(ALL_PAGES_TAB,
|
||||
R.string.awesomebar_all_pages_title,
|
||||
|
@ -535,7 +535,7 @@ public class AwesomeBarTabs extends TabHost {
|
|||
}
|
||||
|
||||
private void addBookmarksTab() {
|
||||
Log.d(LOG_NAME, "Creating Bookmarks tab");
|
||||
Log.d(LOGTAG, "Creating Bookmarks tab");
|
||||
|
||||
addAwesomeTab(BOOKMARKS_TAB,
|
||||
R.string.awesomebar_bookmarks_title,
|
||||
|
@ -549,7 +549,7 @@ public class AwesomeBarTabs extends TabHost {
|
|||
}
|
||||
|
||||
private void addHistoryTab() {
|
||||
Log.d(LOG_NAME, "Creating History tab");
|
||||
Log.d(LOGTAG, "Creating History tab");
|
||||
|
||||
addAwesomeTab(HISTORY_TAB,
|
||||
R.string.awesomebar_history_title,
|
||||
|
|
|
@ -44,6 +44,8 @@ import android.util.AttributeSet;
|
|||
import android.util.Log;
|
||||
|
||||
class ConfirmPreference extends DialogPreference {
|
||||
private static final String LOGTAG = "GeckoConfirmPreference";
|
||||
|
||||
private String mAction = null;
|
||||
private Context mContext = null;
|
||||
public ConfirmPreference(Context context, AttributeSet attrs) {
|
||||
|
@ -72,6 +74,6 @@ class ConfirmPreference extends DialogPreference {
|
|||
}
|
||||
});
|
||||
}
|
||||
Log.i("GeckoPref", "action: " + mAction);
|
||||
Log.i(LOGTAG, "action: " + mAction);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -68,6 +68,8 @@ import org.mozilla.gecko.R;
|
|||
|
||||
public class CrashReporter extends Activity
|
||||
{
|
||||
private static final String LOGTAG = "GeckoCrashReporter";
|
||||
|
||||
private static final String PASSED_MINI_DUMP_KEY = "minidumpPath";
|
||||
private static final String MINI_DUMP_PATH_KEY = "upload_file_minidump";
|
||||
private static final String PAGE_URL_KEY = "URL";
|
||||
|
@ -78,8 +80,6 @@ public class CrashReporter extends Activity
|
|||
private static final String PENDING_DIR = CRASH_REPORT_DIR + "pending";
|
||||
private static final String SUBMITTED_DIR = CRASH_REPORT_DIR + "submitted";
|
||||
|
||||
private static final String LOG_NAME = "GeckoCrashReporter";
|
||||
|
||||
private Handler mHandler;
|
||||
private ProgressDialog mProgressDialog;
|
||||
private File mPendingMinidumpFile;
|
||||
|
@ -87,12 +87,12 @@ public class CrashReporter extends Activity
|
|||
private HashMap<String, String> mExtrasStringMap;
|
||||
|
||||
private boolean moveFile(File inFile, File outFile) {
|
||||
Log.i(LOG_NAME, "moving " + inFile + " to " + outFile);
|
||||
Log.i(LOGTAG, "moving " + inFile + " to " + outFile);
|
||||
if (inFile.renameTo(outFile))
|
||||
return true;
|
||||
try {
|
||||
outFile.createNewFile();
|
||||
Log.i(LOG_NAME, "couldn't rename minidump file");
|
||||
Log.i(LOGTAG, "couldn't rename minidump file");
|
||||
// so copy it instead
|
||||
FileChannel inChannel = new FileInputStream(inFile).getChannel();
|
||||
FileChannel outChannel = new FileOutputStream(outFile).getChannel();
|
||||
|
@ -103,7 +103,7 @@ public class CrashReporter extends Activity
|
|||
if (transferred > 0)
|
||||
inFile.delete();
|
||||
} catch (Exception e) {
|
||||
Log.e(LOG_NAME, "exception while copying minidump file: ", e);
|
||||
Log.e(LOGTAG, "exception while copying minidump file: ", e);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
@ -180,7 +180,7 @@ public class CrashReporter extends Activity
|
|||
BufferedReader reader = new BufferedReader(new FileReader(filePath));
|
||||
return readStringsFromReader(reader, stringMap);
|
||||
} catch (Exception e) {
|
||||
Log.e(LOG_NAME, "exception while reading strings: ", e);
|
||||
Log.e(LOGTAG, "exception while reading strings: ", e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -214,7 +214,7 @@ public class CrashReporter extends Activity
|
|||
data + "\r\n"
|
||||
).getBytes());
|
||||
} catch (Exception ex) {
|
||||
Log.e(LOG_NAME, "Exception when sending \"" + name + "\"", ex);
|
||||
Log.e(LOGTAG, "Exception when sending \"" + name + "\"", ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -231,14 +231,14 @@ public class CrashReporter extends Activity
|
|||
}
|
||||
|
||||
private void sendReport(File minidumpFile, Map<String, String> extras, File extrasFile) {
|
||||
Log.i(LOG_NAME, "sendReport: " + minidumpFile.getPath());
|
||||
Log.i(LOGTAG, "sendReport: " + minidumpFile.getPath());
|
||||
final CheckBox includeURLCheckbox = (CheckBox) findViewById(R.id.include_url);
|
||||
|
||||
String spec = extras.get(SERVER_URL_KEY);
|
||||
if (spec == null)
|
||||
doFinish();
|
||||
|
||||
Log.i(LOG_NAME, "server url: " + spec);
|
||||
Log.i(LOGTAG, "server url: " + spec);
|
||||
try {
|
||||
URL url = new URL(spec);
|
||||
HttpURLConnection conn = (HttpURLConnection)url.openConnection();
|
||||
|
@ -282,7 +282,7 @@ public class CrashReporter extends Activity
|
|||
sendPart(os, boundary, "Android_CPU_ABI2", Build.CPU_ABI2);
|
||||
sendPart(os, boundary, "Android_Hardware", Build.HARDWARE);
|
||||
} catch (Exception ex) {
|
||||
Log.e(LOG_NAME, "Exception while sending SDK version 8 keys", ex);
|
||||
Log.e(LOGTAG, "Exception while sending SDK version 8 keys", ex);
|
||||
}
|
||||
}
|
||||
sendPart(os, boundary, "Android_Version", Build.VERSION.SDK_INT + " (" + Build.VERSION.CODENAME + ")");
|
||||
|
@ -309,7 +309,7 @@ public class CrashReporter extends Activity
|
|||
fos.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
Log.e(LOG_NAME, "exception during send: ", e);
|
||||
Log.e(LOGTAG, "exception during send: ", e);
|
||||
}
|
||||
|
||||
doFinish();
|
||||
|
@ -321,10 +321,10 @@ public class CrashReporter extends Activity
|
|||
Intent intent = new Intent(action);
|
||||
intent.setClassName("@ANDROID_PACKAGE_NAME@",
|
||||
"@ANDROID_PACKAGE_NAME@.App");
|
||||
Log.i(LOG_NAME, intent.toString());
|
||||
Log.i(LOGTAG, intent.toString());
|
||||
startActivity(intent);
|
||||
} catch (Exception e) {
|
||||
Log.e(LOG_NAME, "error while trying to restart", e);
|
||||
Log.e(LOGTAG, "error while trying to restart", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -56,6 +56,8 @@ import org.json.JSONObject;
|
|||
import org.json.JSONException;
|
||||
|
||||
public class DoorHangerPopup extends PopupWindow {
|
||||
private static final String LOGTAG = "GeckoDoorHangerPopup";
|
||||
|
||||
private Context mContext;
|
||||
private LinearLayout mContent;
|
||||
|
||||
|
@ -76,7 +78,7 @@ public class DoorHangerPopup extends PopupWindow {
|
|||
|
||||
public void addDoorHanger(String message, String value, JSONArray buttons,
|
||||
Tab tab, JSONObject options) {
|
||||
Log.i("DoorHangerPopup", "Adding a DoorHanger to Tab: " + tab.getId());
|
||||
Log.i(LOGTAG, "Adding a DoorHanger to Tab: " + tab.getId());
|
||||
|
||||
// Replace the doorhanger if it already exists
|
||||
DoorHanger dh = tab.getDoorHanger(value);
|
||||
|
@ -94,7 +96,7 @@ public class DoorHangerPopup extends PopupWindow {
|
|||
int callBackId = buttonObject.getInt("callback");
|
||||
dh.addButton(label, callBackId);
|
||||
} catch (JSONException e) {
|
||||
Log.i("DoorHangerPopup", "JSON throws " + e);
|
||||
Log.i(LOGTAG, "JSON throws " + e);
|
||||
}
|
||||
}
|
||||
dh.setOptions(options);
|
||||
|
@ -109,7 +111,7 @@ public class DoorHangerPopup extends PopupWindow {
|
|||
// Updates popup contents to show doorhangers for the selected tab
|
||||
public void updatePopup() {
|
||||
Tab tab = Tabs.getInstance().getSelectedTab();
|
||||
Log.i("DoorHangerPopup", "Showing all doorhangers for tab: " + tab.getId());
|
||||
Log.i(LOGTAG, "Showing all doorhangers for tab: " + tab.getId());
|
||||
|
||||
HashMap<String, DoorHanger> doorHangers = tab.getDoorHangers();
|
||||
// Hide the popup if there aren't any doorhangers to show
|
||||
|
@ -134,13 +136,13 @@ public class DoorHangerPopup extends PopupWindow {
|
|||
|
||||
public void hidePopup() {
|
||||
if (isShowing()) {
|
||||
Log.i("DoorHangerPopup", "Hiding the DoorHangerPopup");
|
||||
Log.i(LOGTAG, "Hiding the DoorHangerPopup");
|
||||
dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
public void showPopup() {
|
||||
Log.i("DoorHangerPopup", "Showing the DoorHangerPopup");
|
||||
Log.i(LOGTAG, "Showing the DoorHangerPopup");
|
||||
fixBackgroundForFirst();
|
||||
|
||||
if (isShowing())
|
||||
|
|
|
@ -60,7 +60,7 @@ import java.net.URL;
|
|||
import java.util.HashMap;
|
||||
|
||||
public class Favicons {
|
||||
private static final String LOG_NAME = "Favicons";
|
||||
private static final String LOGTAG = "GeckoFavicons";
|
||||
|
||||
private Context mContext;
|
||||
private DatabaseHelper mDbHelper;
|
||||
|
@ -80,12 +80,12 @@ public class Favicons {
|
|||
|
||||
DatabaseHelper(Context context) {
|
||||
super(context, DATABASE_NAME, null, DATABASE_VERSION);
|
||||
Log.d(LOG_NAME, "Creating DatabaseHelper");
|
||||
Log.d(LOGTAG, "Creating DatabaseHelper");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(SQLiteDatabase db) {
|
||||
Log.d(LOG_NAME, "Creating database for favicon URLs");
|
||||
Log.d(LOGTAG, "Creating database for favicon URLs");
|
||||
|
||||
db.execSQL("CREATE TABLE " + TABLE_NAME + " (" +
|
||||
COLUMN_ID + " INTEGER PRIMARY KEY," +
|
||||
|
@ -96,7 +96,7 @@ public class Favicons {
|
|||
|
||||
@Override
|
||||
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
|
||||
Log.w(LOG_NAME, "Upgrading favicon URLs database from version " +
|
||||
Log.w(LOGTAG, "Upgrading favicon URLs database from version " +
|
||||
oldVersion + " to " + newVersion + ", which will destroy all old data");
|
||||
|
||||
// Drop table completely
|
||||
|
@ -107,7 +107,7 @@ public class Favicons {
|
|||
}
|
||||
|
||||
public String getFaviconUrlForPageUrl(String pageUrl) {
|
||||
Log.d(LOG_NAME, "Calling getFaviconUrlForPageUrl() for " + pageUrl);
|
||||
Log.d(LOGTAG, "Calling getFaviconUrlForPageUrl() for " + pageUrl);
|
||||
|
||||
SQLiteDatabase db = mDbHelper.getReadableDatabase();
|
||||
|
||||
|
@ -131,7 +131,7 @@ public class Favicons {
|
|||
}
|
||||
|
||||
public void setFaviconUrlForPageUrl(String pageUrl, String faviconUrl) {
|
||||
Log.d(LOG_NAME, "Calling setFaviconUrlForPageUrl() for " + pageUrl);
|
||||
Log.d(LOGTAG, "Calling setFaviconUrlForPageUrl() for " + pageUrl);
|
||||
|
||||
SQLiteDatabase db = mDbHelper.getWritableDatabase();
|
||||
|
||||
|
@ -144,7 +144,7 @@ public class Favicons {
|
|||
}
|
||||
|
||||
public Favicons(Context context) {
|
||||
Log.d(LOG_NAME, "Creating Favicons instance");
|
||||
Log.d(LOGTAG, "Creating Favicons instance");
|
||||
|
||||
mContext = context;
|
||||
mDbHelper = new DatabaseHelper(context);
|
||||
|
@ -153,7 +153,7 @@ public class Favicons {
|
|||
public void loadFavicon(String pageUrl, String faviconUrl,
|
||||
OnFaviconLoadedListener listener) {
|
||||
|
||||
Log.d(LOG_NAME, "Calling loadFavicon() with URL = " + pageUrl +
|
||||
Log.d(LOGTAG, "Calling loadFavicon() with URL = " + pageUrl +
|
||||
" and favicon URL = " + faviconUrl);
|
||||
|
||||
// Handle the case where page url is empty
|
||||
|
@ -166,7 +166,7 @@ public class Favicons {
|
|||
}
|
||||
|
||||
public void close() {
|
||||
Log.d(LOG_NAME, "Closing Favicons database");
|
||||
Log.d(LOGTAG, "Closing Favicons database");
|
||||
mDbHelper.close();
|
||||
}
|
||||
|
||||
|
@ -180,13 +180,13 @@ public class Favicons {
|
|||
mFaviconUrl = faviconUrl;
|
||||
mListener = listener;
|
||||
|
||||
Log.d(LOG_NAME, "Creating LoadFaviconTask with URL = " + pageUrl +
|
||||
Log.d(LOGTAG, "Creating LoadFaviconTask with URL = " + pageUrl +
|
||||
" and favicon URL = " + faviconUrl);
|
||||
}
|
||||
|
||||
// Runs in background thread
|
||||
private BitmapDrawable loadFaviconFromDb() {
|
||||
Log.d(LOG_NAME, "Loading favicon from DB for URL = " + mPageUrl);
|
||||
Log.d(LOGTAG, "Loading favicon from DB for URL = " + mPageUrl);
|
||||
|
||||
ContentResolver resolver = mContext.getContentResolver();
|
||||
|
||||
|
@ -210,7 +210,7 @@ public class Favicons {
|
|||
|
||||
Bitmap bitmap = BitmapFactory.decodeByteArray(b, 0, b.length);
|
||||
|
||||
Log.d(LOG_NAME, "Loaded favicon from DB successfully for URL = " + mPageUrl);
|
||||
Log.d(LOGTAG, "Loaded favicon from DB successfully for URL = " + mPageUrl);
|
||||
|
||||
return new BitmapDrawable(bitmap);
|
||||
}
|
||||
|
@ -228,20 +228,20 @@ public class Favicons {
|
|||
|
||||
ContentResolver resolver = mContext.getContentResolver();
|
||||
|
||||
Log.d(LOG_NAME, "Saving favicon on browser database for URL = " + mPageUrl);
|
||||
Log.d(LOGTAG, "Saving favicon on browser database for URL = " + mPageUrl);
|
||||
resolver.update(Browser.BOOKMARKS_URI,
|
||||
values,
|
||||
Browser.BookmarkColumns.URL + " = ?",
|
||||
new String[] { mPageUrl });
|
||||
|
||||
|
||||
Log.d(LOG_NAME, "Saving favicon URL for URL = " + mPageUrl);
|
||||
Log.d(LOGTAG, "Saving favicon URL for URL = " + mPageUrl);
|
||||
mDbHelper.setFaviconUrlForPageUrl(mPageUrl, mFaviconUrl);
|
||||
}
|
||||
|
||||
// Runs in background thread
|
||||
private BitmapDrawable downloadFavicon(URL faviconUrl) {
|
||||
Log.d(LOG_NAME, "Downloading favicon for URL = " + mPageUrl +
|
||||
Log.d(LOGTAG, "Downloading favicon for URL = " + mPageUrl +
|
||||
" with favicon URL = " + mFaviconUrl);
|
||||
|
||||
BitmapDrawable image = null;
|
||||
|
@ -250,11 +250,11 @@ public class Favicons {
|
|||
InputStream is = (InputStream) faviconUrl.getContent();
|
||||
image = (BitmapDrawable) Drawable.createFromStream(is, "src");
|
||||
} catch (IOException e) {
|
||||
Log.d(LOG_NAME, "Error downloading favicon: " + e);
|
||||
Log.d(LOGTAG, "Error downloading favicon: " + e);
|
||||
}
|
||||
|
||||
if (image != null) {
|
||||
Log.d(LOG_NAME, "Downloaded favicon successfully for URL = " + mPageUrl);
|
||||
Log.d(LOGTAG, "Downloaded favicon successfully for URL = " + mPageUrl);
|
||||
saveFaviconToDb(image);
|
||||
}
|
||||
|
||||
|
@ -270,7 +270,7 @@ public class Favicons {
|
|||
try {
|
||||
pageUrl = new URL(mPageUrl);
|
||||
} catch (MalformedURLException e) {
|
||||
Log.d(LOG_NAME, "The provided URL is not valid: " + e);
|
||||
Log.d(LOGTAG, "The provided URL is not valid: " + e);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -286,11 +286,11 @@ public class Favicons {
|
|||
faviconUrl = new URL(mFaviconUrl);
|
||||
}
|
||||
} catch (MalformedURLException e) {
|
||||
Log.d(LOG_NAME, "The provided favicon URL is not valid: " + e);
|
||||
Log.d(LOGTAG, "The provided favicon URL is not valid: " + e);
|
||||
return null;
|
||||
}
|
||||
|
||||
Log.d(LOG_NAME, "Favicon URL is now: " + mFaviconUrl);
|
||||
Log.d(LOGTAG, "Favicon URL is now: " + mFaviconUrl);
|
||||
|
||||
String storedFaviconUrl = mDbHelper.getFaviconUrlForPageUrl(mPageUrl);
|
||||
if (storedFaviconUrl != null && storedFaviconUrl.equals(mFaviconUrl)) {
|
||||
|
@ -310,7 +310,7 @@ public class Favicons {
|
|||
|
||||
@Override
|
||||
protected void onPostExecute(BitmapDrawable image) {
|
||||
Log.d(LOG_NAME, "LoadFaviconTask finished for URL = " + mPageUrl);
|
||||
Log.d(LOGTAG, "LoadFaviconTask finished for URL = " + mPageUrl);
|
||||
|
||||
if (mListener != null)
|
||||
mListener.onFaviconLoaded(mPageUrl, image);
|
||||
|
|
|
@ -89,7 +89,7 @@ import dalvik.system.*;
|
|||
abstract public class GeckoApp
|
||||
extends Activity implements GeckoEventListener, SensorEventListener, LocationListener
|
||||
{
|
||||
private static final String LOG_NAME = "GeckoApp";
|
||||
private static final String LOGTAG = "GeckoApp";
|
||||
|
||||
public static final String ACTION_ALERT_CLICK = "org.mozilla.gecko.ACTION_ALERT_CLICK";
|
||||
public static final String ACTION_ALERT_CLEAR = "org.mozilla.gecko.ACTION_ALERT_CLEAR";
|
||||
|
@ -131,7 +131,7 @@ abstract public class GeckoApp
|
|||
String icon;
|
||||
int id;
|
||||
public boolean onMenuItemClick(MenuItem item) {
|
||||
Log.i("GeckoJSMenu", "menu item clicked");
|
||||
Log.i(LOGTAG, "menu item clicked");
|
||||
GeckoAppShell.sendEventToGecko(new GeckoEvent("Menu:Clicked", Integer.toString(id)));
|
||||
return true;
|
||||
}
|
||||
|
@ -195,8 +195,6 @@ abstract public class GeckoApp
|
|||
*/
|
||||
public static final String PLUGIN_PERMISSION = "android.webkit.permission.PLUGIN";
|
||||
|
||||
private static final String LOGTAG = "PluginManager";
|
||||
|
||||
private static final String PLUGIN_SYSTEM_LIB = "/system/lib/plugins/";
|
||||
|
||||
private static final String PLUGIN_TYPE = "type";
|
||||
|
@ -389,7 +387,7 @@ abstract public class GeckoApp
|
|||
Drawable drawable = Drawable.createFromStream(is, "src");
|
||||
mi.setIcon(drawable);
|
||||
} catch(Exception e) {
|
||||
Log.e("Gecko", "onPrepareOptionsMenu: Unable to set icon", e);
|
||||
Log.e(LOGTAG, "onPrepareOptionsMenu: Unable to set icon", e);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -522,7 +520,7 @@ abstract public class GeckoApp
|
|||
editor.putString("last-uri", uri);
|
||||
editor.putString("last-title", title);
|
||||
|
||||
Log.i(LOG_NAME, "Saving:: " + uri + " " + title);
|
||||
Log.i(LOGTAG, "Saving:: " + uri + " " + title);
|
||||
editor.commit();
|
||||
|
||||
GeckoEvent event = new GeckoEvent();
|
||||
|
@ -544,14 +542,14 @@ abstract public class GeckoApp
|
|||
if (favicon == null)
|
||||
return;
|
||||
|
||||
Log.i(LOG_NAME, "Favicon successfully loaded for URL = " + pageUrl);
|
||||
Log.i(LOGTAG, "Favicon successfully loaded for URL = " + pageUrl);
|
||||
|
||||
// The tab might be pointing to another URL by the time the
|
||||
// favicon is finally loaded, in which case we simply ignore it.
|
||||
if (!tab.getURL().equals(pageUrl))
|
||||
return;
|
||||
|
||||
Log.i(LOG_NAME, "Favicon is for current URL = " + pageUrl);
|
||||
Log.i(LOGTAG, "Favicon is for current URL = " + pageUrl);
|
||||
|
||||
tab.updateFavicon(favicon);
|
||||
|
||||
|
@ -652,7 +650,7 @@ abstract public class GeckoApp
|
|||
}
|
||||
|
||||
public void handleMessage(String event, JSONObject message) {
|
||||
Log.i("Gecko", "Got message: " + event);
|
||||
Log.i(LOGTAG, "Got message: " + event);
|
||||
try {
|
||||
if (event.equals("Menu:Add")) {
|
||||
String name = message.getString("name");
|
||||
|
@ -687,43 +685,43 @@ abstract public class GeckoApp
|
|||
final String title = message.getString("title");
|
||||
final CharSequence titleText = title;
|
||||
handleContentLoaded(tabId, uri, title);
|
||||
Log.i(LOG_NAME, "URI - " + uri + ", title - " + title);
|
||||
Log.i(LOGTAG, "URI - " + uri + ", title - " + title);
|
||||
} else if (event.equals("DOMTitleChanged")) {
|
||||
final int tabId = message.getInt("tabID");
|
||||
final String title = message.getString("title");
|
||||
final CharSequence titleText = title;
|
||||
handleTitleChanged(tabId, title);
|
||||
Log.i(LOG_NAME, "title - " + title);
|
||||
Log.i(LOGTAG, "title - " + title);
|
||||
} else if (event.equals("DOMLinkAdded")) {
|
||||
final int tabId = message.getInt("tabID");
|
||||
final String rel = message.getString("rel");
|
||||
final String href = message.getString("href");
|
||||
Log.i(LOG_NAME, "link rel - " + rel + ", href - " + href);
|
||||
Log.i(LOGTAG, "link rel - " + rel + ", href - " + href);
|
||||
handleLinkAdded(tabId, rel, href);
|
||||
} else if (event.equals("log")) {
|
||||
// generic log listener
|
||||
final String msg = message.getString("msg");
|
||||
Log.i(LOG_NAME, "Log: " + msg);
|
||||
Log.i(LOGTAG, "Log: " + msg);
|
||||
} else if (event.equals("Content:LocationChange")) {
|
||||
final int tabId = message.getInt("tabID");
|
||||
final String uri = message.getString("uri");
|
||||
Log.i(LOG_NAME, "URI - " + uri);
|
||||
Log.i(LOGTAG, "URI - " + uri);
|
||||
handleLocationChange(tabId, uri);
|
||||
} else if (event.equals("Content:SecurityChange")) {
|
||||
final int tabId = message.getInt("tabID");
|
||||
final String mode = message.getString("mode");
|
||||
Log.i(LOG_NAME, "Security Mode - " + mode);
|
||||
Log.i(LOGTAG, "Security Mode - " + mode);
|
||||
handleSecurityChange(tabId, mode);
|
||||
} else if (event.equals("Content:StateChange")) {
|
||||
final int tabId = message.getInt("tabID");
|
||||
int state = message.getInt("state");
|
||||
Log.i(LOG_NAME, "State - " + state);
|
||||
Log.i(LOGTAG, "State - " + state);
|
||||
if ((state & GeckoAppShell.WPL_STATE_IS_DOCUMENT) != 0) {
|
||||
if ((state & GeckoAppShell.WPL_STATE_START) != 0) {
|
||||
Log.i(LOG_NAME, "Got a document start");
|
||||
Log.i(LOGTAG, "Got a document start");
|
||||
handleDocumentStart(tabId);
|
||||
} else if ((state & GeckoAppShell.WPL_STATE_STOP) != 0) {
|
||||
Log.i(LOG_NAME, "Got a document stop");
|
||||
Log.i(LOGTAG, "Got a document stop");
|
||||
handleDocumentStop(tabId);
|
||||
}
|
||||
}
|
||||
|
@ -731,18 +729,18 @@ abstract public class GeckoApp
|
|||
//GeckoApp.mAppContext.doCameraCapture(message.getString("path"));
|
||||
doCameraCapture();
|
||||
} else if (event.equals("Tab:Added")) {
|
||||
Log.i(LOG_NAME, "Created a new tab");
|
||||
Log.i(LOGTAG, "Created a new tab");
|
||||
int tabId = message.getInt("tabID");
|
||||
String uri = message.getString("uri");
|
||||
Boolean selected = message.getBoolean("selected");
|
||||
handleAddTab(tabId, uri, selected);
|
||||
} else if (event.equals("Tab:Closed")) {
|
||||
Log.i(LOG_NAME, "Destroyed a tab");
|
||||
Log.i(LOGTAG, "Destroyed a tab");
|
||||
int tabId = message.getInt("tabID");
|
||||
handleCloseTab(tabId);
|
||||
} else if (event.equals("Tab:Selected")) {
|
||||
int tabId = message.getInt("tabID");
|
||||
Log.i(LOG_NAME, "Switched to tab: " + tabId);
|
||||
Log.i(LOGTAG, "Switched to tab: " + tabId);
|
||||
handleSelectTab(tabId);
|
||||
} else if (event.equals("Doorhanger:Add")) {
|
||||
handleDoorHanger(message);
|
||||
|
@ -806,7 +804,7 @@ abstract public class GeckoApp
|
|||
});
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.i(LOG_NAME, "handleMessage throws " + e + " for message: " + event);
|
||||
Log.i(LOGTAG, "handleMessage throws " + e + " for message: " + event);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -817,7 +815,7 @@ abstract public class GeckoApp
|
|||
final int tabId = geckoObject.getInt("tabID");
|
||||
final JSONObject options = geckoObject.getJSONObject("options");
|
||||
|
||||
Log.i(LOG_NAME, "DoorHanger received for tab " + tabId + ", msg:" + message);
|
||||
Log.i(LOGTAG, "DoorHanger received for tab " + tabId + ", msg:" + message);
|
||||
|
||||
mMainHandler.post(new Runnable() {
|
||||
public void run() {
|
||||
|
@ -832,7 +830,7 @@ abstract public class GeckoApp
|
|||
final String value = geckoObject.getString("value");
|
||||
final int tabId = geckoObject.getInt("tabID");
|
||||
|
||||
Log.i(LOG_NAME, "Doorhanger:Remove received for tab " + tabId);
|
||||
Log.i(LOGTAG, "Doorhanger:Remove received for tab " + tabId);
|
||||
|
||||
mMainHandler.post(new Runnable() {
|
||||
public void run() {
|
||||
|
@ -1019,7 +1017,7 @@ abstract public class GeckoApp
|
|||
try {
|
||||
mGeckoLayout.updateViewLayout(view, lp);
|
||||
} catch (IllegalArgumentException e) {
|
||||
Log.i("updateViewLayout - IllegalArgumentException", "e:" + e);
|
||||
Log.i(LOGTAG, "e:" + e);
|
||||
// it can be the case where we
|
||||
// get an update before the view
|
||||
// is actually attached.
|
||||
|
@ -1165,7 +1163,7 @@ abstract public class GeckoApp
|
|||
try {
|
||||
Looper.loop();
|
||||
} catch (Exception e) {
|
||||
Log.e(LOG_NAME, "top level exception", e);
|
||||
Log.e(LOGTAG, "top level exception", e);
|
||||
StringWriter sw = new StringWriter();
|
||||
PrintWriter pw = new PrintWriter(sw);
|
||||
e.printStackTrace(pw);
|
||||
|
@ -1277,30 +1275,30 @@ abstract public class GeckoApp
|
|||
return;
|
||||
|
||||
if (Intent.ACTION_MAIN.equals(action)) {
|
||||
Log.i(LOG_NAME, "Intent : ACTION_MAIN");
|
||||
Log.i(LOGTAG, "Intent : ACTION_MAIN");
|
||||
GeckoAppShell.sendEventToGecko(new GeckoEvent(""));
|
||||
}
|
||||
else if (Intent.ACTION_VIEW.equals(action)) {
|
||||
String uri = intent.getDataString();
|
||||
GeckoAppShell.sendEventToGecko(new GeckoEvent(uri));
|
||||
Log.i(LOG_NAME,"onNewIntent: "+uri);
|
||||
Log.i(LOGTAG,"onNewIntent: "+uri);
|
||||
}
|
||||
else if (ACTION_WEBAPP.equals(action)) {
|
||||
String uri = intent.getStringExtra("args");
|
||||
GeckoAppShell.sendEventToGecko(new GeckoEvent(uri));
|
||||
Log.i(LOG_NAME,"Intent : WEBAPP - " + uri);
|
||||
Log.i(LOGTAG,"Intent : WEBAPP - " + uri);
|
||||
}
|
||||
else if (ACTION_BOOKMARK.equals(action)) {
|
||||
String args = intent.getStringExtra("args");
|
||||
GeckoAppShell.sendEventToGecko(new GeckoEvent(args));
|
||||
Log.i(LOG_NAME,"Intent : BOOKMARK - " + args);
|
||||
Log.i(LOGTAG,"Intent : BOOKMARK - " + args);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause()
|
||||
{
|
||||
Log.i(LOG_NAME, "pause");
|
||||
Log.i(LOGTAG, "pause");
|
||||
|
||||
// Remember the last screen.
|
||||
mMainHandler.postDelayed(new Runnable() {
|
||||
|
@ -1327,7 +1325,7 @@ abstract public class GeckoApp
|
|||
@Override
|
||||
public void onResume()
|
||||
{
|
||||
Log.i(LOG_NAME, "resume");
|
||||
Log.i(LOGTAG, "resume");
|
||||
if (checkLaunchState(LaunchState.GeckoRunning))
|
||||
GeckoAppShell.onResume();
|
||||
// After an onPause, the activity is back in the foreground.
|
||||
|
@ -1345,7 +1343,7 @@ abstract public class GeckoApp
|
|||
@Override
|
||||
public void onStop()
|
||||
{
|
||||
Log.i(LOG_NAME, "stop");
|
||||
Log.i(LOGTAG, "stop");
|
||||
// We're about to be stopped, potentially in preparation for
|
||||
// being destroyed. We're killable after this point -- as I
|
||||
// understand it, in extreme cases the process can be terminated
|
||||
|
@ -1364,7 +1362,7 @@ abstract public class GeckoApp
|
|||
@Override
|
||||
public void onRestart()
|
||||
{
|
||||
Log.i(LOG_NAME, "restart");
|
||||
Log.i(LOGTAG, "restart");
|
||||
super.onRestart();
|
||||
}
|
||||
|
||||
|
@ -1373,7 +1371,7 @@ abstract public class GeckoApp
|
|||
{
|
||||
Log.w(LOGTAG, "zerdatime " + new Date().getTime() + " - onStart");
|
||||
|
||||
Log.i(LOG_NAME, "start");
|
||||
Log.i(LOGTAG, "start");
|
||||
GeckoAppShell.sendEventToGecko(new GeckoEvent(GeckoEvent.ACTIVITY_START));
|
||||
super.onStart();
|
||||
}
|
||||
|
@ -1381,7 +1379,7 @@ abstract public class GeckoApp
|
|||
@Override
|
||||
public void onDestroy()
|
||||
{
|
||||
Log.i(LOG_NAME, "destroy");
|
||||
Log.i(LOGTAG, "destroy");
|
||||
|
||||
// Tell Gecko to shutting down; we'll end up calling System.exit()
|
||||
// in onXreExit.
|
||||
|
@ -1416,7 +1414,7 @@ abstract public class GeckoApp
|
|||
@Override
|
||||
public void onConfigurationChanged(android.content.res.Configuration newConfig)
|
||||
{
|
||||
Log.i(LOG_NAME, "configuration changed");
|
||||
Log.i(LOGTAG, "configuration changed");
|
||||
// nothing, just ignore
|
||||
super.onConfigurationChanged(newConfig);
|
||||
}
|
||||
|
@ -1424,7 +1422,7 @@ abstract public class GeckoApp
|
|||
@Override
|
||||
public void onLowMemory()
|
||||
{
|
||||
Log.e(LOG_NAME, "low memory");
|
||||
Log.e(LOGTAG, "low memory");
|
||||
if (checkLaunchState(LaunchState.GeckoRunning))
|
||||
GeckoAppShell.onLowMemory();
|
||||
super.onLowMemory();
|
||||
|
@ -1456,11 +1454,11 @@ abstract public class GeckoApp
|
|||
/* TODO: addEnvToIntent(intent); */
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
|
||||
Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
|
||||
Log.i(LOG_NAME, intent.toString());
|
||||
Log.i(LOGTAG, intent.toString());
|
||||
GeckoAppShell.killAnyZombies();
|
||||
startActivity(intent);
|
||||
} catch (Exception e) {
|
||||
Log.i(LOG_NAME, "error doing restart", e);
|
||||
Log.i(LOGTAG, "error doing restart", e);
|
||||
}
|
||||
finish();
|
||||
// Give the restart process time to start before we die
|
||||
|
@ -1472,7 +1470,7 @@ abstract public class GeckoApp
|
|||
}
|
||||
|
||||
private void checkAndLaunchUpdate() {
|
||||
Log.i(LOG_NAME, "Checking for an update");
|
||||
Log.i(LOGTAG, "Checking for an update");
|
||||
|
||||
int statusCode = 8; // UNEXPECTED_ERROR
|
||||
File baseUpdateDir = null;
|
||||
|
@ -1492,7 +1490,7 @@ abstract public class GeckoApp
|
|||
if (!updateFile.exists())
|
||||
return;
|
||||
|
||||
Log.i(LOG_NAME, "Update is available!");
|
||||
Log.i(LOGTAG, "Update is available!");
|
||||
|
||||
// Launch APK
|
||||
File updateFileToRun = new File(updateDir, getPackageName() + "-update.apk");
|
||||
|
@ -1501,15 +1499,15 @@ abstract public class GeckoApp
|
|||
String amCmd = "/system/bin/am start -a android.intent.action.VIEW " +
|
||||
"-n com.android.packageinstaller/.PackageInstallerActivity -d file://" +
|
||||
updateFileToRun.getPath();
|
||||
Log.i(LOG_NAME, amCmd);
|
||||
Log.i(LOGTAG, amCmd);
|
||||
Runtime.getRuntime().exec(amCmd);
|
||||
statusCode = 0; // OK
|
||||
} else {
|
||||
Log.i(LOG_NAME, "Cannot rename the update file!");
|
||||
Log.i(LOGTAG, "Cannot rename the update file!");
|
||||
statusCode = 7; // WRITE_ERROR
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.i(LOG_NAME, "error launching installer to update", e);
|
||||
Log.i(LOGTAG, "error launching installer to update", e);
|
||||
}
|
||||
|
||||
// Update the status file
|
||||
|
@ -1522,7 +1520,7 @@ abstract public class GeckoApp
|
|||
outStream.write(buf, 0, buf.length);
|
||||
outStream.close();
|
||||
} catch (Exception e) {
|
||||
Log.i(LOG_NAME, "error writing status file", e);
|
||||
Log.i(LOGTAG, "error writing status file", e);
|
||||
}
|
||||
|
||||
if (statusCode == 0)
|
||||
|
@ -1536,7 +1534,7 @@ abstract public class GeckoApp
|
|||
status = reader.readLine();
|
||||
reader.close();
|
||||
} catch (Exception e) {
|
||||
Log.i(LOG_NAME, "error reading update status", e);
|
||||
Log.i(LOGTAG, "error reading update status", e);
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
@ -1554,11 +1552,11 @@ abstract public class GeckoApp
|
|||
|
||||
try {
|
||||
while (null == (filePickerResult = mFilePickerResult.poll(1, TimeUnit.MILLISECONDS))) {
|
||||
Log.i(LOG_NAME, "processing events from showFilePicker ");
|
||||
Log.i(LOGTAG, "processing events from showFilePicker ");
|
||||
GeckoAppShell.processNextNativeEvent();
|
||||
}
|
||||
} catch (InterruptedException e) {
|
||||
Log.i(LOG_NAME, "showing file picker ", e);
|
||||
Log.i(LOGTAG, "showing file picker ", e);
|
||||
}
|
||||
|
||||
return filePickerResult;
|
||||
|
@ -1593,7 +1591,7 @@ abstract public class GeckoApp
|
|||
}
|
||||
|
||||
public boolean doReload() {
|
||||
Log.i(LOG_NAME, "Reload requested");
|
||||
Log.i(LOGTAG, "Reload requested");
|
||||
Tab tab = Tabs.getInstance().getSelectedTab();
|
||||
if (tab == null)
|
||||
return false;
|
||||
|
@ -1602,7 +1600,7 @@ abstract public class GeckoApp
|
|||
}
|
||||
|
||||
public boolean doForward() {
|
||||
Log.i(LOG_NAME, "Forward requested");
|
||||
Log.i(LOGTAG, "Forward requested");
|
||||
Tab tab = Tabs.getInstance().getSelectedTab();
|
||||
if (tab == null)
|
||||
return false;
|
||||
|
@ -1611,7 +1609,7 @@ abstract public class GeckoApp
|
|||
}
|
||||
|
||||
public boolean doStop() {
|
||||
Log.i(LOG_NAME, "Stop requested");
|
||||
Log.i(LOGTAG, "Stop requested");
|
||||
Tab tab = Tabs.getInstance().getSelectedTab();
|
||||
if (tab == null)
|
||||
return false;
|
||||
|
@ -1689,13 +1687,13 @@ abstract public class GeckoApp
|
|||
fos.close();
|
||||
filePickerResult = file.getAbsolutePath();
|
||||
}catch (Exception e) {
|
||||
Log.e(LOG_NAME, "showing file picker", e);
|
||||
Log.e(LOGTAG, "showing file picker", e);
|
||||
}
|
||||
}
|
||||
try {
|
||||
mFilePickerResult.put(filePickerResult);
|
||||
} catch (InterruptedException e) {
|
||||
Log.i(LOG_NAME, "error returning file picker result", e);
|
||||
Log.i(LOGTAG, "error returning file picker result", e);
|
||||
}
|
||||
break;
|
||||
case AWESOMEBAR_REQUEST:
|
||||
|
@ -1709,7 +1707,7 @@ abstract public class GeckoApp
|
|||
}
|
||||
break;
|
||||
case CAMERA_CAPTURE_REQUEST:
|
||||
Log.i(LOG_NAME, "Returning from CAMERA_CAPTURE_REQUEST: " + resultCode);
|
||||
Log.i(LOGTAG, "Returning from CAMERA_CAPTURE_REQUEST: " + resultCode);
|
||||
File file = new File(Environment.getExternalStorageDirectory(), "cameraCapture-" + Integer.toString(kCaptureIndex) + ".jpg");
|
||||
kCaptureIndex++;
|
||||
GeckoEvent e = new GeckoEvent("cameraCaptureDone", resultCode == Activity.RESULT_OK ?
|
||||
|
@ -1731,7 +1729,7 @@ abstract public class GeckoApp
|
|||
|
||||
public void loadUrl(String url, AwesomeBar.Type type) {
|
||||
mBrowserToolbar.setTitle(url);
|
||||
Log.d(LOG_NAME, type.name());
|
||||
Log.d(LOGTAG, type.name());
|
||||
if (type == AwesomeBar.Type.ADD) {
|
||||
GeckoAppShell.sendEventToGecko(new GeckoEvent("Tab:Add", url));
|
||||
} else {
|
||||
|
|
|
@ -83,7 +83,7 @@ import org.json.JSONObject;
|
|||
|
||||
public class GeckoAppShell
|
||||
{
|
||||
private static final String LOG_FILE_NAME = "GeckoAppShell";
|
||||
private static final String LOGTAG = "GeckoAppShell";
|
||||
|
||||
// static members only
|
||||
private GeckoAppShell() { }
|
||||
|
@ -207,25 +207,25 @@ public class GeckoAppShell
|
|||
sFreeSpace = cacheStats.getFreeBlocks() *
|
||||
cacheStats.getBlockSize();
|
||||
} else {
|
||||
Log.i(LOG_FILE_NAME, "Unable to get cache dir");
|
||||
Log.i(LOGTAG, "Unable to get cache dir");
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.e(LOG_FILE_NAME, "exception while stating cache dir: ", e);
|
||||
Log.e(LOGTAG, "exception while stating cache dir: ", e);
|
||||
}
|
||||
return sFreeSpace;
|
||||
}
|
||||
|
||||
static boolean moveFile(File inFile, File outFile)
|
||||
{
|
||||
Log.i(LOG_FILE_NAME, "moving " + inFile + " to " + outFile);
|
||||
Log.i(LOGTAG, "moving " + inFile + " to " + outFile);
|
||||
if (outFile.isDirectory())
|
||||
outFile = new File(outFile, inFile.getName());
|
||||
try {
|
||||
if (inFile.renameTo(outFile))
|
||||
return true;
|
||||
} catch (SecurityException se) {
|
||||
Log.w(LOG_FILE_NAME, "error trying to rename file", se);
|
||||
Log.w(LOGTAG, "error trying to rename file", se);
|
||||
}
|
||||
try {
|
||||
long lastModified = inFile.lastModified();
|
||||
|
@ -244,11 +244,11 @@ public class GeckoAppShell
|
|||
else
|
||||
return false;
|
||||
} catch (Exception e) {
|
||||
Log.e(LOG_FILE_NAME, "exception while moving file: ", e);
|
||||
Log.e(LOGTAG, "exception while moving file: ", e);
|
||||
try {
|
||||
outFile.delete();
|
||||
} catch (SecurityException se) {
|
||||
Log.w(LOG_FILE_NAME, "error trying to delete file", se);
|
||||
Log.w(LOGTAG, "error trying to delete file", se);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -261,7 +261,7 @@ public class GeckoAppShell
|
|||
if (from.renameTo(to))
|
||||
return true;
|
||||
} catch (SecurityException se) {
|
||||
Log.w(LOG_FILE_NAME, "error trying to rename file", se);
|
||||
Log.w(LOGTAG, "error trying to rename file", se);
|
||||
}
|
||||
File[] files = from.listFiles();
|
||||
boolean retVal = true;
|
||||
|
@ -279,7 +279,7 @@ public class GeckoAppShell
|
|||
}
|
||||
from.delete();
|
||||
} catch(Exception e) {
|
||||
Log.e(LOG_FILE_NAME, "error trying to move file", e);
|
||||
Log.e(LOGTAG, "error trying to move file", e);
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
@ -328,24 +328,24 @@ public class GeckoAppShell
|
|||
String[] dirs = GeckoApp.mAppContext.getPluginDirectories();
|
||||
StringBuffer pluginSearchPath = new StringBuffer();
|
||||
for (int i = 0; i < dirs.length; i++) {
|
||||
Log.i("GeckoPlugins", "dir: " + dirs[i]);
|
||||
Log.i(LOGTAG, "dir: " + dirs[i]);
|
||||
pluginSearchPath.append(dirs[i]);
|
||||
pluginSearchPath.append(":");
|
||||
}
|
||||
GeckoAppShell.putenv("MOZ_PLUGIN_PATH="+pluginSearchPath);
|
||||
} catch (Exception ex) {
|
||||
Log.i("GeckoPlugins", "exception getting plugin dirs", ex);
|
||||
Log.i(LOGTAG, "exception getting plugin dirs", ex);
|
||||
}
|
||||
|
||||
GeckoAppShell.putenv("HOME=" + homeDir);
|
||||
GeckoAppShell.putenv("GRE_HOME=" + GeckoApp.sGREDir.getPath());
|
||||
Intent i = geckoApp.getIntent();
|
||||
String env = i.getStringExtra("env0");
|
||||
Log.i(LOG_FILE_NAME, "env0: "+ env);
|
||||
Log.i(LOGTAG, "env0: "+ env);
|
||||
for (int c = 1; env != null; c++) {
|
||||
GeckoAppShell.putenv(env);
|
||||
env = i.getStringExtra("env" + c);
|
||||
Log.i(LOG_FILE_NAME, "env"+ c +": "+ env);
|
||||
Log.i(LOGTAG, "env"+ c +": "+ env);
|
||||
}
|
||||
|
||||
File f = geckoApp.getDir("tmp", Context.MODE_WORLD_READABLE |
|
||||
|
@ -380,7 +380,7 @@ public class GeckoAppShell
|
|||
GeckoAppShell.putenv("UPDATES_DIRECTORY=" + updatesDir.getPath());
|
||||
}
|
||||
catch (Exception e) {
|
||||
Log.i(LOG_FILE_NAME, "No download directory has been found: " + e);
|
||||
Log.i(LOGTAG, "No download directory has been found: " + e);
|
||||
}
|
||||
|
||||
putLocaleEnv();
|
||||
|
@ -418,12 +418,12 @@ public class GeckoAppShell
|
|||
// run gecko -- it will spawn its own thread
|
||||
GeckoAppShell.nativeInit();
|
||||
|
||||
Log.i("GeckoAppJava", "post native init");
|
||||
Log.i(LOGTAG, "post native init");
|
||||
|
||||
// Tell Gecko where the target byte buffer is for rendering
|
||||
GeckoAppShell.setSoftwareLayerClient(GeckoApp.mAppContext.getSoftwareLayerClient());
|
||||
|
||||
Log.i("GeckoAppJava", "setSoftwareLayerClient called");
|
||||
Log.i(LOGTAG, "setSoftwareLayerClient called");
|
||||
|
||||
// First argument is the .apk path
|
||||
String combinedArgs = apkPath + " -greomni " + apkPath;
|
||||
|
@ -622,25 +622,25 @@ public class GeckoAppShell
|
|||
static void onXreExit() {
|
||||
// mLaunchState can only be Launched or GeckoRunning at this point
|
||||
GeckoApp.mAppContext.setLaunchState(GeckoApp.LaunchState.GeckoExiting);
|
||||
Log.i("GeckoAppJava", "XRE exited");
|
||||
Log.i(LOGTAG, "XRE exited");
|
||||
if (gRestartScheduled) {
|
||||
GeckoApp.mAppContext.doRestart();
|
||||
} else {
|
||||
Log.i("GeckoAppJava", "we're done, good bye");
|
||||
Log.i(LOGTAG, "we're done, good bye");
|
||||
GeckoApp.mAppContext.finish();
|
||||
}
|
||||
|
||||
Log.w("GeckoAppShell", "Killing via System.exit()");
|
||||
Log.w(LOGTAG, "Killing via System.exit()");
|
||||
System.exit(0);
|
||||
}
|
||||
static void scheduleRestart() {
|
||||
Log.i("GeckoAppJava", "scheduling restart");
|
||||
Log.i(LOGTAG, "scheduling restart");
|
||||
gRestartScheduled = true;
|
||||
}
|
||||
|
||||
// "Installs" an application by creating a shortcut
|
||||
static void createShortcut(String aTitle, String aURI, String aIconData, String aType) {
|
||||
Log.w("GeckoAppJava", "createShortcut for " + aURI + " [" + aTitle + "] > " + aType);
|
||||
Log.w(LOGTAG, "createShortcut for " + aURI + " [" + aTitle + "] > " + aType);
|
||||
|
||||
// the intent to be launched by the shortcut
|
||||
Intent shortcutIntent = new Intent();
|
||||
|
@ -846,7 +846,7 @@ public class GeckoAppShell
|
|||
|
||||
public static void showAlertNotification(String aImageUrl, String aAlertTitle, String aAlertText,
|
||||
String aAlertCookie, String aAlertName) {
|
||||
Log.i("GeckoAppJava", "GeckoAppShell.showAlertNotification\n" +
|
||||
Log.i(LOGTAG, "GeckoAppShell.showAlertNotification\n" +
|
||||
"- image = '" + aImageUrl + "'\n" +
|
||||
"- title = '" + aAlertTitle + "'\n" +
|
||||
"- text = '" + aAlertText +"'\n" +
|
||||
|
@ -901,11 +901,11 @@ public class GeckoAppShell
|
|||
|
||||
notification.show();
|
||||
|
||||
Log.i("GeckoAppJava", "Created notification ID " + notificationID);
|
||||
Log.i(LOGTAG, "Created notification ID " + notificationID);
|
||||
}
|
||||
|
||||
public static void alertsProgressListener_OnProgress(String aAlertName, long aProgress, long aProgressMax, String aAlertText) {
|
||||
Log.i("GeckoAppJava", "GeckoAppShell.alertsProgressListener_OnProgress\n" +
|
||||
Log.i(LOGTAG, "GeckoAppShell.alertsProgressListener_OnProgress\n" +
|
||||
"- name = '" + aAlertName +"', " +
|
||||
"progress = " + aProgress +" / " + aProgressMax + ", text = '" + aAlertText + "'");
|
||||
|
||||
|
@ -922,7 +922,7 @@ public class GeckoAppShell
|
|||
}
|
||||
|
||||
public static void alertsProgressListener_OnCancel(String aAlertName) {
|
||||
Log.i("GeckoAppJava", "GeckoAppShell.alertsProgressListener_OnCancel('" + aAlertName + "')");
|
||||
Log.i(LOGTAG, "GeckoAppShell.alertsProgressListener_OnCancel('" + aAlertName + "')");
|
||||
|
||||
removeObserver(aAlertName);
|
||||
|
||||
|
@ -934,7 +934,7 @@ public class GeckoAppShell
|
|||
int notificationID = aAlertName.hashCode();
|
||||
|
||||
if (GeckoApp.ACTION_ALERT_CLICK.equals(aAction)) {
|
||||
Log.i("GeckoAppJava", "GeckoAppShell.handleNotification: callObserver(alertclickcallback)");
|
||||
Log.i(LOGTAG, "GeckoAppShell.handleNotification: callObserver(alertclickcallback)");
|
||||
callObserver(aAlertName, "alertclickcallback", aAlertCookie);
|
||||
|
||||
AlertNotification notification = mAlertNotifications.get(notificationID);
|
||||
|
@ -1166,7 +1166,7 @@ public class GeckoAppShell
|
|||
in.close();
|
||||
}
|
||||
catch (Exception e) {
|
||||
Log.i(LOG_FILE_NAME, "finding procs throws ", e);
|
||||
Log.i(LOGTAG, "finding procs throws ", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1209,7 +1209,7 @@ public class GeckoAppShell
|
|||
return buf.array();
|
||||
}
|
||||
catch (Exception e) {
|
||||
Log.i(LOG_FILE_NAME, "getIconForExtension error: ", e);
|
||||
Log.i(LOGTAG, "getIconForExtension error: ", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -1259,24 +1259,24 @@ public class GeckoAppShell
|
|||
double x, double y,
|
||||
double w, double h)
|
||||
{
|
||||
Log.i("GeckoAppShell", "addPluginView:" + view + " @ x:" + x + " y:" + y + " w:" + w + " h:" + h ) ;
|
||||
Log.i(LOGTAG, "addPluginView:" + view + " @ x:" + x + " y:" + y + " w:" + w + " h:" + h ) ;
|
||||
GeckoApp.mAppContext.addPluginView(view, x, y, w, h);
|
||||
}
|
||||
|
||||
public static void removePluginView(View view) {
|
||||
Log.i("GeckoAppShell", "remove view:" + view);
|
||||
Log.i(LOGTAG, "remove view:" + view);
|
||||
GeckoApp.mAppContext.removePluginView(view);
|
||||
}
|
||||
|
||||
public static Class<?> loadPluginClass(String className, String libName) {
|
||||
Log.i("GeckoAppShell", "in loadPluginClass... attempting to access className, then libName.....");
|
||||
Log.i("GeckoAppShell", "className: " + className);
|
||||
Log.i("GeckoAppShell", "libName: " + libName);
|
||||
Log.i(LOGTAG, "in loadPluginClass... attempting to access className, then libName.....");
|
||||
Log.i(LOGTAG, "className: " + className);
|
||||
Log.i(LOGTAG, "libName: " + libName);
|
||||
|
||||
try {
|
||||
String[] split = libName.split("/");
|
||||
String packageName = split[split.length - 3];
|
||||
Log.i("GeckoAppShell", "load \"" + className + "\" from \"" + packageName +
|
||||
Log.i(LOGTAG, "load \"" + className + "\" from \"" + packageName +
|
||||
"\" for \"" + libName + "\"");
|
||||
Context pluginContext =
|
||||
GeckoApp.mAppContext.createPackageContext(packageName,
|
||||
|
@ -1285,11 +1285,11 @@ public class GeckoAppShell
|
|||
ClassLoader pluginCL = pluginContext.getClassLoader();
|
||||
return pluginCL.loadClass(className);
|
||||
} catch (java.lang.ClassNotFoundException cnfe) {
|
||||
Log.i("GeckoAppShell", "class not found", cnfe);
|
||||
Log.i(LOGTAG, "class not found", cnfe);
|
||||
} catch (android.content.pm.PackageManager.NameNotFoundException nnfe) {
|
||||
Log.i("GeckoAppShell", "package not found", nnfe);
|
||||
Log.i(LOGTAG, "package not found", nnfe);
|
||||
}
|
||||
Log.e("GeckoAppShell", "couldn't find class");
|
||||
Log.e(LOGTAG, "couldn't find class");
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -1297,13 +1297,13 @@ public class GeckoAppShell
|
|||
|
||||
static class GeckoRunnableCallback implements Runnable {
|
||||
public void run() {
|
||||
Log.i("GeckoShell", "run GeckoRunnableCallback");
|
||||
Log.i(LOGTAG, "run GeckoRunnableCallback");
|
||||
GeckoAppShell.executeNextRunnable();
|
||||
}
|
||||
}
|
||||
|
||||
public static void postToJavaThread(boolean mainThread) {
|
||||
Log.i("GeckoShell", "post to " + (mainThread ? "main " : "") + "java thread");
|
||||
Log.i(LOGTAG, "post to " + (mainThread ? "main " : "") + "java thread");
|
||||
getMainHandler().post(new GeckoRunnableCallback());
|
||||
}
|
||||
|
||||
|
@ -1315,7 +1315,7 @@ public class GeckoAppShell
|
|||
static byte[] sCameraBuffer = null;
|
||||
|
||||
static int[] initCamera(String aContentType, int aCamera, int aWidth, int aHeight) {
|
||||
Log.i("GeckoAppJava", "initCamera(" + aContentType + ", " + aWidth + "x" + aHeight + ") on thread " + Thread.currentThread().getId());
|
||||
Log.i(LOGTAG, "initCamera(" + aContentType + ", " + aWidth + "x" + aHeight + ") on thread " + Thread.currentThread().getId());
|
||||
|
||||
getMainHandler().post(new Runnable() {
|
||||
public void run() {
|
||||
|
@ -1378,9 +1378,9 @@ public class GeckoAppShell
|
|||
try {
|
||||
sCamera.setPreviewDisplay(GeckoApp.cameraView.getHolder());
|
||||
} catch(IOException e) {
|
||||
Log.e("GeckoAppJava", "Error setPreviewDisplay:", e);
|
||||
Log.e(LOGTAG, "Error setPreviewDisplay:", e);
|
||||
} catch(RuntimeException e) {
|
||||
Log.e("GeckoAppJava", "Error setPreviewDisplay:", e);
|
||||
Log.e(LOGTAG, "Error setPreviewDisplay:", e);
|
||||
}
|
||||
|
||||
sCamera.setParameters(params);
|
||||
|
@ -1395,23 +1395,23 @@ public class GeckoAppShell
|
|||
});
|
||||
sCamera.startPreview();
|
||||
params = sCamera.getParameters();
|
||||
Log.i("GeckoAppJava", "Camera: " + params.getPreviewSize().width + "x" + params.getPreviewSize().height +
|
||||
Log.i(LOGTAG, "Camera: " + params.getPreviewSize().width + "x" + params.getPreviewSize().height +
|
||||
" @ " + params.getPreviewFrameRate() + "fps. format is " + params.getPreviewFormat());
|
||||
result[0] = 1;
|
||||
result[1] = params.getPreviewSize().width;
|
||||
result[2] = params.getPreviewSize().height;
|
||||
result[3] = params.getPreviewFrameRate();
|
||||
|
||||
Log.i("GeckoAppJava", "Camera preview started");
|
||||
Log.i(LOGTAG, "Camera preview started");
|
||||
} catch(RuntimeException e) {
|
||||
Log.e("GeckoAppJava", "initCamera RuntimeException : ", e);
|
||||
Log.e(LOGTAG, "initCamera RuntimeException : ", e);
|
||||
result[0] = result[1] = result[2] = result[3] = 0;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
static synchronized void closeCamera() {
|
||||
Log.i("GeckoAppJava", "closeCamera() on thread " + Thread.currentThread().getId());
|
||||
Log.i(LOGTAG, "closeCamera() on thread " + Thread.currentThread().getId());
|
||||
getMainHandler().post(new Runnable() {
|
||||
public void run() {
|
||||
try {
|
||||
|
@ -1447,14 +1447,14 @@ public class GeckoAppShell
|
|||
try {
|
||||
sTracerQueue.put(new Date());
|
||||
} catch(InterruptedException ie) {
|
||||
Log.w("GeckoAppShell", "exception firing tracer", ie);
|
||||
Log.w(LOGTAG, "exception firing tracer", ie);
|
||||
}
|
||||
}
|
||||
});
|
||||
try {
|
||||
sTracerQueue.take();
|
||||
} catch(InterruptedException ie) {
|
||||
Log.w("GeckoAppShell", "exception firing tracer", ie);
|
||||
Log.w(LOGTAG, "exception firing tracer", ie);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1499,7 +1499,7 @@ public class GeckoAppShell
|
|||
processNextNativeEvent();
|
||||
}
|
||||
} catch (InterruptedException e) {
|
||||
Log.i(LOG_FILE_NAME, "showing prompt ", e);
|
||||
Log.i(LOGTAG, "showing prompt ", e);
|
||||
}
|
||||
return promptServiceResult;
|
||||
}
|
||||
|
@ -1517,7 +1517,7 @@ public class GeckoAppShell
|
|||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
Log.i("GeckoShell", "handleGeckoMessage throws " + e);
|
||||
Log.i(LOGTAG, "handleGeckoMessage throws " + e);
|
||||
}
|
||||
|
||||
return "";
|
||||
|
|
|
@ -51,6 +51,8 @@ import android.os.BatteryManager;
|
|||
public class GeckoBatteryManager
|
||||
extends BroadcastReceiver
|
||||
{
|
||||
private static final String LOGTAG = "GeckoBatteryManager";
|
||||
|
||||
// Those constants should be keep in sync with the ones in:
|
||||
// dom/battery/Constants.h
|
||||
private final static double kDefaultLevel = 1.0;
|
||||
|
@ -66,7 +68,7 @@ public class GeckoBatteryManager
|
|||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
if (!intent.getAction().equals(Intent.ACTION_BATTERY_CHANGED)) {
|
||||
Log.e("GeckoBatteryManager", "Got an unexpected intent!");
|
||||
Log.e(LOGTAG, "Got an unexpected intent!");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -77,7 +79,7 @@ public class GeckoBatteryManager
|
|||
int plugged = intent.getIntExtra(BatteryManager.EXTRA_PLUGGED, -1);
|
||||
if (plugged == -1) {
|
||||
sCharging = kDefaultCharging;
|
||||
Log.e("GeckoBatteryManager", "Failed to get the plugged status!");
|
||||
Log.e(LOGTAG, "Failed to get the plugged status!");
|
||||
} else {
|
||||
// Likely, if plugged > 0, it's likely plugged and charging but the doc
|
||||
// isn't clear about that.
|
||||
|
@ -95,7 +97,7 @@ public class GeckoBatteryManager
|
|||
double current = (double)intent.getIntExtra(BatteryManager.EXTRA_LEVEL, -1);
|
||||
double max = (double)intent.getIntExtra(BatteryManager.EXTRA_SCALE, -1);
|
||||
if (current == -1 || max == -1) {
|
||||
Log.e("GeckoBatteryManager", "Failed to get battery level!");
|
||||
Log.e(LOGTAG, "Failed to get battery level!");
|
||||
sLevel = kDefaultLevel;
|
||||
} else {
|
||||
sLevel = current / max;
|
||||
|
@ -112,14 +114,14 @@ public class GeckoBatteryManager
|
|||
|
||||
if (sCharging) {
|
||||
if (dLevel < 0) {
|
||||
Log.w("GeckoBatteryManager", "When charging, level should increase!");
|
||||
Log.w(LOGTAG, "When charging, level should increase!");
|
||||
sRemainingTime = kUnknownRemainingTime;
|
||||
} else {
|
||||
sRemainingTime = Math.round(dt / dLevel * (1.0 - sLevel));
|
||||
}
|
||||
} else {
|
||||
if (dLevel > 0) {
|
||||
Log.w("GeckoBatteryManager", "When discharging, level should decrease!");
|
||||
Log.w(LOGTAG, "When discharging, level should decrease!");
|
||||
sRemainingTime = kUnknownRemainingTime;
|
||||
} else {
|
||||
sRemainingTime = Math.round(dt / -dLevel * sLevel);
|
||||
|
|
|
@ -55,6 +55,8 @@ import android.util.Log;
|
|||
*/
|
||||
|
||||
public class GeckoEvent {
|
||||
private static final String LOGTAG = "GeckoEvent";
|
||||
|
||||
public static final int INVALID = -1;
|
||||
public static final int NATIVE_POKE = 0;
|
||||
public static final int KEY_EVENT = 1;
|
||||
|
@ -157,7 +159,7 @@ public class GeckoEvent {
|
|||
mAlpha = -s.values[0];
|
||||
mBeta = -s.values[1];
|
||||
mGamma = -s.values[2];
|
||||
Log.i("GeckoEvent", "SensorEvent type = " + s.sensor.getType() + " " + s.sensor.getName() + " " + mAlpha + " " + mBeta + " " + mGamma );
|
||||
Log.i(LOGTAG, "SensorEvent type = " + s.sensor.getType() + " " + s.sensor.getName() + " " + mAlpha + " " + mBeta + " " + mGamma );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -65,6 +65,8 @@ public class GeckoInputConnection
|
|||
extends BaseInputConnection
|
||||
implements TextWatcher, InputConnectionHandler
|
||||
{
|
||||
private static final String LOGTAG = "GeckoInputConnection";
|
||||
|
||||
private class ChangeNotification {
|
||||
public String mText;
|
||||
public int mStart;
|
||||
|
@ -99,21 +101,21 @@ public class GeckoInputConnection
|
|||
|
||||
@Override
|
||||
public boolean beginBatchEdit() {
|
||||
Log.d("GeckoAppJava", "IME: beginBatchEdit");
|
||||
Log.d(LOGTAG, "IME: beginBatchEdit");
|
||||
mBatchMode = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean commitCompletion(CompletionInfo text) {
|
||||
Log.d("GeckoAppJava", "IME: commitCompletion");
|
||||
Log.d(LOGTAG, "IME: commitCompletion");
|
||||
|
||||
return commitText(text.getText(), 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean commitText(CharSequence text, int newCursorPosition) {
|
||||
Log.d("GeckoAppJava", "IME: commitText");
|
||||
Log.d(LOGTAG, "IME: commitText");
|
||||
|
||||
setComposingText(text, newCursorPosition);
|
||||
finishComposingText();
|
||||
|
@ -123,7 +125,7 @@ public class GeckoInputConnection
|
|||
|
||||
@Override
|
||||
public boolean deleteSurroundingText(int leftLength, int rightLength) {
|
||||
Log.d("GeckoAppJava", "IME: deleteSurroundingText");
|
||||
Log.d(LOGTAG, "IME: deleteSurroundingText");
|
||||
if (leftLength == 0 && rightLength == 0)
|
||||
return true;
|
||||
|
||||
|
@ -146,7 +148,7 @@ public class GeckoInputConnection
|
|||
try {
|
||||
mQueryResult.take();
|
||||
} catch (InterruptedException e) {
|
||||
Log.e("GeckoAppJava", "IME: deleteSurroundingText interrupted", e);
|
||||
Log.e(LOGTAG, "IME: deleteSurroundingText interrupted", e);
|
||||
return false;
|
||||
}
|
||||
delStart = mSelectionStart > leftLength ?
|
||||
|
@ -182,7 +184,7 @@ public class GeckoInputConnection
|
|||
|
||||
@Override
|
||||
public boolean endBatchEdit() {
|
||||
Log.d("GeckoAppJava", "IME: endBatchEdit");
|
||||
Log.d(LOGTAG, "IME: endBatchEdit");
|
||||
|
||||
mBatchMode = false;
|
||||
|
||||
|
@ -204,7 +206,7 @@ public class GeckoInputConnection
|
|||
|
||||
@Override
|
||||
public boolean finishComposingText() {
|
||||
Log.d("GeckoAppJava", "IME: finishComposingText");
|
||||
Log.d(LOGTAG, "IME: finishComposingText");
|
||||
|
||||
if (mComposing) {
|
||||
// Set style to none
|
||||
|
@ -229,14 +231,14 @@ public class GeckoInputConnection
|
|||
|
||||
@Override
|
||||
public int getCursorCapsMode(int reqModes) {
|
||||
Log.d("GeckoAppJava", "IME: getCursorCapsMode");
|
||||
Log.d(LOGTAG, "IME: getCursorCapsMode");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Editable getEditable() {
|
||||
Log.w("GeckoAppJava", "IME: getEditable called from " +
|
||||
Log.w(LOGTAG, "IME: getEditable called from " +
|
||||
Thread.currentThread().getStackTrace()[0].toString());
|
||||
|
||||
return null;
|
||||
|
@ -244,7 +246,7 @@ public class GeckoInputConnection
|
|||
|
||||
@Override
|
||||
public boolean performContextMenuAction(int id) {
|
||||
Log.d("GeckoAppJava", "IME: performContextMenuAction");
|
||||
Log.d(LOGTAG, "IME: performContextMenuAction");
|
||||
|
||||
// First we need to ask Gecko to tell us the full contents of the
|
||||
// text field we're about to operate on.
|
||||
|
@ -254,7 +256,7 @@ public class GeckoInputConnection
|
|||
try {
|
||||
text = mQueryResult.take();
|
||||
} catch (InterruptedException e) {
|
||||
Log.e("GeckoAppJava", "IME: performContextMenuAction interrupted", e);
|
||||
Log.e(LOGTAG, "IME: performContextMenuAction interrupted", e);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -284,7 +286,7 @@ public class GeckoInputConnection
|
|||
try {
|
||||
text = mQueryResult.take();
|
||||
} catch (InterruptedException e) {
|
||||
Log.e("GeckoAppJava", "IME: performContextMenuAction interrupted", e);
|
||||
Log.e(LOGTAG, "IME: performContextMenuAction interrupted", e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -304,7 +306,7 @@ public class GeckoInputConnection
|
|||
if (!GeckoApp.checkLaunchState(GeckoApp.LaunchState.GeckoRunning))
|
||||
return null;
|
||||
|
||||
Log.d("GeckoAppJava", "IME: getExtractedText");
|
||||
Log.d(LOGTAG, "IME: getExtractedText");
|
||||
|
||||
ExtractedText extract = new ExtractedText();
|
||||
extract.flags = 0;
|
||||
|
@ -316,7 +318,7 @@ public class GeckoInputConnection
|
|||
try {
|
||||
mQueryResult.take();
|
||||
} catch (InterruptedException e) {
|
||||
Log.e("GeckoAppJava", "IME: getExtractedText interrupted", e);
|
||||
Log.e(LOGTAG, "IME: getExtractedText interrupted", e);
|
||||
return null;
|
||||
}
|
||||
extract.selectionStart = mSelectionStart;
|
||||
|
@ -349,21 +351,21 @@ public class GeckoInputConnection
|
|||
return extract;
|
||||
|
||||
} catch (InterruptedException e) {
|
||||
Log.e("GeckoAppJava", "IME: getExtractedText interrupted", e);
|
||||
Log.e(LOGTAG, "IME: getExtractedText interrupted", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public CharSequence getTextAfterCursor(int length, int flags) {
|
||||
Log.d("GeckoAppJava", "IME: getTextAfterCursor");
|
||||
Log.d(LOGTAG, "IME: getTextAfterCursor");
|
||||
|
||||
GeckoAppShell.sendEventToGecko(
|
||||
new GeckoEvent(GeckoEvent.IME_GET_SELECTION, 0, 0));
|
||||
try {
|
||||
mQueryResult.take();
|
||||
} catch (InterruptedException e) {
|
||||
Log.e("GeckoAppJava", "IME: getTextBefore/AfterCursor interrupted", e);
|
||||
Log.e(LOGTAG, "IME: getTextBefore/AfterCursor interrupted", e);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -386,21 +388,21 @@ public class GeckoInputConnection
|
|||
try {
|
||||
return mQueryResult.take();
|
||||
} catch (InterruptedException e) {
|
||||
Log.e("GeckoAppJava", "IME: getTextBefore/AfterCursor: Interrupted!", e);
|
||||
Log.e(LOGTAG, "IME: getTextBefore/AfterCursor: Interrupted!", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public CharSequence getTextBeforeCursor(int length, int flags) {
|
||||
Log.d("GeckoAppJava", "IME: getTextBeforeCursor");
|
||||
Log.d(LOGTAG, "IME: getTextBeforeCursor");
|
||||
|
||||
return getTextAfterCursor(-length, flags);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setComposingText(CharSequence text, int newCursorPosition) {
|
||||
Log.d("GeckoAppJava", "IME: setComposingText");
|
||||
Log.d(LOGTAG, "IME: setComposingText");
|
||||
|
||||
enableChangeNotifications();
|
||||
|
||||
|
@ -414,7 +416,7 @@ public class GeckoInputConnection
|
|||
try {
|
||||
mQueryResult.take();
|
||||
} catch (InterruptedException e) {
|
||||
Log.e("GeckoAppJava", "IME: setComposingText interrupted", e);
|
||||
Log.e(LOGTAG, "IME: setComposingText interrupted", e);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -534,7 +536,7 @@ public class GeckoInputConnection
|
|||
|
||||
@Override
|
||||
public boolean setComposingRegion(int start, int end) {
|
||||
Log.d("GeckoAppJava", "IME: setComposingRegion(start=" + start + ", end=" + end + ")");
|
||||
Log.d(LOGTAG, "IME: setComposingRegion(start=" + start + ", end=" + end + ")");
|
||||
if (start < 0 || end < start)
|
||||
return true;
|
||||
|
||||
|
@ -552,7 +554,7 @@ public class GeckoInputConnection
|
|||
try {
|
||||
text = mQueryResult.take();
|
||||
} catch (InterruptedException e) {
|
||||
Log.e("GeckoAppJava", "IME: setComposingRegion interrupted", e);
|
||||
Log.e(LOGTAG, "IME: setComposingRegion interrupted", e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -568,7 +570,7 @@ public class GeckoInputConnection
|
|||
|
||||
@Override
|
||||
public boolean setSelection(int start, int end) {
|
||||
Log.d("GeckoAppJava", "IME: setSelection");
|
||||
Log.d(LOGTAG, "IME: setSelection");
|
||||
|
||||
if (mComposing) {
|
||||
/* Translate to fake selection positions */
|
||||
|
@ -616,7 +618,7 @@ public class GeckoInputConnection
|
|||
|
||||
public void notifyTextChange(InputMethodManager imm, String text,
|
||||
int start, int oldEnd, int newEnd) {
|
||||
Log.d("GeckoAppShell", String.format("IME: notifyTextChange: text=%s s=%d ne=%d oe=%d",
|
||||
Log.d(LOGTAG, String.format("IME: notifyTextChange: text=%s s=%d ne=%d oe=%d",
|
||||
text, start, newEnd, oldEnd));
|
||||
if (!mChangeNotificationsEnabled)
|
||||
return;
|
||||
|
@ -657,7 +659,7 @@ public class GeckoInputConnection
|
|||
|
||||
public void notifySelectionChange(InputMethodManager imm,
|
||||
int start, int end) {
|
||||
Log.d("GeckoAppJava", String.format("IME: notifySelectionChange: s=%d e=%d", start, end));
|
||||
Log.d(LOGTAG, String.format("IME: notifySelectionChange: s=%d e=%d", start, end));
|
||||
|
||||
if (!mChangeNotificationsEnabled)
|
||||
return;
|
||||
|
@ -700,7 +702,7 @@ public class GeckoInputConnection
|
|||
// TextWatcher
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count)
|
||||
{
|
||||
Log.d("GeckoAppShell", String.format("IME: onTextChanged: t=%s s=%d b=%d l=%d",
|
||||
Log.d(LOGTAG, String.format("IME: onTextChanged: t=%s s=%d b=%d l=%d",
|
||||
s, start, before, count));
|
||||
|
||||
mNumPendingChanges++;
|
||||
|
@ -751,7 +753,7 @@ public class GeckoInputConnection
|
|||
|
||||
public InputConnection onCreateInputConnection(EditorInfo outAttrs)
|
||||
{
|
||||
Log.d("GeckoAppJava", "IME: handleCreateInputConnection called");
|
||||
Log.d(LOGTAG, "IME: handleCreateInputConnection called");
|
||||
|
||||
outAttrs.inputType = InputType.TYPE_CLASS_TEXT;
|
||||
outAttrs.imeOptions = EditorInfo.IME_ACTION_NONE;
|
||||
|
@ -913,17 +915,17 @@ public class GeckoInputConnection
|
|||
|
||||
View v = GeckoApp.mAppContext.getLayerController().getView();
|
||||
|
||||
Log.d("GeckoAppJava", "notifyIME");
|
||||
Log.d(LOGTAG, "notifyIME");
|
||||
|
||||
if (v == null)
|
||||
return;
|
||||
|
||||
Log.d("GeckoAppJava", "notifyIME v!= null");
|
||||
Log.d(LOGTAG, "notifyIME v!= null");
|
||||
|
||||
switch (type) {
|
||||
case NOTIFY_IME_RESETINPUTSTATE:
|
||||
|
||||
Log.d("GeckoAppJava", "notifyIME = reset");
|
||||
Log.d(LOGTAG, "notifyIME = reset");
|
||||
// Composition event is already fired from widget.
|
||||
// So reset IME flags.
|
||||
reset();
|
||||
|
@ -945,12 +947,12 @@ public class GeckoInputConnection
|
|||
break;
|
||||
|
||||
case NOTIFY_IME_CANCELCOMPOSITION:
|
||||
Log.d("GeckoAppJava", "notifyIME = cancel");
|
||||
Log.d(LOGTAG, "notifyIME = cancel");
|
||||
IMEStateUpdater.resetIME();
|
||||
break;
|
||||
|
||||
case NOTIFY_IME_FOCUSCHANGE:
|
||||
Log.d("GeckoAppJava", "notifyIME = focus");
|
||||
Log.d(LOGTAG, "notifyIME = focus");
|
||||
IMEStateUpdater.resetIME();
|
||||
break;
|
||||
}
|
||||
|
@ -984,7 +986,7 @@ public class GeckoInputConnection
|
|||
if (imm == null)
|
||||
return;
|
||||
|
||||
Log.d("GeckoAppJava", String.format("IME: notifyIMEChange: t=%s s=%d ne=%d oe=%d",
|
||||
Log.d(LOGTAG, String.format("IME: notifyIMEChange: t=%s s=%d ne=%d oe=%d",
|
||||
text, start, newEnd, end));
|
||||
|
||||
if (newEnd < 0)
|
||||
|
@ -1033,13 +1035,13 @@ public class GeckoInputConnection
|
|||
}
|
||||
|
||||
public void run() {
|
||||
Log.d("GeckoAppJava", "IME: run()");
|
||||
Log.d(LOGTAG, "IME: run()");
|
||||
synchronized(IMEStateUpdater.class) {
|
||||
instance = null;
|
||||
}
|
||||
|
||||
View v = GeckoApp.mAppContext.getLayerController().getView();
|
||||
Log.d("GeckoAppJava", "IME: v="+v);
|
||||
Log.d(LOGTAG, "IME: v="+v);
|
||||
|
||||
InputMethodManager imm = (InputMethodManager) v.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
if (imm == null)
|
||||
|
|
|
@ -53,7 +53,8 @@ public class GeckoPreferences
|
|||
extends PreferenceActivity
|
||||
implements OnPreferenceChangeListener
|
||||
{
|
||||
private static final String LOG_FILE_NAME = "GeckoPreferences";
|
||||
private static final String LOGTAG = "GeckoPreferences";
|
||||
|
||||
private static Context sContext;
|
||||
private static JSONArray sJSONPrefs = null;
|
||||
private ArrayList<String> mPreferencesList = new ArrayList<String>();
|
||||
|
@ -157,7 +158,7 @@ public class GeckoPreferences
|
|||
}
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
Log.e(LOG_FILE_NAME, "Problem parsing preferences response: ", e);
|
||||
Log.e(LOGTAG, "Problem parsing preferences response: ", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -178,12 +179,12 @@ public class GeckoPreferences
|
|||
}
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
Log.e(LOG_FILE_NAME, "JSON exception: ", e);
|
||||
Log.e(LOGTAG, "JSON exception: ", e);
|
||||
return;
|
||||
}
|
||||
|
||||
if (jsonPref == null) {
|
||||
Log.e(LOG_FILE_NAME, "invalid preference given to setPreference()");
|
||||
Log.e(LOGTAG, "invalid preference given to setPreference()");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -51,7 +51,6 @@ import java.util.Date;
|
|||
import java.util.Locale;
|
||||
|
||||
public class GeckoThread extends Thread {
|
||||
|
||||
private static final String LOGTAG = "GeckoThread";
|
||||
|
||||
Intent mIntent;
|
||||
|
|
|
@ -50,6 +50,8 @@ import android.provider.Browser;
|
|||
import android.util.Log;
|
||||
|
||||
class GlobalHistory {
|
||||
private static final String LOGTAG = "GeckoGlobalHistory";
|
||||
|
||||
private static GlobalHistory sInstance = new GlobalHistory();
|
||||
|
||||
static GlobalHistory getInstance() {
|
||||
|
@ -60,7 +62,6 @@ class GlobalHistory {
|
|||
// this allows batching together multiple requests and processing them together,
|
||||
// which is more efficient.
|
||||
private static final long BATCHING_DELAY_MS = 100;
|
||||
private static final String LOG_NAME = "GlobalHistory";
|
||||
|
||||
private final Handler mHandler; // a background thread on which we can process requests
|
||||
private final Queue<String> mPendingUris; // URIs that need to be checked
|
||||
|
@ -77,7 +78,7 @@ class GlobalHistory {
|
|||
Set<String> visitedSet = mVisitedCache.get();
|
||||
if (visitedSet == null) {
|
||||
// the cache was wiped away, repopulate it
|
||||
Log.w(LOG_NAME, "Rebuilding visited link set...");
|
||||
Log.w(LOGTAG, "Rebuilding visited link set...");
|
||||
visitedSet = new HashSet<String>();
|
||||
Cursor c = GeckoApp.mAppContext.getContentResolver().query(Browser.BOOKMARKS_URI,
|
||||
new String[] { Browser.BookmarkColumns.URL },
|
||||
|
|
|
@ -50,6 +50,8 @@ import android.net.Uri;
|
|||
public class NotificationHandler
|
||||
extends BroadcastReceiver
|
||||
{
|
||||
private static final String LOGTAG = "GeckoNotificationHandler";
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
if (intent != null)
|
||||
|
@ -68,14 +70,14 @@ public class NotificationHandler
|
|||
alertCookie = "";
|
||||
}
|
||||
|
||||
Log.i("GeckoAppJava", "NotificationHandler.handleIntent\n" +
|
||||
Log.i(LOGTAG, "NotificationHandler.handleIntent\n" +
|
||||
"- action = '" + action + "'\n" +
|
||||
"- alertName = '" + alertName + "'\n" +
|
||||
"- alertCookie = '" + alertCookie + "'");
|
||||
|
||||
int notificationID = alertName.hashCode();
|
||||
|
||||
Log.i("GeckoAppJava", "Handle notification ID " + notificationID);
|
||||
Log.i(LOGTAG, "Handle notification ID " + notificationID);
|
||||
|
||||
if (App.mAppContext != null) {
|
||||
// This should call the observer, if any
|
||||
|
@ -93,11 +95,11 @@ public class NotificationHandler
|
|||
appIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
appIntent.putExtra("args", "-alert " + alertName + (alertCookie.length() > 0 ? "#" + alertCookie : ""));
|
||||
try {
|
||||
Log.i("GeckoAppJava", "startActivity with intent: Action='" + appIntent.getAction() + "'" +
|
||||
Log.i(LOGTAG, "startActivity with intent: Action='" + appIntent.getAction() + "'" +
|
||||
", args='" + appIntent.getStringExtra("args") + "'" );
|
||||
context.startActivity(appIntent);
|
||||
} catch (ActivityNotFoundException e) {
|
||||
Log.e("GeckoAppJava", "NotificationHandler Exception: ", e);
|
||||
Log.e(LOGTAG, "NotificationHandler Exception: ", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -72,9 +72,10 @@ import android.text.InputType;
|
|||
import android.app.AlertDialog;
|
||||
|
||||
public class PromptService implements OnClickListener, OnCancelListener, OnItemClickListener {
|
||||
private static final String LOGTAG = "GeckoPromptService";
|
||||
|
||||
private PromptInput[] mInputs;
|
||||
private AlertDialog mDialog = null;
|
||||
private static final String LOG_NAME = "GeckoPromptService";
|
||||
|
||||
private class PromptButton {
|
||||
public String label = "";
|
||||
|
@ -268,7 +269,7 @@ public class PromptService implements OnClickListener, OnCancelListener, OnItemC
|
|||
}
|
||||
}
|
||||
} catch(Exception ex) {
|
||||
Log.i(LOG_NAME, "Error building return: " + ex);
|
||||
Log.i(LOGTAG, "Error building return: " + ex);
|
||||
}
|
||||
|
||||
if (mDialog != null) {
|
||||
|
|
|
@ -46,10 +46,11 @@ import java.io.*;
|
|||
import org.mozilla.gecko.GeckoAppShell;
|
||||
|
||||
public class Restarter extends Activity {
|
||||
private static final String LOGTAG = "GeckoRestarter";
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
Log.i("Restarter", "trying to restart @MOZ_APP_NAME@");
|
||||
Log.i(LOGTAG, "trying to restart @MOZ_APP_NAME@");
|
||||
try {
|
||||
int countdown = 40;
|
||||
while (GeckoAppShell.checkForGeckoProcs() && --countdown > 0) {
|
||||
|
@ -71,7 +72,7 @@ public class Restarter extends Activity {
|
|||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.i("Restarter", e.toString());
|
||||
Log.i(LOGTAG, e.toString());
|
||||
}
|
||||
try {
|
||||
String action = "android.intent.action.MAIN";
|
||||
|
@ -82,10 +83,10 @@ public class Restarter extends Activity {
|
|||
if (b != null)
|
||||
intent.putExtras(b);
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
Log.i("GeckoAppJava", intent.toString());
|
||||
Log.i(LOGTAG, intent.toString());
|
||||
startActivity(intent);
|
||||
} catch (Exception e) {
|
||||
Log.i("Restarter", e.toString());
|
||||
Log.i(LOGTAG, e.toString());
|
||||
}
|
||||
// Give the new process time to start before we die
|
||||
GeckoAppShell.waitForAnotherGeckoProc();
|
||||
|
|
|
@ -57,8 +57,8 @@ import java.util.HashMap;
|
|||
import java.util.List;
|
||||
|
||||
public class Tab {
|
||||
private static final String LOGTAG = "GeckoTab";
|
||||
|
||||
private static final String LOG_NAME = "Tab";
|
||||
private int mId;
|
||||
private String mUrl;
|
||||
private String mTitle;
|
||||
|
@ -143,7 +143,7 @@ public class Tab {
|
|||
public void updateURL(String url) {
|
||||
if (url != null && url.length() > 0) {
|
||||
mUrl = new String(url);
|
||||
Log.i(LOG_NAME, "Updated url: " + url + " for tab with id: " + mId);
|
||||
Log.i(LOGTAG, "Updated url: " + url + " for tab with id: " + mId);
|
||||
updateBookmark();
|
||||
}
|
||||
}
|
||||
|
@ -155,7 +155,7 @@ public class Tab {
|
|||
mTitle = "";
|
||||
}
|
||||
|
||||
Log.i(LOG_NAME, "Updated title: " + mTitle + " for tab with id: " + mId);
|
||||
Log.i(LOGTAG, "Updated title: " + mTitle + " for tab with id: " + mId);
|
||||
|
||||
final HistoryEntry he = getLastHistoryEntry();
|
||||
if (he != null) {
|
||||
|
@ -166,7 +166,7 @@ public class Tab {
|
|||
}
|
||||
});
|
||||
} else {
|
||||
Log.e(LOG_NAME, "Requested title update on empty history stack");
|
||||
Log.e(LOGTAG, "Requested title update on empty history stack");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -186,12 +186,12 @@ public class Tab {
|
|||
|
||||
public void updateFavicon(Drawable favicon) {
|
||||
mFavicon = favicon;
|
||||
Log.i(LOG_NAME, "Updated favicon for tab with id: " + mId);
|
||||
Log.i(LOGTAG, "Updated favicon for tab with id: " + mId);
|
||||
}
|
||||
|
||||
public void updateFaviconURL(String faviconUrl) {
|
||||
mFaviconUrl = faviconUrl;
|
||||
Log.i(LOG_NAME, "Updated favicon URL for tab with id: " + mId);
|
||||
Log.i(LOGTAG, "Updated favicon URL for tab with id: " + mId);
|
||||
}
|
||||
|
||||
public void updateSecurityMode(String mode) {
|
||||
|
@ -296,20 +296,20 @@ public class Tab {
|
|||
});
|
||||
} else if (event.equals("Back")) {
|
||||
if (mHistoryIndex - 1 < 0) {
|
||||
Log.e(LOG_NAME, "Received unexpected back notification");
|
||||
Log.e(LOGTAG, "Received unexpected back notification");
|
||||
return;
|
||||
}
|
||||
mHistoryIndex--;
|
||||
} else if (event.equals("Forward")) {
|
||||
if (mHistoryIndex + 1 >= mHistory.size()) {
|
||||
Log.e(LOG_NAME, "Received unexpected forward notification");
|
||||
Log.e(LOGTAG, "Received unexpected forward notification");
|
||||
return;
|
||||
}
|
||||
mHistoryIndex++;
|
||||
} else if (event.equals("Goto")) {
|
||||
int index = message.getInt("index");
|
||||
if (index < 0 || index >= mHistory.size()) {
|
||||
Log.e(LOG_NAME, "Received unexpected history-goto notification");
|
||||
Log.e(LOGTAG, "Received unexpected history-goto notification");
|
||||
return;
|
||||
}
|
||||
mHistoryIndex = index;
|
||||
|
|
|
@ -46,8 +46,8 @@ import android.util.Log;
|
|||
import org.json.JSONObject;
|
||||
|
||||
public class Tabs implements GeckoEventListener {
|
||||
private static final String LOGTAG = "GeckoTabs";
|
||||
|
||||
private static final String LOG_NAME = "Tabs";
|
||||
private static int selectedTab = -1;
|
||||
private HashMap<Integer, Tab> tabs;
|
||||
private ArrayList<Tab> order;
|
||||
|
@ -74,7 +74,7 @@ public class Tabs implements GeckoEventListener {
|
|||
Tab tab = new Tab(id, url);
|
||||
tabs.put(id, tab);
|
||||
order.add(tab);
|
||||
Log.i(LOG_NAME, "Added a tab with id: " + id + ", url: " + url);
|
||||
Log.i(LOGTAG, "Added a tab with id: " + id + ", url: " + url);
|
||||
return tab;
|
||||
}
|
||||
|
||||
|
@ -82,7 +82,7 @@ public class Tabs implements GeckoEventListener {
|
|||
if (tabs.containsKey(id)) {
|
||||
order.remove(getTab(id));
|
||||
tabs.remove(id);
|
||||
Log.i(LOG_NAME, "Removed a tab with id: " + id);
|
||||
Log.i(LOGTAG, "Removed a tab with id: " + id);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -170,7 +170,7 @@ public class Tabs implements GeckoEventListener {
|
|||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.i(LOG_NAME, "handleMessage throws " + e + " for message: " + event);
|
||||
Log.i(LOGTAG, "handleMessage throws " + e + " for message: " + event);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ public class PanZoomController
|
|||
extends GestureDetector.SimpleOnGestureListener
|
||||
implements ScaleGestureDetector.OnScaleGestureListener
|
||||
{
|
||||
private static final String LOG_NAME = "PanZoomController";
|
||||
private static final String LOGTAG = "GeckoPanZoomController";
|
||||
|
||||
private LayerController mController;
|
||||
|
||||
|
@ -148,7 +148,7 @@ public class PanZoomController
|
|||
mState = PanZoomState.PINCHING;
|
||||
return false;
|
||||
}
|
||||
Log.e(LOG_NAME, "Unhandled case " + mState + " in onTouchStart");
|
||||
Log.e(LOGTAG, "Unhandled case " + mState + " in onTouchStart");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -157,7 +157,7 @@ public class PanZoomController
|
|||
case NOTHING:
|
||||
case FLING:
|
||||
// should never happen
|
||||
Log.e(LOG_NAME, "Received impossible touch move while in " + mState);
|
||||
Log.e(LOGTAG, "Received impossible touch move while in " + mState);
|
||||
return false;
|
||||
case TOUCHING:
|
||||
mLastTimestamp = System.currentTimeMillis();
|
||||
|
@ -174,7 +174,7 @@ public class PanZoomController
|
|||
// scale gesture listener will handle this
|
||||
return false;
|
||||
}
|
||||
Log.e(LOG_NAME, "Unhandled case " + mState + " in onTouchMove");
|
||||
Log.e(LOGTAG, "Unhandled case " + mState + " in onTouchMove");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -183,7 +183,7 @@ public class PanZoomController
|
|||
case NOTHING:
|
||||
case FLING:
|
||||
// should never happen
|
||||
Log.e(LOG_NAME, "Received impossible touch end while in " + mState);
|
||||
Log.e(LOGTAG, "Received impossible touch end while in " + mState);
|
||||
return false;
|
||||
case TOUCHING:
|
||||
mState = PanZoomState.NOTHING;
|
||||
|
@ -210,7 +210,7 @@ public class PanZoomController
|
|||
}
|
||||
return true;
|
||||
}
|
||||
Log.e(LOG_NAME, "Unhandled case " + mState + " in onTouchEnd");
|
||||
Log.e(LOGTAG, "Unhandled case " + mState + " in onTouchEnd");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -601,7 +601,7 @@ public class PanZoomController
|
|||
ret.put("x", (int)Math.round(point.x));
|
||||
ret.put("y", (int)Math.round(point.y));
|
||||
} catch(Exception ex) {
|
||||
Log.w(LOG_NAME, "Error building return: " + ex);
|
||||
Log.w(LOGTAG, "Error building return: " + ex);
|
||||
}
|
||||
|
||||
GeckoEvent e = new GeckoEvent("Gesture:LongPress", ret.toString());
|
||||
|
|
Загрузка…
Ссылка в новой задаче