| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 | 5 |
| 6 package org.chromium.base.library_loader; | 6 package org.chromium.base.library_loader; |
| 7 | 7 |
| 8 import android.content.Context; | 8 import android.content.Context; |
| 9 import android.content.pm.ApplicationInfo; | 9 import android.content.pm.ApplicationInfo; |
| 10 import android.os.Build; | 10 import android.os.Build; |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 // TODO(aurimas): Build.CPU_ABI has been deprecated. Replace it when fin
al L SDK is public. | 231 // TODO(aurimas): Build.CPU_ABI has been deprecated. Replace it when fin
al L SDK is public. |
| 232 return "lib/" + Build.CPU_ABI + "/" + System.mapLibraryName(libName); | 232 return "lib/" + Build.CPU_ABI + "/" + System.mapLibraryName(libName); |
| 233 } | 233 } |
| 234 | 234 |
| 235 private static void deleteDirectorySync(File dir) { | 235 private static void deleteDirectorySync(File dir) { |
| 236 try { | 236 try { |
| 237 File[] files = dir.listFiles(); | 237 File[] files = dir.listFiles(); |
| 238 if (files != null) { | 238 if (files != null) { |
| 239 for (File file : files) { | 239 for (File file : files) { |
| 240 if (!file.delete()) { | 240 if (!file.delete()) { |
| 241 Log.e(TAG, "Failed to remove " + file.getAbsolutePath()); | 241 Log.e(TAG, "Failed to remove " + file.getAbsolutePath())
; |
| 242 } | 242 } |
| 243 } | 243 } |
| 244 } | 244 } |
| 245 if (!dir.delete()) { | 245 if (!dir.delete()) { |
| 246 Log.w(TAG, "Failed to remove " + dir.getAbsolutePath()); | 246 Log.w(TAG, "Failed to remove " + dir.getAbsolutePath()); |
| 247 } | 247 } |
| 248 return; | 248 return; |
| 249 } catch (Exception e) { | 249 } catch (Exception e) { |
| 250 Log.e(TAG, "Failed to remove old libs, ", e); | 250 Log.e(TAG, "Failed to remove old libs, ", e); |
| 251 } | 251 } |
| 252 } | 252 } |
| 253 } | 253 } |
| OLD | NEW |