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


Java WorkSource类代码示例

本文整理汇总了Java中android.os.WorkSource的典型用法代码示例。如果您正苦于以下问题:Java WorkSource类的具体用法?Java WorkSource怎么用?Java WorkSource使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: startHook

import android.os.WorkSource; //导入依赖的package包/类
@Override
public void startHook() {
	
	Method setImplmethod = RefInvoke.findMethodExact(
			"android.app.AlarmManager", ClassLoader.getSystemClassLoader(),
			"setImpl",int.class,long.class,long.class,long.class,PendingIntent.class,WorkSource.class);
	hookhelper.hookMethod(setImplmethod, new AbstractBahaviorHookCallBack() {
		
		@Override
		public void descParam(HookParam param) {
			Logger.log_behavior("The Alarm Information:");
			PendingIntent intent = (PendingIntent) param.args[4];
			descPendingIntent(intent);
			Logger.log_behavior("TriggerAtMillis = "+param.args[1]);
			Logger.log_behavior("windowMillis = "+param.args[2]);
			Logger.log_behavior("intervalMillis = "+param.args[3]);

		}
	});
	
}
 
开发者ID:Miracle963,项目名称:zjdroid,代码行数:22,代码来源:AlarmManagerHook.java

示例2: startHook

import android.os.WorkSource; //导入依赖的package包/类
@Override
public void startHook() {
	
	Method setImplmethod = RefInvoke.findMethodExact(
			"android.app.AlarmManager", ClassLoader.getSystemClassLoader(),
			"setImpl",int.class,long.class,long.class,long.class,PendingIntent.class,WorkSource.class);
	hookhelper.hookMethod(setImplmethod, new AbstractBahaviorHookCallBack() {
		
		@Override
		public void descParam(HookParam param) {
			Logger.log_behavior("The Alarm Information:");
			PendingIntent intent = (PendingIntent) param.args[4];
			if(intent != null)
			   descPendingIntent(intent);
			Logger.log_behavior("TriggerAtMillis = "+param.args[1]);
			Logger.log_behavior("windowMillis = "+param.args[2]);
			Logger.log_behavior("intervalMillis = "+param.args[3]);

		}
	});
	
}
 
开发者ID:mikusjelly,项目名称:HeyGirl,代码行数:23,代码来源:AlarmManagerHook.java

示例3: onSetRequest

import android.os.WorkSource; //导入依赖的package包/类
@Override
public void onSetRequest(ProviderRequestUnbundled requests, WorkSource source) {
    Log.v(TAG, "onSetRequest: " + requests + " by " + source);

    long autoTime = Math.max(requests.getInterval(), FASTEST_REFRESH_INTERVAL);
    boolean autoUpdate = requests.getReportLocation();

    Log.v(TAG, "using autoUpdate=" + autoUpdate + " autoTime=" + autoTime);

    if (autoUpdate) {
        helper.setTime(autoTime);
        helper.enable();
    } else {
        helper.disable();
    }
}
 
开发者ID:microg,项目名称:android_packages_apps_UnifiedNlp,代码行数:17,代码来源:LocationProviderV2.java

示例4: createFromParcel

import android.os.WorkSource; //导入依赖的package包/类
@Override
public LocationRequest createFromParcel(Parcel in) {
	LocationRequest request = new LocationRequest();
	request.setQuality(in.readInt());
	request.setFastestInterval(in.readLong());
	request.setInterval(in.readLong());
	request.setExpireAt(in.readLong());
	request.setNumUpdates(in.readInt());
	request.setSmallestDisplacement(in.readFloat());
	request.setHideFromAppOps(in.readInt() != 0);
	String provider = in.readString();
	if (provider != null)
		request.setProvider(provider);
	WorkSource workSource = in.readParcelable(null);
	if (workSource != null)
		request.setWorkSource(workSource);
	return request;
}
 
开发者ID:emdete,项目名称:pyneo-wirelesslocation,代码行数:19,代码来源:LocationRequest.java

示例5: beforeCall

import android.os.WorkSource; //导入依赖的package包/类
@Override
     public boolean beforeCall(Object who, Method method, Object... args) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N && args[0] instanceof String) {
	args[0] = getHostPkg();
}
         int index = ArrayUtils.indexOfFirst(args, WorkSource.class);
         if (index >= 0) {
             args[index] = null;
         }
         return true;
     }
 
开发者ID:7763sea,项目名称:VirtualHook,代码行数:12,代码来源:AlarmManagerStub.java

示例6: call

import android.os.WorkSource; //导入依赖的package包/类
@Override
public Object call(Object who, Method method, Object... args) throws Throwable {
    int index = ArrayUtils.indexOfFirst(args, WorkSource.class);
    if (index >= 0) {
        args[index] = null;
    }
    return super.call(who, method, args);
}
 
