diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/BuildVars.java b/TMessagesProj/src/main/java/org/telegram/messenger/BuildVars.java index 550415842..6e44ac825 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/BuildVars.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/BuildVars.java @@ -24,8 +24,8 @@ public class BuildVars { public static boolean USE_CLOUD_STRINGS = true; public static boolean CHECK_UPDATES = true; public static boolean NO_SCOPED_STORAGE = Build.VERSION.SDK_INT <= 29; - public static int BUILD_VERSION = 2928; - public static String BUILD_VERSION_STRING = "9.1.5"; + public static int BUILD_VERSION = 2929; + public static String BUILD_VERSION_STRING = "9.1.6"; public static int APP_ID = 4; public static String APP_HASH = "014b35b6184100b085b0d0572f9b5103"; diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/MediaDataController.java b/TMessagesProj/src/main/java/org/telegram/messenger/MediaDataController.java index c52af8d9a..b46b1025c 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/MediaDataController.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/MediaDataController.java @@ -7255,7 +7255,7 @@ public class MediaDataController extends BaseController { @Override public void run() { for (int i = 0; i < previewItems.size(); i++) { - if (previewItems.get(i).chatTheme != null) { + if (previewItems.get(i) != null && previewItems.get(i).chatTheme != null) { previewItems.get(i).chatTheme.loadPreviewColors(0); } } diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java b/TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java index 1e4f23ab4..573470e8d 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java @@ -11,11 +11,13 @@ package org.telegram.messenger; import static org.telegram.messenger.NotificationsController.TYPE_CHANNEL; import static org.telegram.messenger.NotificationsController.TYPE_PRIVATE; +import android.Manifest; import android.app.Activity; import android.appwidget.AppWidgetManager; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; +import android.content.pm.PackageManager; import android.location.Location; import android.os.Build; import android.os.Bundle; @@ -29,6 +31,7 @@ import android.util.SparseBooleanArray; import android.util.SparseIntArray; import androidx.collection.LongSparseArray; +import androidx.core.app.ActivityCompat; import androidx.core.app.NotificationManagerCompat; import androidx.core.util.Consumer; @@ -14898,7 +14901,16 @@ public class MessagesController extends BaseController implements NotificationCe } } TelephonyManager tm = (TelephonyManager) ApplicationLoader.applicationContext.getSystemService(Context.TELEPHONY_SERVICE); - if (svc != null || VoIPService.callIShouldHavePutIntoIntent != null || tm.getCallState() != TelephonyManager.CALL_STATE_IDLE) { + boolean callStateIsIdle = true; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { + //TODO check + if (ActivityCompat.checkSelfPermission(ApplicationLoader.applicationContext, Manifest.permission.READ_PHONE_STATE) == PackageManager.PERMISSION_GRANTED) { + callStateIsIdle = tm.getCallState() == TelephonyManager.CALL_STATE_IDLE; + } + } else { + callStateIsIdle = tm.getCallState() == TelephonyManager.CALL_STATE_IDLE; + } + if (svc != null || VoIPService.callIShouldHavePutIntoIntent != null || !callStateIsIdle) { if (BuildVars.LOGS_ENABLED) { FileLog.d("Auto-declining call " + call.id + " because there's already active one"); } diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/voip/VoIPService.java b/TMessagesProj/src/main/java/org/telegram/messenger/voip/VoIPService.java index 92601ebd9..626c030df 100755 --- a/TMessagesProj/src/main/java/org/telegram/messenger/voip/VoIPService.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/voip/VoIPService.java @@ -4026,7 +4026,13 @@ public class VoIPService extends Service implements SensorEventListener, AudioMa customView.setOnClickPendingIntent(R.id.decline_btn, endPendingIntent); builder.setLargeIcon(avatar); - incomingNotification.headsUpContentView = incomingNotification.bigContentView = customView; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { + builder.setColor(0xFF282e31); + builder.setColorized(true); + builder.setCustomBigContentView(customView); + } else { + incomingNotification.headsUpContentView = incomingNotification.bigContentView = customView; + } } startForeground(ID_INCOMING_CALL_NOTIFICATION, incomingNotification); startRingtoneAndVibration(); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarLayout.java b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarLayout.java index 4749c96e6..1d745defb 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarLayout.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ActionBar/ActionBarLayout.java @@ -2176,7 +2176,9 @@ public class ActionBarLayout extends FrameLayout implements INavigationLayout, F private void onCloseAnimationEnd() { if (transitionAnimationInProgress && onCloseAnimationEndRunnable != null) { if (currentAnimation != null) { - currentAnimation.cancel(); + AnimatorSet animatorSet = currentAnimation; + currentAnimation = null; + animatorSet.cancel(); } transitionAnimationInProgress = false; layoutToIgnore = null; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java index 886251a03..3114d9814 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java @@ -12447,7 +12447,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not position++; } } - if (top && messages != null && messages.get(position) != null) { + if (top && messages != null && messages.size() > 0 && messages.get(position) != null) { long groupId = messages.get(position).getGroupId(); while (groupId != 0 && position + 1 < messages.size()) { if (groupId != messages.get(position + 1).getGroupId()) { @@ -12456,7 +12456,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not position++; } } - if (messages != null) { + if (messages != null && messages.size() > 0) { position = Math.min(position, messages.size() - 1); } chatScrollHelper.scrollToPosition(chatScrollHelperCallback.position = position, chatScrollHelperCallback.offset = 0, chatScrollHelperCallback.bottom = !top, true); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/LNavigation/LNavigation.java b/TMessagesProj/src/main/java/org/telegram/ui/LNavigation/LNavigation.java index ccc100497..d32f9485d 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/LNavigation/LNavigation.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/LNavigation/LNavigation.java @@ -1423,6 +1423,7 @@ public class LNavigation extends FrameLayout implements INavigationLayout, Float if (newLastFragment != null) { newLastFragment.prepareFragmentToSlide(false, false); + newLastFragment.onTransitionAnimationEnd(true, true); newLastFragment.onBecomeFullyVisible(); } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java index 2111a3f6e..110f83eeb 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java @@ -5198,7 +5198,7 @@ public class LaunchActivity extends BasePermissionsActivity implements INavigati } PipRoundVideoView pipRoundVideoView = PipRoundVideoView.getInstance(); MediaController.getInstance().setBaseActivity(this, false); - MediaController.getInstance().setFeedbackView(actionBarLayout.getView(), false); + MediaController.getInstance().setFeedbackView(feedbackView, false); if (pipRoundVideoView != null) { pipRoundVideoView.close(false); } @@ -5240,6 +5240,8 @@ public class LaunchActivity extends BasePermissionsActivity implements INavigati actionBarLayout.onUserLeaveHint(); } + View feedbackView; + @Override protected void onResume() { super.onResume(); @@ -5254,7 +5256,7 @@ public class LaunchActivity extends BasePermissionsActivity implements INavigati checkWasMutedByAdmin(true); //FileLog.d("UI resume time = " + (SystemClock.elapsedRealtime() - ApplicationLoader.startTime)); NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.startAllHeavyOperations, 4096); - MediaController.getInstance().setFeedbackView(actionBarLayout.getView(), true); + MediaController.getInstance().setFeedbackView(feedbackView = actionBarLayout.getView(), true); ApplicationLoader.mainInterfacePaused = false; showLanguageAlert(false); Utilities.stageQueue.postRunnable(() -> { diff --git a/gradle.properties b/gradle.properties index 286e082e2..4856ec79d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -13,8 +13,8 @@ # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # org.gradle.parallel=true #Sat Mar 12 05:53:50 MSK 2016 -APP_VERSION_NAME=9.1.5 -APP_VERSION_CODE=2928 +APP_VERSION_NAME=9.1.6 +APP_VERSION_CODE=2929 APP_PACKAGE=org.telegram.messenger RELEASE_KEY_PASSWORD=TelegramAndroidPswd RELEASE_KEY_ALIAS=tmessages