mirror of
https://github.com/DrKLO/Telegram.git
synced 2024-12-22 14:35:03 +01:00
update to 9.4.7
This commit is contained in:
parent
116092e32d
commit
7554c9b726
13 changed files with 91 additions and 38 deletions
|
@ -578,15 +578,23 @@ public class AndroidUtilities {
|
||||||
return dir;
|
return dir;
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
ApplicationLoader.appCenterLog(e);
|
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
File dir = new File(ApplicationLoader.applicationContext.getCacheDir() + "/logs");
|
File dir = new File(ApplicationLoader.applicationContext.getCacheDir() + "/logs");
|
||||||
dir.mkdirs();
|
dir.mkdirs();
|
||||||
return dir;
|
return dir;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
ApplicationLoader.appCenterLog(e);
|
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
|
File dir = new File(ApplicationLoader.applicationContext.getFilesDir() + "/logs");
|
||||||
|
dir.mkdirs();
|
||||||
|
return dir;
|
||||||
|
} catch (Exception e) {
|
||||||
|
|
||||||
|
}
|
||||||
|
ApplicationLoader.appCenterLog(new RuntimeException("can't create logs directory"));
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1949,7 +1957,11 @@ public class AndroidUtilities {
|
||||||
try {
|
try {
|
||||||
File file = ApplicationLoader.applicationContext.getFilesDir();
|
File file = ApplicationLoader.applicationContext.getFilesDir();
|
||||||
if (file != null) {
|
if (file != null) {
|
||||||
return file;
|
File cacheFile = new File(file, "cache/");
|
||||||
|
cacheFile.mkdirs();
|
||||||
|
if ((file.exists() || file.mkdirs()) && file.canWrite()) {
|
||||||
|
return cacheFile;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
||||||
|
|
|
@ -24,8 +24,8 @@ public class BuildVars {
|
||||||
public static boolean USE_CLOUD_STRINGS = true;
|
public static boolean USE_CLOUD_STRINGS = true;
|
||||||
public static boolean CHECK_UPDATES = true;
|
public static boolean CHECK_UPDATES = true;
|
||||||
public static boolean NO_SCOPED_STORAGE = Build.VERSION.SDK_INT <= 29;
|
public static boolean NO_SCOPED_STORAGE = Build.VERSION.SDK_INT <= 29;
|
||||||
public static int BUILD_VERSION = 3155;
|
public static int BUILD_VERSION = 3160;
|
||||||
public static String BUILD_VERSION_STRING = "9.4.6";
|
public static String BUILD_VERSION_STRING = "9.4.7";
|
||||||
public static int APP_ID = 4;
|
public static int APP_ID = 4;
|
||||||
public static String APP_HASH = "014b35b6184100b085b0d0572f9b5103";
|
public static String APP_HASH = "014b35b6184100b085b0d0572f9b5103";
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,7 @@ import android.hardware.Sensor;
|
||||||
import android.hardware.SensorEvent;
|
import android.hardware.SensorEvent;
|
||||||
import android.hardware.SensorEventListener;
|
import android.hardware.SensorEventListener;
|
||||||
import android.hardware.SensorManager;
|
import android.hardware.SensorManager;
|
||||||
|
import android.media.AudioDeviceInfo;
|
||||||
import android.media.AudioFormat;
|
import android.media.AudioFormat;
|
||||||
import android.media.AudioManager;
|
import android.media.AudioManager;
|
||||||
import android.media.AudioRecord;
|
import android.media.AudioRecord;
|
||||||
|
@ -52,6 +53,7 @@ import android.provider.OpenableColumns;
|
||||||
import android.telephony.PhoneStateListener;
|
import android.telephony.PhoneStateListener;
|
||||||
import android.telephony.TelephonyManager;
|
import android.telephony.TelephonyManager;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
|
import android.util.Log;
|
||||||
import android.util.SparseArray;
|
import android.util.SparseArray;
|
||||||
import android.view.HapticFeedbackConstants;
|
import android.view.HapticFeedbackConstants;
|
||||||
import android.view.TextureView;
|
import android.view.TextureView;
|
||||||
|
@ -60,6 +62,8 @@ import android.view.WindowManager;
|
||||||
import android.webkit.MimeTypeMap;
|
import android.webkit.MimeTypeMap;
|
||||||
import android.widget.FrameLayout;
|
import android.widget.FrameLayout;
|
||||||
|
|
||||||
|
import androidx.annotation.RequiresApi;
|
||||||
|
|
||||||
import com.google.android.exoplayer2.C;
|
import com.google.android.exoplayer2.C;
|
||||||
import com.google.android.exoplayer2.ExoPlayer;
|
import com.google.android.exoplayer2.ExoPlayer;
|
||||||
import com.google.android.exoplayer2.ui.AspectRatioFrameLayout;
|
import com.google.android.exoplayer2.ui.AspectRatioFrameLayout;
|
||||||
|
@ -95,6 +99,7 @@ import java.nio.channels.FileChannel;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Timer;
|
import java.util.Timer;
|
||||||
import java.util.TimerTask;
|
import java.util.TimerTask;
|
||||||
|
@ -1623,10 +1628,7 @@ public class MediaController implements AudioManager.OnAudioFocusChangeListener,
|
||||||
if (raisedToBack == minCount || accelerometerVertical) {
|
if (raisedToBack == minCount || accelerometerVertical) {
|
||||||
lastAccelerometerDetected = System.currentTimeMillis();
|
lastAccelerometerDetected = System.currentTimeMillis();
|
||||||
}
|
}
|
||||||
if (proximityTouched && (raisedToBack == minCount || accelerometerVertical || System.currentTimeMillis() - lastAccelerometerDetected < 60) && !NotificationsController.audioManager.isWiredHeadsetOn()) {
|
if (proximityTouched && (raisedToBack == minCount || accelerometerVertical || System.currentTimeMillis() - lastAccelerometerDetected < 60) && !NotificationsController.audioManager.isWiredHeadsetOn() && !VoIPService.isAnyKindOfCallActive()) {
|
||||||
if (BuildVars.LOGS_ENABLED) {
|
|
||||||
FileLog.d("sensor values reached");
|
|
||||||
}
|
|
||||||
if (playingMessageObject == null && recordStartRunnable == null && recordingAudio == null && !PhotoViewer.getInstance().isVisible() && ApplicationLoader.isScreenOn && !inputFieldHasText && allowStartRecord && raiseChat != null && !callInProgress) {
|
if (playingMessageObject == null && recordStartRunnable == null && recordingAudio == null && !PhotoViewer.getInstance().isVisible() && ApplicationLoader.isScreenOn && !inputFieldHasText && allowStartRecord && raiseChat != null && !callInProgress) {
|
||||||
if (!raiseToEarRecord) {
|
if (!raiseToEarRecord) {
|
||||||
if (BuildVars.LOGS_ENABLED) {
|
if (BuildVars.LOGS_ENABLED) {
|
||||||
|
@ -1663,7 +1665,7 @@ public class MediaController implements AudioManager.OnAudioFocusChangeListener,
|
||||||
raisedToTop = 0;
|
raisedToTop = 0;
|
||||||
raisedToTopSign = 0;
|
raisedToTopSign = 0;
|
||||||
countLess = 0;
|
countLess = 0;
|
||||||
} else if (proximityTouched && ((accelerometerSensor == null || linearSensor == null) && gravitySensor == null)) {
|
} else if (proximityTouched && ((accelerometerSensor == null || linearSensor == null) && gravitySensor == null) && !VoIPService.isAnyKindOfCallActive()) {
|
||||||
if (playingMessageObject != null && !ApplicationLoader.mainInterfacePaused && (playingMessageObject.isVoice() || playingMessageObject.isRoundVideo())) {
|
if (playingMessageObject != null && !ApplicationLoader.mainInterfacePaused && (playingMessageObject.isVoice() || playingMessageObject.isRoundVideo())) {
|
||||||
if (!useFrontSpeaker && !NotificationsController.audioManager.isWiredHeadsetOn()) {
|
if (!useFrontSpeaker && !NotificationsController.audioManager.isWiredHeadsetOn()) {
|
||||||
if (BuildVars.LOGS_ENABLED) {
|
if (BuildVars.LOGS_ENABLED) {
|
||||||
|
|
|
@ -1546,6 +1546,9 @@ public class ActionBarLayout extends FrameLayout implements INavigationLayout, F
|
||||||
parent.removeView(fragmentView);
|
parent.removeView(fragmentView);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!fragment.hasOwnBackground && fragmentView.getBackground() == null) {
|
||||||
|
fragmentView.setBackgroundColor(Theme.getColor(Theme.key_windowBackgroundWhite));
|
||||||
|
}
|
||||||
containerView.addView(fragmentView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT));
|
containerView.addView(fragmentView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT));
|
||||||
if (fragment.actionBar != null && fragment.actionBar.shouldAddToContainer()) {
|
if (fragment.actionBar != null && fragment.actionBar.shouldAddToContainer()) {
|
||||||
if (removeActionBarExtraHeight) {
|
if (removeActionBarExtraHeight) {
|
||||||
|
|
|
@ -984,5 +984,10 @@ public class ReactionsLayoutInBubble {
|
||||||
VisibleReaction that = (VisibleReaction) o;
|
VisibleReaction that = (VisibleReaction) o;
|
||||||
return documentId == that.documentId && Objects.equals(emojicon, that.emojicon);
|
return documentId == that.documentId && Objects.equals(emojicon, that.emojicon);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return Objects.hash(emojicon, documentId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -977,7 +977,7 @@ public class ReactionsContainerLayout extends FrameLayout implements Notificatio
|
||||||
allReactionsAvailable = true;
|
allReactionsAvailable = true;
|
||||||
fillRecentReactionsList(visibleReactions);
|
fillRecentReactionsList(visibleReactions);
|
||||||
}
|
}
|
||||||
|
filterReactions(visibleReactions);
|
||||||
setVisibleReactionsList(visibleReactions);
|
setVisibleReactionsList(visibleReactions);
|
||||||
|
|
||||||
if (message.messageOwner.reactions != null && message.messageOwner.reactions.results != null) {
|
if (message.messageOwner.reactions != null && message.messageOwner.reactions.results != null) {
|
||||||
|
@ -989,6 +989,17 @@ public class ReactionsContainerLayout extends FrameLayout implements Notificatio
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void filterReactions(List<ReactionsLayoutInBubble.VisibleReaction> visibleReactions) {
|
||||||
|
HashSet<ReactionsLayoutInBubble.VisibleReaction> set = new HashSet<>();
|
||||||
|
for (int i = 0; i < visibleReactions.size(); i++) {
|
||||||
|
if (set.contains(visibleReactions.get(i))) {
|
||||||
|
i--;
|
||||||
|
visibleReactions.remove(i);
|
||||||
|
}
|
||||||
|
set.add(visibleReactions.get(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void fillRecentReactionsList(List<ReactionsLayoutInBubble.VisibleReaction> visibleReactions) {
|
private void fillRecentReactionsList(List<ReactionsLayoutInBubble.VisibleReaction> visibleReactions) {
|
||||||
if (!allReactionsAvailable) {
|
if (!allReactionsAvailable) {
|
||||||
//fill default reactions
|
//fill default reactions
|
||||||
|
|
|
@ -11,6 +11,7 @@ package org.telegram.ui.Components;
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.graphics.SurfaceTexture;
|
import android.graphics.SurfaceTexture;
|
||||||
|
import android.media.AudioManager;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
|
@ -501,13 +502,13 @@ public class VideoPlayer implements Player.Listener, VideoListener, AnalyticsLis
|
||||||
public void setStreamType(int type) {
|
public void setStreamType(int type) {
|
||||||
if (player != null) {
|
if (player != null) {
|
||||||
player.setAudioAttributes(new AudioAttributes.Builder()
|
player.setAudioAttributes(new AudioAttributes.Builder()
|
||||||
.setContentType(type)
|
.setUsage(type == AudioManager.STREAM_VOICE_CALL ? C.USAGE_VOICE_COMMUNICATION : C.USAGE_MEDIA)
|
||||||
.build(), false);
|
.build(), false);
|
||||||
}
|
}
|
||||||
if (audioPlayer != null) {
|
if (audioPlayer != null) {
|
||||||
audioPlayer.setAudioAttributes(new AudioAttributes.Builder()
|
audioPlayer.setAudioAttributes(new AudioAttributes.Builder()
|
||||||
.setContentType(type)
|
.setUsage(type == AudioManager.STREAM_VOICE_CALL ? C.USAGE_VOICE_COMMUNICATION : C.USAGE_MEDIA)
|
||||||
.build(), false);
|
.build(), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1077,7 +1077,7 @@ public class LaunchActivity extends BasePermissionsActivity implements INavigati
|
||||||
}
|
}
|
||||||
|
|
||||||
private BaseFragment getClientNotActivatedFragment() {
|
private BaseFragment getClientNotActivatedFragment() {
|
||||||
if (LoginActivity.loadCurrentState(false).getInt("currentViewNum", 0) != 0) {
|
if (LoginActivity.loadCurrentState(false, currentAccount).getInt("currentViewNum", 0) != 0) {
|
||||||
return new LoginActivity();
|
return new LoginActivity();
|
||||||
}
|
}
|
||||||
return new IntroActivity();
|
return new IntroActivity();
|
||||||
|
@ -2977,7 +2977,9 @@ public class LaunchActivity extends BasePermissionsActivity implements INavigati
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (SharedConfig.useLNavigation) {
|
||||||
actionBarLayout.rebuildFragments(INavigationLayout.REBUILD_FLAG_REBUILD_LAST);
|
actionBarLayout.rebuildFragments(INavigationLayout.REBUILD_FLAG_REBUILD_LAST);
|
||||||
|
}
|
||||||
if (AndroidUtilities.isTablet()) {
|
if (AndroidUtilities.isTablet()) {
|
||||||
layersActionBarLayout.rebuildFragments(INavigationLayout.REBUILD_FLAG_REBUILD_LAST);
|
layersActionBarLayout.rebuildFragments(INavigationLayout.REBUILD_FLAG_REBUILD_LAST);
|
||||||
rightActionBarLayout.rebuildFragments(INavigationLayout.REBUILD_FLAG_REBUILD_LAST);
|
rightActionBarLayout.rebuildFragments(INavigationLayout.REBUILD_FLAG_REBUILD_LAST);
|
||||||
|
|
|
@ -589,7 +589,7 @@ public class LoginActivity extends BaseFragment {
|
||||||
slideViewsContainer.addView(views[a], LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT, Gravity.CENTER, AndroidUtilities.isTablet() ? 26 : 18, 30, AndroidUtilities.isTablet() ? 26 : 18, 0));
|
slideViewsContainer.addView(views[a], LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT, Gravity.CENTER, AndroidUtilities.isTablet() ? 26 : 18, 30, AndroidUtilities.isTablet() ? 26 : 18, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
Bundle savedInstanceState = activityMode == MODE_LOGIN ? loadCurrentState(newAccount) : null;
|
Bundle savedInstanceState = activityMode == MODE_LOGIN ? loadCurrentState(newAccount, currentAccount) : null;
|
||||||
if (savedInstanceState != null) {
|
if (savedInstanceState != null) {
|
||||||
currentViewNum = savedInstanceState.getInt("currentViewNum", 0);
|
currentViewNum = savedInstanceState.getInt("currentViewNum", 0);
|
||||||
syncContacts = savedInstanceState.getInt("syncContacts", 1) == 1;
|
syncContacts = savedInstanceState.getInt("syncContacts", 1) == 1;
|
||||||
|
@ -873,13 +873,10 @@ public class LoginActivity extends BaseFragment {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Bundle loadCurrentState(boolean newAccount) {
|
public static Bundle loadCurrentState(boolean newAccount, int currentAccount) {
|
||||||
if (newAccount) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
try {
|
try {
|
||||||
Bundle bundle = new Bundle();
|
Bundle bundle = new Bundle();
|
||||||
SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("logininfo2", Context.MODE_PRIVATE);
|
SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("logininfo2" + (newAccount ? "_" + currentAccount : ""), Context.MODE_PRIVATE);
|
||||||
Map<String, ?> params = preferences.getAll();
|
Map<String, ?> params = preferences.getAll();
|
||||||
for (Map.Entry<String, ?> entry : params.entrySet()) {
|
for (Map.Entry<String, ?> entry : params.entrySet()) {
|
||||||
String key = entry.getKey();
|
String key = entry.getKey();
|
||||||
|
@ -916,7 +913,7 @@ public class LoginActivity extends BaseFragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void clearCurrentState() {
|
private void clearCurrentState() {
|
||||||
SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("logininfo2", Context.MODE_PRIVATE);
|
SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("logininfo2" + (newAccount ? "_" + currentAccount : ""), Context.MODE_PRIVATE);
|
||||||
SharedPreferences.Editor editor = preferences.edit();
|
SharedPreferences.Editor editor = preferences.edit();
|
||||||
editor.clear();
|
editor.clear();
|
||||||
editor.commit();
|
editor.commit();
|
||||||
|
@ -1529,7 +1526,7 @@ public class LoginActivity extends BaseFragment {
|
||||||
v.saveStateParams(bundle);
|
v.saveStateParams(bundle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("logininfo2", Context.MODE_PRIVATE);
|
SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("logininfo2" + (newAccount ? "_" + currentAccount : ""), Context.MODE_PRIVATE);
|
||||||
SharedPreferences.Editor editor = preferences.edit();
|
SharedPreferences.Editor editor = preferences.edit();
|
||||||
editor.clear();
|
editor.clear();
|
||||||
putBundleToEditor(bundle, editor, null);
|
putBundleToEditor(bundle, editor, null);
|
||||||
|
@ -3475,7 +3472,10 @@ public class LoginActivity extends BaseFragment {
|
||||||
timeText.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 15);
|
timeText.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 15);
|
||||||
timeText.setGravity(Gravity.TOP | Gravity.CENTER_HORIZONTAL);
|
timeText.setGravity(Gravity.TOP | Gravity.CENTER_HORIZONTAL);
|
||||||
timeText.setOnClickListener(v-> {
|
timeText.setOnClickListener(v-> {
|
||||||
if (isRequestingFirebaseSms || isResendingCode) {
|
// if (isRequestingFirebaseSms || isResendingCode) {
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
if (time > 0 && timeTimer != null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
isResendingCode = true;
|
isResendingCode = true;
|
||||||
|
@ -3994,9 +3994,11 @@ public class LoginActivity extends BaseFragment {
|
||||||
if (currentType == AUTH_TYPE_MESSAGE) {
|
if (currentType == AUTH_TYPE_MESSAGE) {
|
||||||
setProblemTextVisible(true);
|
setProblemTextVisible(true);
|
||||||
timeText.setVisibility(GONE);
|
timeText.setVisibility(GONE);
|
||||||
|
problemText.setVisibility(VISIBLE);
|
||||||
} else if (currentType == AUTH_TYPE_FLASH_CALL && (nextType == AUTH_TYPE_CALL || nextType == AUTH_TYPE_SMS)) {
|
} else if (currentType == AUTH_TYPE_FLASH_CALL && (nextType == AUTH_TYPE_CALL || nextType == AUTH_TYPE_SMS)) {
|
||||||
setProblemTextVisible(false);
|
setProblemTextVisible(false);
|
||||||
timeText.setVisibility(VISIBLE);
|
timeText.setVisibility(VISIBLE);
|
||||||
|
problemText.setVisibility(GONE);
|
||||||
if (nextType == AUTH_TYPE_CALL || nextType == AUTH_TYPE_MISSED_CALL) {
|
if (nextType == AUTH_TYPE_CALL || nextType == AUTH_TYPE_MISSED_CALL) {
|
||||||
timeText.setText(LocaleController.formatString("CallAvailableIn", R.string.CallAvailableIn, 1, 0));
|
timeText.setText(LocaleController.formatString("CallAvailableIn", R.string.CallAvailableIn, 1, 0));
|
||||||
} else if (nextType == AUTH_TYPE_SMS) {
|
} else if (nextType == AUTH_TYPE_SMS) {
|
||||||
|
@ -4014,6 +4016,7 @@ public class LoginActivity extends BaseFragment {
|
||||||
timeText.setText(LocaleController.formatString("CallAvailableIn", R.string.CallAvailableIn, 2, 0));
|
timeText.setText(LocaleController.formatString("CallAvailableIn", R.string.CallAvailableIn, 2, 0));
|
||||||
setProblemTextVisible(time < 1000);
|
setProblemTextVisible(time < 1000);
|
||||||
timeText.setVisibility(time < 1000 ? GONE : VISIBLE);
|
timeText.setVisibility(time < 1000 ? GONE : VISIBLE);
|
||||||
|
problemText.setVisibility(time < 1000 ? VISIBLE : GONE);
|
||||||
|
|
||||||
SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig", Activity.MODE_PRIVATE);
|
SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig", Activity.MODE_PRIVATE);
|
||||||
String hash = preferences.getString("sms_hash", null);
|
String hash = preferences.getString("sms_hash", null);
|
||||||
|
@ -4036,9 +4039,11 @@ public class LoginActivity extends BaseFragment {
|
||||||
timeText.setText(LocaleController.formatString("SmsAvailableIn", R.string.SmsAvailableIn, 2, 0));
|
timeText.setText(LocaleController.formatString("SmsAvailableIn", R.string.SmsAvailableIn, 2, 0));
|
||||||
setProblemTextVisible(time < 1000);
|
setProblemTextVisible(time < 1000);
|
||||||
timeText.setVisibility(time < 1000 ? GONE : VISIBLE);
|
timeText.setVisibility(time < 1000 ? GONE : VISIBLE);
|
||||||
|
problemText.setVisibility(time < 1000 ? VISIBLE : GONE);
|
||||||
createTimer();
|
createTimer();
|
||||||
} else {
|
} else {
|
||||||
timeText.setVisibility(GONE);
|
timeText.setVisibility(GONE);
|
||||||
|
problemText.setVisibility(VISIBLE);
|
||||||
setProblemTextVisible(false);
|
setProblemTextVisible(false);
|
||||||
createCodeTimer();
|
createCodeTimer();
|
||||||
}
|
}
|
||||||
|
@ -4090,6 +4095,7 @@ public class LoginActivity extends BaseFragment {
|
||||||
if (codeTime <= 1000) {
|
if (codeTime <= 1000) {
|
||||||
setProblemTextVisible(true);
|
setProblemTextVisible(true);
|
||||||
timeText.setVisibility(GONE);
|
timeText.setVisibility(GONE);
|
||||||
|
problemText.setVisibility(VISIBLE);
|
||||||
destroyCodeTimer();
|
destroyCodeTimer();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -5889,6 +5895,10 @@ public class LoginActivity extends BaseFragment {
|
||||||
|
|
||||||
showKeyboard(codeFieldContainer.codeField[0]);
|
showKeyboard(codeFieldContainer.codeField[0]);
|
||||||
codeFieldContainer.requestFocus();
|
codeFieldContainer.requestFocus();
|
||||||
|
|
||||||
|
if (!restore && params.containsKey("nextType")) {
|
||||||
|
AndroidUtilities.runOnUIThread(resendCodeTimeout, params.getInt("timeout"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onPasscodeError(boolean clear) {
|
private void onPasscodeError(boolean clear) {
|
||||||
|
@ -6141,8 +6151,6 @@ public class LoginActivity extends BaseFragment {
|
||||||
codeFieldContainer.setText("");
|
codeFieldContainer.setText("");
|
||||||
codeFieldContainer.codeField[0].requestFocus();
|
codeFieldContainer.codeField[0].requestFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
AndroidUtilities.runOnUIThread(resendCodeTimeout, 60000);
|
|
||||||
}, SHOW_DELAY);
|
}, SHOW_DELAY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1142,10 +1142,14 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
FileLog.e(e);
|
FileLog.e(e);
|
||||||
AndroidUtilities.runOnUIThread(() -> {
|
AndroidUtilities.runOnUIThread(() -> {
|
||||||
|
try {
|
||||||
RecyclerListView innerListView = sharedMediaLayout.getCurrentListView();
|
RecyclerListView innerListView = sharedMediaLayout.getCurrentListView();
|
||||||
if (innerListView != null && innerListView.getAdapter() != null) {
|
if (innerListView != null && innerListView.getAdapter() != null) {
|
||||||
innerListView.getAdapter().notifyDataSetChanged();
|
innerListView.getAdapter().notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
|
} catch (Throwable e2) {
|
||||||
|
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,6 @@ import static org.webrtc.MediaCodecUtils.QCOM_PREFIX;
|
||||||
|
|
||||||
import android.media.MediaCodecInfo;
|
import android.media.MediaCodecInfo;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.util.Log;
|
|
||||||
|
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
|
@ -162,20 +161,24 @@ public class HardwareVideoEncoderFactory implements VideoEncoderFactory {
|
||||||
private @Nullable MediaCodecInfo findCodecForType(VideoCodecMimeType type) {
|
private @Nullable MediaCodecInfo findCodecForType(VideoCodecMimeType type) {
|
||||||
ArrayList<MediaCodecInfo> infos = MediaCodecUtils.getSortedCodecsList();
|
ArrayList<MediaCodecInfo> infos = MediaCodecUtils.getSortedCodecsList();
|
||||||
int count = infos.size();
|
int count = infos.size();
|
||||||
|
MediaCodecInfo info2 = null;
|
||||||
for (int i = 0; i < count; ++i) {
|
for (int i = 0; i < count; ++i) {
|
||||||
MediaCodecInfo info = infos.get(i);
|
MediaCodecInfo info = infos.get(i);
|
||||||
if (info == null || !info.isEncoder()) {
|
if (info == null || !info.isEncoder()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (isSupportedCodec(info, type)) {
|
if (isSupportedCodec(info, type, true)) {
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
if (isSupportedCodec(info, type, false)) {
|
||||||
|
info2 = info;
|
||||||
}
|
}
|
||||||
return null; // No support for this type.
|
}
|
||||||
|
return info2; // No support for this type.
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns true if the given MediaCodecInfo indicates a supported encoder for the given type.
|
// Returns true if the given MediaCodecInfo indicates a supported encoder for the given type.
|
||||||
private boolean isSupportedCodec(MediaCodecInfo info, VideoCodecMimeType type) {
|
private boolean isSupportedCodec(MediaCodecInfo info, VideoCodecMimeType type, boolean isHardwareSupportedInSdk) {
|
||||||
if (!MediaCodecUtils.codecSupportsType(info, type)) {
|
if (!MediaCodecUtils.codecSupportsType(info, type)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -185,7 +188,7 @@ public class HardwareVideoEncoderFactory implements VideoEncoderFactory {
|
||||||
== null) {
|
== null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return isHardwareSupportedInCurrentSdk(info, type) && isMediaCodecAllowed(info);
|
return (!isHardwareSupportedInSdk || isHardwareSupportedInCurrentSdk(info, type)) && isMediaCodecAllowed(info);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns true if the given MediaCodecInfo indicates a hardware module that is supported on the
|
// Returns true if the given MediaCodecInfo indicates a hardware module that is supported on the
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<paths>
|
<paths>
|
||||||
<external-path name="media" path="."/>
|
<external-path name="media" path="."/>
|
||||||
|
<files-path name="logs" path="/logs/"/>
|
||||||
|
<files-path name="cache" path="/cache/"/>
|
||||||
<root-path name="external_files" path="/storage/" />
|
<root-path name="external_files" path="/storage/" />
|
||||||
</paths>
|
</paths>
|
|
@ -13,8 +13,8 @@
|
||||||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
||||||
# org.gradle.parallel=true
|
# org.gradle.parallel=true
|
||||||
#Sat Mar 12 05:53:50 MSK 2016
|
#Sat Mar 12 05:53:50 MSK 2016
|
||||||
APP_VERSION_NAME=9.4.6
|
APP_VERSION_NAME=9.4.7
|
||||||
APP_VERSION_CODE=3155
|
APP_VERSION_CODE=3160
|
||||||
APP_PACKAGE=org.telegram.messenger
|
APP_PACKAGE=org.telegram.messenger
|
||||||
RELEASE_KEY_PASSWORD=android
|
RELEASE_KEY_PASSWORD=android
|
||||||
RELEASE_KEY_ALIAS=androidkey
|
RELEASE_KEY_ALIAS=androidkey
|
||||||
|
|
Loading…
Reference in a new issue