Yes,two applications can use the same process name.
Two advices for you:
1.After checking the process name,you still need to check the signature of the app.
Other apps can use the same name with you , but they can't use the same signature.
//the code showing how to get siginature
PackageInfo info = getPackageInfoByName(context, pkgName);
byte[] sign = info.signatures[0].toByteArray();
//Add code here check whether the sign with your app
public static PackageInfo getPackageInfoByName(Context context, String packageName) {
try {
return context.getPackageManager().getPackageInfo(packageName,PackageManager.GET_SIGNATURES);
} catch (PackageManager.NameNotFoundException e) {
Log.e(TAG, "Failed getPackageInfo", e);
}
return null;
}
2.You can add an signature level permission for your service which work as the server of binder.
//1.create a signature level permission in your AndroidManifest.xml
<permission
android:name="com.xyz.aa.permission.bindservice"
android:protectionLevel="signature">
</permission>
//2.Add the permission to your service
<service android:name=".MyService"
android:permission="com.xyz.aa.permission.bindservice">
</service>
The app who want to bind the service should use this permission,only apps using same signature with you can use this permission.