Java源码示例:com.facebook.Settings
示例1
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
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
private void postTrim() {
synchronized (lock) {
if (!isTrimPending) {
isTrimPending = true;
Settings.getExecutor().execute(new Runnable() {
@Override
public void run() {
trim();
}
});
}
}
}
示例4
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();
}
}
}
示例5
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();
}
}
}
示例6
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();
}
}
});
}
}
示例7
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();
}
}
}
示例8
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();
}
}
});
}
}
示例9
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();
}
}
}
示例10
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;
}
示例11
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();
}
}
}
示例12
private void postTrim() {
synchronized (lock) {
if (!isTrimPending) {
isTrimPending = true;
Settings.getExecutor().execute(new Runnable() {
@Override
public void run() {
trim();
}
});
}
}
}
示例13
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();
}
}
}
示例14
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();
}
}
});
}
}
示例15
private void postTrim() {
synchronized (lock) {
if (!isTrimPending) {
isTrimPending = true;
Settings.getExecutor().execute(new Runnable() {
@Override
public void run() {
trim();
}
});
}
}
}
示例16
private void postTrim() {
synchronized (lock) {
if (!isTrimPending) {
isTrimPending = true;
Settings.getExecutor().execute(new Runnable() {
@Override
public void run() {
trim();
}
});
}
}
}
示例17
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();
}
}
}
示例18
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();
}
}
}
示例19
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();
}
}
});
}
}
示例20
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();
}
}
});
}
}
示例21
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();
}
}
}
示例22
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();
}
}
});
}
}
示例23
public synchronized static void registerAccessToken(String accessToken) {
if (Settings.isLoggingBehaviorEnabled(LoggingBehavior.INCLUDE_ACCESS_TOKENS) == false) {
registerStringToReplace(accessToken, "ACCESS_TOKEN_REMOVED");
}
}
示例24
WorkQueue(int maxConcurrent) {
this(maxConcurrent, Settings.getExecutor());
}
示例25
private boolean shouldLog() {
return Settings.isLoggingBehaviorEnabled(behavior);
}
示例26
WorkQueue(int maxConcurrent) {
this(maxConcurrent, Settings.getExecutor());
}
示例27
public static final String getDialogAuthority() {
return String.format(DIALOG_AUTHORITY_FORMAT, Settings.getFacebookDomain());
}
示例28
public static final String getGraphUrlBase() {
return String.format(GRAPH_URL_FORMAT, Settings.getFacebookDomain());
}
示例29
private boolean shouldLog() {
return Settings.isLoggingBehaviorEnabled(behavior);
}
示例30
public static void log(LoggingBehavior behavior, String tag, String format, Object... args) {
if (Settings.isLoggingBehaviorEnabled(behavior)) {
String string = String.format(format, args);
log(behavior, Log.DEBUG, tag, string);
}
}