Target SDK 30
This commit is contained in:
parent
7ee8ba34b0
commit
d611d20cfd
11 changed files with 94 additions and 26 deletions
|
@ -2,7 +2,7 @@ job-android:
|
||||||
|
|
||||||
stage: build
|
stage: build
|
||||||
tags: [ "docker-android" ]
|
tags: [ "docker-android" ]
|
||||||
image: gitlab.linphone.org:4567/bc/public/linphone-android/bc-dev-android:29
|
image: gitlab.linphone.org:4567/bc/public/linphone-android/bc-dev-android:30
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- if ! [ -z ${SCP_PRIVATE_KEY+x} ]; then eval $(ssh-agent -s); fi
|
- if ! [ -z ${SCP_PRIVATE_KEY+x} ]; then eval $(ssh-agent -s); fi
|
||||||
|
|
|
@ -53,8 +53,8 @@ project.tasks['preBuild'].dependsOn 'getGitVersion'
|
||||||
project.tasks['preBuild'].dependsOn 'linphoneSdkSource'
|
project.tasks['preBuild'].dependsOn 'linphoneSdkSource'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 29
|
compileSdkVersion 30
|
||||||
buildToolsVersion "29.0.3"
|
buildToolsVersion '30.0.2'
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion 23
|
minSdkVersion 23
|
||||||
targetSdkVersion 29
|
targetSdkVersion 29
|
||||||
|
|
|
@ -119,7 +119,7 @@ class ChatRoomsListViewModel : ErrorReportingViewModel() {
|
||||||
chatRoomsToDeleteCount = 1
|
chatRoomsToDeleteCount = 1
|
||||||
if (chatRoom != null) {
|
if (chatRoom != null) {
|
||||||
coreContext.notificationsManager.dismissChatNotification(chatRoom)
|
coreContext.notificationsManager.dismissChatNotification(chatRoom)
|
||||||
Compatibility.removeChatRoomShortcut(chatRoom)
|
Compatibility.removeChatRoomShortcut(coreContext.context, chatRoom)
|
||||||
chatRoom.addListener(chatRoomListener)
|
chatRoom.addListener(chatRoomListener)
|
||||||
coreContext.core.deleteChatRoom(chatRoom)
|
coreContext.core.deleteChatRoom(chatRoom)
|
||||||
}
|
}
|
||||||
|
@ -133,7 +133,7 @@ class ChatRoomsListViewModel : ErrorReportingViewModel() {
|
||||||
}
|
}
|
||||||
|
|
||||||
coreContext.notificationsManager.dismissChatNotification(chatRoom)
|
coreContext.notificationsManager.dismissChatNotification(chatRoom)
|
||||||
Compatibility.removeChatRoomShortcut(chatRoom)
|
Compatibility.removeChatRoomShortcut(coreContext.context, chatRoom)
|
||||||
chatRoom.addListener(chatRoomListener)
|
chatRoom.addListener(chatRoomListener)
|
||||||
chatRoom.core.deleteChatRoom(chatRoom)
|
chatRoom.core.deleteChatRoom(chatRoom)
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ import org.linphone.LinphoneApplication.Companion.coreContext
|
||||||
import org.linphone.R
|
import org.linphone.R
|
||||||
|
|
||||||
class SyncAccountAdapter : BaseAdapter() {
|
class SyncAccountAdapter : BaseAdapter() {
|
||||||
private var accounts: ArrayList<Triple<String, String, Drawable>> = arrayListOf()
|
private var accounts: ArrayList<Triple<String, String, Drawable?>> = arrayListOf()
|
||||||
|
|
||||||
init {
|
init {
|
||||||
accounts.addAll(coreContext.contactsManager.getAvailableSyncAccounts())
|
accounts.addAll(coreContext.contactsManager.getAvailableSyncAccounts())
|
||||||
|
@ -30,7 +30,7 @@ class SyncAccountAdapter : BaseAdapter() {
|
||||||
return view
|
return view
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getItem(position: Int): Triple<String, String, Drawable> {
|
override fun getItem(position: Int): Triple<String, String, Drawable?> {
|
||||||
return accounts[position]
|
return accounts[position]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -137,19 +137,19 @@ class RecordingViewModel(val path: String) : ViewModel(), Comparable<RecordingVi
|
||||||
} else {
|
} else {
|
||||||
textureView.surfaceTextureListener = object : TextureView.SurfaceTextureListener {
|
textureView.surfaceTextureListener = object : TextureView.SurfaceTextureListener {
|
||||||
override fun onSurfaceTextureSizeChanged(
|
override fun onSurfaceTextureSizeChanged(
|
||||||
surface: SurfaceTexture?,
|
surface: SurfaceTexture,
|
||||||
width: Int,
|
width: Int,
|
||||||
height: Int
|
height: Int
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
override fun onSurfaceTextureUpdated(surface: SurfaceTexture?) { }
|
override fun onSurfaceTextureUpdated(surface: SurfaceTexture) { }
|
||||||
|
|
||||||
override fun onSurfaceTextureDestroyed(surface: SurfaceTexture?): Boolean {
|
override fun onSurfaceTextureDestroyed(surface: SurfaceTexture): Boolean {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onSurfaceTextureAvailable(
|
override fun onSurfaceTextureAvailable(
|
||||||
surface: SurfaceTexture?,
|
surface: SurfaceTexture,
|
||||||
width: Int,
|
width: Int,
|
||||||
height: Int
|
height: Int
|
||||||
) {
|
) {
|
||||||
|
|
|
@ -137,8 +137,10 @@ class Compatibility {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun removeChatRoomShortcut(chatRoom: ChatRoom) {
|
fun removeChatRoomShortcut(context: Context, chatRoom: ChatRoom) {
|
||||||
// TODO Use removeLongLivedShortcuts() starting Android R (API 30)
|
if (Version.sdkAboveOrEqual(Version.API30_ANDROID_11)) {
|
||||||
|
// TODO Use removeLongLivedShortcuts()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun addImageToMediaStore(context: Context, content: Content): Boolean {
|
suspend fun addImageToMediaStore(context: Context, content: Content): Boolean {
|
||||||
|
|
|
@ -276,12 +276,12 @@ class ContactsManager(private val context: Context) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getAvailableSyncAccounts(): List<Triple<String, String, Drawable>> {
|
fun getAvailableSyncAccounts(): List<Triple<String, String, Drawable?>> {
|
||||||
val accountManager = context.getSystemService(Context.ACCOUNT_SERVICE) as AccountManager
|
val accountManager = context.getSystemService(Context.ACCOUNT_SERVICE) as AccountManager
|
||||||
val packageManager = context.packageManager
|
val packageManager = context.packageManager
|
||||||
val syncAdapters = ContentResolver.getSyncAdapterTypes()
|
val syncAdapters = ContentResolver.getSyncAdapterTypes()
|
||||||
val authenticators: Array<AuthenticatorDescription> = accountManager.authenticatorTypes
|
val authenticators: Array<AuthenticatorDescription> = accountManager.authenticatorTypes
|
||||||
val available = arrayListOf<Triple<String, String, Drawable>>()
|
val available = arrayListOf<Triple<String, String, Drawable?>>()
|
||||||
|
|
||||||
for (syncAdapter in syncAdapters) {
|
for (syncAdapter in syncAdapters) {
|
||||||
if (syncAdapter.authority == "com.android.contacts" && syncAdapter.isUserVisible) {
|
if (syncAdapter.authority == "com.android.contacts" && syncAdapter.isUserVisible) {
|
||||||
|
|
|
@ -47,14 +47,23 @@ class NativeContactEditor(val contact: NativeContact) {
|
||||||
val contentResolver = coreContext.context.contentResolver
|
val contentResolver = coreContext.context.contentResolver
|
||||||
val results = contentResolver.applyBatch(ContactsContract.AUTHORITY, changes)
|
val results = contentResolver.applyBatch(ContactsContract.AUTHORITY, changes)
|
||||||
for (result in results) {
|
for (result in results) {
|
||||||
Log.i("[Native Contact Editor] Contact creation result is ${result.uri}")
|
val uri = result.uri
|
||||||
val cursor = contentResolver.query(result.uri, arrayOf(RawContacts.CONTACT_ID), null, null, null)
|
Log.i("[Native Contact Editor] Contact creation result is $uri")
|
||||||
if (cursor != null) {
|
if (uri != null) {
|
||||||
cursor.moveToNext()
|
val cursor = contentResolver.query(
|
||||||
val contactId: Long = cursor.getLong(0)
|
uri,
|
||||||
Log.i("[Native Contact Editor] New contact id is $contactId")
|
arrayOf(RawContacts.CONTACT_ID),
|
||||||
cursor.close()
|
null,
|
||||||
return contactId
|
null,
|
||||||
|
null
|
||||||
|
)
|
||||||
|
if (cursor != null) {
|
||||||
|
cursor.moveToNext()
|
||||||
|
val contactId: Long = cursor.getLong(0)
|
||||||
|
Log.i("[Native Contact Editor] New contact id is $contactId")
|
||||||
|
cursor.close()
|
||||||
|
return contactId
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -301,9 +310,10 @@ class NativeContactEditor(val contact: NativeContact) {
|
||||||
val contentResolver = coreContext.context.contentResolver
|
val contentResolver = coreContext.context.contentResolver
|
||||||
val results = contentResolver.applyBatch(ContactsContract.AUTHORITY, changes)
|
val results = contentResolver.applyBatch(ContactsContract.AUTHORITY, changes)
|
||||||
for (result in results) {
|
for (result in results) {
|
||||||
Log.i("[Native Contact Editor] Result is ${result.uri}")
|
val uri = result.uri
|
||||||
if (updateSyncAccountRawId && syncAccountRawId == null && result?.uri != null) {
|
Log.i("[Native Contact Editor] Result is $uri")
|
||||||
syncAccountRawId = ContentUris.parseId(result.uri).toString()
|
if (uri != null && updateSyncAccountRawId && syncAccountRawId == null) {
|
||||||
|
syncAccountRawId = ContentUris.parseId(uri).toString()
|
||||||
Log.i("[Native Contact Editor] Sync account raw id is $syncAccountRawId")
|
Log.i("[Native Contact Editor] Sync account raw id is $syncAccountRawId")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,6 +47,10 @@ class NotificationBroadcastReceiver : BroadcastReceiver() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (localIdentity == null) {
|
||||||
|
Log.e("[Notification Broadcast Receiver] Local identity is null for notification id $notificationId")
|
||||||
|
return
|
||||||
|
}
|
||||||
val localAddress = core.interpretUrl(localIdentity)
|
val localAddress = core.interpretUrl(localIdentity)
|
||||||
if (localAddress == null) {
|
if (localAddress == null) {
|
||||||
Log.e("[Notification Broadcast Receiver] Couldn't interpret local address $localIdentity")
|
Log.e("[Notification Broadcast Receiver] Couldn't interpret local address $localIdentity")
|
||||||
|
|
|
@ -54,6 +54,7 @@
|
||||||
glideAvatarFallback="@{viewModel.defaultAccountAvatar}" />
|
glideAvatarFallback="@{viewModel.defaultAccountAvatar}" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
|
android:visibility="@{viewModel.defaultAccountFound ? View.VISIBLE : View.GONE}"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:adjustViewBounds="true"
|
android:adjustViewBounds="true"
|
||||||
|
@ -74,6 +75,7 @@
|
||||||
android:textColor="?attr/lightToolbarTextColor"
|
android:textColor="?attr/lightToolbarTextColor"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
android:textSize="18sp"
|
android:textSize="18sp"
|
||||||
|
android:padding="10dp"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
|
|
50
docker-files/bc-dev-android-30
Normal file
50
docker-files/bc-dev-android-30
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
FROM debian:stretch
|
||||||
|
|
||||||
|
MAINTAINER Ghislain MARY <ghislain.mary@belledonne-communications.com>
|
||||||
|
|
||||||
|
|
||||||
|
# Configure locale
|
||||||
|
RUN apt-get update && \
|
||||||
|
apt-get install -y locales && \
|
||||||
|
apt-get clean && \
|
||||||
|
echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && \
|
||||||
|
locale-gen
|
||||||
|
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'
|
||||||
|
|
||||||
|
ENV SHELL=/bin/bash
|
||||||
|
|
||||||
|
# Define environment
|
||||||
|
ENV ANDROID_SDK 25.2.5
|
||||||
|
ENV ANDROID_HOME /opt/android-sdk-linux
|
||||||
|
|
||||||
|
# Install common general tools
|
||||||
|
RUN apt-get update && \
|
||||||
|
apt-get install -y curl nano sudo unzip vim wget openjdk-8-jdk-headless rsync ssh git && \
|
||||||
|
apt-get clean
|
||||||
|
|
||||||
|
# Get the Android tools
|
||||||
|
RUN wget https://dl.google.com/android/repository/tools_r$ANDROID_SDK-linux.zip && \
|
||||||
|
unzip tools_r$ANDROID_SDK-linux.zip -d $ANDROID_HOME && \
|
||||||
|
rm -f tools_r$ANDROID_SDK-linux.zip
|
||||||
|
ENV PATH $ANDROID_HOME/tools:$ANDROID_HOME/tools/bin:$ANDROID_HOME/platform-tools:$PATH
|
||||||
|
|
||||||
|
# Get the Android SDK
|
||||||
|
RUN echo "y" | sdkmanager "platforms;android-30" "build-tools;30.0.2" "extras;android;m2repository" "extras;google;m2repository" "platform-tools" "tools"
|
||||||
|
|
||||||
|
# Accept Android SDK licenses
|
||||||
|
RUN yes | sdkmanager --licenses
|
||||||
|
|
||||||
|
# Update if needed
|
||||||
|
RUN echo y | android update sdk --no-ui --all --filter platform-tools
|
||||||
|
RUN echo y | android update sdk --no-ui --all --filter android-30
|
||||||
|
RUN echo y | android update sdk --no-ui --all --filter build-tools-30.0.2
|
||||||
|
|
||||||
|
# Configure user bc
|
||||||
|
RUN useradd -ms /bin/bash bc && \
|
||||||
|
echo 'bc:cotcot' | chpasswd && \
|
||||||
|
echo 'bc ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
|
||||||
|
|
||||||
|
USER bc
|
||||||
|
WORKDIR /home/bc
|
||||||
|
ENV PS1='\[\e[34m\]\u@bc-dev-android>\[\e[0m\] '
|
||||||
|
CMD bash
|
Loading…
Reference in a new issue