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

Commit a4739b86 authored by Elliott Hughes's avatar Elliott Hughes Committed by Gerrit Code Review
Browse files

Merge "Move frameworks/base to std::unique_ptr."

parents 5e91082b 93bb56ef
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -23,9 +23,9 @@
#include "selinux/selinux.h"
#include "selinux/android.h"
#include <errno.h>
#include <memory>
#include <ScopedLocalRef.h>
#include <ScopedUtfChars.h>
#include <UniquePtr.h>

namespace android {

@@ -34,7 +34,7 @@ struct SecurityContext_Delete {
        freecon(p);
    }
};
typedef UniquePtr<char[], SecurityContext_Delete> Unique_SecurityContext;
typedef std::unique_ptr<char[], SecurityContext_Delete> Unique_SecurityContext;

static jboolean isSELinuxDisabled = true;

@@ -112,7 +112,7 @@ static jboolean setFSCreateCon(JNIEnv *env, jobject, jstring contextStr) {
        return false;
    }

    UniquePtr<ScopedUtfChars> context;
    std::unique_ptr<ScopedUtfChars> context;
    const char* context_c_str = NULL;
    if (contextStr != NULL) {
        context.reset(new ScopedUtfChars(env, contextStr));
+3 −3
Original line number Diff line number Diff line
@@ -20,7 +20,6 @@
#include "core_jni_helpers.h"

#include <ScopedUtfChars.h>
#include <UniquePtr.h>
#include <androidfw/ZipFileRO.h>
#include <androidfw/ZipUtils.h>
#include <utils/Log.h>
@@ -37,6 +36,7 @@
#include <sys/stat.h>
#include <sys/types.h>

#include <memory>

#define APK_LIB "lib/"
#define APK_LIB_LEN (sizeof(APK_LIB) - 1)
@@ -398,7 +398,7 @@ iterateOverNativeFiles(JNIEnv *env, jlong apkHandle, jstring javaCpuAbi,
        return INSTALL_FAILED_INVALID_APK;
    }

    UniquePtr<NativeLibrariesIterator> it(NativeLibrariesIterator::create(zipFile));
    std::unique_ptr<NativeLibrariesIterator> it(NativeLibrariesIterator::create(zipFile));
    if (it.get() == NULL) {
        return INSTALL_FAILED_INVALID_APK;
    }
@@ -446,7 +446,7 @@ static int findSupportedAbi(JNIEnv *env, jlong apkHandle, jobjectArray supported
        return INSTALL_FAILED_INVALID_APK;
    }

    UniquePtr<NativeLibrariesIterator> it(NativeLibrariesIterator::create(zipFile));
    std::unique_ptr<NativeLibrariesIterator> it(NativeLibrariesIterator::create(zipFile));
    if (it.get() == NULL) {
        return INSTALL_FAILED_INVALID_APK;
    }