From ad97b8b905bb6f0a30241bea27a56572068c39ab Mon Sep 17 00:00:00 2001 From: Amith Yamasani Date: Tue, 29 Jul 2014 16:25:17 -0700 Subject: [PATCH] Potential fix for apps disappearing in launcher on system server crash Throw RuntimeException to launcher if there was a RemoteException from LauncherAppsService. This matches the behavior of previous calls that were made to PackageManager that could have resulted in a RemoteException if the system server was dying/dead. Bug: 15687732 Change-Id: Ifda3fda209141b361a286fc033217acfa0ec196e --- core/java/android/content/pm/LauncherApps.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/java/android/content/pm/LauncherApps.java b/core/java/android/content/pm/LauncherApps.java index 2d50b5aa6ffbb..c95a5bf5c780a 100644 --- a/core/java/android/content/pm/LauncherApps.java +++ b/core/java/android/content/pm/LauncherApps.java @@ -190,7 +190,7 @@ public class LauncherApps { return info; } } catch (RemoteException re) { - return null; + throw new RuntimeException("Failed to call LauncherAppsService"); } return null; } @@ -259,7 +259,7 @@ public class LauncherApps { try { return mService.isPackageEnabled(packageName, user); } catch (RemoteException re) { - return false; + throw new RuntimeException("Failed to call LauncherAppsService"); } } @@ -275,7 +275,7 @@ public class LauncherApps { try { return mService.isActivityEnabled(component, user); } catch (RemoteException re) { - return false; + throw new RuntimeException("Failed to call LauncherAppsService"); } }