top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Android: motion sensor is under monitor during doze.

+1 vote
249 views

Did anyone has a study on DOZE in Android M? I just noticed that significant motion sensor is under monitor during doze. Does this mean that if I put my phone in car or train and take this vehicle for whole day long, then it would not get any chance to enter DOZE even if I do nothing?

If this is true, anybody can explain why Google has defined it like this?

posted Feb 23, 2016 by anonymous

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button LinkedIn Share Button

Similar Questions
+1 vote

The default setup wizard setting is using the back fingerprint sensor, how to change it to the front one in Setup Wizard?

+1 vote

Is it possible to use an andriod tablet as a second monitor? I'm running Fedora 21 on a Dell Precision Workstation 3800.

+2 votes

I have Micromax Unite 4 Pro Q465, and using in India. upgraded to 5.1
I cant see Enhanced 4G LTE mode under the Cellular Networks.
I already checked "*#4636#*#*, its showing already ON (Turn off Volte provisioned flag)

What can I do to enable Enhanced 4G?

0 votes

I have applied the pagination as per the below code but the new data is not added to the Recyclerview. it loading previous data again and again. In this, I have applied the filter in the recycler view to filter the list according to the category. But I am unable to apply the pagination to the filterable recyclerview. Please assist.

I am using Firestore database in Android Application. If any more information is required, Please let me know

CODE

public void onFilter(Filters filters) {
        // Construct query basic query
        Query query = mFirestore.collection("posts").orderBy("timestamp", Query.Direction.DESCENDING);

        // Category (equality filter)
        if (filters.hasCategory()) {
            query = query.whereEqualTo("postcategory", filters.getCategory());
        }


        // Limit items
        query = query.limit(5);


        Query finalQuery = query;
        finalQuery.get().addOnCompleteListener(new OnCompleteListener<QuerySnapshot>() {
            @Override
            public void onComplete(@NonNull Task<QuerySnapshot> task) {
                if (task.isSuccessful()) {
                    for (DocumentSnapshot document : task.getResult()) {
                        PostsModel productModel = document.toObject(PostsModel.class);

                        mQuery = finalQuery;

                        adapter.setQuery(mQuery);
                       // list.add(productModel);
                    }

                    adapter.notifyDataSetChanged();
                    lastVisible = task.getResult().getDocuments().get(task.getResult().size() - 1);

                    RecyclerView.OnScrollListener onScrollListener = new RecyclerView.OnScrollListener() {
                        @Override
                        public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
                            super.onScrollStateChanged(recyclerView, newState);
                            if (newState == AbsListView.OnScrollListener.SCROLL_STATE_TOUCH_SCROLL) {
                                isScrolling = true;
                            }
                        }

                        @Override
                        public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
                            super.onScrolled(recyclerView, dx, dy);

                            LinearLayoutManager linearLayoutManager = ((LinearLayoutManager) recyclerView.getLayoutManager());
                            int firstVisibleItemPosition = linearLayoutManager.findFirstVisibleItemPosition();
                            int visibleItemCount = linearLayoutManager.getChildCount();
                            int totalItemCount = linearLayoutManager.getItemCount();

                            if (isScrolling && (firstVisibleItemPosition + visibleItemCount == totalItemCount) && !isLastItemReached) {
                                isScrolling = false;
                                Query nextQuery = PostsRef.orderBy("timestamp", Query.Direction.DESCENDING).startAfter(lastVisible).limit(5);
                                nextQuery.get().addOnCompleteListener(new OnCompleteListener<QuerySnapshot>() {
                                    @Override
                                    public void onComplete(@NonNull Task<QuerySnapshot> t) {
                                        if (t.isSuccessful()) {
                                            for (DocumentSnapshot d : t.getResult()) {
                                                PostsModel productModel = d.toObject(PostsModel.class);

                                                mQuery = finalQuery;

                                                adapter.setQuery(mQuery);
                                               // list.add(productModel);
                                            }
                                            adapter.notifyDataSetChanged();
                                            lastVisible = t.getResult().getDocuments().get(t.getResult().size() - 1);

                                            if (t.getResult().size() < 5) {
                                                isLastItemReached = true;
                                            }
                                        }
                                    }
                                });
                            }
                        }
                    };

                    recyclerView.addOnScrollListener(onScrollListener);
                }
            }
        });


        // Update the query


        // Set header
        mCurrentSearchView.setText(Html.fromHtml(filters.getSearchDescription(getActivity().getApplicationContext())));

        // Save filters
        mViewModel.setFilters(filters);
    }
...