Loading services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerServiceImpl.java +22 −8 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import android.annotation.Nullable; import android.app.ActivityManager; import android.app.ActivityOptions; import android.app.ActivityTaskManager; import android.app.AppGlobals; import android.app.IActivityManager; import android.app.IActivityTaskManager; import android.content.BroadcastReceiver; Loading @@ -35,7 +36,9 @@ import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.content.ServiceConnection; import android.content.pm.IPackageManager; import android.content.pm.PackageManager; import android.content.pm.ServiceInfo; import android.hardware.soundtrigger.IRecognitionStatusCallback; import android.os.Bundle; import android.os.Handler; Loading Loading @@ -167,12 +170,8 @@ class VoiceInteractionManagerServiceImpl implements VoiceInteractionSessionConne mSessionComponentName = new ComponentName(service.getPackageName(), mInfo.getSessionService()); final String hotwordDetectionServiceName = mInfo.getHotwordDetectionService(); if (hotwordDetectionServiceName != null) { mHotwordDetectionComponentName = new ComponentName(service.getPackageName(), hotwordDetectionServiceName); } else { mHotwordDetectionComponentName = null; } mHotwordDetectionComponentName = hotwordDetectionServiceName != null ? new ComponentName(service.getPackageName(), hotwordDetectionServiceName) : null; mIWindowManager = IWindowManager.Stub.asInterface( ServiceManager.getService(Context.WINDOW_SERVICE)); IntentFilter filter = new IntentFilter(); Loading Loading @@ -456,8 +455,22 @@ class VoiceInteractionManagerServiceImpl implements VoiceInteractionSessionConne } boolean isIsolatedProcessLocked(ComponentName componentName) { // TODO : Need to make sure this component exists and is :isolated. return true; IPackageManager pm = AppGlobals.getPackageManager(); try { ServiceInfo serviceInfo = pm.getServiceInfo(componentName, PackageManager.GET_META_DATA | PackageManager.MATCH_DIRECT_BOOT_AWARE | PackageManager.MATCH_DIRECT_BOOT_UNAWARE, mUser); if (serviceInfo != null) { return (serviceInfo.flags & ServiceInfo.FLAG_ISOLATED_PROCESS) != 0 && (serviceInfo.flags & ServiceInfo.FLAG_EXTERNAL_SERVICE) == 0; } } catch (RemoteException e) { if (DEBUG) { Slog.w(TAG, "isIsolatedProcess RemoteException : " + e); } } return false; } public void dumpLocked(FileDescriptor fd, PrintWriter pw, String[] args) { Loading @@ -476,6 +489,7 @@ class VoiceInteractionManagerServiceImpl implements VoiceInteractionSessionConne pw.println(" Service info:"); mInfo.getServiceInfo().dump(new PrintWriterPrinter(pw), " "); pw.print(" Recognition service="); pw.println(mInfo.getRecognitionService()); pw.print(" Hotword detection service="); pw.println(mInfo.getHotwordDetectionService()); pw.print(" Settings activity="); pw.println(mInfo.getSettingsActivity()); pw.print(" Supports assist="); pw.println(mInfo.getSupportsAssist()); pw.print(" Supports launch from keyguard="); Loading Loading
services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerServiceImpl.java +22 −8 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import android.annotation.Nullable; import android.app.ActivityManager; import android.app.ActivityOptions; import android.app.ActivityTaskManager; import android.app.AppGlobals; import android.app.IActivityManager; import android.app.IActivityTaskManager; import android.content.BroadcastReceiver; Loading @@ -35,7 +36,9 @@ import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.content.ServiceConnection; import android.content.pm.IPackageManager; import android.content.pm.PackageManager; import android.content.pm.ServiceInfo; import android.hardware.soundtrigger.IRecognitionStatusCallback; import android.os.Bundle; import android.os.Handler; Loading Loading @@ -167,12 +170,8 @@ class VoiceInteractionManagerServiceImpl implements VoiceInteractionSessionConne mSessionComponentName = new ComponentName(service.getPackageName(), mInfo.getSessionService()); final String hotwordDetectionServiceName = mInfo.getHotwordDetectionService(); if (hotwordDetectionServiceName != null) { mHotwordDetectionComponentName = new ComponentName(service.getPackageName(), hotwordDetectionServiceName); } else { mHotwordDetectionComponentName = null; } mHotwordDetectionComponentName = hotwordDetectionServiceName != null ? new ComponentName(service.getPackageName(), hotwordDetectionServiceName) : null; mIWindowManager = IWindowManager.Stub.asInterface( ServiceManager.getService(Context.WINDOW_SERVICE)); IntentFilter filter = new IntentFilter(); Loading Loading @@ -456,8 +455,22 @@ class VoiceInteractionManagerServiceImpl implements VoiceInteractionSessionConne } boolean isIsolatedProcessLocked(ComponentName componentName) { // TODO : Need to make sure this component exists and is :isolated. return true; IPackageManager pm = AppGlobals.getPackageManager(); try { ServiceInfo serviceInfo = pm.getServiceInfo(componentName, PackageManager.GET_META_DATA | PackageManager.MATCH_DIRECT_BOOT_AWARE | PackageManager.MATCH_DIRECT_BOOT_UNAWARE, mUser); if (serviceInfo != null) { return (serviceInfo.flags & ServiceInfo.FLAG_ISOLATED_PROCESS) != 0 && (serviceInfo.flags & ServiceInfo.FLAG_EXTERNAL_SERVICE) == 0; } } catch (RemoteException e) { if (DEBUG) { Slog.w(TAG, "isIsolatedProcess RemoteException : " + e); } } return false; } public void dumpLocked(FileDescriptor fd, PrintWriter pw, String[] args) { Loading @@ -476,6 +489,7 @@ class VoiceInteractionManagerServiceImpl implements VoiceInteractionSessionConne pw.println(" Service info:"); mInfo.getServiceInfo().dump(new PrintWriterPrinter(pw), " "); pw.print(" Recognition service="); pw.println(mInfo.getRecognitionService()); pw.print(" Hotword detection service="); pw.println(mInfo.getHotwordDetectionService()); pw.print(" Settings activity="); pw.println(mInfo.getSettingsActivity()); pw.print(" Supports assist="); pw.println(mInfo.getSupportsAssist()); pw.print(" Supports launch from keyguard="); Loading