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

Commit 8a40728f authored by Songchun Fan's avatar Songchun Fan
Browse files

[pm] make sure to restore mAlways=true preferred activity filter

Test: manual and verified that if a action has more than one preferred
activity filters, at least the mAlways=true filter will be restored on reboot.

Test: Before reboot in dumpsys:
      android.media.action.STILL_IMAGE_CAMERA:
        59144b6 com.google.android.GoogleCamera/com.android.camera.CameraImageActivity
         mMatch=0x100000 mAlways=false
          Action: "android.media.action.STILL_IMAGE_CAMERA"
          Category: "android.intent.category.DEFAULT"
        7d0bd59 com.google.android.GoogleCamera/com.android.camera.CameraImageActivity
         mMatch=0x100000 mAlways=false
          Action: "android.media.action.STILL_IMAGE_CAMERA"
          Category: "android.intent.category.DEFAULT"
        fbb913d com.google.android.GoogleCamera/com.android.camera.CameraImageActivity
         mMatch=0x100000 mAlways=false
          Action: "android.media.action.STILL_IMAGE_CAMERA"
          Category: "android.intent.category.DEFAULT"
        c86d195 com.google.android.GoogleCamera/com.android.camera.CameraImageActivity
         mMatch=0x100000 mAlways=true
          Selected from:
            com.google.android.GoogleCamera/com.android.camera.CameraImageActivity
            photo.android.hd.camera/com.android.camera.activity.SplashActivity
            filter.camera.snap.photo.video.panorama/cn.kuxun.kxcamera.CameraActivity
            net.sourceforge.opencamera/.MainActivity
            com.snapchat.android/com.snap.mushroom.MainActivity
          Action: "android.media.action.STILL_IMAGE_CAMERA"
          Category: "android.intent.category.DEFAULT"

Test: After reboot in dumpsys:
      android.media.action.STILL_IMAGE_CAMERA:
        aaf8ce5 com.google.android.GoogleCamera/com.android.camera.CameraImageActivity
         mMatch=0x100000 mAlways=false
          Action: "android.media.action.STILL_IMAGE_CAMERA"
          Category: "android.intent.category.DEFAULT"
        c249186 com.google.android.GoogleCamera/com.android.camera.CameraImageActivity
         mMatch=0x100000 mAlways=true
          Selected from:
            com.google.android.GoogleCamera/com.android.camera.CameraImageActivity
            photo.android.hd.camera/com.android.camera.activity.SplashActivity
            filter.camera.snap.photo.video.panorama/cn.kuxun.kxcamera.CameraActivity
            net.sourceforge.opencamera/.MainActivity
            com.snapchat.android/com.snap.mushroom.MainActivity
          Action: "android.media.action.STILL_IMAGE_CAMERA"
          Category: "android.intent.category.DEFAULT"

BUG: 157548344
Change-Id: I4b6c23e25957138a0b38f4be074c24a4519df59f
parent 9c9434b3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1407,7 +1407,7 @@ public final class Settings {
                if (pa.mPref.getParseError() == null) {
                    final PreferredIntentResolver resolver = editPreferredActivitiesLPw(userId);
                    ArrayList<PreferredActivity> pal = resolver.findFilters(pa);
                    if (pal == null || pal.size() == 0) {
                    if (pal == null || pal.size() == 0 || pa.mPref.mAlways) {
                        resolver.addFilter(pa);
                    }
                } else {