Skip to content

Commit 001647a

Browse files
committed
DroidPlugin:add method getMyPid()
1 parent 4392d5a commit 001647a

3 files changed

Lines changed: 23 additions & 0 deletions

File tree

project/Libraries/DroidPlugin/src/com/morgoo/droidplugin/pm/IPluginManager.aidl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,4 +146,6 @@ interface IPluginManager {
146146
void reportMyProcessName(in String stubProcessName,in String targetProcessName, String targetPkg);
147147

148148
void onActivtyOnNewIntent(in ActivityInfo stubInfo,in ActivityInfo targetInfo, in Intent intent);
149+
150+
int getMyPid();
149151
}

project/Libraries/DroidPlugin/src/com/morgoo/droidplugin/pm/IPluginManagerImpl.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1351,4 +1351,9 @@ public void onActivtyOnNewIntent(ActivityInfo stubInfo, ActivityInfo targetInfo,
13511351
mActivityManagerService.onActivtyOnNewIntent(Binder.getCallingPid(), Binder.getCallingUid(), stubInfo, targetInfo, intent);
13521352
}
13531353

1354+
@Override
1355+
public int getMyPid(){
1356+
return android.os.Process.myPid();
1357+
}
1358+
13541359
}

project/Libraries/DroidPlugin/src/com/morgoo/droidplugin/pm/PluginManager.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -977,4 +977,20 @@ public void onActivtyOnNewIntent(ActivityInfo stubInfo, ActivityInfo targetInfo,
977977
Log.e(TAG, "onActivtyOnNewIntent", e);
978978
}
979979
}
980+
981+
public int getMyPid() throws RemoteException {
982+
try {
983+
if (mPluginManager != null) {
984+
return mPluginManager.getMyPid();
985+
} else {
986+
Log.w(TAG, "Plugin Package Manager Service not be connect");
987+
return -1;
988+
}
989+
} catch (RemoteException e) {
990+
throw e;
991+
} catch (Exception e) {
992+
Log.e(TAG, "getMyPid", e);
993+
return -1;
994+
}
995+
}
980996
}

0 commit comments

Comments
 (0)