Commit ab1b8a92 by Kim Peace

Fixed android version into device info

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