android-6.0-marshmallow

SecurityException: not allowed to perform OP_READ_PHONE_STATE

霸气de小男生 提交于 2019-12-04 15:53:46
问题 User is reporting my app crashes with this error trace java.lang.SecurityException: com.android.phone from uid 10134 not allowed to perform OP_READ_PHONE_STATE at android.os.Parcel.readException(Parcel.java:1620) at android.os.Parcel.readException(Parcel.java:1573) at com.android.internal.telephony.IPhoneSubInfo$Stub$Proxy.getVoiceMailNumberForSubscriber(IPhoneSubInfo.java:858) at android.telephony.TelephonyManager.getVoiceMailNumber(TelephonyManager.java:2383) at android.telephony

Some Permissions' protectionLevel seems wrongly documented or implemented

风流意气都作罢 提交于 2019-12-04 15:49:03
I'm running through many permissions tagged PROTECTION_NORMAL and PROTECTION_DANGEROUS in a ListView . Upon click my application calls ActivityCompat.requestPermission() . All permissions I tested (by that I mean all normal and dangerous permissions for API-7 and above I could find ) are working fine on my Emulator, except for some: CHANGE_NETWORK_STATE Requesting CHANGE_NETWORK_STATE always returns PackageManager.PERMISSION_DENIED (without even prompting). I would expect it granted by default since it's flagged normal , or if the documentation is wrong, to be prompted for it then. GET

Can not switch to Doze mode

▼魔方 西西 提交于 2019-12-04 15:36:05
问题 I am following instructions on this android page to switch android to doz mode to test my app, I have used a real device as well as emulator. But in both cases when I give the second command once or several times, which is adb shell dympsys deviceidle step it only says Stepped: ACTIVE Before giving the commands I turned off/locked the device as well but no use. I wanted how my app behaves in doze mode but nothing seems to work, I also tried adb shell dumpsys deviceidle force-idle but this

Android M email completition

十年热恋 提交于 2019-12-04 14:11:50
as you know the permission system on Android M has been updated. I currently use the permission GET_ACCOUNTS to autocomplete the user email when he sign in/sign up on my app. final ArrayList<String> emails = new ArrayList<String>(); for (Account account : AccountManager.get(this).getAccounts()) { emails.add(account.name); } email.setAdapter(new ArrayAdapter<>(this, android.R.layout.simple_dropdown_item_1line, emails)); The problem is that on Android M, to continue to use this feature, I'll need to ask the user for the permission to read his accounts. That doesn't make sense because to save the

Using ACTION_CAPTIVE_PORTAL_SIGN_IN

[亡魂溺海] 提交于 2019-12-04 12:17:40
问题 The Android M supports a new ACTION_CAPTIVE_PORTAL_SIGN_IN. Is there any sample available on how to capture this action. I tried with the normal way of registering for an action in both through the activity and through the broadcast receiver. However when I am connected with the captive portal wifi network, I am not receiving the actions. Someone please help 回答1: It can be used to allow your app to perform captive portal Wi-Fi sign in. Assuming you have something like this in your manifest:

Android M listening to android.os.action.DEVICE_IDLE_MODE_CHANGED

╄→гoц情女王★ 提交于 2019-12-04 11:51:39
问题 Can a third party application get an action once the device goes in to Doze mode? Trying to register Broadcast receiver for below action, <receiver android:name="com.doze.sample.DozemodeReceiver" android:enabled="true"> <intent-filter> <action android:name=" android.os.action.DEVICE_IDLE_MODE_CHANGED" /> </intent-filter> </receiver> It's not working (the receiver is not being called). 回答1: To confirm what was mentioned in the comments, defining the android.os.action.DEVICE_IDLE_MODE_CHANGED

Application (WiFi connections) doesn't work anymore on Android 6.0 Marshmallow

落爺英雄遲暮 提交于 2019-12-04 11:22:27
My application stopped working once I upgraded to Marshmallow, it was supposed to be able to change the WiFi connection, but now it doesn't do anything at all. I've spent some time reading about the new permission model of the Android 6.0. Well awesome, but old apps should continue working... Anyway, I started trying to implement the granting of permission, but realized that this is a normal permission and there should be done no permission request for it if it's defined in android manifest: <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" /> The permission has always been

How Do I determine which app is causing the “Screen Overlay Detected” error?

一曲冷凌霜 提交于 2019-12-04 10:35:53
Let me preface this with I have already read through Android "Screen Overlay Detected" message if user is trying to grant a permission when a notification is showing and I understand exactly what the overlay problem is. I also understand how to request it as well as how to check if my current running app has permission to draw on overlays (!Settings.canDrawOverlays(this)). I was getting scolded for my app because every time a permission request would popup, the overlays popup would be shown and even though users gave permission for my application to draw overlays, they could never get past the

Is it possible to create a custom floating text selection menu in Android versions pre Marshmallow?

☆樱花仙子☆ 提交于 2019-12-04 10:05:12
I'm looking to create a custom menu for text selection. I know it's possible to edit the behaviour of the action bar with setCustomSelectionActionModeCallback, but in my case I don't want that action bar to show at all, I want my own floating custom menu which I have already achieved. Only thing is that there is no way to not show the action bar menu after selecting the text in the TextView. The behaviour I need is not the standard cut/copy/paste, the actions I have implemented are for highlighting and saving the highlighted section of text to a database. I have done some tinkering and the

CollapsingToolBarLayout - status bar scrim color doesn't change

北城余情 提交于 2019-12-04 09:57:58
问题 I updated my android studio few days ago and started working with the CoordinatorLayout and CollapsingToolbarLayout just trying stuff. It seems that the Toolbar scrim colour override the status bar initial colour and the status bar scrim colour (tried both from xml and code) initial state: started scrolling: scrolled until collapsing: So the questions are: How can I prevent the toolbar to override the status bar when collapsing (not even letting the image I'm collapsing to go above it). How