Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7be87f77 authored by kaiyiz's avatar kaiyiz Committed by cretin45
Browse files

Gallery2: Set default value for server timeout

The timeout of server is not set when read from flag of SERVER_TIMEOUT,
the value will stay to be -1, as a result there will be no resume dialog

Set a default value of 3 min for resume timeout

CRs-Fixed: 753834

Change-Id: Icd4640c4b56a64857dfade1bb8d7a3581494d404
parent 98b9fb07
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1268,6 +1268,7 @@ public class MoviePlayer implements
        private long mLastDisconnectTime;
        private boolean mIsShowDialog = false;
        private AlertDialog mServerTimeoutDialog;
        private int RESUME_DIALOG_TIMEOUT = 3 * 60 * 1000; // 3 mins

        // check whether disconnect from server timeout or not.
        // if timeout, return false. otherwise, return true.
@@ -1390,8 +1391,12 @@ public class MoviePlayer implements
        }

        public void setVideoInfo(Metadata data) {
            mServerTimeout = RESUME_DIALOG_TIMEOUT;
            if (data.has(SERVER_TIMEOUT)) {
                mServerTimeout = data.getInt(SERVER_TIMEOUT);
                if (mServerTimeout == 0) {
                    mServerTimeout = RESUME_DIALOG_TIMEOUT;
                }
                if (LOG) {
                    Log.v(TAG, "get server timeout from metadata. mServerTimeout="
                            + mServerTimeout);