Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 10b004d2 authored by Mina Granic's avatar Mina Granic Committed by Mina Karadzic
Browse files

Remove shouldOverrideToPortrait.

A method with a new signature has been launched in 25Q2.

Flag: EXEMPT remove unused code.
Bug: 314960895
Test: manual build
Test: atest PropertyTest

Change-Id: I2d6a8b5282f504118454008dd55678858f5ff217
parent 1d360925
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -1664,10 +1664,9 @@ package android.hardware.camera2 {
  public final class CameraManager {
    method @NonNull public android.hardware.camera2.CameraCharacteristics getCameraCharacteristics(@NonNull String, boolean) throws android.hardware.camera2.CameraAccessException;
    method public String[] getCameraIdListNoLazy() throws android.hardware.camera2.CameraAccessException;
    method @FlaggedApi("com.android.window.flags.enable_camera_compat_for_desktop_windowing") public static int getRotationOverrideInternal(@Nullable android.content.Context, @Nullable android.content.pm.PackageManager, @Nullable String);
    method public static int getRotationOverride(@Nullable android.content.Context, @Nullable android.content.pm.PackageManager, @Nullable String);
    method @RequiresPermission(android.Manifest.permission.CAMERA) public void openCamera(@NonNull String, boolean, @Nullable android.os.Handler, @NonNull android.hardware.camera2.CameraDevice.StateCallback) throws android.hardware.camera2.CameraAccessException;
    method @RequiresPermission(allOf={android.Manifest.permission.SYSTEM_CAMERA, android.Manifest.permission.CAMERA}) public void openCamera(@NonNull String, int, @NonNull java.util.concurrent.Executor, @NonNull android.hardware.camera2.CameraDevice.StateCallback) throws android.hardware.camera2.CameraAccessException;
    method public static boolean shouldOverrideToPortrait(@Nullable android.content.pm.PackageManager, @Nullable String);
    field public static final String LANDSCAPE_TO_PORTRAIT_PROP = "camera.enable_landscape_to_portrait";
    field public static final long OVERRIDE_CAMERA_LANDSCAPE_TO_PORTRAIT = 250678880L; // 0xef10e60L
    field @FlaggedApi("com.android.window.flags.enable_camera_compat_for_desktop_windowing") public static final int ROTATION_OVERRIDE_NONE = 0; // 0x0
+52 −0
Original line number Diff line number Diff line
@@ -545,16 +545,62 @@ OptionalBuilderConstructorArgument: android.service.notification.ZenPolicy.Build
    Builder constructor arguments must be mandatory (i.e. not @Nullable): parameter policy in android.service.notification.ZenPolicy.Builder(android.service.notification.ZenPolicy policy)


OverlappingConstants: android.app.appfunctions.AppFunctionManager#ACCESS_FLAG_MASK_OTHER:
    Found overlapping flag constant values: `ACCESS_FLAG_MASK_OTHER` with value 6 (0x6) and overlapping flag value 31 (0x1f) from `ACCESS_FLAG_MASK_ALL`


ProtectedMember: android.app.AppDetailsActivity#onCreate(android.os.Bundle):
    Protected methods not allowed; must be public: method android.app.AppDetailsActivity.onCreate(android.os.Bundle)}
ProtectedMember: android.view.ViewGroup#resetResolvedDrawables():
    Protected methods not allowed; must be public: method android.view.ViewGroup.resetResolvedDrawables()}


RequiresPermission: android.accounts.AccountManager#addAccount(String, String, String[], android.os.Bundle, android.app.Activity, android.accounts.AccountManagerCallback<android.os.Bundle>, android.os.Handler):
    Method 'addAccount' documentation duplicates auto-generated documentation by @RequiresPermission. If the permissions are only required under certain circumstances use conditional=true to suppress the auto-documentation
RequiresPermission: android.accounts.AccountManager#addAccountExplicitly(android.accounts.Account, String, android.os.Bundle):
    Method 'addAccountExplicitly' documentation duplicates auto-generated documentation by @RequiresPermission. If the permissions are only required under certain circumstances use conditional=true to suppress the auto-documentation
