Showing
3 changed files
with
43 additions
and
21 deletions
| ... | ... | @@ -622,27 +622,37 @@ public class SocketService1 extends BaseService { |
| 622 | 622 | private void setLight(int op) { |
| 623 | 623 | if (op == SERVER_CMD_OPEN_LIGHT) {//打开灯光 |
| 624 | 624 | Log.d("setEqu", "打开灯光"); |
| 625 | - LightOperationUtils.open(); | |
| 626 | - LightOperationUtils.setLightValue(5); | |
| 627 | - //延时增亮 | |
| 628 | - Timer timer = new Timer();//实例化Timer类 | |
| 629 | - timer.schedule(new TimerTask() { | |
| 630 | - public void run() { | |
| 631 | - LightOperationUtils.setLightValue(Utils.getInt(context, "brightness", 50)); | |
| 632 | - this.cancel(); | |
| 633 | - } | |
| 634 | - }, 2000);//毫秒 | |
| 625 | + try { | |
| 626 | + iPlayer.openLight(); | |
| 627 | + } catch (RemoteException e) { | |
| 628 | + e.printStackTrace(); | |
| 629 | + } | |
| 630 | +// LightOperationUtils.open(); | |
| 631 | +// LightOperationUtils.setLightValue(5); | |
| 632 | +// //延时增亮 | |
| 633 | +// Timer timer = new Timer();//实例化Timer类 | |
| 634 | +// timer.schedule(new TimerTask() { | |
| 635 | +// public void run() { | |
| 636 | +// LightOperationUtils.setLightValue(Utils.getInt(context, "brightness", 50)); | |
| 637 | +// this.cancel(); | |
| 638 | +// } | |
| 639 | +// }, 2000);//毫秒 | |
| 635 | 640 | } else if (op == SERVER_CMD_CLOSE_LIGHT) {//关闭灯光 |
| 636 | 641 | Log.d("setEqu", "关闭灯光"); |
| 637 | - LightOperationUtils.setLightValue(5); | |
| 638 | - //延时关闭 | |
| 639 | - Timer timer = new Timer();//实例化Timer类 | |
| 640 | - timer.schedule(new TimerTask() { | |
| 641 | - public void run() { | |
| 642 | - LightOperationUtils.close(); | |
| 643 | - this.cancel(); | |
| 644 | - } | |
| 645 | - }, 2000);//毫秒 | |
| 642 | + try { | |
| 643 | + iPlayer.closeLight(); | |
| 644 | + } catch (RemoteException e) { | |
| 645 | + e.printStackTrace(); | |
| 646 | + } | |
| 647 | +// LightOperationUtils.setLightValue(20); | |
| 648 | +// //延时关闭 | |
| 649 | +// Timer timer = new Timer();//实例化Timer类 | |
| 650 | +// timer.schedule(new TimerTask() { | |
| 651 | +// public void run() { | |
| 652 | +// LightOperationUtils.close(); | |
| 653 | +// this.cancel(); | |
| 654 | +// } | |
| 655 | +// }, 2000);//毫秒 | |
| 646 | 656 | } |
| 647 | 657 | } |
| 648 | 658 | ... | ... |
| ... | ... | @@ -173,6 +173,14 @@ public class CinemaControlService extends Service { |
| 173 | 173 | } |
| 174 | 174 | CinemaControlService.this.movies.addAll(movies); |
| 175 | 175 | } |
| 176 | + | |
| 177 | + public void openLight()throws RemoteException { | |
| 178 | + fadeIn(); | |
| 179 | + } | |
| 180 | + | |
| 181 | + public void closeLight()throws RemoteException { | |
| 182 | + fadeOut(); | |
| 183 | + } | |
| 176 | 184 | }; |
| 177 | 185 | |
| 178 | 186 | public CinemaControlService() { |
| ... | ... | @@ -259,7 +267,7 @@ public class CinemaControlService extends Service { |
| 259 | 267 | private boolean fadeOuting = false; |
| 260 | 268 | private int maxValue = 50; |
| 261 | 269 | |
| 262 | - private void fadeIn() { | |
| 270 | + public void fadeIn() { | |
| 263 | 271 | DeviceInfo connectDevice = mApplication.getConnectDevice(); |
| 264 | 272 | if (connectDevice == null) { |
| 265 | 273 | Log.d("aidl", "connect device is null"); |
| ... | ... | @@ -288,7 +296,7 @@ public class CinemaControlService extends Service { |
| 288 | 296 | handler.post(openRunnable); |
| 289 | 297 | } |
| 290 | 298 | |
| 291 | - private void fadeOut() { | |
| 299 | + public void fadeOut() { | |
| 292 | 300 | fadeOuting = true; |
| 293 | 301 | DeviceInfo connectDevice = mApplication.getConnectDevice(); |
| 294 | 302 | if (connectDevice == null) { | ... | ... |
Please
register
or
login
to post a comment