kl分歧_Android的分歧

kl分歧

As they race to squeeze more and more battery out of their devices, Android handset manufactures are creating unlikely casualties: app developers.

随着他们争相从设备中榨取越来越多的电池,Android手机制造商正在造成不大可能的人员伤亡:应用程序开发人员。

To increase battery life, many manufacturers (OEMs) re-implement the inbuilt power management features of the Android Open Source Project (AOSP) in ways that aggressively restrict background processing for all but a handful of “special” apps.

为了延长电池寿命,许多制造商(OEM)重新实施了Android开放源代码项目(AOSP)的内置电源管理功能,该方式积极地限制了除少数“特殊”应用程序之外的所有应用程序的后台处理。

Android developers across the continent are discovering the hard way that certain Android API components such as Wakelocks, Alarms, Broadcast Receivers, Jobs, Push Notifications, etc. do not work as expected on many devices made by Huawei, Tecno, Xiaomi and others.

遍布非洲大陆的Android开发人员正在发现,某些Android API组件(如唤醒锁,警报,广播接收器,作业,推送通知等)很难在华为,Tecno,小米制造的许多设备上无法正常工作。

It is no surprise, of course, that such restrictions disproportionately affect developers in Africa. Android is the dominant smartphone OS on the continent and entry-level devices, which make up the bulk of the market, are more likely to enact aggressive battery optimization.

当然,此类限制对非洲开发商的影响尤其严重,也就不足为奇了。 Android是非洲大陆上占主导地位的智能手机OS,而占据市场大部分的入门级设备则更有可能实施积极的电池优化。

白名单是新的预安装🏷️ (Whitelisting is the new Pre-installing 🏷️)

Chances are if you bought a brand new Tecno (the most popular phone brand in Africa) today, it would come pre-installed with WhatsApp, Facebook and a handful of other apps.

如果您今天购买了全新的Tecno( 非洲最受欢迎的电话品牌 ),则可能会预装WhatsApp,Facebook和少数其他应用程序。

For years, Android OEMs have shipped devices with a bunch of pre-installed apps that cannot be removed. The process through which a third-party app gets pre-installed is largely opaque and has been a privilege enjoyed by only a handful of “special” apps.

多年来,Android OEM厂商已在设备中附带了许多无法删除的预安装应用程序。 第三方应用程序的预安装过程在很大程度上是不透明的,并且只有少数“特殊”应用程序享有这种特权。

The approach OEMs have taken to maximize battery life is giving rise to a new even more perturbing kind of privilege: whitelisting.

OEM采取的最大限度地延长电池寿命的方法正在产生一种新的,更令人困扰的特权: 白名单

Image for post

Many OEMs maintain a small list of apps that are allowed to run unrestricted by default. All other apps are restricted unless the user explicitly adds them to this list.

许多OEM维护的应用程序列表很小,默认情况下允许其不受限制地运行。 除非用户明确将所有其他应用添加到此列表,否则所有其他应用均受限制。

The above tweet from VLC illustrates the frustration this is causing developers. Whereas pre-installing mostly gave apps a distributional advantage, whitelisting gives them a functional one. The functionality of an app is its very essence. Thus, restricting the capabilities available to non-whitelisted apps effectively handicaps them.

上面来自VLC的推文说明了这使开发人员感到沮丧。 预安装主要为应用程序带来了分配优势,而白名单则为它们提供了功能。 应用程序的功能是其本质。 因此,限制非白名单应用程序可用的功能会阻碍它们。

Here’s one developer’s comment on an issue reporting this problem on the Android Issue Tracker:

这是一个开发人员针对在Android Issue Tracker上报告此问题的问题评论

I have an app with over 500K+ downloads on play store. I use a notification listener service, which is available in the android framework, and tested on almost all major manufacturer devices.

我在Play商店中有一个下载量超过50万的应用程序。 我使用了android框架中可用的通知侦听器服务,并在几乎所有主要制造商的设备上进行了测试。

The users drop a poor rating because these stupid OEMs aggressively kills the services in background (even though the service is extremely lightweight). I frequently receive so many feedbacks mentioning that the app is not working on their phone, and when I ask them about the manufacturer, it is always the ones mentioned below.

用户之所以打败他们,是因为这些愚蠢的OEM主动在后台终止了该服务(即使该服务非常轻巧)。 我经常收到很多反馈,提到该应用程序无法在他们的手机上运行,​​当我向他们询问制造商时,总是下面提到的。

