Merge "Grant record audio permission to SystemCaptionsService instead of ContentCaptureService"
This commit is contained in:
@@ -3054,9 +3054,9 @@ public class ApplicationPackageManager extends PackageManager {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getContentCaptureServicePackageName() {
|
||||
public String getSystemCaptionsServicePackageName() {
|
||||
try {
|
||||
return mPM.getContentCaptureServicePackageName();
|
||||
return mPM.getSystemCaptionsServicePackageName();
|
||||
} catch (RemoteException e) {
|
||||
throw e.rethrowAsRuntimeException();
|
||||
}
|
||||
|
||||
@@ -742,7 +742,7 @@ interface IPackageManager {
|
||||
|
||||
String getAppPredictionServicePackageName();
|
||||
|
||||
String getContentCaptureServicePackageName();
|
||||
String getSystemCaptionsServicePackageName();
|
||||
|
||||
String getIncidentReportApproverPackageName();
|
||||
|
||||
|
||||
@@ -6863,9 +6863,9 @@ public abstract class PackageManager {
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
public String getContentCaptureServicePackageName() {
|
||||
public String getSystemCaptionsServicePackageName() {
|
||||
throw new UnsupportedOperationException(
|
||||
"getContentCaptureServicePackageName not implemented in subclass");
|
||||
"getSystemCaptionsServicePackageName not implemented in subclass");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -20173,21 +20173,20 @@ public class PackageManagerService extends IPackageManager.Stub
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getContentCaptureServicePackageName() {
|
||||
String contentCaptureServiceName =
|
||||
mContext.getString(R.string.config_defaultContentCaptureService);
|
||||
public String getSystemCaptionsServicePackageName() {
|
||||
String flattenedSystemCaptionsServiceComponentName =
|
||||
mContext.getString(R.string.config_defaultSystemCaptionsService);
|
||||
|
||||
if (TextUtils.isEmpty(contentCaptureServiceName)) {
|
||||
if (TextUtils.isEmpty(flattenedSystemCaptionsServiceComponentName)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
int separatorIndex = contentCaptureServiceName.indexOf("/");
|
||||
|
||||
if (separatorIndex < 0) {
|
||||
ComponentName systemCaptionsServiceComponentName =
|
||||
ComponentName.unflattenFromString(flattenedSystemCaptionsServiceComponentName);
|
||||
if (systemCaptionsServiceComponentName == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return contentCaptureServiceName.substring(0, separatorIndex);
|
||||
return systemCaptionsServiceComponentName.getPackageName();
|
||||
}
|
||||
|
||||
public String getIncidentReportApproverPackageName() {
|
||||
|
||||
@@ -748,11 +748,11 @@ public final class DefaultPermissionGrantPolicy {
|
||||
grantSystemFixedPermissionsToSystemPackage("com.android.sharedstoragebackup", userId,
|
||||
STORAGE_PERMISSIONS);
|
||||
|
||||
// Content Capture Service
|
||||
String contentCaptureServicePackageName =
|
||||
mContext.getPackageManager().getContentCaptureServicePackageName();
|
||||
if (!TextUtils.isEmpty(contentCaptureServicePackageName)) {
|
||||
grantPermissionsToSystemPackage(contentCaptureServicePackageName, userId,
|
||||
// System Captions Service
|
||||
String systemCaptionsServicePackageName =
|
||||
mContext.getPackageManager().getSystemCaptionsServicePackageName();
|
||||
if (!TextUtils.isEmpty(systemCaptionsServicePackageName)) {
|
||||
grantPermissionsToSystemPackage(systemCaptionsServicePackageName, userId,
|
||||
MICROPHONE_PERMISSIONS);
|
||||
}
|
||||
|
||||
|
||||
@@ -1138,7 +1138,7 @@ public class IPackageManagerStub implements IPackageManager {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getContentCaptureServicePackageName() throws RemoteException {
|
||||
public String getSystemCaptionsServicePackageName() throws RemoteException {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user