Loading api/system-current.txt +17 −2 Original line number Original line Diff line number Diff line Loading @@ -1711,6 +1711,15 @@ package android.hardware.radio { field public static final int CLASS_AM_FM = 0; // 0x0 field public static final int CLASS_AM_FM = 0; // 0x0 field public static final int CLASS_DT = 2; // 0x2 field public static final int CLASS_DT = 2; // 0x2 field public static final int CLASS_SAT = 1; // 0x1 field public static final int CLASS_SAT = 1; // 0x1 field public static final int CONFIG_DAB_DAB_LINKING = 6; // 0x6 field public static final int CONFIG_DAB_DAB_SOFT_LINKING = 8; // 0x8 field public static final int CONFIG_DAB_FM_LINKING = 7; // 0x7 field public static final int CONFIG_DAB_FM_SOFT_LINKING = 9; // 0x9 field public static final int CONFIG_FORCE_ANALOG = 2; // 0x2 field public static final int CONFIG_FORCE_DIGITAL = 3; // 0x3 field public static final int CONFIG_FORCE_MONO = 1; // 0x1 field public static final int CONFIG_RDS_AF = 4; // 0x4 field public static final int CONFIG_RDS_REG = 5; // 0x5 field public static final int REGION_ITU_1 = 0; // 0x0 field public static final int REGION_ITU_1 = 0; // 0x0 field public static final int REGION_ITU_2 = 1; // 0x1 field public static final int REGION_ITU_2 = 1; // 0x1 field public static final int REGION_JAPAN = 3; // 0x3 field public static final int REGION_JAPAN = 3; // 0x3 Loading Loading @@ -1890,15 +1899,20 @@ package android.hardware.radio { method public abstract void close(); method public abstract void close(); method public abstract int getConfiguration(android.hardware.radio.RadioManager.BandConfig[]); method public abstract int getConfiguration(android.hardware.radio.RadioManager.BandConfig[]); method public abstract boolean getMute(); method public abstract boolean getMute(); method public java.util.Map<java.lang.String, java.lang.String> getParameters(java.util.List<java.lang.String>); method public abstract int getProgramInformation(android.hardware.radio.RadioManager.ProgramInfo[]); method public abstract int getProgramInformation(android.hardware.radio.RadioManager.ProgramInfo[]); method public abstract java.util.List<android.hardware.radio.RadioManager.ProgramInfo> getProgramList(java.util.Map<java.lang.String, java.lang.String>); method public abstract java.util.List<android.hardware.radio.RadioManager.ProgramInfo> getProgramList(java.util.Map<java.lang.String, java.lang.String>); method public abstract boolean hasControl(); method public abstract boolean hasControl(); method public abstract boolean isAnalogForced(); method public abstract deprecated boolean isAnalogForced(); method public abstract boolean isAntennaConnected(); method public abstract boolean isAntennaConnected(); method public boolean isConfigFlagSet(int); method public boolean isConfigFlagSupported(int); method public abstract int scan(int, boolean); method public abstract int scan(int, boolean); method public abstract void setAnalogForced(boolean); method public abstract deprecated void setAnalogForced(boolean); method public void setConfigFlag(int, boolean); method public abstract int setConfiguration(android.hardware.radio.RadioManager.BandConfig); method public abstract int setConfiguration(android.hardware.radio.RadioManager.BandConfig); method public abstract int setMute(boolean); method public abstract int setMute(boolean); method public java.util.Map<java.lang.String, java.lang.String> setParameters(java.util.Map<java.lang.String, java.lang.String>); method public abstract boolean startBackgroundScan(); method public abstract boolean startBackgroundScan(); method public abstract int step(int, boolean); method public abstract int step(int, boolean); method public abstract deprecated int tune(int, int); method public abstract deprecated int tune(int, int); Loading @@ -1924,6 +1938,7 @@ package android.hardware.radio { method public void onEmergencyAnnouncement(boolean); method public void onEmergencyAnnouncement(boolean); method public void onError(int); method public void onError(int); method public deprecated void onMetadataChanged(android.hardware.radio.RadioMetadata); method public deprecated void onMetadataChanged(android.hardware.radio.RadioMetadata); method public void onParametersUpdated(java.util.Map<java.lang.String, java.lang.String>); method public void onProgramInfoChanged(android.hardware.radio.RadioManager.ProgramInfo); method public void onProgramInfoChanged(android.hardware.radio.RadioManager.ProgramInfo); method public void onProgramListChanged(); method public void onProgramListChanged(); method public void onTrafficAnnouncement(boolean); method public void onTrafficAnnouncement(boolean); Loading core/java/android/hardware/radio/ITuner.aidl +3 −11 Original line number Original line Diff line number Diff line Loading @@ -82,17 +82,9 @@ interface ITuner { */ */ List<RadioManager.ProgramInfo> getProgramList(in Map vendorFilter); List<RadioManager.ProgramInfo> getProgramList(in Map vendorFilter); /** boolean isConfigFlagSupported(int flag); * @throws IllegalStateException if the switch is not supported at current boolean isConfigFlagSet(int flag); * configuration. void setConfigFlag(int flag, boolean value); */ boolean isAnalogForced(); /** * @throws IllegalStateException if the switch is not supported at current * configuration. */ void setAnalogForced(boolean isForced); /** /** * @param parameters Vendor-specific key-value pairs, must be Map<String, String> * @param parameters Vendor-specific key-value pairs, must be Map<String, String> Loading core/java/android/hardware/radio/RadioManager.java +65 −0 Original line number Original line Diff line number Diff line Loading @@ -120,6 +120,71 @@ public class RadioManager { * @see BandDescriptor */ * @see BandDescriptor */ public static final int REGION_KOREA = 4; public static final int REGION_KOREA = 4; /** * Forces mono audio stream reception. * * Analog broadcasts can recover poor reception conditions by jointing * stereo channels into one. Mainly for, but not limited to AM/FM. */ public static final int CONFIG_FORCE_MONO = 1; /** * Forces the analog playback for the supporting radio technology. * * User may disable digital playback for FM HD Radio or hybrid FM/DAB with * this option. This is purely user choice, ie. does not reflect digital- * analog handover state managed from the HAL implementation side. * * Some radio technologies may not support this, ie. DAB. */ public static final int CONFIG_FORCE_ANALOG = 2; /** * Forces the digital playback for the supporting radio technology. * * User may disable digital-analog handover that happens with poor * reception conditions. With digital forced, the radio will remain silent * instead of switching to analog channel if it's available. This is purely * user choice, it does not reflect the actual state of handover. */ public static final int CONFIG_FORCE_DIGITAL = 3; /** * RDS Alternative Frequencies. * * If set and the currently tuned RDS station broadcasts on multiple * channels, radio tuner automatically switches to the best available * alternative. */ public static final int CONFIG_RDS_AF = 4; /** * RDS region-specific program lock-down. * * Allows user to lock to the current region as they move into the * other region. */ public static final int CONFIG_RDS_REG = 5; /** Enables DAB-DAB hard- and implicit-linking (the same content). */ public static final int CONFIG_DAB_DAB_LINKING = 6; /** Enables DAB-FM hard- and implicit-linking (the same content). */ public static final int CONFIG_DAB_FM_LINKING = 7; /** Enables DAB-DAB soft-linking (related content). */ public static final int CONFIG_DAB_DAB_SOFT_LINKING = 8; /** Enables DAB-FM soft-linking (related content). */ public static final int CONFIG_DAB_FM_SOFT_LINKING = 9; /** @hide */ @IntDef(prefix = { "CONFIG_" }, value = { CONFIG_FORCE_MONO, CONFIG_FORCE_ANALOG, CONFIG_FORCE_DIGITAL, CONFIG_RDS_AF, CONFIG_RDS_REG, CONFIG_DAB_DAB_LINKING, CONFIG_DAB_FM_LINKING, CONFIG_DAB_DAB_SOFT_LINKING, CONFIG_DAB_FM_SOFT_LINKING, }) @Retention(RetentionPolicy.SOURCE) public @interface ConfigFlag {} private static void writeStringMap(@NonNull Parcel dest, @NonNull Map<String, String> map) { private static void writeStringMap(@NonNull Parcel dest, @NonNull Map<String, String> map) { dest.writeInt(map.size()); dest.writeInt(map.size()); for (Map.Entry<String, String> entry : map.entrySet()) { for (Map.Entry<String, String> entry : map.entrySet()) { Loading core/java/android/hardware/radio/RadioTuner.java +51 −7 Original line number Original line Diff line number Diff line Loading @@ -290,7 +290,9 @@ public abstract class RadioTuner { * @throws IllegalStateException if the switch is not supported at current * @throws IllegalStateException if the switch is not supported at current * configuration. * configuration. * @return {@code true} if analog is forced, {@code false} otherwise. * @return {@code true} if analog is forced, {@code false} otherwise. * @deprecated Use {@link isConfigFlagSet(int)} instead. */ */ @Deprecated public abstract boolean isAnalogForced(); public abstract boolean isAnalogForced(); /** /** Loading @@ -305,9 +307,49 @@ public abstract class RadioTuner { * @param isForced {@code true} to force analog, {@code false} for a default behaviour. * @param isForced {@code true} to force analog, {@code false} for a default behaviour. * @throws IllegalStateException if the switch is not supported at current * @throws IllegalStateException if the switch is not supported at current * configuration. * configuration. * @deprecated Use {@link setConfigFlag(int, boolean)} instead. */ */ @Deprecated public abstract void setAnalogForced(boolean isForced); public abstract void setAnalogForced(boolean isForced); /** * Checks, if a given config flag is supported * * @param flag Flag to check. * @return True, if the flag is supported. */ public boolean isConfigFlagSupported(@RadioManager.ConfigFlag int flag) { return false; } /** * Fetches the current setting of a given config flag. * * The success/failure result is consistent with isConfigFlagSupported. * * @param flag Flag to fetch. * @return The current value of the flag. * @throws IllegalStateException if the flag is not applicable right now. * @throws UnsupportedOperationException if the flag is not supported at all. */ public boolean isConfigFlagSet(@RadioManager.ConfigFlag int flag) { throw new UnsupportedOperationException(); } /** * Sets the config flag. * * The success/failure result is consistent with isConfigFlagSupported. * * @param flag Flag to set. * @param value The new value of a given flag. * @throws IllegalStateException if the flag is not applicable right now. * @throws UnsupportedOperationException if the flag is not supported at all. */ public void setConfigFlag(@RadioManager.ConfigFlag int flag, boolean value) { throw new UnsupportedOperationException(); } /** /** * Generic method for setting vendor-specific parameter values. * Generic method for setting vendor-specific parameter values. * The framework does not interpret the parameters, they are passed * The framework does not interpret the parameters, they are passed Loading @@ -316,6 +358,7 @@ public abstract class RadioTuner { * Framework does not make any assumptions on the keys or values, other than * Framework does not make any assumptions on the keys or values, other than * ones stated in VendorKeyValue documentation (a requirement of key * ones stated in VendorKeyValue documentation (a requirement of key * prefixes). * prefixes). * See VendorKeyValue at hardware/interfaces/broadcastradio/2.0/types.hal. * * * For each pair in the result map, the key will be one of the keys * For each pair in the result map, the key will be one of the keys * contained in the input (possibly with wildcards expanded), and the value * contained in the input (possibly with wildcards expanded), and the value Loading @@ -332,10 +375,11 @@ public abstract class RadioTuner { * * * @param parameters Vendor-specific key-value pairs. * @param parameters Vendor-specific key-value pairs. * @return Operation completion status for parameters being set. * @return Operation completion status for parameters being set. * @hide FutureFeature */ */ public abstract @NonNull Map<String, String> public @NonNull Map<String, String> setParameters(@NonNull Map<String, String> parameters); setParameters(@NonNull Map<String, String> parameters) { throw new UnsupportedOperationException(); } /** /** * Generic method for retrieving vendor-specific parameter values. * Generic method for retrieving vendor-specific parameter values. Loading @@ -355,10 +399,11 @@ public abstract class RadioTuner { * * * @param keys Parameter keys to fetch. * @param keys Parameter keys to fetch. * @return Vendor-specific key-value pairs. * @return Vendor-specific key-value pairs. * @hide FutureFeature */ */ public abstract @NonNull Map<String, String> public @NonNull Map<String, String> getParameters(@NonNull List<String> keys); getParameters(@NonNull List<String> keys) { throw new UnsupportedOperationException(); } /** /** * Get current antenna connection state for current configuration. * Get current antenna connection state for current configuration. Loading Loading @@ -494,7 +539,6 @@ public abstract class RadioTuner { * asynchronously. * asynchronously. * * * @param parameters Vendor-specific key-value pairs. * @param parameters Vendor-specific key-value pairs. * @hide FutureFeature */ */ public void onParametersUpdated(@NonNull Map<String, String> parameters) {} public void onParametersUpdated(@NonNull Map<String, String> parameters) {} } } Loading core/java/android/hardware/radio/TunerAdapter.java +22 −3 Original line number Original line Diff line number Diff line Loading @@ -236,17 +236,36 @@ class TunerAdapter extends RadioTuner { @Override @Override public boolean isAnalogForced() { public boolean isAnalogForced() { return isConfigFlagSet(RadioManager.CONFIG_FORCE_ANALOG); } @Override public void setAnalogForced(boolean isForced) { setConfigFlag(RadioManager.CONFIG_FORCE_ANALOG, isForced); } @Override public boolean isConfigFlagSupported(@RadioManager.ConfigFlag int flag) { try { try { return mTuner.isAnalogForced(); return mTuner.isConfigFlagSupported(flag); } catch (RemoteException e) { } catch (RemoteException e) { throw new RuntimeException("service died", e); throw new RuntimeException("service died", e); } } } } @Override @Override public void setAnalogForced(boolean isForced) { public boolean isConfigFlagSet(@RadioManager.ConfigFlag int flag) { try { return mTuner.isConfigFlagSet(flag); } catch (RemoteException e) { throw new RuntimeException("service died", e); } } @Override public void setConfigFlag(@RadioManager.ConfigFlag int flag, boolean value) { try { try { mTuner.setAnalogForced(isForced); mTuner.setConfigFlag(flag, value); } catch (RemoteException e) { } catch (RemoteException e) { throw new RuntimeException("service died", e); throw new RuntimeException("service died", e); } } Loading Loading
api/system-current.txt +17 −2 Original line number Original line Diff line number Diff line Loading @@ -1711,6 +1711,15 @@ package android.hardware.radio { field public static final int CLASS_AM_FM = 0; // 0x0 field public static final int CLASS_AM_FM = 0; // 0x0 field public static final int CLASS_DT = 2; // 0x2 field public static final int CLASS_DT = 2; // 0x2 field public static final int CLASS_SAT = 1; // 0x1 field public static final int CLASS_SAT = 1; // 0x1 field public static final int CONFIG_DAB_DAB_LINKING = 6; // 0x6 field public static final int CONFIG_DAB_DAB_SOFT_LINKING = 8; // 0x8 field public static final int CONFIG_DAB_FM_LINKING = 7; // 0x7 field public static final int CONFIG_DAB_FM_SOFT_LINKING = 9; // 0x9 field public static final int CONFIG_FORCE_ANALOG = 2; // 0x2 field public static final int CONFIG_FORCE_DIGITAL = 3; // 0x3 field public static final int CONFIG_FORCE_MONO = 1; // 0x1 field public static final int CONFIG_RDS_AF = 4; // 0x4 field public static final int CONFIG_RDS_REG = 5; // 0x5 field public static final int REGION_ITU_1 = 0; // 0x0 field public static final int REGION_ITU_1 = 0; // 0x0 field public static final int REGION_ITU_2 = 1; // 0x1 field public static final int REGION_ITU_2 = 1; // 0x1 field public static final int REGION_JAPAN = 3; // 0x3 field public static final int REGION_JAPAN = 3; // 0x3 Loading Loading @@ -1890,15 +1899,20 @@ package android.hardware.radio { method public abstract void close(); method public abstract void close(); method public abstract int getConfiguration(android.hardware.radio.RadioManager.BandConfig[]); method public abstract int getConfiguration(android.hardware.radio.RadioManager.BandConfig[]); method public abstract boolean getMute(); method public abstract boolean getMute(); method public java.util.Map<java.lang.String, java.lang.String> getParameters(java.util.List<java.lang.String>); method public abstract int getProgramInformation(android.hardware.radio.RadioManager.ProgramInfo[]); method public abstract int getProgramInformation(android.hardware.radio.RadioManager.ProgramInfo[]); method public abstract java.util.List<android.hardware.radio.RadioManager.ProgramInfo> getProgramList(java.util.Map<java.lang.String, java.lang.String>); method public abstract java.util.List<android.hardware.radio.RadioManager.ProgramInfo> getProgramList(java.util.Map<java.lang.String, java.lang.String>); method public abstract boolean hasControl(); method public abstract boolean hasControl(); method public abstract boolean isAnalogForced(); method public abstract deprecated boolean isAnalogForced(); method public abstract boolean isAntennaConnected(); method public abstract boolean isAntennaConnected(); method public boolean isConfigFlagSet(int); method public boolean isConfigFlagSupported(int); method public abstract int scan(int, boolean); method public abstract int scan(int, boolean); method public abstract void setAnalogForced(boolean); method public abstract deprecated void setAnalogForced(boolean); method public void setConfigFlag(int, boolean); method public abstract int setConfiguration(android.hardware.radio.RadioManager.BandConfig); method public abstract int setConfiguration(android.hardware.radio.RadioManager.BandConfig); method public abstract int setMute(boolean); method public abstract int setMute(boolean); method public java.util.Map<java.lang.String, java.lang.String> setParameters(java.util.Map<java.lang.String, java.lang.String>); method public abstract boolean startBackgroundScan(); method public abstract boolean startBackgroundScan(); method public abstract int step(int, boolean); method public abstract int step(int, boolean); method public abstract deprecated int tune(int, int); method public abstract deprecated int tune(int, int); Loading @@ -1924,6 +1938,7 @@ package android.hardware.radio { method public void onEmergencyAnnouncement(boolean); method public void onEmergencyAnnouncement(boolean); method public void onError(int); method public void onError(int); method public deprecated void onMetadataChanged(android.hardware.radio.RadioMetadata); method public deprecated void onMetadataChanged(android.hardware.radio.RadioMetadata); method public void onParametersUpdated(java.util.Map<java.lang.String, java.lang.String>); method public void onProgramInfoChanged(android.hardware.radio.RadioManager.ProgramInfo); method public void onProgramInfoChanged(android.hardware.radio.RadioManager.ProgramInfo); method public void onProgramListChanged(); method public void onProgramListChanged(); method public void onTrafficAnnouncement(boolean); method public void onTrafficAnnouncement(boolean); Loading
core/java/android/hardware/radio/ITuner.aidl +3 −11 Original line number Original line Diff line number Diff line Loading @@ -82,17 +82,9 @@ interface ITuner { */ */ List<RadioManager.ProgramInfo> getProgramList(in Map vendorFilter); List<RadioManager.ProgramInfo> getProgramList(in Map vendorFilter); /** boolean isConfigFlagSupported(int flag); * @throws IllegalStateException if the switch is not supported at current boolean isConfigFlagSet(int flag); * configuration. void setConfigFlag(int flag, boolean value); */ boolean isAnalogForced(); /** * @throws IllegalStateException if the switch is not supported at current * configuration. */ void setAnalogForced(boolean isForced); /** /** * @param parameters Vendor-specific key-value pairs, must be Map<String, String> * @param parameters Vendor-specific key-value pairs, must be Map<String, String> Loading
core/java/android/hardware/radio/RadioManager.java +65 −0 Original line number Original line Diff line number Diff line Loading @@ -120,6 +120,71 @@ public class RadioManager { * @see BandDescriptor */ * @see BandDescriptor */ public static final int REGION_KOREA = 4; public static final int REGION_KOREA = 4; /** * Forces mono audio stream reception. * * Analog broadcasts can recover poor reception conditions by jointing * stereo channels into one. Mainly for, but not limited to AM/FM. */ public static final int CONFIG_FORCE_MONO = 1; /** * Forces the analog playback for the supporting radio technology. * * User may disable digital playback for FM HD Radio or hybrid FM/DAB with * this option. This is purely user choice, ie. does not reflect digital- * analog handover state managed from the HAL implementation side. * * Some radio technologies may not support this, ie. DAB. */ public static final int CONFIG_FORCE_ANALOG = 2; /** * Forces the digital playback for the supporting radio technology. * * User may disable digital-analog handover that happens with poor * reception conditions. With digital forced, the radio will remain silent * instead of switching to analog channel if it's available. This is purely * user choice, it does not reflect the actual state of handover. */ public static final int CONFIG_FORCE_DIGITAL = 3; /** * RDS Alternative Frequencies. * * If set and the currently tuned RDS station broadcasts on multiple * channels, radio tuner automatically switches to the best available * alternative. */ public static final int CONFIG_RDS_AF = 4; /** * RDS region-specific program lock-down. * * Allows user to lock to the current region as they move into the * other region. */ public static final int CONFIG_RDS_REG = 5; /** Enables DAB-DAB hard- and implicit-linking (the same content). */ public static final int CONFIG_DAB_DAB_LINKING = 6; /** Enables DAB-FM hard- and implicit-linking (the same content). */ public static final int CONFIG_DAB_FM_LINKING = 7; /** Enables DAB-DAB soft-linking (related content). */ public static final int CONFIG_DAB_DAB_SOFT_LINKING = 8; /** Enables DAB-FM soft-linking (related content). */ public static final int CONFIG_DAB_FM_SOFT_LINKING = 9; /** @hide */ @IntDef(prefix = { "CONFIG_" }, value = { CONFIG_FORCE_MONO, CONFIG_FORCE_ANALOG, CONFIG_FORCE_DIGITAL, CONFIG_RDS_AF, CONFIG_RDS_REG, CONFIG_DAB_DAB_LINKING, CONFIG_DAB_FM_LINKING, CONFIG_DAB_DAB_SOFT_LINKING, CONFIG_DAB_FM_SOFT_LINKING, }) @Retention(RetentionPolicy.SOURCE) public @interface ConfigFlag {} private static void writeStringMap(@NonNull Parcel dest, @NonNull Map<String, String> map) { private static void writeStringMap(@NonNull Parcel dest, @NonNull Map<String, String> map) { dest.writeInt(map.size()); dest.writeInt(map.size()); for (Map.Entry<String, String> entry : map.entrySet()) { for (Map.Entry<String, String> entry : map.entrySet()) { Loading
core/java/android/hardware/radio/RadioTuner.java +51 −7 Original line number Original line Diff line number Diff line Loading @@ -290,7 +290,9 @@ public abstract class RadioTuner { * @throws IllegalStateException if the switch is not supported at current * @throws IllegalStateException if the switch is not supported at current * configuration. * configuration. * @return {@code true} if analog is forced, {@code false} otherwise. * @return {@code true} if analog is forced, {@code false} otherwise. * @deprecated Use {@link isConfigFlagSet(int)} instead. */ */ @Deprecated public abstract boolean isAnalogForced(); public abstract boolean isAnalogForced(); /** /** Loading @@ -305,9 +307,49 @@ public abstract class RadioTuner { * @param isForced {@code true} to force analog, {@code false} for a default behaviour. * @param isForced {@code true} to force analog, {@code false} for a default behaviour. * @throws IllegalStateException if the switch is not supported at current * @throws IllegalStateException if the switch is not supported at current * configuration. * configuration. * @deprecated Use {@link setConfigFlag(int, boolean)} instead. */ */ @Deprecated public abstract void setAnalogForced(boolean isForced); public abstract void setAnalogForced(boolean isForced); /** * Checks, if a given config flag is supported * * @param flag Flag to check. * @return True, if the flag is supported. */ public boolean isConfigFlagSupported(@RadioManager.ConfigFlag int flag) { return false; } /** * Fetches the current setting of a given config flag. * * The success/failure result is consistent with isConfigFlagSupported. * * @param flag Flag to fetch. * @return The current value of the flag. * @throws IllegalStateException if the flag is not applicable right now. * @throws UnsupportedOperationException if the flag is not supported at all. */ public boolean isConfigFlagSet(@RadioManager.ConfigFlag int flag) { throw new UnsupportedOperationException(); } /** * Sets the config flag. * * The success/failure result is consistent with isConfigFlagSupported. * * @param flag Flag to set. * @param value The new value of a given flag. * @throws IllegalStateException if the flag is not applicable right now. * @throws UnsupportedOperationException if the flag is not supported at all. */ public void setConfigFlag(@RadioManager.ConfigFlag int flag, boolean value) { throw new UnsupportedOperationException(); } /** /** * Generic method for setting vendor-specific parameter values. * Generic method for setting vendor-specific parameter values. * The framework does not interpret the parameters, they are passed * The framework does not interpret the parameters, they are passed Loading @@ -316,6 +358,7 @@ public abstract class RadioTuner { * Framework does not make any assumptions on the keys or values, other than * Framework does not make any assumptions on the keys or values, other than * ones stated in VendorKeyValue documentation (a requirement of key * ones stated in VendorKeyValue documentation (a requirement of key * prefixes). * prefixes). * See VendorKeyValue at hardware/interfaces/broadcastradio/2.0/types.hal. * * * For each pair in the result map, the key will be one of the keys * For each pair in the result map, the key will be one of the keys * contained in the input (possibly with wildcards expanded), and the value * contained in the input (possibly with wildcards expanded), and the value Loading @@ -332,10 +375,11 @@ public abstract class RadioTuner { * * * @param parameters Vendor-specific key-value pairs. * @param parameters Vendor-specific key-value pairs. * @return Operation completion status for parameters being set. * @return Operation completion status for parameters being set. * @hide FutureFeature */ */ public abstract @NonNull Map<String, String> public @NonNull Map<String, String> setParameters(@NonNull Map<String, String> parameters); setParameters(@NonNull Map<String, String> parameters) { throw new UnsupportedOperationException(); } /** /** * Generic method for retrieving vendor-specific parameter values. * Generic method for retrieving vendor-specific parameter values. Loading @@ -355,10 +399,11 @@ public abstract class RadioTuner { * * * @param keys Parameter keys to fetch. * @param keys Parameter keys to fetch. * @return Vendor-specific key-value pairs. * @return Vendor-specific key-value pairs. * @hide FutureFeature */ */ public abstract @NonNull Map<String, String> public @NonNull Map<String, String> getParameters(@NonNull List<String> keys); getParameters(@NonNull List<String> keys) { throw new UnsupportedOperationException(); } /** /** * Get current antenna connection state for current configuration. * Get current antenna connection state for current configuration. Loading Loading @@ -494,7 +539,6 @@ public abstract class RadioTuner { * asynchronously. * asynchronously. * * * @param parameters Vendor-specific key-value pairs. * @param parameters Vendor-specific key-value pairs. * @hide FutureFeature */ */ public void onParametersUpdated(@NonNull Map<String, String> parameters) {} public void onParametersUpdated(@NonNull Map<String, String> parameters) {} } } Loading
core/java/android/hardware/radio/TunerAdapter.java +22 −3 Original line number Original line Diff line number Diff line Loading @@ -236,17 +236,36 @@ class TunerAdapter extends RadioTuner { @Override @Override public boolean isAnalogForced() { public boolean isAnalogForced() { return isConfigFlagSet(RadioManager.CONFIG_FORCE_ANALOG); } @Override public void setAnalogForced(boolean isForced) { setConfigFlag(RadioManager.CONFIG_FORCE_ANALOG, isForced); } @Override public boolean isConfigFlagSupported(@RadioManager.ConfigFlag int flag) { try { try { return mTuner.isAnalogForced(); return mTuner.isConfigFlagSupported(flag); } catch (RemoteException e) { } catch (RemoteException e) { throw new RuntimeException("service died", e); throw new RuntimeException("service died", e); } } } } @Override @Override public void setAnalogForced(boolean isForced) { public boolean isConfigFlagSet(@RadioManager.ConfigFlag int flag) { try { return mTuner.isConfigFlagSet(flag); } catch (RemoteException e) { throw new RuntimeException("service died", e); } } @Override public void setConfigFlag(@RadioManager.ConfigFlag int flag, boolean value) { try { try { mTuner.setAnalogForced(isForced); mTuner.setConfigFlag(flag, value); } catch (RemoteException e) { } catch (RemoteException e) { throw new RuntimeException("service died", e); throw new RuntimeException("service died", e); } } Loading