当前位置: 首页>>代码示例>>Java>>正文


Java ServiceRequest.ANY_RESPONSE属性代码示例

本文整理汇总了Java中com.musala.atmosphere.commons.ad.service.ServiceRequest.ANY_RESPONSE属性的典型用法代码示例。如果您正苦于以下问题:Java ServiceRequest.ANY_RESPONSE属性的具体用法?Java ServiceRequest.ANY_RESPONSE怎么用?Java ServiceRequest.ANY_RESPONSE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.musala.atmosphere.commons.ad.service.ServiceRequest的用法示例。


在下文中一共展示了ServiceRequest.ANY_RESPONSE属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setWiFi

/**
 * Turns on the WiFi of the device.
 *
 * @param state
 *        true if the WiFi should be on; false if it should be off.
 * @return a fake response, since we are not requesting any information.
 */
private Object setWiFi(Object[] arguments) {
    boolean state = (Boolean) arguments[0];

    WifiManager wifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
    wifiManager.setWifiEnabled(state);

    return ServiceRequest.ANY_RESPONSE;
}
 
开发者ID:MusalaSoft,项目名称:atmosphere-service,代码行数:15,代码来源:AgentRequestHandler.java

示例2: setKeyguard

/**
 * Dismisses and re enables the keyguard of the device in order to Lock and Unlock it.
 *
 * @param locked
 *        - <code>true</code> if the keyguard should be re-enabled and <code>false</code> to dismiss it.
 * @return a {@link ServiceRequest#ANY_RESPONSE}, since we are not requesting any information.
 */
@SuppressWarnings("deprecation")
private Object setKeyguard(Object[] args) {
    boolean keyguardState = (Boolean) args[0];

    if (keyguardState) {
        keyguardLock.reenableKeyguard();
    } else {
        keyguardLock.disableKeyguard();
    }

    return ServiceRequest.ANY_RESPONSE;
}
 
开发者ID:MusalaSoft,项目名称:atmosphere-service,代码行数:19,代码来源:AgentRequestHandler.java

示例3: openLocationSettings

/**
 * Opens the location settings activity.
 *
 * @return a {@link ServiceRequest#ANY_RESPONSE}, since we are not requesting any information
 */
private Object openLocationSettings() {
    Intent openLocationSettingsIntent = new Intent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS);
    openLocationSettingsIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

    context.startActivity(openLocationSettingsIntent);

    return ServiceRequest.ANY_RESPONSE;
}
 
开发者ID:MusalaSoft,项目名称:atmosphere-service,代码行数:13,代码来源:AgentRequestHandler.java

示例4: showTapLocation

/**
 * Shows a tap location on the current device screen.
 *
 * @param arguments
 *        - the point where the tap will be placed
 * @return a {@link ServiceRequest#ANY_RESPONSE}, since we are not requesting any information
 */
private Object showTapLocation(Object[] arguments) {
    Point tapPoint = (Point) arguments[0];

    Intent intent = new Intent(context, LocationPointerService.class);
    intent.putExtra(LocationPointerConstants.CENTER_POINT_INTENT_NAME.getValue(), tapPoint);
    context.startService(intent);

    return ServiceRequest.ANY_RESPONSE;
}
 
开发者ID:MusalaSoft,项目名称:atmosphere-service,代码行数:16,代码来源:AgentRequestHandler.java

示例5: stopBackgroundProcess

/**
 * Stops all background processes associated with the given package.
 *
 * @param arguments
 *        - args[0] contains the given package name
 * @return a {@link ServiceRequest#ANY_RESPONSE}, since we are not requesting any information
 */
private Object stopBackgroundProcess(Object[] arguments) {
    String packageName = (String) arguments[0];

    ActivityManager activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
    activityManager.killBackgroundProcesses(packageName);
    return ServiceRequest.ANY_RESPONSE;
}
 
开发者ID:MusalaSoft,项目名称:atmosphere-service,代码行数:14,代码来源:AgentRequestHandler.java

示例6: sendBroadcast

/**
 * Broadcast the given intent to all interested BroadcastReceivers.
 *
 * @param args
 *        - args[0] should contain the AtmoshereIntent object for the broadcast
 * @return a {@link ServiceRequest#ANY_RESPONSE}, since we are not requesting any information
 *
 * @see {@link Context#sendBroadcast(Intent)}
 */
private Object sendBroadcast(Object[] args) {
    if (args != null && args.length > 0) {
        Object intent = args[0];

        if (intent != null && intent instanceof AtmosphereIntent) {
            context.sendBroadcast(((AtmosphereIntent) intent).toIntent());
        }
    }

    return ServiceRequest.ANY_RESPONSE;
}
 
开发者ID:MusalaSoft,项目名称:atmosphere-service,代码行数:20,代码来源:AgentRequestHandler.java

示例7: disalbeMockLocation

/**
 * Disables mocking location for the given provider.
 *
 * @param arguments
 *        - a {@link String} object that is the provider name
 * @return {@link ServiceRequest#ANY_RESPONSE}
 */
private Object disalbeMockLocation(Object[] arguments) {
    locationProvider.disableMockLocation((String) arguments[0]);
    return ServiceRequest.ANY_RESPONSE;
}
 
开发者ID:MusalaSoft,项目名称:atmosphere-service,代码行数:11,代码来源:AgentRequestHandler.java


注:本文中的com.musala.atmosphere.commons.ad.service.ServiceRequest.ANY_RESPONSE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。