RequiresPermission: android.accounts.AccountManager#blockingGetAuthToken(android.accounts.Account, String, boolean):
    Method 'blockingGetAuthToken' documentation duplicates auto-generated documentation by @RequiresPermission. If the permissions are only required under certain circumstances use conditional=true to suppress the auto-documentation
RequiresPermission: android.accounts.AccountManager#clearPassword(android.accounts.Account):
    Method 'clearPassword' documentation duplicates auto-generated documentation by @RequiresPermission. If the permissions are only required under certain circumstances use conditional=true to suppress the auto-documentation
RequiresPermission: android.accounts.AccountManager#confirmCredentials(android.accounts.Account, android.os.Bundle, android.app.Activity, android.accounts.AccountManagerCallback<android.os.Bundle>, android.os.Handler):
    Method 'confirmCredentials' documentation duplicates auto-generated documentation by @RequiresPermission. If the permissions are only required under certain circumstances use conditional=true to suppress the auto-documentation
RequiresPermission: android.accounts.AccountManager#editProperties(String, android.app.Activity, android.accounts.AccountManagerCallback<android.os.Bundle>, android.os.Handler):
    Method 'editProperties' documentation duplicates auto-generated documentation by @RequiresPermission. If the permissions are only required under certain circumstances use conditional=true to suppress the auto-documentation
RequiresPermission: android.accounts.AccountManager#getAccountsByType(String):
    Method 'getAccountsByType' documentation duplicates auto-generated documentation by @RequiresPermission. If the permissions are only required under certain circumstances use conditional=true to suppress the auto-documentation
RequiresPermission: android.accounts.AccountManager#getAccountsByTypeAndFeatures(String, String[], android.accounts.AccountManagerCallback<android.accounts.Account[]>, android.os.Handler):
    Method 'getAccountsByTypeAndFeatures' documentation mentions permissions without declaring @RequiresPermission
RequiresPermission: android.accounts.AccountManager#getAuthToken(android.accounts.Account, String, android.os.Bundle, android.app.Activity, android.accounts.AccountManagerCallback<android.os.Bundle>, android.os.Handler):
    Method 'getAuthToken' documentation duplicates auto-generated documentation by @RequiresPermission. If the permissions are only required under certain circumstances use conditional=true to suppress the auto-documentation
RequiresPermission: android.accounts.AccountManager#getAuthToken(android.accounts.Account, String, android.os.Bundle, boolean, android.accounts.AccountManagerCallback<android.os.Bundle>, android.os.Handler):
    Method 'getAuthToken' documentation duplicates auto-generated documentation by @RequiresPermission. If the permissions are only required under certain circumstances use conditional=true to suppress the auto-documentation
RequiresPermission: android.accounts.AccountManager#getAuthTokenByFeatures(String, String, String[], android.app.Activity, android.os.Bundle, android.os.Bundle, android.accounts.AccountManagerCallback<android.os.Bundle>, android.os.Handler):
    Method 'getAuthTokenByFeatures' documentation duplicates auto-generated documentation by @RequiresPermission. If the permissions are only required under certain circumstances use conditional=true to suppress the auto-documentation
RequiresPermission: android.accounts.AccountManager#getPassword(android.accounts.Account):
    Method 'getPassword' documentation duplicates auto-generated documentation by @RequiresPermission. If the permissions are only required under certain circumstances use conditional=true to suppress the auto-documentation
RequiresPermission: android.accounts.AccountManager#getUserData(android.accounts.Account, String):
    Method 'getUserData' documentation duplicates auto-generated documentation by @RequiresPermission. If the permissions are only required under certain circumstances use conditional=true to suppress the auto-documentation
RequiresPermission: android.accounts.AccountManager#hasFeatures(android.accounts.Account, String[], android.accounts.AccountManagerCallback<java.lang.Boolean>, android.os.Handler):
    Method 'hasFeatures' documentation mentions permissions without declaring @RequiresPermission
