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

Commit b7b95015 authored by Svet Ganov's avatar Svet Ganov
Browse files

Apps targeting P need phone pemrisison to get device serial - framework

Test: cts-tradefed run cts-dev -m CtsAppSecurityHostTestCases
          -t android.appsecurity.cts.PermissionsHostTest#testSerialAccessPolicy

bug:30978688

Change-Id: I2f65cd556798e20d1b029fbcf151d09f818c1bda
parent ababce19
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -7081,9 +7081,11 @@ public class ActivityManagerService extends IActivityManager.Stub
            }
            // We deprecated Build.SERIAL and it is not accessible to
            // apps that target the v2 security sandbox. Since access to
            // the serial is now behind a permission we push down the value.
            String buildSerial = appInfo.targetSandboxVersion < 2
            // apps that target the v2 security sandbox and to apps that
            // target APIs higher than O MR1. Since access to the serial
            // is now behind a permission we push down the value.
            final String buildSerial = (appInfo.targetSandboxVersion < 2
                    && appInfo.targetSdkVersion <= Build.VERSION_CODES.O_MR1)
                            ? sTheRealBuildSerial : Build.UNKNOWN;
            // Check if this is a secondary process that should be incorporated into some