ScanActivity.java revision c219b1556fa413891ce35c26d59a03e767dc4fed
/*
* FreeOTP
*
* Authors: Nathaniel McCallum <npmccallum@redhat.com>
*
* Copyright (C) 2013 Nathaniel McCallum, Red Hat
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
private final ScanAsyncTask mScanAsyncTask;
private final int mCameraId;
}
super.handleMessage(msg);
}
}
}
public static boolean haveCamera() {
}
// Find a back-facing camera, otherwise use the first camera.
break;
}
return cameraId;
}
public ScanActivity() {
super();
assert mCameraId >= 0;
// Create the decoder thread
mScanAsyncTask = new ScanAsyncTask() {
super.onPostExecute(result);
finish();
}
};
}
super.onCreate(savedInstanceState);
}
public void onDestroy() {
super.onDestroy();
mScanAsyncTask.cancel(true);
}
protected void onStart() {
super.onStart();
}
return;
// The code in this section comes from the developer docs. See:
// http://developer.android.com/reference/android/hardware/Camera.html#setDisplayOrientation(int)
int rotation = 0;
case Surface.ROTATION_0:
rotation = 0;
break;
case Surface.ROTATION_90:
rotation = 90;
break;
case Surface.ROTATION_180:
rotation = 180;
break;
case Surface.ROTATION_270:
rotation = 270;
break;
}
int result = 0;
switch (mCameraInfo.facing) {
break;
break;
}
}
@TargetApi(14)
try {
// Open the camera
} catch (Exception e) {
e.printStackTrace();
// Show error message
return;
}
// Set auto-focus mode
}
}
return;
}
}
}