RequiresPermission: android.accounts.AccountManager#invalidateAuthToken(String, String):
    Method 'invalidateAuthToken' documentation duplicates auto-generated documentation by @RequiresPermission. If the permissions are only required under certain circumstances use conditional=true to suppress the auto-documentation
RequiresPermission: android.accounts.AccountManager#peekAuthToken(android.accounts.Account, String):
    Method 'peekAuthToken' documentation duplicates auto-generated documentation by @RequiresPermission. If the permissions are only required under certain circumstances use conditional=true to suppress the auto-documentation
RequiresPermission: android.accounts.AccountManager#removeAccount(android.accounts.Account, android.accounts.AccountManagerCallback<java.lang.Boolean>, android.os.Handler):
    Method 'removeAccount' documentation duplicates auto-generated documentation by @RequiresPermission. If the permissions are only required under certain circumstances use conditional=true to suppress the auto-documentation
RequiresPermission: android.accounts.AccountManager#removeAccountExplicitly(android.accounts.Account):
    Method 'removeAccountExplicitly' documentation duplicates auto-generated documentation by @RequiresPermission. If the permissions are only required under certain circumstances use conditional=true to suppress the auto-documentation
RequiresPermission: android.accounts.AccountManager#renameAccount(android.accounts.Account, String, android.accounts.AccountManagerCallback<android.accounts.Account>, android.os.Handler):
    Method 'renameAccount' documentation duplicates auto-generated documentation by @RequiresPermission. If the permissions are only required under certain circumstances use conditional=true to suppress the auto-documentation
RequiresPermission: android.accounts.AccountManager#setAuthToken(android.accounts.Account, String, String):
    Method 'setAuthToken' documentation duplicates auto-generated documentation by @RequiresPermission. If the permissions are only required under certain circumstances use conditional=true to suppress the auto-documentation
RequiresPermission: android.accounts.AccountManager#setPassword(android.accounts.Account, String):
    Method 'setPassword' documentation duplicates auto-generated documentation by @RequiresPermission. If the permissions are only required under certain circumstances use conditional=true to suppress the auto-documentation
RequiresPermission: android.accounts.AccountManager#setUserData(android.accounts.Account, String, String):
    Method 'setUserData' documentation duplicates auto-generated documentation by @RequiresPermission. If the permissions are only required under certain circumstances use conditional=true to suppress the auto-documentation
RequiresPermission: android.accounts.AccountManager#updateCredentials(android.accounts.Account, String, android.os.Bundle, android.app.Activity, android.accounts.AccountManagerCallback<android.os.Bundle>, android.os.Handler):
    Method 'updateCredentials' documentation duplicates auto-generated documentation by @RequiresPermission. If the permissions are only required under certain circumstances use conditional=true to suppress the auto-documentation
RequiresPermission: android.app.ActivityManager#addOnUidImportanceListener(android.app.ActivityManager.OnUidImportanceListener, int):
    Method 'addOnUidImportanceListener' documentation mentions permissions already declared by @RequiresPermission
RequiresPermission: android.app.ActivityManager#getHistoricalProcessExitReasons(String, int, int):
@@ -1511,6 +1557,8 @@ RequiresPermission: android.telephony.TelephonyManager#getSystemSelectionChannel
    Method 'getSystemSelectionChannels' documentation mentions permissions already declared by @RequiresPermission
RequiresPermission: android.telephony.TelephonyManager#getTelephonyHistograms():
    Method 'getTelephonyHistograms' documentation mentions permissions already declared by @RequiresPermission
RequiresPermission: android.telephony.TelephonyManager#getUiccCardsInfo():
    Method 'getUiccCardsInfo' documentation duplicates auto-generated documentation by @RequiresPermission. If the permissions are only required under certain circumstances use conditional=true to suppress the auto-documentation
RequiresPermission: android.telephony.TelephonyManager#getVisualVoicemailPackageName():
    Method 'getVisualVoicemailPackageName' documentation mentions permissions already declared by @RequiresPermission