开发者ID:coding-dream,项目名称:TPlayer,代码行数:9,代码来源:WifiManagerStub.java

示例7: startScan

import android.os.WorkSource; //导入依赖的package包/类
/**
 * Request a scan for access points. Returns immediately. The availability
 * of the results is made known later by means of an asynchronous event sent
 * on completion of the scan.
 * @return {@code true} if the operation succeeded, i.e., the scan was initiated
 */
public boolean startScan() {
    try {
        final WorkSource workSource = null;
        mService.startScan(workSource);
        return true;
    } catch (RemoteException e) {
        return false;
    }
}
 
开发者ID:shouldit,项目名称:android-proxy,代码行数:16,代码来源:WifiManager.java

示例8: onSetMinTime

import android.os.WorkSource; //导入依赖的package包/类
@Override
public void onSetMinTime(long minTime, WorkSource ws) {
    Log.v(TAG, "onSetMinTime: " + minTime + " by " + ws);
    autoTime = Math.max(minTime, FASTEST_REFRESH_INTERVAL);
    helper.setTime(autoTime);
    if (autoUpdate) helper.enable();
}
 
开发者ID:microg,项目名称:android_packages_apps_UnifiedNlp,代码行数:8,代码来源:LocationProviderV1.java

示例9: onSetRequest

import android.os.WorkSource; //导入依赖的package包/类
@Override
public void onSetRequest(final ProviderRequestUnbundled requests, final WorkSource ws) {
	try {
		if (DEBUG) Log.d(TAG, "onSetRequest: requests=" + requests + ", ws=" + ws);
		wirelessEnvListener.disable();
		long autoTime = Long.MAX_VALUE;
		boolean autoUpdate = false;
		for (final LocationRequestUnbundled request : requests.getLocationRequests()) {
			if (DEBUG) Log.d(TAG, "onSetRequest: request=" + request);
			if (autoTime > request.getInterval()) {
				autoTime = request.getInterval();
			}
			autoUpdate = true;
		}
		if (autoUpdate) {
			if (autoTime < 1500) {
				autoTime = 1500;
			}
			wirelessEnvListener.setTime(autoTime);
			wirelessEnvListener.enable();
		}
		else {
			wirelessEnvListener.disable();
		}
	}
	catch (Exception e) {
		Log.e(TAG, "onSetRequest: e=" + e, e);
	}
}
 
开发者ID:emdete,项目名称:pyneo-wirelesslocation,代码行数:30,代码来源:NetworkLocationProviderV2.java

示例10: getWorkSource

import android.os.WorkSource; //导入依赖的package包/类
/**
 * @hide
 */
public WorkSource getWorkSource() {
    return null;
}
 
开发者ID:microg,项目名称:android_packages_apps_UnifiedNlp,代码行数:7,代码来源:LocationRequest.java

示例11: onAddListener

import android.os.WorkSource; //导入依赖的package包/类
@Override
public void onAddListener(final int uid, final WorkSource ws) {
	if (DEBUG) Log.d(TAG, uid + " is listening as " + ws != null ? (ws + " (contents:" + ws.describeContents() + ")") : "[unknown WorkSource]");
}
 
开发者ID:emdete,项目名称:pyneo-wirelesslocation,代码行数:5,代码来源:NetworkLocationProviderV1.java

示例12: onRemoveListener

import android.os.WorkSource; //导入依赖的package包/类
@Override
public void onRemoveListener(final int uid, final WorkSource ws) {
}
 
开发者ID:emdete,项目名称:pyneo-wirelesslocation,代码行数:4,代码来源:NetworkLocationProviderV1.java

示例13: onSetMinTime

import android.os.WorkSource; //导入依赖的package包/类
@Override
public void onSetMinTime(final long minTime, final WorkSource ws) {
	autoTime = minTime;
}
 
开发者ID:emdete,项目名称:pyneo-wirelesslocation,代码行数:5,代码来源:NetworkLocationProviderV1.java

示例14: setMinTime

import android.os.WorkSource; //导入依赖的package包/类
public void setMinTime(long minTime, WorkSource ws) {
	LocationProvider.this.onSetMinTime(minTime, ws);
}
 
开发者ID:emdete,项目名称:pyneo-wirelesslocation,代码行数:4,代码来源:LocationProvider.java

示例15: addListener

import android.os.WorkSource; //导入依赖的package包/类
public void addListener(int uid) {
	LocationProvider.this.onAddListener(uid, new WorkSource(uid));
}
 
开发者ID:emdete,项目名称:pyneo-wirelesslocation,代码行数:4,代码来源:LocationProvider.java


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