清除APP 数据的时候出现Crash的情况分析

在清除Chromium 浏览器数据的时候出现了异常情况
Crash 复制步骤:
info>Storage&cache>CLEAR STORAGE>CLEAR ALL DATA>OK

清除APP 数据的时候出现Crash的情况分析_第1张图片

 Crash 关键log如下:

5-25 01:15:31.954  1497  3925 I WindowManager: WIN DEATH: Window{7b7e795 u0 org.chromium.chrome/org.chromium.chrome.browser.site_settings.ManageSpaceActivity}
05-25 01:15:31.954  1497  3925 W InputDispatcher: Attempted to unregister already unregistered input channel '7b7e795 org.chromium.chrome/org.chromium.chrome.browser.site_settings.ManageSpaceActivity (server)'
05-25 01:15:31.959  1497  1609 W ActivityManager: setHasOverlayUi called on unknown pid: 18206
05-25 01:15:31.966  1497  1609 E ActivityManager: Failure starting process org.chromium.chrome
05-25 01:15:31.966  1497  1609 E ActivityManager: java.lang.SecurityException: Package org.chromium.chrome is currently frozen!
05-25 01:15:31.966  1497  1609 E ActivityManager:     at com.android.server.pm.PackageManagerService.checkPackageStartable(PackageManagerService.java:4606)
05-25 01:15:31.966  1497  1609 E ActivityManager:     at com.android.server.am.ProcessList.startProcessLocked(ProcessList.java:1763)
05-25 01:15:31.966  1497  1609 E ActivityManager:     at com.android.server.am.ProcessList.startProcessLocked(ProcessList.java:2335)
05-25 01:15:31.966  1497  1609 E ActivityManager:     at com.android.server.am.ProcessList.startProcessLocked(ProcessList.java:2457)
05-25 01:15:31.966  1497  1609 E ActivityManager:     at com.android.server.am.ActivityManagerService.startProcessLocked(ActivityManagerService.java:3187)
05-25 01:15:31.966  1497  1609 E ActivityManager:     at com.android.server.am.ActivityManagerService.startActivityAsUserEmpty(ActivityManagerService.java:3733)
05-25 01:15:31.966  1497  1609 E ActivityManager:     at com.android.server.am.ActivityManagerService$LocalService.startActivityAsUserEmpty(ActivityManagerService.java:19089)
05-25 01:15:31.966  1497  1609 E ActivityManager:     at com.android.server.wm.-$$Lambda$gfq3ciA_KEGa4G8MjW1JFVBuAk8.accept(Unknown Source:4)
05-25 01:15:31.966  1497  1609 E ActivityManager:     at com.android.internal.util.function.pooled.PooledLambdaImpl.doInvoke(PooledLambdaImpl.java:278)
05-25 01:15:31.966  1497  1609 E ActivityManager:     at com.android.internal.util.function.pooled.PooledLambdaImpl.invoke(PooledLambdaImpl.java:201)
05-25 01:15:31.966  1497  1609 E ActivityManager:     at com.android.internal.util.function.pooled.OmniFunction.run(OmniFunction.java:97)
05-25 01:15:31.966  1497  1609 E ActivityManager:     at android.os.Handler.handleCallback(Handler.java:938)
05-25 01:15:31.966  1497  1609 E ActivityManager:     at android.os.Handler.dispatchMessage(Handler.java:99)
05-25 01:15:31.966  1497  1609 E ActivityManager:     at android.os.Looper.loop(Looper.java:223)
05-25 01:15:31.966  1497  1609 E ActivityManager:     at android.os.HandlerThread.run(HandlerThread.java:67)
05-25 01:15:31.966  1497  1609 E ActivityManager:     at com.android.server.ServiceThread.run(ServiceThread.java:44)
05-25 01:15:31.966  1497  1609 I ActivityManager: Force stopping org.chromium.chrome appid=10106 user=0: start failure
05-25 01:15:31.968  1497  1609 E libprocessgroup: getpgid(18255) failed: Permission denied
05-25 01:15:31.973  1497  1609 I chatty  : uid=1000(system) android.display identical 1 line
05-25 01:15:31.980  1497  1609 E libprocessgroup: getpgid(18255) failed: Permission denied
05-25 01:15:31.985   735   735 I Zygote  : Process 18255 exited due to signal 9 (Killed)
05-25 01:15:31.986  1497  1609 I libprocessgroup: Successfully killed process cgroup uid 10106 pid 18255 in 17ms
05-25 01:15:31.987  1497  1609 I WindowManager:   Force finishing activity ActivityRecord{3f766ec u0 org.chromium.chrome/.browser.site_settings.ManageSpaceActivity t51 f} isExiting}
05-25 01:15:31.987  1497  1609 W ActivityTaskManager: Duplicate finish request for r=ActivityRecord{3f766ec u0 org.chromium.chrome/.browser.site_settings.ManageSpaceActivity t51 f} isExiting}
05-25 01:15:31.987  1497  1609 I WindowManager:   Force finishing activity ActivityRecord{236048 u0 com.android.settings/.SubSettings t51 f}}
05-25 01:15:31.987  1497  1609 W ActivityTaskManager: Duplicate finish request for r=ActivityRecord{236048 u0 com.android.settings/.SubSettings t51 f}}
05-25 01:15:31.999  1497  1609 I ActivityManager: Exiting empty application process 0:org.chromium.chrome/u0a106 (null)
05-25 01:15:32.017   949  1353 W APM::AudioPolicyEngine: getDevicesForStrategy() unknown strategy: -1
05-25 01:15:32.018  1497  5112 I system_server: oneway function results will be dropped but finished with status OK and parcel size 4

追踪Code,在/frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java中找到抛出异常的处理位置:

if (mFrozenPackages.contains(packageName)) {
                throw new SecurityException("Package " + packageName + " is currently frozen!");
            }

问题产生的原因是:

这是因为强制清除应用程序数据可能会由于缺少文件/数据库和应用程序崩溃而导致异常行为。通常用户还需要重新启动应用程序,以确保所有应用程序数据都可以重新设置。
这取决于应用程序设计是否考虑到缓存文件异常,如果应用程序正在运行但缓存文件已清除,则是否重建文件。这个一般是应用程序需要考虑的问题。

你可能感兴趣的:(Android,应用,android,java)