Loading src/com/android/packageinstaller/wear/WearPackageArgs.java +6 −0 Original line number Diff line number Diff line Loading @@ -45,6 +45,8 @@ public class WearPackageArgs { "com.google.android.clockwork.EXTRA_KEY_COMPANION_DEVICE_VERSION"; private static final String KEY_SHOULD_CHECK_GMS_DEPENDENCY = "com.google.android.clockwork.EXTRA_KEY_SHOULD_CHECK_GMS_DEPENDENCY"; private static final String KEY_SKIP_IF_LOWER_VERSION = "com.google.android.clockwork.EXTRA_SKIP_IF_LOWER_VERSION"; public static String getPackageName(Bundle b) { return b.getString(KEY_PACKAGE_NAME); Loading Loading @@ -87,6 +89,10 @@ public class WearPackageArgs { return b.getInt(KEY_START_ID); } public static boolean skipIfLowerVersion(Bundle b) { return b.getBoolean(KEY_SKIP_IF_LOWER_VERSION, false); } public static Bundle setStartId(Bundle b, int startId) { b.putInt(KEY_START_ID, startId); return b; Loading src/com/android/packageinstaller/wear/WearPackageInstallerService.java +14 −4 Original line number Diff line number Diff line Loading @@ -195,13 +195,15 @@ public class WearPackageInstallerService extends Service { int companionSdkVersion = WearPackageArgs.getCompanionSdkVersion(argsBundle); int companionDeviceVersion = WearPackageArgs.getCompanionDeviceVersion(argsBundle); String compressionAlg = WearPackageArgs.getCompressionAlg(argsBundle); boolean skipIfLowerVersion = WearPackageArgs.skipIfLowerVersion(argsBundle); if (Log.isLoggable(TAG, Log.DEBUG)) { Log.d(TAG, "Installing package: " + packageName + ", assetUri: " + assetUri + ",permUri: " + permUri + ", startId: " + startId + ", checkPerms: " + checkPerms + ", skipIfSameVersion: " + skipIfSameVersion + ", compressionAlg: " + compressionAlg + ", companionSdkVersion: " + companionSdkVersion + ", companionDeviceVersion: " + companionDeviceVersion); companionSdkVersion + ", companionDeviceVersion: " + companionDeviceVersion + ", skipIfLowerVersion: " + skipIfLowerVersion); } final PackageManager pm = getPackageManager(); File tempFile = null; Loading Loading @@ -266,10 +268,18 @@ public class WearPackageInstallerService extends Service { ") is equal to existing app for " + packageName); } } else if (existingPkgInfo.versionCode > pkg.mVersionCode) { if (skipIfLowerVersion) { // Starting in Feldspar, we are not going to allow downgrades of any app. Log.w(TAG, "Version number of new app (" + pkg.mVersionCode + ") is lower than existing app ( " + existingPkgInfo.versionCode + ") for " + packageName + "; not installing due to versionCheck"); return; } else { Log.w(TAG, "Version number of new app (" + pkg.mVersionCode + ") is lower than existing app ( " + existingPkgInfo.versionCode + ") for " + packageName); } } // Following the Android Phone model, we should only check for permissions for any // newly defined perms. Loading Loading
src/com/android/packageinstaller/wear/WearPackageArgs.java +6 −0 Original line number Diff line number Diff line Loading @@ -45,6 +45,8 @@ public class WearPackageArgs { "com.google.android.clockwork.EXTRA_KEY_COMPANION_DEVICE_VERSION"; private static final String KEY_SHOULD_CHECK_GMS_DEPENDENCY = "com.google.android.clockwork.EXTRA_KEY_SHOULD_CHECK_GMS_DEPENDENCY"; private static final String KEY_SKIP_IF_LOWER_VERSION = "com.google.android.clockwork.EXTRA_SKIP_IF_LOWER_VERSION"; public static String getPackageName(Bundle b) { return b.getString(KEY_PACKAGE_NAME); Loading Loading @@ -87,6 +89,10 @@ public class WearPackageArgs { return b.getInt(KEY_START_ID); } public static boolean skipIfLowerVersion(Bundle b) { return b.getBoolean(KEY_SKIP_IF_LOWER_VERSION, false); } public static Bundle setStartId(Bundle b, int startId) { b.putInt(KEY_START_ID, startId); return b; Loading
src/com/android/packageinstaller/wear/WearPackageInstallerService.java +14 −4 Original line number Diff line number Diff line Loading @@ -195,13 +195,15 @@ public class WearPackageInstallerService extends Service { int companionSdkVersion = WearPackageArgs.getCompanionSdkVersion(argsBundle); int companionDeviceVersion = WearPackageArgs.getCompanionDeviceVersion(argsBundle); String compressionAlg = WearPackageArgs.getCompressionAlg(argsBundle); boolean skipIfLowerVersion = WearPackageArgs.skipIfLowerVersion(argsBundle); if (Log.isLoggable(TAG, Log.DEBUG)) { Log.d(TAG, "Installing package: " + packageName + ", assetUri: " + assetUri + ",permUri: " + permUri + ", startId: " + startId + ", checkPerms: " + checkPerms + ", skipIfSameVersion: " + skipIfSameVersion + ", compressionAlg: " + compressionAlg + ", companionSdkVersion: " + companionSdkVersion + ", companionDeviceVersion: " + companionDeviceVersion); companionSdkVersion + ", companionDeviceVersion: " + companionDeviceVersion + ", skipIfLowerVersion: " + skipIfLowerVersion); } final PackageManager pm = getPackageManager(); File tempFile = null; Loading Loading @@ -266,10 +268,18 @@ public class WearPackageInstallerService extends Service { ") is equal to existing app for " + packageName); } } else if (existingPkgInfo.versionCode > pkg.mVersionCode) { if (skipIfLowerVersion) { // Starting in Feldspar, we are not going to allow downgrades of any app. Log.w(TAG, "Version number of new app (" + pkg.mVersionCode + ") is lower than existing app ( " + existingPkgInfo.versionCode + ") for " + packageName + "; not installing due to versionCheck"); return; } else { Log.w(TAG, "Version number of new app (" + pkg.mVersionCode + ") is lower than existing app ( " + existingPkgInfo.versionCode + ") for " + packageName); } } // Following the Android Phone model, we should only check for permissions for any // newly defined perms. Loading