Starting March 27, 2025, we recommend using android-latest-release instead of aosp-main to build and contribute to AOSP. For more information, see Changes to AOSP.
         
       
     
  
  
  
  
  
    
    
      
    
    
      
      Stay organized with collections
    
    
      
      Save and categorize content based on your preferences.
    
  
  
    
  
  
  
  
    
  
  
    
    
  
  
ApkChangeDetector
  public
  
  
  
  class
  ApkChangeDetector
  
    extends Object
  
  
  
  
  
  
  
    
    | java.lang.Object | 
  
  
    
      | ↳ | com.android.tradefed.targetprep.incremental.ApkChangeDetector | 
  
  
    
  This class detects whether the APKs to be installed are different from those on the device, in
 order to decide whether to skip app installation and uninstallation during ERROR(/TestAppInstallSetup)'s setUp and tearDown.
Summary
Public constructors
    ApkChangeDetector
    
public ApkChangeDetector ()
    
    
    
  
 
Public methods
    handlePackageCleanup
    
public boolean handlePackageCleanup (String packageName, 
                ITestDevice device, 
                Integer userId, 
                boolean forAllUsers)
    
    
    
  Handle package cleanup process.
    
    | Parameters | 
|---|
      
        | packageName | String: the name of package to be cleaned up. | 
      
        | device | ITestDevice: Indicates the device on which the test is running. | 
      
        | userId | Integer: The current user ID. | 
      
        | forAllUsers | boolean: Indicates whether the cleanup should be done for all users. | 
    
    
      | Returns | 
|---|
      
        | boolean | Whether the cleanup of an indicated package is done. Default to false, which
     indicates that the cleanup is not done. | 
    
      
  
 
    handleTestAppsPreinstall
    
public boolean handleTestAppsPreinstall (String packageName, 
                 testApps, 
                ITestDevice device, 
                Integer userId, 
                boolean forAllUsers)
    
    
    
  Handle app pre-install process.
    
    | Parameters | 
|---|
      
        | packageName | String: The name of the package. | 
      
        | testApps | : Indicate all APK files in the package with the nameERROR(/packageName). | 
      
        | device | ITestDevice: Indicates the device on which the test is running. | 
      
        | userId | Integer: The current user ID. | 
      
        | forAllUsers | boolean: Indicates whether the cleanup should be done for all users. | 
    
    
      | Returns | 
|---|
      
        | boolean | Whether the APKs in ERROR(/packageName)are fully handled under local incremental
     setup. Default to false, which does not oblige to re-install the package APKs. | 
    
      
  
 
 
 
  
  
 
  
    
    
      
    
    
  
       
    
    
  
  
  Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
  Last updated 2025-03-19 UTC.
  
  
  
    
      [[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-03-19 UTC."],[],[]]