Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 037ca2ad authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Remove implicit StrongPointer creation" into main

parents 6af2e307 8d8f00d8
Loading
Loading
Loading
Loading
+6 −10
Original line number Diff line number Diff line
@@ -13,7 +13,6 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#undef ANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION // TODO:remove this and fix code

#define LOG_TAG "InputTransferToken"

@@ -53,7 +52,7 @@ static jlong nativeCreateFromBinder(JNIEnv* env, jclass clazz, jobject tokenBind
}

static void nativeWriteToParcel(JNIEnv* env, jclass clazz, jlong nativeObj, jobject parcelObj) {
    InputTransferToken* inputTransferToken = reinterpret_cast<InputTransferToken*>(nativeObj);
    auto inputTransferToken = reinterpret_cast<InputTransferToken*>(nativeObj);
    Parcel* parcel = parcelForJavaObject(env, parcelObj);
    inputTransferToken->writeToParcel(parcel);
}
@@ -67,12 +66,12 @@ static jlong nativeReadFromParcel(JNIEnv* env, jclass clazz, jobject parcelObj)
}

static jobject nativeGetBinderToken(JNIEnv* env, jclass clazz, jlong nativeObj) {
    sp<InputTransferToken> inputTransferToken = reinterpret_cast<InputTransferToken*>(nativeObj);
    auto inputTransferToken = reinterpret_cast<InputTransferToken*>(nativeObj);
    return javaObjectForIBinder(env, inputTransferToken->mToken);
}

static jlong nativeGetBinderTokenRef(JNIEnv*, jclass, jlong nativeObj) {
    sp<InputTransferToken> inputTransferToken = reinterpret_cast<InputTransferToken*>(nativeObj);
    auto inputTransferToken = reinterpret_cast<InputTransferToken*>(nativeObj);
    return reinterpret_cast<jlong>(inputTransferToken->mToken.get());
}

@@ -105,12 +104,9 @@ static jlong nativeGetNativeInputTransferTokenFinalizer(JNIEnv* env, jclass claz

static bool nativeEquals(JNIEnv* env, jclass clazz, jlong inputTransferTokenObj1,
                         jlong inputTransferTokenObj2) {
    sp<InputTransferToken> inputTransferToken1(
            reinterpret_cast<InputTransferToken*>(inputTransferTokenObj1));
    sp<InputTransferToken> inputTransferToken2(
            reinterpret_cast<InputTransferToken*>(inputTransferTokenObj2));

    return inputTransferToken1 == inputTransferToken2;
    auto token1 = reinterpret_cast<InputTransferToken*>(inputTransferTokenObj1);
    auto token2 = reinterpret_cast<InputTransferToken*>(inputTransferTokenObj2);
    return (token1 != nullptr) && (token2 != nullptr) && (*token1 == *token2);
}

static const JNINativeMethod sInputTransferTokenMethods[] = {