我有一台运行 Android 11 的 Oppo A53。当我在初始活动(登录页面)中设置断点时,一旦命中断点,应用程序将在不活动五秒后终止。在模拟设备或我的其他测试设备(同样运行 Android 11 的 Samsung Tab A)上不会出现此问题。此外,一旦应用程序启动另一个 Activity,我就可以无限期地停留在新 Activity 的断点上。
以下是应用程序清单的一部分,显示了登录活动的定义:
<activity
android:name=".LoginActivity"
android:theme="@style/SplashTheme"
android:screenOrientation="locked"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Run Code Online (Sandbox Code Playgroud)
这是 logcat 中的相关行:
2022-02-09 16:12:38.811 11786-11786/com.uomini.meecha D/OplusInputMethodUtil: init DEBUG to false, update DEBUG_IME to false
2022-02-09 16:12:39.381 11786-12103/com.uomini.meecha V/FA: Connection attempt already in progress
2022-02-09 16:12:44.018 11786-11800/com.uomini.meecha I/m.uomini.meech: Thread[2,tid=11800,WaitingInMainSignalCatcherLoop,Thread*=0xb4000079bc426000,peer=0x12ec0000,"Signal Catcher"]: reacting to signal 3
2022-02-09 16:12:44.018 11786-11800/com.uomini.meecha I/m.uomini.meech:
2022-02-09 16:12:44.190 11786-11800/com.uomini.meecha I/m.uomini.meech: Wrote stack traces to tombstoned
Run Code Online (Sandbox Code Playgroud)
我的其他应用程序上也发生同样的情况,所以我不认为这是应用程序问题,特别是因为它只发生在 Oppo 上。
我在Oppo mobile - Lollipop版本面临问题.我需要在我的应用中写入联系人权限.但在oppo棒棒糖中,它要求oppo自己的安全许可.如果我拒绝该权限而不是应用程序在打开该屏幕时崩溃.所以我想知道如何在Oppo Lollipop版本中查看此权限.在另一台设备和所有操作系统它工作正常但我在OPPO棒棒糖版本面临问题.
如果我们打开安全权限On就会发生这种情况.如果我们将其关闭而不是它将起作用.我想以编程方式请求权限,而不是进入设置
当从最近的oppo和vivo手机中移除我的应用程序时,后台服务停止,并且广播接收器在这种情况下也不起作用.
android background-service broadcastreceiver android-broadcast oppo
我的应用程序中有服务,该服务需要在设备OPPO的后台运行。我读过某个地方,我们需要在应用程序的设置中启用自动启动功能,以保持服务运行,但是我在权限上存在问题。
java.lang.SecurityException:权限拒绝:从ProcessRecord {904a19d 12604:elite.driver.adsmove.com.settingpermission / u0a214}(pid = 12604,uid = 10214)需要oppo.permission.OPPO_COMPONENT_SAFE
当我尝试这样做时
if (Build.MANUFACTURER.equals("OPPO")) {
Intent[] AUTO_START_OPPO = {
new Intent().setComponent(new ComponentName("com.coloros.safe", "com.coloros.safe.permission.startup.StartupAppListActivity")),
new Intent().setComponent(new ComponentName("com.coloros.safe", "com.coloros.safe.permission.startupapp.StartupAppListActivity")),
new Intent().setComponent(new ComponentName("com.coloros.safecenter", "com.coloros.safecenter.startupapp.StartupAppListActivity")),
new Intent().setComponent(new ComponentName("com.coloros.safecenter", "com.coloros.safecenter.startup.StartupAppListActivity"))
};
for (Intent intent : AUTO_START_OPPO) {
if (getPackageManager().resolveActivity(intent, PackageManager.MATCH_DEFAULT_ONLY) != null) {
try {
startActivity(intent);
break;
} catch (Exception e) {
Log.d(TAG, "OPPO - Exception: "+ e.toString());
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
我也尝试添加权限并请求它,但失败了
<!--for OPPO-->
<uses-permission android:name="oppo.permission.OPPO_COMPONENT_SAFE" />
Run Code Online (Sandbox Code Playgroud)
期待有经验的人提供帮助,谢谢!
我无法在 oppo 设备中打开意图。我已经在清单上放置了所需的权限,<uses-permission android:name="oppo.permission.OPPO_COMPONENT_SAFE"/>
但从来没有工作......总是显示相同的错误:
java.lang.SecurityException: Permission Denial: starting Intent { cmp=com.coloros.safecenter/.startupapp.StartupAppListActivity mCallingUid=10222 } from ProcessRecord{6f75382 3122:com.test.myapp.debug/u0a222} (pid=3122, uid=10222) requires oppo.permission.OPPO_COMPONENT_SAFE
Run Code Online (Sandbox Code Playgroud)
我已经尝试了所有这些意图:
new Intent().setComponent(new ComponentName("com.oppo.safe", "com.oppo.safe.permission.startup.StartupAppListActivity")),
new Intent().setComponent(new ComponentName("com.coloros.safecenter", "com.coloros.safecenter.permission.startup.StartupAppListActivity")),
new Intent().setComponent(new ComponentName("com.coloros.safecenter", "com.coloros.safecenter.permission.startupapp.StartupAppListActivity")),
new Intent().setComponent(new ComponentName("com.coloros.safecenter", "com.coloros.safecenter.permission.startupmanager.StartupAppListActivity")),
new Intent().setComponent(new ComponentName("com.coloros.safe", "com.coloros.safe.permission.startup.StartupAppListActivity")),
new Intent().setComponent(new ComponentName("com.coloros.safe", "com.coloros.safe.permission.startupapp.StartupAppListActivity")),
new Intent().setComponent(new ComponentName("com.coloros.safe", "com.coloros.safe.permission.startupmanager.StartupAppListActivity")),
new Intent().setComponent(new ComponentName("com.coloros.safecenter", "com.coloros.safecenter.permission.startsettings")),
new Intent().setComponent(new ComponentName("com.coloros.safecenter", "com.coloros.safecenter.permission.startupapp.startupmanager")),
new Intent().setComponent(new ComponentName("com.coloros.safecenter", "com.coloros.safecenter.permission.startupmanager.startupActivity")),
new Intent().setComponent(new ComponentName("com.coloros.safecenter", "com.coloros.safecenter.permission.startup.startupapp.startupmanager")),
new Intent().setComponent(new ComponentName("com.coloros.safecenter", "com.coloros.safecenter.startupapp.StartupAppListActivity")),
new Intent().setComponent(new ComponentName("com.coloros.safecenter", "com.coloros.safecenter.StartupAppListActivity")),
new Intent().setComponent(new ComponentName("com.coloros.safecenter", "com.coloros.privacypermissionsentry.PermissionTopActivity.Startupmanager")),
new …
Run Code Online (Sandbox Code Playgroud) android android-manifest android-permissions android-securityexception oppo
我一直在寻找有关中国手机(Oppo、华为、小米、Vivo 等)在向上滑动(关闭)应用程序时,后台服务停止运行时出现此问题的答案。
大多数解决方案是:
我的问题是像 Whatsapp 这样的应用程序如何仍然接收消息或通知甚至向上滑动?此外,1.和2.中提到的解决方案如果手机重新启动就不起作用,但是Whatsapp仍然可以接收消息?我已经测试过三星设备,即使应用程序被向上滑动,它们在运行后台服务时也没有问题。有没有人在中国手机上遇到同样的问题?
android ×6
oppo ×6
java ×2
debugging ×1
exception ×1
permissions ×1
security ×1
termination ×1