Commit ab1b8a92 by Kim Peace

Fixed android version into device info

parent e95209e0
...@@ -181,7 +181,6 @@ ...@@ -181,7 +181,6 @@
$('#pictureModalCenter').modal('show'); $('#pictureModalCenter').modal('show');
} }
let androidVersion = 0;
$("#pictureModal").load("./modal_chat_picture.html"); $("#pictureModal").load("./modal_chat_picture.html");
$("#chatMenuModal").load("./modal_chat_menu.html"); $("#chatMenuModal").load("./modal_chat_menu.html");
$("#loadingArea").load("./loading.html"); $("#loadingArea").load("./loading.html");
...@@ -196,10 +195,6 @@ ...@@ -196,10 +195,6 @@
NativeBridgeDelegate.saveSelectedUserList(""); NativeBridgeDelegate.saveSelectedUserList("");
if (typeof (android) != "undefined") {
androidVersion = android.getAndroidVersion();
}
</script> </script>
</body> </body>
......
...@@ -170,11 +170,11 @@ ...@@ -170,11 +170,11 @@
$("#zoom").load("./zoom.html"); $("#zoom").load("./zoom.html");
$("#loadingArea").load("./loading.html"); $("#loadingArea").load("./loading.html");
let androidVersion = 0;
if (deviceInfo.isAndroid()) { if (deviceInfo.isAndroid()) {
androidVersion = android.getAndroidVersion(); if (
if (globalUserInfo.collaborationType.type == COLLABORATION_TYPE.DOCUMENT && androidVersion < ANDROID_SDK_VERSION.O) { globalUserInfo.collaborationType.type == COLLABORATION_TYPE.DOCUMENT
&& deviceInfo.androidVersion < ANDROID_SDK_VERSION.O
) {
alert(getLocalizedString('not_support_version')); alert(getLocalizedString('not_support_version'));
if (typeof android != "undefined") { if (typeof android != "undefined") {
NativeBridgeDelegate.openCommunicationHome(); NativeBridgeDelegate.openCommunicationHome();
......
...@@ -15,6 +15,7 @@ var CoviewUserInfo = class { ...@@ -15,6 +15,7 @@ var CoviewUserInfo = class {
joinType; joinType;
isLeaved; isLeaved;
meetingID; meetingID;
constructor(sid, loginId, roomId, shopName) { constructor(sid, loginId, roomId, shopName) {
this.sid = sid; this.sid = sid;
this.loginId = loginId; this.loginId = loginId;
...@@ -23,6 +24,7 @@ var CoviewUserInfo = class { ...@@ -23,6 +24,7 @@ var CoviewUserInfo = class {
const unwrappedType = NativeBridgeDataSource.getJoinCollaborationType(); const unwrappedType = NativeBridgeDataSource.getJoinCollaborationType();
this.collaborationType = this.parseNumberToCoworkType(unwrappedType); this.collaborationType = this.parseNumberToCoworkType(unwrappedType);
this.joinType = NativeBridgeDataSource.getCollaborationJoinFlg(); this.joinType = NativeBridgeDataSource.getCollaborationJoinFlg();
this.isLeaved = false; this.isLeaved = false;
this.meetingID = 0; this.meetingID = 0;
} }
......
...@@ -9,10 +9,14 @@ NativeBridgeDataSource.getDeviceInfo = function () { ...@@ -9,10 +9,14 @@ NativeBridgeDataSource.getDeviceInfo = function () {
var DeviceInfo = class { var DeviceInfo = class {
isMoble; // iphone or iPad isMoble; // iphone or iPad
platform; // ios or android platform; // ios or android
androidVersion;
constructor(deviceInfo) { constructor(deviceInfo) {
this.isMoble = deviceInfo.isMoble; this.isMoble = deviceInfo.isMoble;
this.platform = deviceInfo.platform; this.platform = deviceInfo.platform;
if (typeof android != "undefined") {
this.androidVersion = android.getAndroidVersion();
}
} }
isiOS() { isiOS() {
......
...@@ -106,7 +106,7 @@ NativeBridgeDelegate.joinCollaboration = function ( ...@@ -106,7 +106,7 @@ NativeBridgeDelegate.joinCollaboration = function (
} else if (deviceInfo.isAndroid()) { } else if (deviceInfo.isAndroid()) {
if ( if (
collaborationType == COLLABORATION_TYPE.DOCUMENT && collaborationType == COLLABORATION_TYPE.DOCUMENT &&
androidVersion < ANDROID_SDK_VERSION.O deviceInfo.androidVersion < ANDROID_SDK_VERSION.O
) { ) {
alert(getLocalizedString("not_support_version")); alert(getLocalizedString("not_support_version"));
return; return;
...@@ -239,7 +239,8 @@ NativeBridgeDelegate.inviteCollaboration = function ( ...@@ -239,7 +239,8 @@ NativeBridgeDelegate.inviteCollaboration = function (
userIDList, userIDList,
collaborationType collaborationType
) { ) {
const collaborationNumber = CHAT_UTIL.getCollaborationTypeNumber(collaborationType); const collaborationNumber =
CHAT_UTIL.getCollaborationTypeNumber(collaborationType);
if (typeof android != "undefined") { if (typeof android != "undefined") {
android.inviteCollaboration(userIDList, collaborationNumber); android.inviteCollaboration(userIDList, collaborationNumber);
} else { } else {
...@@ -293,7 +294,8 @@ NativeBridgeDelegate.joinChangedCollaboration = function ( ...@@ -293,7 +294,8 @@ NativeBridgeDelegate.joinChangedCollaboration = function (
collaborationType, collaborationType,
meetingID meetingID
) { ) {
const collaborationNumber = CHAT_UTIL.getCollaborationTypeNumber(collaborationType); const collaborationNumber =
CHAT_UTIL.getCollaborationTypeNumber(collaborationType);
if (deviceInfo.isiOS()) { if (deviceInfo.isiOS()) {
webkit.messageHandlers.joinChangedCollaboration.postMessage({ webkit.messageHandlers.joinChangedCollaboration.postMessage({
joinCollaborationType: collaborationNumber, joinCollaborationType: collaborationNumber,
...@@ -312,17 +314,16 @@ NativeBridgeDelegate.joinMeetingRoom = function (meetingID) { ...@@ -312,17 +314,16 @@ NativeBridgeDelegate.joinMeetingRoom = function (meetingID) {
} }
}; };
NativeBridgeDelegate.setJoinCollaborationType = function ( NativeBridgeDelegate.setJoinCollaborationType = function (type) {
type,
androidVersion
) {
const collaborationNumber = CHAT_UTIL.getCollaborationTypeNumber(type); const collaborationNumber = CHAT_UTIL.getCollaborationTypeNumber(type);
if (deviceInfo.isiOS()) { if (deviceInfo.isiOS()) {
webkit.messageHandlers.setJoinCollaborationType.postMessage(collaborationNumber); webkit.messageHandlers.setJoinCollaborationType.postMessage(
collaborationNumber
);
} else if (deviceInfo.isAndroid()) { } else if (deviceInfo.isAndroid()) {
if ( if (
type == COLLABORATION_TYPE.DOCUMENT && type == COLLABORATION_TYPE.DOCUMENT &&
androidVersion < ANDROID_SDK_VERSION.O deviceInfo.androidVersion < ANDROID_SDK_VERSION.O
) { ) {
alert(getLocalizedString("not_support_version")); alert(getLocalizedString("not_support_version"));
return; return;
......
...@@ -136,7 +136,7 @@ ChatRoom.startCollaboration = function (collaborationType) { ...@@ -136,7 +136,7 @@ ChatRoom.startCollaboration = function (collaborationType) {
if (deviceInfo.isAndroid()) { if (deviceInfo.isAndroid()) {
if ( if (
collaborationType == COLLABORATION_TYPE.DOCUMENT && collaborationType == COLLABORATION_TYPE.DOCUMENT &&
androidVersion < ANDROID_SDK_VERSION.O deviceInfo.androidVersion < ANDROID_SDK_VERSION.O
) { ) {
alert(getLocalizedString("not_support_version")); alert(getLocalizedString("not_support_version"));
return; return;
......
...@@ -17,7 +17,7 @@ FermiWebSocketBridge.shareFileHost = function (collaborationType) { ...@@ -17,7 +17,7 @@ FermiWebSocketBridge.shareFileHost = function (collaborationType) {
FermiWebSocketBridge.hostChangeResponse = function () { FermiWebSocketBridge.hostChangeResponse = function () {
fw.sendToMsg("others", "HOST_CHANGE_RESPONSE", { fw.sendToMsg("others", "HOST_CHANGE_RESPONSE", {
isAndroid: deviceInfo.isAndroid(), isAndroid: deviceInfo.isAndroid(),
isAble: androidVersion >= ANDROID_SDK_VERSION.O, isAble: deviceInfo.androidVersion >= ANDROID_SDK_VERSION.O,
loginId: currentUserInfo.loginID, loginId: currentUserInfo.loginID,
}); });
}; };
......
...@@ -290,7 +290,7 @@ FermiWebSocketMessageHandler.updateJoinChangeCollaboration = function ( ...@@ -290,7 +290,7 @@ FermiWebSocketMessageHandler.updateJoinChangeCollaboration = function (
if ( if (
deviceInfo.isAndroid() && deviceInfo.isAndroid() &&
collaborationType == COLLABORATION_TYPE.DOCUMENT && collaborationType == COLLABORATION_TYPE.DOCUMENT &&
androidVersion < ANDROID_SDK_VERSION.O deviceInfo.androidVersion < ANDROID_SDK_VERSION.O
) { ) {
coview_api.HeartBeatUser(globalUserInfo.loginId); coview_api.HeartBeatUser(globalUserInfo.loginId);
alert(getLocalizedString("not_support_version")); alert(getLocalizedString("not_support_version"));
......
...@@ -35,10 +35,7 @@ function changeCollaboration(collaborationType) { ...@@ -35,10 +35,7 @@ function changeCollaboration(collaborationType) {
if (globalUserInfo.collaborationType == COLLABORATION_TYPE.DOCUMENT) { if (globalUserInfo.collaborationType == COLLABORATION_TYPE.DOCUMENT) {
NativeBridgeDelegate.exitMeetingRoom(); NativeBridgeDelegate.exitMeetingRoom();
} }
NativeBridgeDelegate.setJoinCollaborationType( NativeBridgeDelegate.setJoinCollaborationType(collaborationType);
collaborationType,
androidVersion
);
globalUserInfo.collaborationType = collaborationType; globalUserInfo.collaborationType = collaborationType;
updateCollaborationUI(collaborationType); updateCollaborationUI(collaborationType);
...@@ -122,7 +119,7 @@ async function updateCollaborationUI(collaborationType) { ...@@ -122,7 +119,7 @@ async function updateCollaborationUI(collaborationType) {
function applyForHostChange() { function applyForHostChange() {
if ( if (
globalUserInfo.collaborationType == COLLABORATION_TYPE.DOCUMENT && globalUserInfo.collaborationType == COLLABORATION_TYPE.DOCUMENT &&
androidVersion < ANDROID_SDK_VERSION.O && deviceInfo.androidVersion < ANDROID_SDK_VERSION.O &&
deviceInfo.isAndroid() deviceInfo.isAndroid()
) { ) {
alert(getLocalizedString("not_support_version")); alert(getLocalizedString("not_support_version"));
......
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