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


Java TransactionTooLargeException类代码示例

本文整理汇总了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);
        }
    }
}
 
开发者ID:michelelacorte,项目名称:FlickLauncher,代码行数:17,代码来源:LauncherAppWidgetHost.java

示例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);
        }
    }
}
 
开发者ID:AChep,项目名称:AcDisplay,代码行数:17,代码来源:MyAppWidgetHost.java

示例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;
    }
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:16,代码来源:IntentUtils.java

示例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();
    }
}
 
开发者ID:brevent,项目名称:prevent,代码行数:14,代码来源:ActivityManagerService.java

示例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();
    }
}
 
开发者ID:brevent,项目名称:prevent,代码行数:16,代码来源:ActivityManagerService.java

示例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();
}
 
开发者ID:michelelacorte,项目名称:FlickLauncher,代码行数:35,代码来源:WidgetsModel.java

示例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);
        }
    }
}
 
开发者ID:Mr-lin930819,项目名称:SimplOS,代码行数:16,代码来源:LauncherAppWidgetHost.java

示例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;
    }
}
 
开发者ID:Smalinuxer,项目名称:Vafrinn,代码行数:9,代码来源:CustomTab.java

示例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);
        }
    }
}
 
开发者ID:DeviceConnect,项目名称:DeviceConnect-Android,代码行数:36,代码来源:DevicePluginManager.java

示例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();
}
 
开发者ID:RunasSudo,项目名称:FLauncher,代码行数:30,代码来源:WidgetsModel.java

示例11: isBinderSizeError

import android.os.TransactionTooLargeException; //导入依赖的package包/类
public static boolean isBinderSizeError(Exception e) {
    return e.getCause() instanceof TransactionTooLargeException
            || e.getCause() instanceof DeadObjectException;
}
 
开发者ID:enricocid,项目名称:LaunchEnr,代码行数:5,代码来源:Utilities.java

示例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();
}
 
开发者ID:brevent,项目名称:prevent,代码行数:6,代码来源:ActivityManagerService.java

示例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));
}
 
开发者ID:ukanth,项目名称:XPrivacy,代码行数:55,代码来源:Util.java


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