summaryrefslogtreecommitdiffstats
path: root/services/voiceinteraction
diff options
context:
space:
mode:
authorSvet Ganov <svetoslavganov@google.com>2015-06-15 16:36:24 -0700
committerSvet Ganov <svetoslavganov@google.com>2015-06-19 15:17:56 -0700
commitadc1cf46045ae756d3a9ccbccf6b0f894e4c1edd (patch)
tree3026471435d1bda05cdac444e2499703a53ff78d /services/voiceinteraction
parent90b3b93de460ccd1fc1116154f5d61bd2bc93d25 (diff)
downloadframeworks_base-adc1cf46045ae756d3a9ccbccf6b0f894e4c1edd.zip
frameworks_base-adc1cf46045ae756d3a9ccbccf6b0f894e4c1edd.tar.gz
frameworks_base-adc1cf46045ae756d3a9ccbccf6b0f894e4c1edd.tar.bz2
Only grant runtime permissions to special components.
Now runtime permissions are granted only to components that are part of the system or perform special system operations. For exmple, the shell UID gets its runtime permissions granted by default and the default phone app gets the phone permissions granted by default. bug:21764803 Change-Id: If8b8cadbd1980ffe7a6fc15bbb5f54a425f6e8f9
Diffstat (limited to 'services/voiceinteraction')
-rw-r--r--services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerService.java17
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