android.hardware.ConsumerIrManager Java Examples

The following examples show how to use android.hardware.ConsumerIrManager. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MainActivity.java    From IR-Remote with Apache License 2.0 7 votes vote down vote up
@Override
protected void onCreate(final Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.content_main);
    irManager = (ConsumerIrManager) getSystemService(CONSUMER_IR_SERVICE);

    findViewById(R.id.tvpower).setOnClickListener(new ClickListener(hex2ir(CMD_TV_POWER)));
    findViewById(R.id.tvsource).setOnClickListener(new ClickListener(hex2ir(CMD_TV_SOURCE)));
    findViewById(R.id.tvchnext).setOnClickListener(new ClickListener(hex2ir(CMD_TV_CH_NEXT)));
    findViewById(R.id.tvchprev).setOnClickListener(new ClickListener(hex2ir(CMD_TV_CH_PREV)));
    findViewById(R.id.tvback).setOnClickListener(new ClickListener(hex2ir(CMD_TV_BACK)));
    findViewById(R.id.tvleft).setOnClickListener(new ClickListener(hex2ir(CMD_TV_LEFT)));
    findViewById(R.id.tvright).setOnClickListener(new ClickListener(hex2ir(CMD_TV_RIGHT)));
    findViewById(R.id.tvok).setOnClickListener(new ClickListener(hex2ir(CMD_TV_ENTER)));

    findViewById(R.id.sbpower).setOnClickListener(new ClickListener(hex2ir(CMD_SB_POWER)));
    findViewById(R.id.sbsource).setOnClickListener(new ClickListener(hex2ir(CMD_SB_SOURCE)));
    findViewById(R.id.sbvoldown).setOnClickListener(new ClickListener(hex2ir(CMD_SB_VOLDOWN)));
    findViewById(R.id.sbvolup).setOnClickListener(new ClickListener(hex2ir(CMD_SB_VOLUP)));
}
 
Example #2
Source File: IRController.java    From android-ir-remote with MIT License 5 votes vote down vote up
public IRController(Context context)
{
    _context = context;
    _irManager = (ConsumerIrManager)context.getSystemService(Context.CONSUMER_IR_SERVICE);

    if(_irManager != null)
    {
        if(_irManager.hasIrEmitter())
        {
            _enabled = true;
        }
    }
}
 
Example #3
Source File: ContextImpl.java    From AndroidComponentPlugin with Apache License 2.0 4 votes vote down vote up
public Object createService(ContextImpl ctx) {
    return new ConsumerIrManager(ctx);
}
 
Example #4
Source File: ContextImpl.java    From AndroidComponentPlugin with Apache License 2.0 4 votes vote down vote up
public Object createService(ContextImpl ctx) {
    return new ConsumerIrManager(ctx);
}
 
Example #5
Source File: SystemServiceRegistry.java    From android_9.0.0_r45 with Apache License 2.0 4 votes vote down vote up
@Override
public ConsumerIrManager createService(ContextImpl ctx) throws ServiceNotFoundException {
    return new ConsumerIrManager(ctx);
}
 
Example #6
Source File: ServiceUtil.java    From PowerFileExplorer with GNU General Public License v3.0 4 votes vote down vote up
@TargetApi(19)
public static ConsumerIrManager getConsumerIrManager() {
    return (ConsumerIrManager) getSystemService(Context.CONSUMER_IR_SERVICE);
}
 
Example #7
Source File: ContextImpl.java    From AndroidComponentPlugin with Apache License 2.0 3 votes vote down vote up
public Object createService(ContextImpl ctx) {
    return new ConsumerIrManager(ctx);
}