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

Commit a4714a00 authored by Giulio Cervera's avatar Giulio Cervera
Browse files

Merge remote-tracking branch 'origin/ics_chocolate_M8260AAABQNLZA30136' into HEAD

parents 010109c3 909f1072
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -10811,6 +10811,8 @@ package android.media {
    ctor public MediaRecorder();
    method public static final int getAudioSourceMax();
    method public int getMaxAmplitude() throws java.lang.IllegalStateException;
    method public void native_start() throws java.lang.IllegalStateException;
    method public void native_stop() throws java.lang.IllegalStateException;
    method public void prepare() throws java.io.IOException, java.lang.IllegalStateException;
    method public void release();
    method public void reset();
+8 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2007 The Android Open Source Project
 * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
@@ -104,4 +105,11 @@ public class Power
    }

    private static native void rebootNative(String reason) throws IOException ;

    /**
     * Activate/DeActivate Unstable Memory block
     *
     * @param on Whether you want Activate(true) or DeActive(False)
     */
    public static native int SetUnstableMemoryState(boolean on);
}
+8 −0
Original line number Diff line number Diff line
/* //device/libs/android_runtime/android_os_Power.cpp
**
** Copyright 2006, The Android Open Source Project
** Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
@@ -85,6 +86,12 @@ static void android_os_Power_reboot(JNIEnv *env, jobject clazz, jstring reason)
    jniThrowIOException(env, errno);
}

static int
SetUnstableMemoryState(JNIEnv *env, jobject clazz, jboolean on)
{
    return set_unstable_memory_state(on);
}

static JNINativeMethod method_table[] = {
    { "acquireWakeLock", "(ILjava/lang/String;)V", (void*)acquireWakeLock },
    { "releaseWakeLock", "(Ljava/lang/String;)V", (void*)releaseWakeLock },
@@ -92,6 +99,7 @@ static JNINativeMethod method_table[] = {
    { "setScreenState", "(Z)I", (void*)setScreenState },
    { "shutdown", "()V", (void*)android_os_Power_shutdown },
    { "rebootNative", "(Ljava/lang/String;)V", (void*)android_os_Power_reboot },
    { "SetUnstableMemoryState",  "(Z)I", (void*)SetUnstableMemoryState},
};

int register_android_os_Power(JNIEnv *env)
+1 −1
Original line number Diff line number Diff line
@@ -567,7 +567,7 @@ nAllocationElementData1D(JNIEnv *_env, jobject _this, RsContext con, jint alloc,
    jint len = _env->GetArrayLength(data);
    LOG_API("nAllocationElementData1D, con(%p), alloc(%p), offset(%i), comp(%i), len(%i), sizeBytes(%i)", con, (RsAllocation)alloc, offset, compIdx, len, sizeBytes);
    jbyte *ptr = _env->GetByteArrayElements(data, NULL);
    rsAllocation1DElementData(con, (RsAllocation)alloc, offset, lod, ptr, compIdx, sizeBytes);
    rsAllocation1DElementData(con, (RsAllocation)alloc, offset, lod, ptr, sizeBytes, compIdx);
    _env->ReleaseByteArrayElements(data, ptr, JNI_ABORT);
}

+56 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2008 The Android Open Source Project
 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef ANDROID_MEMORY_HEAP_ION_H
#define ANDROID_MEMORY_HEAP_ION_H

#include <stdlib.h>
#include <stdint.h>

#include <binder/MemoryHeapBase.h>
#include <binder/IMemory.h>
#include <utils/SortedVector.h>
#include <utils/threads.h>
#include <linux/ion.h>

namespace android {

class MemoryHeapBase;

// ---------------------------------------------------------------------------

class MemoryHeapIon : public MemoryHeapBase
{
public:
    MemoryHeapIon(const char*, size_t, uint32_t, long unsigned int);
    MemoryHeapIon();
    ~MemoryHeapIon();

    status_t mapIonFd(int fd, size_t size, unsigned long memory_type, int flags);

    status_t ionInit(int ionFd, void *base, int size, int flags,
                                const char* device, struct ion_handle *handle,
                                int ionMapFd);

private:
	int mIonDeviceFd;  /*fd we get from open("/dev/ion")*/
	struct ion_handle *mIonHandle;  /*handle we get from ION_IOC_ALLOC*/ };

// ---------------------------------------------------------------------------
}; // namespace android

#endif // ANDROID_MEMORY_HEAP_ION_H
Loading