Bug 778468 - Part 1: Move ActivityResultHandler to org.mozilla.gecko.util package. r=mfinkle

--HG--
extra : rebase_source : 2e367de82c0d129f2e469da825d49fd41dd6e19b
This commit is contained in:
Chris Peterson 2012-08-02 10:33:44 -07:00
parent c72c06520a
commit 1fa3b14de9
8 changed files with 20 additions and 9 deletions

View File

@ -4,6 +4,9 @@
package org.mozilla.gecko;
import org.mozilla.gecko.util.ActivityResultHandler;
import org.mozilla.gecko.util.ActivityResultHandlerMap;
import org.json.JSONException;
import org.json.JSONObject;

View File

@ -2,10 +2,10 @@
* 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/. */
package org.mozilla.gecko;
package org.mozilla.gecko.util;
import android.content.Intent;
interface ActivityResultHandler {
public void onActivityResult(int resultCode, Intent data);
public interface ActivityResultHandler {
void onActivityResult(int resultCode, Intent data);
}

View File

@ -2,21 +2,21 @@
* 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/. */
package org.mozilla.gecko;
package org.mozilla.gecko.util;
import java.util.HashMap;
import java.util.Map;
class ActivityResultHandlerMap {
public final class ActivityResultHandlerMap {
private Map<Integer, ActivityResultHandler> mMap = new HashMap<Integer, ActivityResultHandler>();
private int mCounter = 0;
synchronized int put(ActivityResultHandler handler) {
public synchronized int put(ActivityResultHandler handler) {
mMap.put(mCounter, handler);
return mCounter++;
}
synchronized ActivityResultHandler getAndRemove(int i) {
public synchronized ActivityResultHandler getAndRemove(int i) {
return mMap.remove(i);
}
}

View File

@ -4,6 +4,8 @@
package org.mozilla.gecko;
import org.mozilla.gecko.util.ActivityResultHandler;
import android.content.Intent;
class AwesomebarResultHandler implements ActivityResultHandler {

View File

@ -4,6 +4,8 @@
package org.mozilla.gecko;
import org.mozilla.gecko.util.ActivityResultHandler;
import android.app.Activity;
import android.content.Intent;
import android.os.Environment;

View File

@ -4,6 +4,8 @@
package org.mozilla.gecko;
import org.mozilla.gecko.util.ActivityResultHandler;
import android.app.Activity;
import android.content.Intent;
import android.database.Cursor;

View File

@ -4,6 +4,8 @@
package org.mozilla.gecko;
import org.mozilla.gecko.util.ActivityResultHandler;
import android.app.Activity;
import android.content.ContentResolver;
import android.content.Intent;

View File

@ -21,6 +21,8 @@ MOZGLUE_JAVA_FILES := \
$(NULL)
UTIL_JAVA_FILES := \
ActivityResultHandler.java \
ActivityResultHandlerMap.java \
util/FloatUtils.java \
$(NULL)
@ -28,8 +30,6 @@ FENNEC_JAVA_FILES = \
AboutHomeContent.java \
AboutHomeSection.java \
ActivityHandlerHelper.java \
ActivityResultHandler.java \
ActivityResultHandlerMap.java \
AndroidImport.java \
AndroidImportPreference.java \
AlertNotification.java \