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

Commit 3d0854e4 authored by Dharmesh Mokani's avatar Dharmesh Mokani
Browse files

Remove STOPSHIPs from GSA 4.0

Added stopships so that GSA won't crash on older L release.

Bug: 17443440
Change-Id: I792eb53d5021118bdb09c44ffae7a8286a0cd69b
parent 5b7d28fc
Loading
Loading
Loading
Loading
+3 −9
Original line number Diff line number Diff line
@@ -121,15 +121,9 @@ class AppWidgetManagerCompatVL extends AppWidgetManagerCompat {
        } else {
            badgeLocation.offset(bitmap.getWidth() - badgeSize - badgeMargin, top);
        }
        Drawable drawable = null;
        // STOPSHIP(mokani): Remove catch block once dogfood build is bigger than LRW70.
        // This hack is just to prevent crash in older builds.
        try {
            drawable = mPm.getUserBadgedDrawableForDensity(new BitmapDrawable(res, bitmap),
                    info.getProfile(), badgeLocation, 0);
        } catch (Throwable e) {
            return bitmap;
        }

        Drawable drawable = mPm.getUserBadgedDrawableForDensity(
                new BitmapDrawable(res, bitmap), info.getProfile(), badgeLocation, 0);

        if (drawable instanceof BitmapDrawable) {
            return ((BitmapDrawable) drawable).getBitmap();
+2 −10
Original line number Diff line number Diff line
@@ -47,11 +47,7 @@ public class PackageInstallerCompatVL extends PackageInstallerCompat {
        mResumed = false;
        mBound = false;

        // STOPSHIP(mokani): Remove catch block once dogfood build is bigger than LRW70.
        // This hack is just to prevent crash in older builds.
        try {
        mInstaller.registerSessionCallback(mCallback);
        } catch (Throwable e) { }

        // On start, send updates for all active sessions
        for (SessionInfo info : mInstaller.getAllSessions()) {
@@ -77,11 +73,7 @@ public class PackageInstallerCompatVL extends PackageInstallerCompat {

    @Override
    public void onStop() {
        // STOPSHIP(mokani): Remove catch block once dogfood build is bigger than LRW70.
        // This hack is just to prevent crash in older builds.
        try {
        mInstaller.unregisterSessionCallback(mCallback);
        } catch (Throwable e) { }
    }

    @Override
+2 −14
Original line number Diff line number Diff line
@@ -51,13 +51,7 @@ public class UserManagerCompatVL extends UserManagerCompatV17 {

    @Override
    public Drawable getBadgedDrawableForUser(Drawable unbadged, UserHandleCompat user) {
        // STOPSHIP(mokani): Remove catch block once dogfood build is bigger than LRW70.
        // This hack is just to prevent crash in older builds.
        try {
        return mPm.getUserBadgedIcon(unbadged, user.getUser());
        } catch (Throwable e) {
            return unbadged;
        }
    }

    @Override
@@ -65,13 +59,7 @@ public class UserManagerCompatVL extends UserManagerCompatV17 {
        if (user == null) {
            return label;
        }
        // STOPSHIP(mokani): Remove catch block once dogfood build is bigger than LRW70.
        // This hack is just to prevent crash in older builds.
        try {
        return mPm.getUserBadgedLabel(label, user.getUser());
        } catch (Throwable e) {
            return label;
        }
    }
}