Merge "Deprecate and no-op test API getContentCaptureServicePackageName"

This commit is contained in:
Nikita Dubrovsky
2022-07-13 21:59:32 +00:00
committed by Android (Google) Code Review
5 changed files with 10 additions and 23 deletions

View File

@@ -822,7 +822,7 @@ package android.content.pm {
}
public abstract class PackageManager {
method @Nullable public String getContentCaptureServicePackageName();
method @Deprecated @Nullable public final String getContentCaptureServicePackageName();
method @Nullable public String getDefaultTextClassifierPackageName();
method @RequiresPermission(android.Manifest.permission.INJECT_EVENTS) public android.os.IBinder getHoldLockToken();
method public abstract int getInstallReason(@NonNull String, @NonNull android.os.UserHandle);

View File

@@ -3656,15 +3656,6 @@ public class ApplicationPackageManager extends PackageManager {
}
}
@Override
public String getContentCaptureServicePackageName() {
try {
return mPM.getContentCaptureServicePackageName();
} catch (RemoteException e) {
throw e.rethrowAsRuntimeException();
}
}
@Override
public boolean isPackageStateProtected(String packageName, int userId) {
try {

View File

@@ -715,8 +715,6 @@ interface IPackageManager {
String getIncidentReportApproverPackageName();
String getContentCaptureServicePackageName();
boolean isPackageStateProtected(String packageName, int userId);
void sendDeviceCustomizationReadyBroadcast();

View File

@@ -10083,15 +10083,21 @@ public abstract class PackageManager {
}
/**
* @return the system defined content capture package name, or null if there's none.
* @deprecated This function throws an {@link UnsupportedOperationException}. For pre-granting
* permissions, instead of looking up the package that provides {@code ContentCaptureService},
* use roles.
*
* @hide
*/
// This function cannot yet be removed because it is referenced from GTS tests. The tests have
// been updated to not rely on it when running on Android T and above, but in order to compile
// the tests we must keep this method.
@Deprecated
@TestApi
@Nullable
public String getContentCaptureServicePackageName() {
public final String getContentCaptureServicePackageName() {
throw new UnsupportedOperationException(
"getContentCaptureServicePackageName not implemented in subclass");
"getContentCaptureServicePackageName is deprecated");
}
/**

View File

@@ -387,14 +387,6 @@ public abstract class IPackageManagerBase extends IPackageManager.Stub {
return snapshot().getComponentEnabledSetting(component, Binder.getCallingUid(), userId);
}
@Override
@Deprecated
public final String getContentCaptureServicePackageName() {
return mService.ensureSystemPackageName(snapshot(),
mService.getPackageFromComponentString(
R.string.config_defaultContentCaptureService));
}
@Nullable
@Override
@Deprecated