Image for post
A Tecno B1P showing whitelisted (not optimized) apps. This screen was 4 layers deep in Settings.
Tecno B1P显示列入白名单(未优化)的应用程序。 该屏幕在“设置”中深4层。

Unassuming users often blame developers for the degraded performance of their apps and leave negative reviews on Google Play. You can’t blame them though: OEMs go to great lengths to hide the settings to whitelist new apps and only tech-savvy users can find them. What’s more, many users are not even aware that apps are competing on non-level playing field.

谦虚的用户经常将应用程序性能下降归咎于开发人员,并在Google Play上留下负面评价。 但是,您不能责怪他们:OEM竭尽全力隐藏设置以将新应用列入白名单,只有精通技术的用户才能找到它们。 而且,许多用户甚至都不知道应用程序正在非公平竞争中竞争。

Image for post
Photo Credit: Tony Greenstein
图片来源:Tony Greenstein

If this reminds you of the famous commandment from George Orwell’s Animal Farm, it should. Who knew that even things as intangible as binaries of compiled code could be more equal than others!

如果这使您想起乔治·奥威尔(George Orwell)的动物农场的著名诫命,那就应该了。 谁知道,即使像编译代码的二进制文件一样无形的东西也可能比其他东西更平等!

违约的力量🔦 (The Power of Defaults 🔦)

It’s a bit of a truism in tech that users are “dumb.” As a result, many products prescribe “sensible” defaults for their users, so as not to burden them with too many steps.

用户“愚蠢”,这在技术上有些不言而喻。 结果,许多产品为用户规定了“明智的”默认设置,以免给他们增加太多的负担。

The problem with defaults, of course, is that they end becoming something of a self-fulfilling prophecy. Making an option the default among a set of choices increases the likelihood that it is chosen.

当然,违约的问题在于它们最终会变成一种自我实现的预言。 将选项设为一组选项中的默认选项会增加选择该选项的可能性。

Instead of making real hardware improvements, OEMs are exploiting this flaw in human psychology to squeeze out more battery life at the expense of their customers and third-party developers.

OEM并未进行真正的硬件改进,而是利用人类心理上的此缺陷来延长电池寿命,而以牺牲客户和第三方开发人员为代价。

Some may argue that restricting newly installed apps is a sensible default since it protects users from malicious and poorly optimized apps that might hog their battery.

有人可能会说,限制新安装的应用程序是明智的默认设置,因为它可以保护用户免受恶意和优化效果不佳的应用程序的困扰,这些应用程序可能会消耗大量电量。

What this misses, however, is that such restrictions ultimately violate the principle of least astonishment. A user who downloads an alarm app and sets up an alarm expects it to go off at the set time. Similarly, one who installs a messaging app expects to be notified when there’s a new message.

然而,这遗漏的是,这样的限制最终违反了最小惊讶原则 。 下载警报应用程序并设置警报的用户希望它在设置的时间关闭。 同样,安装消息传递应用程序的人希望在收到新消息时收到通知。

Such a user has already shown sufficient intent that they are interested in using the functionality of the app they just installed and shouldn’t have to go through additional hoops to get the app to work as intended.

这样的用户已经显示出足够的意图,表明他们有兴趣使用刚安装的应用程序的功能,因此不必为了使应用程序按预期工作而经历额外的麻烦。

What’s more, some of the modifications OEMs make in their android forks go against the Android Compatibility Definition Document (CDD) requirements and break core APIs.

此外,OEM在其Android分支中进行的某些修改违反了Android兼容性定义文档(CDD)的要求,并破坏了核心API。

At NALA, we’ve had first-hand experience of the frustrations caused by such OEM modifications. The number 1 complaint we hear from some of our users is that the app keeps asking them to grant it the accessibility permission.

在NALA,我们有亲身经历过OEM修改引起的挫败感。 我们从一些用户那里收到的第一抱怨是该应用程序一直在要求他们授予其可访问性权限。

NALA is a mobile money application that brings together your financial accounts and helps you make transactions through your existing mobile money services all from one application. We enable people to make payments ‘offline’ and this is done through us automating USSD in the background of the users phones without needing a data connection.