RequiresPermission: android.telephony.TelephonyManager#getVoiceActivationState():
@@ -2041,8 +2089,12 @@ UnflaggedApi: android.content.pm.UserInfo#isCommunalProfile():
    New API must be flagged with @FlaggedApi: method android.content.pm.UserInfo.isCommunalProfile()
UnflaggedApi: android.content.pm.UserInfo#isPrivateProfile():
    New API must be flagged with @FlaggedApi: method android.content.pm.UserInfo.isPrivateProfile()
UnflaggedApi: android.content.pm.UserInfo#supportsSwitchToByUser():
    Changes from deprecated to not deprecated must be flagged with @FlaggedApi: method android.content.pm.UserInfo.supportsSwitchToByUser()
UnflaggedApi: android.credentials.CredentialProviderInfo#isPrimary():
    New API must be flagged with @FlaggedApi: method android.credentials.CredentialProviderInfo.isPrimary()
UnflaggedApi: android.hardware.camera2.CameraManager#getRotationOverride(android.content.Context, android.content.pm.PackageManager, String):
    New API must be flagged with @FlaggedApi: method android.hardware.camera2.CameraManager.getRotationOverride(android.content.Context,android.content.pm.PackageManager,String)
UnflaggedApi: android.hardware.input.InputManager#addUniqueIdAssociationByPort(String, String):
    New API must be flagged with @FlaggedApi: method android.hardware.input.InputManager.addUniqueIdAssociationByPort(String,String)
UnflaggedApi: android.hardware.input.InputManager#removeUniqueIdAssociationByPort(String):
+1 −44
Original line number Diff line number Diff line
@@ -85,7 +85,6 @@ import android.util.Pair;
import android.util.Size;
import android.view.Display;
import android.view.Surface;
import android.window.DesktopModeFlags;

import com.android.internal.camera.flags.Flags;
import com.android.internal.util.ArrayUtils;
@@ -1697,26 +1696,8 @@ public final class CameraManager {
    /**
     * @hide
     */
    public static int getRotationOverride(@Nullable Context context,
            @Nullable PackageManager packageManager, @Nullable String packageName) {
        // Isolated process does not have access to the ContentProvider which
        // `DesktopModeFlags` uses. `DesktopModeFlags` combines developer options and Aconfig flags.
        if (!Process.isIsolated() && DesktopModeFlags
                .ENABLE_CAMERA_COMPAT_SIMULATE_REQUESTED_ORIENTATION.isTrue()) {
            return getRotationOverrideInternal(context, packageManager, packageName);
        } else {
            return shouldOverrideToPortrait(packageManager, packageName)
                        ? ICameraService.ROTATION_OVERRIDE_OVERRIDE_TO_PORTRAIT
                        : ICameraService.ROTATION_OVERRIDE_NONE;
        }
    }

    /**
     * @hide
     */
    @FlaggedApi(com.android.window.flags.Flags.FLAG_ENABLE_CAMERA_COMPAT_FOR_DESKTOP_WINDOWING)
    @TestApi
    public static int getRotationOverrideInternal(@Nullable Context context,
    public static int getRotationOverride(@Nullable Context context,
            @Nullable PackageManager packageManager, @Nullable String packageName) {
        if (!CameraManagerGlobal.sLandscapeToPortrait) {
            return ICameraService.ROTATION_OVERRIDE_NONE;
@@ -1823,30 +1804,6 @@ public final class CameraManager {
        }
    }

    /**
     * @hide
     */
    @TestApi
    public static boolean shouldOverrideToPortrait(@Nullable PackageManager packageManager,
            @Nullable String packageName) {
        if (!CameraManagerGlobal.sLandscapeToPortrait) {
            return false;
        }

        if (packageManager != null && packageName != null) {
            try {
                return packageManager.getProperty(
                        PackageManager.PROPERTY_COMPAT_OVERRIDE_LANDSCAPE_TO_PORTRAIT,
                        packageName).getBoolean();
            } catch (PackageManager.NameNotFoundException e) {
                // No such property
            }
        }

        return CompatChanges.isChangeEnabled(OVERRIDE_CAMERA_LANDSCAPE_TO_PORTRAIT);
    }


    /**
     * @hide
     */