Loading api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -2101,6 +2101,7 @@ package android.hardware.radio { method public java.lang.String getVersion(); method public boolean isBackgroundScanningSupported(); method public boolean isCaptureSupported(); method public boolean isInitializationRequired(); method public boolean isProgramIdentifierSupported(int); method public boolean isProgramTypeSupported(int); method public void writeToParcel(android.os.Parcel, int); Loading core/java/android/hardware/radio/RadioManager.java +22 −3 Original line number Diff line number Diff line Loading @@ -211,6 +211,7 @@ public class RadioManager { private final String mSerial; private final int mNumTuners; private final int mNumAudioSources; private final boolean mIsInitializationRequired; private final boolean mIsCaptureSupported; private final BandDescriptor[] mBands; private final boolean mIsBgScanSupported; Loading @@ -222,7 +223,8 @@ public class RadioManager { /** @hide */ public ModuleProperties(int id, String serviceName, int classId, String implementor, String product, String version, String serial, int numTuners, int numAudioSources, boolean isCaptureSupported, BandDescriptor[] bands, boolean isBgScanSupported, boolean isInitializationRequired, boolean isCaptureSupported, BandDescriptor[] bands, boolean isBgScanSupported, @ProgramSelector.ProgramType int[] supportedProgramTypes, @ProgramSelector.IdentifierType int[] supportedIdentifierTypes, @Nullable Map<String, Integer> dabFrequencyTable, Loading @@ -236,6 +238,7 @@ public class RadioManager { mSerial = serial; mNumTuners = numTuners; mNumAudioSources = numAudioSources; mIsInitializationRequired = isInitializationRequired; mIsCaptureSupported = isCaptureSupported; mBands = bands; mIsBgScanSupported = isBgScanSupported; Loading Loading @@ -329,6 +332,18 @@ public class RadioManager { return mNumAudioSources; } /** * Checks, if BandConfig initialization (after {@link RadioManager#openTuner}) * is required to be done before other operations or not. * * If it is, the client has to wait for {@link RadioTuner.Callback#onConfigurationChanged} * callback before executing any other operations. Otherwise, such operation will fail * returning {@link RadioManager#STATUS_INVALID_OPERATION} error code. */ public boolean isInitializationRequired() { return mIsInitializationRequired; } /** {@code true} if audio capture is possible from radio tuner output. * This indicates if routing to audio devices not connected to the same HAL as the FM radio * is possible (e.g. to USB) or DAR (Digital Audio Recorder) feature can be implemented. Loading Loading @@ -419,6 +434,7 @@ public class RadioManager { mSerial = in.readString(); mNumTuners = in.readInt(); mNumAudioSources = in.readInt(); mIsInitializationRequired = in.readInt() == 1; mIsCaptureSupported = in.readInt() == 1; Parcelable[] tmp = in.readParcelableArray(BandDescriptor.class.getClassLoader()); mBands = new BandDescriptor[tmp.length]; Loading Loading @@ -454,6 +470,7 @@ public class RadioManager { dest.writeString(mSerial); dest.writeInt(mNumTuners); dest.writeInt(mNumAudioSources); dest.writeInt(mIsInitializationRequired ? 1 : 0); dest.writeInt(mIsCaptureSupported ? 1 : 0); dest.writeParcelableArray(mBands, flags); dest.writeInt(mIsBgScanSupported ? 1 : 0); Loading @@ -476,6 +493,7 @@ public class RadioManager { + ", mVersion=" + mVersion + ", mSerial=" + mSerial + ", mNumTuners=" + mNumTuners + ", mNumAudioSources=" + mNumAudioSources + ", mIsInitializationRequired=" + mIsInitializationRequired + ", mIsCaptureSupported=" + mIsCaptureSupported + ", mIsBgScanSupported=" + mIsBgScanSupported + ", mBands=" + Arrays.toString(mBands) + "]"; Loading @@ -484,8 +502,8 @@ public class RadioManager { @Override public int hashCode() { return Objects.hash(mId, mServiceName, mClassId, mImplementor, mProduct, mVersion, mSerial, mNumTuners, mNumAudioSources, mIsCaptureSupported, mBands, mIsBgScanSupported, mDabFrequencyTable, mVendorInfo); mSerial, mNumTuners, mNumAudioSources, mIsInitializationRequired, mIsCaptureSupported, mBands, mIsBgScanSupported, mDabFrequencyTable, mVendorInfo); } @Override Loading @@ -503,6 +521,7 @@ public class RadioManager { if (!Objects.equals(mSerial, other.mSerial)) return false; if (mNumTuners != other.mNumTuners) return false; if (mNumAudioSources != other.mNumAudioSources) return false; if (mIsInitializationRequired != other.mIsInitializationRequired) return false; if (mIsCaptureSupported != other.mIsCaptureSupported) return false; if (!Objects.equals(mBands, other.mBands)) return false; if (mIsBgScanSupported != other.mIsBgScanSupported) return false; Loading services/core/java/com/android/server/broadcastradio/hal2/Convert.java +1 −0 Original line number Diff line number Diff line Loading @@ -232,6 +232,7 @@ class Convert { * HAL implementation instance. */ 1, // numTuners 1, // numAudioSources false, // isInitializationRequired false, // isCaptureSupported amfmConfigToBands(amfmConfig), Loading services/core/jni/BroadcastRadio/convert.cpp +5 −4 Original line number Diff line number Diff line Loading @@ -380,6 +380,7 @@ static JavaRef<jobject> ModulePropertiesFromHal(JNIEnv *env, const V1_0::Propert auto jProduct = make_javastr(env, prop10.product); auto jVersion = make_javastr(env, prop10.version); auto jSerial = make_javastr(env, prop10.serial); constexpr bool isInitializationRequired = true; bool isBgScanSupported = prop11 ? prop11->supportsBackgroundScanning : false; auto jVendorInfo = prop11 ? VendorInfoFromHal(env, prop11->vendorInfo) : nullptr; Loading @@ -394,9 +395,9 @@ static JavaRef<jobject> ModulePropertiesFromHal(JNIEnv *env, const V1_0::Propert return make_javaref(env, env->NewObject(gjni.ModuleProperties.clazz, gjni.ModuleProperties.cstor, moduleId, jServiceName.get(), prop10.classId, jImplementor.get(), jProduct.get(), jVersion.get(), jSerial.get(), prop10.numTuners, prop10.numAudioSources, prop10.supportsCapture, jBands.get(), isBgScanSupported, jSupportedProgramTypes.get(), jSupportedIdentifierTypes.get(), nullptr, jVendorInfo.get())); prop10.numAudioSources, isInitializationRequired, prop10.supportsCapture, jBands.get(), isBgScanSupported, jSupportedProgramTypes.get(), jSupportedIdentifierTypes.get(), nullptr, jVendorInfo.get())); } JavaRef<jobject> ModulePropertiesFromHal(JNIEnv *env, const V1_0::Properties &properties, Loading Loading @@ -712,7 +713,7 @@ void register_android_server_broadcastradio_convert(JNIEnv *env) { gjni.ModuleProperties.clazz = MakeGlobalRefOrDie(env, modulePropertiesClass); gjni.ModuleProperties.cstor = GetMethodIDOrDie(env, modulePropertiesClass, "<init>", "(ILjava/lang/String;ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;" "Ljava/lang/String;IIZ[Landroid/hardware/radio/RadioManager$BandDescriptor;Z" "Ljava/lang/String;IIZZ[Landroid/hardware/radio/RadioManager$BandDescriptor;Z" "[I[ILjava/util/Map;Ljava/util/Map;)V"); auto programInfoClass = FindClassOrDie(env, "android/hardware/radio/RadioManager$ProgramInfo"); Loading Loading
api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -2101,6 +2101,7 @@ package android.hardware.radio { method public java.lang.String getVersion(); method public boolean isBackgroundScanningSupported(); method public boolean isCaptureSupported(); method public boolean isInitializationRequired(); method public boolean isProgramIdentifierSupported(int); method public boolean isProgramTypeSupported(int); method public void writeToParcel(android.os.Parcel, int); Loading
core/java/android/hardware/radio/RadioManager.java +22 −3 Original line number Diff line number Diff line Loading @@ -211,6 +211,7 @@ public class RadioManager { private final String mSerial; private final int mNumTuners; private final int mNumAudioSources; private final boolean mIsInitializationRequired; private final boolean mIsCaptureSupported; private final BandDescriptor[] mBands; private final boolean mIsBgScanSupported; Loading @@ -222,7 +223,8 @@ public class RadioManager { /** @hide */ public ModuleProperties(int id, String serviceName, int classId, String implementor, String product, String version, String serial, int numTuners, int numAudioSources, boolean isCaptureSupported, BandDescriptor[] bands, boolean isBgScanSupported, boolean isInitializationRequired, boolean isCaptureSupported, BandDescriptor[] bands, boolean isBgScanSupported, @ProgramSelector.ProgramType int[] supportedProgramTypes, @ProgramSelector.IdentifierType int[] supportedIdentifierTypes, @Nullable Map<String, Integer> dabFrequencyTable, Loading @@ -236,6 +238,7 @@ public class RadioManager { mSerial = serial; mNumTuners = numTuners; mNumAudioSources = numAudioSources; mIsInitializationRequired = isInitializationRequired; mIsCaptureSupported = isCaptureSupported; mBands = bands; mIsBgScanSupported = isBgScanSupported; Loading Loading @@ -329,6 +332,18 @@ public class RadioManager { return mNumAudioSources; } /** * Checks, if BandConfig initialization (after {@link RadioManager#openTuner}) * is required to be done before other operations or not. * * If it is, the client has to wait for {@link RadioTuner.Callback#onConfigurationChanged} * callback before executing any other operations. Otherwise, such operation will fail * returning {@link RadioManager#STATUS_INVALID_OPERATION} error code. */ public boolean isInitializationRequired() { return mIsInitializationRequired; } /** {@code true} if audio capture is possible from radio tuner output. * This indicates if routing to audio devices not connected to the same HAL as the FM radio * is possible (e.g. to USB) or DAR (Digital Audio Recorder) feature can be implemented. Loading Loading @@ -419,6 +434,7 @@ public class RadioManager { mSerial = in.readString(); mNumTuners = in.readInt(); mNumAudioSources = in.readInt(); mIsInitializationRequired = in.readInt() == 1; mIsCaptureSupported = in.readInt() == 1; Parcelable[] tmp = in.readParcelableArray(BandDescriptor.class.getClassLoader()); mBands = new BandDescriptor[tmp.length]; Loading Loading @@ -454,6 +470,7 @@ public class RadioManager { dest.writeString(mSerial); dest.writeInt(mNumTuners); dest.writeInt(mNumAudioSources); dest.writeInt(mIsInitializationRequired ? 1 : 0); dest.writeInt(mIsCaptureSupported ? 1 : 0); dest.writeParcelableArray(mBands, flags); dest.writeInt(mIsBgScanSupported ? 1 : 0); Loading @@ -476,6 +493,7 @@ public class RadioManager { + ", mVersion=" + mVersion + ", mSerial=" + mSerial + ", mNumTuners=" + mNumTuners + ", mNumAudioSources=" + mNumAudioSources + ", mIsInitializationRequired=" + mIsInitializationRequired + ", mIsCaptureSupported=" + mIsCaptureSupported + ", mIsBgScanSupported=" + mIsBgScanSupported + ", mBands=" + Arrays.toString(mBands) + "]"; Loading @@ -484,8 +502,8 @@ public class RadioManager { @Override public int hashCode() { return Objects.hash(mId, mServiceName, mClassId, mImplementor, mProduct, mVersion, mSerial, mNumTuners, mNumAudioSources, mIsCaptureSupported, mBands, mIsBgScanSupported, mDabFrequencyTable, mVendorInfo); mSerial, mNumTuners, mNumAudioSources, mIsInitializationRequired, mIsCaptureSupported, mBands, mIsBgScanSupported, mDabFrequencyTable, mVendorInfo); } @Override Loading @@ -503,6 +521,7 @@ public class RadioManager { if (!Objects.equals(mSerial, other.mSerial)) return false; if (mNumTuners != other.mNumTuners) return false; if (mNumAudioSources != other.mNumAudioSources) return false; if (mIsInitializationRequired != other.mIsInitializationRequired) return false; if (mIsCaptureSupported != other.mIsCaptureSupported) return false; if (!Objects.equals(mBands, other.mBands)) return false; if (mIsBgScanSupported != other.mIsBgScanSupported) return false; Loading
services/core/java/com/android/server/broadcastradio/hal2/Convert.java +1 −0 Original line number Diff line number Diff line Loading @@ -232,6 +232,7 @@ class Convert { * HAL implementation instance. */ 1, // numTuners 1, // numAudioSources false, // isInitializationRequired false, // isCaptureSupported amfmConfigToBands(amfmConfig), Loading
services/core/jni/BroadcastRadio/convert.cpp +5 −4 Original line number Diff line number Diff line Loading @@ -380,6 +380,7 @@ static JavaRef<jobject> ModulePropertiesFromHal(JNIEnv *env, const V1_0::Propert auto jProduct = make_javastr(env, prop10.product); auto jVersion = make_javastr(env, prop10.version); auto jSerial = make_javastr(env, prop10.serial); constexpr bool isInitializationRequired = true; bool isBgScanSupported = prop11 ? prop11->supportsBackgroundScanning : false; auto jVendorInfo = prop11 ? VendorInfoFromHal(env, prop11->vendorInfo) : nullptr; Loading @@ -394,9 +395,9 @@ static JavaRef<jobject> ModulePropertiesFromHal(JNIEnv *env, const V1_0::Propert return make_javaref(env, env->NewObject(gjni.ModuleProperties.clazz, gjni.ModuleProperties.cstor, moduleId, jServiceName.get(), prop10.classId, jImplementor.get(), jProduct.get(), jVersion.get(), jSerial.get(), prop10.numTuners, prop10.numAudioSources, prop10.supportsCapture, jBands.get(), isBgScanSupported, jSupportedProgramTypes.get(), jSupportedIdentifierTypes.get(), nullptr, jVendorInfo.get())); prop10.numAudioSources, isInitializationRequired, prop10.supportsCapture, jBands.get(), isBgScanSupported, jSupportedProgramTypes.get(), jSupportedIdentifierTypes.get(), nullptr, jVendorInfo.get())); } JavaRef<jobject> ModulePropertiesFromHal(JNIEnv *env, const V1_0::Properties &properties, Loading Loading @@ -712,7 +713,7 @@ void register_android_server_broadcastradio_convert(JNIEnv *env) { gjni.ModuleProperties.clazz = MakeGlobalRefOrDie(env, modulePropertiesClass); gjni.ModuleProperties.cstor = GetMethodIDOrDie(env, modulePropertiesClass, "<init>", "(ILjava/lang/String;ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;" "Ljava/lang/String;IIZ[Landroid/hardware/radio/RadioManager$BandDescriptor;Z" "Ljava/lang/String;IIZZ[Landroid/hardware/radio/RadioManager$BandDescriptor;Z" "[I[ILjava/util/Map;Ljava/util/Map;)V"); auto programInfoClass = FindClassOrDie(env, "android/hardware/radio/RadioManager$ProgramInfo"); Loading