2012-07-13 18:06:24 +00:00
|
|
|
/* 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/. */
|
|
|
|
|
|
|
|
package org.mozilla.gecko;
|
|
|
|
|
|
|
|
import android.content.Intent;
|
|
|
|
import android.util.Log;
|
|
|
|
|
2013-05-10 01:48:00 +00:00
|
|
|
import java.util.Queue;
|
2012-07-28 00:53:54 +00:00
|
|
|
|
2012-07-13 18:06:24 +00:00
|
|
|
class FilePickerResultHandlerSync extends FilePickerResultHandler {
|
|
|
|
private static final String LOGTAG = "GeckoFilePickerResultHandlerSync";
|
|
|
|
|
2013-05-10 01:48:00 +00:00
|
|
|
FilePickerResultHandlerSync(Queue<String> resultQueue) {
|
2013-05-29 15:08:55 +00:00
|
|
|
super(resultQueue, null);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Use this constructor to asynchronously listen for results */
|
|
|
|
public FilePickerResultHandlerSync(ActivityHandlerHelper.FileResultHandler handler) {
|
|
|
|
super(null, handler);
|
2012-07-13 18:06:24 +00:00
|
|
|
}
|
|
|
|
|
2013-02-27 05:48:00 +00:00
|
|
|
@Override
|
2012-07-13 18:06:24 +00:00
|
|
|
public void onActivityResult(int resultCode, Intent data) {
|
2013-05-29 15:08:55 +00:00
|
|
|
if (mFilePickerResult != null)
|
|
|
|
mFilePickerResult.offer(handleActivityResult(resultCode, data));
|
|
|
|
|
|
|
|
if (mHandler != null)
|
|
|
|
mHandler.gotFile(handleActivityResult(resultCode, data));
|
2012-07-13 18:06:24 +00:00
|
|
|
}
|
|
|
|
}
|