Java 类android.os.WorkSource 实例源码

项目:zjdroid    文件:AlarmManagerHook.java   
@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]);

        }
    });

}
项目:AppTroy    文件:AlarmManagerHook.java   
@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]);

        }
    });

}
项目:ZJDroid    文件:AlarmManagerHook.java   
@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]);

        }
    });

}
项目:ZjDroid-master    文件:AlarmManagerHook.java   
@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]);

        }
    });

}
项目:HeyGirl    文件:AlarmManagerHook.java   
@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]);

        }
    });

}
项目:android_packages_apps_UnifiedNlp    文件:LocationProviderV2.java   
@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();
    }
}
项目:ZjDroid    文件:AlarmManagerHook.java   
@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]);

        }
    });

}
项目:pyneo-wirelesslocation    文件:LocationRequest.java   
@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;
}
项目:VirtualHook    文件:AlarmManagerStub.java   
@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;
     }
项目:TPlayer    文件:WifiManagerStub.java   
@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);
}
项目:TPlayer    文件:AlarmManagerStub.java   
@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;
     }
项目:container    文件:AlarmManagerPatch.java   
@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;
     }
项目:android-proxy    文件:WifiManager.java   
/**
 * 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;
    }
}
项目:android-proxy    文件:WifiManager.java   
/** @hide */
public boolean startScan(WorkSource workSource) {
    try {
        mService.startScan(workSource);
        return true;
    } catch (RemoteException e) {
        return false;
    }
}
项目:android_packages_apps_UnifiedNlp    文件:LocationProviderV1.java   
@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();
}
项目:pyneo-wirelesslocation    文件:NetworkLocationProviderV2.java   
@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);
    }
}
项目:android_packages_apps_UnifiedNlp    文件:LocationRequest.java   
/**
 * @hide
 */
public WorkSource getWorkSource() {
    return null;
}
项目:pyneo-wirelesslocation    文件:NetworkLocationProviderV1.java   
@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]");
}
项目:pyneo-wirelesslocation    文件:NetworkLocationProviderV1.java   
@Override
public void onRemoveListener(final int uid, final WorkSource ws) {
}
项目:pyneo-wirelesslocation    文件:NetworkLocationProviderV1.java   
@Override
public void onSetMinTime(final long minTime, final WorkSource ws) {
    autoTime = minTime;
}
项目:pyneo-wirelesslocation    文件:LocationProvider.java   
public void setMinTime(long minTime, WorkSource ws) {
    LocationProvider.this.onSetMinTime(minTime, ws);
}
项目:pyneo-wirelesslocation    文件:LocationProvider.java   
public void addListener(int uid) {
    LocationProvider.this.onAddListener(uid, new WorkSource(uid));
}
项目:pyneo-wirelesslocation    文件:LocationProvider.java   
public void removeListener(int uid) {
    LocationProvider.this.onRemoveListener(uid, new WorkSource(uid));
}
项目:pyneo-wirelesslocation    文件:LocationRequest.java   
/**
 * @hide
 */
public WorkSource getWorkSource() {
    return mWorkSource;
}
项目:android_packages_apps_UnifiedNlp    文件:LocationProvider.java   
/**
 * Notifies the location provider of the smallest minimum time between updates amongst
 * all clients that are listening for locations.  This allows the provider to reduce
 * the frequency of updates to match the requested frequency.
 *
 * @param minTime the smallest minTime value over all listeners for this provider.
 * @param ws      the source this work is coming from.
 */
public abstract void onSetMinTime(long minTime, WorkSource ws);
项目:android_packages_apps_UnifiedNlp    文件:LocationProvider.java   
/**
 * Notifies the location provider when a new client is listening for locations.
 *
 * @param uid user ID of the new client.
 * @param ws  a WorkSource representation of the client.
 */
public abstract void onAddListener(int uid, WorkSource ws);
项目:android_packages_apps_UnifiedNlp    文件:LocationProvider.java   
/**
 * Notifies the location provider when a client is no longer listening for locations.
 *
 * @param uid user ID of the client no longer listening.
 * @param ws  a WorkSource representation of the client.
 */
public abstract void onRemoveListener(int uid, WorkSource ws);
项目:android_packages_apps_UnifiedNlp    文件:LocationProviderBase.java   
/**
 * Set the {@link ProviderRequest} requirements for this provider.
 * <p>Each call to this method overrides all previous requests.
 * <p>This method might trigger the provider to start returning
 * locations, or to stop returning locations, depending on the
 * parameters in the request.
 */
public abstract void onSetRequest(ProviderRequestUnbundled request, WorkSource source);
项目:android_packages_apps_UnifiedNlp    文件:LocationRequest.java   
/**
 * Sets the WorkSource to use for power blaming of this location request.
 * <p/>
 * <p>No permissions are required to make this call, however the LocationManager
 * will throw a SecurityException when requesting location updates if the caller
 * doesn't have the {@link android.Manifest.permission#UPDATE_DEVICE_STATS} permission.
 *
 * @param workSource WorkSource defining power blame for this location request.
 * @hide
 */
public void setWorkSource(WorkSource workSource) {
}
项目:android_packages_apps_UnifiedNlp    文件:LocationProviderV1.java   
@Override
public void onAddListener(int uid, WorkSource ws) {

}
项目:android_packages_apps_UnifiedNlp    文件:LocationProviderV1.java   
@Override
public void onRemoveListener(int uid, WorkSource ws) {

}
项目:pyneo-wirelesslocation    文件:LocationProvider.java   
/**
 * Notifies the location provider of the smallest minimum time between updates amongst
 * all clients that are listening for locations.  This allows the provider to reduce
 * the frequency of updates to match the requested frequency.
 *
 * @param minTime the smallest minTime value over all listeners for this provider.
 * @param ws the source this work is coming from.
 */
public abstract void onSetMinTime(long minTime, WorkSource ws);
项目:pyneo-wirelesslocation    文件:LocationProvider.java   
/**
 * Notifies the location provider when a new client is listening for locations.
 *
 * @param uid user ID of the new client.
 * @param ws a WorkSource representation of the client.
 */
public abstract void onAddListener(int uid, WorkSource ws);
项目:pyneo-wirelesslocation    文件:LocationProvider.java   
/**
 * Notifies the location provider when a client is no longer listening for locations.
 *
 * @param uid user ID of the client no longer listening.
 * @param ws a WorkSource representation of the client.
 */
public abstract void onRemoveListener(int uid, WorkSource ws);
项目:pyneo-wirelesslocation    文件:LocationRequest.java   
/**
 * Sets the WorkSource to use for power blaming of this location request.
 * <p/>
 * <p>No permissions are required to make this call, however the LocationManager
 * will throw a SecurityException when requesting location updates if the caller
 * doesn't have the {@link android.Manifest.permission#UPDATE_DEVICE_STATS} permission.
 *
 * @param workSource WorkSource defining power blame for this location request.
 * @hide
 */
public void setWorkSource(WorkSource workSource) {
    mWorkSource = workSource;
}