Commit 6df2a5c2 by Kim Jinsung

#32918 置くだけセンサー実装

パーミッション関連実装
parent 4d7278ac
......@@ -62,9 +62,6 @@ public class ABVEnvironment {
// Serverから取得したcontentVersion時のリソースパターンを一時的に保存するための変数
public int resourcePatternType;
// Serverから取得したmasterDataのfetchDateを一時的に保存するための変数
public String tempMasterDataFetchDate = "";
////////////////////////////// 定数 //////////////////////////////////
private static final String ServerTimeKey = "ABook";
......
......@@ -172,8 +172,8 @@ public class Constant {
// 連携機器の区分
public interface DeviceType {
int thermomete = 1; // 芯温系
int sensor = 2; // くだけセンサー
int thermomete = 1; // 中心温度計
int sensor = 2; // くだけセンサー
int barcode = 3; // バーコード
}
}
......@@ -127,4 +127,8 @@ public class ABookKeys {
public static final String CMD_GET_DEVICE_INFO = "getDeviceInfo"; // CMSのインターフェースのパラメータ:cmd
public static final String TASK_DEVICE_TYPE = "deviceType"; // CMSのインターフェースのパラメータ:devicetype
public static final String TASK_QUESTION_ID = "qid"; // CMSのインターフェースのパラメータ:qid
public static final String TASK_DEVICE_TYPE_PARAM1 = "param1"; // CMSのインターフェースのパラメータ:param1 (デバイスID)
public static final String TASK_DEVICE_TYPE_PARAM2 = "param2"; // CMSのインターフェースのパラメータ:param2(1:温度、2:湿度)
}
......@@ -39,6 +39,10 @@ public class ABVDataCache {
private Date lastPresentTime = DateTimeUtil.getCurrentDate(); // 最後の通信時に取得したサーバの時間
private static final int SEVER_ALERT_INTERVAL = 30; //システム日付チェック前後期間(分)
// Serverから取得したmasterDataのfetchDateを一時的に保存するための変数
public String tempMasterDataFetchDate = null;
/**
* 未指定ジャンルのID
* @since 1.0.0
......@@ -233,6 +237,7 @@ public class ABVDataCache {
defaultCategoryId = -1;
defaultGroupId = -1;
urlPath = null;
tempMasterDataFetchDate = null;
}
public void setLastPresentTime(Date lasttime) {
......
......@@ -39,7 +39,7 @@ import jp.agentec.adf.util.DateTimeUtil;
* FIXME: DBのトランザクションができていない
*
*/
public class ContentRefresher {
public class ContentRefresher {
private static final String TAG = "ContentRefresher";
private static ContentRefresher instance;
......@@ -96,6 +96,7 @@ public class ContentRefresher {
contentDownloader.kickTask(); // waitingで止まらないように実行を促す
throw new ABVException(ABVExceptionCode.C_I_CONTENT_0002);
}
networkAdapter = ABVEnvironment.getInstance().networkAdapter;
if (networkAdapter != null && !networkAdapter.isNetworkConnected()) { // NWのチェック
throw new NetworkDisconnectedException();
......@@ -161,15 +162,14 @@ public class ContentRefresher {
categoryLogic.initializeCategories(); // カテゴリ設定
// マスタデータの最新更新された時のFetchDateを一時に保存する。
Logger.d(TAG, "before fetchDate : " + ABVEnvironment.getInstance().tempMasterDataFetchDate);
Logger.d(TAG, "before fetchDate : " + ABVDataCache.getInstance().tempMasterDataFetchDate);
// CMSでメンテナンスされるHACCPマスタデータをアプリから取得できるようにJSONファイルを生成する。
String fetchDate = masterDataLogic.initializeMasterData(ABVEnvironment.getInstance().tempMasterDataFetchDate);
String fetchDate = masterDataLogic.initializeMasterData(ABVDataCache.getInstance().tempMasterDataFetchDate);
Logger.d(TAG, "after fetchDate : " + fetchDate);
if (fetchDate != null) {
// マスタデータの最新更新された時のFetchDateを一時に保存する。
ABVEnvironment.getInstance().tempMasterDataFetchDate = fetchDate;
ABVDataCache.getInstance().tempMasterDataFetchDate = fetchDate;
}
if (interrupt) { // この時点で停止要求が来た場合先には進まない。(ServiceOption/Group/Categoryの更新は1セットで行う(トランザクションはそれぞれ別))
......
......@@ -9,10 +9,7 @@ import jp.agentec.abook.abv.bl.acms.client.parameters.FetchDateParameters;
import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.exception.ABVException;
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.dao.AbstractDao;
import jp.agentec.abook.abv.bl.data.dao.AcmsDao;
import jp.agentec.adf.util.FileUtil;
public class MasterDataLogic extends AbstractLogic {
......@@ -29,15 +26,6 @@ public class MasterDataLogic extends AbstractLogic {
* @since 1.0.0
*/
public String initializeMasterData(String lastFetchDate) {
// コンテンツバージョン用lastFetchDateの取得
AcmsDao dao = AbstractDao.getDao(AcmsDao.class);
String daoLastFetchDate = dao.selectContentVersionLastFetchDate();
// ローカルに保存されている fetchDateがない場合、contentversionのlastFetchDateを利用する。
if (lastFetchDate.length() < 1) {
lastFetchDate = daoLastFetchDate;
}
String fetchDate = null;
try {
FetchDateParameters param = new FetchDateParameters(cache.getMemberInfo().sid, lastFetchDate);
......
......@@ -46,6 +46,13 @@
android:theme="@style/ABook"
android:allowBackup="false"
android:largeHeap="true" >
<!-- LinkingビーコンIFの使用宣言 -->
<meta-data
android:name="com.nttdocomo.android.smartdeviceagent.feature.beacon"
android:value="true" />
<!-- LinkingビーコンIFの使用宣言 -->
<service android:name="jp.agentec.abook.abv.cl.push.ABVFcmListenerService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT"></action>
......
......@@ -1394,6 +1394,7 @@
<string name="set_title_pairing">ペアリング</string>
<string name="set_pairing_central_thermometer">中心温度計</string>
<string name="pairing_search_scan">スキャン</string>
<string name="pairing_search_scaning">スキャン中..</string>
<string name="pairing_search_stop">中止</string>
<string name="pairing_save_thermometer">登録された温度計</string>
<string name="pairing_other_thermometer">その他温度計</string>
......@@ -1403,15 +1404,23 @@
<string name="ble_disconnect">未接続</string>
<string name="ble_connecting">接続中..</string>
<string name="ble_connect_success">接続済み</string>
<string name="msg_no_device_info">登録された中心温度計情報がありません。\n設定画面のペアリングの中心温度計から登録できます。</string>alert
<string name="msg_no_device_info">登録された中心温度計情報がありません。\n設定画面のペアリングの中心温度計から登録できます。</string>
<string name="title_okudake_sensor">置くだけセンサー</string>
<string name="msg_ble_connect_error">登録した中心温度計と接続することができません。中心温度計の電源を確認した後、再度お試しください。(%s)</string>
<string name="msg_ble_connect_success">中心温度計と接続になりました。中心温度計を操作してください。</string>
<string name="msg_scan_bluetooth_no_allow">BlueToothの利用を「許可」しないと、中心温度計のスキャンができません。</string>
<string name="msg_thermometer_connect_bluetooth_no_allow">BlueToothの利用を「許可」しないと、中心温度計と接続できません。</string>
<string name="msg_okudake_connect_bluetooth_no_allow">BlueToothの利用を「許可」しないと、置くだけセンサーと接続できません。</string>
<string name="msg_okudake_location_device_no_allow">端末の設定から位置情報をONにしてください。</string>
<string name="ble_is_not_supported">BLEを支援しません。</string>
<string name="bluetooth_is_not_supported">ブルートゥースを支援しません。</string>
<string name="bluetooth_is_not_working">ブルートゥース機能がオンになっているか確認してください。</string>
<string name="msg_connected_bluetooth">%sに接続されました。</string>
<string name="msg_ble_not_connect">接続が停止しました。</string>
<string name="msg_ble_connect_error">%sと接続されていません。\n%sと接続状態を設定画面の機器連携から確認してください。</string>
<string name="msg_permission_dialog_bluetooth">ブルートゥース利用権限が必要です。\nアプリ設定画面へ遷移します。</string>
<string name="sensor">センサー</string>
<string name="barcode">バーコード</string>
......
......@@ -1401,6 +1401,7 @@
<string name="set_title_pairing">패어링</string>
<string name="set_pairing_central_thermometer">중심 온도계</string>
<string name="pairing_search_scan">스캔</string>
<string name="pairing_search_scaning">스캔중..</string>
<string name="pairing_search_stop">중지</string>
<string name="pairing_save_thermometer">등록된 온도계</string>
<string name="pairing_other_thermometer">그 밖에 온도계</string>
......@@ -1410,13 +1411,19 @@
<string name="ble_connecting">접속 시도 중..</string>
<string name="ble_connect_success">접속 완료</string>
<string name="msg_no_device_info">등록된 중심 온도계 정보가 없습니다.\n 설정 화면의 페어링의 중심 온도계에서 등록 가능합니다.</string>
<string name="title_okudake_sensor">오쿠다케 센서</string>
<string name="msg_ble_connect_error">등록한 중심 온도계와 연결 할 수 없습니다. 중심 온도계의 전원을 확인후 다시 시도해 주시기 바랍니다.(%s)</string>
<string name="msg_ble_connect_success">중심 온도계와 연결되었습니다. 중심 온도계를 조작 해 주세요.</string>
<string name="msg_scan_bluetooth_no_allow">블루투스 사용를 [허용] 하지 않으면, 중심 온도계 스캔이 불가능 합니다. </string>
<string name="msg_thermometer_connect_bluetooth_no_allow">블루투스 사용를 [허용] 하지 않으면, 중심 온도계와 연결이 불가능 합니다.</string>
<string name="msg_okudake_connect_bluetooth_no_allow">블루투스 사용를 [허용] 하지 않으면, 오쿠다케 센서와 연결이 불가능 합니다.</string>
<string name="msg_okudake_location_device_no_allow">단말기의 설정에서 위치정보를 ON으로 설정해 주세요.</string>
<string name="ble_is_not_supported">BLE는 지원되지 않습니다.</string>
<string name="bluetooth_is_not_supported">블루투스는 지원되지 않습니다.</string>
<string name="bluetooth_is_not_working">블루투스가 작동하지 않습니다.</string>
<string name="msg_connected_bluetooth">%s에 접속되었습니다</string>
<string name="msg_ble_not_connect">접속이 정지되었습니다.</string>
<string name="msg_ble_connect_error">%s랑 접속되지않습니다.\n%s와의 접속상태를 설정화면의 기기연결에서 확인해주세요.</string>
<string name="msg_permission_dialog_bluetooth">블루투스이용권한이 필요합니다.\n설정화면으로 이동합니다.</string>
<string name="sensor">센서</string>
<string name="barcode">바코드</string>
......
......@@ -1400,6 +1400,7 @@
<string name="set_title_pairing">Pairing</string>
<string name="set_pairing_central_thermometer">Central thermometer</string>
<string name="pairing_search_scan">Scan</string>
<string name="pairing_search_scaning">Scaning..</string>
<string name="pairing_search_stop">Stop</string>
<string name="pairing_save_thermometer">Saved thermometer</string>
<string name="pairing_other_thermometer">Other thermometer</string>
......@@ -1409,14 +1410,20 @@
<string name="ble_connecting">Connection..</string>
<string name="ble_connect_success">Connected</string>
<string name="msg_no_device_info">There is no registered central thermometer information. \n You can register in the center thermometer of the pairing of setting screen.</string>
<string name="title_okudake_sensor">OKUDAKE SENSOR</string>
<string name="msg_ble_connect_error">You can not connect to the registered center thermometer. Check the power supply of the central thermometer and try again.(%s)</string>
<string name="msg_ble_connect_success">Connected with the center thermometer. Please control the central thermometer.</string>
<string name="msg_scan_bluetooth_no_allow">If Bluetooth is not allow, the center thermometer scan is disabled.</string>
<string name="msg_thermometer_connect_bluetooth_no_allow">If Bluetooth is not allow, the center thermometer connect is disabled.</string>
<string name="msg_okudake_connect_bluetooth_no_allow">If Bluetooth is not allow, the center okudake sensor connect is disabled.</string>
<string name="msg_okudake_location_device_no_allow">Please set the location information to ON in the device setting.</string>
<string name="ble_is_not_supported">BLE is not supported.</string>
<string name="bluetooth_is_not_supported">Bluetooth is not supported.</string>
<string name="bluetooth_is_not_working">Bluetooth is not working.</string>
<string name="msg_connected_bluetooth">Connected to %s</string>
<string name="msg_ble_not_connect">The connection has stopped.</string>
<string name="msg_ble_connect_error">Not connected with %s. \nCheck %s and connection status from the device linkage on the setting screen.</string>
<string name="msg_permission_dialog_bluetooth">You need Bluetooth access authority. \nIt changes to the application setting.</string>
<string name="sensor">Sensor</string>
<string name="barcode">Barcode</string>
......
......@@ -21,6 +21,7 @@ dependencies {
implementation project(':xwalk_core_library')
implementation files('libs/FoxitRDK.jar')
implementation project(':SwiftDecoderMobile')
implementation files('libs/sdaiflib.jar')
}
android {
......
......@@ -27,16 +27,6 @@
android:gravity="left|center_vertical"
android:textSize="20sp" />
<TextView
android:id="@+id/bl_subTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="1"
android:padding="3dp"
android:text="connection.."
android:textColor="@android:color/darker_gray"
android:textSize="17sp" />
</LinearLayout>
<Button
......
package jp.agentec.abook.abv.cl.util;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.List;
import java.util.UUID;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.launcher.android.R;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothGatt;
......@@ -19,10 +11,16 @@ import android.bluetooth.BluetoothManager;
import android.bluetooth.BluetoothProfile;
import android.content.Context;
import android.os.Build;
import android.os.Handler;
import android.os.Looper;
import android.widget.Toast;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.List;
import java.util.UUID;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.launcher.android.R;
import static android.bluetooth.BluetoothDevice.TRANSPORT_LE;
import static org.chromium.base.ThreadUtils.runOnUiThread;
......@@ -66,13 +64,14 @@ public class BleManagerUtil {
// });
// return;
// }
Logger.d("GATT_ message : [ " + status);
final int fStatus = status;
// ディバイスと接続されていない場合のメッセージコード:133, 62
// ディバイスと接続が切れた場合のメッセージコード:19
if (status == 133 || status == 62) { // 接続失敗
runOnUiThread( new Runnable() {
public void run() {
listener.onConnectionError();
Logger.e("onConnectionStateChange status = " + fStatus);
listener.onConnectionError(fStatus);
}
});
return;
......@@ -81,9 +80,11 @@ public class BleManagerUtil {
if( status == BluetoothGatt.GATT_SUCCESS && BluetoothProfile.STATE_CONNECTED == newState ) {
// 接続完了
if (!mBluetoothGatt.discoverServices()) { // サービス検索
runOnUiThread( new Runnable() { // 接続失敗
public void run() {
listener.onGetDeviceInfoFailed();
listener.onGetDeviceInfoFailed(fStatus);
Logger.e("onConnectionStateChange2 status = " + fStatus);
}
});
}
......@@ -210,10 +211,10 @@ public class BleManagerUtil {
*/
public interface BleManagerUtilListener {
void onGetDeviceInfo(String strTemperature); // ディバイスから渡す情報
void onGetDeviceInfoFailed(); // ディバイスと接続失敗時の情報渡す。
void onGetDeviceInfoFailed(int status); // ディバイスと接続失敗時の情報渡す。
void onConnectionState(); // ディバイスと接続された時情報渡す。
void onDisConnectionState(); // ディバイスと切断時
void onConnectionError(); // ディバイス接続エラー
void onConnectionError(int status); // ディバイス接続エラー
}
// 接続
......
......@@ -8,7 +8,10 @@ import android.support.multidex.MultiDexApplication;
import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.data.ABVDataCache;
import jp.agentec.abook.abv.cl.helper.ABVUncaughtExceptionHandler;
import jp.agentec.abook.abv.cl.util.PreferenceUtil;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
import jp.agentec.abook.abv.ui.common.util.Initializer;
import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper;
import jp.agentec.adf.util.FileUtil;
......@@ -49,6 +52,9 @@ public class ABVApplication extends MultiDexApplication {
//添付ファイル臨時保存場所削除
FileUtil.delete(ABVEnvironment.getInstance().getCacheTempAttachedImageDirPath());
// masterDataの fetchDateのローカルに保存された値を取得し、新着更新時に利用するため、セットして置く。
ABVDataCache.getInstance().tempMasterDataFetchDate = PreferenceUtil.getUserPref(this, AppDefType.UserPrefKey.MASTER_DATA_FETCH_DATE, null);
}
@Override
......
......@@ -59,7 +59,6 @@ public interface AppDefType {
String BLUETOOTH_DEVICE_TEMPERATURE_NAME = "bleDeviceTemperatureName"; // 温度計機器の名
String BLUETOOTH_DEVICE_TEMPERATURE_ADDRESS = "bleDeviceTemperatureAddress"; // 温度計機器のアドレス
String BLUETOOTH_DEVICE_TEMPERATURE_CONNECTED = "bleDeviceTemperatureConnected"; // 芯温計機器と接続可否
String MASTER_DATA_FETCH_DATE = "masterDataFetchDate"; // マスタデータのFetchDate
}
......
package jp.agentec.abook.abv.ui.home.activity;
import android.app.Activity;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.EditText;
import com.honeywell.barcode.HSMDecodeComponent;
import com.honeywell.barcode.HSMDecodeResult;
import com.honeywell.barcode.HSMDecoder;
import com.honeywell.barcode.Symbology;
import com.honeywell.license.ActivationManager;
import com.honeywell.license.ActivationResult;
import com.honeywell.plugins.PluginResultListener;
import com.honeywell.plugins.decode.DecodeResultListener;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.common.activity.ABVUIActivity;
import jp.agentec.abook.abv.ui.common.dialog.ABookAlertDialog;
import jp.agentec.abook.abv.ui.common.util.AlertDialogUtil;
import jp.agentec.abook.abv.ui.home.plugin.BarCodeReaderCustomPlugin;
import android.app.Activity;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import jp.agentec.abook.abv.ui.home.plugin.BarCodeReaderCustomPluginResultListener;
/* The purpose of this sample code is to show the multiple different ways you can use bar code scanning functionality in your application.
......@@ -43,7 +33,7 @@ import jp.agentec.abook.abv.ui.home.plugin.BarCodeReaderCustomPluginResultListen
* 3) You can create a custom SwiftPlugin to completely control the look and operation of a scan event.
* This custom plug-in must be registered with HSMDecoder and can be used with either method 1 or 2 mentioned above.
*/
public class BarCodeReaderActivity extends Activity implements DecodeResultListener, BarCodeReaderCustomPluginResultListener {
public class BarCodeReaderActivity extends ABVUIActivity implements DecodeResultListener, BarCodeReaderCustomPluginResultListener {
public HSMDecoder hsmDecoder;
private EditText editTextDisplay;
......@@ -62,12 +52,10 @@ public class BarCodeReaderActivity extends Activity implements DecodeResultListe
//activate the API with your license key
ActivationResult activationResult = ActivationManager.activate(this, "trial-image-areyn-12062017");
Toast.makeText(this, "Activation Result: " + activationResult, Toast.LENGTH_LONG).show();
//get the singleton instance of the decoder
hsmDecoder = HSMDecoder.getInstance(this);
Logger.d(TAG, "isDecodingEnabled !!!! [ " + hsmDecoder.isDecodingEnabled());
// Toast.makeText(this, "Activation isDecodingEnabled: " + hsmDecoder.isDecodingEnabled(), Toast.LENGTH_LONG).show();
//set all decoder related settings
setSymbology();
......@@ -112,7 +100,7 @@ public class BarCodeReaderActivity extends Activity implements DecodeResultListe
}
private void displayBarcodeData(HSMDecodeResult[] barcodeData) {
Toast.makeText(this, "barcodeData.length : [%d]" + barcodeData.length, Toast.LENGTH_LONG).show();
// Toast.makeText(this, "barcodeData.length : [%d]" + barcodeData.length, Toast.LENGTH_LONG).show();
if( barcodeData.length > 0) {
HSMDecodeResult firstResult = barcodeData[0];
......@@ -126,12 +114,12 @@ public class BarCodeReaderActivity extends Activity implements DecodeResultListe
if (scanCount == 1) {
hsmDecoder.enableSound(false);
editTextDisplay.setText(msg);
Toast.makeText(this, "Activation Result: " + msg, Toast.LENGTH_LONG).show();
// Toast.makeText(this, "Activation Result: " + msg, Toast.LENGTH_LONG).show();
final String readingBarcodeData = firstResult.getBarcodeData();
ABookAlertDialog saveDialog = AlertDialogUtil.createAlertDialog(this, getString(R.string.barcode));
saveDialog.setMessage(readingBarcodeData);
saveDialog.setButton(DialogInterface.BUTTON_POSITIVE, getResources().getString(R.string.confirm), new DialogInterface.OnClickListener() {
saveDialog.setButton(DialogInterface.BUTTON_POSITIVE, getResources().getString(R.string.ok), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
onDisposeInstance();
......@@ -232,6 +220,7 @@ public class BarCodeReaderActivity extends Activity implements DecodeResultListe
// 閉じるボタンの処理
public void onClickCloseView(View v) {
onDisposeInstance();
finish();
}
}
\ No newline at end of file
......@@ -2,7 +2,6 @@ package jp.agentec.abook.abv.ui.home.activity;
import android.app.DatePickerDialog;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.res.Configuration;
......@@ -12,7 +11,6 @@ import android.graphics.BitmapFactory;
import android.net.Uri;
import android.os.Bundle;
import android.provider.MediaStore;
import android.speech.tts.TextToSpeech;
import android.util.SparseBooleanArray;
import android.view.KeyEvent;
import android.view.View;
......@@ -63,9 +61,9 @@ import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.Callback;
import jp.agentec.abook.abv.bl.common.CommonExecutor;
import jp.agentec.abook.abv.bl.common.Constant;
import jp.agentec.abook.abv.bl.common.Constant.PushMessageSendType;
import jp.agentec.abook.abv.bl.common.Constant.ReportType;
import jp.agentec.abook.abv.bl.common.Constant.TaskReportLevel;
import jp.agentec.abook.abv.bl.common.Constant.PushMessageSendType;
import jp.agentec.abook.abv.bl.common.constant.ABookKeys;
import jp.agentec.abook.abv.bl.common.exception.ABVException;
import jp.agentec.abook.abv.bl.common.exception.ABVExceptionCode;
......@@ -89,7 +87,6 @@ import jp.agentec.abook.abv.bl.dto.TaskReportDto;
import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.OperationLogic;
import jp.agentec.abook.abv.bl.logic.PushMessageLogic;
import jp.agentec.abook.abv.cl.util.AndroidStringUtil;
import jp.agentec.abook.abv.cl.util.PreferenceUtil;
import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.common.activity.ABVUIActivity;
......@@ -115,8 +112,6 @@ import jp.agentec.adf.util.DateTimeUtil;
import jp.agentec.adf.util.FileUtil;
import jp.agentec.adf.util.StringUtil;
import static jp.agentec.abook.abv.cl.util.PreferenceUtil.getUserPref;
/**
* Created by leej on 2018/08/17
*/
......@@ -436,9 +431,6 @@ public class OperationListActivity extends ABVUIActivity {
});
}
// masterDataの fetchDateの取得する。
ABVEnvironment.getInstance().tempMasterDataFetchDate = getUserPref(AppDefType.UserPrefKey.MASTER_DATA_FETCH_DATE, "");
if (!activityResultFlg && operationId == -1) {
dataRefresh(true);
}
......@@ -1784,9 +1776,6 @@ public class OperationListActivity extends ABVUIActivity {
}
}
// masterDataの fetchDateの取得する。
ABVEnvironment.getInstance().tempMasterDataFetchDate = getUserPref(AppDefType.UserPrefKey.MASTER_DATA_FETCH_DATE, "");
CommonExecutor.execute(new Runnable() {
@Override
public void run() {
......@@ -1923,7 +1912,7 @@ public class OperationListActivity extends ABVUIActivity {
}
private void setMasterDataFetchDate() {
Logger.d(TAG, "ABVEnvironment.getInstance().tempMasterDataFetchDate : " + ABVEnvironment.getInstance().tempMasterDataFetchDate);
putUserPref(AppDefType.UserPrefKey.MASTER_DATA_FETCH_DATE, ABVEnvironment.getInstance().tempMasterDataFetchDate);
Logger.d(TAG, "ABVDataCache.getInstance().tempMasterDataFetchDate : " + ABVDataCache.getInstance().tempMasterDataFetchDate);
putUserPref(AppDefType.UserPrefKey.MASTER_DATA_FETCH_DATE, ABVDataCache.getInstance().tempMasterDataFetchDate);
}
}
package jp.agentec.abook.abv.ui.home.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import java.util.List;
import java.util.Map;
import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.home.adapter.common.BaseSectionAdapter;
import jp.agentec.abook.abv.ui.home.adapter.common.IndexPath;
import jp.agentec.abook.abv.ui.home.adapter.common.SectionHeaderData;
import static jp.agentec.abook.abv.ui.home.activity.PairingSettingActivity.DEVICE_CONNECTED;
import static jp.agentec.abook.abv.ui.home.activity.PairingSettingActivity.EXTRAS_DEVICE_ADDRESS;
import static jp.agentec.abook.abv.ui.home.activity.PairingSettingActivity.EXTRAS_DEVICE_NAME;
import static org.chromium.base.ThreadUtils.runOnUiThread;
/**
* Created by kim, changgyun on 2018/11/15.
*/
......@@ -28,13 +19,6 @@ import static org.chromium.base.ThreadUtils.runOnUiThread;
public class BleListAdapter extends BaseSectionAdapter<SectionHeaderData, BleListRowData> {
private static final String TAG = "BleListAdapter";
protected BleListAdapter.BleListAdapterListener listener;
private Context mContext;
private LayoutInflater mInflater;
private List<Map<String, String>> mListItem;
private String savedDeviceAddress = ""; // 保存されているディバイスのアドレス
private String savedDeviceName = ""; // 保存されているディバイスの名
private boolean savedDeviceConnected = false; // 保存されているディバスの接続可否
public interface BleListAdapterListener {
// 登録されたデバイス情報削除
......@@ -73,7 +57,6 @@ public class BleListAdapter extends BaseSectionAdapter<SectionHeaderData, BleLis
convertView = inflater.inflate(R.layout.ble_section_list_row, null);
holder = new ListRowViewHolder();
holder.bl_title = (TextView) convertView.findViewById(R.id.bl_title);
holder.bl_subTitle = (TextView) convertView.findViewById(R.id.bl_subTitle);
holder.bl_deleteBtn = (Button) convertView.findViewById(R.id.bl_deleteBtn);
convertView.setTag(holder);
} else {
......@@ -81,12 +64,10 @@ public class BleListAdapter extends BaseSectionAdapter<SectionHeaderData, BleLis
}
BleListRowData rowData = rowList.get(indexPath.section).get(indexPath.row);
holder.bl_title.setText(rowData.title);
holder.bl_subTitle.setText(rowData.subTitle);
//スキャンされた温度計表示時に削除ボタンと接続ステータス非表示
if (!rowData.isSaved) {
holder.bl_deleteBtn.setVisibility(View.INVISIBLE);
holder.bl_subTitle.setVisibility(View.GONE);
} else {
holder.bl_deleteBtn.setVisibility(View.VISIBLE);
holder.bl_deleteBtn.setOnClickListener(new View.OnClickListener() {
......@@ -95,7 +76,6 @@ public class BleListAdapter extends BaseSectionAdapter<SectionHeaderData, BleLis
listener.onDeleteConnectInfo();
}
});
holder.bl_subTitle.setVisibility(View.VISIBLE);
}
return convertView;
}
......@@ -107,7 +87,6 @@ public class BleListAdapter extends BaseSectionAdapter<SectionHeaderData, BleLis
static class ListRowViewHolder {
TextView bl_title;
TextView bl_subTitle;
Button bl_deleteBtn;
}
......
......@@ -8,24 +8,23 @@ public class BleListRowData extends SectionRowData {
public String deviceAddress;
/**
* 中心温度計(登録された温度計)
* @param title 温度計名
* @param deviceAddress デバイスアドレス
* デフォルト
* @param title タイトル
* @param subTitle サブタイトル
*/
public BleListRowData(String title, String deviceAddress) {
super(title, null);
this.deviceAddress = deviceAddress;
this.isSaved = false;
public BleListRowData(String title, String subTitle) {
super(title, subTitle);
}
/**
* 中心温度計(スキャンされた温度計)
* 中心温度計
* @param title 温度計名
* @param subTitle 接続状態
* @param deviceAddress デバイスアドレス
* @param isSaved 登録状態
*/
public BleListRowData(String title, String subTitle, String deviceAddress) {
super(title, subTitle);
public BleListRowData(String title, String deviceAddress, boolean isSaved) {
super(title, null);
this.deviceAddress = deviceAddress;
this.isSaved = true;
this.isSaved = isSaved;
}
}
......@@ -26,7 +26,6 @@ import jp.agentec.abook.abv.ui.viewer.activity.HTMLXWalkWebViewActivity;
import static android.content.pm.PackageManager.PERMISSION_GRANTED;
import static jp.agentec.abook.abv.cl.util.PreferenceUtil.getUserPref;
import static org.chromium.base.ContextUtils.getApplicationContext;
/**
* 権限チェック及び設定画面遷移
......@@ -105,14 +104,14 @@ public class ABookPermissionHelper {
ContextCompat.checkSelfPermission(mActivity, android.Manifest.permission.WRITE_EXTERNAL_STORAGE) != PERMISSION_GRANTED) {
if (mActivity instanceof HTMLWebViewActivity || mActivity instanceof HTMLXWalkWebViewActivity || mActivity instanceof OperationListActivity) {
// リソースパターンの適用
permitionTextResourceId = PatternStringUtil.patternToInt(getApplicationContext(),
permitionTextResourceId = PatternStringUtil.patternToInt(mActivity.getApplicationContext(),
R.string.msg_permission_dialog_storage_album,
getUserPref(getApplicationContext(), AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0));
getUserPref(mActivity.getApplicationContext(), AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0));
} else {
// リソースパターンの適用
permitionTextResourceId = PatternStringUtil.patternToInt(getApplicationContext(),
permitionTextResourceId = PatternStringUtil.patternToInt(mActivity.getApplicationContext(),
R.string.msg_permission_dialog_storage_update,
getUserPref(getApplicationContext(), AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0));
getUserPref(mActivity.getApplicationContext(), AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0));
}
}
......@@ -122,16 +121,16 @@ public class ABookPermissionHelper {
if (ContextCompat.checkSelfPermission(mActivity,
android.Manifest.permission.ACCESS_FINE_LOCATION) != PERMISSION_GRANTED) {
// リソースパターンの適用
permitionTextResourceId = PatternStringUtil.patternToInt(getApplicationContext(),
permitionTextResourceId = PatternStringUtil.patternToInt(mActivity.getApplicationContext(),
R.string.msg_permission_dialog_location,
getUserPref(getApplicationContext(), AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0));
getUserPref(mActivity.getApplicationContext(), AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0));
}
if (ContextCompat.checkSelfPermission(mActivity,
android.Manifest.permission.ACCESS_COARSE_LOCATION) != PERMISSION_GRANTED) {
// リソースパターンの適用
permitionTextResourceId = PatternStringUtil.patternToInt(getApplicationContext(),
permitionTextResourceId = PatternStringUtil.patternToInt(mActivity.getApplicationContext(),
R.string.msg_permission_dialog_location,
getUserPref(getApplicationContext(), AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0));
getUserPref(mActivity.getApplicationContext(), AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0));
}
break;
......@@ -140,9 +139,9 @@ public class ABookPermissionHelper {
if (ContextCompat.checkSelfPermission(mActivity,
android.Manifest.permission.CAMERA) != PERMISSION_GRANTED) {
// リソースパターンの適用
permitionTextResourceId = PatternStringUtil.patternToInt(getApplicationContext(),
permitionTextResourceId = PatternStringUtil.patternToInt(mActivity.getApplicationContext(),
R.string.msg_permission_dialog_camera,
getUserPref(getApplicationContext(), AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0));
getUserPref(mActivity.getApplicationContext(), AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0));
}
break;
case Constant.ABookPermissionType.Audio:
......@@ -150,9 +149,9 @@ public class ABookPermissionHelper {
if (ContextCompat.checkSelfPermission(mActivity,
android.Manifest.permission.RECORD_AUDIO) != PERMISSION_GRANTED) {
// リソースパターンの適用
permitionTextResourceId = PatternStringUtil.patternToInt(getApplicationContext(),
permitionTextResourceId = PatternStringUtil.patternToInt(mActivity.getApplicationContext(),
R.string.msg_permission_dialog_mic,
getUserPref(getApplicationContext(), AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0));
getUserPref(mActivity.getApplicationContext(), AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0));
}
break;
......@@ -161,9 +160,9 @@ public class ABookPermissionHelper {
if (ContextCompat.checkSelfPermission(mActivity,
Manifest.permission.BLUETOOTH) != PERMISSION_GRANTED) {
// リソースパターンの適用
permitionTextResourceId = PatternStringUtil.patternToInt(getApplicationContext(),
permitionTextResourceId = PatternStringUtil.patternToInt(mActivity.getApplicationContext(),
R.string.msg_permission_dialog_bluetooth,
getUserPref(getApplicationContext(), AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0));
getUserPref(mActivity.getApplicationContext(), AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0));
}
break;
}
......@@ -172,9 +171,9 @@ public class ABookPermissionHelper {
if (showDialogFlg) {
ABookAlertDialog dialog = AlertDialogUtil.createABookAlertDialog(mActivity);
// リソースパターンの適用
dialog.setTitle(PatternStringUtil.patternToString(getApplicationContext(),
dialog.setTitle(PatternStringUtil.patternToString(mActivity.getApplicationContext(),
R.string.title_permission_dialog,
getUserPref(getApplicationContext(), AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
getUserPref(mActivity.getApplicationContext(), AppDefType.UserPrefKey.RESOURCE_PATTERN_TYPE, 0)));
dialog.setMessage(permitionTextResourceId);
dialog.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
@Override
......
......@@ -4,7 +4,6 @@ package jp.agentec.abook.abv.ui.viewer.activity;
* @author jang
*/
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Context;
......@@ -119,6 +118,8 @@ import jp.agentec.abook.abv.cl.util.ContentLogUtil;
import jp.agentec.abook.abv.cl.util.PreferenceUtil;
import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.launcher.android.R.id;
import jp.agentec.abook.abv.ui.Interface.MovePageInterface;
import jp.agentec.abook.abv.ui.Interface.UnAuthorizedContentListener;
import jp.agentec.abook.abv.ui.common.activity.ABVContentViewActivity;
import jp.agentec.abook.abv.ui.common.appinfo.AppColor;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
......@@ -136,12 +137,8 @@ import jp.agentec.abook.abv.ui.common.util.PatternStringUtil;
import jp.agentec.abook.abv.ui.common.view.ABVEditText;
import jp.agentec.abook.abv.ui.common.view.ABVPopupListWindow;
import jp.agentec.abook.abv.ui.common.vo.Size;
import jp.agentec.abook.abv.ui.home.activity.BarCodeReaderActivity;
import jp.agentec.abook.abv.ui.home.activity.PairingSettingActivity;
import jp.agentec.abook.abv.ui.home.helper.ABookCheckWebViewHelper;
import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper;
import jp.agentec.abook.abv.ui.Interface.MovePageInterface;
import jp.agentec.abook.abv.ui.Interface.UnAuthorizedContentListener;
import jp.agentec.abook.abv.ui.viewer.adapter.ContentBookmarkAdapter;
import jp.agentec.abook.abv.ui.viewer.adapter.ContentSearchPageAdapter;
import jp.agentec.abook.abv.ui.viewer.adapter.PDFIndexDialog;
......@@ -161,9 +158,9 @@ import jp.agentec.abook.abv.ui.viewer.view.EnqueteWebView;
import jp.agentec.abook.abv.ui.viewer.view.FullVideoView;
import jp.agentec.abook.abv.ui.viewer.view.MarkingLayout;
import jp.agentec.abook.abv.ui.viewer.view.MarkingView;
import jp.agentec.abook.abv.ui.viewer.view.OperationTaskLayout;
import jp.agentec.abook.abv.ui.viewer.view.PageScrollView;
import jp.agentec.abook.abv.ui.viewer.view.PageView;
import jp.agentec.abook.abv.ui.viewer.view.OperationTaskLayout;
import jp.agentec.abook.abv.ui.viewer.view.ThumbnailSeekBarLayout;
import jp.agentec.abook.abv.ui.viewer.view.ZoomRelativeLayout;
import jp.agentec.abook.abv.ui.viewer.view.ZoomRelativeLayout.ViewMargin;
......@@ -3750,32 +3747,6 @@ public class ContentViewActivity extends ABVContentViewActivity {
}
mUploadMessage.onReceiveValue(result);
break;
// 機器連携と繋がる処理 get DeviceInfo
// case REQUEST_ENABLEBLUETOOTH: // Bluetooth有効化要求
// if( Activity.RESULT_CANCELED == resultCode )
// { // 有効にされなかった
// ABVToastUtil.showMakeText(getApplicationContext(), R.string.bluetooth_is_not_working, Toast.LENGTH_SHORT);
// return;
// }
// break;
// case REQUEST_CONNECTDEVICE: // デバイス接続要求
// String strDeviceName;
// if( Activity.RESULT_OK == resultCode ) {
// // デバイスリストアクティビティからの情報の取得
// strDeviceName = intent.getStringExtra( PairingSettingActivity.EXTRAS_DEVICE_NAME );
// mDeviceAddress = intent.getStringExtra( PairingSettingActivity.EXTRAS_DEVICE_ADDRESS );
// setUserPref(strDeviceName, mDeviceAddress, 1);
// } else {
// strDeviceName = "";
// mDeviceAddress = "";
// setUserPref(strDeviceName, mDeviceAddress, 0);
// }
// break;
case REQUEST_BARCODE_READER: // バーコードレーダから読み取ったデータの処理
if (Activity.RESULT_OK == resultCode) {
setBarCodeData(intent.getStringExtra(BarCodeReaderActivity.BARCODE_READING_DATA));
}
break;
}
mUploadMessage = null;
}
......
package jp.agentec.abook.abv.ui.viewer.activity;
import android.app.Activity;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothGatt;
import android.bluetooth.BluetoothGattCallback;
import android.bluetooth.BluetoothGattCharacteristic;
import android.bluetooth.BluetoothGattDescriptor;
import android.bluetooth.BluetoothGattService;
import android.bluetooth.BluetoothManager;
import android.bluetooth.BluetoothProfile;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.view.View;
import android.webkit.ValueCallback;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.Toast;
import java.io.File;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import jp.agentec.abook.abv.bl.acms.client.json.content.ContentJSON;
import jp.agentec.abook.abv.bl.acms.type.OperationType;
......@@ -47,15 +32,14 @@ import jp.agentec.abook.abv.bl.logic.OperationLogic;
import jp.agentec.abook.abv.cl.util.ContentLogUtil;
import jp.agentec.abook.abv.cl.util.PreferenceUtil;
import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.common.activity.ABVCheckContentViewActivity;
import jp.agentec.abook.abv.ui.common.activity.ABVContentViewActivity;
import jp.agentec.abook.abv.ui.common.activity.ABVUIActivity;
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.ErrorMessage;
import jp.agentec.abook.abv.ui.common.dialog.ABookAlertDialog;
import jp.agentec.abook.abv.ui.common.util.AlertDialogUtil;
import jp.agentec.abook.abv.ui.common.util.PatternStringUtil;
import jp.agentec.abook.abv.ui.home.activity.PairingSettingActivity;
import jp.agentec.abook.abv.ui.home.helper.ABookCheckWebViewHelper;
import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper;
import jp.agentec.abook.abv.ui.home.helper.ContentViewHelper;
......@@ -63,7 +47,7 @@ import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil;
import jp.agentec.adf.util.FileUtil;
public class ParentWebViewActivity extends ABVContentViewActivity {
public class ParentWebViewActivity extends ABVCheckContentViewActivity {
private static final String TAG = "ParentWebViewActivity";
private LinearLayout historyLayout;
......@@ -183,6 +167,8 @@ public class ParentWebViewActivity extends ABVContentViewActivity {
taskListButton.setVisibility(View.VISIBLE);
}
progressDialog.setProgress(0);
//中心温度計接続を切る
bleThermometerDisconnect();
}
}
......@@ -465,33 +451,4 @@ public class ParentWebViewActivity extends ABVContentViewActivity {
webViewLoadUrl(url);
}
// 機能の有効化ダイアログの操作結果
@Override
protected void onActivityResult( int requestCode, int resultCode, Intent data )
{
switch( requestCode )
{
case REQUEST_ENABLEBLUETOOTH: // Bluetooth有効化要求
if( Activity.RESULT_CANCELED == resultCode )
{ // 有効にされなかった
return;
}
break;
case REQUEST_CONNECTDEVICE: // デバイス接続要求
String strDeviceName;
if( Activity.RESULT_OK == resultCode )
{
// デバイスリストアクティビティからの情報の取得
// strDeviceName = data.getStringExtra( DeviceListActivity.EXTRAS_DEVICE_NAME );
mDeviceAddress = data.getStringExtra( PairingSettingActivity.EXTRAS_DEVICE_ADDRESS );
}
else
{
strDeviceName = "";
mDeviceAddress = "";
}
break;
}
super.onActivityResult( requestCode, resultCode, data );
}
}
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