diff options
author | Svet Ganov <svetoslavganov@google.com> | 2015-06-19 22:26:30 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-06-19 22:26:32 +0000 |
commit | 1e575a0f32a00fc6a2f9a71fe1d1eb4426c71787 (patch) | |
tree | 542a3e7078fcf45f101aba84677a0bf04b1dbde3 /services/voiceinteraction/java | |
parent | 53a33da9af0cb09fb154db7dbd7c25e8a9936a7f (diff) | |
parent | adc1cf46045ae756d3a9ccbccf6b0f894e4c1edd (diff) | |
download | frameworks_base-1e575a0f32a00fc6a2f9a71fe1d1eb4426c71787.zip frameworks_base-1e575a0f32a00fc6a2f9a71fe1d1eb4426c71787.tar.gz frameworks_base-1e575a0f32a00fc6a2f9a71fe1d1eb4426c71787.tar.bz2 |
Merge "Only grant runtime permissions to special components." into mnc-dev
Diffstat (limited to 'services/voiceinteraction/java')
-rw-r--r-- | services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java b/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java index fafe44a..b68abab 100644 --- a/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java +++ b/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java @@ -26,6 +26,7 @@ import android.content.Intent; import android.content.pm.ApplicationInfo; import android.content.pm.IPackageManager; import android.content.pm.PackageManager; +import android.content.pm.PackageManagerInternal; import android.content.pm.ResolveInfo; import android.content.pm.ServiceInfo; import android.content.res.Resources; @@ -57,6 +58,7 @@ import com.android.internal.app.IVoiceInteractionSessionShowCallback; import com.android.internal.app.IVoiceInteractor; import com.android.internal.content.PackageMonitor; import com.android.internal.os.BackgroundThread; +import com.android.server.LocalServices; import com.android.server.SystemService; import com.android.server.UiThread; @@ -83,6 +85,21 @@ public class VoiceInteractionManagerService extends SystemService { mDbHelper = new DatabaseHelper(context); mSoundTriggerHelper = new SoundTriggerHelper(context); mServiceStub = new VoiceInteractionManagerServiceStub(); + + PackageManagerInternal packageManagerInternal = LocalServices.getService( + PackageManagerInternal.class); + packageManagerInternal.setVoiceInteractionPackagesProvider( + new PackageManagerInternal.PackagesProvider() { + @Override + public String[] getPackages(int userId) { + mServiceStub.initForUser(userId); + ComponentName interactor = mServiceStub.getCurInteractor(userId); + if (interactor != null) { + return new String[] {interactor.getPackageName()}; + } + return null; + } + }); } @Override |