Skip to content
This repository was archived by the owner on Jun 1, 2026. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified host/bins/cfc-0.1.0-x64.deb
Binary file not shown.
2 changes: 1 addition & 1 deletion host/src/pack/dpkg/opt/cfc/mwc/bin/kill_lg_instance.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ else
pid=`ps aux | grep "LG_B1_Client " | grep -v grep | grep $inst | awk '{print $2}'`
fi

if [ "$pid" -gt 0 ]
if [ ! -z "$pid" ] && [ "$pid" -gt 0 ]
then
echo "inside kill"
kill -KILL $pid
Expand Down
16 changes: 16 additions & 0 deletions host/src/pack/dpkg/opt/cfc/mwc/bin/lg_launcher.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ then
exit 1
fi

num_lg_process=`ps aux | grep "lg_launcher.*$1 $2" | grep -v grep | wc -l`
echo "num_lg_process:$num_lg_process"
if [ "$num_lg_process" -ge "3" ];
then
echo "The app launcher process is already running, skip the app launch!"
exit 0
fi

# It's observed that the LG_B1_Clinet_input will be killed when user logout.
# Needs to restart civ if this happens to ensure all required services are
# up and running
Expand Down Expand Up @@ -62,6 +70,14 @@ fi

$FOLDER_1_UPDATE
$FOLDER_2_UPDATE

num_app_process=`ps aux | grep "mwc_launcher.* $1 $2" | grep -v grep | wc -l`
if [ ! "$num_app_process" -lt "1" ];
then
echo "The app process is already running, skip the app launch!"
exit 0
fi

/opt/cfc/mwc/bin/mwc_launcher localhost 3000 $@

echo "appname:$1, previous_app:$previous_app"
Expand Down
12 changes: 12 additions & 0 deletions host/src/pack/dpkg/opt/cfc/mwc/bin/loadapp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,18 @@ function configure_wm_density()

configure_wm_density

# Kill the looking glass client with same slot id.
# This is to avoid messed looking glass slot allocation status.
lg_pids=`ps aux | grep "LG_B1_Client.*looking-glass$3" | grep -v grep | awk '{print $2}'`

echo "Looking-glass client pid:$lg_pids"
if [ ! -z "$lg_pids" ];
then
echo "Kill looking-glass client pid: $lg_pids"
kill -KILL $lg_pids
sleep 1
fi

if [ "$1" = "com.tencent.mm" ];
then
adb -s vsock:3:5555 shell am start -W -S -n $2 --display $3 --activity-no-animation
Expand Down
Binary file modified host/src/pack/dpkg/opt/cfc/mwc/bin/mwc_hostdaemon
Binary file not shown.
13 changes: 11 additions & 2 deletions host/src/pghost/vatclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,9 @@ int VatClient::HandleEvent(Event* event)
if (ret >=0) {
slot_id = lg_slot;
}
else {
slot_id = -1;
}
}
for (int i=0; i<NUM_LG_SLOTS; i++) {
printf("slot:%d, status:%d, appname:%s, activity:%s\n", i, m_lg_slots[i]->slot_status, m_lg_slots[i]->appname, m_lg_slots[i]->activity);
Expand All @@ -449,7 +452,11 @@ int VatClient::HandleEvent(Event* event)
if (LGSLOT_USED == m_lg_slots[i]->slot_status) {
char* launched_appname = m_lg_slots[i]->appname;
if (strstr(launched_appname, appname)) {
m_lgslot->SetLGSlotIdle(i);
// Set the slot_id to -1 to avoid unexpected slot state update.
slot_id = -1;
// Don't set the slot to idle here. Let the process opened looking glass
// to communicate with daemon for the graceful shutdown.
// m_lgslot->SetLGSlotIdle(i);
kill_lg_process = 1;
slot_found = i;
break;
Expand Down Expand Up @@ -532,6 +539,7 @@ int VatClient::HandleEvent(Event* event)
(char*) ";");
lg_slot = atoi(lg_instance_id);
if (lg_slot >=0 && lg_slot < NUM_LG_SLOTS) {
slot_id = -1;
m_lgslot->SetLGSlotIdle(lg_slot);
}
running = 0;
Expand Down Expand Up @@ -594,8 +602,9 @@ void VatClient::CleanUp()
delete m_launcherconnmgr;

if (slot_id >=0 && slot_id < NUM_LG_SLOTS) {
if (LGSLOT_USED == m_lg_slots[slot_id]->slot_status) {
if (LGSLOT_IDLE != m_lg_slots[slot_id]->slot_status) {
m_lgslot->SetLGSlotIdle(slot_id);
slot_id = -1;
}
}
}
Expand Down