Skip to content
Snippets Groups Projects
Forked from Dhina17 / platform_frameworks_base
27966 commits behind the upstream repository.
  • Tobias Thierer's avatar
    adeea59b
    Make CTS more opinionated about the platform's default MimeMap. · adeea59b
    Tobias Thierer authored
    Historically, the mapping implemented by MimeMap (formerly MimeUtils)
    was largely untested and therefore differed between Android devices.
    
    This CL topic makes CtsMimeMapTestCases a lot more opinionated by
    checking that:
    
     - MimeMap.getDefault() must respect all of the mappings supplied
       in stock Android. This is enforced via CTS bundling a copy of:
       - the {,android.,vendor.}mime.types data files
       - DefaultMimeMapFactory (rewritten via jarjar to
         android.content.type.cts.StockAndroidMimeMapFactory)
       MimeMap.getDefault() is allowed to implement _additional_
       mappings, but changed or removed mappings are not allowed.
     - Public APIs android.webkit.MimeTypeMap and
       URLConnection.getFileNameMap() must behave consistently with
       MimeMap.getDefault() (in stock Android, those APIs are
       implemented directly on top of MimeMap.getDefault()).
    
    Test: atest CtsMimeMapTestCases
    Test: atest CtsLibcoreTestCases:libcore.libcore.net.MimeMapTest
    Test: The above atest runs pass on a device that contains an
          additional mapping in vendor.mime.types that is not
          present in CTS.
    Test: Checked that on a device that changes a mapping in
          android.mime.types, CtsLibcoreTestCases still passes
          but CtsMimeMapTestCases fails.
    
    Bug: 141842930
    Bug: 139895945
    
    Change-Id: I68e0e9c3ce53c1acf2a89f8b80519f4658c07217
    adeea59b
    History
    Make CTS more opinionated about the platform's default MimeMap.
    Tobias Thierer authored
    Historically, the mapping implemented by MimeMap (formerly MimeUtils)
    was largely untested and therefore differed between Android devices.
    
    This CL topic makes CtsMimeMapTestCases a lot more opinionated by
    checking that:
    
     - MimeMap.getDefault() must respect all of the mappings supplied
       in stock Android. This is enforced via CTS bundling a copy of:
       - the {,android.,vendor.}mime.types data files
       - DefaultMimeMapFactory (rewritten via jarjar to
         android.content.type.cts.StockAndroidMimeMapFactory)
       MimeMap.getDefault() is allowed to implement _additional_
       mappings, but changed or removed mappings are not allowed.
     - Public APIs android.webkit.MimeTypeMap and
       URLConnection.getFileNameMap() must behave consistently with
       MimeMap.getDefault() (in stock Android, those APIs are
       implemented directly on top of MimeMap.getDefault()).
    
    Test: atest CtsMimeMapTestCases
    Test: atest CtsLibcoreTestCases:libcore.libcore.net.MimeMapTest
    Test: The above atest runs pass on a device that contains an
          additional mapping in vendor.mime.types that is not
          present in CTS.
    Test: Checked that on a device that changes a mapping in
          android.mime.types, CtsLibcoreTestCases still passes
          but CtsMimeMapTestCases fails.
    
    Bug: 141842930
    Bug: 139895945
    
    Change-Id: I68e0e9c3ce53c1acf2a89f8b80519f4658c07217
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
jarjar-rules.txt 99 B
rule android.content.type.DefaultMimeMapFactory android.content.type.cts.StockAndroidMimeMapFactory