From a44d2c2b6040de52d4c6d60ea8f998edb8985aed Mon Sep 17 00:00:00 2001 From: chris babcock Date: Wed, 29 May 2019 23:53:16 -0400 Subject: [PATCH] Fix version checked for OBB to always match manifest version code #android #rb trivial #ROBOMERGE-SOURCE: CL 6672175 via CL 6672194 via CL 6672197 via CL 6672201 via CL 6672203 via CL 6673471 #ROBOMERGE-BOT: (vundefined-6665479) [CL 6674115 by chris babcock in Main branch] --- .../Java/src/com/epicgames/ue4/GameActivity.java.template | 8 +++++--- .../GoogleVRHMD/Source/GoogleVRHMD/GoogleVRHMD_APL.xml | 2 +- .../UnrealBuildTool/Platform/Android/UEDeployAndroid.cs | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Engine/Build/Android/Java/src/com/epicgames/ue4/GameActivity.java.template b/Engine/Build/Android/Java/src/com/epicgames/ue4/GameActivity.java.template index 8a190c159761..c965563c77f9 100644 --- a/Engine/Build/Android/Java/src/com/epicgames/ue4/GameActivity.java.template +++ b/Engine/Build/Android/Java/src/com/epicgames/ue4/GameActivity.java.template @@ -223,6 +223,7 @@ public class GameActivity extends $${gameActivitySuperClass}$$ implements Surfac //$${gameActivityImplementsAdditions}$$ ComponentCallbacks2 { + public int VersionCode = 0; private boolean bAllowIMU = true; private SensorManager sensorManager; private Sensor accelerometer; @@ -2605,9 +2606,9 @@ public class GameActivity extends $${gameActivitySuperClass}$$ implements Surfac try { - int Version = getPackageManager().getPackageInfo(getPackageName(), 0).versionCode; + VersionCode = getPackageManager().getPackageInfo(getPackageName(), 0).versionCode; int PatchVersion = 0; - nativeSetObbInfo(ProjectName, getApplicationContext().getPackageName(), Version, PatchVersion, AppType); + nativeSetObbInfo(ProjectName, getApplicationContext().getPackageName(), VersionCode, PatchVersion, AppType); } catch (Exception e) { @@ -2652,6 +2653,7 @@ public class GameActivity extends $${gameActivitySuperClass}$$ implements Surfac // remember down time and position downTime = System.currentTimeMillis(); downX = event.getX(); + consoleInputBox.requestFocus(); return true; } case MotionEvent.ACTION_UP: { @@ -2795,7 +2797,7 @@ public class GameActivity extends $${gameActivitySuperClass}$$ implements Surfac // check for OBB file present if we don't have all the files and don't need to verify if (!HasAllFiles && !VerifyOBBOnStartUp) { - HasAllFiles = DownloadShim.expansionFilesDelivered(this); + HasAllFiles = DownloadShim.expansionFilesDelivered(this, VersionCode); } containerFrameLayout = new FrameLayout(_activity); diff --git a/Engine/Plugins/Runtime/GoogleVR/GoogleVRHMD/Source/GoogleVRHMD/GoogleVRHMD_APL.xml b/Engine/Plugins/Runtime/GoogleVR/GoogleVRHMD/Source/GoogleVRHMD/GoogleVRHMD_APL.xml index 996b1c31809a..8b62e51770ec 100644 --- a/Engine/Plugins/Runtime/GoogleVR/GoogleVRHMD/Source/GoogleVRHMD/GoogleVRHMD_APL.xml +++ b/Engine/Plugins/Runtime/GoogleVR/GoogleVRHMD/Source/GoogleVRHMD/GoogleVRHMD_APL.xml @@ -557,7 +557,7 @@ { if(!HasAllFiles) { - HasAllFiles = DownloadShim.expansionFilesDelivered(this); + HasAllFiles = DownloadShim.expansionFilesDelivered(this, VersionCode); } } diff --git a/Engine/Source/Programs/UnrealBuildTool/Platform/Android/UEDeployAndroid.cs b/Engine/Source/Programs/UnrealBuildTool/Platform/Android/UEDeployAndroid.cs index b8e540b041d9..a682148b5112 100644 --- a/Engine/Source/Programs/UnrealBuildTool/Platform/Android/UEDeployAndroid.cs +++ b/Engine/Source/Programs/UnrealBuildTool/Platform/Android/UEDeployAndroid.cs @@ -1037,9 +1037,9 @@ namespace UnrealBuildTool ShimFileContent.Append("\tpublic static Class GetDownloaderType() { return DownloaderActivity.class; }\n"); // Do OBB file checking without using DownloadActivity to avoid transit to another activity - ShimFileContent.Append("\tpublic static boolean expansionFilesDelivered(Activity activity) {\n"); + ShimFileContent.Append("\tpublic static boolean expansionFilesDelivered(Activity activity, int version) {\n"); ShimFileContent.Append("\t\tfor (OBBData.XAPKFile xf : OBBData.xAPKS) {\n"); - ShimFileContent.Append("\t\t\tString fileName = Helpers.getExpansionAPKFileName(activity, xf.mIsMain, xf.mFileVersion, OBBData.AppType);\n"); + ShimFileContent.Append("\t\t\tString fileName = Helpers.getExpansionAPKFileName(activity, xf.mIsMain, version, OBBData.AppType);\n"); ShimFileContent.Append("\t\t\tGameActivity.Log.debug(\"Checking for file : \" + fileName);\n"); ShimFileContent.Append("\t\t\tString fileForNewFile = Helpers.generateSaveFileName(activity, fileName);\n"); ShimFileContent.Append("\t\t\tString fileForDevFile = Helpers.generateSaveFileNameDevelopment(activity, fileName);\n");