Update to 5.14.0 (1847)

This commit is contained in:
DrKLO 2020-01-23 15:58:50 +03:00
parent 30d603778d
commit 29aa3efe1e
10 changed files with 3144 additions and 3137 deletions

View file

@ -278,12 +278,12 @@ android {
manifest.srcFile 'config/release/AndroidManifest_SDK23.xml'
}
ext {
abiVersionCode = 0
abiVersionCode = 9
}
}
}
defaultConfig.versionCode = 1846
defaultConfig.versionCode = 1847
applicationVariants.all { variant ->
variant.outputs.all { output ->

View file

@ -533,9 +533,7 @@ int32_t ConnectionSocket::checkSocketError(int32_t *error) {
void ConnectionSocket::closeSocket(int32_t reason, int32_t error) {
lastEventTime = ConnectionsManager::getInstance(instanceNum).getCurrentTimeMonotonicMillis();
if (reason != 2) {
ConnectionsManager::getInstance(instanceNum).detachConnection(this);
}
if (socketFd >= 0) {
epoll_ctl(ConnectionsManager::getInstance(instanceNum).epolFd, EPOLL_CTL_DEL, socketFd, nullptr);
if (close(socketFd) != 0) {

View file

@ -197,12 +197,10 @@ void ConnectionsManager::select() {
EventObject *eventObject = (EventObject *) epollEvents[a].data.ptr;
eventObject->onEvent(epollEvents[a].events);
}
for (std::vector<ConnectionSocket *>::iterator iter = activeConnections.begin(); iter != activeConnections.end();) {
if ((*iter)->checkTimeout(now)) {
iter = activeConnections.erase(iter);
} else {
iter++;
}
activeConnectionsCopy.resize(activeConnections.size());
std::copy(std::begin(activeConnections), std::end(activeConnections), std::begin(activeConnectionsCopy));
for (auto connection : activeConnectionsCopy) {
connection->checkTimeout(now);
}
Datacenter *datacenter = getDatacenterWithId(currentDatacenterId);

View file

@ -191,6 +191,7 @@ private:
bool networkSlow = false;
bool ipv6Enabled = false;
std::vector<ConnectionSocket *> activeConnections;
std::vector<ConnectionSocket *> activeConnectionsCopy;
int epolFd;
int eventFd;
int *pipeFd;

View file

@ -19,7 +19,7 @@ public class BuildVars {
public static boolean USE_CLOUD_STRINGS = true;
public static boolean CHECK_UPDATES = true;
public static boolean TON_WALLET_STANDALONE = false;
public static int BUILD_VERSION = 1846;
public static int BUILD_VERSION = 1847;
public static String BUILD_VERSION_STRING = "5.14.0";
public static int APP_ID = 4;
public static String APP_HASH = "014b35b6184100b085b0d0572f9b5103";

View file

@ -496,11 +496,20 @@ public class ConnectionsManager extends BaseController {
}
public static int getInitFlags() {
int flags = 0;
EmuDetector detector = EmuDetector.with(ApplicationLoader.applicationContext);
if (detector.detect()) {
return 1024;
flags |= 1024;
}
return 0;
try {
String installer = ApplicationLoader.applicationContext.getPackageManager().getInstallerPackageName(ApplicationLoader.applicationContext.getPackageName());
if ("com.android.vending".equals(installer)) {
flags |= 2048;
}
} catch (Throwable ignore) {
}
return flags;
}
public static void onBytesSent(int amount, int networkType, final int currentAccount) {

View file

@ -12407,15 +12407,18 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
public void onAnimationUpdate(ValueAnimator animation) {
float translationY = (float) animation.getAnimatedValue();
if (!wasManualScroll && unreadMessageObject != null && chatListView != null) {
if (position < 0 || position >= chatAdapter.getItemCount() || messages.get(position - chatAdapter.messagesStartRow) != unreadMessageObject) {
int msgIndex = position - chatAdapter.messagesStartRow;
if (msgIndex < 0 || msgIndex >= messages.size() || messages.get(msgIndex) != unreadMessageObject) {
position = chatAdapter.messagesStartRow + messages.indexOf(unreadMessageObject);
}
if (position >= 0) {
View v = chatLayoutManager.findViewByPosition(position);
float top = pinnedMessageView.getBottom() + translationY - chatListView.getTop();
if (v != null && top > v.getTop() + AndroidUtilities.dp(9)) {
chatListView.scrollBy(0, (int) (v.getTop() + AndroidUtilities.dp(9) - top));
}
}
}
pinnedMessageView.setTranslationY(translationY);
}
});

View file

@ -177,13 +177,15 @@ public class RecyclerAnimationScrollHelper {
}
child.setTranslationY(0);
}
if (animationCallback != null) {
animationCallback.onEndAnimation();
}
if (finalAnimatableAdapter != null) {
finalAnimatableAdapter.onAnimationEnd();
}
if (animationCallback != null) {
animationCallback.onEndAnimation();
}
animator = null;
}
});
@ -264,7 +266,7 @@ public class RecyclerAnimationScrollHelper {
if (!animationRunning) {
super.notifyDataSetChanged();
} else {
shouldNotifyDataSetChanged = false;
shouldNotifyDataSetChanged = true;
}
}
@ -297,20 +299,8 @@ public class RecyclerAnimationScrollHelper {
public void onAnimationEnd() {
animationRunning = false;
if (shouldNotifyDataSetChanged) {
if (shouldNotifyDataSetChanged || !rangeInserted.isEmpty() || !rangeRemoved.isEmpty()) {
notifyDataSetChanged();
} else {
if (!rangeInserted.isEmpty()) {
for (int i = 0; i < rangeInserted.size(); i += 2) {
notifyItemRangeInserted(rangeInserted.get(i), rangeInserted.get(i + 1));
}
}
if (!rangeRemoved.isEmpty()) {
for (int i = 0; i < rangeRemoved.size(); i += 2) {
notifyItemRangeRemoved(rangeRemoved.get(i), rangeRemoved.get(i + 1));
}
}
}
}
}

View file

@ -712,8 +712,9 @@ public class PollCreateActivity extends BaseFragment {
RecyclerView.ViewHolder holder = listView.findContainingViewHolder(p);
if (holder != null) {
int position = holder.getAdapterPosition();
if (position != RecyclerView.NO_POSITION) {
int index = position - answerStartRow;
listAdapter.notifyItemRemoved(holder.getAdapterPosition());
listAdapter.notifyItemRemoved(position);
System.arraycopy(answers, index + 1, answers, index, answers.length - 1 - index);
System.arraycopy(answersChecks, index + 1, answersChecks, index, answersChecks.length - 1 - index);
answers[answers.length - 1] = null;
@ -735,6 +736,7 @@ public class PollCreateActivity extends BaseFragment {
updateRows();
listAdapter.notifyItemChanged(answerSectionRow);
}
}
}) {
@Override
protected boolean drawDivider() {
@ -772,9 +774,11 @@ public class PollCreateActivity extends BaseFragment {
RecyclerView.ViewHolder holder = listView.findContainingViewHolder(editText);
if (holder != null) {
int position = holder.getAdapterPosition();
if (position != RecyclerView.NO_POSITION) {
int index = position - answerStartRow;
answersChecks[index] = checked;
}
}
checkDoneButton();
}
@ -783,9 +787,11 @@ public class PollCreateActivity extends BaseFragment {
RecyclerView.ViewHolder holder = listView.findContainingViewHolder(editText);
if (holder != null) {
int position = holder.getAdapterPosition();
if (position != RecyclerView.NO_POSITION) {
int index = position - answerStartRow;
return answersChecks[index];
}
}
return false;
}
};
@ -824,6 +830,7 @@ public class PollCreateActivity extends BaseFragment {
RecyclerView.ViewHolder holder = listView.findContainingViewHolder(cell);
if (holder != null) {
int position = holder.getAdapterPosition();
if (position != RecyclerView.NO_POSITION) {
int index = position - answerStartRow;
if (index == answersCount - 1 && answersCount < 10) {
addNewField();
@ -839,6 +846,7 @@ public class PollCreateActivity extends BaseFragment {
}
}
}
}
return true;
}
return false;

File diff suppressed because it is too large Load diff