merge fx-team to mozilla-central a=merge

This commit is contained in:
Carsten "Tomcat" Book 2014-09-09 15:58:58 +02:00
commit e2e59cc01e
46 changed files with 376 additions and 292 deletions

View File

@ -126,7 +126,8 @@ class RemoteAutomation(Automation):
self.deleteANRs()
except DMError:
print "Error pulling %s" % traces
pass
except IOError:
print "Error pulling %s" % traces
else:
print "%s not found" % traces

View File

@ -42,7 +42,7 @@ public class VideoCaptureAndroid implements PreviewCallback, Callback, AppStateL
private final static String TAG = "WEBRTC-JC";
// Only non-null while capturing, accessed exclusively from synchronized methods.
/* inner-access */ Camera camera;
Camera camera;
private Camera.CameraInfo info;
private final int id;
private final long native_capturer; // |VideoCaptureAndroid*| in C++.
@ -55,14 +55,14 @@ public class VideoCaptureAndroid implements PreviewCallback, Callback, AppStateL
private final int numCaptureBuffers = 3;
// Needed to start/stop/rotate camera.
/* inner-access */ volatile int mCaptureRotation;
/* inner-access */ int mCaptureWidth;
/* inner-access */ int mCaptureHeight;
/* inner-access */ int mCaptureMinFPS;
/* inner-access */ int mCaptureMaxFPS;
volatile int mCaptureRotation;
int mCaptureWidth;
int mCaptureHeight;
int mCaptureMinFPS;
int mCaptureMaxFPS;
// Are we being told to start/stop the camera, or just suspending/resuming
// due to the application being backgrounded.
/* inner-access */ boolean mResumeCapture;
boolean mResumeCapture;
@WebRTCJNITarget
public VideoCaptureAndroid(int id, long native_capturer) {

View File

@ -29,7 +29,7 @@ import org.mozilla.gecko.mozglue.WebRTCJNITarget;
public class ViEAndroidGLES20 extends GLSurfaceView
implements GLSurfaceView.Renderer {
/* inner-access */ static final String TAG = "WEBRTC-JR";
static final String TAG = "WEBRTC-JR";
private static final boolean DEBUG = false;
// True if onSurfaceCreated has been called.
@ -106,7 +106,7 @@ public class ViEAndroidGLES20 extends GLSurfaceView
}
}
/* inner-access */ static void checkEglError(String prompt, EGL10 egl) {
static void checkEglError(String prompt, EGL10 egl) {
int error;
while ((error = egl.eglGetError()) != EGL10.EGL_SUCCESS) {
Log.e(TAG, String.format("%s: EGL error: 0x%x", prompt, error));

View File

@ -2270,8 +2270,13 @@ public class BrowserApp extends GeckoApp
if (info.parent == 0) {
destination = menu;
} else if (info.parent == GECKO_TOOLS_MENU) {
MenuItem tools = menu.findItem(R.id.tools);
destination = tools != null ? tools.getSubMenu() : menu;
// The tools menu only exists in our -v11 resources.
if (Versions.feature11Plus) {
MenuItem tools = menu.findItem(R.id.tools);
destination = tools != null ? tools.getSubMenu() : menu;
} else {
destination = menu;
}
} else {
MenuItem parent = menu.findItem(info.parent);
if (parent == null) {
@ -2519,8 +2524,11 @@ public class BrowserApp extends GeckoApp
findInPage.setEnabled(false);
// NOTE: Use MenuUtils.safeSetEnabled because some actions might
// be on the BrowserToolbar context menu
MenuUtils.safeSetEnabled(aMenu, R.id.page, false);
// be on the BrowserToolbar context menu.
if (Versions.feature11Plus) {
// There is no page menu prior to v11 resources.
MenuUtils.safeSetEnabled(aMenu, R.id.page, false);
}
MenuUtils.safeSetEnabled(aMenu, R.id.subscribe, false);
MenuUtils.safeSetEnabled(aMenu, R.id.add_search_engine, false);
MenuUtils.safeSetEnabled(aMenu, R.id.site_settings, false);
@ -2557,8 +2565,10 @@ public class BrowserApp extends GeckoApp
MenuUtils.safeSetEnabled(aMenu, R.id.downloads, !inGuestMode);
// NOTE: Use MenuUtils.safeSetEnabled because some actions might
// be on the BrowserToolbar context menu
MenuUtils.safeSetEnabled(aMenu, R.id.page, !isAboutHome(tab));
// be on the BrowserToolbar context menu.
if (Versions.feature11Plus) {
MenuUtils.safeSetEnabled(aMenu, R.id.page, !isAboutHome(tab));
}
MenuUtils.safeSetEnabled(aMenu, R.id.subscribe, tab.hasFeeds());
MenuUtils.safeSetEnabled(aMenu, R.id.add_search_engine, tab.hasOpenSearch());
MenuUtils.safeSetEnabled(aMenu, R.id.site_settings, !isAboutHome(tab));

View File

@ -173,7 +173,7 @@ class FilePickerResultHandler implements ActivityResultHandler {
private final Uri uri;
private final File cacheDir;
private final int tabId;
/* inner-access */ String tempFile;
String tempFile;
public FileLoaderCallbacks(Uri uri, File cacheDir, int tabId) {
this.uri = uri;

View File

@ -35,7 +35,7 @@ public class LightweightTheme implements GeckoEventListener {
private static final String LOGTAG = "GeckoLightweightTheme";
private final Application mApplication;
/* inner-access */ final Handler mHandler;
final Handler mHandler;
private Bitmap mBitmap;
private int mColor;

View File

@ -24,7 +24,7 @@ public final class PrefsHelper {
private static boolean sRegistered;
private static int sUniqueRequestId = 1;
/* inner-access */ static final SparseArray<PrefHandler> sCallbacks = new SparseArray<PrefHandler>();
static final SparseArray<PrefHandler> sCallbacks = new SparseArray<PrefHandler>();
public static int getPref(String prefName, PrefHandler callback) {
return getPrefsInternal(new String[] { prefName }, callback);

View File

@ -52,7 +52,7 @@ public class PropertyAnimator implements Runnable {
private float mDurationReciprocal;
private List<ElementHolder> mElementsList;
private List<PropertyAnimationListener> mListeners;
/* inner-access */ FramePoster mFramePoster;
FramePoster mFramePoster;
private boolean mUseHardwareLayer;
public PropertyAnimator(long duration) {

View File

@ -541,14 +541,12 @@ public class LocalBrowserDB {
columns = new String[] { Favicons._ID };
}
if (uri != null) {
Cursor cursor = null;
final Cursor cursor = cr.query(uri, columns, constraint, null, null);
try {
cursor = cr.query(uri, columns, constraint, null, null);
count = cursor.getCount();
} finally {
if (cursor != null)
cursor.close();
cursor.close();
}
}
debug("Got count " + count + " for " + database);
@ -731,73 +729,68 @@ public class LocalBrowserDB {
// Returns true if any desktop bookmarks exist, which will be true if the user
// has set up sync at one point, or done a profile migration from XUL fennec.
private boolean desktopBookmarksExist(ContentResolver cr) {
if (mDesktopBookmarksExist != null)
if (mDesktopBookmarksExist != null) {
return mDesktopBookmarksExist;
Cursor c = null;
int count = 0;
try {
// Check to see if there are any bookmarks in one of our three
// fixed "Desktop Boomarks" folders.
c = cr.query(bookmarksUriWithLimit(1),
new String[] { Bookmarks._ID },
Bookmarks.PARENT + " = ? OR " +
Bookmarks.PARENT + " = ? OR " +
Bookmarks.PARENT + " = ?",
new String[] { String.valueOf(getFolderIdFromGuid(cr, Bookmarks.TOOLBAR_FOLDER_GUID)),
String.valueOf(getFolderIdFromGuid(cr, Bookmarks.MENU_FOLDER_GUID)),
String.valueOf(getFolderIdFromGuid(cr, Bookmarks.UNFILED_FOLDER_GUID)) },
null);
count = c.getCount();
} finally {
if (c != null)
c.close();
}
// Cache result for future queries
mDesktopBookmarksExist = (count > 0);
// Check to see if there are any bookmarks in one of our three
// fixed "Desktop Bookmarks" folders.
final Cursor c = cr.query(bookmarksUriWithLimit(1),
new String[] { Bookmarks._ID },
Bookmarks.PARENT + " = ? OR " +
Bookmarks.PARENT + " = ? OR " +
Bookmarks.PARENT + " = ?",
new String[] { String.valueOf(getFolderIdFromGuid(cr, Bookmarks.TOOLBAR_FOLDER_GUID)),
String.valueOf(getFolderIdFromGuid(cr, Bookmarks.MENU_FOLDER_GUID)),
String.valueOf(getFolderIdFromGuid(cr, Bookmarks.UNFILED_FOLDER_GUID)) },
null);
try {
mDesktopBookmarksExist = c.getCount() > 0;
} finally {
c.close();
}
return mDesktopBookmarksExist;
}
@RobocopTarget
public boolean isBookmark(ContentResolver cr, String uri) {
Cursor c = null;
try {
c = cr.query(bookmarksUriWithLimit(1),
new String[] { Bookmarks._ID },
Bookmarks.URL + " = ? AND " +
Bookmarks.PARENT + " != ?",
new String[] { uri,
String.valueOf(Bookmarks.FIXED_PINNED_LIST_ID) },
Bookmarks.URL);
return c.getCount() > 0;
} catch (NullPointerException e) {
Log.e(LOGTAG, "NullPointerException in isBookmark");
} finally {
if (c != null)
c.close();
final Cursor c = cr.query(bookmarksUriWithLimit(1),
new String[] { Bookmarks._ID },
Bookmarks.URL + " = ? AND " + Bookmarks.PARENT + " != ?",
new String[] { uri, String.valueOf(Bookmarks.FIXED_PINNED_LIST_ID) },
Bookmarks.URL);
if (c == null) {
Log.e(LOGTAG, "Null cursor in isBookmark");
return false;
}
return false;
try {
return c.getCount() > 0;
} finally {
c.close();
}
}
public boolean isReadingListItem(ContentResolver cr, String uri) {
Cursor c = null;
try {
c = cr.query(mReadingListUriWithProfile,
new String[] { ReadingListItems._ID },
ReadingListItems.URL + " = ? ",
new String[] { uri },
null);
return c.getCount() > 0;
} catch (NullPointerException e) {
Log.e(LOGTAG, "NullPointerException in isReadingListItem");
} finally {
if (c != null)
c.close();
final Cursor c = cr.query(mReadingListUriWithProfile,
new String[] { ReadingListItems._ID },
ReadingListItems.URL + " = ? ",
new String[] { uri },
null);
if (c == null) {
Log.e(LOGTAG, "Null cursor in isReadingListItem");
return false;
}
return false;
try {
return c.getCount() > 0;
} finally {
c.close();
}
}
/**
@ -828,22 +821,20 @@ public class LocalBrowserDB {
}
public String getUrlForKeyword(ContentResolver cr, String keyword) {
Cursor c = null;
final Cursor c = cr.query(mBookmarksUriWithProfile,
new String[] { Bookmarks.URL },
Bookmarks.KEYWORD + " = ?",
new String[] { keyword },
null);
try {
c = cr.query(mBookmarksUriWithProfile,
new String[] { Bookmarks.URL },
Bookmarks.KEYWORD + " = ?",
new String[] { keyword },
null);
if (!c.moveToFirst()) {
return null;
}
if (c.moveToFirst())
return c.getString(c.getColumnIndexOrThrow(Bookmarks.URL));
return c.getString(c.getColumnIndexOrThrow(Bookmarks.URL));
} finally {
if (c != null)
c.close();
c.close();
}
return null;
}
private synchronized long getFolderIdFromGuid(final ContentResolver cr, final String guid) {
@ -896,22 +887,20 @@ public class LocalBrowserDB {
values.put(Bookmarks.DATE_MODIFIED, now);
// Get the page's favicon ID from the history table
Cursor c = null;
final Cursor c = cr.query(mHistoryUriWithProfile,
new String[] { History.FAVICON_ID },
History.URL + " = ?",
new String[] { uri },
null);
try {
c = cr.query(mHistoryUriWithProfile,
new String[] { History.FAVICON_ID },
History.URL + " = ?",
new String[] { uri },
null);
if (c.moveToFirst()) {
int columnIndex = c.getColumnIndexOrThrow(History.FAVICON_ID);
if (!c.isNull(columnIndex))
if (!c.isNull(columnIndex)) {
values.put(Bookmarks.FAVICON_ID, c.getLong(columnIndex));
}
}
} finally {
if (c != null)
c.close();
c.close();
}
// Restore deleted record if possible
@ -1012,16 +1001,14 @@ public class LocalBrowserDB {
* @return The decoded Bitmap from the database, if any. null if none is stored.
*/
public LoadFaviconResult getFaviconForUrl(ContentResolver cr, String faviconURL) {
Cursor c = null;
final Cursor c = cr.query(mFaviconsUriWithProfile,
new String[] { Favicons.DATA },
Favicons.URL + " = ? AND " + Favicons.DATA + " IS NOT NULL",
new String[] { faviconURL },
null);
byte[] b = null;
try {
c = cr.query(mFaviconsUriWithProfile,
new String[] { Favicons.DATA },
Favicons.URL + " = ? AND " + Favicons.DATA + " IS NOT NULL",
new String[] { faviconURL },
null);
if (!c.moveToFirst()) {
return null;
}
@ -1029,9 +1016,7 @@ public class LocalBrowserDB {
final int faviconIndex = c.getColumnIndexOrThrow(Favicons.DATA);
b = c.getBlob(faviconIndex);
} finally {
if (c != null) {
c.close();
}
c.close();
}
if (b == null) {
@ -1042,23 +1027,21 @@ public class LocalBrowserDB {
}
public String getFaviconUrlForHistoryUrl(ContentResolver cr, String uri) {
Cursor c = null;
final Cursor c = cr.query(mHistoryUriWithProfile,
new String[] { History.FAVICON_URL },
Combined.URL + " = ?",
new String[] { uri },
null);
try {
c = cr.query(mHistoryUriWithProfile,
new String[] { History.FAVICON_URL },
Combined.URL + " = ?",
new String[] { uri },
null);
if (!c.moveToFirst()) {
return null;
}
if (c.moveToFirst())
return c.getString(c.getColumnIndexOrThrow(History.FAVICON_URL));
return c.getString(c.getColumnIndexOrThrow(History.FAVICON_URL));
} finally {
if (c != null)
c.close();
c.close();
}
return null;
}
public void updateFaviconForUrl(ContentResolver cr, String pageUri,
@ -1111,28 +1094,23 @@ public class LocalBrowserDB {
@RobocopTarget
public byte[] getThumbnailForUrl(ContentResolver cr, String uri) {
Cursor c = null;
byte[] b = null;
final Cursor c = cr.query(mThumbnailsUriWithProfile,
new String[]{ Thumbnails.DATA },
Thumbnails.URL + " = ? AND " + Thumbnails.DATA + " IS NOT NULL",
new String[]{ uri },
null);
try {
c = cr.query(mThumbnailsUriWithProfile,
new String[]{ Thumbnails.DATA },
Thumbnails.URL + " = ? AND " + Thumbnails.DATA + " IS NOT NULL",
new String[]{ uri },
null);
if (!c.moveToFirst()) {
return null;
}
int thumbnailIndex = c.getColumnIndexOrThrow(Thumbnails.DATA);
b = c.getBlob(thumbnailIndex);
return c.getBlob(thumbnailIndex);
} finally {
if (c != null) {
c.close();
}
c.close();
}
return b;
}
/**
@ -1174,22 +1152,21 @@ public class LocalBrowserDB {
Collection<ContentProviderOperation> operations,
String url, String title,
long date, int visits) {
Cursor cursor = null;
final String[] projection = {
History._ID,
History.VISITS,
History.DATE_LAST_VISITED
};
// We need to get the old visit count.
final Cursor cursor = cr.query(getAllHistoryUri(),
projection,
History.URL + " = ?",
new String[] { url },
null);
try {
final String[] projection = new String[] {
History._ID,
History.VISITS,
History.DATE_LAST_VISITED
};
// We need to get the old visit count.
cursor = cr.query(getAllHistoryUri(),
projection,
History.URL + " = ?",
new String[] { url },
null);
ContentValues values = new ContentValues();
// Restore deleted record if possible
@ -1226,8 +1203,7 @@ public class LocalBrowserDB {
// Queue the operation
operations.add(builder.build());
} finally {
if (cursor != null)
cursor.close();
cursor.close();
}
}

View File

@ -144,9 +144,9 @@ public class SuggestedSites {
}
}
/* inner-access */ final Context context;
/* inner-access */ final Distribution distribution;
/* inner-access */ final File file;
final Context context;
final Distribution distribution;
final File file;
private Map<String, Site> cachedSites;
private Set<String> cachedBlacklist;
@ -235,7 +235,7 @@ public class SuggestedSites {
* Saves suggested sites file to disk. Access to this method should
* be synchronized on 'file'.
*/
/* inner-access */ static void saveSites(File f, Map<String, Site> sites) {
static void saveSites(File f, Map<String, Site> sites) {
ThreadUtils.assertNotOnUiThread();
if (sites == null || sites.isEmpty()) {
@ -313,7 +313,7 @@ public class SuggestedSites {
* It's assumed that the given distribution instance is ready to be
* used and exists.
*/
/* inner-access */ static Map<String, Site> loadFromDistribution(Distribution dist) {
static Map<String, Site> loadFromDistribution(Distribution dist) {
for (Locale locale : getAcceptableLocales()) {
try {
final String languageTag = BrowserLocaleManager.getLanguageTag(locale);
@ -350,7 +350,7 @@ public class SuggestedSites {
return null;
}
/* inner-access */ Map<String, Site> loadFromResource() {
Map<String, Site> loadFromResource() {
try {
return loadSites(RawResource.getAsString(context, R.raw.suggestedsites));
} catch (IOException e) {

View File

@ -61,7 +61,7 @@ public class LoadFaviconTask {
private final int flags;
private final boolean onlyFromLocal;
/* inner-access */ volatile boolean mCancelled;
volatile boolean mCancelled;
// Assuming square favicons, judging by width only is acceptable.
protected int targetWidth;
@ -355,7 +355,7 @@ public class LoadFaviconTask {
return mCancelled;
}
/* inner-access */ Bitmap doInBackground() {
Bitmap doInBackground() {
if (isCancelled()) {
return null;
}
@ -520,7 +520,7 @@ public class LoadFaviconTask {
image.getHeight() > 0;
}
/* inner-access */ void onPostExecute(Bitmap image) {
void onPostExecute(Bitmap image) {
if (isChaining) {
return;
}
@ -564,7 +564,7 @@ public class LoadFaviconTask {
Favicons.dispatchResult(pageUrl, faviconURL, scaled, listener);
}
/* inner-access */ void onCancelled() {
void onCancelled() {
Favicons.removeLoadTask(id);
synchronized(loadsInFlight) {

View File

@ -84,7 +84,7 @@ public class ICODecoder implements Iterable<Bitmap> {
private int offset;
private int len;
/* inner-access */ IconDirectoryEntry[] iconDirectory;
IconDirectoryEntry[] iconDirectory;
private boolean isValid;
private boolean hasDecoded;

View File

@ -88,8 +88,8 @@ public class BrowserHealthRecorder implements HealthRecorder, GeckoEventListener
private final AtomicBoolean orphanChecked = new AtomicBoolean(false);
private volatile int env = -1;
/* inner-access */ final EventDispatcher dispatcher;
/* inner-access */ final ProfileInformationCache profileCache;
final EventDispatcher dispatcher;
final ProfileInformationCache profileCache;
private ContentProviderClient client;
private volatile HealthReportDatabaseStorage storage;
private final ConfigurationProvider configProvider;
@ -649,7 +649,7 @@ public class BrowserHealthRecorder implements HealthRecorder, GeckoEventListener
"bartext",
})));
/* inner-access */ void initializeSearchProvider() {
void initializeSearchProvider() {
this.storage.ensureMeasurementInitialized(
MEASUREMENT_NAME_SEARCH_COUNTS,
MEASUREMENT_VERSION_SEARCH_COUNTS,
@ -784,7 +784,7 @@ public class BrowserHealthRecorder implements HealthRecorder, GeckoEventListener
public static final String MEASUREMENT_NAME_SESSIONS = "org.mozilla.appSessions";
public static final int MEASUREMENT_VERSION_SESSIONS = 4;
/* inner-access */ void initializeSessionsProvider() {
void initializeSessionsProvider() {
this.storage.ensureMeasurementInitialized(
MEASUREMENT_NAME_SESSIONS,
MEASUREMENT_VERSION_SESSIONS,

View File

@ -112,7 +112,7 @@ public class GeckoMenu extends ListView
private MenuItemsAdapter mAdapter;
// Show/hide icons in the list.
/* inner-access */ boolean mShowIcons;
boolean mShowIcons;
public GeckoMenu(Context context) {
this(context, null);
@ -550,7 +550,7 @@ public class GeckoMenu extends ListView
handleMenuItemClick(item);
}
/* inner-access */ void handleMenuItemClick(GeckoMenuItem item) {
void handleMenuItemClick(GeckoMenuItem item) {
if (!item.isEnabled())
return;
@ -575,7 +575,7 @@ public class GeckoMenu extends ListView
}
}
/* inner-access */ void handleMenuItemLongClick(GeckoMenuItem item) {
void handleMenuItemLongClick(GeckoMenuItem item) {
if(!item.isEnabled()) {
return;
}

View File

@ -48,8 +48,8 @@ public class GeckoMenuItem implements MenuItem {
private GeckoActionProvider mActionProvider;
private GeckoSubMenu mSubMenu;
private MenuItem.OnMenuItemClickListener mMenuItemClickListener;
/* inner-access */ final GeckoMenu mMenu;
/* inner-access */ OnShowAsActionChangedListener mShowAsActionChangedListener;
final GeckoMenu mMenu;
OnShowAsActionChangedListener mShowAsActionChangedListener;
public GeckoMenuItem(GeckoMenu menu, int id, int order, int titleRes) {
mMenu = menu;

View File

@ -53,4 +53,9 @@
</view>
<!-- To preserve the ID, even when building for pre-11. -->
<RelativeLayout android:id="@+id/tabs_panel_footer"
android:layout_height="0dp"
android:layout_width="0dp"
android:visibility="gone"/>
</merge>

View File

@ -71,4 +71,20 @@
android:icon="@drawable/ic_menu_guest"
android:visible="false"
android:title="@string/exit_guest_session"/>
<!-- Android will eliminate v11+ resource files from pre-11 builds.
Those files are the only place in which certain IDs are defined.
This causes compilation errors.
To avoid nasty code workarounds, we define stub IDs here, but
hide the menu entries. -->
<item android:id="@+id/page"
android:visible="false"
android:enabled="false"
android:title="@string/page" />
<item android:id="@+id/tools"
android:visible="false"
android:enabled="false"
android:title="@string/tools" />
</menu>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!-- Stub to preserve IDs. -->
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/restore_defaults" />
</menu>

View File

@ -71,4 +71,11 @@
<item name="android:layout_gravity">center</item>
</style>
<style name="Widget.Home.HistoryListView">
<item name="android:paddingLeft">50dp</item>
<item name="android:paddingRight">100dp</item>
<item name="android:paddingTop">0dp</item>
<item name="android:scrollbarStyle">outsideOverlay</item>
</style>
</resources>

View File

@ -39,14 +39,6 @@
<item name="android:verticalSpacing">20dp</item>
</style>
<style name="Widget.Home.HistoryListView">
<item name="android:paddingLeft">50dp</item>
<item name="android:paddingRight">100dp</item>
<item name="android:paddingTop">30dp</item>
<item name="android:scrollbarStyle">outsideOverlay</item>
<item name="topDivider">true</item>
</style>
<!-- Tabs panel -->
<style name="TabsPanelFrame" parent="TabsPanelFrameBase">
<item name="android:paddingTop">32dp</item>

View File

@ -78,12 +78,6 @@
<style name="Widget.ReadingListView" parent="Widget.BookmarksListView"/>
<style name="Widget.Home.HistoryListView">
<item name="android:paddingLeft">32dp</item>
<item name="android:paddingRight">32dp</item>
<item name="android:scrollbarStyle">outsideOverlay</item>
</style>
<style name="Widget.HomeBanner">
<item name="android:paddingLeft">32dp</item>
<item name="android:paddingRight">32dp</item>

View File

@ -62,6 +62,12 @@
<item name="android:listSelector">@drawable/action_bar_button</item>
</style>
<style name="Widget.Home.HistoryListView">
<item name="android:paddingLeft">32dp</item>
<item name="android:paddingRight">32dp</item>
<item name="android:scrollbarStyle">outsideOverlay</item>
</style>
<style name="Widget.ListItem">
<item name="android:minHeight">?android:attr/listPreferredItemHeight</item>
<item name="android:textAppearance">?android:attr/textAppearanceLargeInverse</item>

View File

@ -5,7 +5,7 @@
<!-- Tablet only: The contents under the "Customize" header for tablets,
See xml-v11/preferences.xml for single-pane v11+ phone layout.
Changes to preferences shoudl be mirrored to preferences_customize.xml. -->
Changes to preferences should be mirrored to preferences_customize.xml. -->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:gecko="http://schemas.android.com/apk/res-auto"

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!-- This file is a stub to allow IDs to be used in code
even for a version-limited build. -->
<preference-headers xmlns:android="http://schemas.android.com/apk/res/android">
<header android:fragment="org.mozilla.gecko.preferences.GeckoPreferenceFragment"
android:id="@+id/pref_header_language">
</header>
</preference-headers>

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!-- Stub to preserve IDs. -->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
android:enabled="false" />

View File

@ -46,7 +46,7 @@ public class MatrixBlobCursor extends AbstractCursor {
private int rowCount;
/* inner-access */ Object[] data;
Object[] data;
/**
* Constructs a new cursor with the given initial capacity.

View File

@ -140,7 +140,12 @@ public class TabsPanel extends LinearLayout
mPanelRemote = (PanelView) findViewById(R.id.remote_tabs);
mPanelRemote.setTabsPanel(this);
mFooter = (RelativeLayout) findViewById(R.id.tabs_panel_footer);
// Only applies to v11+ in landscape.
// We ship a stub to avoid a compiler error when referencing the
// ID, so we conditionalize here.
if (Versions.feature11Plus) {
mFooter = (RelativeLayout) findViewById(R.id.tabs_panel_footer);
}
mAddTab = (ImageButton) findViewById(R.id.add_tab);
mAddTab.setOnClickListener(new Button.OnClickListener() {
@ -425,8 +430,10 @@ public class TabsPanel extends LinearLayout
mPanel.show();
if (mCurrentPanel == Panel.REMOTE_TABS) {
if (mFooter != null)
// The footer is only defined in the sidebar, for landscape v11+ views.
if (mFooter != null) {
mFooter.setVisibility(View.GONE);
}
mAddTab.setVisibility(View.INVISIBLE);
@ -512,7 +519,8 @@ public class TabsPanel extends LinearLayout
if (mVisible) {
ViewHelper.setTranslationX(mHeader, -tabsPanelWidth);
ViewHelper.setTranslationX(mTabsContainer, -tabsPanelWidth);
// The footer view is only present on the sidebar
// The footer view is only present on the sidebar, v11+.
ViewHelper.setTranslationX(mFooter, -tabsPanelWidth);
}
final int translationX = (mVisible ? 0 : -tabsPanelWidth);

View File

@ -17,7 +17,7 @@ public final class Clipboard {
// Volatile but not synchronized: we don't care about the race condition in
// init, because both app contexts will be the same, but we do care about a
// thread having a stale null value of mContext.
/* inner-access */ volatile static Context mContext;
volatile static Context mContext;
private final static String LOGTAG = "GeckoClipboard";
private final static SynchronousQueue<String> sClipboardQueue = new SynchronousQueue<String>();
@ -116,7 +116,7 @@ public final class Clipboard {
* present on the thread.
*/
@SuppressWarnings("deprecation")
/* inner-access */ static String getClipboardTextImpl() {
static String getClipboardTextImpl() {
if (Versions.feature11Plus) {
android.content.ClipboardManager cm = (android.content.ClipboardManager) mContext.getSystemService(Context.CLIPBOARD_SERVICE);
if (cm.hasPrimaryClip()) {

View File

@ -50,7 +50,7 @@ public abstract class UIAsyncTask<Param, Result> {
protected abstract InnerResult doInBackground();
}
/* inner-access */ final Handler mBackgroundThreadHandler;
final Handler mBackgroundThreadHandler;
private volatile boolean mCancelled;
private static Handler sHandler;

View File

@ -75,7 +75,7 @@ public class InstallHelper implements NativeEventListener {
}
}
/* inner-access */ void install(String profileName, JSONObject message) throws IOException {
void install(String profileName, JSONObject message) throws IOException {
if (message == null) {
message = new JSONObject();
}

View File

@ -44,7 +44,7 @@ public class WebappImpl extends GeckoApp implements InstallCallback {
private View mTitlebar;
// Must only be accessed from the UI thread.
/* inner-access */ View mSplashscreen;
View mSplashscreen;
private boolean mIsApk = true;
private ApkResources mApkResources;

View File

@ -173,7 +173,7 @@ public class ActivityChooserModel extends DataSetObservable {
/**
* Tag used for logging.
*/
/* inner-access */ static final String LOG_TAG = ActivityChooserModel.class.getSimpleName();
static final String LOG_TAG = ActivityChooserModel.class.getSimpleName();
/**
* The root tag in the history file.
@ -268,12 +268,12 @@ public class ActivityChooserModel extends DataSetObservable {
/**
* Context for accessing resources.
*/
/* inner-access */ final Context mContext;
final Context mContext;
/**
* The name of the history file that backs this model.
*/
/* inner-access */ final String mHistoryFileName;
final String mHistoryFileName;
/**
* The intent for which a activity is being chosen.
@ -298,7 +298,7 @@ public class ActivityChooserModel extends DataSetObservable {
* only after a call to {@link #persistHistoricalDataIfNeeded()} followed by change
* of the share records.
*/
/* inner-access */ boolean mCanReadHistoricalData = true;
boolean mCanReadHistoricalData = true;
/**
* Flag whether the choice history was read. This is used to enforce that
@ -322,7 +322,7 @@ public class ActivityChooserModel extends DataSetObservable {
/**
* Flag whether to reload the activities for the current intent.
*/
/* inner-access */ boolean mReloadActivities;
boolean mReloadActivities;
/**
* Policy for controlling how the model handles chosen activities.
@ -799,7 +799,7 @@ public class ActivityChooserModel extends DataSetObservable {
* @param historicalRecord The pkg to delete records for.
* @return True if the record was added.
*/
/* inner-access */ boolean removeHistoricalRecordsForPackage(final String pkg) {
boolean removeHistoricalRecordsForPackage(final String pkg) {
boolean removed = false;
for (Iterator<HistoricalRecord> i = mHistoricalRecords.iterator(); i.hasNext();) {
@ -1088,7 +1088,7 @@ public class ActivityChooserModel extends DataSetObservable {
}
}
/* inner-access */ void readHistoricalDataFromStream(FileInputStream fis) {
void readHistoricalDataFromStream(FileInputStream fis) {
try {
XmlPullParser parser = Xml.newPullParser();
parser.setInput(fis, null);
@ -1228,7 +1228,7 @@ public class ActivityChooserModel extends DataSetObservable {
*/
private static final String LOGTAG = "GeckoActivityChooserModel";
private final class DataModelPackageMonitor extends BroadcastReceiver {
/* inner-access */ Context mContext;
Context mContext;
public DataModelPackageMonitor() { }

View File

@ -68,7 +68,7 @@ public class AnimatedHeightLayout extends RelativeLayout {
finishAnimation();
}
/* inner-access */ void finishAnimation() {
void finishAnimation() {
if (mAnimating) {
getLayoutParams().height = LayoutParams.WRAP_CONTENT;
mAnimating = false;

View File

@ -24,10 +24,10 @@ import android.widget.PopupWindow;
import android.widget.RelativeLayout;
public abstract class ArrowPopup extends PopupWindow {
/* inner-access */ View mAnchor;
/* inner-access */ ImageView mArrow;
View mAnchor;
ImageView mArrow;
/* inner-access */ int mArrowWidth;
int mArrowWidth;
private int mYOffset;
protected LinearLayout mContent;
@ -154,7 +154,7 @@ public abstract class ArrowPopup extends PopupWindow {
public void onSizeChanged();
}
/* inner-access */ OnSizeChangedListener mListener;
OnSizeChangedListener mListener;
public ArrowPopupLayout(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);

View File

@ -42,8 +42,8 @@ public class BasicColorPicker extends ListView {
Color.BLACK);
private static Drawable mCheckDrawable;
/* inner-access */ int mSelected;
/* inner-access */ final ColorPickerListAdapter mAdapter;
int mSelected;
final ColorPickerListAdapter mAdapter;
public BasicColorPicker(Context context) {
this(context, null);
@ -87,7 +87,7 @@ public class BasicColorPicker extends ListView {
mAdapter.notifyDataSetChanged();
}
/* inner-access */ Drawable getCheckDrawable() {
Drawable getCheckDrawable() {
if (mCheckDrawable == null) {
Resources res = getContext().getResources();

View File

@ -35,8 +35,8 @@ public class ButtonToast {
private final TextView mMessageView;
private final Button mButton;
private final Handler mHideHandler = new Handler();
/* inner-access */ final View mView;
/* inner-access */ Toast mCurrentToast;
final View mView;
Toast mCurrentToast;
public enum ReasonHidden {
CLICKED,

View File

@ -48,13 +48,13 @@ public class DateTimePicker extends FrameLayout {
// Minimal screen width (in inches) for which we can show the calendar;
private static final int SCREEN_SIZE_THRESHOLD = 5;
/* inner-access */ boolean mYearEnabled = true;
/* inner-access */ boolean mMonthEnabled = true;
/* inner-access */ boolean mWeekEnabled;
/* inner-access */ boolean mDayEnabled = true;
/* inner-access */ boolean mHourEnabled = true;
/* inner-access */ boolean mMinuteEnabled = true;
/* inner-access */ boolean mIs12HourMode;
boolean mYearEnabled = true;
boolean mMonthEnabled = true;
boolean mWeekEnabled;
boolean mDayEnabled = true;
boolean mHourEnabled = true;
boolean mMinuteEnabled = true;
boolean mIs12HourMode;
private boolean mCalendarEnabled;
// Size of the screen in inches;
@ -65,13 +65,13 @@ public class DateTimePicker extends FrameLayout {
private final LinearLayout mDateSpinners;
private final LinearLayout mTimeSpinners;
/* inner-access */ final NumberPicker mDaySpinner;
/* inner-access */ final NumberPicker mMonthSpinner;
/* inner-access */ final NumberPicker mWeekSpinner;
/* inner-access */ final NumberPicker mYearSpinner;
/* inner-access */ final NumberPicker mHourSpinner;
/* inner-access */ final NumberPicker mMinuteSpinner;
/* inner-access */ final NumberPicker mAMPMSpinner;
final NumberPicker mDaySpinner;
final NumberPicker mMonthSpinner;
final NumberPicker mWeekSpinner;
final NumberPicker mYearSpinner;
final NumberPicker mHourSpinner;
final NumberPicker mMinuteSpinner;
final NumberPicker mAMPMSpinner;
private final CalendarView mCalendar;
private final EditText mDaySpinnerInput;
private final EditText mMonthSpinnerInput;
@ -85,8 +85,8 @@ public class DateTimePicker extends FrameLayout {
private String[] mShortAMPMs;
private int mNumberOfMonths;
/* inner-access */ Calendar mTempDate;
/* inner-access */ Calendar mCurrentDate;
Calendar mTempDate;
Calendar mCurrentDate;
private Calendar mMinDate;
private Calendar mMaxDate;
private PickersState mState;
@ -410,7 +410,7 @@ public class DateTimePicker extends FrameLayout {
mDateSpinners.addView(mWeekSpinner);
}
/* inner-access */ void setDate(Calendar calendar){
void setDate(Calendar calendar){
mCurrentDate = mTempDate;
if (mCurrentDate.before(mMinDate)) {
mCurrentDate.setTimeInMillis(mMinDate.getTimeInMillis());
@ -419,7 +419,7 @@ public class DateTimePicker extends FrameLayout {
}
}
/* inner-access */ void updateInputState() {
void updateInputState() {
InputMethodManager inputMethodManager = (InputMethodManager)
getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
if (mYearEnabled && inputMethodManager.isActive(mYearSpinnerInput)) {
@ -440,7 +440,7 @@ public class DateTimePicker extends FrameLayout {
}
}
/* inner-access */ void updateSpinners() {
void updateSpinners() {
if (mDayEnabled) {
if (mCurrentDate.equals(mMinDate)) {
mDaySpinner.setMinValue(mCurrentDate.get(Calendar.DAY_OF_MONTH));
@ -500,13 +500,13 @@ public class DateTimePicker extends FrameLayout {
}
}
/* inner-access */ void updateCalendar() {
void updateCalendar() {
if (mCalendarEnabled){
mCalendar.setDate(mCurrentDate.getTimeInMillis(), false, false);
}
}
/* inner-access */ void notifyDateChanged() {
void notifyDateChanged() {
sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_SELECTED);
}

View File

@ -38,16 +38,16 @@ public class GeckoActionProvider {
public void onTargetSelected();
}
/* inner-access */ final Context mContext;
final Context mContext;
public final static String DEFAULT_MIME_TYPE = "text/plain";
public static final String DEFAULT_HISTORY_FILE_NAME = "history.xml";
// History file.
/* inner-access */ String mHistoryFileName = DEFAULT_HISTORY_FILE_NAME;
String mHistoryFileName = DEFAULT_HISTORY_FILE_NAME;
/* inner-access */ OnTargetSelectedListener mOnTargetListener;
OnTargetSelectedListener mOnTargetListener;
private final Callbacks mCallbacks = new Callbacks();
@ -183,7 +183,7 @@ public class GeckoActionProvider {
*/
private class Callbacks implements OnMenuItemClickListener,
OnClickListener {
/* inner-access */ void chooseActivity(int index) {
void chooseActivity(int index) {
final ActivityChooserModel dataModel = ActivityChooserModel.get(mContext, mHistoryFileName);
final Intent launchIntent = dataModel.chooseActivity(index);
if (launchIntent != null) {

View File

@ -63,14 +63,14 @@ public class GeckoSwipeRefreshLayout extends ViewGroup {
private static final float MAX_SWIPE_DISTANCE_FACTOR = .6f;
private static final int REFRESH_TRIGGER_DISTANCE = 120;
/* inner-access */ SwipeProgressBar mProgressBar; // shows progress is going
/* inner-access */ View mTarget; // content that gets pulled down
/* inner-access */ int mOriginalOffsetTop;
/* inner-access */ int mFrom;
/* inner-access */ int mMediumAnimationDuration;
/* inner-access */ float mFromPercentage;
/* inner-access */ float mCurrPercentage;
/* inner-access */ int mCurrentTargetOffsetTop;
SwipeProgressBar mProgressBar; // shows progress is going
View mTarget; // content that gets pulled down
int mOriginalOffsetTop;
int mFrom;
int mMediumAnimationDuration;
float mFromPercentage;
float mCurrPercentage;
int mCurrentTargetOffsetTop;
private OnRefreshListener mListener;
private MotionEvent mDownEvent;
private boolean mRefreshing;
@ -81,8 +81,8 @@ public class GeckoSwipeRefreshLayout extends ViewGroup {
// Target is returning to its start offset because it was cancelled or a
// refresh was triggered.
/* inner-access */ boolean mReturningToStart;
/* inner-access */ final DecelerateInterpolator mDecelerateInterpolator;
boolean mReturningToStart;
final DecelerateInterpolator mDecelerateInterpolator;
private final AccelerateInterpolator mAccelerateInterpolator;
private static final int[] LAYOUT_ATTRS = new int[] {
android.R.attr.enabled
@ -104,7 +104,7 @@ public class GeckoSwipeRefreshLayout extends ViewGroup {
}
};
/* inner-access */ Animation mShrinkTrigger = new Animation() {
Animation mShrinkTrigger = new Animation() {
@Override
public void applyTransformation(float interpolatedTime, Transformation t) {
float percent = mFromPercentage + ((0 - mFromPercentage) * interpolatedTime);
@ -112,7 +112,7 @@ public class GeckoSwipeRefreshLayout extends ViewGroup {
}
};
/* inner-access */ final AnimationListener mReturnToStartPositionListener = new BaseAnimationListener() {
final AnimationListener mReturnToStartPositionListener = new BaseAnimationListener() {
@Override
public void onAnimationEnd(Animation animation) {
// Once the target content has returned to its start position, reset
@ -121,7 +121,7 @@ public class GeckoSwipeRefreshLayout extends ViewGroup {
}
};
/* inner-access */ final AnimationListener mShrinkAnimationListener = new BaseAnimationListener() {
final AnimationListener mShrinkAnimationListener = new BaseAnimationListener() {
@Override
public void onAnimationEnd(Animation animation) {
mCurrPercentage = 0;
@ -214,7 +214,7 @@ public class GeckoSwipeRefreshLayout extends ViewGroup {
removeCallbacks(mCancel);
}
/* inner-access */ void animateOffsetToStartPosition(int from, AnimationListener listener) {
void animateOffsetToStartPosition(int from, AnimationListener listener) {
mFrom = from;
mAnimateToStartPosition.reset();
mAnimateToStartPosition.setDuration(mMediumAnimationDuration);
@ -459,7 +459,7 @@ public class GeckoSwipeRefreshLayout extends ViewGroup {
setTargetOffsetTopAndBottom(targetTop - currentTop);
}
/* inner-access */ void setTargetOffsetTopAndBottom(int offset) {
void setTargetOffsetTopAndBottom(int offset) {
mTarget.offsetTopAndBottom(offset);
mCurrentTargetOffsetTop = mTarget.getTop();
}

View File

@ -17,7 +17,7 @@ import android.widget.TabWidget;
import android.widget.TextView;
public class IconTabWidget extends TabWidget {
/* inner-access */ OnTabChangedListener mListener;
OnTabChangedListener mListener;
private final int mButtonLayoutId;
private final boolean mIsIcon;

View File

@ -141,7 +141,7 @@ public class TwoWayView extends AdapterView<ListAdapter> implements
VERTICAL
}
/* inner-access */ ListAdapter mAdapter;
ListAdapter mAdapter;
private boolean mIsVertical;
@ -159,13 +159,13 @@ public class TwoWayView extends AdapterView<ListAdapter> implements
final boolean[] mIsScrap = new boolean[1];
/* inner-access */ boolean mDataChanged;
/* inner-access */ int mItemCount;
/* inner-access */ int mOldItemCount;
/* inner-access */ boolean mHasStableIds;
boolean mDataChanged;
int mItemCount;
int mOldItemCount;
boolean mHasStableIds;
private boolean mAreAllItemsSelectable;
/* inner-access */ int mFirstPosition;
int mFirstPosition;
private int mSpecificStart;
private SavedState mPendingSync;
@ -181,8 +181,8 @@ public class TwoWayView extends AdapterView<ListAdapter> implements
private final ArrowScrollFocusResult mArrowScrollFocusResult;
/* inner-access */ int mMotionPosition;
/* inner-access */ Runnable mTouchModeReset;
int mMotionPosition;
Runnable mTouchModeReset;
private Rect mTouchFrame;
private CheckForTap mPendingCheckForTap;
private CheckForLongPress mPendingCheckForLongPress;
@ -192,7 +192,7 @@ public class TwoWayView extends AdapterView<ListAdapter> implements
private boolean mIsChildViewEnabled;
/* inner-access */ Drawable mSelector;
Drawable mSelector;
private boolean mDrawSelectorOnTop;
private int mSelectorPosition;
private final Rect mSelectorRect;
@ -205,17 +205,17 @@ public class TwoWayView extends AdapterView<ListAdapter> implements
private SelectionNotifier mSelectionNotifier;
/* inner-access */ boolean mNeedSync;
boolean mNeedSync;
private int mSyncMode;
private int mSyncPosition;
private long mSyncRowId;
private long mSyncHeight;
private int mSelectedStart;
/* inner-access */ int mNextSelectedPosition;
/* inner-access */ long mNextSelectedRowId;
/* inner-access */ int mSelectedPosition;
/* inner-access */ long mSelectedRowId;
int mNextSelectedPosition;
long mNextSelectedRowId;
int mSelectedPosition;
long mSelectedRowId;
private int mOldSelectedPosition;
private long mOldSelectedRowId;
@ -226,8 +226,8 @@ public class TwoWayView extends AdapterView<ListAdapter> implements
private ContextMenuInfo mContextMenuInfo;
/* inner-access */ int mLayoutMode;
/* inner-access */ int mTouchMode;
int mLayoutMode;
int mTouchMode;
private int mLastTouchMode;
private VelocityTracker mVelocityTracker;
private final Scroller mScroller;
@ -2959,7 +2959,7 @@ public class TwoWayView extends AdapterView<ListAdapter> implements
removeCallbacks(mPendingCheckForTap);
}
/* inner-access */ void triggerCheckForLongPress() {
void triggerCheckForLongPress() {
if (mPendingCheckForLongPress == null) {
mPendingCheckForLongPress = new CheckForLongPress();
}
@ -3232,7 +3232,7 @@ public class TwoWayView extends AdapterView<ListAdapter> implements
return (hasFocus() && !isInTouchMode()) || touchModeDrawsInPressedState();
}
/* inner-access */ void positionSelector(int position, View selected) {
void positionSelector(int position, View selected) {
if (position != INVALID_POSITION) {
mSelectorPosition = position;
}
@ -3402,7 +3402,7 @@ public class TwoWayView extends AdapterView<ListAdapter> implements
}
}
/* inner-access */ void fireOnSelected() {
void fireOnSelected() {
OnItemSelectedListener listener = getOnItemSelectedListener();
if (listener == null) {
return;
@ -3418,7 +3418,7 @@ public class TwoWayView extends AdapterView<ListAdapter> implements
}
}
/* inner-access */ void performAccessibilityActionsOnSelected() {
void performAccessibilityActionsOnSelected() {
final int position = getSelectedItemPosition();
if (position >= 0) {
// We fire selection events here not in View
@ -3771,7 +3771,7 @@ public class TwoWayView extends AdapterView<ListAdapter> implements
}
}
/* inner-access */ void layoutChildren() {
void layoutChildren() {
if (getWidth() == 0 || getHeight() == 0) {
return;
}
@ -5293,7 +5293,7 @@ public class TwoWayView extends AdapterView<ListAdapter> implements
invalidate();
}
/* inner-access */ void rememberSyncState() {
void rememberSyncState() {
if (getChildCount() == 0) {
return;
}
@ -5402,7 +5402,7 @@ public class TwoWayView extends AdapterView<ListAdapter> implements
return super.performItemClick(view, position, id);
}
/* inner-access */ boolean performLongPress(final View child,
boolean performLongPress(final View child,
final int longPressPosition, final long longPressId) {
// CHOICE_MODE_MULTIPLE_MODAL takes over long press.
boolean handled = false;
@ -5653,7 +5653,7 @@ public class TwoWayView extends AdapterView<ListAdapter> implements
}
class RecycleBin {
/* inner-access */ RecyclerListener mRecyclerListener;
RecyclerListener mRecyclerListener;
private int mFirstActivePosition;
private View[] mActiveViews = new View[0];
private ArrayList<View>[] mScrapViews;
@ -5987,7 +5987,7 @@ public class TwoWayView extends AdapterView<ListAdapter> implements
super.setFocusableInTouchMode(focusable && !empty);
}
/* inner-access */ void checkFocus() {
void checkFocus() {
final ListAdapter adapter = getAdapter();
final boolean focusable = (adapter != null && adapter.getCount() > 0);
@ -6331,7 +6331,7 @@ public class TwoWayView extends AdapterView<ListAdapter> implements
}
private static class ArrowScrollFocusResult {
/* inner-access */ int mSelectedPosition;
int mSelectedPosition;
private int mAmountToScroll;
/**

View File

@ -827,3 +827,39 @@ class B2GCommands(MachCommandBase):
mochitest = self._spawn(MochitestRunner)
return mochitest.run_b2g_test(test_paths=test_paths, **kwargs)
@CommandProvider
class AndroidCommands(MachCommandBase):
@Command('robocop', category='testing',
conditions=[conditions.is_android],
description='Run a Robocop test.')
@CommandArgument('test_path', default=None, nargs='?',
metavar='TEST',
help='Test to run. Can be specified as a Robocop test name (like "testLoad"), ' \
'or omitted. If omitted, the entire test suite is executed.')
def run_robocop(self, test_path):
self.tests_dir = os.path.join(self.topobjdir, '_tests')
self.mochitest_dir = os.path.join(self.tests_dir, 'testing', 'mochitest')
import imp
path = os.path.join(self.mochitest_dir, 'runtestsremote.py')
with open(path, 'r') as fh:
imp.load_module('runtestsremote', fh, path,
('.py', 'r', imp.PY_SOURCE))
import runtestsremote
args = [
'--xre-path=' + os.environ.get('MOZ_HOST_BIN'),
'--dm_trans=adb',
'--deviceIP=',
'--console-level=INFO',
'--app=' + self.substs['ANDROID_PACKAGE_NAME'],
'--robocop-apk=' + os.path.join(self.topobjdir, 'build', 'mobile', 'robocop', 'robocop-debug.apk'),
'--robocop-ini=' + os.path.join(self.topobjdir, 'build', 'mobile', 'robocop', 'robocop.ini'),
'--log-mach=-',
]
if test_path:
args.append('--test-path=%s' % test_path)
sys.exit(runtestsremote.main(args))

View File

@ -252,6 +252,10 @@ class MochiRemote(Mochitest):
else:
self.log.warning("Unable to retrieve log file (%s) from remote device" % self.remoteLog)
self._dm.removeDir(self.remoteProfile)
# Don't leave an old robotium.config hanging around; the
# profile it references was just deleted!
deviceRoot = self._dm.getDeviceRoot()
self._dm.removeFile(os.path.join(deviceRoot, "robotium.config"))
blobberUploadDir = os.environ.get('MOZ_UPLOAD_DIR', None)
if blobberUploadDir:
self._dm.getDirectory(self.remoteNSPR, blobberUploadDir)
@ -584,14 +588,14 @@ class MochiRemote(Mochitest):
return self._automation.runApp(*args, **kwargs)
def main():
def main(args):
message_logger = MessageLogger(logger=None)
process_args = {'messageLogger': message_logger}
auto = RemoteAutomation(None, "fennec", processArgs=process_args)
parser = RemoteOptions(auto)
structured.commandline.add_logging_group(parser)
options, args = parser.parse_args()
options, args = parser.parse_args(args)
if (options.dm_trans == "adb"):
if (options.deviceIP):
@ -611,7 +615,7 @@ def main():
if (options == None):
log.error("Invalid options specified, use --help for a list of valid options")
sys.exit(1)
return 1
productPieces = options.remoteProductName.split('.')
if (productPieces != None):
@ -622,7 +626,7 @@ def main():
options = parser.verifyOptions(options, mochitest)
if (options == None):
sys.exit(1)
return 1
logParent = os.path.dirname(options.remoteLogFile)
dm.mkDir(logParent);
@ -674,11 +678,6 @@ def main():
my_tests = tests[start:end]
log.info("Running tests %d-%d/%d" % (start+1, end, len(tests)))
dm.removeFile(os.path.join(deviceRoot, "fennec_ids.txt"))
fennec_ids = os.path.abspath(os.path.join(SCRIPT_DIR, "fennec_ids.txt"))
if not os.path.exists(fennec_ids) and options.robocopIds:
fennec_ids = options.robocopIds
dm.pushFile(fennec_ids, os.path.join(deviceRoot, "fennec_ids.txt"))
options.extraPrefs.append('browser.search.suggest.enabled=true')
options.extraPrefs.append('browser.search.suggest.prompted=true')
options.extraPrefs.append('layout.css.devPixelsPerPx=1.0')
@ -805,10 +804,12 @@ def main():
pass
retVal = 1
message_logger.finish()
mochitest.printDeviceInfo(printLogcat=True)
mochitest.printDeviceInfo(printLogcat=True)
message_logger.finish()
return retVal
sys.exit(retVal)
if __name__ == "__main__":
main()
sys.exit(main(sys.argv[1:]))