1 /* 2 * Copyright 2022 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package org.hyphonate.megaaudio.common; 17 18 /** 19 * Control of Global attributes 20 */ 21 public class Globals { 22 /** 23 * Enables/Disables Oboe Workarounds. 24 * @param enabled if true, turns on Oboe "Workarounds" 25 */ setOboeWorkaroundsEnabled(boolean enabled)26 public static native void setOboeWorkaroundsEnabled(boolean enabled); 27 28 /** 29 * @return true if MMAP mode is supported. 30 */ isMMapSupported()31 public static native boolean isMMapSupported(); 32 33 /** 34 * @return true if MMAP Exclusive mode is supported. 35 */ isMMapExclusiveSupported()36 public static native boolean isMMapExclusiveSupported(); 37 38 /** 39 * Enables/Disables MMAP on any stream 40 * @param enabled Specifies the enable/disable state 41 */ setMMapEnabled(boolean enabled)42 public static native void setMMapEnabled(boolean enabled); 43 44 /** 45 * Gets the MMAP enable state 46 * @return true if MMAP is enabled 47 */ isMMapEnabled()48 public static native boolean isMMapEnabled(); 49 } 50