The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2008 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 | |
Kenny Root | cf0b38c | 2011-03-22 14:17:59 -0700 | [diff] [blame] | 17 | package com.android.server.pm; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 18 | |
Calin Juravle | 3621be7 | 2018-01-18 15:17:29 -0800 | [diff] [blame] | 19 | import android.annotation.AppIdInt; |
Victor Hsieh | 5f76124 | 2018-01-20 10:30:12 -0800 | [diff] [blame] | 20 | import android.annotation.NonNull; |
Fyodor Kupolov | b94c165 | 2015-03-03 12:25:30 -0800 | [diff] [blame] | 21 | import android.annotation.Nullable; |
Calin Juravle | 3621be7 | 2018-01-18 15:17:29 -0800 | [diff] [blame] | 22 | import android.annotation.UserIdInt; |
Jeff Brown | b880d88 | 2014-02-10 19:47:07 -0800 | [diff] [blame] | 23 | import android.content.Context; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 24 | import android.content.pm.PackageStats; |
Narayan Kamath | 29564cd | 2014-08-07 10:57:40 +0100 | [diff] [blame] | 25 | import android.os.Build; |
Jeff Sharkey | 9f2f218 | 2016-12-21 09:18:33 -0700 | [diff] [blame] | 26 | import android.os.IBinder; |
| 27 | import android.os.IBinder.DeathRecipient; |
Jeff Sharkey | 70b4d10 | 2016-12-05 11:19:28 -0700 | [diff] [blame] | 28 | import android.os.IInstalld; |
Jeff Sharkey | 9f2f218 | 2016-12-21 09:18:33 -0700 | [diff] [blame] | 29 | import android.os.RemoteException; |
Jeff Sharkey | 70b4d10 | 2016-12-05 11:19:28 -0700 | [diff] [blame] | 30 | import android.os.ServiceManager; |
Felka Chang | 71e3efe | 2019-11-20 14:11:13 +0800 | [diff] [blame] | 31 | import android.os.storage.CrateMetadata; |
Jeff Sharkey | 9f2f218 | 2016-12-21 09:18:33 -0700 | [diff] [blame] | 32 | import android.text.format.DateUtils; |
Joe Onorato | 8a9b220 | 2010-02-26 18:56:32 -0800 | [diff] [blame] | 33 | import android.util.Slog; |
Jeff Sharkey | 790a4ec | 2015-04-09 13:18:44 -0700 | [diff] [blame] | 34 | |
Jeff Sharkey | 9f2f218 | 2016-12-21 09:18:33 -0700 | [diff] [blame] | 35 | import com.android.internal.os.BackgroundThread; |
Narayan Kamath | 29564cd | 2014-08-07 10:57:40 +0100 | [diff] [blame] | 36 | import com.android.server.SystemService; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 37 | |
Jeff Sharkey | dd02e33 | 2018-06-27 14:41:57 -0600 | [diff] [blame] | 38 | import dalvik.system.BlockGuard; |
Jeff Sharkey | fdeeeea | 2016-01-11 17:34:24 -0700 | [diff] [blame] | 39 | import dalvik.system.VMRuntime; |
| 40 | |
Victor Hsieh | 55f1499 | 2018-01-13 14:12:59 -0800 | [diff] [blame] | 41 | import java.io.FileDescriptor; |
| 42 | |
Jeff Sharkey | c98c7bc | 2016-12-07 14:57:34 -0700 | [diff] [blame] | 43 | public class Installer extends SystemService { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 44 | private static final String TAG = "Installer"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 45 | |
Todd Kennedy | fa54ab7 | 2015-09-25 07:46:12 -0700 | [diff] [blame] | 46 | /* *************************************************************************** |
| 47 | * IMPORTANT: These values are passed to native code. Keep them in sync with |
Mathew Inwood | 3c8277d | 2018-03-09 14:06:08 +0000 | [diff] [blame] | 48 | * frameworks/native/cmds/installd/installd_constants.h |
Todd Kennedy | fa54ab7 | 2015-09-25 07:46:12 -0700 | [diff] [blame] | 49 | * **************************************************************************/ |
| 50 | /** Application should be visible to everyone */ |
Andreas Gampe | bdd30d8 | 2016-03-20 11:32:11 -0700 | [diff] [blame] | 51 | public static final int DEXOPT_PUBLIC = 1 << 1; |
Todd Kennedy | fa54ab7 | 2015-09-25 07:46:12 -0700 | [diff] [blame] | 52 | /** Application wants to allow debugging of its code */ |
Nicolas Geoffray | 56123ba | 2017-05-05 14:30:02 +0100 | [diff] [blame] | 53 | public static final int DEXOPT_DEBUGGABLE = 1 << 2; |
Todd Kennedy | fa54ab7 | 2015-09-25 07:46:12 -0700 | [diff] [blame] | 54 | /** The system boot has finished */ |
Nicolas Geoffray | 56123ba | 2017-05-05 14:30:02 +0100 | [diff] [blame] | 55 | public static final int DEXOPT_BOOTCOMPLETE = 1 << 3; |
Andreas Gampe | bdd30d8 | 2016-03-20 11:32:11 -0700 | [diff] [blame] | 56 | /** Hint that the dexopt type is profile-guided. */ |
Nicolas Geoffray | 56123ba | 2017-05-05 14:30:02 +0100 | [diff] [blame] | 57 | public static final int DEXOPT_PROFILE_GUIDED = 1 << 4; |
Calin Juravle | c22c30e | 2017-01-16 19:18:48 -0800 | [diff] [blame] | 58 | /** The compilation is for a secondary dex file. */ |
Nicolas Geoffray | 56123ba | 2017-05-05 14:30:02 +0100 | [diff] [blame] | 59 | public static final int DEXOPT_SECONDARY_DEX = 1 << 5; |
Calin Juravle | c22c30e | 2017-01-16 19:18:48 -0800 | [diff] [blame] | 60 | /** Ignore the result of dexoptNeeded and force compilation. */ |
Nicolas Geoffray | 56123ba | 2017-05-05 14:30:02 +0100 | [diff] [blame] | 61 | public static final int DEXOPT_FORCE = 1 << 6; |
Calin Juravle | c22c30e | 2017-01-16 19:18:48 -0800 | [diff] [blame] | 62 | /** Indicates that the dex file passed to dexopt in on CE storage. */ |
Nicolas Geoffray | 56123ba | 2017-05-05 14:30:02 +0100 | [diff] [blame] | 63 | public static final int DEXOPT_STORAGE_CE = 1 << 7; |
Calin Juravle | c22c30e | 2017-01-16 19:18:48 -0800 | [diff] [blame] | 64 | /** Indicates that the dex file passed to dexopt in on DE storage. */ |
Nicolas Geoffray | 56123ba | 2017-05-05 14:30:02 +0100 | [diff] [blame] | 65 | public static final int DEXOPT_STORAGE_DE = 1 << 8; |
David Sehr | 2118ec4 | 2017-10-25 14:28:29 -0700 | [diff] [blame] | 66 | /** Indicates that dexopt is invoked from the background service. */ |
| 67 | public static final int DEXOPT_IDLE_BACKGROUND_JOB = 1 << 9; |
David Brazdil | f7e31c0 | 2018-02-13 17:04:26 +0000 | [diff] [blame] | 68 | /** Indicates that dexopt should restrict access to private APIs. */ |
| 69 | public static final int DEXOPT_ENABLE_HIDDEN_API_CHECKS = 1 << 10; |
Mathieu Chartier | f890c3e | 2018-03-06 18:28:22 -0800 | [diff] [blame] | 70 | /** Indicates that dexopt should convert to CompactDex. */ |
| 71 | public static final int DEXOPT_GENERATE_COMPACT_DEX = 1 << 11; |
Mathieu Chartier | a9c3433 | 2018-03-12 17:11:07 -0700 | [diff] [blame] | 72 | /** Indicates that dexopt should generate an app image */ |
| 73 | public static final int DEXOPT_GENERATE_APP_IMAGE = 1 << 12; |
Patrick Baumann | 90d4e0d | 2020-04-14 16:57:30 -0700 | [diff] [blame] | 74 | /** Indicates that dexopt may be run with different performance / priority tuned for restore */ |
| 75 | public static final int DEXOPT_FOR_RESTORE = 1 << 13; // TODO(b/135202722): remove |
Todd Kennedy | fa54ab7 | 2015-09-25 07:46:12 -0700 | [diff] [blame] | 76 | |
Jeff Sharkey | 4e7a765 | 2018-08-24 17:25:42 -0600 | [diff] [blame] | 77 | public static final int FLAG_STORAGE_DE = IInstalld.FLAG_STORAGE_DE; |
| 78 | public static final int FLAG_STORAGE_CE = IInstalld.FLAG_STORAGE_CE; |
Jeff Sharkey | 3f70463 | 2019-05-14 14:55:13 -0600 | [diff] [blame] | 79 | public static final int FLAG_STORAGE_EXTERNAL = IInstalld.FLAG_STORAGE_EXTERNAL; |
Jeff Sharkey | 4e7a765 | 2018-08-24 17:25:42 -0600 | [diff] [blame] | 80 | |
| 81 | public static final int FLAG_CLEAR_CACHE_ONLY = IInstalld.FLAG_CLEAR_CACHE_ONLY; |
| 82 | public static final int FLAG_CLEAR_CODE_CACHE_ONLY = IInstalld.FLAG_CLEAR_CODE_CACHE_ONLY; |
| 83 | |
| 84 | public static final int FLAG_FREE_CACHE_V2 = IInstalld.FLAG_FREE_CACHE_V2; |
| 85 | public static final int FLAG_FREE_CACHE_V2_DEFY_QUOTA = IInstalld.FLAG_FREE_CACHE_V2_DEFY_QUOTA; |
| 86 | public static final int FLAG_FREE_CACHE_NOOP = IInstalld.FLAG_FREE_CACHE_NOOP; |
| 87 | |
| 88 | public static final int FLAG_USE_QUOTA = IInstalld.FLAG_USE_QUOTA; |
| 89 | public static final int FLAG_FORCE = IInstalld.FLAG_FORCE; |
Jeff Sharkey | fdeeeea | 2016-01-11 17:34:24 -0700 | [diff] [blame] | 90 | |
Calin Juravle | 86b6bbd | 2019-06-17 17:13:55 -0700 | [diff] [blame] | 91 | public static final int FLAG_CLEAR_APP_DATA_KEEP_ART_PROFILES = |
| 92 | IInstalld.FLAG_CLEAR_APP_DATA_KEEP_ART_PROFILES; |
| 93 | |
Jeff Sharkey | c98c7bc | 2016-12-07 14:57:34 -0700 | [diff] [blame] | 94 | private final boolean mIsolated; |
| 95 | |
Jeff Sharkey | 740f523 | 2016-12-09 14:31:26 -0700 | [diff] [blame] | 96 | private volatile IInstalld mInstalld; |
Jeff Sharkey | c8ddc2d | 2016-12-05 23:14:41 -0700 | [diff] [blame] | 97 | private volatile Object mWarnIfHeld; |
| 98 | |
Jeff Brown | b880d88 | 2014-02-10 19:47:07 -0800 | [diff] [blame] | 99 | public Installer(Context context) { |
Jeff Sharkey | c98c7bc | 2016-12-07 14:57:34 -0700 | [diff] [blame] | 100 | this(context, false); |
Jeff Brown | b880d88 | 2014-02-10 19:47:07 -0800 | [diff] [blame] | 101 | } |
| 102 | |
Jeff Sharkey | c98c7bc | 2016-12-07 14:57:34 -0700 | [diff] [blame] | 103 | /** |
| 104 | * @param isolated indicates if this object should <em>not</em> connect to |
| 105 | * the real {@code installd}. All remote calls will be ignored |
| 106 | * unless you extend this class and intercept them. |
| 107 | */ |
| 108 | public Installer(Context context, boolean isolated) { |
Andreas Gampe | d15300c | 2016-06-23 20:27:12 -0700 | [diff] [blame] | 109 | super(context); |
Jeff Sharkey | c98c7bc | 2016-12-07 14:57:34 -0700 | [diff] [blame] | 110 | mIsolated = isolated; |
Andreas Gampe | d15300c | 2016-06-23 20:27:12 -0700 | [diff] [blame] | 111 | } |
| 112 | |
Jeff Sharkey | 8948c01 | 2015-11-03 12:33:54 -0800 | [diff] [blame] | 113 | /** |
| 114 | * Yell loudly if someone tries making future calls while holding a lock on |
| 115 | * the given object. |
| 116 | */ |
| 117 | public void setWarnIfHeld(Object warnIfHeld) { |
Jeff Sharkey | c8ddc2d | 2016-12-05 23:14:41 -0700 | [diff] [blame] | 118 | mWarnIfHeld = warnIfHeld; |
Jeff Sharkey | 8948c01 | 2015-11-03 12:33:54 -0800 | [diff] [blame] | 119 | } |
| 120 | |
Jeff Brown | 6f357d3 | 2014-01-15 20:40:55 -0800 | [diff] [blame] | 121 | @Override |
| 122 | public void onStart() { |
Jeff Sharkey | 740f523 | 2016-12-09 14:31:26 -0700 | [diff] [blame] | 123 | if (mIsolated) { |
| 124 | mInstalld = null; |
| 125 | } else { |
Jeff Sharkey | 9f2f218 | 2016-12-21 09:18:33 -0700 | [diff] [blame] | 126 | connect(); |
| 127 | } |
| 128 | } |
| 129 | |
| 130 | private void connect() { |
| 131 | IBinder binder = ServiceManager.getService("installd"); |
| 132 | if (binder != null) { |
| 133 | try { |
| 134 | binder.linkToDeath(new DeathRecipient() { |
| 135 | @Override |
| 136 | public void binderDied() { |
| 137 | Slog.w(TAG, "installd died; reconnecting"); |
| 138 | connect(); |
| 139 | } |
| 140 | }, 0); |
| 141 | } catch (RemoteException e) { |
| 142 | binder = null; |
| 143 | } |
| 144 | } |
| 145 | |
| 146 | if (binder != null) { |
| 147 | mInstalld = IInstalld.Stub.asInterface(binder); |
Jeff Sharkey | 82add8a | 2017-03-11 19:44:16 -0700 | [diff] [blame] | 148 | try { |
| 149 | invalidateMounts(); |
| 150 | } catch (InstallerException ignored) { |
| 151 | } |
Jeff Sharkey | 9f2f218 | 2016-12-21 09:18:33 -0700 | [diff] [blame] | 152 | } else { |
| 153 | Slog.w(TAG, "installd not found; trying again"); |
| 154 | BackgroundThread.getHandler().postDelayed(() -> { |
| 155 | connect(); |
| 156 | }, DateUtils.SECOND_IN_MILLIS); |
Jeff Sharkey | c98c7bc | 2016-12-07 14:57:34 -0700 | [diff] [blame] | 157 | } |
Jeff Brown | 6f357d3 | 2014-01-15 20:40:55 -0800 | [diff] [blame] | 158 | } |
| 159 | |
Jeff Sharkey | c98c7bc | 2016-12-07 14:57:34 -0700 | [diff] [blame] | 160 | /** |
| 161 | * Do several pre-flight checks before making a remote call. |
| 162 | * |
| 163 | * @return if the remote call should continue. |
| 164 | */ |
| 165 | private boolean checkBeforeRemote() { |
Jeff Sharkey | c8ddc2d | 2016-12-05 23:14:41 -0700 | [diff] [blame] | 166 | if (mWarnIfHeld != null && Thread.holdsLock(mWarnIfHeld)) { |
| 167 | Slog.wtf(TAG, "Calling thread " + Thread.currentThread().getName() + " is holding 0x" |
| 168 | + Integer.toHexString(System.identityHashCode(mWarnIfHeld)), new Throwable()); |
| 169 | } |
Jeff Sharkey | c98c7bc | 2016-12-07 14:57:34 -0700 | [diff] [blame] | 170 | if (mIsolated) { |
| 171 | Slog.i(TAG, "Ignoring request because this installer is isolated"); |
| 172 | return false; |
| 173 | } else { |
| 174 | return true; |
| 175 | } |
Jeff Sharkey | c8ddc2d | 2016-12-05 23:14:41 -0700 | [diff] [blame] | 176 | } |
| 177 | |
Jeff Sharkey | 1c6f723 | 2016-12-19 16:39:02 -0700 | [diff] [blame] | 178 | public long createAppData(String uuid, String packageName, int userId, int flags, int appId, |
Jeff Sharkey | c8ddc2d | 2016-12-05 23:14:41 -0700 | [diff] [blame] | 179 | String seInfo, int targetSdkVersion) throws InstallerException { |
Jeff Sharkey | 1c6f723 | 2016-12-19 16:39:02 -0700 | [diff] [blame] | 180 | if (!checkBeforeRemote()) return -1; |
Jeff Sharkey | c8ddc2d | 2016-12-05 23:14:41 -0700 | [diff] [blame] | 181 | try { |
Jeff Sharkey | 1c6f723 | 2016-12-19 16:39:02 -0700 | [diff] [blame] | 182 | return mInstalld.createAppData(uuid, packageName, userId, flags, appId, seInfo, |
Jeff Sharkey | 70b4d10 | 2016-12-05 11:19:28 -0700 | [diff] [blame] | 183 | targetSdkVersion); |
Jeff Sharkey | 447a3ac | 2016-12-12 10:15:37 -0700 | [diff] [blame] | 184 | } catch (Exception e) { |
Jeff Sharkey | 740f523 | 2016-12-09 14:31:26 -0700 | [diff] [blame] | 185 | throw InstallerException.from(e); |
Jeff Sharkey | 70b4d10 | 2016-12-05 11:19:28 -0700 | [diff] [blame] | 186 | } |
Jeff Sharkey | 790a4ec | 2015-04-09 13:18:44 -0700 | [diff] [blame] | 187 | } |
| 188 | |
Jeff Sharkey | 019ac85 | 2016-12-05 23:39:46 -0700 | [diff] [blame] | 189 | public void restoreconAppData(String uuid, String packageName, int userId, int flags, int appId, |
| 190 | String seInfo) throws InstallerException { |
Jeff Sharkey | c98c7bc | 2016-12-07 14:57:34 -0700 | [diff] [blame] | 191 | if (!checkBeforeRemote()) return; |
Jeff Sharkey | 019ac85 | 2016-12-05 23:39:46 -0700 | [diff] [blame] | 192 | try { |
| 193 | mInstalld.restoreconAppData(uuid, packageName, userId, flags, appId, seInfo); |
Jeff Sharkey | 447a3ac | 2016-12-12 10:15:37 -0700 | [diff] [blame] | 194 | } catch (Exception e) { |
Jeff Sharkey | 740f523 | 2016-12-09 14:31:26 -0700 | [diff] [blame] | 195 | throw InstallerException.from(e); |
Jeff Sharkey | 019ac85 | 2016-12-05 23:39:46 -0700 | [diff] [blame] | 196 | } |
Jeff Sharkey | 790a4ec | 2015-04-09 13:18:44 -0700 | [diff] [blame] | 197 | } |
| 198 | |
Jeff Sharkey | 019ac85 | 2016-12-05 23:39:46 -0700 | [diff] [blame] | 199 | public void migrateAppData(String uuid, String packageName, int userId, int flags) |
Jeff Sharkey | e469713 | 2016-02-06 19:46:15 -0700 | [diff] [blame] | 200 | throws InstallerException { |
Jeff Sharkey | c98c7bc | 2016-12-07 14:57:34 -0700 | [diff] [blame] | 201 | if (!checkBeforeRemote()) return; |
Jeff Sharkey | 019ac85 | 2016-12-05 23:39:46 -0700 | [diff] [blame] | 202 | try { |
| 203 | mInstalld.migrateAppData(uuid, packageName, userId, flags); |
Jeff Sharkey | 447a3ac | 2016-12-12 10:15:37 -0700 | [diff] [blame] | 204 | } catch (Exception e) { |
Jeff Sharkey | 740f523 | 2016-12-09 14:31:26 -0700 | [diff] [blame] | 205 | throw InstallerException.from(e); |
Jeff Sharkey | 019ac85 | 2016-12-05 23:39:46 -0700 | [diff] [blame] | 206 | } |
Jeff Sharkey | e469713 | 2016-02-06 19:46:15 -0700 | [diff] [blame] | 207 | } |
| 208 | |
Jeff Sharkey | 019ac85 | 2016-12-05 23:39:46 -0700 | [diff] [blame] | 209 | public void clearAppData(String uuid, String packageName, int userId, int flags, |
| 210 | long ceDataInode) throws InstallerException { |
Jeff Sharkey | c98c7bc | 2016-12-07 14:57:34 -0700 | [diff] [blame] | 211 | if (!checkBeforeRemote()) return; |
Jeff Sharkey | 019ac85 | 2016-12-05 23:39:46 -0700 | [diff] [blame] | 212 | try { |
| 213 | mInstalld.clearAppData(uuid, packageName, userId, flags, ceDataInode); |
Jeff Sharkey | 447a3ac | 2016-12-12 10:15:37 -0700 | [diff] [blame] | 214 | } catch (Exception e) { |
Jeff Sharkey | 740f523 | 2016-12-09 14:31:26 -0700 | [diff] [blame] | 215 | throw InstallerException.from(e); |
Jeff Sharkey | 019ac85 | 2016-12-05 23:39:46 -0700 | [diff] [blame] | 216 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 217 | } |
| 218 | |
Jeff Sharkey | 019ac85 | 2016-12-05 23:39:46 -0700 | [diff] [blame] | 219 | public void destroyAppData(String uuid, String packageName, int userId, int flags, |
| 220 | long ceDataInode) throws InstallerException { |
Jeff Sharkey | c98c7bc | 2016-12-07 14:57:34 -0700 | [diff] [blame] | 221 | if (!checkBeforeRemote()) return; |
Jeff Sharkey | 019ac85 | 2016-12-05 23:39:46 -0700 | [diff] [blame] | 222 | try { |
| 223 | mInstalld.destroyAppData(uuid, packageName, userId, flags, ceDataInode); |
Jeff Sharkey | 447a3ac | 2016-12-12 10:15:37 -0700 | [diff] [blame] | 224 | } catch (Exception e) { |
Jeff Sharkey | 740f523 | 2016-12-09 14:31:26 -0700 | [diff] [blame] | 225 | throw InstallerException.from(e); |
Jeff Sharkey | 019ac85 | 2016-12-05 23:39:46 -0700 | [diff] [blame] | 226 | } |
Dave Allison | 0efbd9a | 2014-01-30 14:19:51 -0800 | [diff] [blame] | 227 | } |
| 228 | |
Jeff Sharkey | 1566233 | 2017-04-03 16:41:29 -0600 | [diff] [blame] | 229 | public void fixupAppData(String uuid, int flags) throws InstallerException { |
| 230 | if (!checkBeforeRemote()) return; |
| 231 | try { |
| 232 | mInstalld.fixupAppData(uuid, flags); |
| 233 | } catch (Exception e) { |
| 234 | throw InstallerException.from(e); |
| 235 | } |
| 236 | } |
| 237 | |
Jeff Sharkey | c8ddc2d | 2016-12-05 23:14:41 -0700 | [diff] [blame] | 238 | public void moveCompleteApp(String fromUuid, String toUuid, String packageName, |
Songchun Fan | 7c0f329 | 2020-02-13 09:38:58 -0800 | [diff] [blame] | 239 | int appId, String seInfo, int targetSdkVersion, |
Songchun Fan | 480b78b | 2020-02-05 12:07:28 -0800 | [diff] [blame] | 240 | String fromCodePath) throws InstallerException { |
Jeff Sharkey | c98c7bc | 2016-12-07 14:57:34 -0700 | [diff] [blame] | 241 | if (!checkBeforeRemote()) return; |
Jeff Sharkey | c8ddc2d | 2016-12-05 23:14:41 -0700 | [diff] [blame] | 242 | try { |
Songchun Fan | 7c0f329 | 2020-02-13 09:38:58 -0800 | [diff] [blame] | 243 | mInstalld.moveCompleteApp(fromUuid, toUuid, packageName, appId, seInfo, |
Songchun Fan | 480b78b | 2020-02-05 12:07:28 -0800 | [diff] [blame] | 244 | targetSdkVersion, fromCodePath); |
Jeff Sharkey | 447a3ac | 2016-12-12 10:15:37 -0700 | [diff] [blame] | 245 | } catch (Exception e) { |
Jeff Sharkey | 740f523 | 2016-12-09 14:31:26 -0700 | [diff] [blame] | 246 | throw InstallerException.from(e); |
Jeff Sharkey | c8ddc2d | 2016-12-05 23:14:41 -0700 | [diff] [blame] | 247 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 248 | } |
| 249 | |
Jeff Sharkey | 82ca901 | 2017-01-08 17:06:58 -0700 | [diff] [blame] | 250 | public void getAppSize(String uuid, String[] packageNames, int userId, int flags, int appId, |
| 251 | long[] ceDataInodes, String[] codePaths, PackageStats stats) |
Jeff Sharkey | 5eb3eb5 | 2016-12-13 08:44:51 -0700 | [diff] [blame] | 252 | throws InstallerException { |
Jeff Sharkey | c98c7bc | 2016-12-07 14:57:34 -0700 | [diff] [blame] | 253 | if (!checkBeforeRemote()) return; |
Jeff Sharkey | dd02e33 | 2018-06-27 14:41:57 -0600 | [diff] [blame] | 254 | if (codePaths != null) { |
| 255 | for (String codePath : codePaths) { |
| 256 | BlockGuard.getVmPolicy().onPathAccess(codePath); |
| 257 | } |
| 258 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 259 | try { |
Jeff Sharkey | 82ca901 | 2017-01-08 17:06:58 -0700 | [diff] [blame] | 260 | final long[] res = mInstalld.getAppSize(uuid, packageNames, userId, flags, |
| 261 | appId, ceDataInodes, codePaths); |
Jeff Sharkey | 740f523 | 2016-12-09 14:31:26 -0700 | [diff] [blame] | 262 | stats.codeSize += res[0]; |
| 263 | stats.dataSize += res[1]; |
| 264 | stats.cacheSize += res[2]; |
Jeff Sharkey | 82ca901 | 2017-01-08 17:06:58 -0700 | [diff] [blame] | 265 | stats.externalCodeSize += res[3]; |
| 266 | stats.externalDataSize += res[4]; |
| 267 | stats.externalCacheSize += res[5]; |
| 268 | } catch (Exception e) { |
| 269 | throw InstallerException.from(e); |
| 270 | } |
| 271 | } |
| 272 | |
| 273 | public void getUserSize(String uuid, int userId, int flags, int[] appIds, PackageStats stats) |
| 274 | throws InstallerException { |
| 275 | if (!checkBeforeRemote()) return; |
| 276 | try { |
| 277 | final long[] res = mInstalld.getUserSize(uuid, userId, flags, appIds); |
| 278 | stats.codeSize += res[0]; |
| 279 | stats.dataSize += res[1]; |
| 280 | stats.cacheSize += res[2]; |
| 281 | stats.externalCodeSize += res[3]; |
| 282 | stats.externalDataSize += res[4]; |
| 283 | stats.externalCacheSize += res[5]; |
| 284 | } catch (Exception e) { |
| 285 | throw InstallerException.from(e); |
| 286 | } |
| 287 | } |
| 288 | |
Jeff Sharkey | 0034788 | 2017-04-17 16:44:12 -0600 | [diff] [blame] | 289 | public long[] getExternalSize(String uuid, int userId, int flags, int[] appIds) |
| 290 | throws InstallerException { |
Jeff Sharkey | c8b29ac | 2017-07-06 11:29:06 -0600 | [diff] [blame] | 291 | if (!checkBeforeRemote()) return new long[6]; |
Jeff Sharkey | 82ca901 | 2017-01-08 17:06:58 -0700 | [diff] [blame] | 292 | try { |
Jeff Sharkey | 0034788 | 2017-04-17 16:44:12 -0600 | [diff] [blame] | 293 | return mInstalld.getExternalSize(uuid, userId, flags, appIds); |
Jeff Sharkey | 447a3ac | 2016-12-12 10:15:37 -0700 | [diff] [blame] | 294 | } catch (Exception e) { |
Jeff Sharkey | 740f523 | 2016-12-09 14:31:26 -0700 | [diff] [blame] | 295 | throw InstallerException.from(e); |
Jeff Sharkey | 4288419 | 2016-04-09 16:12:01 -0600 | [diff] [blame] | 296 | } |
| 297 | } |
| 298 | |
Felka Chang | 71e3efe | 2019-11-20 14:11:13 +0800 | [diff] [blame] | 299 | /** |
| 300 | * To get all of the CrateMetadata of the crates for the specified user app by the installd. |
| 301 | * |
| 302 | * @param uuid the UUID |
| 303 | * @param packageNames the application package names |
| 304 | * @param userId the user id |
| 305 | * @return the array of CrateMetadata |
| 306 | */ |
| 307 | @Nullable |
| 308 | public CrateMetadata[] getAppCrates(@NonNull String uuid, @NonNull String[] packageNames, |
| 309 | @UserIdInt int userId) throws InstallerException { |
| 310 | if (!checkBeforeRemote()) return null; |
| 311 | try { |
| 312 | return mInstalld.getAppCrates(uuid, packageNames, userId); |
| 313 | } catch (Exception e) { |
| 314 | throw InstallerException.from(e); |
| 315 | } |
| 316 | } |
| 317 | |
| 318 | /** |
| 319 | * To retrieve all of the CrateMetadata of the crate for the specified user app by the installd. |
| 320 | * |
| 321 | * @param uuid the UUID |
| 322 | * @param userId the user id |
| 323 | * @return the array of CrateMetadata |
| 324 | */ |
| 325 | @Nullable |
| 326 | public CrateMetadata[] getUserCrates(String uuid, @UserIdInt int userId) |
| 327 | throws InstallerException { |
| 328 | if (!checkBeforeRemote()) return null; |
| 329 | try { |
| 330 | return mInstalld.getUserCrates(uuid, userId); |
| 331 | } catch (Exception e) { |
| 332 | throw InstallerException.from(e); |
| 333 | } |
| 334 | } |
| 335 | |
Jeff Sharkey | 36ba022 | 2017-01-18 12:11:31 -0700 | [diff] [blame] | 336 | public void setAppQuota(String uuid, int userId, int appId, long cacheQuota) |
| 337 | throws InstallerException { |
| 338 | if (!checkBeforeRemote()) return; |
| 339 | try { |
| 340 | mInstalld.setAppQuota(uuid, userId, appId, cacheQuota); |
| 341 | } catch (Exception e) { |
| 342 | throw InstallerException.from(e); |
| 343 | } |
| 344 | } |
| 345 | |
Jeff Sharkey | c98c7bc | 2016-12-07 14:57:34 -0700 | [diff] [blame] | 346 | public void dexopt(String apkPath, int uid, @Nullable String pkgName, String instructionSet, |
Calin Juravle | db4a79a | 2015-12-23 18:55:08 +0200 | [diff] [blame] | 347 | int dexoptNeeded, @Nullable String outputPath, int dexFlags, |
Calin Juravle | 811a75a | 2017-04-05 22:49:38 -0700 | [diff] [blame] | 348 | String compilerFilter, @Nullable String volumeUuid, @Nullable String sharedLibraries, |
Calin Juravle | 6ae39fc | 2018-01-19 20:32:47 -0800 | [diff] [blame] | 349 | @Nullable String seInfo, boolean downgrade, int targetSdkVersion, |
Calin Juravle | 4bc8f4d | 2018-02-12 12:00:44 -0800 | [diff] [blame] | 350 | @Nullable String profileName, @Nullable String dexMetadataPath, |
| 351 | @Nullable String compilationReason) throws InstallerException { |
Jeff Sharkey | fdeeeea | 2016-01-11 17:34:24 -0700 | [diff] [blame] | 352 | assertValidInstructionSet(instructionSet); |
Jeff Sharkey | dd02e33 | 2018-06-27 14:41:57 -0600 | [diff] [blame] | 353 | BlockGuard.getVmPolicy().onPathAccess(apkPath); |
| 354 | BlockGuard.getVmPolicy().onPathAccess(outputPath); |
| 355 | BlockGuard.getVmPolicy().onPathAccess(dexMetadataPath); |
Jeff Sharkey | c98c7bc | 2016-12-07 14:57:34 -0700 | [diff] [blame] | 356 | if (!checkBeforeRemote()) return; |
Jeff Sharkey | 740f523 | 2016-12-09 14:31:26 -0700 | [diff] [blame] | 357 | try { |
| 358 | mInstalld.dexopt(apkPath, uid, pkgName, instructionSet, dexoptNeeded, outputPath, |
David Brazdil | 3d44ed0 | 2018-01-16 20:01:47 +0000 | [diff] [blame] | 359 | dexFlags, compilerFilter, volumeUuid, sharedLibraries, seInfo, downgrade, |
Calin Juravle | 4bc8f4d | 2018-02-12 12:00:44 -0800 | [diff] [blame] | 360 | targetSdkVersion, profileName, dexMetadataPath, compilationReason); |
Jeff Sharkey | 447a3ac | 2016-12-12 10:15:37 -0700 | [diff] [blame] | 361 | } catch (Exception e) { |
Jeff Sharkey | 740f523 | 2016-12-09 14:31:26 -0700 | [diff] [blame] | 362 | throw InstallerException.from(e); |
| 363 | } |
Andreas Gampe | bdd30d8 | 2016-03-20 11:32:11 -0700 | [diff] [blame] | 364 | } |
| 365 | |
Calin Juravle | 6ae39fc | 2018-01-19 20:32:47 -0800 | [diff] [blame] | 366 | public boolean mergeProfiles(int uid, String packageName, String profileName) |
David Sehr | a877708 | 2016-05-24 15:25:23 -0700 | [diff] [blame] | 367 | throws InstallerException { |
Jeff Sharkey | c98c7bc | 2016-12-07 14:57:34 -0700 | [diff] [blame] | 368 | if (!checkBeforeRemote()) return false; |
Jeff Sharkey | c24fa02 | 2016-12-07 10:37:47 -0700 | [diff] [blame] | 369 | try { |
Calin Juravle | 6ae39fc | 2018-01-19 20:32:47 -0800 | [diff] [blame] | 370 | return mInstalld.mergeProfiles(uid, packageName, profileName); |
Jeff Sharkey | 447a3ac | 2016-12-12 10:15:37 -0700 | [diff] [blame] | 371 | } catch (Exception e) { |
Jeff Sharkey | 740f523 | 2016-12-09 14:31:26 -0700 | [diff] [blame] | 372 | throw InstallerException.from(e); |
Jeff Sharkey | c24fa02 | 2016-12-07 10:37:47 -0700 | [diff] [blame] | 373 | } |
David Sehr | a877708 | 2016-05-24 15:25:23 -0700 | [diff] [blame] | 374 | } |
| 375 | |
Calin Juravle | 6ae39fc | 2018-01-19 20:32:47 -0800 | [diff] [blame] | 376 | public boolean dumpProfiles(int uid, String packageName, String profileName, String codePath) |
Mathieu Chartier | 235845d | 2017-05-10 15:09:19 -0700 | [diff] [blame] | 377 | throws InstallerException { |
| 378 | if (!checkBeforeRemote()) return false; |
Jeff Sharkey | dd02e33 | 2018-06-27 14:41:57 -0600 | [diff] [blame] | 379 | BlockGuard.getVmPolicy().onPathAccess(codePath); |
Mathieu Chartier | 235845d | 2017-05-10 15:09:19 -0700 | [diff] [blame] | 380 | try { |
Calin Juravle | 6ae39fc | 2018-01-19 20:32:47 -0800 | [diff] [blame] | 381 | return mInstalld.dumpProfiles(uid, packageName, profileName, codePath); |
| 382 | } catch (Exception e) { |
| 383 | throw InstallerException.from(e); |
| 384 | } |
| 385 | } |
| 386 | |
| 387 | public boolean copySystemProfile(String systemProfile, int uid, String packageName, |
| 388 | String profileName) throws InstallerException { |
| 389 | if (!checkBeforeRemote()) return false; |
| 390 | try { |
| 391 | return mInstalld.copySystemProfile(systemProfile, uid, packageName, profileName); |
Mathieu Chartier | 235845d | 2017-05-10 15:09:19 -0700 | [diff] [blame] | 392 | } catch (Exception e) { |
| 393 | throw InstallerException.from(e); |
| 394 | } |
| 395 | } |
| 396 | |
Jeff Sharkey | fdeeeea | 2016-01-11 17:34:24 -0700 | [diff] [blame] | 397 | public void rmdex(String codePath, String instructionSet) throws InstallerException { |
| 398 | assertValidInstructionSet(instructionSet); |
Jeff Sharkey | c98c7bc | 2016-12-07 14:57:34 -0700 | [diff] [blame] | 399 | if (!checkBeforeRemote()) return; |
Jeff Sharkey | dd02e33 | 2018-06-27 14:41:57 -0600 | [diff] [blame] | 400 | BlockGuard.getVmPolicy().onPathAccess(codePath); |
Jeff Sharkey | c24fa02 | 2016-12-07 10:37:47 -0700 | [diff] [blame] | 401 | try { |
| 402 | mInstalld.rmdex(codePath, instructionSet); |
Jeff Sharkey | 447a3ac | 2016-12-12 10:15:37 -0700 | [diff] [blame] | 403 | } catch (Exception e) { |
Jeff Sharkey | 740f523 | 2016-12-09 14:31:26 -0700 | [diff] [blame] | 404 | throw InstallerException.from(e); |
Jeff Sharkey | c24fa02 | 2016-12-07 10:37:47 -0700 | [diff] [blame] | 405 | } |
Jeff Sharkey | fdeeeea | 2016-01-11 17:34:24 -0700 | [diff] [blame] | 406 | } |
| 407 | |
| 408 | public void rmPackageDir(String packageDir) throws InstallerException { |
Jeff Sharkey | c98c7bc | 2016-12-07 14:57:34 -0700 | [diff] [blame] | 409 | if (!checkBeforeRemote()) return; |
Jeff Sharkey | dd02e33 | 2018-06-27 14:41:57 -0600 | [diff] [blame] | 410 | BlockGuard.getVmPolicy().onPathAccess(packageDir); |
Jeff Sharkey | c24fa02 | 2016-12-07 10:37:47 -0700 | [diff] [blame] | 411 | try { |
| 412 | mInstalld.rmPackageDir(packageDir); |
Jeff Sharkey | 447a3ac | 2016-12-12 10:15:37 -0700 | [diff] [blame] | 413 | } catch (Exception e) { |
Jeff Sharkey | 740f523 | 2016-12-09 14:31:26 -0700 | [diff] [blame] | 414 | throw InstallerException.from(e); |
Jeff Sharkey | c24fa02 | 2016-12-07 10:37:47 -0700 | [diff] [blame] | 415 | } |
Jeff Sharkey | fdeeeea | 2016-01-11 17:34:24 -0700 | [diff] [blame] | 416 | } |
| 417 | |
Calin Juravle | 6ae39fc | 2018-01-19 20:32:47 -0800 | [diff] [blame] | 418 | public void clearAppProfiles(String packageName, String profileName) throws InstallerException { |
Jeff Sharkey | c98c7bc | 2016-12-07 14:57:34 -0700 | [diff] [blame] | 419 | if (!checkBeforeRemote()) return; |
Jeff Sharkey | c24fa02 | 2016-12-07 10:37:47 -0700 | [diff] [blame] | 420 | try { |
Calin Juravle | 6ae39fc | 2018-01-19 20:32:47 -0800 | [diff] [blame] | 421 | mInstalld.clearAppProfiles(packageName, profileName); |
Jeff Sharkey | 447a3ac | 2016-12-12 10:15:37 -0700 | [diff] [blame] | 422 | } catch (Exception e) { |
Jeff Sharkey | 740f523 | 2016-12-09 14:31:26 -0700 | [diff] [blame] | 423 | throw InstallerException.from(e); |
Jeff Sharkey | c24fa02 | 2016-12-07 10:37:47 -0700 | [diff] [blame] | 424 | } |
Calin Juravle | d6d27e3 | 2016-03-23 13:59:18 +0000 | [diff] [blame] | 425 | } |
| 426 | |
Jeff Sharkey | c24fa02 | 2016-12-07 10:37:47 -0700 | [diff] [blame] | 427 | public void destroyAppProfiles(String packageName) throws InstallerException { |
Jeff Sharkey | c98c7bc | 2016-12-07 14:57:34 -0700 | [diff] [blame] | 428 | if (!checkBeforeRemote()) return; |
Jeff Sharkey | c24fa02 | 2016-12-07 10:37:47 -0700 | [diff] [blame] | 429 | try { |
| 430 | mInstalld.destroyAppProfiles(packageName); |
Jeff Sharkey | 447a3ac | 2016-12-12 10:15:37 -0700 | [diff] [blame] | 431 | } catch (Exception e) { |
Jeff Sharkey | 740f523 | 2016-12-09 14:31:26 -0700 | [diff] [blame] | 432 | throw InstallerException.from(e); |
Jeff Sharkey | c24fa02 | 2016-12-07 10:37:47 -0700 | [diff] [blame] | 433 | } |
David Brazdil | 9aa6db0 | 2016-03-08 12:57:12 +0000 | [diff] [blame] | 434 | } |
| 435 | |
Jeff Sharkey | fcf1e55 | 2016-04-14 20:44:58 -0600 | [diff] [blame] | 436 | public void createUserData(String uuid, int userId, int userSerial, int flags) |
| 437 | throws InstallerException { |
Jeff Sharkey | c98c7bc | 2016-12-07 14:57:34 -0700 | [diff] [blame] | 438 | if (!checkBeforeRemote()) return; |
Jeff Sharkey | 019ac85 | 2016-12-05 23:39:46 -0700 | [diff] [blame] | 439 | try { |
| 440 | mInstalld.createUserData(uuid, userId, userSerial, flags); |
Jeff Sharkey | 447a3ac | 2016-12-12 10:15:37 -0700 | [diff] [blame] | 441 | } catch (Exception e) { |
Jeff Sharkey | 740f523 | 2016-12-09 14:31:26 -0700 | [diff] [blame] | 442 | throw InstallerException.from(e); |
Jeff Sharkey | 019ac85 | 2016-12-05 23:39:46 -0700 | [diff] [blame] | 443 | } |
Jeff Sharkey | fdeeeea | 2016-01-11 17:34:24 -0700 | [diff] [blame] | 444 | } |
| 445 | |
Jeff Sharkey | fcf1e55 | 2016-04-14 20:44:58 -0600 | [diff] [blame] | 446 | public void destroyUserData(String uuid, int userId, int flags) throws InstallerException { |
Jeff Sharkey | c98c7bc | 2016-12-07 14:57:34 -0700 | [diff] [blame] | 447 | if (!checkBeforeRemote()) return; |
Jeff Sharkey | 019ac85 | 2016-12-05 23:39:46 -0700 | [diff] [blame] | 448 | try { |
| 449 | mInstalld.destroyUserData(uuid, userId, flags); |
Jeff Sharkey | 447a3ac | 2016-12-12 10:15:37 -0700 | [diff] [blame] | 450 | } catch (Exception e) { |
Jeff Sharkey | 740f523 | 2016-12-09 14:31:26 -0700 | [diff] [blame] | 451 | throw InstallerException.from(e); |
Jeff Sharkey | 019ac85 | 2016-12-05 23:39:46 -0700 | [diff] [blame] | 452 | } |
Jeff Sharkey | fdeeeea | 2016-01-11 17:34:24 -0700 | [diff] [blame] | 453 | } |
| 454 | |
Jeff Sharkey | ddff807 | 2017-05-26 13:10:46 -0600 | [diff] [blame] | 455 | public void freeCache(String uuid, long targetFreeBytes, long cacheReservedBytes, int flags) |
| 456 | throws InstallerException { |
Jeff Sharkey | c98c7bc | 2016-12-07 14:57:34 -0700 | [diff] [blame] | 457 | if (!checkBeforeRemote()) return; |
Jeff Sharkey | c24fa02 | 2016-12-07 10:37:47 -0700 | [diff] [blame] | 458 | try { |
Jeff Sharkey | ddff807 | 2017-05-26 13:10:46 -0600 | [diff] [blame] | 459 | mInstalld.freeCache(uuid, targetFreeBytes, cacheReservedBytes, flags); |
Jeff Sharkey | 447a3ac | 2016-12-12 10:15:37 -0700 | [diff] [blame] | 460 | } catch (Exception e) { |
Jeff Sharkey | 740f523 | 2016-12-09 14:31:26 -0700 | [diff] [blame] | 461 | throw InstallerException.from(e); |
Jeff Sharkey | c24fa02 | 2016-12-07 10:37:47 -0700 | [diff] [blame] | 462 | } |
Jeff Sharkey | fdeeeea | 2016-01-11 17:34:24 -0700 | [diff] [blame] | 463 | } |
| 464 | |
Kenny Root | ddbe50d | 2012-09-06 13:18:37 -0700 | [diff] [blame] | 465 | /** |
Jeff Sharkey | fdeeeea | 2016-01-11 17:34:24 -0700 | [diff] [blame] | 466 | * Links the 32 bit native library directory in an application's data |
| 467 | * directory to the real location for backward compatibility. Note that no |
| 468 | * such symlink is created for 64 bit shared libraries. |
Kenny Root | ddbe50d | 2012-09-06 13:18:37 -0700 | [diff] [blame] | 469 | */ |
Jeff Sharkey | c24fa02 | 2016-12-07 10:37:47 -0700 | [diff] [blame] | 470 | public void linkNativeLibraryDirectory(String uuid, String packageName, String nativeLibPath32, |
Jeff Sharkey | fdeeeea | 2016-01-11 17:34:24 -0700 | [diff] [blame] | 471 | int userId) throws InstallerException { |
Jeff Sharkey | c98c7bc | 2016-12-07 14:57:34 -0700 | [diff] [blame] | 472 | if (!checkBeforeRemote()) return; |
Jeff Sharkey | dd02e33 | 2018-06-27 14:41:57 -0600 | [diff] [blame] | 473 | BlockGuard.getVmPolicy().onPathAccess(nativeLibPath32); |
Jeff Sharkey | c24fa02 | 2016-12-07 10:37:47 -0700 | [diff] [blame] | 474 | try { |
| 475 | mInstalld.linkNativeLibraryDirectory(uuid, packageName, nativeLibPath32, userId); |
Jeff Sharkey | 447a3ac | 2016-12-12 10:15:37 -0700 | [diff] [blame] | 476 | } catch (Exception e) { |
Jeff Sharkey | 740f523 | 2016-12-09 14:31:26 -0700 | [diff] [blame] | 477 | throw InstallerException.from(e); |
Jeff Sharkey | c24fa02 | 2016-12-07 10:37:47 -0700 | [diff] [blame] | 478 | } |
Kenny Root | 6a6b007 | 2010-10-07 16:46:10 -0700 | [diff] [blame] | 479 | } |
Robert Craig | 4385343 | 2014-03-04 11:57:23 -0500 | [diff] [blame] | 480 | |
Jeff Sharkey | fdeeeea | 2016-01-11 17:34:24 -0700 | [diff] [blame] | 481 | public void createOatDir(String oatDir, String dexInstructionSet) |
| 482 | throws InstallerException { |
Jeff Sharkey | c98c7bc | 2016-12-07 14:57:34 -0700 | [diff] [blame] | 483 | if (!checkBeforeRemote()) return; |
Jeff Sharkey | c24fa02 | 2016-12-07 10:37:47 -0700 | [diff] [blame] | 484 | try { |
| 485 | mInstalld.createOatDir(oatDir, dexInstructionSet); |
Jeff Sharkey | 447a3ac | 2016-12-12 10:15:37 -0700 | [diff] [blame] | 486 | } catch (Exception e) { |
Jeff Sharkey | 740f523 | 2016-12-09 14:31:26 -0700 | [diff] [blame] | 487 | throw InstallerException.from(e); |
Jeff Sharkey | c24fa02 | 2016-12-07 10:37:47 -0700 | [diff] [blame] | 488 | } |
Jeff Sharkey | 790a4ec | 2015-04-09 13:18:44 -0700 | [diff] [blame] | 489 | } |
| 490 | |
Jeff Sharkey | fdeeeea | 2016-01-11 17:34:24 -0700 | [diff] [blame] | 491 | public void linkFile(String relativePath, String fromBase, String toBase) |
| 492 | throws InstallerException { |
Jeff Sharkey | c98c7bc | 2016-12-07 14:57:34 -0700 | [diff] [blame] | 493 | if (!checkBeforeRemote()) return; |
Jeff Sharkey | dd02e33 | 2018-06-27 14:41:57 -0600 | [diff] [blame] | 494 | BlockGuard.getVmPolicy().onPathAccess(fromBase); |
| 495 | BlockGuard.getVmPolicy().onPathAccess(toBase); |
Jeff Sharkey | c24fa02 | 2016-12-07 10:37:47 -0700 | [diff] [blame] | 496 | try { |
| 497 | mInstalld.linkFile(relativePath, fromBase, toBase); |
Jeff Sharkey | 447a3ac | 2016-12-12 10:15:37 -0700 | [diff] [blame] | 498 | } catch (Exception e) { |
Jeff Sharkey | 740f523 | 2016-12-09 14:31:26 -0700 | [diff] [blame] | 499 | throw InstallerException.from(e); |
Jeff Sharkey | c24fa02 | 2016-12-07 10:37:47 -0700 | [diff] [blame] | 500 | } |
Robert Craig | 4385343 | 2014-03-04 11:57:23 -0500 | [diff] [blame] | 501 | } |
Narayan Kamath | 6c4b9de | 2014-08-08 12:44:12 +0100 | [diff] [blame] | 502 | |
Andreas Gampe | abcbe2f | 2016-02-26 11:25:36 -0800 | [diff] [blame] | 503 | public void moveAb(String apkPath, String instructionSet, String outputPath) |
| 504 | throws InstallerException { |
Jeff Sharkey | c98c7bc | 2016-12-07 14:57:34 -0700 | [diff] [blame] | 505 | if (!checkBeforeRemote()) return; |
Jeff Sharkey | dd02e33 | 2018-06-27 14:41:57 -0600 | [diff] [blame] | 506 | BlockGuard.getVmPolicy().onPathAccess(apkPath); |
| 507 | BlockGuard.getVmPolicy().onPathAccess(outputPath); |
Jeff Sharkey | c24fa02 | 2016-12-07 10:37:47 -0700 | [diff] [blame] | 508 | try { |
| 509 | mInstalld.moveAb(apkPath, instructionSet, outputPath); |
Jeff Sharkey | 447a3ac | 2016-12-12 10:15:37 -0700 | [diff] [blame] | 510 | } catch (Exception e) { |
Jeff Sharkey | 740f523 | 2016-12-09 14:31:26 -0700 | [diff] [blame] | 511 | throw InstallerException.from(e); |
Jeff Sharkey | c24fa02 | 2016-12-07 10:37:47 -0700 | [diff] [blame] | 512 | } |
Andreas Gampe | abcbe2f | 2016-02-26 11:25:36 -0800 | [diff] [blame] | 513 | } |
| 514 | |
Andreas Gampe | 33c592d | 2016-09-09 17:08:53 -0700 | [diff] [blame] | 515 | public void deleteOdex(String apkPath, String instructionSet, String outputPath) |
| 516 | throws InstallerException { |
Jeff Sharkey | c98c7bc | 2016-12-07 14:57:34 -0700 | [diff] [blame] | 517 | if (!checkBeforeRemote()) return; |
Jeff Sharkey | dd02e33 | 2018-06-27 14:41:57 -0600 | [diff] [blame] | 518 | BlockGuard.getVmPolicy().onPathAccess(apkPath); |
| 519 | BlockGuard.getVmPolicy().onPathAccess(outputPath); |
Jeff Sharkey | c24fa02 | 2016-12-07 10:37:47 -0700 | [diff] [blame] | 520 | try { |
| 521 | mInstalld.deleteOdex(apkPath, instructionSet, outputPath); |
Jeff Sharkey | 447a3ac | 2016-12-12 10:15:37 -0700 | [diff] [blame] | 522 | } catch (Exception e) { |
Jeff Sharkey | 740f523 | 2016-12-09 14:31:26 -0700 | [diff] [blame] | 523 | throw InstallerException.from(e); |
Jeff Sharkey | c24fa02 | 2016-12-07 10:37:47 -0700 | [diff] [blame] | 524 | } |
Andreas Gampe | 33c592d | 2016-09-09 17:08:53 -0700 | [diff] [blame] | 525 | } |
| 526 | |
Victor Hsieh | cccad19 | 2018-03-19 15:57:02 -0700 | [diff] [blame] | 527 | public void installApkVerity(String filePath, FileDescriptor verityInput, int contentSize) |
Victor Hsieh | 55f1499 | 2018-01-13 14:12:59 -0800 | [diff] [blame] | 528 | throws InstallerException { |
| 529 | if (!checkBeforeRemote()) return; |
Jeff Sharkey | dd02e33 | 2018-06-27 14:41:57 -0600 | [diff] [blame] | 530 | BlockGuard.getVmPolicy().onPathAccess(filePath); |
Victor Hsieh | 55f1499 | 2018-01-13 14:12:59 -0800 | [diff] [blame] | 531 | try { |
Victor Hsieh | cccad19 | 2018-03-19 15:57:02 -0700 | [diff] [blame] | 532 | mInstalld.installApkVerity(filePath, verityInput, contentSize); |
Victor Hsieh | 55f1499 | 2018-01-13 14:12:59 -0800 | [diff] [blame] | 533 | } catch (Exception e) { |
| 534 | throw InstallerException.from(e); |
| 535 | } |
| 536 | } |
| 537 | |
Victor Hsieh | 5f76124 | 2018-01-20 10:30:12 -0800 | [diff] [blame] | 538 | public void assertFsverityRootHashMatches(String filePath, @NonNull byte[] expectedHash) |
| 539 | throws InstallerException { |
| 540 | if (!checkBeforeRemote()) return; |
Jeff Sharkey | dd02e33 | 2018-06-27 14:41:57 -0600 | [diff] [blame] | 541 | BlockGuard.getVmPolicy().onPathAccess(filePath); |
Victor Hsieh | 5f76124 | 2018-01-20 10:30:12 -0800 | [diff] [blame] | 542 | try { |
| 543 | mInstalld.assertFsverityRootHashMatches(filePath, expectedHash); |
| 544 | } catch (Exception e) { |
| 545 | throw InstallerException.from(e); |
| 546 | } |
| 547 | } |
| 548 | |
Calin Juravle | 1aa5f88 | 2017-01-25 01:05:50 -0800 | [diff] [blame] | 549 | public boolean reconcileSecondaryDexFile(String apkPath, String packageName, int uid, |
| 550 | String[] isas, @Nullable String volumeUuid, int flags) throws InstallerException { |
| 551 | for (int i = 0; i < isas.length; i++) { |
| 552 | assertValidInstructionSet(isas[i]); |
| 553 | } |
| 554 | if (!checkBeforeRemote()) return false; |
Jeff Sharkey | dd02e33 | 2018-06-27 14:41:57 -0600 | [diff] [blame] | 555 | BlockGuard.getVmPolicy().onPathAccess(apkPath); |
Calin Juravle | 1aa5f88 | 2017-01-25 01:05:50 -0800 | [diff] [blame] | 556 | try { |
| 557 | return mInstalld.reconcileSecondaryDexFile(apkPath, packageName, uid, isas, |
| 558 | volumeUuid, flags); |
| 559 | } catch (Exception e) { |
| 560 | throw InstallerException.from(e); |
| 561 | } |
| 562 | } |
| 563 | |
Alan Stokes | a002360 | 2017-10-16 12:31:44 +0100 | [diff] [blame] | 564 | public byte[] hashSecondaryDexFile(String dexPath, String packageName, int uid, |
| 565 | @Nullable String volumeUuid, int flags) throws InstallerException { |
| 566 | if (!checkBeforeRemote()) return new byte[0]; |
Jeff Sharkey | dd02e33 | 2018-06-27 14:41:57 -0600 | [diff] [blame] | 567 | BlockGuard.getVmPolicy().onPathAccess(dexPath); |
Alan Stokes | a002360 | 2017-10-16 12:31:44 +0100 | [diff] [blame] | 568 | try { |
| 569 | return mInstalld.hashSecondaryDexFile(dexPath, packageName, uid, volumeUuid, flags); |
| 570 | } catch (Exception e) { |
| 571 | throw InstallerException.from(e); |
| 572 | } |
| 573 | } |
| 574 | |
Calin Juravle | fcbb74a | 2018-01-21 21:39:18 -0800 | [diff] [blame] | 575 | public boolean createProfileSnapshot(int appId, String packageName, String profileName, |
| 576 | String classpath) throws InstallerException { |
Calin Juravle | fd9f8ae | 2017-11-29 18:26:55 -0800 | [diff] [blame] | 577 | if (!checkBeforeRemote()) return false; |
| 578 | try { |
Calin Juravle | fcbb74a | 2018-01-21 21:39:18 -0800 | [diff] [blame] | 579 | return mInstalld.createProfileSnapshot(appId, packageName, profileName, classpath); |
Calin Juravle | fd9f8ae | 2017-11-29 18:26:55 -0800 | [diff] [blame] | 580 | } catch (Exception e) { |
| 581 | throw InstallerException.from(e); |
| 582 | } |
| 583 | } |
| 584 | |
Calin Juravle | 6ae39fc | 2018-01-19 20:32:47 -0800 | [diff] [blame] | 585 | public void destroyProfileSnapshot(String packageName, String profileName) |
Calin Juravle | fd9f8ae | 2017-11-29 18:26:55 -0800 | [diff] [blame] | 586 | throws InstallerException { |
| 587 | if (!checkBeforeRemote()) return; |
| 588 | try { |
Calin Juravle | 6ae39fc | 2018-01-19 20:32:47 -0800 | [diff] [blame] | 589 | mInstalld.destroyProfileSnapshot(packageName, profileName); |
Calin Juravle | fd9f8ae | 2017-11-29 18:26:55 -0800 | [diff] [blame] | 590 | } catch (Exception e) { |
| 591 | throw InstallerException.from(e); |
| 592 | } |
| 593 | } |
| 594 | |
Jeff Sharkey | 7d25faf | 2017-01-16 20:58:40 -0700 | [diff] [blame] | 595 | public void invalidateMounts() throws InstallerException { |
| 596 | if (!checkBeforeRemote()) return; |
| 597 | try { |
| 598 | mInstalld.invalidateMounts(); |
| 599 | } catch (Exception e) { |
| 600 | throw InstallerException.from(e); |
| 601 | } |
| 602 | } |
| 603 | |
Jeff Sharkey | d5d5e92 | 2017-02-21 10:51:23 -0700 | [diff] [blame] | 604 | public boolean isQuotaSupported(String volumeUuid) throws InstallerException { |
| 605 | if (!checkBeforeRemote()) return false; |
| 606 | try { |
| 607 | return mInstalld.isQuotaSupported(volumeUuid); |
| 608 | } catch (Exception e) { |
| 609 | throw InstallerException.from(e); |
| 610 | } |
| 611 | } |
| 612 | |
Ricky Wai | 4482ab5 | 2019-12-10 19:08:18 +0000 | [diff] [blame] | 613 | /** |
| 614 | * Bind mount private volume CE and DE mirror storage. |
| 615 | */ |
Ricky Wai | 88b369a | 2020-02-07 16:26:29 +0000 | [diff] [blame] | 616 | public void tryMountDataMirror(String volumeUuid) throws InstallerException { |
Ricky Wai | 4482ab5 | 2019-12-10 19:08:18 +0000 | [diff] [blame] | 617 | if (!checkBeforeRemote()) return; |
| 618 | try { |
Ricky Wai | 88b369a | 2020-02-07 16:26:29 +0000 | [diff] [blame] | 619 | mInstalld.tryMountDataMirror(volumeUuid); |
Ricky Wai | 4482ab5 | 2019-12-10 19:08:18 +0000 | [diff] [blame] | 620 | } catch (Exception e) { |
| 621 | throw InstallerException.from(e); |
| 622 | } |
| 623 | } |
| 624 | |
| 625 | /** |
| 626 | * Unmount private volume CE and DE mirror storage. |
| 627 | */ |
| 628 | public void onPrivateVolumeRemoved(String volumeUuid) throws InstallerException { |
| 629 | if (!checkBeforeRemote()) return; |
| 630 | try { |
| 631 | mInstalld.onPrivateVolumeRemoved(volumeUuid); |
| 632 | } catch (Exception e) { |
| 633 | throw InstallerException.from(e); |
| 634 | } |
| 635 | } |
| 636 | |
Calin Juravle | 3621be7 | 2018-01-18 15:17:29 -0800 | [diff] [blame] | 637 | public boolean prepareAppProfile(String pkg, @UserIdInt int userId, @AppIdInt int appId, |
| 638 | String profileName, String codePath, String dexMetadataPath) throws InstallerException { |
| 639 | if (!checkBeforeRemote()) return false; |
Jeff Sharkey | dd02e33 | 2018-06-27 14:41:57 -0600 | [diff] [blame] | 640 | BlockGuard.getVmPolicy().onPathAccess(codePath); |
| 641 | BlockGuard.getVmPolicy().onPathAccess(dexMetadataPath); |
Calin Juravle | 3621be7 | 2018-01-18 15:17:29 -0800 | [diff] [blame] | 642 | try { |
| 643 | return mInstalld.prepareAppProfile(pkg, userId, appId, profileName, codePath, |
| 644 | dexMetadataPath); |
| 645 | } catch (Exception e) { |
| 646 | throw InstallerException.from(e); |
| 647 | } |
| 648 | } |
| 649 | |
Nikita Ioffe | 952aa7b | 2019-01-28 19:49:56 +0000 | [diff] [blame] | 650 | /** |
| 651 | * Snapshots user data of the given package. |
| 652 | * |
| 653 | * @param pkg name of the package to snapshot user data for. |
| 654 | * @param userId id of the user whose data to snapshot. |
Nikita Ioffe | 5dcd1797 | 2019-02-04 11:08:13 +0000 | [diff] [blame] | 655 | * @param snapshotId id of this snapshot. |
Nikita Ioffe | 952aa7b | 2019-01-28 19:49:56 +0000 | [diff] [blame] | 656 | * @param storageFlags flags controlling which data (CE or DE) to snapshot. |
| 657 | * |
| 658 | * @return inode of the snapshot of users CE package data, or {@code 0} if a remote calls |
| 659 | * shouldn't be continued. See {@link #checkBeforeRemote}. |
| 660 | * |
| 661 | * @throws InstallerException if failed to snapshot user data. |
| 662 | */ |
Nikita Ioffe | 5dcd1797 | 2019-02-04 11:08:13 +0000 | [diff] [blame] | 663 | public long snapshotAppData(String pkg, @UserIdInt int userId, int snapshotId, int storageFlags) |
Narayan Kamath | 869f706 | 2019-01-10 12:24:15 +0000 | [diff] [blame] | 664 | throws InstallerException { |
Nikita Ioffe | 952aa7b | 2019-01-28 19:49:56 +0000 | [diff] [blame] | 665 | if (!checkBeforeRemote()) return 0; |
Narayan Kamath | 869f706 | 2019-01-10 12:24:15 +0000 | [diff] [blame] | 666 | |
| 667 | try { |
Nikita Ioffe | 5dcd1797 | 2019-02-04 11:08:13 +0000 | [diff] [blame] | 668 | return mInstalld.snapshotAppData(null, pkg, userId, snapshotId, storageFlags); |
Narayan Kamath | 869f706 | 2019-01-10 12:24:15 +0000 | [diff] [blame] | 669 | } catch (Exception e) { |
| 670 | throw InstallerException.from(e); |
| 671 | } |
| 672 | } |
| 673 | |
Nikita Ioffe | 952aa7b | 2019-01-28 19:49:56 +0000 | [diff] [blame] | 674 | /** |
| 675 | * Restores user data snapshot of the given package. |
| 676 | * |
| 677 | * @param pkg name of the package to restore user data for. |
| 678 | * @param appId id of the package to restore user data for. |
Nikita Ioffe | 952aa7b | 2019-01-28 19:49:56 +0000 | [diff] [blame] | 679 | * @param userId id of the user whose data to restore. |
Nikita Ioffe | 5dcd1797 | 2019-02-04 11:08:13 +0000 | [diff] [blame] | 680 | * @param snapshotId id of the snapshot to restore. |
Nikita Ioffe | 952aa7b | 2019-01-28 19:49:56 +0000 | [diff] [blame] | 681 | * @param storageFlags flags controlling which data (CE or DE) to restore. |
| 682 | * |
| 683 | * @return {@code true} if user data restore was successful, or {@code false} if a remote call |
| 684 | * shouldn't be continued. See {@link #checkBeforeRemote}. |
| 685 | * |
| 686 | * @throws InstallerException if failed to restore user data. |
| 687 | */ |
Nikita Ioffe | 5dcd1797 | 2019-02-04 11:08:13 +0000 | [diff] [blame] | 688 | public boolean restoreAppDataSnapshot(String pkg, @AppIdInt int appId, String seInfo, |
| 689 | @UserIdInt int userId, int snapshotId, int storageFlags) throws InstallerException { |
Narayan Kamath | 869f706 | 2019-01-10 12:24:15 +0000 | [diff] [blame] | 690 | if (!checkBeforeRemote()) return false; |
| 691 | |
| 692 | try { |
Nikita Ioffe | 5dcd1797 | 2019-02-04 11:08:13 +0000 | [diff] [blame] | 693 | mInstalld.restoreAppDataSnapshot(null, pkg, appId, seInfo, userId, snapshotId, |
Narayan Kamath | 869f706 | 2019-01-10 12:24:15 +0000 | [diff] [blame] | 694 | storageFlags); |
| 695 | return true; |
| 696 | } catch (Exception e) { |
| 697 | throw InstallerException.from(e); |
| 698 | } |
| 699 | } |
| 700 | |
Nikita Ioffe | 952aa7b | 2019-01-28 19:49:56 +0000 | [diff] [blame] | 701 | /** |
| 702 | * Deletes user data snapshot of the given package. |
| 703 | * |
| 704 | * @param pkg name of the package to delete user data snapshot for. |
| 705 | * @param userId id of the user whose user data snapshot to delete. |
| 706 | * @param ceSnapshotInode inode of CE user data snapshot. |
Nikita Ioffe | 5dcd1797 | 2019-02-04 11:08:13 +0000 | [diff] [blame] | 707 | * @param snapshotId id of the snapshot to delete. |
Nikita Ioffe | 952aa7b | 2019-01-28 19:49:56 +0000 | [diff] [blame] | 708 | * @param storageFlags flags controlling which user data snapshot (CE or DE) to delete. |
| 709 | * |
| 710 | * @return {@code true} if user data snapshot was successfully deleted, or {@code false} if a |
| 711 | * remote call shouldn't be continued. See {@link #checkBeforeRemote}. |
| 712 | * |
| 713 | * @throws InstallerException if failed to delete user data snapshot. |
| 714 | */ |
| 715 | public boolean destroyAppDataSnapshot(String pkg, @UserIdInt int userId, long ceSnapshotInode, |
Nikita Ioffe | 5dcd1797 | 2019-02-04 11:08:13 +0000 | [diff] [blame] | 716 | int snapshotId, int storageFlags) throws InstallerException { |
Nikita Ioffe | 952aa7b | 2019-01-28 19:49:56 +0000 | [diff] [blame] | 717 | if (!checkBeforeRemote()) return false; |
| 718 | |
| 719 | try { |
Nikita Ioffe | 5dcd1797 | 2019-02-04 11:08:13 +0000 | [diff] [blame] | 720 | mInstalld.destroyAppDataSnapshot(null, pkg, userId, ceSnapshotInode, snapshotId, |
| 721 | storageFlags); |
Nikita Ioffe | 952aa7b | 2019-01-28 19:49:56 +0000 | [diff] [blame] | 722 | return true; |
| 723 | } catch (Exception e) { |
| 724 | throw InstallerException.from(e); |
| 725 | } |
| 726 | } |
| 727 | |
Narayan Kamath | 157dd1d | 2019-06-12 13:06:30 +0100 | [diff] [blame] | 728 | /** |
Oli Lan | 27bec23 | 2020-03-17 16:31:10 +0000 | [diff] [blame] | 729 | * Deletes all snapshots of credential encrypted user data, where the snapshot id is not |
| 730 | * included in {@code retainSnapshotIds}. |
| 731 | * |
| 732 | * @param userId id of the user whose user data snapshots to delete. |
| 733 | * @param retainSnapshotIds ids of the snapshots that should not be deleted. |
| 734 | * |
| 735 | * @return {@code true} if the operation was successful, or {@code false} if a remote call |
| 736 | * shouldn't be continued. See {@link #checkBeforeRemote}. |
| 737 | * |
| 738 | * @throws InstallerException if failed to delete user data snapshot. |
| 739 | */ |
| 740 | public boolean destroyCeSnapshotsNotSpecified(@UserIdInt int userId, |
| 741 | int[] retainSnapshotIds) throws InstallerException { |
| 742 | if (!checkBeforeRemote()) return false; |
| 743 | |
| 744 | try { |
| 745 | mInstalld.destroyCeSnapshotsNotSpecified(null, userId, retainSnapshotIds); |
| 746 | return true; |
| 747 | } catch (Exception e) { |
| 748 | throw InstallerException.from(e); |
| 749 | } |
| 750 | } |
| 751 | |
| 752 | /** |
Narayan Kamath | 157dd1d | 2019-06-12 13:06:30 +0100 | [diff] [blame] | 753 | * Migrates obb data from its legacy location {@code /data/media/obb} to |
| 754 | * {@code /data/media/0/Android/obb}. This call is idempotent and a fast no-op if data has |
| 755 | * already been migrated. |
| 756 | * |
| 757 | * @throws InstallerException if an error occurs. |
| 758 | */ |
| 759 | public boolean migrateLegacyObbData() throws InstallerException { |
| 760 | if (!checkBeforeRemote()) return false; |
| 761 | |
| 762 | try { |
| 763 | mInstalld.migrateLegacyObbData(); |
| 764 | return true; |
| 765 | } catch (Exception e) { |
| 766 | throw InstallerException.from(e); |
| 767 | } |
| 768 | } |
| 769 | |
Jeff Sharkey | fdeeeea | 2016-01-11 17:34:24 -0700 | [diff] [blame] | 770 | private static void assertValidInstructionSet(String instructionSet) |
| 771 | throws InstallerException { |
Narayan Kamath | 6c4b9de | 2014-08-08 12:44:12 +0100 | [diff] [blame] | 772 | for (String abi : Build.SUPPORTED_ABIS) { |
Jeff Sharkey | fdeeeea | 2016-01-11 17:34:24 -0700 | [diff] [blame] | 773 | if (VMRuntime.getInstructionSet(abi).equals(instructionSet)) { |
| 774 | return; |
Narayan Kamath | 6c4b9de | 2014-08-08 12:44:12 +0100 | [diff] [blame] | 775 | } |
| 776 | } |
Jeff Sharkey | fdeeeea | 2016-01-11 17:34:24 -0700 | [diff] [blame] | 777 | throw new InstallerException("Invalid instruction set: " + instructionSet); |
Narayan Kamath | 6c4b9de | 2014-08-08 12:44:12 +0100 | [diff] [blame] | 778 | } |
Jeff Sharkey | 740f523 | 2016-12-09 14:31:26 -0700 | [diff] [blame] | 779 | |
Eric Holk | a1485f6 | 2019-01-07 13:58:25 -0800 | [diff] [blame] | 780 | public boolean compileLayouts(String apkPath, String packageName, String outDexFile, int uid) { |
| 781 | try { |
| 782 | return mInstalld.compileLayouts(apkPath, packageName, outDexFile, uid); |
| 783 | } catch (RemoteException e) { |
| 784 | return false; |
| 785 | } |
| 786 | } |
| 787 | |
Jeff Sharkey | 740f523 | 2016-12-09 14:31:26 -0700 | [diff] [blame] | 788 | public static class InstallerException extends Exception { |
| 789 | public InstallerException(String detailMessage) { |
| 790 | super(detailMessage); |
| 791 | } |
| 792 | |
| 793 | public static InstallerException from(Exception e) throws InstallerException { |
Jeff Sharkey | 447a3ac | 2016-12-12 10:15:37 -0700 | [diff] [blame] | 794 | throw new InstallerException(e.toString()); |
Jeff Sharkey | 740f523 | 2016-12-09 14:31:26 -0700 | [diff] [blame] | 795 | } |
| 796 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 797 | } |