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


Java Binder.getCallingPid方法代码示例

本文整理汇总了Java中android.os.Binder.getCallingPid方法的典型用法代码示例。如果您正苦于以下问题:Java Binder.getCallingPid方法的具体用法?Java Binder.getCallingPid怎么用?Java Binder.getCallingPid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.os.Binder的用法示例。


在下文中一共展示了Binder.getCallingPid方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: attachPluginProcess

import android.os.Binder; //导入方法依赖的package包/类
@Override
public String attachPluginProcess(String process, int index, IBinder binder, String def) throws RemoteException {
    int pid = Binder.getCallingPid();
    IPluginClient client = null;
    try {
        client = IPluginClient.Stub.asInterface(binder);
    } catch (Throwable e) {
        if (LOGR) {
            LogRelease.e(PLUGIN_TAG, "a.p.p pc.s.ai: " + e.getMessage(), e);
        }
    }
    if (client == null) {
        return null;
    }
    return PluginProcessMain.attachProcess(pid, process, index, binder, client, def, mManager);
}
 
开发者ID:wangyupeng1-iri,项目名称:springreplugin,代码行数:17,代码来源:PmHostSvc.java

示例2: reloadLauncherIfExternal

import android.os.Binder; //导入方法依赖的package包/类
private void reloadLauncherIfExternal() {
    if (AndroidVersion.isAtLeastMarshmallow && Binder.getCallingPid() != Process.myPid()) {
        LauncherAppState app = LauncherAppState.getInstanceNoCreate();
        if (app != null) {
            app.getModel().forceReload();
        }
    }
}
 
开发者ID:enricocid,项目名称:LaunchEnr,代码行数:9,代码来源:LauncherProvider.java

示例3: insert

import android.os.Binder; //导入方法依赖的package包/类
@Override
public Uri insert(@NonNull Uri uri, ContentValues initialValues) {
    createDbIfNotExists();
    SqlArguments args = new SqlArguments(uri);

    // In very limited cases, we support system|signature permission apps to modify the db.
    if (Binder.getCallingPid() != Process.myPid()) {
        if (!initializeExternalAdd(initialValues)) {
            return null;
        }
    }

    SQLiteDatabase db = mOpenHelper.getWritableDatabase();
    addModifiedTime(initialValues);
    final long rowId = dbInsertAndCheck(mOpenHelper, db, args.table, null, initialValues);
    if (rowId < 0) return null;

    uri = ContentUris.withAppendedId(uri, rowId);
    notifyListeners();

    if (AndroidVersion.isAtLeastMarshmallow) {
        reloadLauncherIfExternal();
    } else {
        // Deprecated behavior to support legacy devices which rely on provider callbacks.
        LauncherAppState app = LauncherAppState.getInstanceNoCreate();
        if (app != null && "true".equals(uri.getQueryParameter("isExternalAdd"))) {
            app.getModel().forceReload();
        }

        String notify = uri.getQueryParameter("notify");
        if (notify == null || "true".equals(notify)) {
            getContext().getContentResolver().notifyChange(uri, null);
        }
    }
    return uri;
}
 
开发者ID:enricocid,项目名称:LaunchEnr,代码行数:37,代码来源:LauncherProvider.java

示例4: shouldRestrictVisibility

import android.os.Binder; //导入方法依赖的package包/类
/**
 * @return true if we should restrict the columns readable by this caller
 */
private boolean shouldRestrictVisibility() {
    int callingUid = Binder.getCallingUid();
    return Binder.getCallingPid() != Process.myPid() &&
            callingUid != mSystemUid &&
            callingUid != mDefContainerUid;
}
 
开发者ID:redleaf2002,项目名称:downloadmanager,代码行数:10,代码来源:DownloadProvider.java

示例5: getCallingPid

import android.os.Binder; //导入方法依赖的package包/类
public static int getCallingPid() {
    return Binder.getCallingPid();
}
 
开发者ID:7763sea,项目名称:VirtualHook,代码行数:4,代码来源:VBinder.java

示例6: onGetCallingUid

import android.os.Binder; //导入方法依赖的package包/类
public static int onGetCallingUid(int originUid) {
    int callingPid = Binder.getCallingPid();
    if (callingPid == Process.myPid()) {
        return VClientImpl.get().getBaseVUid();
    }
    if (callingPid == VirtualCore.get().getSystemPid()) {
        return Process.SYSTEM_UID;
    }
    int vuid = VActivityManager.get().getUidByPid(callingPid);
    if (vuid != -1) {
        return VUserHandle.getAppId(vuid);
    }
    VLog.d(TAG, "Unknown uid: " + callingPid);
    return VClientImpl.get().getBaseVUid();
}
 
开发者ID:7763sea,项目名称:VirtualHook,代码行数:16,代码来源:NativeEngine.java

示例7: reloadLauncherIfExternal

import android.os.Binder; //导入方法依赖的package包/类
private void reloadLauncherIfExternal() {
    if (Utilities.ATLEAST_MARSHMALLOW && Binder.getCallingPid() != Process.myPid()) {
        LauncherAppState app = LauncherAppState.getInstanceNoCreate();
        if (app != null) {
            app.reloadWorkspace();
        }
    }
}
 
开发者ID:TeamBrainStorm,项目名称:SimpleUILauncher,代码行数:9,代码来源:LauncherProvider.java

示例8: onActivityCreated

import android.os.Binder; //导入方法依赖的package包/类
@Override
public void onActivityCreated(ComponentName component, ComponentName caller, IBinder token, Intent intent, String affinity, int taskId, int launchMode, int flags) {
    int pid = Binder.getCallingPid();
    ProcessRecord targetApp = findProcessLocked(pid);
    if (targetApp != null) {
        mMainStack.onActivityCreated(targetApp, component, caller, token, intent, affinity, taskId, launchMode, flags);
    }
}
 
