Commit 4a4dfd74 by onuma

Task #42647 OS10 で THETAが認識されない。

parent f7f0d433
......@@ -114,13 +114,6 @@ android {
abiFilters "x86_64", ""
}
}
// 容量が大きいため、コメントアウト
// x86_armv7 {
// ndk {
// abiFilters "x86", "armeabi-v7a", ""
// }
// }
} else {
armv7 {
versionCode defaultConfig.versionCode
......@@ -128,6 +121,7 @@ android {
abiFilters "armeabi-v7a", ""
}
}
armv8 {
versionCode defaultConfig.versionCode + 1
ndk {
......
......@@ -47,7 +47,6 @@ public class ThetaHelper {
* @return true:接続成功、false:接続失敗
*/
public boolean connectThetaCameraWifi(int networkId) {
Logger.i(TAG,"connectThetaCameraWifi : " + networkId);
WifiManager wifiManager = (WifiManager)mContext.getApplicationContext().getSystemService(Context.WIFI_SERVICE);
if (wifiManager == null) {
Logger.e(TAG, "wifiManager == null");
......@@ -67,7 +66,6 @@ public class ThetaHelper {
* @return networkIdを返す(-1は失敗)
*/
public int saveThetaCameraWifi(String ssid) {
Logger.i(TAG, "saveThetaCameraWifi : " + ssid);
WifiManager wifiManager = (WifiManager)mContext.getApplicationContext().getSystemService(Context.WIFI_SERVICE);
if (wifiManager == null) {
Logger.e(TAG, "wifiManager == null");
......@@ -109,7 +107,6 @@ public class ThetaHelper {
* @return 存在有無(true:存在する,false:存在しない)
*/
private boolean checkWifiNetwork(String ssid) {
Logger.i(TAG,"checkWifiNetwork : " + ssid);
WifiManager wifiManager = (WifiManager)mContext.getApplicationContext().getSystemService(Context.WIFI_SERVICE);
if (wifiManager == null) {
Logger.e(TAG, "wifiManager == null");
......@@ -121,7 +118,7 @@ public class ThetaHelper {
for (ScanResult scanResult : wifiManager.getScanResults()) {
String scanResultSSID = scanResult.SSID.replace("\"", "");
int index = scanResultSSID.indexOf(ssid);
Logger.i(TAG, "scanResultSSID = " + scanResultSSID);
Logger.d(TAG, "scanResultSSID = " + scanResultSSID);
if (index != -1) {
hasWifiList = true;
}
......@@ -134,7 +131,7 @@ public class ThetaHelper {
* @param ssid アクセスポイント
* @return 接続パスワード
*/
public static String getPassword(String ssid) {
public String getPassword(String ssid) {
String password = ssid.replace("THETA","");
password = password.replace(".OSC","");
return password.substring(2);
......@@ -219,7 +216,6 @@ public class ThetaHelper {
* @return true:接続状態、false:非接続状態
*/
public boolean checkThetaCameraWifiConnected(@NonNull WifiManager wifiManager) {
Logger.i(TAG,"--- checkThetaCameraWifiConnected");
List<ScanResult> results = wifiManager.getScanResults();
boolean isConnected = false;
for (ScanResult scanResult : results) {
......@@ -251,7 +247,7 @@ public class ThetaHelper {
* THETAカメラWi-Fiと非接続
*/
public void disConnectThetaCameraWifi(WifiManager wifiManager) {
Logger.i(TAG,"--- disConnectThetaCameraWifi");
Logger.d(TAG,"disConnectThetaCameraWifi");
//既存接続中のネットワーク切断
WifiInfo wifi_inf = wifiManager.getConnectionInfo();
if (wifi_inf.getNetworkId() != -1 ) {
......@@ -261,30 +257,6 @@ public class ThetaHelper {
wifiManager.disconnect();
}
public static ConnectivityManager.NetworkCallback networkCallback_ = new ConnectivityManager.NetworkCallback() {
@Override
public void onAvailable(@NonNull Network network) {
super.onAvailable(network);
}
@Override
public void onLost(@NonNull Network network) {
super.onLost(network);
}
@Override
public void onUnavailable() {
super.onUnavailable();
}
};
public static ConnectivityManager.NetworkCallback getNetworkCallback(){
if (networkCallback_ == null) {
networkCallback_ = new ConnectivityManager.NetworkCallback();
}
return networkCallback_;
}
/**
* ConnectivityManagerを利用してアプリ(プロセス)全体のネットワークを設定します。
......@@ -310,7 +282,6 @@ public class ThetaHelper {
* ConnectivityManagerを利用してアプリ(プロセス)全体のネットワークを解除する。
*/
public void appConnectedWifiDefault() {
Logger.i(TAG,"---- appConnectedWifiDefault");
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) {
ConnectivityManager connectivityManager = (ConnectivityManager)mContext.getSystemService(Context.CONNECTIVITY_SERVICE);
if (connectivityManager != null) {
......
......@@ -10,13 +10,10 @@ import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import jp.agentec.abook.abv.bl.common.log.Logger;
/**
* Input stream for motion JPEG data
*/
public class MJpegInputStream extends DataInputStream {
private static final String TAG = "MJpegInputStream";
private final byte[] SOI_MARKER = {(byte) 0xFF, (byte) 0xD8};
private final byte[] EOF_MARKER = {(byte) 0xFF, (byte) 0xD9};
private final static String CONTENT_LENGTH = "Content-Length";
......@@ -80,17 +77,13 @@ public class MJpegInputStream extends DataInputStream {
properties.load(bais);
return Integer.parseInt(properties.getProperty(CONTENT_LENGTH));
}
private int systemCount_ = 0;
/**
* Acquire image data for 1 frame
* @return Image data for 1 frame
* @throws IOException
*/
public Bitmap readMJpegFrame() throws IOException {
if (systemCount_%10 == 0) {
Logger.i(TAG, "--- readMJpegFrame");
}
systemCount_++;
mark(FRAME_MAX_LENGTH);
int headerLength = getStartOfSequence(this, SOI_MARKER);
int contentLength;
......
package jp.agentec.abook.abv.ui.common.activity;
import android.accounts.Account;
import android.accounts.AccountManager;
import android.app.Activity;
import android.app.ActivityManager;
import android.app.ActivityManager.RunningTaskInfo;
import android.app.AlarmManager;
import android.app.AlertDialog;
import android.app.PendingIntent;
import android.app.ProgressDialog;
import android.content.BroadcastReceiver;
import android.content.ContentValues;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.content.pm.ActivityInfo;
import android.content.res.Configuration;
import android.graphics.Color;
......
......@@ -3,74 +3,43 @@ package jp.agentec.abook.abv.ui.common.activity;
import jp.agentec.abook.abv.bl.acms.type.DownloadStatusType;
import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.CommonExecutor;
import jp.agentec.abook.abv.bl.common.Constant;
import jp.agentec.abook.abv.bl.common.exception.ABVException;
import jp.agentec.abook.abv.bl.common.exception.ABVExceptionCode;
import jp.agentec.abook.abv.bl.common.exception.AcmsException;
import jp.agentec.abook.abv.bl.common.exception.NetworkDisconnectedException;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.data.ABVDataCache;
import jp.agentec.abook.abv.bl.data.dao.AbstractDao;
import jp.agentec.abook.abv.bl.data.dao.OperationDao;
import jp.agentec.abook.abv.bl.download.ContentDownloader;
import jp.agentec.abook.abv.bl.download.ContentFileExtractor;
import jp.agentec.abook.abv.bl.download.ContentZipDownloadNotification;
import jp.agentec.abook.abv.bl.dto.ContentDto;
import jp.agentec.abook.abv.bl.dto.FixPushMessageDto;
import jp.agentec.abook.abv.bl.dto.OperationDto;
import jp.agentec.abook.abv.bl.dto.PushMessageDto;
import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.PushMessageLogic;
import jp.agentec.abook.abv.cl.environment.DeviceInfo;
import jp.agentec.abook.abv.cl.helper.ContentMarkingFileHelper;
import jp.agentec.abook.abv.cl.util.AndroidStringUtil;
import jp.agentec.abook.abv.launcher.android.ABVApplication;
import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
import jp.agentec.abook.abv.ui.common.constant.ErrorCode;
import jp.agentec.abook.abv.ui.common.constant.NaviConsts;
import jp.agentec.abook.abv.ui.common.dialog.ABookAlertDialog;
import jp.agentec.abook.abv.ui.common.helper.ProgressDialogHelper;
import jp.agentec.abook.abv.ui.common.util.ABVToastUtil;
import jp.agentec.abook.abv.ui.common.util.AlertDialogUtil;
import jp.agentec.abook.abv.ui.common.util.KeyboardUtils;
import jp.agentec.abook.abv.ui.common.util.LogUtil;
import jp.agentec.abook.abv.ui.common.util.PatternStringUtil;
import jp.agentec.abook.abv.ui.home.activity.ABookSettingActivity;
import jp.agentec.abook.abv.ui.home.adapter.FixPushMessageAdapter;
import jp.agentec.abook.abv.ui.home.adapter.OperationSelectAdapter;
import jp.agentec.abook.abv.ui.home.adapter.PushMessageListAdapter;
import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper;
import jp.agentec.abook.abv.ui.viewer.activity.DeviceImageListActivity;
import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.view.Window;
import android.view.animation.Animation;
import android.view.animation.LinearInterpolator;
import android.view.animation.RotateAnimation;
import android.widget.AdapterView;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.RadioGroup;
import android.widget.TextView;
import android.widget.Toast;
import com.handmark.pulltorefresh.library.PullToRefreshBase;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
public abstract class ABVUIActivity extends ABVAuthenticatedActivity {
private final static String TAG = "ABVUIActivity";
......@@ -534,7 +503,6 @@ public abstract class ABVUIActivity extends ABVAuthenticatedActivity {
* @return true:有効, false:無効
*/
protected boolean deviceWifiEnable() {
Logger.i(TAG,"--------- deviceWifiEnable");
if (DeviceInfo.isDeviceWifiEnabled(this)) {
return true;
} else {
......
......@@ -30,12 +30,10 @@ import java.util.Stack;
import jp.agentec.abook.abv.bl.acms.client.json.DownloadedContentInfoJSON;
import jp.agentec.abook.abv.bl.acms.client.json.content.ContentJSON;
import jp.agentec.abook.abv.bl.acms.type.DeliveryType;
import jp.agentec.abook.abv.bl.acms.type.DownloadStatusType;
import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.constant.ABookKeys;
import jp.agentec.abook.abv.bl.common.exception.AcmsException;
import jp.agentec.abook.abv.bl.common.exception.NetworkDisconnectedException;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.common.util.ContentFileUtil;
import jp.agentec.abook.abv.bl.common.util.JsonUtil;
......@@ -69,7 +67,6 @@ import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.DefPrefKey;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.UserPrefKey;
import jp.agentec.abook.abv.ui.common.appinfo.AppNaviType;
import jp.agentec.abook.abv.ui.common.constant.ErrorCode;
import jp.agentec.abook.abv.ui.common.constant.NaviConsts;
import jp.agentec.abook.abv.ui.common.dialog.ABookAlertDialog;
import jp.agentec.abook.abv.ui.common.util.ABVToastUtil;
......@@ -81,7 +78,6 @@ import jp.agentec.abook.abv.ui.home.activity.OperationRelatedContentActivity;
import jp.agentec.abook.abv.ui.viewer.activity.AudioPlayActivity;
import jp.agentec.abook.abv.ui.viewer.activity.CheckOZDViewActivity;
import jp.agentec.abook.abv.ui.viewer.activity.ContentViewActivity;
import jp.agentec.abook.abv.ui.viewer.activity.DeviceImageListActivity;
import jp.agentec.abook.abv.ui.viewer.activity.EnqueteWebViewActivity;
import jp.agentec.abook.abv.ui.viewer.activity.HTMLWebViewActivity;
import jp.agentec.abook.abv.ui.viewer.activity.HTMLXWalkWebViewActivity;
......@@ -90,7 +86,6 @@ import jp.agentec.abook.abv.ui.viewer.activity.ParentWebViewActivity;
import jp.agentec.abook.abv.ui.viewer.activity.PreviewActivity;
import jp.agentec.abook.abv.ui.viewer.activity.VideoViewActivity;
import jp.agentec.abook.abv.ui.viewer.activity.theta.ThetaActivity;
import jp.agentec.abook.abv.ui.viewer.view.OperationTaskLayout;
import jp.agentec.adf.net.http.HttpDownloadSimpleNotification;
import jp.agentec.adf.util.CollectionUtil;
import jp.agentec.adf.util.DateTimeFormat;
......@@ -1884,7 +1879,6 @@ public class ActivityHandlingHelper extends ABookHelper implements RemoteObserve
* THETAカメラと接続が切れたときにTHETA関連Activityをすべて終了させる
*/
public synchronized void finishAllThetaActivity() {
Logger.i(TAG,"---- finishAllThetaActivity");
for (ABVAuthenticatedActivity activity : currentActivityStack) {
if (activity instanceof ThetaActivity) {
activity.finish();
......
......@@ -531,7 +531,7 @@ public class DeviceImageListActivity extends ABVUIActivity {
registerButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Logger.i(TAG,"registerButton.onClick");
Logger.v(TAG,"registerButton.onClick");
buttonDoubleTapControl(registerButton);
if (deviceWifiEnable()) {
wifiScanStart();
......@@ -585,7 +585,7 @@ public class DeviceImageListActivity extends ABVUIActivity {
* ブロードキャスト リスナーを登録し、Wifiスキャンを開始する。
*/
private void wifiScanStart() {
Logger.i(TAG,"---- wifiScanStart");
Logger.v(TAG,"wifiScanStart");
showProgressPopup();
registerReceiver(wifiReceiver, new IntentFilter(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION));
mWifiManager.startScan();
......@@ -597,15 +597,14 @@ public class DeviceImageListActivity extends ABVUIActivity {
* @param networkId 接続可能なネットワークID
*/
private void connectThetaWifi(final String ssid, int networkId) {
Logger.i(TAG,"connectThetaWifi");
Logger.i(TAG,"connectThetaWifi ssid=%s, networdId=%s, Build.VERSION_CODE=%s", ssid, networkId, Build.VERSION.SDK_INT);
showProgressPopup(getString(R.string.msg_wifi_connecting));
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
Logger.i(TAG,"connectThetaWifi Android10");
showProgressPopup(getString(R.string.msg_wifi_connecting));
WifiNetworkSpecifier.Builder builder = new WifiNetworkSpecifier.Builder();
builder.setSsid(ssid);
String pass = ThetaHelper.getPassword(ssid);
String pass = mThetaHelper.getPassword(ssid);
builder.setWpa2Passphrase(pass);
WifiNetworkSpecifier wifiNetworkSpecifier = builder.build();
......@@ -620,7 +619,6 @@ public class DeviceImageListActivity extends ABVUIActivity {
@Override
public void onAvailable(Network network) {
super.onAvailable(network);
closeProgressPopup();
ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
if (cm != null) {
// 接続したら保存
......@@ -651,8 +649,6 @@ public class DeviceImageListActivity extends ABVUIActivity {
cm.requestNetwork(networkRequest, networkCallback_);
}
} else {
Logger.i(TAG,"connectThetaWifi Android9以下");
showProgressPopup(getString(R.string.msg_wifi_connecting));
if (networkId == -1) {
networkId = mThetaHelper.saveThetaCameraWifi(ssid);
......@@ -705,15 +701,14 @@ public class DeviceImageListActivity extends ABVUIActivity {
* @param deviceInfo THETAカメラ情報
*/
public void thetaDeviceInfoTaskFinish(ThetaDeviceInfo deviceInfo) {
Logger.i(TAG, "--- thetaDeviceInfoTaskFinish");
closeProgressPopup();
if (deviceInfo != null && deviceInfo.getModel().length() != 0) {
if (deviceInfo.getModel().equals(ABookValues.THETA_MODEL_NAME_THETA_S) || deviceInfo.getModel().equals(ABookValues.THETA_MODEL_NAME_THETA_SC)) {
putUserPref(ABookKeys.THETA_OLD_VERSION_FLG, true);
Logger.i(TAG, "thetaDeviceInfoTaskFinish use API2.0");
Logger.d(TAG, "thetaDeviceInfoTaskFinish use API2.0");
} else {
putUserPref(ABookKeys.THETA_OLD_VERSION_FLG, false);
Logger.i(TAG, "thetaDeviceInfoTaskFinish use API2.1");
Logger.d(TAG, "thetaDeviceInfoTaskFinish use API2.1");
}
if (mThetaDeviceConnectDialog != null && mThetaDeviceConnectDialog.isShowing()) {
......@@ -729,7 +724,6 @@ public class DeviceImageListActivity extends ABVUIActivity {
AlertDialogUtil.showAlertDialog(this, R.string.app_name, R.string.msg_fail_connect_theta_wifi, true, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Logger.i(TAG,"---AlertDialogUtil.onClick");
wifiScanStart();
}
});
......@@ -742,7 +736,6 @@ public class DeviceImageListActivity extends ABVUIActivity {
BroadcastReceiver wifiReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
Logger.i(TAG,"--- wifiReceiver onReceive");
unregisterReceiver(wifiReceiver);
thetaWifiScanResult();
}
......@@ -755,25 +748,23 @@ public class DeviceImageListActivity extends ABVUIActivity {
* ③未登録の端末情報取得し、画面再描画
*/
public void thetaWifiScanResult() {
Logger.i(TAG, "--- thetaWifiScanResult");
List<ScanResult> results = mWifiManager.getScanResults();
boolean isConnected = false;
List<ThetaDeviceInfo> scanWifiList = new ArrayList<>();
List<ThetaDeviceInfo> scanSavedWifiList = new ArrayList<>();
for (ScanResult scanResult : results) {
String scanSSID = scanResult.SSID.replace("\"", "");
Logger.i(TAG, "*****scanSSID = "+ scanSSID);
Logger.d(TAG, "*****scanSSID = "+ scanSSID);
if (scanSSID.length() != 0) {
int index = scanSSID.indexOf(ABookValues.THETA_MODEL_NAME_THETA);
ThetaDeviceInfo deviceInfo = new ThetaDeviceInfo();
if (index != -1) {
int networkId = -1;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
Logger.i(TAG, "--- thetaWifiScanResult --- Q以上");
deviceInfo.setSSID(scanSSID);
String[] ssid = PreferenceUtil.get(getApplicationContext(), AppDefType.DefPrefKey.THETA_SSID_STRING);
if (ssid != null) {
savedThetaList_ = Arrays.asList(ssid);
savedThetaList_ = new ArrayList<>(Arrays.asList(ssid));
if (findThetaSSID(scanSSID)) {
networkId = 0; // -1 だと未登録になるので
deviceInfo.setSSID(scanSSID);
......@@ -781,7 +772,6 @@ public class DeviceImageListActivity extends ABVUIActivity {
}
}
} else {
Logger.i(TAG, "--- thetaWifiScanResult --- OS9 以下");
for (WifiConfiguration configuration : mWifiManager.getConfiguredNetworks()) {
// Android4.2以降よりダブルクォーテーションが付いてくるので除去
String configurationSSID = configuration.SSID.replace("\"", "");
......@@ -831,15 +821,8 @@ public class DeviceImageListActivity extends ABVUIActivity {
* @return ssidの追加された、あたらしいsavedThetaList_
*/
private List<String> addThetaSSID(String ssid) {
if (savedThetaList_.size()==0){
// 最初の1つめは必ず登録
if (!findThetaSSID(ssid)) {
savedThetaList_.add(ssid);
} else {
for (String id : savedThetaList_) {
if (!findThetaSSID(id)) {
savedThetaList_.add(id);
}
}
}
return savedThetaList_;
}
......
......@@ -5,9 +5,7 @@ import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.net.ConnectivityManager;
import android.net.wifi.WifiManager;
import android.os.Build;
import android.os.Bundle;
import com.theta.helper.ThetaHelper;
......@@ -43,13 +41,11 @@ public class ThetaActivity extends ABVUIActivity {
BroadcastReceiver wifiReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
Logger.i(TAG,"---- wifiReceiver onReceive");
unregisterReceiver(wifiReceiver);
boolean isConnected = mThetaHelper.checkThetaCameraWifiConnected(mWifiManager);
closeProgressPopup();
//THETAカメラ画面閉じる
if (mWifiScanType == Constant.WifiScanType.CloseCameraActivity) {
isConnected = true;
if (isConnected) {
mThetaHelper.disConnectThetaCameraWifi(mWifiManager);
}
......@@ -94,7 +90,7 @@ public class ThetaActivity extends ABVUIActivity {
* Wi-Fiが接続状態かチェックする。
*/
protected void closeThetaCameraActivity() {
Logger.i(TAG,"---- closeThetaCameraActivity");
Logger.i(TAG,"closeThetaCameraActivity");
showProgressPopup();
//現在接続状態なのかチェック
registerReceiver(wifiReceiver, new IntentFilter(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION));
......
......@@ -54,6 +54,7 @@ public class ThetaCameraActivity extends ThetaActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
Logger.i(TAG,"onCreate");
super.onCreate(savedInstanceState);
setContentView(R.layout.ac_theta_camera);
mLiveView = findViewById(R.id.live_view);
......@@ -62,7 +63,7 @@ public class ThetaCameraActivity extends ThetaActivity {
closeBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Logger.i(TAG, "--- CloseBtn.onClick");
Logger.v(TAG, "CloseBtn.onClick");
buttonDoubleTapControl(closeBtn);
mLiveView.stopPlay();
if (deviceWifiEnable()) {
......@@ -78,7 +79,6 @@ public class ThetaCameraActivity extends ThetaActivity {
mShootBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Logger.i(TAG, "--- mShootBtn.onClick");
buttonDoubleTapControl(mShootBtn);
showProgressPopup();
new ShootTask(ThetaCameraActivity.this).execute();
......@@ -92,7 +92,6 @@ public class ThetaCameraActivity extends ThetaActivity {
mImageListBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Logger.i(TAG, "--- mImageListBtn.onClick");
buttonDoubleTapControl(mImageListBtn);
Intent intent = new Intent();
intent.setClassName(getPackageName(), ThetaImageListActivity.class.getName());
......@@ -257,7 +256,7 @@ public class ThetaCameraActivity extends ThetaActivity {
* @param mJpegInputStream Live画像データ
*/
public void showLiveViewTaskFinish(MJpegInputStream mJpegInputStream) {
Logger.i(TAG,"----- showLiveViewTaskFinish");
if (mJpegInputStream != null) {
mLiveView.setSource(mJpegInputStream);
new GetOptionExposureTask(ThetaCameraActivity.this).execute();
......@@ -314,7 +313,6 @@ public class ThetaCameraActivity extends ThetaActivity {
*/
@Override
protected void thetaCameraWifiConnected() {
Logger.i(TAG,"thetaCameraWifiConnected");
if (mLiveView.getSource() == null) {
if (mLivePreviewTask != null) {
mLivePreviewTask.cancel(true);
......
......@@ -48,7 +48,6 @@ public class ThetaImagePreviewActivity extends ThetaActivity {
backBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Logger.i(TAG, "--- backBtn.onClick");
//転送後にTHETAライブラリ再描画のため
if (isThetaListActivityBack && isSavedSuccess) {
setResult(RESULT_OK);
......@@ -62,7 +61,6 @@ public class ThetaImagePreviewActivity extends ThetaActivity {
mSaveBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Logger.i(TAG,"mSaveBtn.onClick");
buttonDoubleTapControl(mSaveBtn);
AlertDialogUtil.showAlertDialog(ThetaImagePreviewActivity.this, R.string.app_name, R.string.msg_theta_image_send_confirm, false, new DialogInterface.OnClickListener() {
@Override
......@@ -72,11 +70,9 @@ public class ThetaImagePreviewActivity extends ThetaActivity {
@Override
public void run() {
if (mThetaHelper.thetaImageLocalSave(mTexture.getPhoto(), mFileId)) {
Logger.i(TAG,"画像転送に成功しました。");
showSimpleAlertDialog(R.string.app_name, R.string.msg_theta_image_send_success);
isSavedSuccess = true;
} else {
Logger.i(TAG,"画像転送に失敗しました。");
showSimpleAlertDialog(R.string.app_name, R.string.msg_theta_image_send_fail);
}
closeProgressPopup();
......@@ -102,7 +98,7 @@ public class ThetaImagePreviewActivity extends ThetaActivity {
//端末の戻るボタン禁止
@Override
public boolean dispatchKeyEvent(KeyEvent event) {
Logger.i(TAG, "dispatchKeyEvent %s", event);
Logger.v(TAG, "dispatchKeyEvent %s", event);
if (event.getAction()==KeyEvent.ACTION_UP) { // 戻るボタンを抑止
if (event.getKeyCode() == KeyEvent.KEYCODE_BACK) {
return true;
......@@ -116,7 +112,6 @@ public class ThetaImagePreviewActivity extends ThetaActivity {
* @param imageData 画像データ
*/
public void loadPhotoTaskFinish(ImageData imageData) {
Logger.i(TAG, "--- loadPhotoTaskFinish");
if (imageData != null) {
byte[] dataObject = imageData.getRawData();
if (dataObject == null) {
......
......@@ -24,13 +24,12 @@ public class DeviceInfoTask extends AsyncTask<Void, String, ThetaDeviceInfo> {
private static final int FAIL_RETRAY_DELAY_MILLIS = 2000;
public DeviceInfoTask(DeviceImageListActivity refActivity) {
Logger.i(TAG,"--- DeviceInfoTask");
this.refActivity = new WeakReference<>(refActivity);
}
@Override
protected ThetaDeviceInfo doInBackground(Void... params) {
Logger.i(TAG, "--- doInBackground");
Logger.d(TAG, "doInBackground");
HttpConnector camera = new HttpConnector(ABookValues.THETA_IP_ADDRESS);
final int MAX_RETRY_COUNT = 6;
ThetaDeviceInfo deviceInfo = null;
......@@ -57,7 +56,7 @@ public class DeviceInfoTask extends AsyncTask<Void, String, ThetaDeviceInfo> {
@Override
protected void onPostExecute(ThetaDeviceInfo deviceInfo) {
Logger.i(TAG, "--- onPostExecute");
Logger.d(TAG, "onPostExecute");
DeviceImageListActivity activity = refActivity.get();
activity.thetaDeviceInfoTaskFinish(deviceInfo);
}
......
......@@ -32,7 +32,6 @@ public class ImageListTask extends AsyncTask<Void, String, List<ImageRow>> {
private final WeakReference<ThetaImageListActivity> refActivity;
public ImageListTask(ThetaImageListActivity refActivity) {
Logger.i(TAG, "--- ImageListTask");
this.refActivity = new WeakReference<>(refActivity);
}
......@@ -44,7 +43,7 @@ public class ImageListTask extends AsyncTask<Void, String, List<ImageRow>> {
@Override
protected List<ImageRow> doInBackground(Void... params) {
try {
Logger.i(TAG, "---- doInBackground");
Logger.d(TAG, "doInBackground");
boolean isOldApi = PreferenceUtil.getUserPref(refActivity.get(), ABookKeys.THETA_OLD_VERSION_FLG, false);
HttpConnector camera = new HttpConnector(ABookValues.THETA_IP_ADDRESS, isOldApi);
ArrayList<ImageInfo> objects = camera.getList();
......
......@@ -34,14 +34,13 @@ public class LoadPhotoTask extends AsyncTask<Void, Object, ImageData> {
private long receivedDataSize = 0;
public LoadPhotoTask(Activity refActivity, String fileId) {
Logger.i(TAG,"--- LoadPhotoTask");
this.refActivity = new WeakReference<>(refActivity);
this.mFileId = fileId;
}
@Override
protected void onPreExecute() {
Logger.i(TAG, "--- onPreExecute");
Logger.d(TAG, "onPreExecute");
Activity activity = refActivity.get();
if (activity instanceof ThetaImagePreviewActivity) {
ThetaImagePreviewActivity previewActivity = (ThetaImagePreviewActivity)activity;
......@@ -53,19 +52,17 @@ public class LoadPhotoTask extends AsyncTask<Void, Object, ImageData> {
@Override
protected ImageData doInBackground(Void... params) {
try {
Logger.i(TAG,"start to download image" + mFileId);
Logger.d(TAG,"start to download image" + mFileId);
boolean isOldApi = PreferenceUtil.getUserPref(refActivity.get(), ABookKeys.THETA_OLD_VERSION_FLG, false);
HttpConnector camera = new HttpConnector(ABookValues.THETA_IP_ADDRESS, isOldApi);
ImageData resizedImageData = camera.getImage(mFileId, new HttpDownloadListener() {
@Override
public void onTotalSize(long totalSize) {
Logger.i(TAG,"----onTotalSize : " + totalSize);
fileSize = totalSize;
}
@Override
public void onDataReceived(int size) {
//Logger.i(TAG,"----onDataReceived : " + size);
receivedDataSize += size;
if (fileSize != 0) {
......@@ -90,12 +87,10 @@ public class LoadPhotoTask extends AsyncTask<Void, Object, ImageData> {
ThetaImagePreviewActivity previewActivity = (ThetaImagePreviewActivity)activity;
for (Object param : values) {
if (param instanceof Integer) {
if ((Integer)((Integer) param).intValue()%10 == 0) {
Logger.i(TAG, "--- onProgressUpdate progress = " + param);
}
Logger.d(TAG, "onProgressUpdate progress = " + param);
previewActivity.progressDialogHorizontal.setProgress((Integer) param);
} else if (param instanceof String) {
Logger.i(TAG, "onProgressUpdate param = " + param);
Logger.d(TAG, "onProgressUpdate param = " + param);
}
}
}
......@@ -103,7 +98,7 @@ public class LoadPhotoTask extends AsyncTask<Void, Object, ImageData> {
@Override
protected void onPostExecute(ImageData imageData) {
Logger.i(TAG, "---- onPostExecute");
Logger.d(TAG, "onPostExecute");
Activity activity = refActivity.get();
if (activity instanceof ThetaImagePreviewActivity) {
ThetaImagePreviewActivity previewActivity = (ThetaImagePreviewActivity)activity;
......
......@@ -29,30 +29,23 @@ public class ShowLiveViewTask extends AsyncTask<Void, String, MJpegInputStream>
private final WeakReference<ThetaCameraActivity> refActivity;
public ShowLiveViewTask(ThetaCameraActivity refActivity) {
Logger.i(TAG,"---- ShowLiveViewTask");
this.refActivity = new WeakReference<>(refActivity);
}
@Override
protected MJpegInputStream doInBackground(Void... params) {
Logger.i(TAG, "--- doInBackground");
Logger.d(TAG, "doInBackground");
MJpegInputStream mjis = null;
final int MAX_RETRY_COUNT = 5;
for (int retryCount = 0; retryCount < MAX_RETRY_COUNT; retryCount++) {
Logger.i(TAG,"retryCount = " + retryCount);
try {
boolean isOldApi = PreferenceUtil.getUserPref(refActivity.get(), ABookKeys.THETA_OLD_VERSION_FLG, false);
//boolean isOldApi = false;
Logger.i(TAG,"1");
HttpConnector camera = new HttpConnector(ABookValues.THETA_IP_ADDRESS, isOldApi);
Logger.i(TAG,"2");
InputStream is = camera.getLivePreview();
Logger.i(TAG,"3");
mjis = new MJpegInputStream(is);
Logger.i(TAG,"4");
//正常にライブ再生されるか確認
mjis.readMJpegFrame();
Logger.i(TAG,"5");
retryCount = MAX_RETRY_COUNT;
} catch (IOException e) {
Logger.e(TAG,"doInBackground fail e = " + e.toString());
......
......@@ -93,7 +93,7 @@ hope_page=http://www.agentec.jp
contact_email=abook-appsupport@agentec.jp
#Log Settings
log_level=0
log_level=2
default_log_name=abvje
#エラーレポート/Exportログ送信方法 1:acms 2:平文メール(開発・テスト時のみ) 3:暗号化添付メール
error_report_flg=1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment