Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-client-android
Commits
b8190512
Commit
b8190512
authored
Mar 22, 2021
by
Adrien Béraud
Committed by
Sébastien Blin
Jun 11, 2021
Browse files
jni: rename Ringservice to JamiService
Change-Id: Ib20206f49983199778df2c924479098dbf1f16f9
parent
e40c6c61
Changes
28
Hide whitespace changes
Inline
Side-by-side
build-daemon.sh
View file @
b8190512
...
...
@@ -201,7 +201,7 @@ ${CXX} --shared \
-Wno-unused-function
\
-Wno-unused-parameter
\
-Wl
,-Bsymbolic
\
${
JNIDIR
}
/
ring
_wrapper.cpp
\
${
JNIDIR
}
/
jami
_wrapper.cpp
\
${
DAEMON_BUILD_DIR
}
/src/.libs/libring.a
\
-isystem
${
DAEMON_DIR
}
/contrib/
${
TARGET
}
/include
\
-I
${
DAEMON_DIR
}
/src
\
...
...
ring-android/app/src/main/java/cx/ring/account/JamiAccountSummaryFragment.java
View file @
b8190512
...
...
@@ -106,8 +106,6 @@ public class JamiAccountSummaryFragment extends BaseSupportFragment<JamiAccountS
private
static
final
String
FRAGMENT_DIALOG_BACKUP
=
TAG
+
".dialog.backup"
;
private
static
final
int
WRITE_REQUEST_CODE
=
43
;
private
static
final
int
SCROLL_DIRECTION_UP
=
-
1
;
public
static
final
String
ACCOUNT_ID_KEY
=
AccountEditionFragment
.
class
.
getCanonicalName
()
+
"accountid"
;
private
static
final
int
SETTINGS_ACCOUNT
=
0
;
private
static
final
int
SETTINGS_MEDIA
=
1
;
private
static
final
int
SETTINGS_SYSTEM
=
2
;
...
...
@@ -710,7 +708,7 @@ public class JamiAccountSummaryFragment extends BaseSupportFragment<JamiAccountS
private
Fragment
fragmentWithBundle
(
Fragment
result
,
String
accountId
)
{
Bundle
args
=
new
Bundle
();
args
.
putString
(
ACCOUNT_ID_KEY
,
accountId
);
args
.
putString
(
AccountEditionFragment
.
ACCOUNT_ID_KEY
,
accountId
);
result
.
setArguments
(
args
);
return
result
;
}
...
...
@@ -744,7 +742,7 @@ public class JamiAccountSummaryFragment extends BaseSupportFragment<JamiAccountS
public
void
goToBlackList
(
String
accountId
)
{
BlockListFragment
blockListFragment
=
new
BlockListFragment
();
Bundle
args
=
new
Bundle
();
args
.
putString
(
ACCOUNT_ID_KEY
,
accountId
);
args
.
putString
(
AccountEditionFragment
.
ACCOUNT_ID_KEY
,
accountId
);
blockListFragment
.
setArguments
(
args
);
changeFragment
(
blockListFragment
,
BlockListFragment
.
TAG
);
}
...
...
ring-android/app/src/main/java/cx/ring/application/JamiApplication.java
View file @
b8190512
...
...
@@ -65,7 +65,6 @@ import javax.inject.Named;
import
cx.ring.BuildConfig
;
import
cx.ring.R
;
import
cx.ring.views.AvatarFactory
;
import
net.jami.daemon.Ringservice
;
import
cx.ring.dependencyinjection.DaggerJamiInjectionComponent
;
import
cx.ring.dependencyinjection.JamiInjectionComponent
;
import
cx.ring.dependencyinjection.JamiInjectionModule
;
...
...
@@ -179,10 +178,10 @@ public abstract class JamiApplication extends Application {
if
(
mPreferencesService
.
getSettings
().
isAllowPushNotifications
())
{
String
token
=
getPushToken
();
if
(
token
!=
null
)
{
Rings
ervice
.
setPushNotificationToken
(
token
);
JamiS
ervice
.
setPushNotificationToken
(
token
);
}
}
else
{
Rings
ervice
.
setPushNotificationToken
(
""
);
JamiS
ervice
.
setPushNotificationToken
(
""
);
}
Intent
intent
=
new
Intent
(
DRING_CONNECTION_CHANGED
);
...
...
ring-android/app/src/main/java/cx/ring/client/CallActivity.java
View file @
b8190512
...
...
@@ -175,7 +175,7 @@ public class CallActivity extends AppCompatActivity {
}
private
void
hideSystemUI
()
{
KeyboardVisibilityManager
.
hideKeyboard
(
this
,
0
);
KeyboardVisibilityManager
.
hideKeyboard
(
this
);
if
(
mMainView
!=
null
)
{
mMainView
.
setSystemUiVisibility
(
View
.
SYSTEM_UI_FLAG_LAYOUT_STABLE
|
View
.
SYSTEM_UI_FLAG_LOW_PROFILE
...
...
ring-android/app/src/main/java/cx/ring/client/HomeActivity.java
View file @
b8190512
...
...
@@ -75,6 +75,9 @@ import cx.ring.interfaces.Colorable;
import
net.jami.model.Account
;
import
net.jami.model.AccountConfig
;
import
cx.ring.service.DRingService
;
import
net.jami.model.Contact
;
import
net.jami.model.Conversation
;
import
net.jami.services.AccountService
;
import
net.jami.services.NotificationService
;
import
cx.ring.settings.SettingsFragment
;
...
...
@@ -778,7 +781,7 @@ public class HomeActivity extends AppCompatActivity implements BottomNavigationV
List
<
Future
<
Bitmap
>>
futureIcons
=
new
ArrayList
<>(
Math
.
min
(
conversations
.
size
(),
maxCount
));
for
(
Conversation
conversation
:
conversations
)
{
Call
Contact
contact
=
conversation
.
getContact
();
Contact
contact
=
conversation
.
getContact
();
futureIcons
.
add
(
AvatarFactory
.
getBitmapAvatar
(
this
,
contact
,
targetSize
)
.
subscribeOn
(
Schedulers
.
computation
())
.
toFuture
());
...
...
@@ -789,7 +792,7 @@ public class HomeActivity extends AppCompatActivity implements BottomNavigationV
i
=
0
;
for
(
Conversation
conversation
:
conversations
)
{
Call
Contact
contact
=
conversation
.
getContact
();
Contact
contact
=
conversation
.
getContact
();
IconCompat
icon
=
null
;
try
{
icon
=
IconCompat
.
createWithBitmap
(
futureIcons
.
get
(
i
).
get
());
...
...
ring-android/app/src/main/java/cx/ring/dependencyinjection/JamiInjectionComponent.java
View file @
b8190512
...
...
@@ -60,7 +60,6 @@ import cx.ring.service.DRingService;
import
cx.ring.service.JamiJobService
;
import
net.jami.services.AccountService
;
import
net.jami.services.CallService
;
import
net.jami.services.ConferenceService
;
import
cx.ring.services.ContactServiceImpl
;
import
net.jami.services.DaemonService
;
import
cx.ring.services.DataTransferService
;
...
...
@@ -151,8 +150,6 @@ public interface JamiInjectionComponent {
void
inject
(
CallService
service
);
void
inject
(
ConferenceService
service
);
void
inject
(
AccountService
service
);
void
inject
(
HardwareService
service
);
...
...
ring-android/app/src/main/java/cx/ring/fragments/CallFragment.java
View file @
b8190512
...
...
@@ -86,6 +86,17 @@ import androidx.percentlayout.widget.PercentFrameLayout;
import
com.rodolfonavalon.shaperipplelibrary.model.Circle
;
import
net.jami.call.CallPresenter
;
import
net.jami.call.CallView
;
import
net.jami.daemon.JamiService
;
import
net.jami.model.Call
;
import
net.jami.model.Conference
;
import
net.jami.model.Contact
;
import
net.jami.services.DeviceRuntimeService
;
import
net.jami.services.HardwareService
;
import
net.jami.services.NotificationService
;
import
net.jami.utils.StringUtils
;
import
java.util.ArrayList
;
import
java.util.Iterator
;
import
java.util.List
;
...
...
@@ -99,32 +110,22 @@ import javax.inject.Inject;
import
cx.ring.R
;
import
cx.ring.adapters.ConfParticipantAdapter
;
import
cx.ring.application.JamiApplication
;
import
net.jami.call.CallPresenter
;
import
net.jami.call.CallView
;
import
cx.ring.client.CallActivity
;
import
cx.ring.client.ContactDetailsActivity
;
import
cx.ring.client.ConversationActivity
;
import
cx.ring.client.ConversationSelectionActivity
;
import
cx.ring.client.HomeActivity
;
import
net.jami.daemon.Ringservice
;
import
cx.ring.databinding.FragCallBinding
;
import
cx.ring.databinding.ItemParticipantLabelBinding
;
import
net.jami.model.Contact
;
import
net.jami.model.Conference
;
import
net.jami.model.Call
;
import
cx.ring.mvp.BaseSupportFragment
;
import
cx.ring.plugins.RecyclerPicker.RecyclerPicker
;
import
cx.ring.plugins.RecyclerPicker.RecyclerPickerLayoutManager
;
import
cx.ring.service.DRingService
;
import
net.jami.services.DeviceRuntimeService
;
import
net.jami.services.HardwareService
;
import
net.jami.services.NotificationService
;
import
cx.ring.utils.ActionHelper
;
import
cx.ring.utils.ContentUriHandler
;
import
cx.ring.utils.ConversationPath
;
import
cx.ring.utils.DeviceUtils
;
import
cx.ring.utils.MediaButtonsHelper
;
import
net.jami.utils.StringUtils
;
import
cx.ring.views.AvatarDrawable
;
import
io.reactivex.disposables.CompositeDisposable
;
...
...
@@ -284,7 +285,7 @@ public class CallFragment extends BaseSupportFragment<CallPresenter> implements
getString
(
R
.
string
.
action_call_hangup
),
PendingIntent
.
getService
(
context
,
new
Random
().
nextInt
(),
new
Intent
(
DRingService
.
ACTION_CALL_END
)
.
setClass
(
context
,
DRing
Service
.
class
)
.
setClass
(
context
,
Jami
Service
.
class
)
.
putExtra
(
NotificationService
.
KEY_CALL_ID
,
callId
),
PendingIntent
.
FLAG_ONE_SHOT
)));
paramBuilder
.
setActions
(
actions
);
try
{
...
...
@@ -912,7 +913,9 @@ public class CallFragment extends BaseSupportFragment<CallPresenter> implements
@Override
public
void
displayDialPadKeyboard
()
{
KeyboardVisibilityManager
.
showKeyboard
(
getActivity
(),
binding
.
dialpadEditText
,
InputMethodManager
.
SHOW_FORCED
);
binding
.
dialpadEditText
.
requestFocus
();
InputMethodManager
imm
=
(
InputMethodManager
)
binding
.
dialpadEditText
.
getContext
().
getSystemService
(
Context
.
INPUT_METHOD_SERVICE
);
imm
.
toggleSoftInput
(
InputMethodManager
.
SHOW_FORCED
,
InputMethodManager
.
HIDE_IMPLICIT_ONLY
);
}
@Override
...
...
@@ -1398,11 +1401,11 @@ public class CallFragment extends BaseSupportFragment<CallPresenter> implements
@Override
public
void
toggleCallMediaHandler
(
String
id
,
String
callId
,
boolean
toggle
)
{
Rings
ervice
.
toggleCallMediaHandler
(
id
,
callId
,
toggle
);
JamiS
ervice
.
toggleCallMediaHandler
(
id
,
callId
,
toggle
);
}
public
Map
<
String
,
String
>
getCallMediaHandlerDetails
(
String
id
)
{
return
Rings
ervice
.
getCallMediaHandlerDetails
(
id
).
toNative
();
return
JamiS
ervice
.
getCallMediaHandlerDetails
(
id
).
toNative
();
}
@Override
...
...
@@ -1421,7 +1424,7 @@ public class CallFragment extends BaseSupportFragment<CallPresenter> implements
}
public
boolean
displayPluginsButton
()
{
return
Rings
ervice
.
getPluginsEnabled
()
&&
Rings
ervice
.
getCallMediaHandlers
().
size
()
>
0
;
return
JamiS
ervice
.
getPluginsEnabled
()
&&
JamiS
ervice
.
getCallMediaHandlers
().
size
()
>
0
;
}
@Override
...
...
@@ -1475,7 +1478,7 @@ public class CallFragment extends BaseSupportFragment<CallPresenter> implements
// Create callMediaHandlers and videoPluginsItems in a lazy manner
if
(
pluginsModeFirst
)
{
// Init
callMediaHandlers
=
Rings
ervice
.
getCallMediaHandlers
();
callMediaHandlers
=
JamiS
ervice
.
getCallMediaHandlers
();
List
<
Drawable
>
videoPluginsItems
=
new
ArrayList
<>(
callMediaHandlers
.
size
()
+
1
);
videoPluginsItems
.
add
(
context
.
getDrawable
(
R
.
drawable
.
baseline_cancel_24
));
...
...
ring-android/app/src/main/java/cx/ring/fragments/ConversationFragment.java
View file @
b8190512
...
...
@@ -87,6 +87,8 @@ import net.jami.conversation.ConversationPresenter;
import
net.jami.conversation.ConversationView
;
import
cx.ring.databinding.FragConversationBinding
;
import
cx.ring.interfaces.Colorable
;
import
net.jami.daemon.JamiService
;
import
net.jami.model.Account
;
import
net.jami.model.Contact
;
import
net.jami.model.Conversation
;
...
...
@@ -419,26 +421,21 @@ public class ConversationFragment extends BaseSupportFragment<ConversationPresen
PopupMenu
popup
=
new
PopupMenu
(
context
,
v
);
popup
.
inflate
(
R
.
menu
.
conversation_share_actions
);
popup
.
setOnMenuItemClickListener
(
item
->
{
switch
(
item
.
getItemId
())
{
case
R
.
id
.
conv_send_audio
:
sendAudioMessage
();
break
;
case
R
.
id
.
conv_send_video
:
sendVideoMessage
();
break
;
case
R
.
id
.
conv_send_file
:
presenter
.
selectFile
();
break
;
case
R
.
id
.
conv_share_location
:
shareLocation
();
break
;
case
R
.
id
.
chat_plugins
:
presenter
.
showPluginListHandlers
();
break
;
int
itemId
=
item
.
getItemId
();
if
(
itemId
==
R
.
id
.
conv_send_audio
)
{
sendAudioMessage
();
}
else
if
(
itemId
==
R
.
id
.
conv_send_video
)
{
sendVideoMessage
();
}
else
if
(
itemId
==
R
.
id
.
conv_send_file
)
{
presenter
.
selectFile
();
}
else
if
(
itemId
==
R
.
id
.
conv_share_location
)
{
shareLocation
();
}
else
if
(
itemId
==
R
.
id
.
chat_plugins
)
{
presenter
.
showPluginListHandlers
();
}
return
false
;
});
popup
.
getMenu
().
findItem
(
R
.
id
.
chat_plugins
).
setVisible
(
Rings
ervice
.
getPluginsEnabled
()
&&
Rings
ervice
.
getChatHandlers
().
size
()
>
0
);
popup
.
getMenu
().
findItem
(
R
.
id
.
chat_plugins
).
setVisible
(
JamiS
ervice
.
getPluginsEnabled
()
&&
!
JamiS
ervice
.
getChatHandlers
().
isEmpty
()
);
MenuPopupHelper
menuHelper
=
new
MenuPopupHelper
(
context
,
(
MenuBuilder
)
popup
.
getMenu
(),
v
);
menuHelper
.
setForceShowIcon
(
true
);
menuHelper
.
show
();
...
...
@@ -450,7 +447,7 @@ public class ConversationFragment extends BaseSupportFragment<ConversationPresen
FragmentManager
fragmentManager
=
getChildFragmentManager
();
PluginHandlersListFragment
fragment
=
PluginHandlersListFragment
.
newInstance
(
accountId
,
contactId
);
fragmentManager
.
beginTransaction
()
.
add
(
R
.
id
.
pluginListHandlers
,
fragment
,
f
ragment
.
TAG
)
.
add
(
R
.
id
.
pluginListHandlers
,
fragment
,
PluginHandlersListF
ragment
.
TAG
)
.
commit
();
RelativeLayout
.
LayoutParams
params
=
(
RelativeLayout
.
LayoutParams
)
binding
.
mapCard
.
getLayoutParams
();
...
...
ring-android/app/src/main/java/cx/ring/fragments/LinkDeviceFragment.java
View file @
b8190512
...
...
@@ -214,7 +214,7 @@ public class LinkDeviceFragment extends BaseBottomSheetFragment<LinkDevicePresen
mBinding
.
accountLinkInfo
.
setText
(
styledResultText
);
mBinding
.
accountLinkInfo
.
requestFocus
();
KeyboardVisibilityManager
.
hideKeyboard
(
getActivity
()
,
0
);
KeyboardVisibilityManager
.
hideKeyboard
(
getActivity
());
}
private
void
onClickStart
()
{
...
...
ring-android/app/src/main/java/cx/ring/fragments/PluginHandlersListFragment.java
View file @
b8190512
...
...
@@ -9,7 +9,8 @@ import androidx.annotation.NonNull;
import
androidx.annotation.Nullable
;
import
androidx.fragment.app.Fragment
;
import
cx.ring.daemon.Ringservice
;
import
net.jami.daemon.JamiService
;
import
cx.ring.databinding.FragPluginHandlersListBinding
;
import
cx.ring.plugins.PluginUtils
;
import
cx.ring.settings.pluginssettings.PluginDetails
;
...
...
@@ -74,11 +75,11 @@ public class PluginHandlersListFragment extends Fragment implements PluginsListA
@Override
public
void
onPluginItemClicked
(
PluginDetails
pluginDetails
)
{
Rings
ervice
.
toggleChatHandler
(
pluginDetails
.
getmHandlerId
(),
mPath
.
getAccountId
(),
mPath
.
getConversationId
(),
pluginDetails
.
isEnabled
());
JamiS
ervice
.
toggleChatHandler
(
pluginDetails
.
getmHandlerId
(),
mPath
.
getAccountId
(),
mPath
.
getConversationId
(),
pluginDetails
.
isEnabled
());
}
@Override
public
void
onPluginEnabled
(
PluginDetails
pluginDetails
)
{
Rings
ervice
.
toggleChatHandler
(
pluginDetails
.
getmHandlerId
(),
mPath
.
getAccountId
(),
mPath
.
getConversationId
(),
pluginDetails
.
isEnabled
());
JamiS
ervice
.
toggleChatHandler
(
pluginDetails
.
getmHandlerId
(),
mPath
.
getAccountId
(),
mPath
.
getConversationId
(),
pluginDetails
.
isEnabled
());
}
}
ring-android/app/src/main/java/cx/ring/plugins/PluginUtils.java
View file @
b8190512
...
...
@@ -8,8 +8,10 @@ import java.io.File;
import
java.util.ArrayList
;
import
java.util.List
;
import
net.jami.daemon.Ringservice
;
import
cx.ring.settings.pluginssettings.PluginDetails
;
import
net.jami.daemon.JamiService
;
import
net.jami.daemon.StringMap
;
import
net.jami.utils.Log
;
public
class
PluginUtils
{
...
...
@@ -26,8 +28,8 @@ public class PluginUtils {
tree
(
mContext
.
getFilesDir
()
+
File
.
separator
+
"plugins"
,
0
);
tree
(
mContext
.
getCacheDir
().
getAbsolutePath
(),
0
);
List
<
String
>
pluginsPaths
=
Rings
ervice
.
getInstalledPlugins
();
List
<
String
>
loadedPluginsPaths
=
Rings
ervice
.
getLoadedPlugins
();
List
<
String
>
pluginsPaths
=
JamiS
ervice
.
getInstalledPlugins
();
List
<
String
>
loadedPluginsPaths
=
JamiS
ervice
.
getLoadedPlugins
();
List
<
PluginDetails
>
pluginsList
=
new
ArrayList
<>(
pluginsPaths
.
size
());
for
(
String
pluginPath
:
pluginsPaths
)
{
...
...
@@ -59,12 +61,12 @@ public class PluginUtils {
tree
(
mContext
.
getFilesDir
()
+
File
.
separator
+
"plugins"
,
0
);
tree
(
mContext
.
getCacheDir
().
getAbsolutePath
(),
0
);
List
<
String
>
chatHandlersId
=
Rings
ervice
.
getChatHandlers
();
List
<
String
>
chatHandlerStatus
=
Rings
ervice
.
getChatHandlerStatus
(
accountId
,
peerId
);
List
<
String
>
chatHandlersId
=
JamiS
ervice
.
getChatHandlers
();
List
<
String
>
chatHandlerStatus
=
JamiS
ervice
.
getChatHandlerStatus
(
accountId
,
peerId
);
List
<
PluginDetails
>
handlersList
=
new
ArrayList
<>(
chatHandlersId
.
size
());
for
(
String
handlerId
:
chatHandlersId
)
{
StringMap
handlerDetails
=
Rings
ervice
.
getChatHandlerDetails
(
handlerId
);
StringMap
handlerDetails
=
JamiS
ervice
.
getChatHandlerDetails
(
handlerId
);
String
pluginPath
=
handlerDetails
.
get
(
"pluginId"
);
pluginPath
=
pluginPath
.
substring
(
0
,
pluginPath
.
lastIndexOf
(
"/data"
));
boolean
enabled
=
false
;
...
...
@@ -85,7 +87,7 @@ public class PluginUtils {
* @return true if loaded
*/
public
static
boolean
loadPlugin
(
String
path
)
{
return
Rings
ervice
.
loadPlugin
(
path
);
return
JamiS
ervice
.
loadPlugin
(
path
);
}
/**
...
...
@@ -95,7 +97,7 @@ public class PluginUtils {
* @return true if unloaded
*/
public
static
boolean
unloadPlugin
(
String
path
)
{
return
Rings
ervice
.
unloadPlugin
(
path
);
return
JamiS
ervice
.
unloadPlugin
(
path
);
}
/**
...
...
@@ -103,7 +105,7 @@ public class PluginUtils {
* @return list of path
*/
public
static
List
<
String
>
getLoadedPlugins
()
{
return
Rings
ervice
.
getLoadedPlugins
();
return
JamiS
ervice
.
getLoadedPlugins
();
}
/**
...
...
ring-android/app/src/main/java/cx/ring/services/CameraService.java
View file @
b8190512
...
...
@@ -68,8 +68,7 @@ import java.util.Map;
import
java.util.Set
;
import
net.jami.daemon.IntVect
;
import
net.jami.daemon.Ringservice
;
import
net.jami.daemon.RingserviceJNI
;
import
net.jami.daemon.JamiService
;
import
net.jami.daemon.StringMap
;
import
net.jami.daemon.UintVect
;
import
net.jami.utils.Tuple
;
...
...
@@ -114,7 +113,7 @@ public class CameraService {
if
(
addedDevices
.
add
(
camera
.
first
))
{
if
(!
devices
.
cameras
.
contains
(
camera
.
first
))
devices
.
cameras
.
add
(
camera
.
first
);
Rings
ervice
JNI
.
addVideoDevice
(
camera
.
first
);
JamiS
ervice
.
addVideoDevice
(
camera
.
first
);
}
}
});
...
...
@@ -127,7 +126,7 @@ public class CameraService {
if
(
addedDevices
.
remove
(
cameraId
))
{
Log
.
w
(
TAG
,
"onCameraUnavailable "
+
cameraId
+
" current:"
+
previewCamera
);
devices
.
cameras
.
remove
(
cameraId
);
Rings
ervice
JNI
.
removeVideoDevice
(
cameraId
);
JamiS
ervice
.
removeVideoDevice
(
cameraId
);
}
}
}
...
...
@@ -222,7 +221,7 @@ public class CameraService {
}
params
.
rotation
=
getCameraDisplayRotation
(
deviceParams
,
rotation
);
int
r
=
params
.
rotation
;
getVideoHandler
().
post
(()
->
Rings
ervice
.
setDeviceOrientation
(
camId
,
r
));
getVideoHandler
().
post
(()
->
JamiS
ervice
.
setDeviceOrientation
(
camId
,
r
));
}
public
void
setOrientation
(
int
rotation
)
{
...
...
@@ -242,7 +241,7 @@ public class CameraService {
if
(
params
!=
null
)
{
params
.
rotation
=
rotation
;
}
Rings
ervice
.
setDeviceOrientation
(
camId
,
rotation
);
JamiS
ervice
.
setDeviceOrientation
(
camId
,
rotation
);
}
private
static
int
getCameraDisplayRotation
(
DeviceParams
device
,
int
screenRotation
)
{
...
...
@@ -414,19 +413,19 @@ public class CameraService {
for
(
String
oldId
:
old
.
cameras
)
{
if
(!
devs
.
cameras
.
contains
(
oldId
)
||
resetCamera
)
{
if
(
addedDevices
.
remove
(
oldId
))
Rings
ervice
JNI
.
removeVideoDevice
(
oldId
);
JamiS
ervice
.
removeVideoDevice
(
oldId
);
}
}
}
// Added devices
for
(
String
camera
:
devs
.
cameras
)
{
Log
.
w
(
TAG
,
"
Rings
erviceJNI.addVideoDevice init "
+
camera
);
Log
.
w
(
TAG
,
"
JamiS
erviceJNI.addVideoDevice init "
+
camera
);
if
(
addedDevices
.
add
(
camera
))
Rings
ervice
JNI
.
addVideoDevice
(
camera
);
JamiS
ervice
.
addVideoDevice
(
camera
);
}
// New default
if
(
devs
.
currentId
!=
null
)
{
Rings
ervice
JNI
.
setDefaultDevice
(
devs
.
currentId
);
JamiS
ervice
.
setDefaultDevice
(
devs
.
currentId
);
}
}
return
devs
;
...
...
@@ -581,12 +580,12 @@ public class CameraService {
// If it's a key-frame, send the cached SPS/PPS NALs prior to
// sending key-frame.
if
(
isKeyFrame
&&
codecData
!=
null
)
{
Rings
ervice
JNI
.
captureVideoPacket
(
codecData
,
codecData
.
capacity
(),
0
,
false
,
info
.
presentationTimeUs
,
videoParams
.
rotation
);
JamiS
ervice
.
captureVideoPacket
(
codecData
,
codecData
.
capacity
(),
0
,
false
,
info
.
presentationTimeUs
,
videoParams
.
rotation
);
}
// Send the encoded frame
ByteBuffer
buffer
=
codec
.
getOutputBuffer
(
index
);
Rings
ervice
JNI
.
captureVideoPacket
(
buffer
,
info
.
size
,
info
.
offset
,
isKeyFrame
,
info
.
presentationTimeUs
,
videoParams
.
rotation
);
JamiS
ervice
.
captureVideoPacket
(
buffer
,
info
.
size
,
info
.
offset
,
isKeyFrame
,
info
.
presentationTimeUs
,
videoParams
.
rotation
);
codec
.
releaseOutputBuffer
(
index
,
false
);
}
}
...
...
@@ -840,7 +839,7 @@ public class CameraService {
tmpReader
.
setOnImageAvailableListener
(
r
->
{
Image
image
=
r
.
acquireLatestImage
();
if
(
image
!=
null
)
{
Rings
ervice
JNI
.
captureVideoFrame
(
image
,
videoParams
.
rotation
);
JamiS
ervice
.
captureVideoFrame
(
image
,
videoParams
.
rotation
);
image
.
close
();
}
},
handler
);
...
...
ring-android/app/src/main/java/cx/ring/services/DataTransferService.java
View file @
b8190512
...
...
@@ -40,7 +40,7 @@ public class DataTransferService extends Service {
private
final
String
TAG
=
DataTransferService
.
class
.
getSimpleName
();
@Inject
net
.
jami
.
services
.
NotificationService
mNotificationService
;
NotificationService
mNotificationService
;
private
NotificationManagerCompat
notificationManager
;
private
boolean
isFirst
=
true
;
...
...
@@ -59,22 +59,22 @@ public class DataTransferService extends Service {
return
START_NOT_STICKY
;
}
if
(
isFirst
)
{
isFirst
=
false
;
//
if (isFirst) {
//
isFirst = false;
mNotificationService
.
cancelFileNotification
(
notificationId
,
true
);
serviceNotificationId
=
notificationId
;
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
Q
)
startForeground
(
NOTIF_FILE_SERVICE_ID
,
notification
,
ServiceInfo
.
FOREGROUND_SERVICE_TYPE_DATA_SYNC
);
else
startForeground
(
NOTIF_FILE_SERVICE_ID
,
notification
);
}
//
}
if
(
mNotificationService
.
getDataTransferNotification
(
serviceNotificationId
)
==
null
)
{
mNotificationService
.
cancelFileNotification
(
notificationId
,
true
);
serviceNotificationId
=
notificationId
;
}
if
(
notificationId
==
serviceNotificationId
)
if
(
notificationId
==
serviceNotificationId
)
notificationManager
.
notify
(
NOTIF_FILE_SERVICE_ID
,
notification
);
else
notificationManager
.
notify
(
notificationId
,
notification
);
...
...
ring-android/app/src/main/java/cx/ring/services/HardwareServiceImpl.java
View file @
b8190512
...
...
@@ -46,7 +46,7 @@ import java.util.List;
import
java.util.Map
;
import
net.jami.daemon.IntVect
;
import
net.jami.daemon.
Rings
ervice
;
import
net.jami.daemon.
JamiS
ervice
;
import
net.jami.daemon.UintVect
;
import
net.jami.model.Conference
;
import
net.jami.model.Call
;
...
...
@@ -340,7 +340,7 @@ public class HardwareServiceImpl extends HardwareService implements AudioManager
@Override
synchronized
public
void
toggleSpeakerphone
(
boolean
checked
)
{
Rings
ervice
.
setAudioPlugin
(
Rings
ervice
.
getCurrentAudioOutputPlugin
());
JamiS
ervice
.
setAudioPlugin
(
JamiS
ervice
.
getCurrentAudioOutputPlugin
());
mShouldSpeakerphone
=
checked
;
Log
.
w
(
TAG
,
"toggleSpeakerphone setSpeakerphoneOn "
+
checked
);
if
(
mHasSpeakerPhone
&&
checked
)
{
...
...
@@ -382,7 +382,7 @@ public class HardwareServiceImpl extends HardwareService implements AudioManager
shm
.
window
=
startVideo
(
id
,
holder
.
getSurface
(),
width
,
height
);
if
(
shm
.
window
==
0
)
{
Log
.
i
(
TAG
,
"D
Ring
Service.decodingStarted() no window !"
);
Log
.
i
(
TAG
,
"D
Jami
Service.decodingStarted() no window !"
);
VideoEvent
event
=
new
VideoEvent
();
event
.
start
=
true
;
...
...
@@ -493,7 +493,7 @@ public class HardwareServiceImpl extends HardwareService implements AudioManager
private
void
toggleMediaHandler
(
String
callId
)
{
if
(
mMediaHandlerId
!=
null
)
Rings
ervice
.
toggleCallMediaHandler
(
mMediaHandlerId
,
callId
,
true
);
JamiS
ervice
.
toggleCallMediaHandler
(
mMediaHandlerId
,
callId
,
true
);
}
public
void
stopMediaHandler
()
{
...
...
@@ -533,7 +533,7 @@ public class HardwareServiceImpl extends HardwareService implements AudioManager
if
(
conf
!=
null
&&
useHardwareCodec
)
{
Call
call
=
conf
.
getCall
();
if
(
call
!=
null
)
{
call
.
setDetails
(
Rings
ervice
.
getCallDetails
(
call
.
getDaemonIdString
()).
toNative
());
call
.
setDetails
(
JamiS
ervice
.
getCallDetails
(
call
.
getDaemonIdString
()).
toNative
());
videoParams
.
codec
=
call
.
getVideoCodec
();
}
else
{
videoParams
.
codec
=
null
;
...
...
@@ -553,7 +553,7 @@ public class HardwareServiceImpl extends HardwareService implements AudioManager
if
(
currentCall
==
null
)
return
;
if
(
mPluginCallId
!=
null
&&
!
mPluginCallId
.
equals
(
currentCall
))
{
Rings
ervice
.
toggleCallMediaHandler
(
mMediaHandlerId
,
currentCall
,
false
);
JamiS
ervice
.
toggleCallMediaHandler
(
mMediaHandlerId
,
currentCall
,
false
);
mIsChoosePlugin
=
false
;
mMediaHandlerId
=
null
;
mPluginCallId
=
null
;
...
...
@@ -629,7 +629,7 @@ public class HardwareServiceImpl extends HardwareService implements AudioManager
}
if
(
shm
==
null
||
shm
.
window
==
0
)
{
Log
.
i
(
TAG
,
"D
Ring
Service.addVideoSurface() no window !"
);
Log
.
i
(
TAG
,
"D
Jami
Service.addVideoSurface() no window !"
);
VideoEvent
event
=
new
VideoEvent
();
event
.
start
=
true
;
...
...
ring-android/app/src/main/java/cx/ring/services/LocationSharingService.java
View file @
b8190512
...
...
@@ -62,7 +62,7 @@ import cx.ring.R;
import
cx.ring.application.JamiApplication
;
import
cx.ring.client.ConversationActivity
;
import
net.jami.daemon.Blob
;
import
net.jami.daemon.
Rings
ervice
;
import
net.jami.daemon.
JamiS
ervice
;
import
net.jami.daemon.StringMap
;
import
net.jami.facades.ConversationFacade
;
import
cx.ring.fragments.ConversationFragment
;
...
...
@@ -215,7 +215,7 @@ public class LocationSharingService extends Service implements LocationListener
StringMap
msgs
=
new
StringMap
();
msgs
.
setRaw
(
net
.
jami
.
services
.
CallService
.
MIME_GEOLOCATION
,
Blob
.
fromString
(
location
.
toString
()));
for
(
ConversationPath
p
:
contactLocationShare
.
keySet
())
{
Rings
ervice
.
sendAccountTextMessage
(
p
.
getAccountId
(),
p
.
getConversationId
(),
msgs
);
JamiS
ervice
.
sendAccountTextMessage
(
p
.
getAccountId
(),
p
.
getConversationId
(),
msgs
);
}
}));