本文整理汇总了Java中com.facebook.Settings类的典型用法代码示例。如果您正苦于以下问题:Java Settings类的具体用法?Java Settings怎么用?Java Settings使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Settings类属于com.facebook包,在下文中一共展示了Settings类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: log
import com.facebook.Settings; //导入依赖的package包/类
public static void log(LoggingBehavior behavior, int priority, String tag, String string) {
if (Settings.isLoggingBehaviorEnabled(behavior)) {
string = replaceStrings(string);
if (tag.startsWith(LOG_TAG_BASE) == false) {
tag = LOG_TAG_BASE + tag;
}
Log.println(priority, tag, string);
// Developer errors warrant special treatment by printing out a stack trace, to make both more noticeable,
// and let the source of the problem be more easily pinpointed.
if (behavior == LoggingBehavior.DEVELOPER_ERRORS) {
(new Exception()).printStackTrace();
}
}
}
示例2: clearCache
import com.facebook.Settings; //导入依赖的package包/类
public void clearCache() {
// get the current directory listing of files to delete
final File[] filesToDelete = directory.listFiles(BufferFile.excludeBufferFiles());
lastClearCacheTime.set(System.currentTimeMillis());
if (filesToDelete != null) {
Settings.getExecutor().execute(new Runnable() {
@Override
public void run() {
for (File file : filesToDelete) {
file.delete();
}
}
});
}
}
示例3: postTrim
import com.facebook.Settings; //导入依赖的package包/类
private void postTrim() {
synchronized (lock) {
if (!isTrimPending) {
isTrimPending = true;
Settings.getExecutor().execute(new Runnable() {
@Override
public void run() {
trim();
}
});
}
}
}
示例4: createProxyAuthIntent
import com.facebook.Settings; //导入依赖的package包/类
public static Intent createProxyAuthIntent(Context context, String applicationId, List<String> permissions,
String e2e, boolean isRerequest, SessionDefaultAudience defaultAudience) {
for (NativeAppInfo appInfo : facebookAppInfoList) {
Intent intent = new Intent()
.setClassName(appInfo.getPackage(), FACEBOOK_PROXY_AUTH_ACTIVITY)
.putExtra(FACEBOOK_PROXY_AUTH_APP_ID_KEY, applicationId);
if (!Utility.isNullOrEmpty(permissions)) {
intent.putExtra(FACEBOOK_PROXY_AUTH_PERMISSIONS_KEY, TextUtils.join(",", permissions));
}
if (!Utility.isNullOrEmpty(e2e)) {
intent.putExtra(FACEBOOK_PROXY_AUTH_E2E_KEY, e2e);
}
intent.putExtra(ServerProtocol.DIALOG_PARAM_RESPONSE_TYPE, ServerProtocol.DIALOG_RESPONSE_TYPE_TOKEN);
intent.putExtra(ServerProtocol.DIALOG_PARAM_RETURN_SCOPES, ServerProtocol.DIALOG_RETURN_SCOPES_TRUE);
intent.putExtra(ServerProtocol.DIALOG_PARAM_DEFAULT_AUDIENCE, defaultAudience.getNativeProtocolAudience());
if (!Settings.getPlatformCompatibilityEnabled()) {
// Override the API Version for Auth
intent.putExtra(ServerProtocol.DIALOG_PARAM_LEGACY_OVERRIDE, ServerProtocol.GRAPH_API_VERSION);
// Only set the rerequest auth type for non legacy requests
if (isRerequest) {
intent.putExtra(ServerProtocol.DIALOG_PARAM_AUTH_TYPE, ServerProtocol.DIALOG_REREQUEST_AUTH_TYPE);
}
}
intent = validateActivityIntent(context, intent, appInfo);
if (intent != null) {
return intent;
}
}
return null;
}
示例5: requestAsync
import com.facebook.Settings; //导入依赖的package包/类
/**
* Request to login async.
*
* @param strPath
* - Path of login.
* @param callback
* - Call back function.
*/
public <T> void requestAsync( String strPath,
final OnResult<T> callback)
{
Settings.addLoggingBehavior(LoggingBehavior.INCLUDE_ACCESS_TOKENS);
Settings.addLoggingBehavior(LoggingBehavior.REQUESTS);
Session session = Session.getActiveSession();
Request request =
Request.newGraphPathRequest(session, strPath,
new Request.Callback()
{
@Override
public void onCompleted(Response response)
{
if (response.getError() != null)
{
Log.i("MainActivity",
String.format(
"Error making request: %s",
response.getError()));
}
else
{
GraphUser user =
response.getGraphObjectAs(GraphUser.class);
callback.onResult((T) user);
Log.i("MainActivity",
String.format(
"Name: %s",
user.getName()));
}
}
});
request.executeAsync();
}
示例6: registerAccessToken
import com.facebook.Settings; //导入依赖的package包/类
public synchronized static void registerAccessToken(String accessToken) {
if (Settings.isLoggingBehaviorEnabled(LoggingBehavior.INCLUDE_ACCESS_TOKENS) == false) {
registerStringToReplace(accessToken, "ACCESS_TOKEN_REMOVED");
}
}
示例7: shouldLog
import com.facebook.Settings; //导入依赖的package包/类
private boolean shouldLog() {
return Settings.isLoggingBehaviorEnabled(behavior);
}
示例8: WorkQueue
import com.facebook.Settings; //导入依赖的package包/类
WorkQueue(int maxConcurrent) {
this(maxConcurrent, Settings.getExecutor());
}
示例9: getDialogAuthority
import com.facebook.Settings; //导入依赖的package包/类
public static final String getDialogAuthority() {
return String.format(DIALOG_AUTHORITY_FORMAT, Settings.getFacebookDomain());
}
示例10: getGraphUrlBase
import com.facebook.Settings; //导入依赖的package包/类
public static final String getGraphUrlBase() {
return String.format(GRAPH_URL_FORMAT, Settings.getFacebookDomain());
}
示例11: getGraphVideoUrlBase
import com.facebook.Settings; //导入依赖的package包/类
public static final String getGraphVideoUrlBase() {
return String.format(GRAPH_VIDEO_URL_FORMAT, Settings.getFacebookDomain());
}
示例12: getRestUrlBase
import com.facebook.Settings; //导入依赖的package包/类
public static final String getRestUrlBase() {
return String.format(REST_URL_FORMAT, Settings.getFacebookDomain());
}
示例13: getAPIVersion
import com.facebook.Settings; //导入依赖的package包/类
public static final String getAPIVersion() {
if (Settings.getPlatformCompatibilityEnabled()) {
return LEGACY_API_VERSION;
}
return GRAPH_API_VERSION;
}