本文整理汇总了Java中android.os.TransactionTooLargeException类的典型用法代码示例。如果您正苦于以下问题:Java TransactionTooLargeException类的具体用法?Java TransactionTooLargeException怎么用?Java TransactionTooLargeException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TransactionTooLargeException类属于android.os包,在下文中一共展示了TransactionTooLargeException类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: startListening
import android.os.TransactionTooLargeException; //导入依赖的package包/类
@Override
public void startListening() {
try {
super.startListening();
} catch (Exception e) {
if (e.getCause() instanceof TransactionTooLargeException ||
e.getCause() instanceof DeadObjectException) {
// We're willing to let this slide. The exception is being caused by the list of
// RemoteViews which is being passed back. The startListening relationship will
// have been established by this point, and we will end up populating the
// widgets upon bind anyway. See issue 14255011 for more context.
} else {
throw new RuntimeException(e);
}
}
}
示例2: startListening
import android.os.TransactionTooLargeException; //导入依赖的package包/类
@Override
public void startListening() {
try {
super.startListening();
} catch (Exception e) {
//noinspection StatementWithEmptyBody
if (e.getCause() instanceof TransactionTooLargeException) {
// We're willing to let this slide. The exception is being caused by the list of
// RemoteViews which is being passed back. The startListening relationship will
// have been established by this point, and we will end up populating the
// widgets upon bind anyway. See issue 14255011 for more context.
} else {
throw new RuntimeException(e);
}
}
}
示例3: logTransactionTooLargeOrRethrow
import android.os.TransactionTooLargeException; //导入依赖的package包/类
/**
* Given an exception, check whether it wrapped a {@link TransactionTooLargeException}. If it
* does, then log the underlying error. If not, throw the original exception again.
*
* @param e The caught RuntimeException.
* @param intent The intent that triggered the RuntimeException to be thrown.
*/
public static void logTransactionTooLargeOrRethrow(RuntimeException e, Intent intent) {
// See http://crbug.com/369574.
if (e.getCause() instanceof TransactionTooLargeException) {
Log.e(TAG, "Could not resolve Activity for intent " + intent.toString(), e);
} else {
throw e;
}
}
示例4: startService
import android.os.TransactionTooLargeException; //导入依赖的package包/类
public ComponentName startService(IApplicationThread caller, Intent service,
String resolvedType, String callingPackage, int userId)
throws TransactionTooLargeException {
try {
PreventRunningUtils.setSender(caller);
if (PreventRunningUtils.hookStartService(caller, service)) {
return startService$Pr(caller, service, resolvedType, callingPackage, userId);
}
return null;
} finally {
PreventRunningUtils.clearSender();
}
}
示例5: bindService
import android.os.TransactionTooLargeException; //导入依赖的package包/类
public int bindService(IApplicationThread caller, IBinder token, Intent service,
String resolvedType, IServiceConnection connection, int flags, String callingPackage,
int userId) throws TransactionTooLargeException {
try {
PreventRunningUtils.setSender(caller);
if (PreventRunningUtils.hookBindService(caller, token, service)) {
return bindService$Pr(caller, token, service,
resolvedType, connection, flags, callingPackage, userId);
} else {
return 0;
}
} finally {
PreventRunningUtils.clearSender();
}
}
示例6: updateAndClone
import android.os.TransactionTooLargeException; //导入依赖的package包/类
public WidgetsModel updateAndClone(Context context) {
Preconditions.assertWorkerThread();
try {
final ArrayList<WidgetItem> widgetsAndShortcuts = new ArrayList<>();
// Widgets
AppWidgetManagerCompat widgetManager = AppWidgetManagerCompat.getInstance(context);
for (AppWidgetProviderInfo widgetInfo : widgetManager.getAllProviders()) {
widgetsAndShortcuts.add(new WidgetItem(
LauncherAppWidgetProviderInfo.fromProviderInfo(context, widgetInfo),
widgetManager));
}
// Shortcuts
PackageManager pm = context.getPackageManager();
for (ResolveInfo info :
pm.queryIntentActivities(new Intent(Intent.ACTION_CREATE_SHORTCUT), 0)) {
widgetsAndShortcuts.add(new WidgetItem(info, pm));
}
setWidgetsAndShortcuts(widgetsAndShortcuts);
} catch (Exception e) {
if (!ProviderConfig.IS_DOGFOOD_BUILD &&
(e.getCause() instanceof TransactionTooLargeException ||
e.getCause() instanceof DeadObjectException)) {
// the returned value may be incomplete and will not be refreshed until the next
// time Launcher starts.
// TODO: after figuring out a repro step, introduce a dirty bit to check when
// onResume is called to refresh the widget provider list.
} else {
throw e;
}
}
return clone();
}
示例7: startListening
import android.os.TransactionTooLargeException; //导入依赖的package包/类
@Override
public void startListening() {
try {
super.startListening();
} catch (Exception e) {
if (e.getCause() instanceof TransactionTooLargeException) {
// We're willing to let this slide. The exception is being caused by the list of
// RemoteViews which is being passed back. The startListening relationship will
// have been established by this point, and we will end up populating the
// widgets upon bind anyway. See issue 14255011 for more context.
} else {
throw new RuntimeException(e);
}
}
}
示例8: logTransactionTooLargeOrRethrow
import android.os.TransactionTooLargeException; //导入依赖的package包/类
private static void logTransactionTooLargeOrRethrow(RuntimeException e, Intent intent) {
// See http://crbug.com/369574.
if (e.getCause() instanceof TransactionTooLargeException) {
Log.e(TAG, "Could not resolve Activity for intent " + intent.toString(), e);
} else {
throw e;
}
}
示例9: createDevicePluginList
import android.os.TransactionTooLargeException; //导入依赖的package包/类
/**
* アプリ一覧からデバイスプラグイン一覧を作成する.
*
* @throws PluginDetectionException アプリケーション一覧のサイズが大きすぎて取得できなかった場合
*/
public void createDevicePluginList() throws PluginDetectionException {
PackageManager pkgMgr = mContext.getPackageManager();
Map<String, List<DevicePlugin>> allPlugins;
try {
allPlugins = getInstalledPlugins(pkgMgr);
} catch (Exception e) {
PluginDetectionException.Reason reason;
if (Build.VERSION.SDK_INT >= 15) {
if (e.getClass() == TransactionTooLargeException.class) {
reason = PluginDetectionException.Reason.TOO_MANY_PACKAGES;
} else {
reason = PluginDetectionException.Reason.OTHER;
}
} else {
reason = PluginDetectionException.Reason.OTHER;
}
throw new PluginDetectionException(e, reason);
}
for (Map.Entry<String, List<DevicePlugin>> entry : allPlugins.entrySet()) {
List<DevicePlugin> pluginListPerPackage = entry.getValue();
// 重複したプラグインを除外
for (DevicePlugin plugin : filterPlugin(pluginListPerPackage)) {
mPlugins.put(plugin.getPluginId(), plugin);
notifyFound(plugin);
}
}
}
示例10: updateAndClone
import android.os.TransactionTooLargeException; //导入依赖的package包/类
public WidgetsModel updateAndClone(Context context) {
Utilities.assertWorkerThread();
try {
final ArrayList<Object> widgetsAndShortcuts = new ArrayList<>();
// Widgets
for (AppWidgetProviderInfo widgetInfo :
AppWidgetManagerCompat.getInstance(context).getAllProviders()) {
widgetsAndShortcuts.add(LauncherAppWidgetProviderInfo
.fromProviderInfo(context, widgetInfo));
}
// Shortcuts
widgetsAndShortcuts.addAll(context.getPackageManager().queryIntentActivities(
new Intent(Intent.ACTION_CREATE_SHORTCUT), 0));
setWidgetsAndShortcuts(widgetsAndShortcuts);
} catch (Exception e) {
if (!LauncherAppState.isDogfoodBuild() &&
(e.getCause() instanceof TransactionTooLargeException ||
e.getCause() instanceof DeadObjectException)) {
// the returned value may be incomplete and will not be refreshed until the next
// time Launcher starts.
// TODO: after figuring out a repro step, introduce a dirty bit to check when
// onResume is called to refresh the widget provider list.
} else {
throw e;
}
}
return clone();
}
示例11: isBinderSizeError
import android.os.TransactionTooLargeException; //导入依赖的package包/类
public static boolean isBinderSizeError(Exception e) {
return e.getCause() instanceof TransactionTooLargeException
|| e.getCause() instanceof DeadObjectException;
}
示例12: UnsupportedOperationException
import android.os.TransactionTooLargeException; //导入依赖的package包/类
public ComponentName startService$Pr(IApplicationThread caller, Intent service,
String resolvedType, String callingPackage, int userId)
throws TransactionTooLargeException {
throw new UnsupportedOperationException();
}
示例13: bug
import android.os.TransactionTooLargeException; //导入依赖的package包/类
public static void bug(XHook hook, Throwable ex) {
if (ex instanceof InvocationTargetException) {
InvocationTargetException exex = (InvocationTargetException) ex;
if (exex.getTargetException() != null)
ex = exex.getTargetException();
}
int priority;
if (ex instanceof ActivityShare.AbortException)
priority = Log.WARN;
else if (ex instanceof ActivityShare.ServerException)
priority = Log.WARN;
else if (ex instanceof ConnectTimeoutException)
priority = Log.WARN;
else if (ex instanceof FileNotFoundException)
priority = Log.WARN;
else if (ex instanceof HttpHostConnectException)
priority = Log.WARN;
else if (ex instanceof NameNotFoundException)
priority = Log.WARN;
else if (ex instanceof NoClassDefFoundError)
priority = Log.WARN;
else if (ex instanceof OutOfMemoryError)
priority = Log.WARN;
else if (ex instanceof RuntimeException)
priority = Log.WARN;
else if (ex instanceof SecurityException)
priority = Log.WARN;
else if (ex instanceof SocketTimeoutException)
priority = Log.WARN;
else if (ex instanceof SSLPeerUnverifiedException)
priority = Log.WARN;
else if (ex instanceof StackOverflowError)
priority = Log.WARN;
else if (ex instanceof TransactionTooLargeException)
priority = Log.WARN;
else if (ex instanceof UnknownHostException)
priority = Log.WARN;
else if (ex instanceof UnsatisfiedLinkError)
priority = Log.WARN;
else
priority = Log.ERROR;
boolean xprivacy = false;
for (StackTraceElement frame : ex.getStackTrace())
if (frame.getClassName() != null && frame.getClassName().startsWith("biz.bokhorst.xprivacy")) {
xprivacy = true;
break;
}
if (!xprivacy)
priority = Log.WARN;
log(hook, priority, ex.toString() + " uid=" + Process.myUid() + "\n" + Log.getStackTraceString(ex));
}