NALA是一款移动货币应用程序,可将您的财务帐户汇总在一起,并帮助您通过一个应用程序通过现有的移动货币服务进行交易。 我们使人们可以“离线”进行付款,这是通过在用户电话的后台自动进行USSD来完成的,而无需数据连接。

Image for post

In order to interact with USSD on behalf of the user, NALA requires permission to run an accessibility service and this is typically requested the first time a user installs the app.

为了代表用户与USSD进行交互,NALA需要获得运行无障碍服务的许可,并且通常是在用户首次安装该应用时提出的。

However, on some devices (some models of Tecno, Itel, Infinix, Huawei, and Xiaomi), this permission is revoked whenever a user closes the app.

但是,在某些设备上(某些型号的Tecno,Itel,Infinix,Huawei和Xiaomi),只要用户关闭应用程序,此权限就会被撤销。

When we dug deeper to understand this behaviour, we were stunned to find out why: on some devices, when a user swipes an app away from the recent apps list, the app is force-stopped instead of just killing the app process.

当我们更深入地了解这种行为时,我们惊奇地发现了原因:在某些设备上,当用户从最近的应用程序列表中滑动某个应用程序时,该应用程序将被强制停止,而不仅仅是终止应用程序进程。

Whereas there’s no difference, in the eyes of the user, between the two states, the OS handles them very differently. “Force stop” does not only kill the processes of the app but also moves it into the stopped state, where nothing in the app will run again until a user manually starts the app again.

在用户看来,这两种状态之间没有区别,但操作系统对它们的处理方式却大不相同。 “强制停止”不仅会终止应用程序的进程,而且会将其移至已停止状态 ,在该状态下 ,应用程序中的任何内容都不会再次运行,直到用户再次手动启动该应用程序为止。

In practice, this means that such an app won’t be able to run any background processing or receive push notifications. Moreover, for security reasons, Android disables all accessibility services for an app that is force-stopped.

实际上,这意味着这样的应用程序将无法运行任何后台处理或接收推送通知。 此外,出于安全原因,Android会为强制停止的应用程序禁用所有辅助功能服务。

This effectively means that NALA users on such devices are asked to grant the app the accessibility permission every time they open the app. As you might imagine, this drives many of our users nuts and some never use the app again.

这实际上意味着,此类设备上的NALA用户每次打开应用程序时都被要求授予该应用程序可访问性权限。 就像您想象的那样,这使我们许多用户感到疯狂,有些人再也不会使用该应用程序。

Few things are as annoying as a bug that you did not cause and more importantly, that you just cannot fix. The only “fix” we’ve found is asking users to lock the app in the recent list so it doesn’t get cleared but even that doesn’t work on all devices and is less than ideal user experience.

很少有事情像没有引起您的错误一样令人讨厌,更重要的是,您根本无法修复。 我们发现的唯一“解决方案”是要求用户将应用程序锁定在最近的列表中,这样就不会清除该应用程序,但即使该功能也不能在所有设备上正常运行,并且不够理想。

An API is a contract and it should be treated as such. It falls on Google to ensure that all APIs documented in the Android Developer docs work as expected on all supported devices. Constantly having to patch code to work on specific devices not only kills productivity but it is also unsustainable.

API是合同,应将其视为合同。 Google负责确保Android Developer文档中记录的所有API在所有受支持的设备上都能正常工作。 不断地必须修补代码才能在特定设备上工作不仅会降低生产力,而且也是不可持续的。

可疑的中立🔍 (Questionable Neutrality 🔍)

One of the idiosyncrasies of the smartphone industry is that building a great phone is not necessarily the best way to maximize profit. It is getting increasingly harder for OEMs to convince people to upgrade to the latest device yet the ones they already have are “good enough” for their needs.

智能手机行业的特质之一是,打造出色的手机并不一定是实现利润最大化的最佳方法。 OEM越来越难以说服人们升级到最新设备,而他们已经拥有的设备已经足够满足他们的需求。

Because of this reality, many OEMs are starting to offer additional services to complement their devices in order to counter-balance the inevitable slow down in revenues.

由于这一现实,许多OEM开始提供附加服务来补充其设备,以抵消不可避免的收入下降。

Take Transsion, the company behind smartphone brands like Tecno and Infinix for example. It launched Boomplay, a Spotify-style streaming service for African music in 2015, and recently led a $40M investment in PalmPay, an Africa-focused payments startup.