开发者ID:coding-dream,项目名称:TPlayer,代码行数:9,代码来源:VActivityManagerService.java

示例9: insert

import android.os.Binder; //导入方法依赖的package包/类
@Override
public Uri insert(Uri uri, ContentValues initialValues) {
    createDbIfNotExists();
    SqlArguments args = new SqlArguments(uri);

    // In very limited cases, we support system|signature permission apps to modify the db.
    if (Binder.getCallingPid() != Process.myPid()) {
        if (!initializeExternalAdd(initialValues)) {
            return null;
        }
    }

    SQLiteDatabase db = mOpenHelper.getWritableDatabase();
    addModifiedTime(initialValues);
    final long rowId = dbInsertAndCheck(mOpenHelper, db, args.table, null, initialValues);
    if (rowId < 0) return null;

    uri = ContentUris.withAppendedId(uri, rowId);
    notifyListeners();

    if (Utilities.ATLEAST_MARSHMALLOW) {
        reloadLauncherIfExternal();
    } else {
        // Deprecated behavior to support legacy devices which rely on provider callbacks.
        LauncherAppState app = LauncherAppState.getInstanceNoCreate();
        if (app != null && "true".equals(uri.getQueryParameter("isExternalAdd"))) {
            app.reloadWorkspace();
        }

        String notify = uri.getQueryParameter("notify");
        if (notify == null || "true".equals(notify)) {
            getContext().getContentResolver().notifyChange(uri, null);
        }
    }
    return uri;
}
 
开发者ID:TeamBrainStorm,项目名称:SimpleUILauncher,代码行数:37,代码来源:LauncherProvider.java

示例10: delete

import android.os.Binder; //导入方法依赖的package包/类
@Override
public int delete(Uri uri, String selection, String[] selectionArgs) {
    createDbIfNotExists();
    SqlArguments args = new SqlArguments(uri, selection, selectionArgs);

    SQLiteDatabase db = mOpenHelper.getWritableDatabase();

    if (Binder.getCallingPid() != Process.myPid()
            && Favorites.TABLE_NAME.equalsIgnoreCase(args.table)) {
        String widgetSelection = TextUtils.isEmpty(args.where) ? "1=1" : args.where;
        widgetSelection = String.format(Locale.ENGLISH, "%1$s = %2$d AND ( %3$s )",
                Favorites.ITEM_TYPE, Favorites.ITEM_TYPE_APPWIDGET, widgetSelection);
        try (Cursor c = db.query(Favorites.TABLE_NAME, new String[] { Favorites.APPWIDGET_ID },
                widgetSelection, args.args, null, null, null)) {
            AppWidgetHost host = new AppWidgetHost(getContext(), Launcher.APPWIDGET_HOST_ID);
            while (c.moveToNext()) {
                int widgetId = c.getInt(0);
                if (widgetId != AppWidgetManager.INVALID_APPWIDGET_ID) {
                    try {
                        host.deleteAppWidgetId(widgetId);
                    } catch (RuntimeException e) {
                        Log.e(TAG, "Error deleting widget id " + widgetId, e);
                    }
                }
            }
        }
    }
    int count = db.delete(args.table, args.where, args.args);
    if (count > 0) {
        notifyListeners();
        reloadLauncherIfExternal();
    }
    return count;
}
 
开发者ID:michelelacorte,项目名称:FlickLauncher,代码行数:35,代码来源:LauncherProvider.java

示例11: checkCallingPermission

import android.os.Binder; //导入方法依赖的package包/类
public static int checkCallingPermission(@NonNull Context context, @NonNull String permission, String packageName) {
    if (Binder.getCallingPid() == Process.myPid()) {
        return -1;
    }
    return checkPermission(context, permission, Binder.getCallingPid(), Binder.getCallingUid(), packageName);
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:7,代码来源:PermissionChecker.java

示例12: regActivity

import android.os.Binder; //导入方法依赖的package包/类
@Override
public void regActivity(int index, String plugin, String container, String activity) throws RemoteException {
    int pid = Binder.getCallingPid();
    PluginProcessMain.attachActivity(pid, index, plugin, activity, container);
}
 
开发者ID:wangyupeng1-iri,项目名称:springreplugin,代码行数:6,代码来源:PmHostSvc.java

示例13: unregActivity

import android.os.Binder; //导入方法依赖的package包/类
@Override
public void unregActivity(int index, String plugin, String container, String activity) throws RemoteException {
    int pid = Binder.getCallingPid();
    PluginProcessMain.detachActivity(pid, index, plugin, activity, container);
}
 
开发者ID:wangyupeng1-iri,项目名称:springreplugin,代码行数:6,代码来源:PmHostSvc.java

示例14: regService

import android.os.Binder; //导入方法依赖的package包/类
@Override
public void regService(int index, String plugin, String service) throws RemoteException {
    int pid = Binder.getCallingPid();
    PluginProcessMain.attachService(pid, index, plugin, service);
}
 
开发者ID:wangyupeng1-iri,项目名称:springreplugin,代码行数:6,代码来源:PmHostSvc.java

示例15: unregService

import android.os.Binder; //导入方法依赖的package包/类
@Override
public void unregService(int index, String plugin, String service) throws RemoteException {
    int pid = Binder.getCallingPid();
    PluginProcessMain.detachService(pid, index, plugin, service);
}
 
开发者ID:wangyupeng1-iri,项目名称:springreplugin,代码行数:6,代码来源:PmHostSvc.java


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