From ccca31529c07970e89419fb85a9e8153a5396838 Mon Sep 17 00:00:00 2001 From: Eric Erfanian Date: Wed, 22 Feb 2017 16:32:36 -0800 Subject: Update dialer sources. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Test: Built package and system image. This change clobbers the old source, and is an export from an internal Google repository. The internal repository was forked form Android in March, and this change includes modifications since then, to near the v8 release. Since the fork, we've moved code from monolithic to independent modules. In addition, we've switched to Blaze/Bazel as the build sysetm. This export, however, still uses make. New dependencies have been added: - Dagger - Auto-Value - Glide - Libshortcutbadger Going forward, development will still be in Google3, and the Gerrit release will become an automated export, with the next drop happening in ~ two weeks. Android.mk includes local modifications from ToT. Abridged changelog: Bug fixes ● Not able to mute, add a call when using Phone app in multiwindow mode ● Double tap on keypad triggering multiple key and tones ● Reported spam numbers not showing as spam in the call log ● Crash when user tries to block number while Phone app is not set as default ● Crash when user picks a number from search auto-complete list Visual Voicemail (VVM) improvements ● Share Voicemail audio via standard exporting mechanisms that support file attachment (email, MMS, etc.) ● Make phone number, email and web sites in VVM transcript clickable ● Set PIN before declining VVM Terms of Service {Carrier} ● Set client type for outbound visual voicemail SMS {Carrier} New incoming call and incall UI on older devices (Android M) ● Updated Phone app icon ● New incall UI (large buttons, button labels) ● New and animated Answer/Reject gestures Accessibility ● Add custom answer/decline call buttons on answer screen for touch exploration accessibility services ● Increase size of touch target ● Add verbal feedback when a Voicemail fails to load ● Fix pressing of Phone buttons while in a phone call using Switch Access ● Fix selecting and opening contacts in talkback mode ● Split focus for ‘Learn More’ link in caller id & spam to help distinguish similar text Other ● Backup & Restore for App Preferences ● Prompt user to enable Wi-Fi calling if the call ends due to out of service and Wi-Fi is connected ● Rename “Dialpad” to “Keypad” ● Show "Private number" for restricted calls ● Delete unused items (vcard, add contact, call history) from Phone menu Change-Id: I2a7e53532a24c21bf308bf0a6d178d7ddbca4958 --- .../android/dialer/calllog/CallLogActivity.java | 235 --------------------- 1 file changed, 235 deletions(-) delete mode 100644 src/com/android/dialer/calllog/CallLogActivity.java (limited to 'src/com/android/dialer/calllog/CallLogActivity.java') diff --git a/src/com/android/dialer/calllog/CallLogActivity.java b/src/com/android/dialer/calllog/CallLogActivity.java deleted file mode 100644 index 1823a5bd3..000000000 --- a/src/com/android/dialer/calllog/CallLogActivity.java +++ /dev/null @@ -1,235 +0,0 @@ -/* - * Copyright (C) 2013 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.android.dialer.calllog; - -import android.app.Activity; -import android.app.Fragment; -import android.app.FragmentManager; -import android.content.Intent; -import android.database.Cursor; -import android.os.Bundle; -import android.os.Handler; -import android.provider.CallLog; -import android.provider.CallLog.Calls; -import android.support.v13.app.FragmentPagerAdapter; -import android.support.v4.view.ViewPager; -import android.support.v7.app.ActionBar; -import android.view.Menu; -import android.view.MenuInflater; -import android.view.MenuItem; -import android.view.MotionEvent; -import android.view.ViewGroup; - -import com.android.contacts.common.interactions.TouchPointManager; -import com.android.contacts.common.list.ViewPagerTabs; -import com.android.contacts.common.util.PermissionsUtil; -import com.android.contacts.commonbind.analytics.AnalyticsUtil; -import com.android.dialer.DialtactsActivity; -import com.android.dialer.R; -import com.android.dialer.TransactionSafeActivity; -import com.android.dialer.logging.Logger; -import com.android.dialer.logging.ScreenEvent; -import com.android.dialer.util.DialerUtils; - -public class CallLogActivity extends TransactionSafeActivity implements ViewPager.OnPageChangeListener { - private ViewPager mViewPager; - private ViewPagerTabs mViewPagerTabs; - private ViewPagerAdapter mViewPagerAdapter; - private CallLogFragment mAllCallsFragment; - private CallLogFragment mMissedCallsFragment; - - private String[] mTabTitles; - - private static final int TAB_INDEX_ALL = 0; - private static final int TAB_INDEX_MISSED = 1; - - private static final int TAB_INDEX_COUNT = 2; - - private boolean mIsResumed; - - public class ViewPagerAdapter extends FragmentPagerAdapter { - public ViewPagerAdapter(FragmentManager fm) { - super(fm); - } - - @Override - public long getItemId(int position) { - return getRtlPosition(position); - } - - @Override - public Fragment getItem(int position) { - switch (getRtlPosition(position)) { - case TAB_INDEX_ALL: - return new CallLogFragment( - CallLogQueryHandler.CALL_TYPE_ALL, true /* isCallLogActivity */); - case TAB_INDEX_MISSED: - return new CallLogFragment(Calls.MISSED_TYPE, true /* isCallLogActivity */); - } - throw new IllegalStateException("No fragment at position " + position); - } - - @Override - public Object instantiateItem(ViewGroup container, int position) { - final CallLogFragment fragment = - (CallLogFragment) super.instantiateItem(container, position); - switch (position) { - case TAB_INDEX_ALL: - mAllCallsFragment = fragment; - break; - case TAB_INDEX_MISSED: - mMissedCallsFragment = fragment; - break; - } - return fragment; - } - - @Override - public CharSequence getPageTitle(int position) { - return mTabTitles[position]; - } - - @Override - public int getCount() { - return TAB_INDEX_COUNT; - } - } - - @Override - public boolean dispatchTouchEvent(MotionEvent ev) { - if (ev.getAction() == MotionEvent.ACTION_DOWN) { - TouchPointManager.getInstance().setPoint((int) ev.getRawX(), (int) ev.getRawY()); - } - return super.dispatchTouchEvent(ev); - } - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - setContentView(R.layout.call_log_activity); - getWindow().setBackgroundDrawable(null); - - final ActionBar actionBar = getSupportActionBar(); - actionBar.setDisplayShowHomeEnabled(true); - actionBar.setDisplayHomeAsUpEnabled(true); - actionBar.setDisplayShowTitleEnabled(true); - actionBar.setElevation(0); - - int startingTab = TAB_INDEX_ALL; - final Intent intent = getIntent(); - if (intent != null) { - final int callType = intent.getIntExtra(CallLog.Calls.EXTRA_CALL_TYPE_FILTER, -1); - if (callType == CallLog.Calls.MISSED_TYPE) { - startingTab = TAB_INDEX_MISSED; - } - } - - mTabTitles = new String[TAB_INDEX_COUNT]; - mTabTitles[0] = getString(R.string.call_log_all_title); - mTabTitles[1] = getString(R.string.call_log_missed_title); - - mViewPager = (ViewPager) findViewById(R.id.call_log_pager); - - mViewPagerAdapter = new ViewPagerAdapter(getFragmentManager()); - mViewPager.setAdapter(mViewPagerAdapter); - mViewPager.setOffscreenPageLimit(1); - mViewPager.setOnPageChangeListener(this); - - mViewPagerTabs = (ViewPagerTabs) findViewById(R.id.viewpager_header); - - mViewPagerTabs.setViewPager(mViewPager); - mViewPager.setCurrentItem(startingTab); - } - - @Override - protected void onResume() { - mIsResumed = true; - super.onResume(); - sendScreenViewForChildFragment(mViewPager.getCurrentItem()); - } - - @Override - protected void onPause() { - mIsResumed = false; - super.onPause(); - } - - @Override - public boolean onCreateOptionsMenu(Menu menu) { - final MenuInflater inflater = getMenuInflater(); - inflater.inflate(R.menu.call_log_options, menu); - return true; - } - - @Override - public boolean onPrepareOptionsMenu(Menu menu) { - final MenuItem itemDeleteAll = menu.findItem(R.id.delete_all); - if (mAllCallsFragment != null && itemDeleteAll != null) { - // If onPrepareOptionsMenu is called before fragments are loaded, don't do anything. - final CallLogAdapter adapter = mAllCallsFragment.getAdapter(); - itemDeleteAll.setVisible(adapter != null && !adapter.isEmpty()); - } - return true; - } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - if (!isSafeToCommitTransactions()) { - return true; - } - - if (item.getItemId() == android.R.id.home) { - final Intent intent = new Intent(this, DialtactsActivity.class); - intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); - startActivity(intent); - return true; - } else if (item.getItemId() == R.id.delete_all) { - ClearCallLogDialog.show(getFragmentManager()); - return true; - } - return super.onOptionsItemSelected(item); - } - - @Override - public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { - mViewPagerTabs.onPageScrolled(position, positionOffset, positionOffsetPixels); - } - - @Override - public void onPageSelected(int position) { - if (mIsResumed) { - sendScreenViewForChildFragment(position); - } - mViewPagerTabs.onPageSelected(position); - } - - @Override - public void onPageScrollStateChanged(int state) { - mViewPagerTabs.onPageScrollStateChanged(state); - } - - private void sendScreenViewForChildFragment(int position) { - Logger.logScreenView(ScreenEvent.CALL_LOG_FILTER, this); - } - - private int getRtlPosition(int position) { - if (DialerUtils.isRtl()) { - return mViewPagerAdapter.getCount() - 1 - position; - } - return position; - } -} -- cgit v1.2.3