以Transsion为例,该公司是Tecno和Infinix等智能手机品牌背后的公司。 它于2015年推出了Spotify风格的流媒体服务Boomplay ,用于非洲音乐,最近还领导了针对非洲支付公司PalmPay的4,000万美元投资。

This, of course, raises questions about the neutrality of OEMs as the arbiter of who gets to be whitelisted and who does not. In Thomas Sowell’s words, “the most basic question is not what’s best but who shall decide what’s best”.

当然,这引起了关于OEM作为谁被列入白名单和谁未被列入白名单的仲裁者的中立性的质疑。 用托马斯·索威尔(Thomas Sowell)的话说,“ 最基本的问题不是什么是最好的,而是谁来决定什么是最好的 ”。

Android OEMs are free to build new apps and services to diversify their revenues but they cannot be referee and player at the same time.

Android OEM可以自由构建新的应用程序和服务以实现收入多元化,但不能同时担任裁判和球员。

Google视而不见💤 (Google Turns a Blind Eye 💤)

If OEMs are breaking core Android APIs and modifying the OS in ways that go against Android CDD requirements, how come Google allows them to ship such devices?

如果OEM破坏了核心的Android API并以违反Android CDD要求的方式修改了操作系统,那么Google为何允许他们装运此类设备?

Well, your guess is as good as mine. Whatever the reason, it is not for a lack of power. In the past, Google has not hesitated to assert its power over OEMs when it suited its interests; even with things as trivial as forcing them to display the “Powered by Android” logo on the startup screen.

好吧,你的猜测和我的一样好。 无论出于什么原因,这都不是因为缺乏动力。 过去,Google会在适合自己利益的情况下毫不犹豫地主张对OEM的控制权。 即使有些琐碎的事情(如迫使他们在启动屏幕上显示“由Android技术支持”徽标)

Then again, it is reasonable to question Google’s moral authority in this matter since it is also guilty of denying third-party developers access to APIs that some of its own apps use.

再说一次,在这个问题上质疑Google的道德权威是合理的,因为它也拒绝第三方开发人员访问其某些应用程序使用的API。

For a project whose stated goal is “to avoid any central point of failure in which one industry player can restrict or control the innovations of any other player”, Android has clearly lost its original ethos.

对于一个其明确目标是“避免一个行业参与者可以限制或控制任何其他参与者的创新的任何中心故障点”的项目,Android显然已经失去了其最初的精神。

When asked about the OEM modifications on Reddit 10 months ago, here’s what the Android engineering team had to say:

当被问及10个月前Reddit上的OEM修改 ,这是Android工程团队要说的:

We acknowledge the issue and take it very seriously. We have been actively working with device manufacturers to fix their implementations and seen some positive outcomes.

我们承认这个问题,并非常重视它。 我们一直在与设备制造商积极合作,以修复其实现问题,并取得了一些积极成果。

To help with the situation, we’ve added a CTS test in Android Q to ensure that an app is not killed upon being swiped from Recents. However, as you noted, device manufacturers have various implementations and it is extremely difficult to create an automated test to capture all wrong implementations that are against CDD requirements.

为了解决这种情况,我们在Android Q中添加了CTS测试,以确保应用程序从“最新消息”中清除后不会被杀死。 但是,正如您所指出的,设备制造商有多种实现方式,很难创建自动测试来捕获所有违反CDD要求的错误实现方式。

Though this is a step in the right direction, it doesn’t feel like Google is treating this matter with the urgency it deserves. For now, we can only hope and pray that Google will eventually assert its power to put an end to this bifurcation.

尽管这是朝着正确方向迈出的一步,但似乎Google并没有以应有的紧迫感对待这一问题。 就目前而言,我们只能希望并祈祷Google最终会断言终止这一分歧的力量。

As always, stay informed about all things NALA by following our social media channels; Twitter, Instagram, Facebook, LinkedIn, and YouTube. If you haven’t already, download or update your NALA app here.

与往常一样,通过关注我们的社交媒体渠道随时了解NALA的所有信息; TwitterInstagramFacebookLinkedInYouTube 。 如果尚未下载,请在此处下载或更新NALA应用程序。

If you have any feedback or questions, feel free to email us at: mamanala@nala.money.

如果您有任何反馈或疑问,请随时给我们发送电子邮件: mamanala@nala.money

翻译自: https://medium.com/nala-money/the-bifurcation-of-android-6fa1cced074d

kl分歧

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值