OSDN Git Service

Update settings to reference correct versionCode
authorPatrick Baumann <patb@google.com>
Wed, 4 Apr 2018 20:17:05 +0000 (13:17 -0700)
committerPatrick Baumann <patb@google.com>
Wed, 4 Apr 2018 20:17:05 +0000 (13:17 -0700)
This settings change is required for a framework change that ensures
that apps built for pre-P that rely on reflection to access
ApplicationInfo#versionCode don't crash. The move to long version
code introduces a new field and all modifications of the field are
wrapped in a method that ensures both the new and old fields are set
appropriately.

Bug: 74393568
Test: manual - builds and broken app runs
Change-Id: Idfa5f85d3f91583098ebee88f0e8caecaacff9b4

src/com/android/settings/search/IndexDatabaseHelper.java

index 7073545..5b47616 100644 (file)
@@ -255,7 +255,7 @@ public class IndexDatabaseHelper extends SQLiteOpenHelper {
         for (ResolveInfo info : providers) {
             sb.append(info.providerInfo.packageName)
                     .append(':')
-                    .append(info.providerInfo.applicationInfo.versionCode)
+                    .append(info.providerInfo.applicationInfo.longVersionCode)
                     .append(',');
         }
         return sb.toString();