TapAndTurn icon indicating copy to clipboard operation
TapAndTurn copied to clipboard

App whitelist

Open AAlchemy opened this issue 8 years ago • 20 comments

Need the ability to (whitelist) allow specific apps to change rotation at will. it wrecks havoc on their aspect ratio even after clicking the icon to change rotation after the app launches. (i've only seen this in games so far)

AAlchemy avatar Dec 11 '16 03:12 AAlchemy

Hmm also had this in mind, but I'm not sure how much effort this would be - could you provide a PR with some starting point?

I guess the idea would be to add the overlay once a whitelisted app had been detected and remove the overlay once it finished...

so we'd need:

  • ability to detect running app
  • ability to configure a white/blacklist
  • some logic to match against the list when the service is triggered by rotation

gabm avatar Dec 11 '16 10:12 gabm

This even crashes the camera app, we need a way to bypass.

licaon-kter avatar Dec 27 '16 19:12 licaon-kter

Even crashes it? that's strange?! .. although camera apps usually have their own logic to detect rotation and that's why TT is probably unnecessary for camera apps...

I don't have that much time atm, maybe some of you guys could start work?!

gabm avatar Dec 27 '16 20:12 gabm

Xperia camera app tries to rotate the screen I guess, so it ends up rotated and if I don't touch the Tap'n'Turn icon fast enough it will crash with a message.

I'll have to retest how the Video app does, since that has an internal rotate button too.

licaon-kter avatar Dec 27 '16 21:12 licaon-kter

I suggest an enhancement of the whitelist- feature: TT could handle 4 different modes for each installed app: [1] TT- mode (like out is with TT installed and active nowadays), [2] rotation by system/app (behavior like it is with TT not installed / inactive, but rotation enabled in Android's system settings), [3] fixed portrait mode, [4] fixed landscape mode. In TT's settings, there should be a global parameter deciding the behavior of every app not having a whitelist entry with a dedicated setting. For sure, there have to be the ability to configure every apps behavior (if wanted). TT itself has to hook into a kind of "foreground app change event" (if there is one). Everytime the foreground app changes, TT have to search a kind of lookup table and adapt the rotation's behavior. I think when realizing this concept, there would be no need to remember an app's "latest rotation status".

just-Nob avatar Feb 18 '17 22:02 just-Nob

Hope you tackle this next, camera crashes when the app is on.

licaon-kter avatar May 27 '17 18:05 licaon-kter

hmmm still happening? so i guess the proper solution would be a whitelist/blacklist no?

gabm avatar May 27 '17 18:05 gabm

... cause i guess finding the root of the problem will be hard/impossible ... i can't reproduce that at all (camera/YouTube/video player, gallery)

gabm avatar May 27 '17 18:05 gabm

I'll try to get a log.

Basically neither the Xperia default camera app, nor OpenCamera can be used. They crash ("another app is using the camera") or just error out ("unable to open preview")

But things are strange, since I remember using the camera a day ago when I had the app installed, so my guess is something gets triggered (forced Portrait mode maybe?!) and then even a reboot can't fix it. That made me remember that I had this issue yesterday, iirc, but a reboot fixed it then at least.

I've tested with or without device setting "auto-rotate" ON, no change.

licaon-kter avatar May 27 '17 19:05 licaon-kter

i moved it to #29 for further discussion, as here is for app whitelist/blacklist

gabm avatar May 27 '17 20:05 gabm

Is there some way T&T could detect when an app is trying to rotate the screen by itself? I guess such apps should be left handling their rotation by themselves.

ghost avatar Jul 02 '17 20:07 ghost

i don't know how that should be possible...

gabm avatar Jul 02 '17 20:07 gabm

.. if you can prevent it (rotation), there should be a way to detect someone attempted to change rotation but failed?

ghost avatar Jul 02 '17 20:07 ghost

Does that help ? https://stackoverflow.com/questions/4625167/how-do-i-use-a-service-to-monitor-orientation-change-in-android

ghost avatar Jul 02 '17 20:07 ghost

basically TnT doesn't "prevent" rotation but instead draws an invisible overlay that requests the operating system to "keep" a certain orientation (much like video players/games do).

I don't think it's that easy to detect requested orientations - don't want to say it's impossible - but i really don't know how...

gabm avatar Jul 02 '17 20:07 gabm

thanks for the link.. I'll check that...

gabm avatar Jul 02 '17 20:07 gabm

Any news on this? I just noticed that TnT was the cause that my Barcode Scanner (https://github.com/zxing/zxing) couldn't scan any code. It needs to run in landscape mode. Maybe we could collect and list breaking apps in the readme or separately?

brezelman avatar Mar 03 '18 22:03 brezelman

funny side fact: in the meantime and after switching from Fairphone Open OS (rather close to AOSP 6) to LineageOS 14.1 (Android 7), Tap'n'Turn work nicely together and the rotation settings do not interfere with ZXing Barcode Scanner. Don't know why, just thought I mention this here.

knobhead avatar Mar 04 '18 08:03 knobhead

funny side fact: in the meantime and after switching from Fairphone Open OS (rather close to AOSP 6) to LineageOS 14.1 (Android 7), Tap'n'Turn work nicely together and the rotation settings do not interfere with ZXing Barcode Scanner. Don't know why, just thought I mention this here.

Interesting. I'm using LineageOS 14.1 (Android 7.1.2), too, (on OnePlus One) and it's most of the time not working when phone is in in portrait mode.

brezelman avatar Mar 04 '18 09:03 brezelman

Any news on this?

OpenCamera and Huawei Video are basically unusable, switching layout on the smallest movements, scaling the images strangely and such.

licaon-kter avatar Oct 28 '18 22:10 licaon-kter