[codemod][lint][fbcode] Apply google-java-format

Test Plan: Sandcastle. Visual inspection.

Reviewed By: scottrice

Differential Revision: D19878711

fbshipit-source-id: be56f70b35825140676be511903e5274d1808f25
This commit is contained in:
Andres Suarez
2020-02-13 12:01:03 -08:00
committed by Facebook Github Bot
parent bf16688538
commit b28a834813
11 changed files with 1152 additions and 1160 deletions

View File

@ -1,7 +1,5 @@
package org.pytorch;
import org.junit.BeforeClass;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
@ -14,7 +12,8 @@ public class PytorchHostTests extends PytorchTestBase {
@Override
protected String assetFilePath(String assetName) throws IOException {
Path tempFile = Files.createTempFile("test", ".pt");
try (InputStream resource = Objects.requireNonNull(getClass().getClassLoader().getResourceAsStream("test.pt"))) {
try (InputStream resource =
Objects.requireNonNull(getClass().getClassLoader().getResourceAsStream("test.pt"))) {
Files.copy(resource, tempFile, StandardCopyOption.REPLACE_EXISTING);
}
return tempFile.toAbsolutePath().toString();

View File

@ -1,26 +1,23 @@
package org.pytorch;
import org.junit.Before;
import org.junit.Test;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import org.junit.Test;
public abstract class PytorchTestBase {
private static final String TEST_MODULE_ASSET_NAME = "test.pt";
@Test
public void testForwardNull() throws IOException {
final Module module = Module.load(assetFilePath(TEST_MODULE_ASSET_NAME));
final IValue input =
IValue.from(Tensor.fromBlob(Tensor.allocateByteBuffer(1), new long[] {1}));
final IValue input = IValue.from(Tensor.fromBlob(Tensor.allocateByteBuffer(1), new long[] {1}));
assertTrue(input.isTensor());
final IValue output = module.forward(input);
assertTrue(output.isNull());
@ -57,17 +54,17 @@ public abstract class PytorchTestBase {
final Module module = Module.load(assetFilePath(TEST_MODULE_ASSET_NAME));
double[] values =
new double[] {
-Double.MAX_VALUE,
Double.MAX_VALUE,
-Double.MIN_VALUE,
Double.MIN_VALUE,
-Math.exp(1.d),
-Math.sqrt(2.d),
-3.1415f,
3.1415f,
-1,
0,
1,
-Double.MAX_VALUE,
Double.MAX_VALUE,
-Double.MIN_VALUE,
Double.MIN_VALUE,
-Math.exp(1.d),
-Math.sqrt(2.d),
-3.1415f,
3.1415f,
-1,
0,
1,
};
for (double value : values) {
final IValue input = IValue.from(value);
@ -242,15 +239,14 @@ public abstract class PytorchTestBase {
tensorFloats.getDataAsByteArray();
}
@Test
public void testEqString() throws IOException {
final Module module = Module.load(assetFilePath(TEST_MODULE_ASSET_NAME));
String[] values =
new String[] {
"smoketest",
"проверка не латинских символов", // not latin symbols check
"#@$!@#)($*!@#$)(!@*#$"
"smoketest",
"проверка не латинских символов", // not latin symbols check
"#@$!@#)($*!@#$)(!@*#$"
};
for (String value : values) {
final IValue input = IValue.from(value);
@ -267,9 +263,9 @@ public abstract class PytorchTestBase {
final Module module = Module.load(assetFilePath(TEST_MODULE_ASSET_NAME));
String[] values =
new String[] {
"smoketest",
"проверка не латинских символов", // not latin symbols check
"#@$!@#)($*!@#$)(!@*#$"
"smoketest",
"проверка не латинских символов", // not latin symbols check
"#@$!@#)($*!@#$)(!@*#$"
};
for (String value : values) {
final IValue input = IValue.from(value);
@ -277,7 +273,8 @@ public abstract class PytorchTestBase {
assertTrue(value.equals(input.toStr()));
final IValue output = module.runMethod("str3Concat", input);
assertTrue(output.isString());
String expectedOutput = new StringBuilder().append(value).append(value).append(value).toString();
String expectedOutput =
new StringBuilder().append(value).append(value).append(value).toString();
assertTrue(expectedOutput.equals(output.toStr()));
}
}
@ -286,12 +283,12 @@ public abstract class PytorchTestBase {
public void testEmptyShape() throws IOException {
final Module module = Module.load(assetFilePath(TEST_MODULE_ASSET_NAME));
final long someNumber = 43;
final IValue input = IValue.from(Tensor.fromBlob(new long[]{someNumber}, new long[]{}));
final IValue input = IValue.from(Tensor.fromBlob(new long[] {someNumber}, new long[] {}));
final IValue output = module.runMethod("newEmptyShapeWithItem", input);
assertTrue(output.isTensor());
Tensor value = output.toTensor();
assertArrayEquals(new long[]{}, value.shape());
assertArrayEquals(new long[]{someNumber}, value.getDataAsLongArray());
assertArrayEquals(new long[] {}, value.shape());
assertArrayEquals(new long[] {someNumber}, value.getDataAsLongArray());
}
@Test
@ -310,8 +307,8 @@ public abstract class PytorchTestBase {
final IValue output = module.runMethod("testNonContiguous");
assertTrue(output.isTensor());
Tensor value = output.toTensor();
assertArrayEquals(new long[]{2}, value.shape());
assertArrayEquals(new long[]{100, 300}, value.getDataAsLongArray());
assertArrayEquals(new long[] {2}, value.shape());
assertArrayEquals(new long[] {100, 300}, value.getDataAsLongArray());
}
protected abstract String assetFilePath(String assetName) throws IOException;

View File

@ -1,8 +1,6 @@
package org.pytorch;
/**
* Codes representing tensor data types.
*/
/** Codes representing tensor data types. */
public enum DType {
// NOTE: "jniCode" must be kept in sync with pytorch_jni_common.cpp.
// NOTE: Never serialize "jniCode", because it can change between releases.

View File

@ -17,7 +17,8 @@ class NativePeer implements INativePeer {
private static native HybridData initHybrid(String moduleAbsolutePath);
@DoNotStrip
private static native HybridData initHybridAndroidAsset(String assetName, /* android.content.res.AssetManager */ Object androidAssetManager);
private static native HybridData initHybridAndroidAsset(
String assetName, /* android.content.res.AssetManager */ Object androidAssetManager);
NativePeer(String moduleAbsolutePath) {
mHybridData = initHybrid(moduleAbsolutePath);

View File

@ -1,7 +1,6 @@
package org.pytorch;
import android.content.res.AssetManager;
import com.facebook.jni.annotations.DoNotStrip;
import com.facebook.soloader.nativeloader.NativeLoader;
import com.facebook.soloader.nativeloader.SystemDelegate;
@ -15,13 +14,14 @@ public final class PyTorchAndroid {
}
/**
* Attention:
* This is not recommended way of loading production modules, as prepackaged assets increase apk size etc.
* For production usage consider using loading from file on the disk {@link org.pytorch.Module#load(String)}.
* Attention: This is not recommended way of loading production modules, as prepackaged assets
* increase apk size etc. For production usage consider using loading from file on the disk {@link
* org.pytorch.Module#load(String)}.
*
* This method is meant to use in tests and demos.
* <p>This method is meant to use in tests and demos.
*/
public static Module loadModuleFromAsset(final AssetManager assetManager, final String assetName) {
public static Module loadModuleFromAsset(
final AssetManager assetManager, final String assetName) {
return new Module(new NativePeer(assetName, assetManager));
}

View File

@ -1,8 +1,7 @@
package org.pytorch;
import com.facebook.jni.annotations.DoNotStrip;
import com.facebook.jni.HybridData;
import com.facebook.jni.annotations.DoNotStrip;
import java.nio.Buffer;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
@ -643,7 +642,8 @@ public abstract class Tensor {
// Called from native
@DoNotStrip
private static Tensor nativeNewTensor(ByteBuffer data, long[] shape, int dtype, HybridData hybridData) {
private static Tensor nativeNewTensor(
ByteBuffer data, long[] shape, int dtype, HybridData hybridData) {
Tensor tensor = null;
if (DType.FLOAT32.jniCode == dtype) {
tensor = new Tensor_float32(data.asFloatBuffer(), shape);

View File

@ -1,16 +1,13 @@
package org.pytorch.torchvision;
import android.graphics.Bitmap;
import static org.junit.Assert.assertArrayEquals;
import org.junit.Before;
import android.graphics.Bitmap;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.pytorch.Tensor;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import static org.junit.Assert.assertArrayEquals;
@RunWith(AndroidJUnit4.class)
public class TorchVisionInstrumentedTests {

View File

@ -3,32 +3,30 @@ package org.pytorch.torchvision;
import android.graphics.Bitmap;
import android.graphics.ImageFormat;
import android.media.Image;
import com.facebook.soloader.nativeloader.NativeLoader;
import com.facebook.soloader.nativeloader.SystemDelegate;
import org.pytorch.Tensor;
import java.nio.Buffer;
import java.nio.ByteBuffer;
import java.nio.FloatBuffer;
import java.util.Locale;
import org.pytorch.Tensor;
/**
* Contains utility functions for {@link org.pytorch.Tensor} creation from
* {@link android.graphics.Bitmap} or {@link android.media.Image} source.
* Contains utility functions for {@link org.pytorch.Tensor} creation from {@link
* android.graphics.Bitmap} or {@link android.media.Image} source.
*/
public final class TensorImageUtils {
public static float[] TORCHVISION_NORM_MEAN_RGB = new float[]{0.485f, 0.456f, 0.406f};
public static float[] TORCHVISION_NORM_STD_RGB = new float[]{0.229f, 0.224f, 0.225f};
public static float[] TORCHVISION_NORM_MEAN_RGB = new float[] {0.485f, 0.456f, 0.406f};
public static float[] TORCHVISION_NORM_STD_RGB = new float[] {0.229f, 0.224f, 0.225f};
/**
* Creates new {@link org.pytorch.Tensor} from full {@link android.graphics.Bitmap}, normalized
* with specified in parameters mean and std.
*
* @param normMeanRGB means for RGB channels normalization, length must equal 3, RGB order
* @param normStdRGB standard deviation for RGB channels normalization, length must equal 3, RGB order
* @param normStdRGB standard deviation for RGB channels normalization, length must equal 3, RGB
* order
*/
public static Tensor bitmapToFloat32Tensor(
final Bitmap bitmap, final float[] normMeanRGB, final float normStdRGB[]) {
@ -40,17 +38,17 @@ public final class TensorImageUtils {
}
/**
* Writes tensor content from specified {@link android.graphics.Bitmap},
* normalized with specified in parameters mean and std to specified {@link java.nio.FloatBuffer}
* with specified offset.
* Writes tensor content from specified {@link android.graphics.Bitmap}, normalized with specified
* in parameters mean and std to specified {@link java.nio.FloatBuffer} with specified offset.
*
* @param bitmap {@link android.graphics.Bitmap} as a source for Tensor data
* @param x - x coordinate of top left corner of bitmap's area
* @param y - y coordinate of top left corner of bitmap's area
* @param width - width of bitmap's area
* @param height - height of bitmap's area
* @param bitmap {@link android.graphics.Bitmap} as a source for Tensor data
* @param x - x coordinate of top left corner of bitmap's area
* @param y - y coordinate of top left corner of bitmap's area
* @param width - width of bitmap's area
* @param height - height of bitmap's area
* @param normMeanRGB means for RGB channels normalization, length must equal 3, RGB order
* @param normStdRGB standard deviation for RGB channels normalization, length must equal 3, RGB order
* @param normStdRGB standard deviation for RGB channels normalization, length must equal 3, RGB
* order
*/
public static void bitmapToFloatBuffer(
final Bitmap bitmap,
@ -89,13 +87,14 @@ public final class TensorImageUtils {
* Creates new {@link org.pytorch.Tensor} from specified area of {@link android.graphics.Bitmap},
* normalized with specified in parameters mean and std.
*
* @param bitmap {@link android.graphics.Bitmap} as a source for Tensor data
* @param x - x coordinate of top left corner of bitmap's area
* @param y - y coordinate of top left corner of bitmap's area
* @param width - width of bitmap's area
* @param height - height of bitmap's area
* @param bitmap {@link android.graphics.Bitmap} as a source for Tensor data
* @param x - x coordinate of top left corner of bitmap's area
* @param y - y coordinate of top left corner of bitmap's area
* @param width - width of bitmap's area
* @param height - height of bitmap's area
* @param normMeanRGB means for RGB channels normalization, length must equal 3, RGB order
* @param normStdRGB standard deviation for RGB channels normalization, length must equal 3, RGB order
* @param normStdRGB standard deviation for RGB channels normalization, length must equal 3, RGB
* order
*/
public static Tensor bitmapToFloat32Tensor(
final Bitmap bitmap,
@ -110,20 +109,21 @@ public final class TensorImageUtils {
final FloatBuffer floatBuffer = Tensor.allocateFloatBuffer(3 * width * height);
bitmapToFloatBuffer(bitmap, x, y, width, height, normMeanRGB, normStdRGB, floatBuffer, 0);
return Tensor.fromBlob(floatBuffer, new long[]{1, 3, height, width});
return Tensor.fromBlob(floatBuffer, new long[] {1, 3, height, width});
}
/**
* Creates new {@link org.pytorch.Tensor} from specified area of {@link android.media.Image},
* doing optional rotation, scaling (nearest) and center cropping.
*
* @param image {@link android.media.Image} as a source for Tensor data
* @param image {@link android.media.Image} as a source for Tensor data
* @param rotateCWDegrees Clockwise angle through which the input image needs to be rotated to be
* upright. Range of valid values: 0, 90, 180, 270
* @param tensorWidth return tensor width, must be positive
* @param tensorHeight return tensor height, must be positive
* @param normMeanRGB means for RGB channels normalization, length must equal 3, RGB order
* @param normStdRGB standard deviation for RGB channels normalization, length must equal 3, RGB order
* upright. Range of valid values: 0, 90, 180, 270
* @param tensorWidth return tensor width, must be positive
* @param tensorHeight return tensor height, must be positive
* @param normMeanRGB means for RGB channels normalization, length must equal 3, RGB order
* @param normStdRGB standard deviation for RGB channels normalization, length must equal 3, RGB
* order
*/
public static Tensor imageYUV420CenterCropToFloat32Tensor(
final Image image,
@ -145,26 +145,24 @@ public final class TensorImageUtils {
final FloatBuffer floatBuffer = Tensor.allocateFloatBuffer(3 * tensorWidth * tensorHeight);
imageYUV420CenterCropToFloatBuffer(
image,
rotateCWDegrees,
tensorWidth,
tensorHeight,
normMeanRGB, normStdRGB, floatBuffer, 0);
return Tensor.fromBlob(floatBuffer, new long[]{1, 3, tensorHeight, tensorWidth});
image, rotateCWDegrees, tensorWidth, tensorHeight, normMeanRGB, normStdRGB, floatBuffer, 0);
return Tensor.fromBlob(floatBuffer, new long[] {1, 3, tensorHeight, tensorWidth});
}
/**
* Writes tensor content from specified {@link android.media.Image}, doing optional rotation,
* scaling (nearest) and center cropping to specified {@link java.nio.FloatBuffer} with specified offset.
* scaling (nearest) and center cropping to specified {@link java.nio.FloatBuffer} with specified
* offset.
*
* @param image {@link android.media.Image} as a source for Tensor data
* @param image {@link android.media.Image} as a source for Tensor data
* @param rotateCWDegrees Clockwise angle through which the input image needs to be rotated to be
* upright. Range of valid values: 0, 90, 180, 270
* @param tensorWidth return tensor width, must be positive
* @param tensorHeight return tensor height, must be positive
* @param normMeanRGB means for RGB channels normalization, length must equal 3, RGB order
* @param normStdRGB standard deviation for RGB channels normalization, length must equal 3, RGB order
* @param outBuffer Output buffer, where tensor content will be written
* upright. Range of valid values: 0, 90, 180, 270
* @param tensorWidth return tensor width, must be positive
* @param tensorHeight return tensor height, must be positive
* @param normMeanRGB means for RGB channels normalization, length must equal 3, RGB order
* @param normStdRGB standard deviation for RGB channels normalization, length must equal 3, RGB
* order
* @param outBuffer Output buffer, where tensor content will be written
* @param outBufferOffset Output buffer offset with which tensor content will be written
*/
public static void imageYUV420CenterCropToFloatBuffer(
@ -210,8 +208,7 @@ public final class TensorImageUtils {
normMeanRGB,
normStdRGB,
outBuffer,
outBufferOffset
);
outBufferOffset);
}
private static class NativePeer {
@ -238,11 +235,11 @@ public final class TensorImageUtils {
float[] normMeanRgb,
float[] normStdRgb,
Buffer outBuffer,
int outBufferOffset
);
int outBufferOffset);
}
private static void checkOutBufferCapacity(FloatBuffer outBuffer, int outBufferOffset, int tensorWidth, int tensorHeight) {
private static void checkOutBufferCapacity(
FloatBuffer outBuffer, int outBufferOffset, int tensorWidth, int tensorHeight) {
if (outBufferOffset + 3 * tensorWidth * tensorHeight > outBuffer.capacity()) {
throw new IllegalStateException("Buffer underflow");
}

View File

@ -12,15 +12,6 @@ import android.view.TextureView;
import android.view.ViewStub;
import android.widget.TextView;
import android.widget.Toast;
import org.pytorch.IValue;
import org.pytorch.Module;
import org.pytorch.PyTorchAndroid;
import org.pytorch.Tensor;
import org.pytorch.torchvision.TensorImageUtils;
import java.nio.FloatBuffer;
import androidx.annotation.Nullable;
import androidx.annotation.UiThread;
import androidx.annotation.WorkerThread;
@ -32,6 +23,12 @@ import androidx.camera.core.ImageProxy;
import androidx.camera.core.Preview;
import androidx.camera.core.PreviewConfig;
import androidx.core.app.ActivityCompat;
import java.nio.FloatBuffer;
import org.pytorch.IValue;
import org.pytorch.Module;
import org.pytorch.PyTorchAndroid;
import org.pytorch.Tensor;
import org.pytorch.torchvision.TensorImageUtils;
public class CameraActivity extends AppCompatActivity {
private static final String TAG = BuildConfig.LOGCAT_TAG;
@ -59,10 +56,7 @@ public class CameraActivity extends AppCompatActivity {
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.CAMERA)
!= PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(
this,
PERMISSIONS,
REQUEST_CODE_CAMERA_PERMISSION);
ActivityCompat.requestPermissions(this, PERMISSIONS, REQUEST_CODE_CAMERA_PERMISSION);
} else {
setupCameraX();
}
@ -103,9 +97,9 @@ public class CameraActivity extends AppCompatActivity {
if (requestCode == REQUEST_CODE_CAMERA_PERMISSION) {
if (grantResults[0] == PackageManager.PERMISSION_DENIED) {
Toast.makeText(
this,
"You can't use image classification example without granting CAMERA permission",
Toast.LENGTH_LONG)
this,
"You can't use image classification example without granting CAMERA permission",
Toast.LENGTH_LONG)
.show();
finish();
} else {
@ -118,17 +112,19 @@ public class CameraActivity extends AppCompatActivity {
private static final int TENSOR_HEIGHT = 224;
private void setupCameraX() {
final TextureView textureView = ((ViewStub) findViewById(R.id.camera_texture_view_stub))
.inflate()
.findViewById(R.id.texture_view);
final TextureView textureView =
((ViewStub) findViewById(R.id.camera_texture_view_stub))
.inflate()
.findViewById(R.id.texture_view);
final PreviewConfig previewConfig = new PreviewConfig.Builder().build();
final Preview preview = new Preview(previewConfig);
preview.setOnPreviewOutputUpdateListener(new Preview.OnPreviewOutputUpdateListener() {
@Override
public void onUpdated(Preview.PreviewOutput output) {
textureView.setSurfaceTexture(output.getSurfaceTexture());
}
});
preview.setOnPreviewOutputUpdateListener(
new Preview.OnPreviewOutputUpdateListener() {
@Override
public void onUpdated(Preview.PreviewOutput output) {
textureView.setSurfaceTexture(output.getSurfaceTexture());
}
});
final ImageAnalysisConfig imageAnalysisConfig =
new ImageAnalysisConfig.Builder()
@ -149,12 +145,13 @@ public class CameraActivity extends AppCompatActivity {
if (result != null) {
mLastAnalysisResultTime = SystemClock.elapsedRealtime();
CameraActivity.this.runOnUiThread(new Runnable() {
@Override
public void run() {
CameraActivity.this.handleResult(result);
}
});
CameraActivity.this.runOnUiThread(
new Runnable() {
@Override
public void run() {
CameraActivity.this.handleResult(result);
}
});
}
}
});
@ -174,17 +171,20 @@ public class CameraActivity extends AppCompatActivity {
Log.i(TAG, "Loading module from asset '" + BuildConfig.MODULE_ASSET_NAME + "'");
mModule = PyTorchAndroid.loadModuleFromAsset(getAssets(), BuildConfig.MODULE_ASSET_NAME);
mInputTensorBuffer = Tensor.allocateFloatBuffer(3 * TENSOR_WIDTH * TENSOR_HEIGHT);
mInputTensor = Tensor.fromBlob(mInputTensorBuffer, new long[]{1, 3, TENSOR_WIDTH,
TENSOR_HEIGHT});
mInputTensor =
Tensor.fromBlob(mInputTensorBuffer, new long[] {1, 3, TENSOR_WIDTH, TENSOR_HEIGHT});
}
final long startTime = SystemClock.elapsedRealtime();
TensorImageUtils.imageYUV420CenterCropToFloatBuffer(
image.getImage(), rotationDegrees,
TENSOR_WIDTH, TENSOR_HEIGHT,
image.getImage(),
rotationDegrees,
TENSOR_WIDTH,
TENSOR_HEIGHT,
TensorImageUtils.TORCHVISION_NORM_MEAN_RGB,
TensorImageUtils.TORCHVISION_NORM_STD_RGB,
mInputTensorBuffer, 0);
mInputTensorBuffer,
0);
final long moduleForwardStartTime = SystemClock.elapsedRealtime();
final Tensor outputTensor = mModule.forward(IValue.from(mInputTensor)).toTensor();
final long moduleForwardDuration = SystemClock.elapsedRealtime() - moduleForwardStartTime;
@ -198,9 +198,10 @@ public class CameraActivity extends AppCompatActivity {
@UiThread
protected void handleResult(Result result) {
int ixs[] = Utils.topK(result.scores, 1);
String message = String.format("forwardDuration:%d class:%s",
result.moduleForwardDuration,
Constants.IMAGENET_CLASSES[ixs[0]]);
String message =
String.format(
"forwardDuration:%d class:%s",
result.moduleForwardDuration, Constants.IMAGENET_CLASSES[ixs[0]]);
Log.i(TAG, message);
mTextViewStringBuilder.insert(0, '\n').insert(0, message);
if (mTextViewStringBuilder.length() > TEXT_TRIM_SIZE) {

View File

@ -10,13 +10,12 @@ import androidx.annotation.Nullable;
import androidx.annotation.UiThread;
import androidx.annotation.WorkerThread;
import androidx.appcompat.app.AppCompatActivity;
import java.nio.FloatBuffer;
import org.pytorch.IValue;
import org.pytorch.Module;
import org.pytorch.PyTorchAndroid;
import org.pytorch.Tensor;
import java.nio.FloatBuffer;
public class MainActivity extends AppCompatActivity {
private static final String TAG = BuildConfig.LOGCAT_TAG;
@ -31,21 +30,23 @@ public class MainActivity extends AppCompatActivity {
private Tensor mInputTensor;
private StringBuilder mTextViewStringBuilder = new StringBuilder();
private final Runnable mModuleForwardRunnable = new Runnable() {
@Override
public void run() {
final Result result = doModuleForward();
runOnUiThread(new Runnable() {
private final Runnable mModuleForwardRunnable =
new Runnable() {
@Override
public void run() {
handleResult(result);
if (mBackgroundHandler != null) {
mBackgroundHandler.post(mModuleForwardRunnable);
}
final Result result = doModuleForward();
runOnUiThread(
new Runnable() {
@Override
public void run() {
handleResult(result);
if (mBackgroundHandler != null) {
mBackgroundHandler.post(mModuleForwardRunnable);
}
}
});
}
});
}
};
};
@Override
protected void onCreate(Bundle savedInstanceState) {