Calin Juravle | b8976d8 | 2016-12-16 16:22:00 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2016 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License |
| 15 | */ |
| 16 | |
| 17 | package com.android.server.pm.dex; |
| 18 | |
Brett Chabot | 8091d9e | 2019-02-26 14:52:33 -0800 | [diff] [blame] | 19 | import static com.android.server.pm.dex.PackageDexUsage.DexUseInfo; |
| 20 | import static com.android.server.pm.dex.PackageDexUsage.PackageUseInfo; |
| 21 | |
| 22 | import static org.junit.Assert.assertEquals; |
| 23 | import static org.junit.Assert.assertFalse; |
| 24 | import static org.junit.Assert.assertNotNull; |
| 25 | import static org.junit.Assert.assertTrue; |
| 26 | import static org.mockito.ArgumentMatchers.any; |
| 27 | import static org.mockito.ArgumentMatchers.anyInt; |
| 28 | import static org.mockito.ArgumentMatchers.anyString; |
| 29 | import static org.mockito.Mockito.times; |
| 30 | import static org.mockito.Mockito.verify; |
| 31 | import static org.mockito.Mockito.when; |
| 32 | |
Calin Juravle | b8976d8 | 2016-12-16 16:22:00 +0000 | [diff] [blame] | 33 | import android.content.pm.ApplicationInfo; |
Alan Stokes | a002360 | 2017-10-16 12:31:44 +0100 | [diff] [blame] | 34 | import android.content.pm.IPackageManager; |
Calin Juravle | b8976d8 | 2016-12-16 16:22:00 +0000 | [diff] [blame] | 35 | import android.content.pm.PackageInfo; |
Calin Juravle | 99dd37b | 2017-02-22 19:05:06 -0800 | [diff] [blame] | 36 | import android.os.Build; |
| 37 | import android.os.UserHandle; |
Brett Chabot | 8091d9e | 2019-02-26 14:52:33 -0800 | [diff] [blame] | 38 | |
| 39 | import androidx.test.filters.SmallTest; |
| 40 | import androidx.test.runner.AndroidJUnit4; |
Calin Juravle | b8976d8 | 2016-12-16 16:22:00 +0000 | [diff] [blame] | 41 | |
Alan Stokes | a002360 | 2017-10-16 12:31:44 +0100 | [diff] [blame] | 42 | import com.android.server.pm.Installer; |
| 43 | |
Calin Juravle | f1ff36f | 2017-07-22 12:33:41 -0700 | [diff] [blame] | 44 | import dalvik.system.DelegateLastClassLoader; |
| 45 | import dalvik.system.PathClassLoader; |
Calin Juravle | b8976d8 | 2016-12-16 16:22:00 +0000 | [diff] [blame] | 46 | import dalvik.system.VMRuntime; |
| 47 | |
Calin Juravle | b8976d8 | 2016-12-16 16:22:00 +0000 | [diff] [blame] | 48 | import org.junit.Before; |
Alan Stokes | a002360 | 2017-10-16 12:31:44 +0100 | [diff] [blame] | 49 | import org.junit.Rule; |
Calin Juravle | b8976d8 | 2016-12-16 16:22:00 +0000 | [diff] [blame] | 50 | import org.junit.Test; |
| 51 | import org.junit.runner.RunWith; |
Alan Stokes | a002360 | 2017-10-16 12:31:44 +0100 | [diff] [blame] | 52 | import org.mockito.Mock; |
| 53 | import org.mockito.junit.MockitoJUnit; |
| 54 | import org.mockito.junit.MockitoRule; |
| 55 | import org.mockito.quality.Strictness; |
Calin Juravle | b8976d8 | 2016-12-16 16:22:00 +0000 | [diff] [blame] | 56 | |
Brett Chabot | 8091d9e | 2019-02-26 14:52:33 -0800 | [diff] [blame] | 57 | import java.io.File; |
| 58 | import java.util.ArrayList; |
| 59 | import java.util.Arrays; |
| 60 | import java.util.Collections; |
| 61 | import java.util.HashMap; |
| 62 | import java.util.List; |
| 63 | import java.util.Map; |
Calin Juravle | b8976d8 | 2016-12-16 16:22:00 +0000 | [diff] [blame] | 64 | |
| 65 | @RunWith(AndroidJUnit4.class) |
| 66 | @SmallTest |
| 67 | public class DexManagerTests { |
Calin Juravle | f1ff36f | 2017-07-22 12:33:41 -0700 | [diff] [blame] | 68 | private static final String PATH_CLASS_LOADER_NAME = PathClassLoader.class.getName(); |
| 69 | private static final String DELEGATE_LAST_CLASS_LOADER_NAME = |
| 70 | DelegateLastClassLoader.class.getName(); |
Alan Stokes | b6c3a60 | 2018-11-02 12:10:42 +0000 | [diff] [blame] | 71 | private static final String UNSUPPORTED_CLASS_LOADER_NAME = "unsupported.class_loader"; |
Calin Juravle | f1ff36f | 2017-07-22 12:33:41 -0700 | [diff] [blame] | 72 | |
Alan Stokes | a002360 | 2017-10-16 12:31:44 +0100 | [diff] [blame] | 73 | @Rule public MockitoRule mockito = MockitoJUnit.rule().strictness(Strictness.STRICT_STUBS); |
| 74 | @Mock Installer mInstaller; |
| 75 | @Mock IPackageManager mPM; |
| 76 | private final Object mInstallLock = new Object(); |
| 77 | @Mock DexManager.Listener mListener; |
| 78 | |
Calin Juravle | b8976d8 | 2016-12-16 16:22:00 +0000 | [diff] [blame] | 79 | private DexManager mDexManager; |
| 80 | |
| 81 | private TestData mFooUser0; |
| 82 | private TestData mBarUser0; |
| 83 | private TestData mBarUser1; |
| 84 | private TestData mInvalidIsa; |
| 85 | private TestData mDoesNotExist; |
| 86 | |
Calin Juravle | f1ff36f | 2017-07-22 12:33:41 -0700 | [diff] [blame] | 87 | private TestData mBarUser0UnsupportedClassLoader; |
| 88 | private TestData mBarUser0DelegateLastClassLoader; |
| 89 | |
Calin Juravle | b8976d8 | 2016-12-16 16:22:00 +0000 | [diff] [blame] | 90 | private int mUser0; |
| 91 | private int mUser1; |
Calin Juravle | 99dd37b | 2017-02-22 19:05:06 -0800 | [diff] [blame] | 92 | |
Calin Juravle | b8976d8 | 2016-12-16 16:22:00 +0000 | [diff] [blame] | 93 | @Before |
| 94 | public void setup() { |
Calin Juravle | b8976d8 | 2016-12-16 16:22:00 +0000 | [diff] [blame] | 95 | mUser0 = 0; |
| 96 | mUser1 = 1; |
| 97 | |
| 98 | String isa = VMRuntime.getInstructionSet(Build.SUPPORTED_ABIS[0]); |
| 99 | String foo = "foo"; |
| 100 | String bar = "bar"; |
| 101 | |
Calin Juravle | f1ff36f | 2017-07-22 12:33:41 -0700 | [diff] [blame] | 102 | mFooUser0 = new TestData(foo, isa, mUser0, PATH_CLASS_LOADER_NAME); |
| 103 | mBarUser0 = new TestData(bar, isa, mUser0, PATH_CLASS_LOADER_NAME); |
| 104 | mBarUser1 = new TestData(bar, isa, mUser1, PATH_CLASS_LOADER_NAME); |
Calin Juravle | b8976d8 | 2016-12-16 16:22:00 +0000 | [diff] [blame] | 105 | mInvalidIsa = new TestData("INVALID", "INVALID_ISA", mUser0); |
| 106 | mDoesNotExist = new TestData("DOES.NOT.EXIST", isa, mUser1); |
| 107 | |
Calin Juravle | f1ff36f | 2017-07-22 12:33:41 -0700 | [diff] [blame] | 108 | mBarUser0UnsupportedClassLoader = new TestData(bar, isa, mUser0, |
Alan Stokes | b6c3a60 | 2018-11-02 12:10:42 +0000 | [diff] [blame] | 109 | UNSUPPORTED_CLASS_LOADER_NAME); |
Calin Juravle | f1ff36f | 2017-07-22 12:33:41 -0700 | [diff] [blame] | 110 | mBarUser0DelegateLastClassLoader = new TestData(bar, isa, mUser0, |
| 111 | DELEGATE_LAST_CLASS_LOADER_NAME); |
| 112 | |
Alan Stokes | a002360 | 2017-10-16 12:31:44 +0100 | [diff] [blame] | 113 | mDexManager = new DexManager( |
Victor Hsieh | 785d618 | 2018-04-19 14:26:28 -0700 | [diff] [blame] | 114 | /*Context*/ null, mPM, /*PackageDexOptimizer*/ null, mInstaller, mInstallLock, |
| 115 | mListener); |
Calin Juravle | b8976d8 | 2016-12-16 16:22:00 +0000 | [diff] [blame] | 116 | |
| 117 | // Foo and Bar are available to user0. |
| 118 | // Only Bar is available to user1; |
| 119 | Map<Integer, List<PackageInfo>> existingPackages = new HashMap<>(); |
| 120 | existingPackages.put(mUser0, Arrays.asList(mFooUser0.mPackageInfo, mBarUser0.mPackageInfo)); |
| 121 | existingPackages.put(mUser1, Arrays.asList(mBarUser1.mPackageInfo)); |
| 122 | mDexManager.load(existingPackages); |
| 123 | } |
| 124 | |
| 125 | @Test |
| 126 | public void testNotifyPrimaryUse() { |
| 127 | // The main dex file and splits are re-loaded by the app. |
| 128 | notifyDexLoad(mFooUser0, mFooUser0.getBaseAndSplitDexPaths(), mUser0); |
| 129 | |
| 130 | // Package is not used by others, so we should get nothing back. |
Calin Juravle | 3b74c41 | 2017-08-03 19:48:37 -0700 | [diff] [blame] | 131 | assertNoUseInfo(mFooUser0); |
Calin Juravle | b8976d8 | 2016-12-16 16:22:00 +0000 | [diff] [blame] | 132 | } |
| 133 | |
| 134 | @Test |
| 135 | public void testNotifyPrimaryForeignUse() { |
| 136 | // Foo loads Bar main apks. |
| 137 | notifyDexLoad(mFooUser0, mBarUser0.getBaseAndSplitDexPaths(), mUser0); |
| 138 | |
| 139 | // Bar is used by others now and should be in our records |
| 140 | PackageUseInfo pui = getPackageUseInfo(mBarUser0); |
Calin Juravle | 52a452c | 2017-08-04 01:42:17 -0700 | [diff] [blame] | 141 | assertIsUsedByOtherApps(mBarUser0, pui, true); |
Calin Juravle | b8976d8 | 2016-12-16 16:22:00 +0000 | [diff] [blame] | 142 | assertTrue(pui.getDexUseInfoMap().isEmpty()); |
| 143 | } |
| 144 | |
| 145 | @Test |
| 146 | public void testNotifySecondary() { |
| 147 | // Foo loads its own secondary files. |
| 148 | List<String> fooSecondaries = mFooUser0.getSecondaryDexPaths(); |
| 149 | notifyDexLoad(mFooUser0, fooSecondaries, mUser0); |
| 150 | |
| 151 | PackageUseInfo pui = getPackageUseInfo(mFooUser0); |
Calin Juravle | 52a452c | 2017-08-04 01:42:17 -0700 | [diff] [blame] | 152 | assertIsUsedByOtherApps(mFooUser0, pui, false); |
Calin Juravle | b8976d8 | 2016-12-16 16:22:00 +0000 | [diff] [blame] | 153 | assertEquals(fooSecondaries.size(), pui.getDexUseInfoMap().size()); |
| 154 | assertSecondaryUse(mFooUser0, pui, fooSecondaries, /*isUsedByOtherApps*/false, mUser0); |
| 155 | } |
| 156 | |
| 157 | @Test |
| 158 | public void testNotifySecondaryForeign() { |
| 159 | // Foo loads bar secondary files. |
| 160 | List<String> barSecondaries = mBarUser0.getSecondaryDexPaths(); |
| 161 | notifyDexLoad(mFooUser0, barSecondaries, mUser0); |
| 162 | |
| 163 | PackageUseInfo pui = getPackageUseInfo(mBarUser0); |
Calin Juravle | 52a452c | 2017-08-04 01:42:17 -0700 | [diff] [blame] | 164 | assertIsUsedByOtherApps(mBarUser0, pui, false); |
Calin Juravle | b8976d8 | 2016-12-16 16:22:00 +0000 | [diff] [blame] | 165 | assertEquals(barSecondaries.size(), pui.getDexUseInfoMap().size()); |
| 166 | assertSecondaryUse(mFooUser0, pui, barSecondaries, /*isUsedByOtherApps*/true, mUser0); |
| 167 | } |
| 168 | |
| 169 | @Test |
| 170 | public void testNotifySequence() { |
| 171 | // Foo loads its own secondary files. |
| 172 | List<String> fooSecondaries = mFooUser0.getSecondaryDexPaths(); |
| 173 | notifyDexLoad(mFooUser0, fooSecondaries, mUser0); |
| 174 | // Foo loads Bar own secondary files. |
| 175 | List<String> barSecondaries = mBarUser0.getSecondaryDexPaths(); |
| 176 | notifyDexLoad(mFooUser0, barSecondaries, mUser0); |
| 177 | // Foo loads Bar primary files. |
| 178 | notifyDexLoad(mFooUser0, mBarUser0.getBaseAndSplitDexPaths(), mUser0); |
| 179 | // Bar loads its own secondary files. |
| 180 | notifyDexLoad(mBarUser0, barSecondaries, mUser0); |
| 181 | // Bar loads some own secondary files which foo didn't load. |
| 182 | List<String> barSecondariesForOwnUse = mBarUser0.getSecondaryDexPathsForOwnUse(); |
| 183 | notifyDexLoad(mBarUser0, barSecondariesForOwnUse, mUser0); |
| 184 | |
| 185 | // Check bar usage. Should be used by other app (for primary and barSecondaries). |
| 186 | PackageUseInfo pui = getPackageUseInfo(mBarUser0); |
Calin Juravle | 52a452c | 2017-08-04 01:42:17 -0700 | [diff] [blame] | 187 | assertIsUsedByOtherApps(mBarUser0, pui, true); |
Calin Juravle | b8976d8 | 2016-12-16 16:22:00 +0000 | [diff] [blame] | 188 | assertEquals(barSecondaries.size() + barSecondariesForOwnUse.size(), |
| 189 | pui.getDexUseInfoMap().size()); |
| 190 | |
| 191 | assertSecondaryUse(mFooUser0, pui, barSecondaries, /*isUsedByOtherApps*/true, mUser0); |
| 192 | assertSecondaryUse(mFooUser0, pui, barSecondariesForOwnUse, |
| 193 | /*isUsedByOtherApps*/false, mUser0); |
| 194 | |
| 195 | // Check foo usage. Should not be used by other app. |
| 196 | pui = getPackageUseInfo(mFooUser0); |
Calin Juravle | 52a452c | 2017-08-04 01:42:17 -0700 | [diff] [blame] | 197 | assertIsUsedByOtherApps(mFooUser0, pui, false); |
Calin Juravle | b8976d8 | 2016-12-16 16:22:00 +0000 | [diff] [blame] | 198 | assertEquals(fooSecondaries.size(), pui.getDexUseInfoMap().size()); |
| 199 | assertSecondaryUse(mFooUser0, pui, fooSecondaries, /*isUsedByOtherApps*/false, mUser0); |
| 200 | } |
| 201 | |
| 202 | @Test |
| 203 | public void testPackageUseInfoNotFound() { |
| 204 | // Assert we don't get back data we did not previously record. |
Calin Juravle | 3b74c41 | 2017-08-03 19:48:37 -0700 | [diff] [blame] | 205 | assertNoUseInfo(mFooUser0); |
Calin Juravle | b8976d8 | 2016-12-16 16:22:00 +0000 | [diff] [blame] | 206 | } |
| 207 | |
| 208 | @Test |
| 209 | public void testInvalidIsa() { |
| 210 | // Notifying with an invalid ISA should be ignored. |
| 211 | notifyDexLoad(mInvalidIsa, mInvalidIsa.getSecondaryDexPaths(), mUser0); |
Calin Juravle | 3b74c41 | 2017-08-03 19:48:37 -0700 | [diff] [blame] | 212 | assertNoUseInfo(mInvalidIsa); |
Calin Juravle | b8976d8 | 2016-12-16 16:22:00 +0000 | [diff] [blame] | 213 | } |
| 214 | |
| 215 | @Test |
Calin Juravle | 52a452c | 2017-08-04 01:42:17 -0700 | [diff] [blame] | 216 | public void testNotExistingPackage() { |
Calin Juravle | b8976d8 | 2016-12-16 16:22:00 +0000 | [diff] [blame] | 217 | // Notifying about the load of a package which was previously not |
| 218 | // register in DexManager#load should be ignored. |
| 219 | notifyDexLoad(mDoesNotExist, mDoesNotExist.getBaseAndSplitDexPaths(), mUser0); |
Calin Juravle | 3b74c41 | 2017-08-03 19:48:37 -0700 | [diff] [blame] | 220 | assertNoUseInfo(mDoesNotExist); |
Calin Juravle | b8976d8 | 2016-12-16 16:22:00 +0000 | [diff] [blame] | 221 | } |
| 222 | |
| 223 | @Test |
| 224 | public void testCrossUserAttempt() { |
| 225 | // Bar from User1 tries to load secondary dex files from User0 Bar. |
| 226 | // Request should be ignored. |
| 227 | notifyDexLoad(mBarUser1, mBarUser0.getSecondaryDexPaths(), mUser1); |
Calin Juravle | 3b74c41 | 2017-08-03 19:48:37 -0700 | [diff] [blame] | 228 | assertNoUseInfo(mBarUser1); |
Calin Juravle | b8976d8 | 2016-12-16 16:22:00 +0000 | [diff] [blame] | 229 | } |
| 230 | |
| 231 | @Test |
| 232 | public void testPackageNotInstalledForUser() { |
| 233 | // User1 tries to load Foo which is installed for User0 but not for User1. |
| 234 | // Note that the PackageManagerService already filters this out but we |
| 235 | // still check that nothing goes unexpected in DexManager. |
| 236 | notifyDexLoad(mBarUser0, mFooUser0.getBaseAndSplitDexPaths(), mUser1); |
Calin Juravle | 3b74c41 | 2017-08-03 19:48:37 -0700 | [diff] [blame] | 237 | assertNoUseInfo(mBarUser1); |
Calin Juravle | b8976d8 | 2016-12-16 16:22:00 +0000 | [diff] [blame] | 238 | } |
| 239 | |
Calin Juravle | 0d4b8f8 | 2017-01-23 23:34:25 -0800 | [diff] [blame] | 240 | @Test |
| 241 | public void testNotifyPackageInstallUsedByOther() { |
| 242 | TestData newPackage = new TestData("newPackage", |
| 243 | VMRuntime.getInstructionSet(Build.SUPPORTED_ABIS[0]), mUser0); |
| 244 | |
| 245 | List<String> newSecondaries = newPackage.getSecondaryDexPaths(); |
| 246 | // Before we notify about the installation of the newPackage if mFoo |
| 247 | // is trying to load something from it we should not find it. |
| 248 | notifyDexLoad(mFooUser0, newSecondaries, mUser0); |
Calin Juravle | 3b74c41 | 2017-08-03 19:48:37 -0700 | [diff] [blame] | 249 | assertNoUseInfo(newPackage); |
Calin Juravle | 0d4b8f8 | 2017-01-23 23:34:25 -0800 | [diff] [blame] | 250 | |
| 251 | // Notify about newPackage install and let mFoo load its dexes. |
| 252 | mDexManager.notifyPackageInstalled(newPackage.mPackageInfo, mUser0); |
| 253 | notifyDexLoad(mFooUser0, newSecondaries, mUser0); |
| 254 | |
| 255 | // We should get back the right info. |
| 256 | PackageUseInfo pui = getPackageUseInfo(newPackage); |
Calin Juravle | 52a452c | 2017-08-04 01:42:17 -0700 | [diff] [blame] | 257 | assertIsUsedByOtherApps(newPackage, pui, false); |
Calin Juravle | 0d4b8f8 | 2017-01-23 23:34:25 -0800 | [diff] [blame] | 258 | assertEquals(newSecondaries.size(), pui.getDexUseInfoMap().size()); |
| 259 | assertSecondaryUse(newPackage, pui, newSecondaries, /*isUsedByOtherApps*/true, mUser0); |
| 260 | } |
| 261 | |
| 262 | @Test |
| 263 | public void testNotifyPackageInstallSelfUse() { |
| 264 | TestData newPackage = new TestData("newPackage", |
| 265 | VMRuntime.getInstructionSet(Build.SUPPORTED_ABIS[0]), mUser0); |
| 266 | |
| 267 | List<String> newSecondaries = newPackage.getSecondaryDexPaths(); |
| 268 | // Packages should be able to find their own dex files even if the notification about |
| 269 | // their installation is delayed. |
| 270 | notifyDexLoad(newPackage, newSecondaries, mUser0); |
| 271 | |
| 272 | PackageUseInfo pui = getPackageUseInfo(newPackage); |
Calin Juravle | 52a452c | 2017-08-04 01:42:17 -0700 | [diff] [blame] | 273 | assertIsUsedByOtherApps(newPackage, pui, false); |
Calin Juravle | 0d4b8f8 | 2017-01-23 23:34:25 -0800 | [diff] [blame] | 274 | assertEquals(newSecondaries.size(), pui.getDexUseInfoMap().size()); |
| 275 | assertSecondaryUse(newPackage, pui, newSecondaries, /*isUsedByOtherApps*/false, mUser0); |
| 276 | } |
| 277 | |
Calin Juravle | 99dd37b | 2017-02-22 19:05:06 -0800 | [diff] [blame] | 278 | @Test |
| 279 | public void testNotifyPackageUpdated() { |
| 280 | // Foo loads Bar main apks. |
| 281 | notifyDexLoad(mFooUser0, mBarUser0.getBaseAndSplitDexPaths(), mUser0); |
| 282 | |
| 283 | // Bar is used by others now and should be in our records. |
| 284 | PackageUseInfo pui = getPackageUseInfo(mBarUser0); |
Calin Juravle | 52a452c | 2017-08-04 01:42:17 -0700 | [diff] [blame] | 285 | assertIsUsedByOtherApps(mBarUser0, pui, true); |
Calin Juravle | 99dd37b | 2017-02-22 19:05:06 -0800 | [diff] [blame] | 286 | assertTrue(pui.getDexUseInfoMap().isEmpty()); |
| 287 | |
| 288 | // Notify that bar is updated. |
| 289 | mDexManager.notifyPackageUpdated(mBarUser0.getPackageName(), |
| 290 | mBarUser0.mPackageInfo.applicationInfo.sourceDir, |
| 291 | mBarUser0.mPackageInfo.applicationInfo.splitSourceDirs); |
| 292 | |
| 293 | // The usedByOtherApps flag should be clear now. |
| 294 | pui = getPackageUseInfo(mBarUser0); |
Calin Juravle | 52a452c | 2017-08-04 01:42:17 -0700 | [diff] [blame] | 295 | assertIsUsedByOtherApps(mBarUser0, pui, false); |
Calin Juravle | 99dd37b | 2017-02-22 19:05:06 -0800 | [diff] [blame] | 296 | } |
| 297 | |
| 298 | @Test |
| 299 | public void testNotifyPackageUpdatedCodeLocations() { |
| 300 | // Simulate a split update. |
| 301 | String newSplit = mBarUser0.replaceLastSplit(); |
| 302 | List<String> newSplits = new ArrayList<>(); |
| 303 | newSplits.add(newSplit); |
| 304 | |
| 305 | // We shouldn't find yet the new split as we didn't notify the package update. |
| 306 | notifyDexLoad(mFooUser0, newSplits, mUser0); |
Calin Juravle | 3b74c41 | 2017-08-03 19:48:37 -0700 | [diff] [blame] | 307 | assertNoUseInfo(mBarUser0); |
Calin Juravle | 99dd37b | 2017-02-22 19:05:06 -0800 | [diff] [blame] | 308 | |
| 309 | // Notify that bar is updated. splitSourceDirs will contain the updated path. |
| 310 | mDexManager.notifyPackageUpdated(mBarUser0.getPackageName(), |
| 311 | mBarUser0.mPackageInfo.applicationInfo.sourceDir, |
| 312 | mBarUser0.mPackageInfo.applicationInfo.splitSourceDirs); |
| 313 | |
| 314 | // Now, when the split is loaded we will find it and we should mark Bar as usedByOthers. |
| 315 | notifyDexLoad(mFooUser0, newSplits, mUser0); |
Calin Juravle | 3b74c41 | 2017-08-03 19:48:37 -0700 | [diff] [blame] | 316 | PackageUseInfo pui = getPackageUseInfo(mBarUser0); |
Calin Juravle | 99dd37b | 2017-02-22 19:05:06 -0800 | [diff] [blame] | 317 | assertNotNull(pui); |
Calin Juravle | 52a452c | 2017-08-04 01:42:17 -0700 | [diff] [blame] | 318 | assertIsUsedByOtherApps(newSplits, pui, true); |
Calin Juravle | 99dd37b | 2017-02-22 19:05:06 -0800 | [diff] [blame] | 319 | } |
| 320 | |
| 321 | @Test |
| 322 | public void testNotifyPackageDataDestroyForOne() { |
| 323 | // Bar loads its own secondary files. |
| 324 | notifyDexLoad(mBarUser0, mBarUser0.getSecondaryDexPaths(), mUser0); |
| 325 | notifyDexLoad(mBarUser1, mBarUser1.getSecondaryDexPaths(), mUser1); |
| 326 | |
| 327 | mDexManager.notifyPackageDataDestroyed(mBarUser0.getPackageName(), mUser0); |
| 328 | |
| 329 | // Bar should not be around since it was removed for all users. |
| 330 | PackageUseInfo pui = getPackageUseInfo(mBarUser1); |
| 331 | assertNotNull(pui); |
| 332 | assertSecondaryUse(mBarUser1, pui, mBarUser1.getSecondaryDexPaths(), |
| 333 | /*isUsedByOtherApps*/false, mUser1); |
| 334 | } |
| 335 | |
| 336 | @Test |
| 337 | public void testNotifyPackageDataDestroyForeignUse() { |
| 338 | // Foo loads its own secondary files. |
| 339 | List<String> fooSecondaries = mFooUser0.getSecondaryDexPaths(); |
| 340 | notifyDexLoad(mFooUser0, fooSecondaries, mUser0); |
| 341 | |
| 342 | // Bar loads Foo main apks. |
| 343 | notifyDexLoad(mBarUser0, mFooUser0.getBaseAndSplitDexPaths(), mUser0); |
| 344 | |
| 345 | mDexManager.notifyPackageDataDestroyed(mFooUser0.getPackageName(), mUser0); |
| 346 | |
| 347 | // Foo should still be around since it's used by other apps but with no |
| 348 | // secondary dex info. |
| 349 | PackageUseInfo pui = getPackageUseInfo(mFooUser0); |
Calin Juravle | 52a452c | 2017-08-04 01:42:17 -0700 | [diff] [blame] | 350 | assertIsUsedByOtherApps(mFooUser0, pui, true); |
Calin Juravle | 99dd37b | 2017-02-22 19:05:06 -0800 | [diff] [blame] | 351 | assertTrue(pui.getDexUseInfoMap().isEmpty()); |
| 352 | } |
| 353 | |
| 354 | @Test |
| 355 | public void testNotifyPackageDataDestroyComplete() { |
| 356 | // Foo loads its own secondary files. |
| 357 | List<String> fooSecondaries = mFooUser0.getSecondaryDexPaths(); |
| 358 | notifyDexLoad(mFooUser0, fooSecondaries, mUser0); |
| 359 | |
| 360 | mDexManager.notifyPackageDataDestroyed(mFooUser0.getPackageName(), mUser0); |
| 361 | |
| 362 | // Foo should not be around since all its secondary dex info were deleted |
| 363 | // and it is not used by other apps. |
Calin Juravle | 3b74c41 | 2017-08-03 19:48:37 -0700 | [diff] [blame] | 364 | assertNoUseInfo(mFooUser0); |
Calin Juravle | 99dd37b | 2017-02-22 19:05:06 -0800 | [diff] [blame] | 365 | } |
| 366 | |
| 367 | @Test |
| 368 | public void testNotifyPackageDataDestroyForAll() { |
| 369 | // Foo loads its own secondary files. |
| 370 | notifyDexLoad(mBarUser0, mBarUser0.getSecondaryDexPaths(), mUser0); |
| 371 | notifyDexLoad(mBarUser1, mBarUser1.getSecondaryDexPaths(), mUser1); |
| 372 | |
| 373 | mDexManager.notifyPackageDataDestroyed(mBarUser0.getPackageName(), UserHandle.USER_ALL); |
| 374 | |
| 375 | // Bar should not be around since it was removed for all users. |
Calin Juravle | 3b74c41 | 2017-08-03 19:48:37 -0700 | [diff] [blame] | 376 | assertNoUseInfo(mBarUser0); |
Calin Juravle | 99dd37b | 2017-02-22 19:05:06 -0800 | [diff] [blame] | 377 | } |
| 378 | |
Calin Juravle | 2dfc1b3 | 2017-03-10 18:24:33 -0800 | [diff] [blame] | 379 | @Test |
| 380 | public void testNotifyFrameworkLoad() { |
| 381 | String frameworkDex = "/system/framework/com.android.location.provider.jar"; |
| 382 | // Load a dex file from framework. |
| 383 | notifyDexLoad(mFooUser0, Arrays.asList(frameworkDex), mUser0); |
| 384 | // The dex file should not be recognized as a package. |
Calin Juravle | 3b74c41 | 2017-08-03 19:48:37 -0700 | [diff] [blame] | 385 | assertFalse(mDexManager.hasInfoOnPackage(frameworkDex)); |
Calin Juravle | 2dfc1b3 | 2017-03-10 18:24:33 -0800 | [diff] [blame] | 386 | } |
| 387 | |
Calin Juravle | adbadd5 | 2017-03-28 18:19:15 -0700 | [diff] [blame] | 388 | @Test |
| 389 | public void testNotifySecondaryFromProtected() { |
| 390 | // Foo loads its own secondary files. |
| 391 | List<String> fooSecondaries = mFooUser0.getSecondaryDexPathsFromProtectedDirs(); |
| 392 | notifyDexLoad(mFooUser0, fooSecondaries, mUser0); |
| 393 | |
| 394 | PackageUseInfo pui = getPackageUseInfo(mFooUser0); |
Calin Juravle | 52a452c | 2017-08-04 01:42:17 -0700 | [diff] [blame] | 395 | assertIsUsedByOtherApps(mFooUser0, pui, false); |
Calin Juravle | adbadd5 | 2017-03-28 18:19:15 -0700 | [diff] [blame] | 396 | assertEquals(fooSecondaries.size(), pui.getDexUseInfoMap().size()); |
| 397 | assertSecondaryUse(mFooUser0, pui, fooSecondaries, /*isUsedByOtherApps*/false, mUser0); |
| 398 | } |
| 399 | |
Calin Juravle | f1ff36f | 2017-07-22 12:33:41 -0700 | [diff] [blame] | 400 | @Test |
| 401 | public void testNotifyUnsupportedClassLoader() { |
| 402 | List<String> secondaries = mBarUser0UnsupportedClassLoader.getSecondaryDexPaths(); |
| 403 | notifyDexLoad(mBarUser0UnsupportedClassLoader, secondaries, mUser0); |
| 404 | |
Alan Stokes | 6dba50d | 2018-10-30 15:05:36 +0000 | [diff] [blame] | 405 | assertNoUseInfo(mBarUser0UnsupportedClassLoader); |
Calin Juravle | f1ff36f | 2017-07-22 12:33:41 -0700 | [diff] [blame] | 406 | } |
| 407 | |
| 408 | @Test |
Alan Stokes | b6c3a60 | 2018-11-02 12:10:42 +0000 | [diff] [blame] | 409 | public void testNotifySupportedAndUnsupportedClassLoader() { |
| 410 | String classPath = String.join(File.pathSeparator, mBarUser0.getSecondaryDexPaths()); |
| 411 | List<String> classLoaders = |
| 412 | Arrays.asList(PATH_CLASS_LOADER_NAME, UNSUPPORTED_CLASS_LOADER_NAME); |
| 413 | List<String> classPaths = Arrays.asList(classPath, classPath); |
| 414 | notifyDexLoad(mBarUser0, classLoaders, classPaths, mUser0); |
| 415 | |
| 416 | assertNoUseInfo(mBarUser0); |
| 417 | } |
| 418 | |
| 419 | @Test |
| 420 | public void testNotifyNullClassPath() { |
| 421 | notifyDexLoad(mBarUser0, null, mUser0); |
| 422 | |
| 423 | assertNoUseInfo(mBarUser0); |
| 424 | } |
| 425 | |
| 426 | @Test |
Calin Juravle | f1ff36f | 2017-07-22 12:33:41 -0700 | [diff] [blame] | 427 | public void testNotifyVariableClassLoader() { |
| 428 | // Record bar secondaries with the default PathClassLoader. |
| 429 | List<String> secondaries = mBarUser0.getSecondaryDexPaths(); |
| 430 | |
| 431 | notifyDexLoad(mBarUser0, secondaries, mUser0); |
| 432 | PackageUseInfo pui = getPackageUseInfo(mBarUser0); |
Calin Juravle | 52a452c | 2017-08-04 01:42:17 -0700 | [diff] [blame] | 433 | assertIsUsedByOtherApps(mBarUser0, pui, false); |
Calin Juravle | f1ff36f | 2017-07-22 12:33:41 -0700 | [diff] [blame] | 434 | assertEquals(secondaries.size(), pui.getDexUseInfoMap().size()); |
| 435 | assertSecondaryUse(mFooUser0, pui, secondaries, /*isUsedByOtherApps*/false, mUser0); |
| 436 | |
| 437 | // Record bar secondaries again with a different class loader. This will change the context. |
| 438 | notifyDexLoad(mBarUser0DelegateLastClassLoader, secondaries, mUser0); |
| 439 | |
| 440 | pui = getPackageUseInfo(mBarUser0); |
Calin Juravle | 52a452c | 2017-08-04 01:42:17 -0700 | [diff] [blame] | 441 | assertIsUsedByOtherApps(mBarUser0, pui, false); |
Calin Juravle | f1ff36f | 2017-07-22 12:33:41 -0700 | [diff] [blame] | 442 | assertEquals(secondaries.size(), pui.getDexUseInfoMap().size()); |
| 443 | // We expect that all the contexts to be changed to variable now. |
| 444 | String[] expectedContexts = |
| 445 | Collections.nCopies(secondaries.size(), |
| 446 | PackageDexUsage.VARIABLE_CLASS_LOADER_CONTEXT).toArray(new String[0]); |
| 447 | assertSecondaryUse(mFooUser0, pui, secondaries, /*isUsedByOtherApps*/false, mUser0, |
| 448 | expectedContexts); |
| 449 | } |
| 450 | |
| 451 | @Test |
Alan Stokes | 6dba50d | 2018-10-30 15:05:36 +0000 | [diff] [blame] | 452 | public void testNotifyUnsupportedClassLoaderDoesNotChangeExisting() { |
| 453 | List<String> secondaries = mBarUser0.getSecondaryDexPaths(); |
| 454 | |
| 455 | notifyDexLoad(mBarUser0, secondaries, mUser0); |
| 456 | PackageUseInfo pui = getPackageUseInfo(mBarUser0); |
| 457 | assertSecondaryUse(mBarUser0, pui, secondaries, /*isUsedByOtherApps*/false, mUser0); |
| 458 | |
| 459 | // Record bar secondaries again with an unsupported class loader. This should not change the |
| 460 | // context. |
Calin Juravle | f1ff36f | 2017-07-22 12:33:41 -0700 | [diff] [blame] | 461 | notifyDexLoad(mBarUser0UnsupportedClassLoader, secondaries, mUser0); |
Alan Stokes | 6dba50d | 2018-10-30 15:05:36 +0000 | [diff] [blame] | 462 | pui = getPackageUseInfo(mBarUser0); |
| 463 | assertSecondaryUse(mBarUser0, pui, secondaries, /*isUsedByOtherApps*/false, mUser0); |
Calin Juravle | f1ff36f | 2017-07-22 12:33:41 -0700 | [diff] [blame] | 464 | } |
| 465 | |
Alan Stokes | a002360 | 2017-10-16 12:31:44 +0100 | [diff] [blame] | 466 | @Test |
| 467 | public void testReconcileSecondaryDexFiles_invokesListener() throws Exception { |
| 468 | List<String> fooSecondaries = mFooUser0.getSecondaryDexPathsFromProtectedDirs(); |
| 469 | notifyDexLoad(mFooUser0, fooSecondaries, mUser0); |
| 470 | |
| 471 | when(mPM.getPackageInfo(mFooUser0.getPackageName(), 0, 0)) |
| 472 | .thenReturn(mFooUser0.mPackageInfo); |
| 473 | |
| 474 | mDexManager.reconcileSecondaryDexFiles(mFooUser0.getPackageName()); |
| 475 | |
| 476 | verify(mListener, times(fooSecondaries.size())) |
| 477 | .onReconcileSecondaryDexFile(any(ApplicationInfo.class), |
| 478 | any(DexUseInfo.class), anyString(), anyInt()); |
| 479 | } |
Calin Juravle | f1ff36f | 2017-07-22 12:33:41 -0700 | [diff] [blame] | 480 | |
Calin Juravle | b8976d8 | 2016-12-16 16:22:00 +0000 | [diff] [blame] | 481 | private void assertSecondaryUse(TestData testData, PackageUseInfo pui, |
Calin Juravle | f1ff36f | 2017-07-22 12:33:41 -0700 | [diff] [blame] | 482 | List<String> secondaries, boolean isUsedByOtherApps, int ownerUserId, |
| 483 | String[] expectedContexts) { |
| 484 | assertNotNull(expectedContexts); |
| 485 | assertEquals(expectedContexts.length, secondaries.size()); |
| 486 | int index = 0; |
Calin Juravle | b8976d8 | 2016-12-16 16:22:00 +0000 | [diff] [blame] | 487 | for (String dex : secondaries) { |
| 488 | DexUseInfo dui = pui.getDexUseInfoMap().get(dex); |
| 489 | assertNotNull(dui); |
| 490 | assertEquals(isUsedByOtherApps, dui.isUsedByOtherApps()); |
| 491 | assertEquals(ownerUserId, dui.getOwnerUserId()); |
| 492 | assertEquals(1, dui.getLoaderIsas().size()); |
| 493 | assertTrue(dui.getLoaderIsas().contains(testData.mLoaderIsa)); |
Calin Juravle | f1ff36f | 2017-07-22 12:33:41 -0700 | [diff] [blame] | 494 | assertEquals(expectedContexts[index++], dui.getClassLoaderContext()); |
Calin Juravle | b8976d8 | 2016-12-16 16:22:00 +0000 | [diff] [blame] | 495 | } |
| 496 | } |
Calin Juravle | f1ff36f | 2017-07-22 12:33:41 -0700 | [diff] [blame] | 497 | private void assertSecondaryUse(TestData testData, PackageUseInfo pui, |
| 498 | List<String> secondaries, boolean isUsedByOtherApps, int ownerUserId) { |
| 499 | String[] expectedContexts = DexoptUtils.processContextForDexLoad( |
| 500 | Arrays.asList(testData.mClassLoader), |
| 501 | Arrays.asList(String.join(File.pathSeparator, secondaries))); |
| 502 | assertSecondaryUse(testData, pui, secondaries, isUsedByOtherApps, ownerUserId, |
| 503 | expectedContexts); |
| 504 | } |
Calin Juravle | b8976d8 | 2016-12-16 16:22:00 +0000 | [diff] [blame] | 505 | |
Calin Juravle | 52a452c | 2017-08-04 01:42:17 -0700 | [diff] [blame] | 506 | private void assertIsUsedByOtherApps(TestData testData, PackageUseInfo pui, |
| 507 | boolean isUsedByOtherApps) { |
| 508 | assertIsUsedByOtherApps(testData.getBaseAndSplitDexPaths(), pui, isUsedByOtherApps); |
| 509 | } |
| 510 | |
| 511 | private void assertIsUsedByOtherApps(List<String> codePaths, PackageUseInfo pui, |
| 512 | boolean isUsedByOtherApps) { |
| 513 | for (String codePath : codePaths) { |
| 514 | assertEquals(codePath, isUsedByOtherApps, pui.isUsedByOtherApps(codePath)); |
| 515 | } |
| 516 | } |
Calin Juravle | b8976d8 | 2016-12-16 16:22:00 +0000 | [diff] [blame] | 517 | private void notifyDexLoad(TestData testData, List<String> dexPaths, int loaderUserId) { |
Calin Juravle | f1ff36f | 2017-07-22 12:33:41 -0700 | [diff] [blame] | 518 | // By default, assume a single class loader in the chain. |
| 519 | // This makes writing tests much easier. |
| 520 | List<String> classLoaders = Arrays.asList(testData.mClassLoader); |
Alan Stokes | b6c3a60 | 2018-11-02 12:10:42 +0000 | [diff] [blame] | 521 | List<String> classPaths = (dexPaths == null) |
| 522 | ? Arrays.asList((String) null) |
| 523 | : Arrays.asList(String.join(File.pathSeparator, dexPaths)); |
Calin Juravle | f1ff36f | 2017-07-22 12:33:41 -0700 | [diff] [blame] | 524 | notifyDexLoad(testData, classLoaders, classPaths, loaderUserId); |
| 525 | } |
| 526 | |
Alan Stokes | b6c3a60 | 2018-11-02 12:10:42 +0000 | [diff] [blame] | 527 | private void notifyDexLoad(TestData testData, List<String> classLoaders, |
| 528 | List<String> classPaths, int loaderUserId) { |
| 529 | // We call the internal function so any exceptions thrown cause test failures. |
| 530 | mDexManager.notifyDexLoadInternal(testData.mPackageInfo.applicationInfo, classLoaders, |
| 531 | classPaths, testData.mLoaderIsa, loaderUserId); |
Calin Juravle | b8976d8 | 2016-12-16 16:22:00 +0000 | [diff] [blame] | 532 | } |
| 533 | |
| 534 | private PackageUseInfo getPackageUseInfo(TestData testData) { |
Alan Stokes | a002360 | 2017-10-16 12:31:44 +0100 | [diff] [blame] | 535 | assertTrue(mDexManager.hasInfoOnPackage(testData.getPackageName())); |
| 536 | return mDexManager.getPackageUseInfoOrDefault(testData.getPackageName()); |
Calin Juravle | 3b74c41 | 2017-08-03 19:48:37 -0700 | [diff] [blame] | 537 | } |
| 538 | |
| 539 | private void assertNoUseInfo(TestData testData) { |
Alan Stokes | a002360 | 2017-10-16 12:31:44 +0100 | [diff] [blame] | 540 | assertFalse(mDexManager.hasInfoOnPackage(testData.getPackageName())); |
Calin Juravle | b8976d8 | 2016-12-16 16:22:00 +0000 | [diff] [blame] | 541 | } |
| 542 | |
| 543 | private static PackageInfo getMockPackageInfo(String packageName, int userId) { |
| 544 | PackageInfo pi = new PackageInfo(); |
| 545 | pi.packageName = packageName; |
| 546 | pi.applicationInfo = getMockApplicationInfo(packageName, userId); |
| 547 | return pi; |
| 548 | } |
| 549 | |
| 550 | private static ApplicationInfo getMockApplicationInfo(String packageName, int userId) { |
| 551 | ApplicationInfo ai = new ApplicationInfo(); |
| 552 | String codeDir = "/data/app/" + packageName; |
| 553 | ai.setBaseCodePath(codeDir + "/base.dex"); |
| 554 | ai.setSplitCodePaths(new String[] {codeDir + "/split-1.dex", codeDir + "/split-2.dex"}); |
| 555 | ai.dataDir = "/data/user/" + userId + "/" + packageName; |
Calin Juravle | adbadd5 | 2017-03-28 18:19:15 -0700 | [diff] [blame] | 556 | ai.deviceProtectedDataDir = "/data/user_de/" + userId + "/" + packageName; |
| 557 | ai.credentialProtectedDataDir = "/data/user_ce/" + userId + "/" + packageName; |
Calin Juravle | b8976d8 | 2016-12-16 16:22:00 +0000 | [diff] [blame] | 558 | ai.packageName = packageName; |
| 559 | return ai; |
| 560 | } |
| 561 | |
| 562 | private static class TestData { |
| 563 | private final PackageInfo mPackageInfo; |
| 564 | private final String mLoaderIsa; |
Calin Juravle | f1ff36f | 2017-07-22 12:33:41 -0700 | [diff] [blame] | 565 | private final String mClassLoader; |
Calin Juravle | b8976d8 | 2016-12-16 16:22:00 +0000 | [diff] [blame] | 566 | |
Calin Juravle | f1ff36f | 2017-07-22 12:33:41 -0700 | [diff] [blame] | 567 | private TestData(String packageName, String loaderIsa, int userId, String classLoader) { |
Calin Juravle | b8976d8 | 2016-12-16 16:22:00 +0000 | [diff] [blame] | 568 | mPackageInfo = getMockPackageInfo(packageName, userId); |
| 569 | mLoaderIsa = loaderIsa; |
Calin Juravle | f1ff36f | 2017-07-22 12:33:41 -0700 | [diff] [blame] | 570 | mClassLoader = classLoader; |
| 571 | } |
| 572 | |
| 573 | private TestData(String packageName, String loaderIsa, int userId) { |
| 574 | this(packageName, loaderIsa, userId, PATH_CLASS_LOADER_NAME); |
Calin Juravle | b8976d8 | 2016-12-16 16:22:00 +0000 | [diff] [blame] | 575 | } |
| 576 | |
| 577 | private String getPackageName() { |
| 578 | return mPackageInfo.packageName; |
| 579 | } |
| 580 | |
| 581 | List<String> getSecondaryDexPaths() { |
| 582 | List<String> paths = new ArrayList<>(); |
| 583 | paths.add(mPackageInfo.applicationInfo.dataDir + "/secondary1.dex"); |
| 584 | paths.add(mPackageInfo.applicationInfo.dataDir + "/secondary2.dex"); |
| 585 | paths.add(mPackageInfo.applicationInfo.dataDir + "/secondary3.dex"); |
| 586 | return paths; |
| 587 | } |
| 588 | |
| 589 | List<String> getSecondaryDexPathsForOwnUse() { |
| 590 | List<String> paths = new ArrayList<>(); |
| 591 | paths.add(mPackageInfo.applicationInfo.dataDir + "/secondary4.dex"); |
| 592 | paths.add(mPackageInfo.applicationInfo.dataDir + "/secondary5.dex"); |
| 593 | return paths; |
| 594 | } |
| 595 | |
Calin Juravle | adbadd5 | 2017-03-28 18:19:15 -0700 | [diff] [blame] | 596 | List<String> getSecondaryDexPathsFromProtectedDirs() { |
| 597 | List<String> paths = new ArrayList<>(); |
Alan Stokes | a002360 | 2017-10-16 12:31:44 +0100 | [diff] [blame] | 598 | paths.add(mPackageInfo.applicationInfo.deviceProtectedDataDir + "/secondary6.dex"); |
| 599 | paths.add(mPackageInfo.applicationInfo.credentialProtectedDataDir + "/secondary7.dex"); |
Calin Juravle | adbadd5 | 2017-03-28 18:19:15 -0700 | [diff] [blame] | 600 | return paths; |
| 601 | } |
| 602 | |
Calin Juravle | b8976d8 | 2016-12-16 16:22:00 +0000 | [diff] [blame] | 603 | List<String> getBaseAndSplitDexPaths() { |
| 604 | List<String> paths = new ArrayList<>(); |
| 605 | paths.add(mPackageInfo.applicationInfo.sourceDir); |
| 606 | for (String split : mPackageInfo.applicationInfo.splitSourceDirs) { |
| 607 | paths.add(split); |
| 608 | } |
| 609 | return paths; |
| 610 | } |
Calin Juravle | 99dd37b | 2017-02-22 19:05:06 -0800 | [diff] [blame] | 611 | |
| 612 | String replaceLastSplit() { |
| 613 | int length = mPackageInfo.applicationInfo.splitSourceDirs.length; |
| 614 | // Add an extra bogus dex extension to simulate a new split name. |
| 615 | mPackageInfo.applicationInfo.splitSourceDirs[length - 1] += ".dex"; |
| 616 | return mPackageInfo.applicationInfo.splitSourceDirs[length - 1]; |
| 617 | } |
Calin Juravle | b8976d8 | 2016-12-16 16:22:00 +0000 | [diff] [blame] | 618 | } |
| 619 | } |