diff options
author | Zak Cohen <zakcohen@google.com> | 2019-03-01 14:53:09 -0800 |
---|---|---|
committer | Zak Cohen <zakcohen@google.com> | 2019-03-04 19:37:46 +0000 |
commit | 969d39d4306023279874d998eb65b149d8a7ae55 (patch) | |
tree | 09a5d698480a20e9339971e64318b411d4780869 /services/contentsuggestions | |
parent | a6f2ea1e990c8214f9656cad659d902956afcef3 (diff) |
Adds android.permission.BIND_CONTENT_SUGGESTIONS_SERVICE.
Adds permission required for being bound as a ContentSuggestionsService.
Bug: 126596331
Test: CTS test
Change-Id: Idf211f11dfb2addc348a46974e79cf1f5c21dc6b
Diffstat (limited to 'services/contentsuggestions')
-rw-r--r-- | services/contentsuggestions/java/com/android/server/contentsuggestions/ContentSuggestionsPerUserService.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/services/contentsuggestions/java/com/android/server/contentsuggestions/ContentSuggestionsPerUserService.java b/services/contentsuggestions/java/com/android/server/contentsuggestions/ContentSuggestionsPerUserService.java index a18686da653e..9b70272ed952 100644 --- a/services/contentsuggestions/java/com/android/server/contentsuggestions/ContentSuggestionsPerUserService.java +++ b/services/contentsuggestions/java/com/android/server/contentsuggestions/ContentSuggestionsPerUserService.java @@ -16,6 +16,7 @@ package com.android.server.contentsuggestions; +import android.Manifest; import android.annotation.NonNull; import android.annotation.Nullable; import android.app.ActivityManager; @@ -73,6 +74,13 @@ public final class ContentSuggestionsPerUserService extends throw new PackageManager.NameNotFoundException( "Could not get service for " + serviceComponent); } + if (!Manifest.permission.BIND_CONTENT_SUGGESTIONS_SERVICE.equals(si.permission)) { + Slog.w(TAG, "ContentSuggestionsService from '" + si.packageName + + "' does not require permission " + + Manifest.permission.BIND_CONTENT_SUGGESTIONS_SERVICE); + throw new SecurityException("Service does not require permission " + + Manifest.permission.BIND_CONTENT_SUGGESTIONS_SERVICE); + } return si; } |