public FakeAndroidTarget(String sdkLocation, String target) { mSdkLocation = sdkLocation; mApiLevel = getApiLevel(target); if ("unstubbed".equals(target)) { mBootClasspath.add(mSdkLocation + "/out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes.jar"); mBootClasspath.add(mSdkLocation + "/out/target/common/obj/JAVA_LIBRARIES/core_intermediates/classes.jar"); // pre-build the path to the platform components mPaths.put(ANDROID_JAR, mSdkLocation + "/prebuilts/sdk/current/" + SdkConstants.FN_FRAMEWORK_LIBRARY); mPaths.put(ANDROID_AIDL, mSdkLocation + "/prebuilts/sdk/renderscript/" + SdkConstants.FN_FRAMEWORK_AIDL); } else { String apiPrebuilts; if ("current".equals(target)) { apiPrebuilts = mSdkLocation + "/prebuilts/sdk/current/"; } else { apiPrebuilts = mSdkLocation + "/prebuilts/sdk/" + Integer.toString(mApiLevel) + "/"; } // pre-build the path to the platform components mBootClasspath.add(apiPrebuilts + SdkConstants.FN_FRAMEWORK_LIBRARY); mPaths.put(ANDROID_JAR, apiPrebuilts + SdkConstants.FN_FRAMEWORK_LIBRARY); mPaths.put(ANDROID_AIDL, apiPrebuilts + SdkConstants.FN_FRAMEWORK_AIDL); } }
public FakeAndroidTarget(String sdkLocation, String target) { mSdkLocation = sdkLocation; mApiLevel = getApiLevel(target); if ("unstubbed".equals(target)) { mBootClasspath.add(mSdkLocation + "/out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes.jar"); mBootClasspath.add(mSdkLocation + "/out/target/common/obj/JAVA_LIBRARIES/core_intermediates/classes.jar"); // pre-build the path to the platform components mPaths.put(ANDROID_JAR, mSdkLocation + "/prebuilts/sdk/current/" + SdkConstants.FN_FRAMEWORK_LIBRARY); mPaths.put(ANDROID_AIDL, mSdkLocation + "/prebuilts/sdk/renderscript/" + SdkConstants.FN_FRAMEWORK_AIDL); } else { String apiPrebuilts; if ("current".equals(target)) { apiPrebuilts = mSdkLocation + "/prebuilts/sdk/current/"; } else { apiPrebuilts = mSdkLocation + "/prebuilts/sdk/" + Integer.toString(mApiLevel) + "/"; } // pre-build the path to the platform components mBootClasspath.add(apiPrebuilts + SdkConstants.FN_FRAMEWORK_LIBRARY); mPaths.put(ANDROID_JAR, apiPrebuilts + SdkConstants.FN_FRAMEWORK_LIBRARY); mPaths.put(ANDROID_AIDL, apiPrebuilts + SdkConstants.FN_FRAMEWORK_AIDL); } }
/** * Puts a key/value pair into the array, optimizing for the case where * the key is greater than all existing keys in the array. */ public void append(int key, E value) { if (mSize != 0 && key <= mKeys[mSize - 1]) { put(key, value); return; } if (mGarbage && mSize >= mKeys.length) { gc(); } int pos = mSize; if (pos >= mKeys.length) { int n = ArrayUtils.idealIntArraySize(pos + 1); int[] nkeys = new int[n]; Object[] nvalues = new Object[n]; // Log.e("SparseArray", "grow " + mKeys.length + " to " + n); System.arraycopy(mKeys, 0, nkeys, 0, mKeys.length); System.arraycopy(mValues, 0, nvalues, 0, mValues.length); mKeys = nkeys; mValues = nvalues; } mKeys[pos] = key; mValues[pos] = value; mSize = pos + 1; }
commandOutputsConsumed.put(i, new HashSet<>());