Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
abook_check
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abook_android
abook_check
Commits
b7d4f7a0
Commit
b7d4f7a0
authored
Jun 22, 2020
by
Kim Jinsung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
THETAカメラと接続切断したあと、アプリ側から通常Wi-Fi接続できない問題対応
parent
e054b7ed
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
68 additions
and
42 deletions
+68
-42
ABVJE_UI_Android/src/com/theta/helper/ThetaHelper.java
+49
-0
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/viewer/activity/theta/ThetaActivity.java
+12
-14
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/viewer/activity/theta/task/DeviceInfoTask.java
+4
-25
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/viewer/helper/SceneSendHelper.java
+3
-3
No files found.
ABVJE_UI_Android/src/com/theta/helper/ThetaHelper.java
View file @
b7d4f7a0
...
...
@@ -4,6 +4,9 @@ import android.content.ContentResolver;
import
android.content.ContentValues
;
import
android.content.Context
;
import
android.graphics.Bitmap
;
import
android.net.ConnectivityManager
;
import
android.net.Network
;
import
android.net.NetworkInfo
;
import
android.net.wifi.ScanResult
;
import
android.net.wifi.WifiConfiguration
;
import
android.net.wifi.WifiInfo
;
...
...
@@ -239,4 +242,50 @@ public class ThetaHelper {
}
return
isConnected
;
}
/**
* THETAカメラWi-Fiと非接続接続
*/
public
void
disConnectThetaCameraWifi
(
WifiManager
wifiManager
)
{
//既存接続中のネットワーク切断
WifiInfo
wifi_inf
=
wifiManager
.
getConnectionInfo
();
if
(
wifi_inf
.
getNetworkId
()
!=
-
1
)
{
wifiManager
.
disableNetwork
(
wifi_inf
.
getNetworkId
());
wifiManager
.
disconnect
();
}
}
/**
* ConnectivityManagerを利用してアプリ(プロセス)全体のネットワークを設定します。
*/
public
void
appConnectedWifiOnly
()
{
if
(
android
.
os
.
Build
.
VERSION
.
SDK_INT
>=
android
.
os
.
Build
.
VERSION_CODES
.
M
)
{
ConnectivityManager
connectivityManager
=
(
ConnectivityManager
)
mContext
.
getSystemService
(
Context
.
CONNECTIVITY_SERVICE
);
if
(
connectivityManager
!=
null
)
{
if
(
connectivityManager
.
getAllNetworks
().
length
>
1
)
{
for
(
Network
net
:
connectivityManager
.
getAllNetworks
())
{
NetworkInfo
networkInfo
=
connectivityManager
.
getNetworkInfo
(
net
);
if
(
networkInfo
!=
null
&&
networkInfo
.
getType
()
==
ConnectivityManager
.
TYPE_WIFI
)
{
connectivityManager
.
bindProcessToNetwork
(
net
);
break
;
}
}
}
}
}
}
/**
* ConnectivityManagerを利用してアプリ(プロセス)全体のネットワークを解除する。
*/
public
void
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
)
{
if
(
connectivityManager
.
getBoundNetworkForProcess
()
!=
null
)
{
connectivityManager
.
bindProcessToNetwork
(
null
);
}
}
}
}
}
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/viewer/activity/theta/ThetaActivity.java
View file @
b7d4f7a0
...
...
@@ -11,12 +11,10 @@ import android.os.Bundle;
import
com.theta.helper.ThetaHelper
;
import
jp.agentec.abook.abv.bl.common.Constant
;
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.util.AlertDialogUtil
;
import
jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper
;
import
jp.agentec.abook.abv.ui.viewer.activity.theta.task.FinishWlanTask
;
/**
* Theta関連共通クラス
...
...
@@ -44,25 +42,25 @@ public class ThetaActivity extends ABVUIActivity {
public
void
onReceive
(
Context
context
,
Intent
intent
)
{
unregisterReceiver
(
wifiReceiver
);
boolean
isConnected
=
mThetaHelper
.
checkThetaCameraWifiConnected
(
mWifiManager
);
if
(
isConnected
)
{
Logger
.
d
(
TAG
,
"ThetaカメラWi-Fi接続状態"
);
if
(
mWifiScanType
==
Constant
.
WifiScanType
.
CloseCameraActivity
)
{
//THETAカメラのWi-Fi機能を無効にするAPI送信
new
FinishWlanTask
((
ThetaCameraActivity
)
ActivityHandlingHelper
.
getInstance
().
getCurrentActivity
()).
execute
();
}
else
if
(
mWifiScanType
==
Constant
.
WifiScanType
.
ThetaConnectError
)
{
thetaCameraWifiConnected
();
//THETAカメラ画面閉じる
if
(
mWifiScanType
==
Constant
.
WifiScanType
.
CloseCameraActivity
)
{
if
(
isConnected
)
{
mThetaHelper
.
disConnectThetaCameraWifi
(
mWifiManager
);
}
}
else
{
Logger
.
d
(
TAG
,
"ThetaカメラWi-Fi非接続状態"
);
if
(
mWifiScanType
==
Constant
.
WifiScanType
.
CloseCameraActivity
)
{
finish
();
}
else
if
(
mWifiScanType
==
Constant
.
WifiScanType
.
ThetaConnectError
)
{
mThetaHelper
.
appConnectedWifiDefault
();
finish
();
}
else
if
(
mWifiScanType
==
Constant
.
WifiScanType
.
ThetaConnectError
)
{
//THETAカメラと通信エラー共通
if
(
isConnected
)
{
thetaCameraWifiConnected
();
}
else
{
AlertDialogUtil
.
showAlertDialog
(
ThetaActivity
.
this
,
R
.
string
.
app_name
,
R
.
string
.
msg_theta_wifi_disconnect
,
true
,
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
which
)
{
closeProgressPopup
();
//Thetaカメラ関連Activity終了
ActivityHandlingHelper
.
getInstance
().
finishAllThetaActivity
();
mThetaHelper
.
appConnectedWifiDefault
();
}
});
}
...
...
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/viewer/activity/theta/task/DeviceInfoTask.java
View file @
b7d4f7a0
package
jp
.
agentec
.
abook
.
abv
.
ui
.
viewer
.
activity
.
theta
.
task
;
import
android.content.Context
;
import
android.net.ConnectivityManager
;
import
android.net.Network
;
import
android.net.NetworkInfo
;
import
android.os.AsyncTask
;
import
com.theta.helper.ThetaHelper
;
import
com.theta.network.HttpConnector
;
import
com.theta.network.ThetaDeviceInfo
;
...
...
@@ -45,8 +42,9 @@ public class DeviceInfoTask extends AsyncTask<Void, String, ThetaDeviceInfo> {
}
catch
(
InterruptedException
e1
)
{
e1
.
printStackTrace
();
}
if
(
retryCount
==
0
)
{
thetaConnectedWifiOnly
();
if
(
retryCount
==
0
)
{
//失敗時、LTE環境の影響のため、アプリで利用するネットワークを設定
ThetaHelper
helper
=
new
ThetaHelper
(
refActivity
.
get
());
helper
.
appConnectedWifiOnly
();
}
}
else
{
...
...
@@ -62,23 +60,4 @@ public class DeviceInfoTask extends AsyncTask<Void, String, ThetaDeviceInfo> {
DeviceImageListActivity
activity
=
refActivity
.
get
();
activity
.
thetaDeviceInfoTaskFinish
(
deviceInfo
);
}
/**
* LTE環境の場合、THETA端末のWifi接続後、LTE接続される問題でWifi利用するように設定
*/
private
void
thetaConnectedWifiOnly
()
{
if
(
android
.
os
.
Build
.
VERSION
.
SDK_INT
>=
android
.
os
.
Build
.
VERSION_CODES
.
M
)
{
DeviceImageListActivity
activity
=
refActivity
.
get
();
ConnectivityManager
connectivityManager
=
(
ConnectivityManager
)
activity
.
getSystemService
(
Context
.
CONNECTIVITY_SERVICE
);
if
(
connectivityManager
!=
null
)
{
for
(
Network
net
:
connectivityManager
.
getAllNetworks
())
{
NetworkInfo
networkInfo
=
connectivityManager
.
getNetworkInfo
(
net
);
if
(
networkInfo
!=
null
&&
networkInfo
.
getType
()
==
ConnectivityManager
.
TYPE_WIFI
)
{
connectivityManager
.
bindProcessToNetwork
(
net
);
break
;
}
}
}
}
}
}
ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/viewer/helper/SceneSendHelper.java
View file @
b7d4f7a0
...
...
@@ -18,7 +18,7 @@ import jp.agentec.abook.abv.launcher.android.R;
* シーン画像ファイルをサーバへ登録する処理クラス
*/
public
class
SceneSendHelper
{
private
static
final
String
TAG
=
"
DeviceImageList
Helper"
;
private
static
final
String
TAG
=
"
SceneSend
Helper"
;
private
SceneSendHelper
.
DeviceImageListSendListener
listener
;
private
Context
mContext
;
...
...
@@ -69,7 +69,7 @@ public class SceneSendHelper {
listener
.
sceneSendfinish
();
}
}
catch
(
AcmsException
ex
)
{
Logger
.
e
(
TAG
,
ex
);
Logger
.
e
(
TAG
,
ex
.
toString
()
);
if
(
ex
.
getCode
()
==
ABVExceptionCode
.
P_E_ACMS_P007
)
{
listener
.
sceneSendFail
(
mContext
.
getString
(
R
.
string
.
error_msg_open_pano_edit
));
}
else
{
...
...
@@ -77,7 +77,7 @@ public class SceneSendHelper {
}
break
;
}
catch
(
Exception
e
)
{
Logger
.
e
(
TAG
,
e
);
Logger
.
e
(
TAG
,
e
.
toString
()
);
listener
.
sceneSendFailRetry
(
needSendImages
);
break
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment