| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 package org.chromium.base; | 5 package org.chromium.base; |
| 6 | 6 |
| 7 import android.annotation.TargetApi; |
| 7 import android.content.Context; | 8 import android.content.Context; |
| 8 import android.content.pm.ApplicationInfo; | 9 import android.content.pm.ApplicationInfo; |
| 9 import android.content.pm.PackageInfo; | 10 import android.content.pm.PackageInfo; |
| 10 import android.content.pm.PackageManager; | 11 import android.content.pm.PackageManager; |
| 11 import android.content.pm.PackageManager.NameNotFoundException; | 12 import android.content.pm.PackageManager.NameNotFoundException; |
| 12 import android.os.Build; | 13 import android.os.Build; |
| 13 import android.text.TextUtils; | 14 import android.text.TextUtils; |
| 14 import android.util.Log; | 15 import android.util.Log; |
| 15 | 16 |
| 16 /** | 17 /** |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 } | 126 } |
| 126 | 127 |
| 127 /** | 128 /** |
| 128 * @return Whether the Android build is M or later. | 129 * @return Whether the Android build is M or later. |
| 129 */ | 130 */ |
| 130 public static boolean isMncOrLater() { | 131 public static boolean isMncOrLater() { |
| 131 // TODO(bauerb): Update this once the SDK is updated. | 132 // TODO(bauerb): Update this once the SDK is updated. |
| 132 return Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP_MR1 | 133 return Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP_MR1 |
| 133 || TextUtils.equals("MNC", Build.VERSION.CODENAME); | 134 || TextUtils.equals("MNC", Build.VERSION.CODENAME); |
| 134 } | 135 } |
| 136 |
| 137 @TargetApi(Build.VERSION_CODES.LOLLIPOP) |
| 138 @CalledByNative |
| 139 public static boolean hasApkSplits(Context context) { |
| 140 if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) { |
| 141 return false; |
| 142 } |
| 143 ApplicationInfo appInfo = context.getApplicationInfo(); |
| 144 return appInfo.splitSourceDirs != null && appInfo.splitSourceDirs.length
> 0; |
| 145 } |
| 135 } | 146 } |
| OLD | NEW |