Skip to content

Instantly share code, notes, and snippets.

@rnewman
rnewman / gist:4fc8ef4b944b0fc3808b
Created May 12, 2014 20:13
Successful history and tabs sync taking 17 seconds
1399924895573 Sync.ErrorHandler DEBUG Flushing file log.
1399924895574 Sync.ErrorHandler TRACE Beginning stream copy to success-1399924895574.txt: 1399924895574
1399924895583 Sync.Tracker.Passwords DEBUG Saving changed IDs to passwords
1399924895718 Sync.ErrorHandler TRACE Notifying weave:ui:sync:finish. Status.login is success.login. Status.sync is success.sync
1399924895719 Sync.Status DEBUG Status.service: success.status_ok => success.status_ok
1399924895720 Sync.Status DEBUG Status.service: success.status_ok => success.status_ok
1399924895722 Sync.Status DEBUG Status.service: success.status_ok => success.status_ok
1399924895723 Sync.Status DEBUG Status.service: success.status_ok => success.status_ok
1399924895725 Sync.Status DEBUG Status.service: success.status_ok => success.status_ok
1399924895726 Sync.Status DEBUG Status.service: success.status_ok => success.status_ok
01-06 03:02:32.800 W/MemoSwitchView( 705): current view = com.huawei.android.myrichpad.MemoSwitchView@406413d8
01-06 03:02:34.700 D/GeckoApp( 952): Enabling Android StrictMode
01-06 03:02:35.060 D/GeckoScreenOrientation( 952): updating to new orientation PORTRAIT_PRIMARY
01-06 03:02:35.330 D/libEGL ( 952): loaded /system/lib/egl/libGLES_android.so
01-06 03:02:35.370 D/libEGL ( 952): loaded /system/lib/egl/libEGL_adreno200.so
01-06 03:02:35.760 D/libEGL ( 952): loaded /system/lib/egl/libGLESv1_CM_adreno200.so
01-06 03:02:35.770 D/libEGL ( 952): loaded /system/lib/egl/libGLESv2_adreno200.so
01-06 03:02:36.060 I/ListView( 952): maxScrollFactorString = null
01-06 03:02:36.130 D/GeckoSharedPrefs( 952): Current version = 0, prefs version = 1
01-06 03:02:36.130 D/GeckoSharedPrefs( 952): Performing migration
@rnewman
rnewman / gist:f7f0d6740f9a2ee5a613
Created April 29, 2014 19:42
How to get the label for a resource ID
package android.content.res;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
public class AssetManagerSnooper {
/**
* Use reflection to find the resource name for the given ID.
*/
public static final String getNameForID(AssetManager assets, int id) throws NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException {
@rnewman
rnewman / gist:11298776
Created April 25, 2014 18:26
Spot the bug
public int getDominantColor(String key) {
startRead();
try {
FaviconsForURL element = permanentBackingMap.get(key);
if (element == null) {
element = backingMap.get(key);
}
if (element == null) {
04-24 18:17:02.890 I/FaviconCache( 3960): Starting read.
04-24 18:17:02.890 I/FaviconCache( 3960): Read: after turn semaphore.
04-24 18:17:02.890 I/FaviconCache( 3960): Acquiring write lock.
04-24 18:17:02.890 W/FaviconCache( 3960): Cannot compute dominant color of non-cached favicon. Cache fullness 83968/524288
04-24 18:17:02.890 I/FaviconCache( 3960): finishRead.
04-24 18:17:02.890 I/FaviconCache( 3960): finishRead... releasing.
04-24 18:17:02.900 I/FaviconCache( 3960): releasing.
04-24 18:17:02.900 I/FaviconCache( 3960): java.lang.RuntimeException: stack
04-24 18:17:02.900 I/FaviconCache( 3960): at org.mozilla.gecko.favicons.cache.FaviconCache.releaseWriteLock(FaviconCache.java:482)
04-24 18:17:02.900 I/FaviconCache( 3960): at org.mozilla.gecko.favicons.cache.FaviconCache.finishRead(FaviconCache.java:173)
private void expectNoPermits(String method) {
final int availablePermits = writeLock.availablePermits();
if (availablePermits != 0) {
throw new RuntimeException(method + " has " + availablePermits + " permits. Expected 0.");
}
}
private boolean setMostRecentlyUsedWithinRead(FaviconCacheElement element) {
expectNoPermits("setMostRecentlyUsedWithinRead");
@rnewman
rnewman / gist:11016959
Created April 17, 2014 23:24
.mozconfig
ac_add_options --with-android-ndk="/Users/rnewman/moz/android/android-ndk-r8e"
# Android options
ac_add_options --enable-application=mobile/android
ac_add_options --with-android-ndk="/Users/rnewman/moz/android/android-ndk-r8e"
ac_add_options --with-android-sdk="/Users/rnewman/moz/android/android-sdk-macosx/platforms/android-17"
ac_add_options --with-android-version=9
ac_add_options --with-android-tools="/Users/rnewman/moz/android/android-sdk-macosx/tools"
# ARM
@rnewman
rnewman / gist:11016925
Created April 17, 2014 23:24
locales.sh
pushd objdir-droid/mobile/android/locales && \
for loc in $(cat ../../../../mobile/android/locales/maemo-locales); do LOCALE_MERGEDIR=$PWD/merge-$loc make merge-$loc LOCALE_MERGEDIR=$PWD/merge-$loc; make LOCALE_MERGEDIR=$PWD/merge-$loc chrome-$loc LOCALE_MERGEDIR=$PWD/merge-$loc; done && \
popd
@rnewman
rnewman / coast
Created September 25, 2013 03:56
Notes on Coast
* Swipe vs tap on home screen doesn't work well. Took three tries to tap Reddit.
* No feedback on loading speed. Sluggish.
* Minimal feedback. In the seven tries tapping on the link I wanted, it registered a click on the item above. I didn't know until that page loaded. You do get a grey outline when you successfully tap a link, but not when you fail. *Something* is different versus other browsers...
* Swipe-for-back kinda collides with pinch-to-zoom-out if you have a light touch. This is really annoying.
* It covers the previous page with pinstripes when loading 'back'. It's really annoying. In fact, the whole browsing experience feels like a clunky browser trying to be smooth.
* imgur captures swipes! That sucks a lot when your only controls are swipes. You can only 'escape' by accidentally opening the "Back stack" view. I still don't know how this works.
* You can view URLs, safety, info, etc by swiping down from a page in the "Back stack".
* Coast really suffers from lack of intents.
@rnewman
rnewman / each-commit
Created June 14, 2013 19:58
Dump an individual git commit.
REPO=~/moz/hg/mozilla-inbound
COMMIT=$1
echo "Processing commit $COMMIT into repo $REPO..."
SUMMARY=$(git show --format="%s" $COMMIT | head -n 1)
FILENAME=$(echo "$SUMMARY" | cut -c 1-24 | sed 's/[^_A-Za-z0-9]/-/g' | tr [A-Z] [a-z])
echo "Summary is \"$SUMMARY\"..."
echo "Filename is \"$FILENAME\"..."
git hgshow $COMMIT | sed 's,src/main/java/org/mozilla/gecko/sync/,mobile/android/base/sync/,g' | sed 's,twinql\.com,mozilla.com,' | hg -R $REPO qimport -g -P -n $FILENAME -